hexsha stringlengths 40 40 | size int64 7 1.05M | ext stringclasses 13
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 269 | max_stars_repo_name stringlengths 5 109 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 9 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 269 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 9 | max_issues_count int64 1 48.5k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 269 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 9 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 7 1.05M | avg_line_length float64 1.21 330k | max_line_length int64 6 990k | alphanum_fraction float64 0.01 0.99 | author_id stringlengths 2 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2f7ef1f441876287343b826032049464bc03c426 | 2,178 | hpp | C++ | networking/ArpPacketBase.hpp | leighgarbs/toolbox | fd9ceada534916fa8987cfcb5220cece2188b304 | [
"MIT"
] | null | null | null | networking/ArpPacketBase.hpp | leighgarbs/toolbox | fd9ceada534916fa8987cfcb5220cece2188b304 | [
"MIT"
] | null | null | null | networking/ArpPacketBase.hpp | leighgarbs/toolbox | fd9ceada534916fa8987cfcb5220cece2188b304 | [
"MIT"
] | null | null | null | #if !defined ARP_PACKET_BASE_HPP
#define ARP_PACKET_BASE_HPP
#include <cstdint>
#include "DataPacket.hpp"
#include "SimpleDataField.hpp"
class ArpPacketBase : public DataPacket
{
public:
// Initializes everything to 0
ArpPacketBase();
// Initializes everything to the given values
ArpPacketBase(std::uint16_t htype,
std::uint16_t ptype,
std::uint8_t hlen,
std::uint8_t plen,
std::uint16_t oper);
virtual ~ArpPacketBase();
// Accessors
std::uint16_t getHType() const;
std::uint16_t getPType() const;
std::uint8_t getHLen() const;
std::uint8_t getPLen() const;
std::uint16_t getOper() const;
// Mutators
void setHType(std::uint16_t htype);
void setPType(std::uint16_t ptype);
void setHLen(std::uint8_t hlen);
void setPLen(std::uint8_t plen);
void setOper(std::uint16_t oper);
protected:
SimpleDataField<std::uint16_t> htype;
SimpleDataField<std::uint16_t> ptype;
SimpleDataField<std::uint8_t> hlen;
SimpleDataField<std::uint8_t> plen;
SimpleDataField<std::uint16_t> oper;
private:
// Disallow these for now; maybe these could be meaningfully implemented but
// we'll save that for later
ArpPacketBase(const ArpPacketBase&);
ArpPacketBase& operator=(const ArpPacketBase&);
};
inline std::uint16_t ArpPacketBase::getHType() const
{
return htype;
}
inline std::uint16_t ArpPacketBase::getPType() const
{
return ptype;
}
inline std::uint8_t ArpPacketBase::getHLen() const
{
return hlen;
}
inline std::uint8_t ArpPacketBase::getPLen() const
{
return plen;
}
inline std::uint16_t ArpPacketBase::getOper() const
{
return oper;
}
inline void ArpPacketBase::setHType(std::uint16_t htype)
{
this->htype = htype;
}
inline void ArpPacketBase::setPType(std::uint16_t ptype)
{
this->ptype = ptype;
}
inline void ArpPacketBase::setHLen(std::uint8_t hlen)
{
this->hlen = hlen;
}
inline void ArpPacketBase::setPLen(std::uint8_t plen)
{
this->plen = plen;
}
inline void ArpPacketBase::setOper(std::uint16_t oper)
{
this->oper = oper;
}
#endif
| 19.621622 | 80 | 0.676768 | leighgarbs |
2f8442d410c5e9a22cfa3f56c9b35709cc31ff1a | 816 | cpp | C++ | AtCoder/AGC013/C/code.cpp | sjj118/OI-Code | 964ea6e799d14010f305c7e4aee269d860a781f7 | [
"MIT"
] | null | null | null | AtCoder/AGC013/C/code.cpp | sjj118/OI-Code | 964ea6e799d14010f305c7e4aee269d860a781f7 | [
"MIT"
] | null | null | null | AtCoder/AGC013/C/code.cpp | sjj118/OI-Code | 964ea6e799d14010f305c7e4aee269d860a781f7 | [
"MIT"
] | null | null | null | #include<cstdio>
#include<algorithm>
#define rep(i,x,y) for(int i=(x);i<=(y);++i)
#define per(i,x,y) for(int i=(x);i>=(y);--i)
typedef long long LL;
const int N=4e5+10;
LL n,l,t,x[N],w[N],a[N],b[N],ca,cb,ans[N];
int main(){
scanf("%lld%lld%lld",&n,&l,&t);
rep(i,1,n)scanf("%lld%lld",&x[i],&w[i]);
LL tmp=t/l;
t%=l;
rep(i,1,n)if(w[i]==1)a[++ca]=x[i];else b[++cb]=x[i];
rep(i,1,ca)a[ca+i]=a[i]+l,a[ca*2+i]=a[i]+2*l;
rep(i,1,cb)b[cb+i]=b[i]+l,b[cb*2+i]=b[i]+2*l;
rep(i,1,n){
if(w[i]==1){
ans[(i+(LL)2*tmp*cb%n+std::upper_bound(b+1,b+1+cb*3,x[i]+2*t)-std::lower_bound(b+1,b+1+cb*3,x[i])-1)%n+1]=(x[i]+t)%l;
}else{
ans[(i+n-(LL)2*tmp*ca%n+n+std::lower_bound(a+1,a+1+ca*3,x[i]+2*l-2*t)-std::upper_bound(a+1,a+1+ca*3,x[i]+2*l)-1)%n+1]=(x[i]-t+l)%l;
}
}
rep(i,1,n)printf("%lld\n",ans[i]);
return 0;
}
| 31.384615 | 134 | 0.535539 | sjj118 |
2f8b54c6eb734f9780b509a256efbb4fcea872a8 | 2,113 | cpp | C++ | simple-paint-sdl2/simple-paint-sdl2/simple-paint-sdl2/modules/editor/editor_event.cpp | i582/simple-paint-sdl2 | 3fc4eac68b6cfac949d42d6ea25a38e8fd206b7c | [
"MIT"
] | null | null | null | simple-paint-sdl2/simple-paint-sdl2/simple-paint-sdl2/modules/editor/editor_event.cpp | i582/simple-paint-sdl2 | 3fc4eac68b6cfac949d42d6ea25a38e8fd206b7c | [
"MIT"
] | null | null | null | simple-paint-sdl2/simple-paint-sdl2/simple-paint-sdl2/modules/editor/editor_event.cpp | i582/simple-paint-sdl2 | 3fc4eac68b6cfac949d42d6ea25a38e8fd206b7c | [
"MIT"
] | null | null | null | #include "editor.h"
void Editor::onEvent()
{
while (running && SDL_WaitEvent(&e))
{
switch (e.window.windowID)
{
case WINDOW_NEW_DOCUMENT:
{
switch (e.type)
{
case SDL_MOUSEMOTION:
{
new_document->mouseMotion(&e);
break;
}
case SDL_MOUSEBUTTONDOWN:
{
new_document->mouseButtonDown(&e);
break;
}
case SDL_MOUSEBUTTONUP:
{
new_document->mouseButtonUp(&e);
break;
}
case SDL_MOUSEWHEEL:
{
new_document->mouseWheel(&e);
break;
}
case SDL_KEYDOWN:
{
new_document->keyDown(&e);
break;
}
case SDL_KEYUP:
{
new_document->keyUp(&e);
break;
}
case SDL_TEXTINPUT:
{
new_document->textInput(&e);
break;
}
case SDL_QUIT:
{
new_document->close();
break;
}
}
break;
}
case WINDOW_MAIN:
{
switch (e.type)
{
case SDL_MOUSEMOTION:
{
main_window->mouseMotion(&e);
break;
}
case SDL_MOUSEBUTTONDOWN:
{
main_window->mouseButtonDown(&e);
break;
}
case SDL_MOUSEBUTTONUP:
{
main_window->mouseButtonUp(&e);
break;
}
case SDL_MOUSEWHEEL:
{
main_window->mouseWheel(&e);
break;
}
case SDL_KEYDOWN:
{
main_window->keyDown(&e);
break;
}
case SDL_KEYUP:
{
main_window->keyUp(&e);
break;
}
case SDL_TEXTINPUT:
{
main_window->textInput(&e);
break;
}
case SDL_QUIT:
{
quit();
break;
}
case SDL_WINDOWEVENT:
{
switch (e.window.event)
{
case SDL_WINDOWEVENT_ENTER:
{
break;
}
case SDL_WINDOWEVENT_RESIZED:
{
//main_window->render();
cout << "SDL_WINDOWEVENT_RESIZED" << endl;
break;
}
case SDL_WINDOWEVENT_SIZE_CHANGED:
{
cout << "SDL_WINDOWEVENT_SIZE_CHANGED" << endl;
//main_window->set_size(e.window.data1, e.window.data2);
//main_window->resized();
break;
}
default:break;
}
break;
}
default:break;
}
break;
}
default:
break;
}
sendHandleUserEvent();
}
}
| 11.804469 | 61 | 0.558921 | i582 |
2f999dde5f075b94ddcf1aac8dac60ffd4d39952 | 1,526 | cpp | C++ | Source/Services/TitleStorage/WinRT/TitleStorageBlobResult_WinRT.cpp | blgrossMS/xbox-live-api | 17c586336e11f0fa3a2a3f3acd665b18c5487b24 | [
"MIT"
] | 2 | 2021-07-17T13:34:20.000Z | 2022-01-09T00:55:51.000Z | Source/Services/TitleStorage/WinRT/TitleStorageBlobResult_WinRT.cpp | blgrossMS/xbox-live-api | 17c586336e11f0fa3a2a3f3acd665b18c5487b24 | [
"MIT"
] | null | null | null | Source/Services/TitleStorage/WinRT/TitleStorageBlobResult_WinRT.cpp | blgrossMS/xbox-live-api | 17c586336e11f0fa3a2a3f3acd665b18c5487b24 | [
"MIT"
] | 1 | 2018-11-18T08:32:40.000Z | 2018-11-18T08:32:40.000Z | //*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#include "pch.h"
#include "TitleStorageBlobResult_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TITLE_STORAGE_BEGIN
TitleStorageBlobResult::TitleStorageBlobResult(
_In_ xbox::services::title_storage::title_storage_blob_result cppObj
) :
m_cppObj(std::move(cppObj))
{
auto nativeBlobBuffer = m_cppObj.blob_buffer();
auto writer = ref new Windows::Storage::Streams::DataWriter();
auto nativeBlobBufferSize = nativeBlobBuffer->size();
if(nativeBlobBufferSize <= UINT32_MAX)
{
writer->WriteBytes(Platform::ArrayReference<unsigned char>(&(nativeBlobBuffer->at(0)), static_cast<uint32>(nativeBlobBufferSize)));
}
else
{
throw ref new Platform::OutOfBoundsException(L"Stream size is too large");
}
m_blobBuffer = writer->DetachBuffer();
m_blobMetadata = ref new TitleStorageBlobMetadata(m_cppObj.blob_metadata());
}
Windows::Storage::Streams::IBuffer^
TitleStorageBlobResult::BlobBuffer::get()
{
return m_blobBuffer;
}
TitleStorageBlobMetadata^
TitleStorageBlobResult::BlobMetadata::get()
{
return m_blobMetadata;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TITLE_STORAGE_END | 31.142857 | 139 | 0.694626 | blgrossMS |
2fa187d5ad28cb96e88932220266065eb6bbe7d3 | 2,058 | cpp | C++ | src/ui95_ext/cbeye.cpp | Terebinth/freefalcon-central | c28d807183ab447ef6a801068aa3769527d55deb | [
"BSD-2-Clause"
] | 117 | 2015-01-13T14:48:49.000Z | 2022-03-16T01:38:19.000Z | src/ui95_ext/cbeye.cpp | darongE/freefalcon-central | c28d807183ab447ef6a801068aa3769527d55deb | [
"BSD-2-Clause"
] | 4 | 2015-05-01T13:09:53.000Z | 2017-07-22T09:11:06.000Z | src/ui95_ext/cbeye.cpp | darongE/freefalcon-central | c28d807183ab447ef6a801068aa3769527d55deb | [
"BSD-2-Clause"
] | 78 | 2015-01-13T09:27:47.000Z | 2022-03-18T14:39:09.000Z | #include "stdafx.h"
#include "campaign/include/team.h"
#include "campaign/include/package.h"
#include "ui/include/filters.h"
C_BullsEye::C_BullsEye() : C_Base()
{
_SetCType_(_CNTL_BULLSEYE_);
Color_ = 0;
Scale_ = 1.0f;
DefaultFlags_ = C_BIT_ENABLED;
WorldX_ = WorldY_ = 0;
}
C_BullsEye::C_BullsEye(char **stream) : C_Base(stream)
{
}
C_BullsEye::C_BullsEye(FILE *fp) : C_Base(fp)
{
}
C_BullsEye::~C_BullsEye()
{
}
long C_BullsEye::Size()
{
return(0);
}
void C_BullsEye::Setup(long ID, short Type)
{
SetID(ID);
SetType(Type);
SetDefaultFlags();
SetReady(1);
}
void C_BullsEye::Cleanup(void)
{
}
void C_BullsEye::SetPos(float x, float y)
{
WorldX_ = x;
WorldY_ = y;
SetXY(static_cast<long>(WorldX_ * Scale_), static_cast<long>(WorldY_ * Scale_)); //
}
void C_BullsEye::SetScale(float scl)
{
Scale_ = scl;
SetXY(static_cast<long>(WorldX_ * Scale_), static_cast<long>(WorldY_ * Scale_));
SetWH((short)(BullsEyeLines[0][1] * Scale_) * 2, (short)(BullsEyeLines[0][1] * Scale_) * 2);
}
void C_BullsEye::Refresh()
{
if (GetFlags() bitand C_BIT_INVISIBLE or Parent_ == NULL)
return;
Parent_->SetUpdateRect(GetX() - GetW() / 2, GetY() - GetH() / 2, GetX() + GetW() / 2 + 1, GetY() + GetH() / 2 + 1, GetFlags(), GetClient());
}
void C_BullsEye::Draw(SCREEN *surface, UI95_RECT *cliprect)
{
long i;
long x1, y1, x2, y2;
if (GetFlags() bitand C_BIT_INVISIBLE or Parent_ == NULL)
return;
for (i = 0; i < NUM_BE_CIRCLES; i++)
{
Parent_->DrawCircle(surface, Color_, GetX(), GetY(), BullsEyeRadius[i]*Scale_, GetFlags(), GetClient(), cliprect);
}
for (i = 0; i < NUM_BE_LINES; i++)
{
x1 = GetX() + (short)(BullsEyeLines[i][0] * Scale_);
y1 = GetY() + (short)(BullsEyeLines[i][1] * Scale_);
x2 = GetX() + (short)(BullsEyeLines[i][2] * Scale_);
y2 = GetY() + (short)(BullsEyeLines[i][3] * Scale_);
Parent_->DrawLine(surface, Color_, x1, y1, x2, y2, GetFlags(), GetClient(), cliprect);
}
}
| 23.123596 | 144 | 0.615646 | Terebinth |
2fa1b65fc61179a67e5146eb2b89b68ff7012124 | 724 | cpp | C++ | cpp/Test4-0609/T2.cpp | ljcbaby/Program-Practice | e999c07b595fcf3e70c8da462304e3cc0a292bac | [
"Unlicense"
] | null | null | null | cpp/Test4-0609/T2.cpp | ljcbaby/Program-Practice | e999c07b595fcf3e70c8da462304e3cc0a292bac | [
"Unlicense"
] | null | null | null | cpp/Test4-0609/T2.cpp | ljcbaby/Program-Practice | e999c07b595fcf3e70c8da462304e3cc0a292bac | [
"Unlicense"
] | null | null | null | #include <iostream>
#include <cmath>
using namespace std;
class shape {// 形状类
public:
double getArea() // 求面积
{
return -1;
}
double getPerimeter() // 求周长
{
return -1;
}
};
class RegularPolygon : public shape { // 正多边形类
private:
int n; // 边数
double side; // 边长
public:
RegularPolygon(int n, double side) : n(n), side(side) {}
double getArea() // 求面积
{
return n * side * side / (4 * tan(M_PI / n));
}
double getPerimeter() // 求周长
{
return n * side;
}
};
int main() {
int n;
double s;
cin >> n >> s;
RegularPolygon p(n, s);
cout << p.getArea() << endl;
cout << p.getPerimeter() << endl;
return 0;
}
| 16.088889 | 60 | 0.516575 | ljcbaby |
2fa2cd318402d162ee4d0ca23acaaaf20d893d5a | 727 | cpp | C++ | Dynamic Programming/33reachGivenScore.cpp | Coderangshu/450DSA | fff6cee65f75e5a0bb61d5fd8d000317a7736ca3 | [
"MIT"
] | 1 | 2021-01-18T14:51:20.000Z | 2021-01-18T14:51:20.000Z | Dynamic Programming/33reachGivenScore.cpp | Coderangshu/450DSA | fff6cee65f75e5a0bb61d5fd8d000317a7736ca3 | [
"MIT"
] | null | null | null | Dynamic Programming/33reachGivenScore.cpp | Coderangshu/450DSA | fff6cee65f75e5a0bb61d5fd8d000317a7736ca3 | [
"MIT"
] | null | null | null | // { Driver Code Starts
// Driver Code
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
// } Driver Code Ends
// Complete this function
ll count(ll n)
{
ll availableScores[] = {3,5,10};
ll asn = sizeof(availableScores)/sizeof(ll);
ll dp[n+1][asn+1];
for(ll i=0;i<n+1;i++){
for(ll j=0;j<asn+1;j++){
if(i==0) dp[i][j] = 1;
else if(j==0) dp[i][j] = 0;
else if(availableScores[j-1]>i) dp[i][j] = dp[i][j-1];
else dp[i][j] = dp[i-availableScores[j-1]][j]+dp[i][j-1];
}
}
return dp[n][asn];
}
// { Driver Code Starts.
int main()
{
int t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
cout<<count(n)<<endl;
}
return 0;
} // } Driver Code Ends
| 17.731707 | 66 | 0.537827 | Coderangshu |
2fa4d1431ec8237eca35f498013043188a7ef8f0 | 569,716 | cc | C++ | NFComm/NFMessageDefine/NFMsgShare.pb.cc | bytemode/NoahGameFrame | 34dbcc7db2d5d588ff282543dc371a37372d07d7 | [
"Apache-2.0"
] | 3 | 2019-06-03T07:34:23.000Z | 2019-06-03T07:34:28.000Z | NFComm/NFMessageDefine/NFMsgShare.pb.cc | bytemode/NoahGameFrame | 34dbcc7db2d5d588ff282543dc371a37372d07d7 | [
"Apache-2.0"
] | null | null | null | NFComm/NFMessageDefine/NFMsgShare.pb.cc | bytemode/NoahGameFrame | 34dbcc7db2d5d588ff282543dc371a37372d07d7 | [
"Apache-2.0"
] | null | null | null | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: NFMsgShare.proto
#include "NFMsgShare.pb.h"
#include <algorithm>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.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)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_NFMsgShare_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_AckSearchClan_SearchClanObject_NFMsgShare_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_NFMsgShare_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CurrencyStruct_NFMsgShare_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_NFMsgShare_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_EffectData_NFMsgShare_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_NFMsgBase_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Ident_NFMsgBase_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_NFMsgShare_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ItemStruct_NFMsgShare_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_NFMsgShare_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PVPPlayerInfo_NFMsgShare_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_NFMsgShare_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PlayerEntryInfo_NFMsgShare_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_NFMsgShare_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_ReqAddSceneBuilding_NFMsgShare_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_NFMsgBase_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Vector3_NFMsgBase_2eproto;
namespace NFMsg {
class ReqEnterGameServerDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqEnterGameServer> _instance;
} _ReqEnterGameServer_default_instance_;
class ReqAckEnterGameSuccessDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckEnterGameSuccess> _instance;
} _ReqAckEnterGameSuccess_default_instance_;
class ReqHeartBeatDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqHeartBeat> _instance;
} _ReqHeartBeat_default_instance_;
class ReqLeaveGameServerDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqLeaveGameServer> _instance;
} _ReqLeaveGameServer_default_instance_;
class PlayerEntryInfoDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PlayerEntryInfo> _instance;
} _PlayerEntryInfo_default_instance_;
class AckPlayerEntryListDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AckPlayerEntryList> _instance;
} _AckPlayerEntryList_default_instance_;
class AckPlayerLeaveListDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AckPlayerLeaveList> _instance;
} _AckPlayerLeaveList_default_instance_;
class ReqAckSynDataDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckSynData> _instance;
} _ReqAckSynData_default_instance_;
class ReqAckPlayerMoveDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckPlayerMove> _instance;
} _ReqAckPlayerMove_default_instance_;
class ReqAckPlayerChatDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckPlayerChat> _instance;
} _ReqAckPlayerChat_default_instance_;
class ReqAckPlayerPosSyncDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckPlayerPosSync> _instance;
} _ReqAckPlayerPosSync_default_instance_;
class EffectDataDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<EffectData> _instance;
} _EffectData_default_instance_;
class ReqAckUseSkillDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckUseSkill> _instance;
} _ReqAckUseSkill_default_instance_;
class ReqAckUseItemDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckUseItem> _instance;
} _ReqAckUseItem_default_instance_;
class ReqAckSwapSceneDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckSwapScene> _instance;
} _ReqAckSwapScene_default_instance_;
class ReqAckHomeSceneDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckHomeScene> _instance;
} _ReqAckHomeScene_default_instance_;
class ItemStructDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ItemStruct> _instance;
} _ItemStruct_default_instance_;
class CurrencyStructDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<CurrencyStruct> _instance;
} _CurrencyStruct_default_instance_;
class ReqAckReliveHeroDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckReliveHero> _instance;
} _ReqAckReliveHero_default_instance_;
class ReqPickDropItemDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqPickDropItem> _instance;
} _ReqPickDropItem_default_instance_;
class ReqAcceptTaskDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAcceptTask> _instance;
} _ReqAcceptTask_default_instance_;
class ReqCompeleteTaskDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqCompeleteTask> _instance;
} _ReqCompeleteTask_default_instance_;
class ReqAddSceneBuildingDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAddSceneBuilding> _instance;
} _ReqAddSceneBuilding_default_instance_;
class ReqSceneBuildingsDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqSceneBuildings> _instance;
} _ReqSceneBuildings_default_instance_;
class AckSceneBuildingsDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AckSceneBuildings> _instance;
} _AckSceneBuildings_default_instance_;
class ReqStoreSceneBuildingsDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqStoreSceneBuildings> _instance;
} _ReqStoreSceneBuildings_default_instance_;
class ReqAckCreateClanDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckCreateClan> _instance;
} _ReqAckCreateClan_default_instance_;
class ReqSearchClanDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqSearchClan> _instance;
} _ReqSearchClan_default_instance_;
class AckSearchClan_SearchClanObjectDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AckSearchClan_SearchClanObject> _instance;
} _AckSearchClan_SearchClanObject_default_instance_;
class AckSearchClanDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AckSearchClan> _instance;
} _AckSearchClan_default_instance_;
class ReqAckJoinClanDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckJoinClan> _instance;
} _ReqAckJoinClan_default_instance_;
class ReqAckLeaveClanDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckLeaveClan> _instance;
} _ReqAckLeaveClan_default_instance_;
class ReqAckOprClanMemberDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckOprClanMember> _instance;
} _ReqAckOprClanMember_default_instance_;
class ReqEnterClanEctypeDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqEnterClanEctype> _instance;
} _ReqEnterClanEctype_default_instance_;
class ReqSetFightHeroDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqSetFightHero> _instance;
} _ReqSetFightHero_default_instance_;
class ReqSwitchFightHeroDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqSwitchFightHero> _instance;
} _ReqSwitchFightHero_default_instance_;
class ReqBuyItemFromShopDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqBuyItemFromShop> _instance;
} _ReqBuyItemFromShop_default_instance_;
class PVPPlayerInfoDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PVPPlayerInfo> _instance;
} _PVPPlayerInfo_default_instance_;
class ReqSearchOppnentDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqSearchOppnent> _instance;
} _ReqSearchOppnent_default_instance_;
class AckSearchOppnentDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AckSearchOppnent> _instance;
} _AckSearchOppnent_default_instance_;
class ReqAckCancelSearchDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqAckCancelSearch> _instance;
} _ReqAckCancelSearch_default_instance_;
class ReqEndBattleDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqEndBattle> _instance;
} _ReqEndBattle_default_instance_;
class AckEndBattleDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AckEndBattle> _instance;
} _AckEndBattle_default_instance_;
class ReqSendMailDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqSendMail> _instance;
} _ReqSendMail_default_instance_;
class ReqSwitchServerDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ReqSwitchServer> _instance;
} _ReqSwitchServer_default_instance_;
class AckSwitchServerDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AckSwitchServer> _instance;
} _AckSwitchServer_default_instance_;
} // namespace NFMsg
static void InitDefaultsscc_info_AckEndBattle_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_AckEndBattle_default_instance_;
new (ptr) ::NFMsg::AckEndBattle();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::AckEndBattle::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_AckEndBattle_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_AckEndBattle_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,
&scc_info_ItemStruct_NFMsgShare_2eproto.base,}};
static void InitDefaultsscc_info_AckPlayerEntryList_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_AckPlayerEntryList_default_instance_;
new (ptr) ::NFMsg::AckPlayerEntryList();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::AckPlayerEntryList::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_AckPlayerEntryList_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_AckPlayerEntryList_NFMsgShare_2eproto}, {
&scc_info_PlayerEntryInfo_NFMsgShare_2eproto.base,}};
static void InitDefaultsscc_info_AckPlayerLeaveList_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_AckPlayerLeaveList_default_instance_;
new (ptr) ::NFMsg::AckPlayerLeaveList();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::AckPlayerLeaveList::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_AckPlayerLeaveList_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_AckPlayerLeaveList_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_AckSceneBuildings_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_AckSceneBuildings_default_instance_;
new (ptr) ::NFMsg::AckSceneBuildings();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::AckSceneBuildings::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_AckSceneBuildings_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_AckSceneBuildings_NFMsgShare_2eproto}, {
&scc_info_ReqAddSceneBuilding_NFMsgShare_2eproto.base,}};
static void InitDefaultsscc_info_AckSearchClan_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_AckSearchClan_default_instance_;
new (ptr) ::NFMsg::AckSearchClan();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::AckSearchClan::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_AckSearchClan_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_AckSearchClan_NFMsgShare_2eproto}, {
&scc_info_AckSearchClan_SearchClanObject_NFMsgShare_2eproto.base,}};
static void InitDefaultsscc_info_AckSearchClan_SearchClanObject_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_AckSearchClan_SearchClanObject_default_instance_;
new (ptr) ::NFMsg::AckSearchClan_SearchClanObject();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::AckSearchClan_SearchClanObject::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_AckSearchClan_SearchClanObject_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_AckSearchClan_SearchClanObject_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_AckSearchOppnent_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_AckSearchOppnent_default_instance_;
new (ptr) ::NFMsg::AckSearchOppnent();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::AckSearchOppnent::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_AckSearchOppnent_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, 0, InitDefaultsscc_info_AckSearchOppnent_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,
&scc_info_PVPPlayerInfo_NFMsgShare_2eproto.base,
&scc_info_ReqAddSceneBuilding_NFMsgShare_2eproto.base,}};
static void InitDefaultsscc_info_AckSwitchServer_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_AckSwitchServer_default_instance_;
new (ptr) ::NFMsg::AckSwitchServer();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::AckSwitchServer::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_AckSwitchServer_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_AckSwitchServer_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_CurrencyStruct_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_CurrencyStruct_default_instance_;
new (ptr) ::NFMsg::CurrencyStruct();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::CurrencyStruct::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CurrencyStruct_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_CurrencyStruct_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_EffectData_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_EffectData_default_instance_;
new (ptr) ::NFMsg::EffectData();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::EffectData::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_EffectData_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_EffectData_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ItemStruct_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ItemStruct_default_instance_;
new (ptr) ::NFMsg::ItemStruct();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ItemStruct::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ItemStruct_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ItemStruct_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_PVPPlayerInfo_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_PVPPlayerInfo_default_instance_;
new (ptr) ::NFMsg::PVPPlayerInfo();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::PVPPlayerInfo::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PVPPlayerInfo_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_PVPPlayerInfo_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_PlayerEntryInfo_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_PlayerEntryInfo_default_instance_;
new (ptr) ::NFMsg::PlayerEntryInfo();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::PlayerEntryInfo::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PlayerEntryInfo_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_PlayerEntryInfo_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAcceptTask_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAcceptTask_default_instance_;
new (ptr) ::NFMsg::ReqAcceptTask();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAcceptTask::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqAcceptTask_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqAcceptTask_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqAckCancelSearch_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckCancelSearch_default_instance_;
new (ptr) ::NFMsg::ReqAckCancelSearch();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckCancelSearch::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqAckCancelSearch_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqAckCancelSearch_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckCreateClan_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckCreateClan_default_instance_;
new (ptr) ::NFMsg::ReqAckCreateClan();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckCreateClan::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqAckCreateClan_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqAckCreateClan_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckEnterGameSuccess_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckEnterGameSuccess_default_instance_;
new (ptr) ::NFMsg::ReqAckEnterGameSuccess();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckEnterGameSuccess::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqAckEnterGameSuccess_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqAckEnterGameSuccess_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqAckHomeScene_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckHomeScene_default_instance_;
new (ptr) ::NFMsg::ReqAckHomeScene();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckHomeScene::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqAckHomeScene_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqAckHomeScene_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqAckJoinClan_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckJoinClan_default_instance_;
new (ptr) ::NFMsg::ReqAckJoinClan();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckJoinClan::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqAckJoinClan_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqAckJoinClan_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckLeaveClan_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckLeaveClan_default_instance_;
new (ptr) ::NFMsg::ReqAckLeaveClan();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckLeaveClan::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqAckLeaveClan_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqAckLeaveClan_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckOprClanMember_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckOprClanMember_default_instance_;
new (ptr) ::NFMsg::ReqAckOprClanMember();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckOprClanMember::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqAckOprClanMember_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqAckOprClanMember_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckPlayerChat_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckPlayerChat_default_instance_;
new (ptr) ::NFMsg::ReqAckPlayerChat();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckPlayerChat::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqAckPlayerChat_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqAckPlayerChat_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckPlayerMove_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckPlayerMove_default_instance_;
new (ptr) ::NFMsg::ReqAckPlayerMove();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckPlayerMove::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_ReqAckPlayerMove_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_ReqAckPlayerMove_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,
&scc_info_Vector3_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckPlayerPosSync_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckPlayerPosSync_default_instance_;
new (ptr) ::NFMsg::ReqAckPlayerPosSync();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckPlayerPosSync::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_ReqAckPlayerPosSync_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_ReqAckPlayerPosSync_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,
&scc_info_Vector3_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckReliveHero_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckReliveHero_default_instance_;
new (ptr) ::NFMsg::ReqAckReliveHero();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckReliveHero::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqAckReliveHero_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqAckReliveHero_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckSwapScene_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckSwapScene_default_instance_;
new (ptr) ::NFMsg::ReqAckSwapScene();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckSwapScene::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqAckSwapScene_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqAckSwapScene_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqAckSynData_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckSynData_default_instance_;
new (ptr) ::NFMsg::ReqAckSynData();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckSynData::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqAckSynData_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqAckSynData_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckUseItem_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckUseItem_default_instance_;
new (ptr) ::NFMsg::ReqAckUseItem();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckUseItem::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<4> scc_info_ReqAckUseItem_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 4, 0, InitDefaultsscc_info_ReqAckUseItem_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,
&scc_info_EffectData_NFMsgShare_2eproto.base,
&scc_info_ItemStruct_NFMsgShare_2eproto.base,
&scc_info_Vector3_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqAckUseSkill_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAckUseSkill_default_instance_;
new (ptr) ::NFMsg::ReqAckUseSkill();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAckUseSkill::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_ReqAckUseSkill_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_ReqAckUseSkill_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,
&scc_info_EffectData_NFMsgShare_2eproto.base,}};
static void InitDefaultsscc_info_ReqAddSceneBuilding_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqAddSceneBuilding_default_instance_;
new (ptr) ::NFMsg::ReqAddSceneBuilding();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqAddSceneBuilding::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_ReqAddSceneBuilding_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_ReqAddSceneBuilding_NFMsgShare_2eproto}, {
&scc_info_Vector3_NFMsgBase_2eproto.base,
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqBuyItemFromShop_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqBuyItemFromShop_default_instance_;
new (ptr) ::NFMsg::ReqBuyItemFromShop();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqBuyItemFromShop::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqBuyItemFromShop_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqBuyItemFromShop_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqCompeleteTask_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqCompeleteTask_default_instance_;
new (ptr) ::NFMsg::ReqCompeleteTask();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqCompeleteTask::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqCompeleteTask_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqCompeleteTask_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqEndBattle_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqEndBattle_default_instance_;
new (ptr) ::NFMsg::ReqEndBattle();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqEndBattle::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqEndBattle_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqEndBattle_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqEnterClanEctype_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqEnterClanEctype_default_instance_;
new (ptr) ::NFMsg::ReqEnterClanEctype();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqEnterClanEctype::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqEnterClanEctype_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqEnterClanEctype_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqEnterGameServer_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqEnterGameServer_default_instance_;
new (ptr) ::NFMsg::ReqEnterGameServer();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqEnterGameServer::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqEnterGameServer_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqEnterGameServer_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqHeartBeat_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqHeartBeat_default_instance_;
new (ptr) ::NFMsg::ReqHeartBeat();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqHeartBeat::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqHeartBeat_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqHeartBeat_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqLeaveGameServer_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqLeaveGameServer_default_instance_;
new (ptr) ::NFMsg::ReqLeaveGameServer();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqLeaveGameServer::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqLeaveGameServer_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqLeaveGameServer_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqPickDropItem_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqPickDropItem_default_instance_;
new (ptr) ::NFMsg::ReqPickDropItem();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqPickDropItem::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqPickDropItem_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqPickDropItem_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqSceneBuildings_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqSceneBuildings_default_instance_;
new (ptr) ::NFMsg::ReqSceneBuildings();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqSceneBuildings::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqSceneBuildings_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqSceneBuildings_NFMsgShare_2eproto}, {
&scc_info_Vector3_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqSearchClan_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqSearchClan_default_instance_;
new (ptr) ::NFMsg::ReqSearchClan();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqSearchClan::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReqSearchClan_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ReqSearchClan_NFMsgShare_2eproto}, {}};
static void InitDefaultsscc_info_ReqSearchOppnent_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqSearchOppnent_default_instance_;
new (ptr) ::NFMsg::ReqSearchOppnent();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqSearchOppnent::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqSearchOppnent_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqSearchOppnent_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqSendMail_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqSendMail_default_instance_;
new (ptr) ::NFMsg::ReqSendMail();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqSendMail::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_ReqSendMail_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, 0, InitDefaultsscc_info_ReqSendMail_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,
&scc_info_ItemStruct_NFMsgShare_2eproto.base,
&scc_info_CurrencyStruct_NFMsgShare_2eproto.base,}};
static void InitDefaultsscc_info_ReqSetFightHero_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqSetFightHero_default_instance_;
new (ptr) ::NFMsg::ReqSetFightHero();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqSetFightHero::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqSetFightHero_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqSetFightHero_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqStoreSceneBuildings_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqStoreSceneBuildings_default_instance_;
new (ptr) ::NFMsg::ReqStoreSceneBuildings();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqStoreSceneBuildings::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_ReqStoreSceneBuildings_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_ReqStoreSceneBuildings_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,
&scc_info_ReqAddSceneBuilding_NFMsgShare_2eproto.base,}};
static void InitDefaultsscc_info_ReqSwitchFightHero_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqSwitchFightHero_default_instance_;
new (ptr) ::NFMsg::ReqSwitchFightHero();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqSwitchFightHero::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqSwitchFightHero_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqSwitchFightHero_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static void InitDefaultsscc_info_ReqSwitchServer_NFMsgShare_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::NFMsg::_ReqSwitchServer_default_instance_;
new (ptr) ::NFMsg::ReqSwitchServer();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::NFMsg::ReqSwitchServer::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ReqSwitchServer_NFMsgShare_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ReqSwitchServer_NFMsgShare_2eproto}, {
&scc_info_Ident_NFMsgBase_2eproto.base,}};
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_NFMsgShare_2eproto[46];
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_NFMsgShare_2eproto[6];
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_NFMsgShare_2eproto = nullptr;
const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_NFMsgShare_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqEnterGameServer, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqEnterGameServer, id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqEnterGameServer, account_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqEnterGameServer, game_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqEnterGameServer, name_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckEnterGameSuccess, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckEnterGameSuccess, arg_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqHeartBeat, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqHeartBeat, arg_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqLeaveGameServer, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqLeaveGameServer, arg_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, object_guid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, x_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, y_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, z_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, career_type_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, player_state_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, config_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, scene_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PlayerEntryInfo, class_id_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckPlayerEntryList, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckPlayerEntryList, object_list_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckPlayerLeaveList, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckPlayerLeaveList, object_list_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSynData, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSynData, syser_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSynData, object_list_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSynData, data_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSynData, syn_type_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSynData, msg_id_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerMove, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerMove, mover_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerMove, movetype_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerMove, speed_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerMove, time_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerMove, laststate_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerMove, target_pos_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerMove, source_pos_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerMove, move_direction_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerChat, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerChat, player_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerChat, player_name_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerChat, player_hero_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerChat, player_hero_level_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerChat, chat_channel_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerChat, chat_type_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerChat, chat_info_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerChat, target_id_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerPosSync, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerPosSync, mover_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerPosSync, time_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerPosSync, interpolationtime_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerPosSync, position_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerPosSync, direction_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerPosSync, status_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckPlayerPosSync, frame_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::EffectData, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::EffectData, effect_ident_),
PROTOBUF_FIELD_OFFSET(::NFMsg::EffectData, effect_value_),
PROTOBUF_FIELD_OFFSET(::NFMsg::EffectData, effect_rlt_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseSkill, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseSkill, user_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseSkill, skill_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseSkill, use_index_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseSkill, effect_data_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseItem, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseItem, user_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseItem, item_guid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseItem, effect_data_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseItem, item_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseItem, targetid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckUseItem, position_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSwapScene, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSwapScene, transfer_type_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSwapScene, scene_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSwapScene, line_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSwapScene, x_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSwapScene, y_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSwapScene, z_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckSwapScene, data_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckHomeScene, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckHomeScene, data_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ItemStruct, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ItemStruct, item_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ItemStruct, item_count_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::CurrencyStruct, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::CurrencyStruct, currency_type_),
PROTOBUF_FIELD_OFFSET(::NFMsg::CurrencyStruct, currency_count_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckReliveHero, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckReliveHero, diamond_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckReliveHero, hero_id_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqPickDropItem, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqPickDropItem, item_guid_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAcceptTask, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAcceptTask, task_id_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqCompeleteTask, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqCompeleteTask, task_id_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAddSceneBuilding, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAddSceneBuilding, pos_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAddSceneBuilding, guid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAddSceneBuilding, master_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAddSceneBuilding, config_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAddSceneBuilding, scene_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAddSceneBuilding, master_name_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAddSceneBuilding, is_home_scene_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAddSceneBuilding, is_building_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSceneBuildings, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSceneBuildings, scene_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSceneBuildings, pos_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSceneBuildings, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSceneBuildings, buildings_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqStoreSceneBuildings, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqStoreSceneBuildings, guid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqStoreSceneBuildings, home_scene_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqStoreSceneBuildings, buildings_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckCreateClan, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckCreateClan, clan_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckCreateClan, clan_name_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckCreateClan, clan_desc_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckCreateClan, clan_player_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckCreateClan, clan_player_name_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckCreateClan, clan_player_bp_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSearchClan, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSearchClan, clan_name_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan_SearchClanObject, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan_SearchClanObject, clan_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan_SearchClanObject, clan_name_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan_SearchClanObject, clan_icon_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan_SearchClanObject, clan_member_count_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan_SearchClanObject, clan_member_max_count_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan_SearchClanObject, clan_honor_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan_SearchClanObject, clan_rank_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchClan, clan_list_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckJoinClan, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckJoinClan, clan_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckJoinClan, clan_player_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckJoinClan, clan_player_name_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckJoinClan, clan_player_bp_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckLeaveClan, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckLeaveClan, clan_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckLeaveClan, clan_player_id_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckOprClanMember, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckOprClanMember, clan_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckOprClanMember, player_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckOprClanMember, member_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckOprClanMember, type_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqEnterClanEctype, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqEnterClanEctype, clan_id_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSetFightHero, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSetFightHero, heroid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSetFightHero, set_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchFightHero, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchFightHero, heroid_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqBuyItemFromShop, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqBuyItemFromShop, itemid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqBuyItemFromShop, count_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, battle_mode_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, level_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, battle_point_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, name_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, head_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, gold_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, diamond_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, hero_cnf1_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, hero_cnf2_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, hero_cnf3_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, hero_star1_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, hero_star2_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, hero_star3_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, hero_id1_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, hero_id2_),
PROTOBUF_FIELD_OFFSET(::NFMsg::PVPPlayerInfo, hero_id3_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSearchOppnent, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSearchOppnent, self_scene_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSearchOppnent, diamond_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSearchOppnent, battle_point_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSearchOppnent, battle_mode_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSearchOppnent, friends_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchOppnent, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchOppnent, scene_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchOppnent, team_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchOppnent, gamble_diamond_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchOppnent, team_members_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchOppnent, opponent_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSearchOppnent, buildings_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckCancelSearch, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqAckCancelSearch, selfid_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqEndBattle, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqEndBattle, auto_end_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, win_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, star_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, gold_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, cup_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, diamond_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, battle_mode_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, team_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, match_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, members_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckEndBattle, item_list_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSendMail, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSendMail, reciever_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSendMail, item_list_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSendMail, currency_list_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchServer, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchServer, selfid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchServer, self_serverid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchServer, target_serverid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchServer, gate_serverid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchServer, sceneid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchServer, client_id_),
PROTOBUF_FIELD_OFFSET(::NFMsg::ReqSwitchServer, groupid_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSwitchServer, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSwitchServer, selfid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSwitchServer, self_serverid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSwitchServer, target_serverid_),
PROTOBUF_FIELD_OFFSET(::NFMsg::AckSwitchServer, gate_serverid_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, sizeof(::NFMsg::ReqEnterGameServer)},
{ 9, -1, sizeof(::NFMsg::ReqAckEnterGameSuccess)},
{ 15, -1, sizeof(::NFMsg::ReqHeartBeat)},
{ 21, -1, sizeof(::NFMsg::ReqLeaveGameServer)},
{ 27, -1, sizeof(::NFMsg::PlayerEntryInfo)},
{ 41, -1, sizeof(::NFMsg::AckPlayerEntryList)},
{ 47, -1, sizeof(::NFMsg::AckPlayerLeaveList)},
{ 53, -1, sizeof(::NFMsg::ReqAckSynData)},
{ 63, -1, sizeof(::NFMsg::ReqAckPlayerMove)},
{ 76, -1, sizeof(::NFMsg::ReqAckPlayerChat)},
{ 89, -1, sizeof(::NFMsg::ReqAckPlayerPosSync)},
{ 101, -1, sizeof(::NFMsg::EffectData)},
{ 109, -1, sizeof(::NFMsg::ReqAckUseSkill)},
{ 118, -1, sizeof(::NFMsg::ReqAckUseItem)},
{ 129, -1, sizeof(::NFMsg::ReqAckSwapScene)},
{ 141, -1, sizeof(::NFMsg::ReqAckHomeScene)},
{ 147, -1, sizeof(::NFMsg::ItemStruct)},
{ 154, -1, sizeof(::NFMsg::CurrencyStruct)},
{ 161, -1, sizeof(::NFMsg::ReqAckReliveHero)},
{ 168, -1, sizeof(::NFMsg::ReqPickDropItem)},
{ 174, -1, sizeof(::NFMsg::ReqAcceptTask)},
{ 180, -1, sizeof(::NFMsg::ReqCompeleteTask)},
{ 186, -1, sizeof(::NFMsg::ReqAddSceneBuilding)},
{ 199, -1, sizeof(::NFMsg::ReqSceneBuildings)},
{ 206, -1, sizeof(::NFMsg::AckSceneBuildings)},
{ 212, -1, sizeof(::NFMsg::ReqStoreSceneBuildings)},
{ 220, -1, sizeof(::NFMsg::ReqAckCreateClan)},
{ 231, -1, sizeof(::NFMsg::ReqSearchClan)},
{ 237, -1, sizeof(::NFMsg::AckSearchClan_SearchClanObject)},
{ 249, -1, sizeof(::NFMsg::AckSearchClan)},
{ 255, -1, sizeof(::NFMsg::ReqAckJoinClan)},
{ 264, -1, sizeof(::NFMsg::ReqAckLeaveClan)},
{ 271, -1, sizeof(::NFMsg::ReqAckOprClanMember)},
{ 280, -1, sizeof(::NFMsg::ReqEnterClanEctype)},
{ 286, -1, sizeof(::NFMsg::ReqSetFightHero)},
{ 293, -1, sizeof(::NFMsg::ReqSwitchFightHero)},
{ 299, -1, sizeof(::NFMsg::ReqBuyItemFromShop)},
{ 306, -1, sizeof(::NFMsg::PVPPlayerInfo)},
{ 328, -1, sizeof(::NFMsg::ReqSearchOppnent)},
{ 338, -1, sizeof(::NFMsg::AckSearchOppnent)},
{ 349, -1, sizeof(::NFMsg::ReqAckCancelSearch)},
{ 355, -1, sizeof(::NFMsg::ReqEndBattle)},
{ 361, -1, sizeof(::NFMsg::AckEndBattle)},
{ 376, -1, sizeof(::NFMsg::ReqSendMail)},
{ 384, -1, sizeof(::NFMsg::ReqSwitchServer)},
{ 396, -1, sizeof(::NFMsg::AckSwitchServer)},
};
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqEnterGameServer_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckEnterGameSuccess_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqHeartBeat_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqLeaveGameServer_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_PlayerEntryInfo_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_AckPlayerEntryList_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_AckPlayerLeaveList_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckSynData_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckPlayerMove_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckPlayerChat_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckPlayerPosSync_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_EffectData_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckUseSkill_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckUseItem_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckSwapScene_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckHomeScene_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ItemStruct_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_CurrencyStruct_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckReliveHero_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqPickDropItem_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAcceptTask_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqCompeleteTask_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAddSceneBuilding_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqSceneBuildings_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_AckSceneBuildings_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqStoreSceneBuildings_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckCreateClan_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqSearchClan_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_AckSearchClan_SearchClanObject_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_AckSearchClan_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckJoinClan_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckLeaveClan_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckOprClanMember_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqEnterClanEctype_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqSetFightHero_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqSwitchFightHero_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqBuyItemFromShop_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_PVPPlayerInfo_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqSearchOppnent_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_AckSearchOppnent_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqAckCancelSearch_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqEndBattle_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_AckEndBattle_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqSendMail_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_ReqSwitchServer_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::NFMsg::_AckSwitchServer_default_instance_),
};
const char descriptor_table_protodef_NFMsgShare_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\020NFMsgShare.proto\022\005NFMsg\032\016NFDefine.prot"
"o\032\017NFMsgBase.proto\"^\n\022ReqEnterGameServer"
"\022\030\n\002id\030\001 \001(\0132\014.NFMsg.Ident\022\017\n\007account\030\002 "
"\001(\014\022\017\n\007game_id\030\003 \001(\005\022\014\n\004name\030\004 \001(\014\"%\n\026Re"
"qAckEnterGameSuccess\022\013\n\003arg\030\001 \001(\005\"\033\n\014Req"
"HeartBeat\022\013\n\003arg\030\001 \001(\005\"!\n\022ReqLeaveGameSe"
"rver\022\013\n\003arg\030\001 \001(\005\"\267\001\n\017PlayerEntryInfo\022!\n"
"\013object_guid\030\001 \001(\0132\014.NFMsg.Ident\022\t\n\001x\030\002 "
"\001(\002\022\t\n\001y\030\003 \001(\002\022\t\n\001z\030\004 \001(\002\022\023\n\013career_type"
"\030\005 \001(\005\022\024\n\014player_state\030\006 \001(\005\022\021\n\tconfig_i"
"d\030\007 \001(\014\022\020\n\010scene_id\030\010 \001(\005\022\020\n\010class_id\030\t "
"\001(\014\"A\n\022AckPlayerEntryList\022+\n\013object_list"
"\030\001 \003(\0132\026.NFMsg.PlayerEntryInfo\"7\n\022AckPla"
"yerLeaveList\022!\n\013object_list\030\001 \003(\0132\014.NFMs"
"g.Ident\"\206\002\n\rReqAckSynData\022\033\n\005syser\030\001 \001(\013"
"2\014.NFMsg.Ident\022!\n\013object_list\030\002 \003(\0132\014.NF"
"Msg.Ident\022\014\n\004data\030\003 \001(\014\022.\n\010syn_type\030\004 \001("
"\0162\034.NFMsg.ReqAckSynData.SynType\022 \n\006msg_i"
"d\030\005 \001(\0162\020.NFMsg.ESynMsgID\"U\n\007SynType\022\016\n\n"
"EST_UNKNOW\020\000\022\r\n\tEST_GROUP\020\001\022\r\n\tEST_SCENE"
"\020\002\022\014\n\010EST_CLAN\020\003\022\016\n\nEST_FRIEND\020\004\"\341\001\n\020Req"
"AckPlayerMove\022\033\n\005mover\030\001 \001(\0132\014.NFMsg.Ide"
"nt\022\020\n\010moveType\030\002 \001(\005\022\r\n\005speed\030\003 \001(\002\022\014\n\004t"
"ime\030\004 \001(\005\022\021\n\tlastState\030\005 \001(\005\022\"\n\ntarget_p"
"os\030\006 \003(\0132\016.NFMsg.Vector3\022\"\n\nsource_pos\030\007"
" \003(\0132\016.NFMsg.Vector3\022&\n\016move_direction\030\010"
" \003(\0132\016.NFMsg.Vector3\"\244\004\n\020ReqAckPlayerCha"
"t\022\037\n\tplayer_id\030\001 \001(\0132\014.NFMsg.Ident\022\023\n\013pl"
"ayer_name\030\002 \001(\014\022\026\n\016player_hero_id\030\003 \001(\014\022"
"\031\n\021player_hero_level\030\004 \001(\014\022>\n\014chat_chann"
"el\030\005 \001(\0162(.NFMsg.ReqAckPlayerChat.EGameC"
"hatChannel\0228\n\tchat_type\030\006 \001(\0162%.NFMsg.Re"
"qAckPlayerChat.EGameChatType\022\021\n\tchat_inf"
"o\030\007 \001(\014\022\037\n\ttarget_id\030\010 \001(\0132\014.NFMsg.Ident"
"\"r\n\020EGameChatChannel\022\017\n\013EGCC_GLOBAL\020\000\022\r\n"
"\tEGCC_CLAN\020\001\022\017\n\013EGCC_FRIEND\020\002\022\017\n\013EGCC_BA"
"TTLE\020\003\022\r\n\tEGCC_TEAM\020\004\022\r\n\tEGCC_ROOM\020\005\"\204\001\n"
"\rEGameChatType\022\r\n\tEGCT_TEXT\020\000\022\016\n\nEGCT_VO"
"ICE\020\001\022\016\n\nEGCT_EMOJI\020\002\022\024\n\020EGCT_DONATE_HER"
"O\020\n\022\030\n\024EGCT_DONATE_BUILDING\020\013\022\024\n\020EGCT_DO"
"NATE_ITEM\020\014\"\277\001\n\023ReqAckPlayerPosSync\022\033\n\005m"
"over\030\001 \001(\0132\014.NFMsg.Ident\022\014\n\004time\030\002 \001(\005\022\031"
"\n\021InterpolationTime\030\003 \001(\002\022 \n\010position\030\004 "
"\001(\0132\016.NFMsg.Vector3\022!\n\tdirection\030\005 \001(\0132\016"
".NFMsg.Vector3\022\016\n\006status\030\006 \001(\005\022\r\n\005frame\030"
"\007 \001(\005\"\323\001\n\nEffectData\022\"\n\014effect_ident\030\001 \001"
"(\0132\014.NFMsg.Ident\022\024\n\014effect_value\030\002 \001(\005\0221"
"\n\neffect_rlt\030\003 \001(\0162\035.NFMsg.EffectData.ER"
"esultType\"X\n\013EResultType\022\014\n\010EET_FAIL\020\000\022\017"
"\n\013EET_SUCCESS\020\001\022\016\n\nEET_REFUSE\020\002\022\014\n\010EET_M"
"ISS\020\003\022\014\n\010EET_CRIT\020\004\"y\n\016ReqAckUseSkill\022\032\n"
"\004user\030\001 \001(\0132\014.NFMsg.Ident\022\020\n\010skill_id\030\002 "
"\001(\014\022\021\n\tuse_index\030\003 \001(\005\022&\n\013effect_data\030\004 "
"\003(\0132\021.NFMsg.EffectData\"\327\001\n\rReqAckUseItem"
"\022\032\n\004user\030\001 \001(\0132\014.NFMsg.Ident\022\037\n\titem_gui"
"d\030\002 \001(\0132\014.NFMsg.Ident\022&\n\013effect_data\030\003 \003"
"(\0132\021.NFMsg.EffectData\022\037\n\004item\030\004 \001(\0132\021.NF"
"Msg.ItemStruct\022\036\n\010targetid\030\005 \001(\0132\014.NFMsg"
".Ident\022 \n\010position\030\006 \001(\0132\016.NFMsg.Vector3"
"\"\363\001\n\017ReqAckSwapScene\022;\n\rtransfer_type\030\001 "
"\001(\0162$.NFMsg.ReqAckSwapScene.EGameSwapTyp"
"e\022\020\n\010scene_id\030\002 \001(\005\022\017\n\007line_id\030\003 \001(\005\022\t\n\001"
"x\030\004 \001(\002\022\t\n\001y\030\005 \001(\002\022\t\n\001z\030\006 \001(\002\022\014\n\004data\030\007 "
"\001(\014\"Q\n\rEGameSwapType\022\017\n\013EGST_NARMAL\020\000\022\016\n"
"\nEGST_CLONE\020\001\022\016\n\nEGST_ARENA\020\002\022\017\n\013EGST_MI"
"RROR\020\003\"\037\n\017ReqAckHomeScene\022\014\n\004data\030\001 \001(\014\""
"1\n\nItemStruct\022\017\n\007item_id\030\001 \001(\014\022\022\n\nitem_c"
"ount\030\002 \001(\005\"\?\n\016CurrencyStruct\022\025\n\rcurrency"
"_type\030\001 \001(\005\022\026\n\016currency_count\030\002 \001(\005\"B\n\020R"
"eqAckReliveHero\022\017\n\007diamond\030\001 \001(\005\022\035\n\007hero"
"_id\030\002 \001(\0132\014.NFMsg.Ident\"2\n\017ReqPickDropIt"
"em\022\037\n\titem_guid\030\002 \001(\0132\014.NFMsg.Ident\" \n\rR"
"eqAcceptTask\022\017\n\007task_id\030\001 \001(\014\"#\n\020ReqComp"
"eleteTask\022\017\n\007task_id\030\001 \001(\014\"\322\001\n\023ReqAddSce"
"neBuilding\022\033\n\003pos\030\001 \001(\0132\016.NFMsg.Vector3\022"
"\032\n\004guid\030\002 \001(\0132\014.NFMsg.Ident\022\034\n\006master\030\003 "
"\001(\0132\014.NFMsg.Ident\022\021\n\tconfig_id\030\004 \001(\014\022\020\n\010"
"scene_id\030\005 \001(\005\022\023\n\013master_name\030\006 \001(\014\022\025\n\ri"
"s_home_scene\030\007 \001(\005\022\023\n\013is_building\030\010 \001(\005\""
"B\n\021ReqSceneBuildings\022\020\n\010scene_id\030\001 \001(\005\022\033"
"\n\003pos\030\002 \001(\0132\016.NFMsg.Vector3\"B\n\021AckSceneB"
"uildings\022-\n\tbuildings\030\001 \003(\0132\032.NFMsg.ReqA"
"ddSceneBuilding\"z\n\026ReqStoreSceneBuilding"
"s\022\032\n\004guid\030\001 \001(\0132\014.NFMsg.Ident\022\025\n\rhome_sc"
"ene_id\030\002 \001(\005\022-\n\tbuildings\030\003 \003(\0132\032.NFMsg."
"ReqAddSceneBuilding\"\257\001\n\020ReqAckCreateClan"
"\022\035\n\007clan_id\030\001 \001(\0132\014.NFMsg.Ident\022\021\n\tclan_"
"name\030\002 \001(\014\022\021\n\tclan_desc\030\003 \001(\014\022$\n\016clan_pl"
"ayer_id\030\004 \001(\0132\014.NFMsg.Ident\022\030\n\020clan_play"
"er_name\030\005 \001(\014\022\026\n\016clan_player_bp\030\006 \001(\005\"\"\n"
"\rReqSearchClan\022\021\n\tclan_name\030\001 \001(\014\"\204\002\n\rAc"
"kSearchClan\0228\n\tclan_list\030\001 \003(\0132%.NFMsg.A"
"ckSearchClan.SearchClanObject\032\270\001\n\020Search"
"ClanObject\022\035\n\007clan_ID\030\001 \001(\0132\014.NFMsg.Iden"
"t\022\021\n\tclan_name\030\002 \001(\014\022\021\n\tclan_icon\030\003 \001(\014\022"
"\031\n\021clan_member_count\030\004 \001(\005\022\035\n\025clan_membe"
"r_max_count\030\005 \001(\005\022\022\n\nclan_honor\030\006 \001(\005\022\021\n"
"\tclan_rank\030\007 \001(\005\"\207\001\n\016ReqAckJoinClan\022\035\n\007c"
"lan_id\030\001 \001(\0132\014.NFMsg.Ident\022$\n\016clan_playe"
"r_id\030\004 \001(\0132\014.NFMsg.Ident\022\030\n\020clan_player_"
"name\030\005 \001(\014\022\026\n\016clan_player_bp\030\006 \001(\005\"V\n\017Re"
"qAckLeaveClan\022\035\n\007clan_id\030\001 \001(\0132\014.NFMsg.I"
"dent\022$\n\016clan_player_id\030\002 \001(\0132\014.NFMsg.Ide"
"nt\"\366\001\n\023ReqAckOprClanMember\022\035\n\007clan_id\030\001 "
"\001(\0132\014.NFMsg.Ident\022\037\n\tplayer_id\030\002 \001(\0132\014.N"
"FMsg.Ident\022\037\n\tmember_id\030\003 \001(\0132\014.NFMsg.Id"
"ent\022<\n\004type\030\004 \001(\0162..NFMsg.ReqAckOprClanM"
"ember.EGClanMemberOprType\"@\n\023EGClanMembe"
"rOprType\022\r\n\tEGAT_DOWN\020\000\022\013\n\007EGAT_UP\020\001\022\r\n\t"
"EGAT_KICK\020\002\"3\n\022ReqEnterClanEctype\022\035\n\007cla"
"n_id\030\001 \001(\0132\014.NFMsg.Ident\"<\n\017ReqSetFightH"
"ero\022\034\n\006Heroid\030\001 \001(\0132\014.NFMsg.Ident\022\013\n\003Set"
"\030\002 \001(\005\"2\n\022ReqSwitchFightHero\022\034\n\006Heroid\030\001"
" \001(\0132\014.NFMsg.Ident\"3\n\022ReqBuyItemFromShop"
"\022\016\n\006itemID\030\001 \001(\014\022\r\n\005count\030\002 \001(\005\"\207\003\n\rPVPP"
"layerInfo\022\030\n\002id\030\001 \001(\0132\014.NFMsg.Ident\022\'\n\013b"
"attle_mode\030\002 \001(\0162\022.NFMsg.EBattleType\022\r\n\005"
"level\030\004 \001(\005\022\024\n\014battle_point\030\005 \001(\005\022\014\n\004nam"
"e\030\006 \001(\014\022\014\n\004head\030\007 \001(\014\022\014\n\004gold\030\010 \001(\005\022\017\n\007d"
"iamond\030\t \001(\005\022\021\n\thero_cnf1\030\024 \001(\014\022\021\n\thero_"
"cnf2\030\025 \001(\014\022\021\n\thero_cnf3\030\026 \001(\014\022\022\n\nhero_st"
"ar1\030\031 \001(\005\022\022\n\nhero_star2\030\032 \001(\005\022\022\n\nhero_st"
"ar3\030\033 \001(\005\022\036\n\010hero_id1\030\034 \001(\0132\014.NFMsg.Iden"
"t\022\036\n\010hero_id2\030\035 \001(\0132\014.NFMsg.Ident\022\036\n\010her"
"o_id3\030\036 \001(\0132\014.NFMsg.Ident\"\225\001\n\020ReqSearchO"
"ppnent\022\022\n\nself_scene\030\001 \001(\005\022\017\n\007diamond\030\002 "
"\001(\005\022\024\n\014battle_point\030\003 \001(\005\022\'\n\013battle_mode"
"\030\004 \001(\0162\022.NFMsg.EBattleType\022\035\n\007friends\030\n "
"\003(\0132\014.NFMsg.Ident\"\326\001\n\020AckSearchOppnent\022\020"
"\n\010scene_id\030\001 \001(\005\022\035\n\007team_id\030\002 \001(\0132\014.NFMs"
"g.Ident\022\026\n\016gamble_diamond\030\003 \001(\005\022\"\n\014team_"
"members\030\005 \003(\0132\014.NFMsg.Ident\022&\n\010opponent\030"
"\016 \001(\0132\024.NFMsg.PVPPlayerInfo\022-\n\tbuildings"
"\030\024 \003(\0132\032.NFMsg.ReqAddSceneBuilding\"2\n\022Re"
"qAckCancelSearch\022\034\n\006selfid\030\001 \001(\0132\014.NFMsg"
".Ident\" \n\014ReqEndBattle\022\020\n\010auto_end\030\001 \001(\005"
"\"\202\002\n\014AckEndBattle\022\013\n\003win\030\001 \001(\005\022\014\n\004star\030\002"
" \001(\005\022\014\n\004gold\030\003 \001(\005\022\013\n\003cup\030\004 \001(\005\022\017\n\007diamo"
"nd\030\005 \001(\005\022\'\n\013battle_mode\030\006 \001(\0162\022.NFMsg.EB"
"attleType\022\035\n\007team_id\030\007 \001(\0132\014.NFMsg.Ident"
"\022\036\n\010match_id\030\010 \001(\0132\014.NFMsg.Ident\022\035\n\007memb"
"ers\030\t \003(\0132\014.NFMsg.Ident\022$\n\titem_list\030\n \003"
"(\0132\021.NFMsg.ItemStruct\"\201\001\n\013ReqSendMail\022\036\n"
"\010reciever\030\001 \001(\0132\014.NFMsg.Ident\022$\n\titem_li"
"st\030\002 \003(\0132\021.NFMsg.ItemStruct\022,\n\rcurrency_"
"list\030\003 \003(\0132\025.NFMsg.CurrencyStruct\"\271\001\n\017Re"
"qSwitchServer\022\034\n\006selfid\030\001 \001(\0132\014.NFMsg.Id"
"ent\022\025\n\rself_serverid\030\002 \001(\003\022\027\n\017target_ser"
"verid\030\003 \001(\003\022\025\n\rgate_serverid\030\004 \001(\003\022\017\n\007Sc"
"eneID\030\005 \001(\003\022\037\n\tclient_id\030\006 \001(\0132\014.NFMsg.I"
"dent\022\017\n\007groupID\030\007 \001(\003\"v\n\017AckSwitchServer"
"\022\034\n\006selfid\030\001 \001(\0132\014.NFMsg.Ident\022\025\n\rself_s"
"erverid\030\002 \001(\003\022\027\n\017target_serverid\030\003 \001(\003\022\025"
"\n\rgate_serverid\030\004 \001(\003b\006proto3"
;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_NFMsgShare_2eproto_deps[2] = {
&::descriptor_table_NFDefine_2eproto,
&::descriptor_table_NFMsgBase_2eproto,
};
static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_NFMsgShare_2eproto_sccs[46] = {
&scc_info_AckEndBattle_NFMsgShare_2eproto.base,
&scc_info_AckPlayerEntryList_NFMsgShare_2eproto.base,
&scc_info_AckPlayerLeaveList_NFMsgShare_2eproto.base,
&scc_info_AckSceneBuildings_NFMsgShare_2eproto.base,
&scc_info_AckSearchClan_NFMsgShare_2eproto.base,
&scc_info_AckSearchClan_SearchClanObject_NFMsgShare_2eproto.base,
&scc_info_AckSearchOppnent_NFMsgShare_2eproto.base,
&scc_info_AckSwitchServer_NFMsgShare_2eproto.base,
&scc_info_CurrencyStruct_NFMsgShare_2eproto.base,
&scc_info_EffectData_NFMsgShare_2eproto.base,
&scc_info_ItemStruct_NFMsgShare_2eproto.base,
&scc_info_PVPPlayerInfo_NFMsgShare_2eproto.base,
&scc_info_PlayerEntryInfo_NFMsgShare_2eproto.base,
&scc_info_ReqAcceptTask_NFMsgShare_2eproto.base,
&scc_info_ReqAckCancelSearch_NFMsgShare_2eproto.base,
&scc_info_ReqAckCreateClan_NFMsgShare_2eproto.base,
&scc_info_ReqAckEnterGameSuccess_NFMsgShare_2eproto.base,
&scc_info_ReqAckHomeScene_NFMsgShare_2eproto.base,
&scc_info_ReqAckJoinClan_NFMsgShare_2eproto.base,
&scc_info_ReqAckLeaveClan_NFMsgShare_2eproto.base,
&scc_info_ReqAckOprClanMember_NFMsgShare_2eproto.base,
&scc_info_ReqAckPlayerChat_NFMsgShare_2eproto.base,
&scc_info_ReqAckPlayerMove_NFMsgShare_2eproto.base,
&scc_info_ReqAckPlayerPosSync_NFMsgShare_2eproto.base,
&scc_info_ReqAckReliveHero_NFMsgShare_2eproto.base,
&scc_info_ReqAckSwapScene_NFMsgShare_2eproto.base,
&scc_info_ReqAckSynData_NFMsgShare_2eproto.base,
&scc_info_ReqAckUseItem_NFMsgShare_2eproto.base,
&scc_info_ReqAckUseSkill_NFMsgShare_2eproto.base,
&scc_info_ReqAddSceneBuilding_NFMsgShare_2eproto.base,
&scc_info_ReqBuyItemFromShop_NFMsgShare_2eproto.base,
&scc_info_ReqCompeleteTask_NFMsgShare_2eproto.base,
&scc_info_ReqEndBattle_NFMsgShare_2eproto.base,
&scc_info_ReqEnterClanEctype_NFMsgShare_2eproto.base,
&scc_info_ReqEnterGameServer_NFMsgShare_2eproto.base,
&scc_info_ReqHeartBeat_NFMsgShare_2eproto.base,
&scc_info_ReqLeaveGameServer_NFMsgShare_2eproto.base,
&scc_info_ReqPickDropItem_NFMsgShare_2eproto.base,
&scc_info_ReqSceneBuildings_NFMsgShare_2eproto.base,
&scc_info_ReqSearchClan_NFMsgShare_2eproto.base,
&scc_info_ReqSearchOppnent_NFMsgShare_2eproto.base,
&scc_info_ReqSendMail_NFMsgShare_2eproto.base,
&scc_info_ReqSetFightHero_NFMsgShare_2eproto.base,
&scc_info_ReqStoreSceneBuildings_NFMsgShare_2eproto.base,
&scc_info_ReqSwitchFightHero_NFMsgShare_2eproto.base,
&scc_info_ReqSwitchServer_NFMsgShare_2eproto.base,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_NFMsgShare_2eproto_once;
static bool descriptor_table_NFMsgShare_2eproto_initialized = false;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_NFMsgShare_2eproto = {
&descriptor_table_NFMsgShare_2eproto_initialized, descriptor_table_protodef_NFMsgShare_2eproto, "NFMsgShare.proto", 6149,
&descriptor_table_NFMsgShare_2eproto_once, descriptor_table_NFMsgShare_2eproto_sccs, descriptor_table_NFMsgShare_2eproto_deps, 46, 2,
schemas, file_default_instances, TableStruct_NFMsgShare_2eproto::offsets,
file_level_metadata_NFMsgShare_2eproto, 46, file_level_enum_descriptors_NFMsgShare_2eproto, file_level_service_descriptors_NFMsgShare_2eproto,
};
// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_NFMsgShare_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_NFMsgShare_2eproto), true);
namespace NFMsg {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReqAckSynData_SynType_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_NFMsgShare_2eproto);
return file_level_enum_descriptors_NFMsgShare_2eproto[0];
}
bool ReqAckSynData_SynType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
return true;
default:
return false;
}
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr ReqAckSynData_SynType ReqAckSynData::EST_UNKNOW;
constexpr ReqAckSynData_SynType ReqAckSynData::EST_GROUP;
constexpr ReqAckSynData_SynType ReqAckSynData::EST_SCENE;
constexpr ReqAckSynData_SynType ReqAckSynData::EST_CLAN;
constexpr ReqAckSynData_SynType ReqAckSynData::EST_FRIEND;
constexpr ReqAckSynData_SynType ReqAckSynData::SynType_MIN;
constexpr ReqAckSynData_SynType ReqAckSynData::SynType_MAX;
constexpr int ReqAckSynData::SynType_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReqAckPlayerChat_EGameChatChannel_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_NFMsgShare_2eproto);
return file_level_enum_descriptors_NFMsgShare_2eproto[1];
}
bool ReqAckPlayerChat_EGameChatChannel_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return true;
default:
return false;
}
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr ReqAckPlayerChat_EGameChatChannel ReqAckPlayerChat::EGCC_GLOBAL;
constexpr ReqAckPlayerChat_EGameChatChannel ReqAckPlayerChat::EGCC_CLAN;
constexpr ReqAckPlayerChat_EGameChatChannel ReqAckPlayerChat::EGCC_FRIEND;
constexpr ReqAckPlayerChat_EGameChatChannel ReqAckPlayerChat::EGCC_BATTLE;
constexpr ReqAckPlayerChat_EGameChatChannel ReqAckPlayerChat::EGCC_TEAM;
constexpr ReqAckPlayerChat_EGameChatChannel ReqAckPlayerChat::EGCC_ROOM;
constexpr ReqAckPlayerChat_EGameChatChannel ReqAckPlayerChat::EGameChatChannel_MIN;
constexpr ReqAckPlayerChat_EGameChatChannel ReqAckPlayerChat::EGameChatChannel_MAX;
constexpr int ReqAckPlayerChat::EGameChatChannel_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReqAckPlayerChat_EGameChatType_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_NFMsgShare_2eproto);
return file_level_enum_descriptors_NFMsgShare_2eproto[2];
}
bool ReqAckPlayerChat_EGameChatType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 10:
case 11:
case 12:
return true;
default:
return false;
}
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr ReqAckPlayerChat_EGameChatType ReqAckPlayerChat::EGCT_TEXT;
constexpr ReqAckPlayerChat_EGameChatType ReqAckPlayerChat::EGCT_VOICE;
constexpr ReqAckPlayerChat_EGameChatType ReqAckPlayerChat::EGCT_EMOJI;
constexpr ReqAckPlayerChat_EGameChatType ReqAckPlayerChat::EGCT_DONATE_HERO;
constexpr ReqAckPlayerChat_EGameChatType ReqAckPlayerChat::EGCT_DONATE_BUILDING;
constexpr ReqAckPlayerChat_EGameChatType ReqAckPlayerChat::EGCT_DONATE_ITEM;
constexpr ReqAckPlayerChat_EGameChatType ReqAckPlayerChat::EGameChatType_MIN;
constexpr ReqAckPlayerChat_EGameChatType ReqAckPlayerChat::EGameChatType_MAX;
constexpr int ReqAckPlayerChat::EGameChatType_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EffectData_EResultType_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_NFMsgShare_2eproto);
return file_level_enum_descriptors_NFMsgShare_2eproto[3];
}
bool EffectData_EResultType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
return true;
default:
return false;
}
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr EffectData_EResultType EffectData::EET_FAIL;
constexpr EffectData_EResultType EffectData::EET_SUCCESS;
constexpr EffectData_EResultType EffectData::EET_REFUSE;
constexpr EffectData_EResultType EffectData::EET_MISS;
constexpr EffectData_EResultType EffectData::EET_CRIT;
constexpr EffectData_EResultType EffectData::EResultType_MIN;
constexpr EffectData_EResultType EffectData::EResultType_MAX;
constexpr int EffectData::EResultType_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReqAckSwapScene_EGameSwapType_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_NFMsgShare_2eproto);
return file_level_enum_descriptors_NFMsgShare_2eproto[4];
}
bool ReqAckSwapScene_EGameSwapType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr ReqAckSwapScene_EGameSwapType ReqAckSwapScene::EGST_NARMAL;
constexpr ReqAckSwapScene_EGameSwapType ReqAckSwapScene::EGST_CLONE;
constexpr ReqAckSwapScene_EGameSwapType ReqAckSwapScene::EGST_ARENA;
constexpr ReqAckSwapScene_EGameSwapType ReqAckSwapScene::EGST_MIRROR;
constexpr ReqAckSwapScene_EGameSwapType ReqAckSwapScene::EGameSwapType_MIN;
constexpr ReqAckSwapScene_EGameSwapType ReqAckSwapScene::EGameSwapType_MAX;
constexpr int ReqAckSwapScene::EGameSwapType_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReqAckOprClanMember_EGClanMemberOprType_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_NFMsgShare_2eproto);
return file_level_enum_descriptors_NFMsgShare_2eproto[5];
}
bool ReqAckOprClanMember_EGClanMemberOprType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
return true;
default:
return false;
}
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr ReqAckOprClanMember_EGClanMemberOprType ReqAckOprClanMember::EGAT_DOWN;
constexpr ReqAckOprClanMember_EGClanMemberOprType ReqAckOprClanMember::EGAT_UP;
constexpr ReqAckOprClanMember_EGClanMemberOprType ReqAckOprClanMember::EGAT_KICK;
constexpr ReqAckOprClanMember_EGClanMemberOprType ReqAckOprClanMember::EGClanMemberOprType_MIN;
constexpr ReqAckOprClanMember_EGClanMemberOprType ReqAckOprClanMember::EGClanMemberOprType_MAX;
constexpr int ReqAckOprClanMember::EGClanMemberOprType_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
// ===================================================================
void ReqEnterGameServer::InitAsDefaultInstance() {
::NFMsg::_ReqEnterGameServer_default_instance_._instance.get_mutable()->id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqEnterGameServer::_Internal {
public:
static const ::NFMsg::Ident& id(const ReqEnterGameServer* msg);
};
const ::NFMsg::Ident&
ReqEnterGameServer::_Internal::id(const ReqEnterGameServer* msg) {
return *msg->id_;
}
void ReqEnterGameServer::clear_id() {
if (GetArenaNoVirtual() == nullptr && id_ != nullptr) {
delete id_;
}
id_ = nullptr;
}
ReqEnterGameServer::ReqEnterGameServer()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqEnterGameServer)
}
ReqEnterGameServer::ReqEnterGameServer(const ReqEnterGameServer& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
account_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_account().empty()) {
account_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.account_);
}
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_name().empty()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (from._internal_has_id()) {
id_ = new ::NFMsg::Ident(*from.id_);
} else {
id_ = nullptr;
}
game_id_ = from.game_id_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqEnterGameServer)
}
void ReqEnterGameServer::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqEnterGameServer_NFMsgShare_2eproto.base);
account_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&game_id_) -
reinterpret_cast<char*>(&id_)) + sizeof(game_id_));
}
ReqEnterGameServer::~ReqEnterGameServer() {
// @@protoc_insertion_point(destructor:NFMsg.ReqEnterGameServer)
SharedDtor();
}
void ReqEnterGameServer::SharedDtor() {
account_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete id_;
}
void ReqEnterGameServer::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqEnterGameServer& ReqEnterGameServer::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqEnterGameServer_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqEnterGameServer::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqEnterGameServer)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
account_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && id_ != nullptr) {
delete id_;
}
id_ = nullptr;
game_id_ = 0;
_internal_metadata_.Clear();
}
const char* ReqEnterGameServer::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes account = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_account(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 game_id = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
game_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes name = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_name(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqEnterGameServer::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqEnterGameServer)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident id = 1;
if (this->has_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::id(this), target, stream);
}
// bytes account = 2;
if (this->account().size() > 0) {
target = stream->WriteBytesMaybeAliased(
2, this->_internal_account(), target);
}
// int32 game_id = 3;
if (this->game_id() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_game_id(), target);
}
// bytes name = 4;
if (this->name().size() > 0) {
target = stream->WriteBytesMaybeAliased(
4, this->_internal_name(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqEnterGameServer)
return target;
}
size_t ReqEnterGameServer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqEnterGameServer)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes account = 2;
if (this->account().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_account());
}
// bytes name = 4;
if (this->name().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_name());
}
// .NFMsg.Ident id = 1;
if (this->has_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*id_);
}
// int32 game_id = 3;
if (this->game_id() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_game_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqEnterGameServer::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqEnterGameServer)
GOOGLE_DCHECK_NE(&from, this);
const ReqEnterGameServer* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqEnterGameServer>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqEnterGameServer)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqEnterGameServer)
MergeFrom(*source);
}
}
void ReqEnterGameServer::MergeFrom(const ReqEnterGameServer& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqEnterGameServer)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.account().size() > 0) {
account_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.account_);
}
if (from.name().size() > 0) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (from.has_id()) {
_internal_mutable_id()->::NFMsg::Ident::MergeFrom(from._internal_id());
}
if (from.game_id() != 0) {
_internal_set_game_id(from._internal_game_id());
}
}
void ReqEnterGameServer::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqEnterGameServer)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqEnterGameServer::CopyFrom(const ReqEnterGameServer& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqEnterGameServer)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqEnterGameServer::IsInitialized() const {
return true;
}
void ReqEnterGameServer::InternalSwap(ReqEnterGameServer* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
account_.Swap(&other->account_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(id_, other->id_);
swap(game_id_, other->game_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqEnterGameServer::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckEnterGameSuccess::InitAsDefaultInstance() {
}
class ReqAckEnterGameSuccess::_Internal {
public:
};
ReqAckEnterGameSuccess::ReqAckEnterGameSuccess()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckEnterGameSuccess)
}
ReqAckEnterGameSuccess::ReqAckEnterGameSuccess(const ReqAckEnterGameSuccess& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
arg_ = from.arg_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckEnterGameSuccess)
}
void ReqAckEnterGameSuccess::SharedCtor() {
arg_ = 0;
}
ReqAckEnterGameSuccess::~ReqAckEnterGameSuccess() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckEnterGameSuccess)
SharedDtor();
}
void ReqAckEnterGameSuccess::SharedDtor() {
}
void ReqAckEnterGameSuccess::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckEnterGameSuccess& ReqAckEnterGameSuccess::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckEnterGameSuccess_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckEnterGameSuccess::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckEnterGameSuccess)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
arg_ = 0;
_internal_metadata_.Clear();
}
const char* ReqAckEnterGameSuccess::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 arg = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
arg_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckEnterGameSuccess::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckEnterGameSuccess)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 arg = 1;
if (this->arg() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_arg(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckEnterGameSuccess)
return target;
}
size_t ReqAckEnterGameSuccess::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckEnterGameSuccess)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// int32 arg = 1;
if (this->arg() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_arg());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckEnterGameSuccess::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckEnterGameSuccess)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckEnterGameSuccess* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckEnterGameSuccess>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckEnterGameSuccess)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckEnterGameSuccess)
MergeFrom(*source);
}
}
void ReqAckEnterGameSuccess::MergeFrom(const ReqAckEnterGameSuccess& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckEnterGameSuccess)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.arg() != 0) {
_internal_set_arg(from._internal_arg());
}
}
void ReqAckEnterGameSuccess::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckEnterGameSuccess)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckEnterGameSuccess::CopyFrom(const ReqAckEnterGameSuccess& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckEnterGameSuccess)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckEnterGameSuccess::IsInitialized() const {
return true;
}
void ReqAckEnterGameSuccess::InternalSwap(ReqAckEnterGameSuccess* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(arg_, other->arg_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckEnterGameSuccess::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqHeartBeat::InitAsDefaultInstance() {
}
class ReqHeartBeat::_Internal {
public:
};
ReqHeartBeat::ReqHeartBeat()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqHeartBeat)
}
ReqHeartBeat::ReqHeartBeat(const ReqHeartBeat& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
arg_ = from.arg_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqHeartBeat)
}
void ReqHeartBeat::SharedCtor() {
arg_ = 0;
}
ReqHeartBeat::~ReqHeartBeat() {
// @@protoc_insertion_point(destructor:NFMsg.ReqHeartBeat)
SharedDtor();
}
void ReqHeartBeat::SharedDtor() {
}
void ReqHeartBeat::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqHeartBeat& ReqHeartBeat::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqHeartBeat_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqHeartBeat::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqHeartBeat)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
arg_ = 0;
_internal_metadata_.Clear();
}
const char* ReqHeartBeat::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 arg = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
arg_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqHeartBeat::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqHeartBeat)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 arg = 1;
if (this->arg() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_arg(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqHeartBeat)
return target;
}
size_t ReqHeartBeat::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqHeartBeat)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// int32 arg = 1;
if (this->arg() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_arg());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqHeartBeat::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqHeartBeat)
GOOGLE_DCHECK_NE(&from, this);
const ReqHeartBeat* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqHeartBeat>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqHeartBeat)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqHeartBeat)
MergeFrom(*source);
}
}
void ReqHeartBeat::MergeFrom(const ReqHeartBeat& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqHeartBeat)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.arg() != 0) {
_internal_set_arg(from._internal_arg());
}
}
void ReqHeartBeat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqHeartBeat)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqHeartBeat::CopyFrom(const ReqHeartBeat& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqHeartBeat)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqHeartBeat::IsInitialized() const {
return true;
}
void ReqHeartBeat::InternalSwap(ReqHeartBeat* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(arg_, other->arg_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqHeartBeat::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqLeaveGameServer::InitAsDefaultInstance() {
}
class ReqLeaveGameServer::_Internal {
public:
};
ReqLeaveGameServer::ReqLeaveGameServer()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqLeaveGameServer)
}
ReqLeaveGameServer::ReqLeaveGameServer(const ReqLeaveGameServer& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
arg_ = from.arg_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqLeaveGameServer)
}
void ReqLeaveGameServer::SharedCtor() {
arg_ = 0;
}
ReqLeaveGameServer::~ReqLeaveGameServer() {
// @@protoc_insertion_point(destructor:NFMsg.ReqLeaveGameServer)
SharedDtor();
}
void ReqLeaveGameServer::SharedDtor() {
}
void ReqLeaveGameServer::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqLeaveGameServer& ReqLeaveGameServer::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqLeaveGameServer_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqLeaveGameServer::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqLeaveGameServer)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
arg_ = 0;
_internal_metadata_.Clear();
}
const char* ReqLeaveGameServer::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 arg = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
arg_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqLeaveGameServer::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqLeaveGameServer)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 arg = 1;
if (this->arg() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_arg(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqLeaveGameServer)
return target;
}
size_t ReqLeaveGameServer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqLeaveGameServer)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// int32 arg = 1;
if (this->arg() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_arg());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqLeaveGameServer::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqLeaveGameServer)
GOOGLE_DCHECK_NE(&from, this);
const ReqLeaveGameServer* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqLeaveGameServer>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqLeaveGameServer)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqLeaveGameServer)
MergeFrom(*source);
}
}
void ReqLeaveGameServer::MergeFrom(const ReqLeaveGameServer& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqLeaveGameServer)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.arg() != 0) {
_internal_set_arg(from._internal_arg());
}
}
void ReqLeaveGameServer::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqLeaveGameServer)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqLeaveGameServer::CopyFrom(const ReqLeaveGameServer& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqLeaveGameServer)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqLeaveGameServer::IsInitialized() const {
return true;
}
void ReqLeaveGameServer::InternalSwap(ReqLeaveGameServer* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(arg_, other->arg_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqLeaveGameServer::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void PlayerEntryInfo::InitAsDefaultInstance() {
::NFMsg::_PlayerEntryInfo_default_instance_._instance.get_mutable()->object_guid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class PlayerEntryInfo::_Internal {
public:
static const ::NFMsg::Ident& object_guid(const PlayerEntryInfo* msg);
};
const ::NFMsg::Ident&
PlayerEntryInfo::_Internal::object_guid(const PlayerEntryInfo* msg) {
return *msg->object_guid_;
}
void PlayerEntryInfo::clear_object_guid() {
if (GetArenaNoVirtual() == nullptr && object_guid_ != nullptr) {
delete object_guid_;
}
object_guid_ = nullptr;
}
PlayerEntryInfo::PlayerEntryInfo()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.PlayerEntryInfo)
}
PlayerEntryInfo::PlayerEntryInfo(const PlayerEntryInfo& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
config_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_config_id().empty()) {
config_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.config_id_);
}
class_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_class_id().empty()) {
class_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.class_id_);
}
if (from._internal_has_object_guid()) {
object_guid_ = new ::NFMsg::Ident(*from.object_guid_);
} else {
object_guid_ = nullptr;
}
::memcpy(&x_, &from.x_,
static_cast<size_t>(reinterpret_cast<char*>(&scene_id_) -
reinterpret_cast<char*>(&x_)) + sizeof(scene_id_));
// @@protoc_insertion_point(copy_constructor:NFMsg.PlayerEntryInfo)
}
void PlayerEntryInfo::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PlayerEntryInfo_NFMsgShare_2eproto.base);
config_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
class_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&object_guid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&scene_id_) -
reinterpret_cast<char*>(&object_guid_)) + sizeof(scene_id_));
}
PlayerEntryInfo::~PlayerEntryInfo() {
// @@protoc_insertion_point(destructor:NFMsg.PlayerEntryInfo)
SharedDtor();
}
void PlayerEntryInfo::SharedDtor() {
config_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
class_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete object_guid_;
}
void PlayerEntryInfo::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const PlayerEntryInfo& PlayerEntryInfo::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PlayerEntryInfo_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void PlayerEntryInfo::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.PlayerEntryInfo)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
config_id_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
class_id_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && object_guid_ != nullptr) {
delete object_guid_;
}
object_guid_ = nullptr;
::memset(&x_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&scene_id_) -
reinterpret_cast<char*>(&x_)) + sizeof(scene_id_));
_internal_metadata_.Clear();
}
const char* PlayerEntryInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident object_guid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_object_guid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// float x = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 21)) {
x_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else goto handle_unusual;
continue;
// float y = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
y_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else goto handle_unusual;
continue;
// float z = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37)) {
z_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else goto handle_unusual;
continue;
// int32 career_type = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
career_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 player_state = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
player_state_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes config_id = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_config_id(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 scene_id = 8;
case 8:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
scene_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes class_id = 9;
case 9:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_class_id(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* PlayerEntryInfo::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.PlayerEntryInfo)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident object_guid = 1;
if (this->has_object_guid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::object_guid(this), target, stream);
}
// float x = 2;
if (!(this->x() <= 0 && this->x() >= 0)) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_x(), target);
}
// float y = 3;
if (!(this->y() <= 0 && this->y() >= 0)) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_y(), target);
}
// float z = 4;
if (!(this->z() <= 0 && this->z() >= 0)) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_z(), target);
}
// int32 career_type = 5;
if (this->career_type() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_career_type(), target);
}
// int32 player_state = 6;
if (this->player_state() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_player_state(), target);
}
// bytes config_id = 7;
if (this->config_id().size() > 0) {
target = stream->WriteBytesMaybeAliased(
7, this->_internal_config_id(), target);
}
// int32 scene_id = 8;
if (this->scene_id() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(8, this->_internal_scene_id(), target);
}
// bytes class_id = 9;
if (this->class_id().size() > 0) {
target = stream->WriteBytesMaybeAliased(
9, this->_internal_class_id(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.PlayerEntryInfo)
return target;
}
size_t PlayerEntryInfo::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.PlayerEntryInfo)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes config_id = 7;
if (this->config_id().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_config_id());
}
// bytes class_id = 9;
if (this->class_id().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_class_id());
}
// .NFMsg.Ident object_guid = 1;
if (this->has_object_guid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*object_guid_);
}
// float x = 2;
if (!(this->x() <= 0 && this->x() >= 0)) {
total_size += 1 + 4;
}
// float y = 3;
if (!(this->y() <= 0 && this->y() >= 0)) {
total_size += 1 + 4;
}
// float z = 4;
if (!(this->z() <= 0 && this->z() >= 0)) {
total_size += 1 + 4;
}
// int32 career_type = 5;
if (this->career_type() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_career_type());
}
// int32 player_state = 6;
if (this->player_state() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_player_state());
}
// int32 scene_id = 8;
if (this->scene_id() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_scene_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void PlayerEntryInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.PlayerEntryInfo)
GOOGLE_DCHECK_NE(&from, this);
const PlayerEntryInfo* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<PlayerEntryInfo>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.PlayerEntryInfo)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.PlayerEntryInfo)
MergeFrom(*source);
}
}
void PlayerEntryInfo::MergeFrom(const PlayerEntryInfo& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.PlayerEntryInfo)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.config_id().size() > 0) {
config_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.config_id_);
}
if (from.class_id().size() > 0) {
class_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.class_id_);
}
if (from.has_object_guid()) {
_internal_mutable_object_guid()->::NFMsg::Ident::MergeFrom(from._internal_object_guid());
}
if (!(from.x() <= 0 && from.x() >= 0)) {
_internal_set_x(from._internal_x());
}
if (!(from.y() <= 0 && from.y() >= 0)) {
_internal_set_y(from._internal_y());
}
if (!(from.z() <= 0 && from.z() >= 0)) {
_internal_set_z(from._internal_z());
}
if (from.career_type() != 0) {
_internal_set_career_type(from._internal_career_type());
}
if (from.player_state() != 0) {
_internal_set_player_state(from._internal_player_state());
}
if (from.scene_id() != 0) {
_internal_set_scene_id(from._internal_scene_id());
}
}
void PlayerEntryInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.PlayerEntryInfo)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void PlayerEntryInfo::CopyFrom(const PlayerEntryInfo& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.PlayerEntryInfo)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool PlayerEntryInfo::IsInitialized() const {
return true;
}
void PlayerEntryInfo::InternalSwap(PlayerEntryInfo* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
config_id_.Swap(&other->config_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
class_id_.Swap(&other->class_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(object_guid_, other->object_guid_);
swap(x_, other->x_);
swap(y_, other->y_);
swap(z_, other->z_);
swap(career_type_, other->career_type_);
swap(player_state_, other->player_state_);
swap(scene_id_, other->scene_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata PlayerEntryInfo::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void AckPlayerEntryList::InitAsDefaultInstance() {
}
class AckPlayerEntryList::_Internal {
public:
};
AckPlayerEntryList::AckPlayerEntryList()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.AckPlayerEntryList)
}
AckPlayerEntryList::AckPlayerEntryList(const AckPlayerEntryList& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
object_list_(from.object_list_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:NFMsg.AckPlayerEntryList)
}
void AckPlayerEntryList::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AckPlayerEntryList_NFMsgShare_2eproto.base);
}
AckPlayerEntryList::~AckPlayerEntryList() {
// @@protoc_insertion_point(destructor:NFMsg.AckPlayerEntryList)
SharedDtor();
}
void AckPlayerEntryList::SharedDtor() {
}
void AckPlayerEntryList::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const AckPlayerEntryList& AckPlayerEntryList::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AckPlayerEntryList_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void AckPlayerEntryList::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.AckPlayerEntryList)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
object_list_.Clear();
_internal_metadata_.Clear();
}
const char* AckPlayerEntryList::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// repeated .NFMsg.PlayerEntryInfo object_list = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_object_list(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* AckPlayerEntryList::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.AckPlayerEntryList)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .NFMsg.PlayerEntryInfo object_list = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_object_list_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(1, this->_internal_object_list(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.AckPlayerEntryList)
return target;
}
size_t AckPlayerEntryList::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.AckPlayerEntryList)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.PlayerEntryInfo object_list = 1;
total_size += 1UL * this->_internal_object_list_size();
for (const auto& msg : this->object_list_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void AckPlayerEntryList::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.AckPlayerEntryList)
GOOGLE_DCHECK_NE(&from, this);
const AckPlayerEntryList* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AckPlayerEntryList>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.AckPlayerEntryList)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.AckPlayerEntryList)
MergeFrom(*source);
}
}
void AckPlayerEntryList::MergeFrom(const AckPlayerEntryList& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.AckPlayerEntryList)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
object_list_.MergeFrom(from.object_list_);
}
void AckPlayerEntryList::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.AckPlayerEntryList)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AckPlayerEntryList::CopyFrom(const AckPlayerEntryList& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.AckPlayerEntryList)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AckPlayerEntryList::IsInitialized() const {
return true;
}
void AckPlayerEntryList::InternalSwap(AckPlayerEntryList* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
object_list_.InternalSwap(&other->object_list_);
}
::PROTOBUF_NAMESPACE_ID::Metadata AckPlayerEntryList::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void AckPlayerLeaveList::InitAsDefaultInstance() {
}
class AckPlayerLeaveList::_Internal {
public:
};
void AckPlayerLeaveList::clear_object_list() {
object_list_.Clear();
}
AckPlayerLeaveList::AckPlayerLeaveList()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.AckPlayerLeaveList)
}
AckPlayerLeaveList::AckPlayerLeaveList(const AckPlayerLeaveList& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
object_list_(from.object_list_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:NFMsg.AckPlayerLeaveList)
}
void AckPlayerLeaveList::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AckPlayerLeaveList_NFMsgShare_2eproto.base);
}
AckPlayerLeaveList::~AckPlayerLeaveList() {
// @@protoc_insertion_point(destructor:NFMsg.AckPlayerLeaveList)
SharedDtor();
}
void AckPlayerLeaveList::SharedDtor() {
}
void AckPlayerLeaveList::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const AckPlayerLeaveList& AckPlayerLeaveList::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AckPlayerLeaveList_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void AckPlayerLeaveList::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.AckPlayerLeaveList)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
object_list_.Clear();
_internal_metadata_.Clear();
}
const char* AckPlayerLeaveList::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// repeated .NFMsg.Ident object_list = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_object_list(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* AckPlayerLeaveList::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.AckPlayerLeaveList)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .NFMsg.Ident object_list = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_object_list_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(1, this->_internal_object_list(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.AckPlayerLeaveList)
return target;
}
size_t AckPlayerLeaveList::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.AckPlayerLeaveList)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.Ident object_list = 1;
total_size += 1UL * this->_internal_object_list_size();
for (const auto& msg : this->object_list_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void AckPlayerLeaveList::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.AckPlayerLeaveList)
GOOGLE_DCHECK_NE(&from, this);
const AckPlayerLeaveList* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AckPlayerLeaveList>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.AckPlayerLeaveList)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.AckPlayerLeaveList)
MergeFrom(*source);
}
}
void AckPlayerLeaveList::MergeFrom(const AckPlayerLeaveList& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.AckPlayerLeaveList)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
object_list_.MergeFrom(from.object_list_);
}
void AckPlayerLeaveList::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.AckPlayerLeaveList)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AckPlayerLeaveList::CopyFrom(const AckPlayerLeaveList& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.AckPlayerLeaveList)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AckPlayerLeaveList::IsInitialized() const {
return true;
}
void AckPlayerLeaveList::InternalSwap(AckPlayerLeaveList* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
object_list_.InternalSwap(&other->object_list_);
}
::PROTOBUF_NAMESPACE_ID::Metadata AckPlayerLeaveList::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckSynData::InitAsDefaultInstance() {
::NFMsg::_ReqAckSynData_default_instance_._instance.get_mutable()->syser_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckSynData::_Internal {
public:
static const ::NFMsg::Ident& syser(const ReqAckSynData* msg);
};
const ::NFMsg::Ident&
ReqAckSynData::_Internal::syser(const ReqAckSynData* msg) {
return *msg->syser_;
}
void ReqAckSynData::clear_syser() {
if (GetArenaNoVirtual() == nullptr && syser_ != nullptr) {
delete syser_;
}
syser_ = nullptr;
}
void ReqAckSynData::clear_object_list() {
object_list_.Clear();
}
ReqAckSynData::ReqAckSynData()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckSynData)
}
ReqAckSynData::ReqAckSynData(const ReqAckSynData& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
object_list_(from.object_list_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_data().empty()) {
data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.data_);
}
if (from._internal_has_syser()) {
syser_ = new ::NFMsg::Ident(*from.syser_);
} else {
syser_ = nullptr;
}
::memcpy(&syn_type_, &from.syn_type_,
static_cast<size_t>(reinterpret_cast<char*>(&msg_id_) -
reinterpret_cast<char*>(&syn_type_)) + sizeof(msg_id_));
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckSynData)
}
void ReqAckSynData::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckSynData_NFMsgShare_2eproto.base);
data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&syser_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&msg_id_) -
reinterpret_cast<char*>(&syser_)) + sizeof(msg_id_));
}
ReqAckSynData::~ReqAckSynData() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckSynData)
SharedDtor();
}
void ReqAckSynData::SharedDtor() {
data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete syser_;
}
void ReqAckSynData::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckSynData& ReqAckSynData::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckSynData_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckSynData::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckSynData)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
object_list_.Clear();
data_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && syser_ != nullptr) {
delete syser_;
}
syser_ = nullptr;
::memset(&syn_type_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&msg_id_) -
reinterpret_cast<char*>(&syn_type_)) + sizeof(msg_id_));
_internal_metadata_.Clear();
}
const char* ReqAckSynData::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident syser = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_syser(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .NFMsg.Ident object_list = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_object_list(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
} else goto handle_unusual;
continue;
// bytes data = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_data(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.ReqAckSynData.SynType syn_type = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_syn_type(static_cast<::NFMsg::ReqAckSynData_SynType>(val));
} else goto handle_unusual;
continue;
// .NFMsg.ESynMsgID msg_id = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_msg_id(static_cast<::NFMsg::ESynMsgID>(val));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckSynData::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckSynData)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident syser = 1;
if (this->has_syser()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::syser(this), target, stream);
}
// repeated .NFMsg.Ident object_list = 2;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_object_list_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(2, this->_internal_object_list(i), target, stream);
}
// bytes data = 3;
if (this->data().size() > 0) {
target = stream->WriteBytesMaybeAliased(
3, this->_internal_data(), target);
}
// .NFMsg.ReqAckSynData.SynType syn_type = 4;
if (this->syn_type() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
4, this->_internal_syn_type(), target);
}
// .NFMsg.ESynMsgID msg_id = 5;
if (this->msg_id() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
5, this->_internal_msg_id(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckSynData)
return target;
}
size_t ReqAckSynData::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckSynData)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.Ident object_list = 2;
total_size += 1UL * this->_internal_object_list_size();
for (const auto& msg : this->object_list_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// bytes data = 3;
if (this->data().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_data());
}
// .NFMsg.Ident syser = 1;
if (this->has_syser()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*syser_);
}
// .NFMsg.ReqAckSynData.SynType syn_type = 4;
if (this->syn_type() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_syn_type());
}
// .NFMsg.ESynMsgID msg_id = 5;
if (this->msg_id() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_msg_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckSynData::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckSynData)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckSynData* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckSynData>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckSynData)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckSynData)
MergeFrom(*source);
}
}
void ReqAckSynData::MergeFrom(const ReqAckSynData& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckSynData)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
object_list_.MergeFrom(from.object_list_);
if (from.data().size() > 0) {
data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.data_);
}
if (from.has_syser()) {
_internal_mutable_syser()->::NFMsg::Ident::MergeFrom(from._internal_syser());
}
if (from.syn_type() != 0) {
_internal_set_syn_type(from._internal_syn_type());
}
if (from.msg_id() != 0) {
_internal_set_msg_id(from._internal_msg_id());
}
}
void ReqAckSynData::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckSynData)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckSynData::CopyFrom(const ReqAckSynData& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckSynData)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckSynData::IsInitialized() const {
return true;
}
void ReqAckSynData::InternalSwap(ReqAckSynData* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
object_list_.InternalSwap(&other->object_list_);
data_.Swap(&other->data_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(syser_, other->syser_);
swap(syn_type_, other->syn_type_);
swap(msg_id_, other->msg_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckSynData::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckPlayerMove::InitAsDefaultInstance() {
::NFMsg::_ReqAckPlayerMove_default_instance_._instance.get_mutable()->mover_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckPlayerMove::_Internal {
public:
static const ::NFMsg::Ident& mover(const ReqAckPlayerMove* msg);
};
const ::NFMsg::Ident&
ReqAckPlayerMove::_Internal::mover(const ReqAckPlayerMove* msg) {
return *msg->mover_;
}
void ReqAckPlayerMove::clear_mover() {
if (GetArenaNoVirtual() == nullptr && mover_ != nullptr) {
delete mover_;
}
mover_ = nullptr;
}
void ReqAckPlayerMove::clear_target_pos() {
target_pos_.Clear();
}
void ReqAckPlayerMove::clear_source_pos() {
source_pos_.Clear();
}
void ReqAckPlayerMove::clear_move_direction() {
move_direction_.Clear();
}
ReqAckPlayerMove::ReqAckPlayerMove()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckPlayerMove)
}
ReqAckPlayerMove::ReqAckPlayerMove(const ReqAckPlayerMove& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
target_pos_(from.target_pos_),
source_pos_(from.source_pos_),
move_direction_(from.move_direction_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_mover()) {
mover_ = new ::NFMsg::Ident(*from.mover_);
} else {
mover_ = nullptr;
}
::memcpy(&movetype_, &from.movetype_,
static_cast<size_t>(reinterpret_cast<char*>(&laststate_) -
reinterpret_cast<char*>(&movetype_)) + sizeof(laststate_));
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckPlayerMove)
}
void ReqAckPlayerMove::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckPlayerMove_NFMsgShare_2eproto.base);
::memset(&mover_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&laststate_) -
reinterpret_cast<char*>(&mover_)) + sizeof(laststate_));
}
ReqAckPlayerMove::~ReqAckPlayerMove() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckPlayerMove)
SharedDtor();
}
void ReqAckPlayerMove::SharedDtor() {
if (this != internal_default_instance()) delete mover_;
}
void ReqAckPlayerMove::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckPlayerMove& ReqAckPlayerMove::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckPlayerMove_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckPlayerMove::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckPlayerMove)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
target_pos_.Clear();
source_pos_.Clear();
move_direction_.Clear();
if (GetArenaNoVirtual() == nullptr && mover_ != nullptr) {
delete mover_;
}
mover_ = nullptr;
::memset(&movetype_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&laststate_) -
reinterpret_cast<char*>(&movetype_)) + sizeof(laststate_));
_internal_metadata_.Clear();
}
const char* ReqAckPlayerMove::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident mover = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_mover(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 moveType = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
movetype_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// float speed = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
speed_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else goto handle_unusual;
continue;
// int32 time = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 lastState = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
laststate_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .NFMsg.Vector3 target_pos = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_target_pos(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
} else goto handle_unusual;
continue;
// repeated .NFMsg.Vector3 source_pos = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_source_pos(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
} else goto handle_unusual;
continue;
// repeated .NFMsg.Vector3 move_direction = 8;
case 8:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_move_direction(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckPlayerMove::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckPlayerMove)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident mover = 1;
if (this->has_mover()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::mover(this), target, stream);
}
// int32 moveType = 2;
if (this->movetype() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_movetype(), target);
}
// float speed = 3;
if (!(this->speed() <= 0 && this->speed() >= 0)) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_speed(), target);
}
// int32 time = 4;
if (this->time() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_time(), target);
}
// int32 lastState = 5;
if (this->laststate() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_laststate(), target);
}
// repeated .NFMsg.Vector3 target_pos = 6;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_target_pos_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(6, this->_internal_target_pos(i), target, stream);
}
// repeated .NFMsg.Vector3 source_pos = 7;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_source_pos_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(7, this->_internal_source_pos(i), target, stream);
}
// repeated .NFMsg.Vector3 move_direction = 8;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_move_direction_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(8, this->_internal_move_direction(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckPlayerMove)
return target;
}
size_t ReqAckPlayerMove::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckPlayerMove)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.Vector3 target_pos = 6;
total_size += 1UL * this->_internal_target_pos_size();
for (const auto& msg : this->target_pos_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// repeated .NFMsg.Vector3 source_pos = 7;
total_size += 1UL * this->_internal_source_pos_size();
for (const auto& msg : this->source_pos_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// repeated .NFMsg.Vector3 move_direction = 8;
total_size += 1UL * this->_internal_move_direction_size();
for (const auto& msg : this->move_direction_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// .NFMsg.Ident mover = 1;
if (this->has_mover()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*mover_);
}
// int32 moveType = 2;
if (this->movetype() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_movetype());
}
// float speed = 3;
if (!(this->speed() <= 0 && this->speed() >= 0)) {
total_size += 1 + 4;
}
// int32 time = 4;
if (this->time() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_time());
}
// int32 lastState = 5;
if (this->laststate() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_laststate());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckPlayerMove::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckPlayerMove)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckPlayerMove* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckPlayerMove>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckPlayerMove)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckPlayerMove)
MergeFrom(*source);
}
}
void ReqAckPlayerMove::MergeFrom(const ReqAckPlayerMove& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckPlayerMove)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
target_pos_.MergeFrom(from.target_pos_);
source_pos_.MergeFrom(from.source_pos_);
move_direction_.MergeFrom(from.move_direction_);
if (from.has_mover()) {
_internal_mutable_mover()->::NFMsg::Ident::MergeFrom(from._internal_mover());
}
if (from.movetype() != 0) {
_internal_set_movetype(from._internal_movetype());
}
if (!(from.speed() <= 0 && from.speed() >= 0)) {
_internal_set_speed(from._internal_speed());
}
if (from.time() != 0) {
_internal_set_time(from._internal_time());
}
if (from.laststate() != 0) {
_internal_set_laststate(from._internal_laststate());
}
}
void ReqAckPlayerMove::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckPlayerMove)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckPlayerMove::CopyFrom(const ReqAckPlayerMove& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckPlayerMove)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckPlayerMove::IsInitialized() const {
return true;
}
void ReqAckPlayerMove::InternalSwap(ReqAckPlayerMove* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
target_pos_.InternalSwap(&other->target_pos_);
source_pos_.InternalSwap(&other->source_pos_);
move_direction_.InternalSwap(&other->move_direction_);
swap(mover_, other->mover_);
swap(movetype_, other->movetype_);
swap(speed_, other->speed_);
swap(time_, other->time_);
swap(laststate_, other->laststate_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckPlayerMove::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckPlayerChat::InitAsDefaultInstance() {
::NFMsg::_ReqAckPlayerChat_default_instance_._instance.get_mutable()->player_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckPlayerChat_default_instance_._instance.get_mutable()->target_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckPlayerChat::_Internal {
public:
static const ::NFMsg::Ident& player_id(const ReqAckPlayerChat* msg);
static const ::NFMsg::Ident& target_id(const ReqAckPlayerChat* msg);
};
const ::NFMsg::Ident&
ReqAckPlayerChat::_Internal::player_id(const ReqAckPlayerChat* msg) {
return *msg->player_id_;
}
const ::NFMsg::Ident&
ReqAckPlayerChat::_Internal::target_id(const ReqAckPlayerChat* msg) {
return *msg->target_id_;
}
void ReqAckPlayerChat::clear_player_id() {
if (GetArenaNoVirtual() == nullptr && player_id_ != nullptr) {
delete player_id_;
}
player_id_ = nullptr;
}
void ReqAckPlayerChat::clear_target_id() {
if (GetArenaNoVirtual() == nullptr && target_id_ != nullptr) {
delete target_id_;
}
target_id_ = nullptr;
}
ReqAckPlayerChat::ReqAckPlayerChat()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckPlayerChat)
}
ReqAckPlayerChat::ReqAckPlayerChat(const ReqAckPlayerChat& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
player_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_player_name().empty()) {
player_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.player_name_);
}
player_hero_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_player_hero_id().empty()) {
player_hero_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.player_hero_id_);
}
player_hero_level_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_player_hero_level().empty()) {
player_hero_level_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.player_hero_level_);
}
chat_info_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_chat_info().empty()) {
chat_info_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.chat_info_);
}
if (from._internal_has_player_id()) {
player_id_ = new ::NFMsg::Ident(*from.player_id_);
} else {
player_id_ = nullptr;
}
if (from._internal_has_target_id()) {
target_id_ = new ::NFMsg::Ident(*from.target_id_);
} else {
target_id_ = nullptr;
}
::memcpy(&chat_channel_, &from.chat_channel_,
static_cast<size_t>(reinterpret_cast<char*>(&chat_type_) -
reinterpret_cast<char*>(&chat_channel_)) + sizeof(chat_type_));
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckPlayerChat)
}
void ReqAckPlayerChat::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckPlayerChat_NFMsgShare_2eproto.base);
player_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
player_hero_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
player_hero_level_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
chat_info_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&player_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&chat_type_) -
reinterpret_cast<char*>(&player_id_)) + sizeof(chat_type_));
}
ReqAckPlayerChat::~ReqAckPlayerChat() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckPlayerChat)
SharedDtor();
}
void ReqAckPlayerChat::SharedDtor() {
player_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
player_hero_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
player_hero_level_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
chat_info_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete player_id_;
if (this != internal_default_instance()) delete target_id_;
}
void ReqAckPlayerChat::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckPlayerChat& ReqAckPlayerChat::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckPlayerChat_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckPlayerChat::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckPlayerChat)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
player_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
player_hero_id_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
player_hero_level_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
chat_info_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && player_id_ != nullptr) {
delete player_id_;
}
player_id_ = nullptr;
if (GetArenaNoVirtual() == nullptr && target_id_ != nullptr) {
delete target_id_;
}
target_id_ = nullptr;
::memset(&chat_channel_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&chat_type_) -
reinterpret_cast<char*>(&chat_channel_)) + sizeof(chat_type_));
_internal_metadata_.Clear();
}
const char* ReqAckPlayerChat::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident player_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_player_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes player_name = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_player_name(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes player_hero_id = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_player_hero_id(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes player_hero_level = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_player_hero_level(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.ReqAckPlayerChat.EGameChatChannel chat_channel = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_chat_channel(static_cast<::NFMsg::ReqAckPlayerChat_EGameChatChannel>(val));
} else goto handle_unusual;
continue;
// .NFMsg.ReqAckPlayerChat.EGameChatType chat_type = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_chat_type(static_cast<::NFMsg::ReqAckPlayerChat_EGameChatType>(val));
} else goto handle_unusual;
continue;
// bytes chat_info = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_chat_info(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident target_id = 8;
case 8:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
ptr = ctx->ParseMessage(_internal_mutable_target_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckPlayerChat::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckPlayerChat)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident player_id = 1;
if (this->has_player_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::player_id(this), target, stream);
}
// bytes player_name = 2;
if (this->player_name().size() > 0) {
target = stream->WriteBytesMaybeAliased(
2, this->_internal_player_name(), target);
}
// bytes player_hero_id = 3;
if (this->player_hero_id().size() > 0) {
target = stream->WriteBytesMaybeAliased(
3, this->_internal_player_hero_id(), target);
}
// bytes player_hero_level = 4;
if (this->player_hero_level().size() > 0) {
target = stream->WriteBytesMaybeAliased(
4, this->_internal_player_hero_level(), target);
}
// .NFMsg.ReqAckPlayerChat.EGameChatChannel chat_channel = 5;
if (this->chat_channel() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
5, this->_internal_chat_channel(), target);
}
// .NFMsg.ReqAckPlayerChat.EGameChatType chat_type = 6;
if (this->chat_type() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
6, this->_internal_chat_type(), target);
}
// bytes chat_info = 7;
if (this->chat_info().size() > 0) {
target = stream->WriteBytesMaybeAliased(
7, this->_internal_chat_info(), target);
}
// .NFMsg.Ident target_id = 8;
if (this->has_target_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
8, _Internal::target_id(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckPlayerChat)
return target;
}
size_t ReqAckPlayerChat::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckPlayerChat)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes player_name = 2;
if (this->player_name().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_player_name());
}
// bytes player_hero_id = 3;
if (this->player_hero_id().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_player_hero_id());
}
// bytes player_hero_level = 4;
if (this->player_hero_level().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_player_hero_level());
}
// bytes chat_info = 7;
if (this->chat_info().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_chat_info());
}
// .NFMsg.Ident player_id = 1;
if (this->has_player_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*player_id_);
}
// .NFMsg.Ident target_id = 8;
if (this->has_target_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*target_id_);
}
// .NFMsg.ReqAckPlayerChat.EGameChatChannel chat_channel = 5;
if (this->chat_channel() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_chat_channel());
}
// .NFMsg.ReqAckPlayerChat.EGameChatType chat_type = 6;
if (this->chat_type() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_chat_type());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckPlayerChat::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckPlayerChat)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckPlayerChat* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckPlayerChat>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckPlayerChat)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckPlayerChat)
MergeFrom(*source);
}
}
void ReqAckPlayerChat::MergeFrom(const ReqAckPlayerChat& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckPlayerChat)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.player_name().size() > 0) {
player_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.player_name_);
}
if (from.player_hero_id().size() > 0) {
player_hero_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.player_hero_id_);
}
if (from.player_hero_level().size() > 0) {
player_hero_level_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.player_hero_level_);
}
if (from.chat_info().size() > 0) {
chat_info_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.chat_info_);
}
if (from.has_player_id()) {
_internal_mutable_player_id()->::NFMsg::Ident::MergeFrom(from._internal_player_id());
}
if (from.has_target_id()) {
_internal_mutable_target_id()->::NFMsg::Ident::MergeFrom(from._internal_target_id());
}
if (from.chat_channel() != 0) {
_internal_set_chat_channel(from._internal_chat_channel());
}
if (from.chat_type() != 0) {
_internal_set_chat_type(from._internal_chat_type());
}
}
void ReqAckPlayerChat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckPlayerChat)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckPlayerChat::CopyFrom(const ReqAckPlayerChat& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckPlayerChat)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckPlayerChat::IsInitialized() const {
return true;
}
void ReqAckPlayerChat::InternalSwap(ReqAckPlayerChat* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
player_name_.Swap(&other->player_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
player_hero_id_.Swap(&other->player_hero_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
player_hero_level_.Swap(&other->player_hero_level_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
chat_info_.Swap(&other->chat_info_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(player_id_, other->player_id_);
swap(target_id_, other->target_id_);
swap(chat_channel_, other->chat_channel_);
swap(chat_type_, other->chat_type_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckPlayerChat::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckPlayerPosSync::InitAsDefaultInstance() {
::NFMsg::_ReqAckPlayerPosSync_default_instance_._instance.get_mutable()->mover_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckPlayerPosSync_default_instance_._instance.get_mutable()->position_ = const_cast< ::NFMsg::Vector3*>(
::NFMsg::Vector3::internal_default_instance());
::NFMsg::_ReqAckPlayerPosSync_default_instance_._instance.get_mutable()->direction_ = const_cast< ::NFMsg::Vector3*>(
::NFMsg::Vector3::internal_default_instance());
}
class ReqAckPlayerPosSync::_Internal {
public:
static const ::NFMsg::Ident& mover(const ReqAckPlayerPosSync* msg);
static const ::NFMsg::Vector3& position(const ReqAckPlayerPosSync* msg);
static const ::NFMsg::Vector3& direction(const ReqAckPlayerPosSync* msg);
};
const ::NFMsg::Ident&
ReqAckPlayerPosSync::_Internal::mover(const ReqAckPlayerPosSync* msg) {
return *msg->mover_;
}
const ::NFMsg::Vector3&
ReqAckPlayerPosSync::_Internal::position(const ReqAckPlayerPosSync* msg) {
return *msg->position_;
}
const ::NFMsg::Vector3&
ReqAckPlayerPosSync::_Internal::direction(const ReqAckPlayerPosSync* msg) {
return *msg->direction_;
}
void ReqAckPlayerPosSync::clear_mover() {
if (GetArenaNoVirtual() == nullptr && mover_ != nullptr) {
delete mover_;
}
mover_ = nullptr;
}
void ReqAckPlayerPosSync::clear_position() {
if (GetArenaNoVirtual() == nullptr && position_ != nullptr) {
delete position_;
}
position_ = nullptr;
}
void ReqAckPlayerPosSync::clear_direction() {
if (GetArenaNoVirtual() == nullptr && direction_ != nullptr) {
delete direction_;
}
direction_ = nullptr;
}
ReqAckPlayerPosSync::ReqAckPlayerPosSync()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckPlayerPosSync)
}
ReqAckPlayerPosSync::ReqAckPlayerPosSync(const ReqAckPlayerPosSync& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_mover()) {
mover_ = new ::NFMsg::Ident(*from.mover_);
} else {
mover_ = nullptr;
}
if (from._internal_has_position()) {
position_ = new ::NFMsg::Vector3(*from.position_);
} else {
position_ = nullptr;
}
if (from._internal_has_direction()) {
direction_ = new ::NFMsg::Vector3(*from.direction_);
} else {
direction_ = nullptr;
}
::memcpy(&time_, &from.time_,
static_cast<size_t>(reinterpret_cast<char*>(&frame_) -
reinterpret_cast<char*>(&time_)) + sizeof(frame_));
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckPlayerPosSync)
}
void ReqAckPlayerPosSync::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckPlayerPosSync_NFMsgShare_2eproto.base);
::memset(&mover_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&frame_) -
reinterpret_cast<char*>(&mover_)) + sizeof(frame_));
}
ReqAckPlayerPosSync::~ReqAckPlayerPosSync() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckPlayerPosSync)
SharedDtor();
}
void ReqAckPlayerPosSync::SharedDtor() {
if (this != internal_default_instance()) delete mover_;
if (this != internal_default_instance()) delete position_;
if (this != internal_default_instance()) delete direction_;
}
void ReqAckPlayerPosSync::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckPlayerPosSync& ReqAckPlayerPosSync::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckPlayerPosSync_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckPlayerPosSync::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckPlayerPosSync)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && mover_ != nullptr) {
delete mover_;
}
mover_ = nullptr;
if (GetArenaNoVirtual() == nullptr && position_ != nullptr) {
delete position_;
}
position_ = nullptr;
if (GetArenaNoVirtual() == nullptr && direction_ != nullptr) {
delete direction_;
}
direction_ = nullptr;
::memset(&time_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&frame_) -
reinterpret_cast<char*>(&time_)) + sizeof(frame_));
_internal_metadata_.Clear();
}
const char* ReqAckPlayerPosSync::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident mover = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_mover(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 time = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// float InterpolationTime = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
interpolationtime_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else goto handle_unusual;
continue;
// .NFMsg.Vector3 position = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
ptr = ctx->ParseMessage(_internal_mutable_position(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Vector3 direction = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
ptr = ctx->ParseMessage(_internal_mutable_direction(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 status = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
status_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 frame = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
frame_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckPlayerPosSync::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckPlayerPosSync)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident mover = 1;
if (this->has_mover()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::mover(this), target, stream);
}
// int32 time = 2;
if (this->time() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_time(), target);
}
// float InterpolationTime = 3;
if (!(this->interpolationtime() <= 0 && this->interpolationtime() >= 0)) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_interpolationtime(), target);
}
// .NFMsg.Vector3 position = 4;
if (this->has_position()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
4, _Internal::position(this), target, stream);
}
// .NFMsg.Vector3 direction = 5;
if (this->has_direction()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
5, _Internal::direction(this), target, stream);
}
// int32 status = 6;
if (this->status() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_status(), target);
}
// int32 frame = 7;
if (this->frame() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_frame(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckPlayerPosSync)
return target;
}
size_t ReqAckPlayerPosSync::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckPlayerPosSync)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident mover = 1;
if (this->has_mover()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*mover_);
}
// .NFMsg.Vector3 position = 4;
if (this->has_position()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*position_);
}
// .NFMsg.Vector3 direction = 5;
if (this->has_direction()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*direction_);
}
// int32 time = 2;
if (this->time() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_time());
}
// float InterpolationTime = 3;
if (!(this->interpolationtime() <= 0 && this->interpolationtime() >= 0)) {
total_size += 1 + 4;
}
// int32 status = 6;
if (this->status() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_status());
}
// int32 frame = 7;
if (this->frame() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_frame());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckPlayerPosSync::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckPlayerPosSync)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckPlayerPosSync* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckPlayerPosSync>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckPlayerPosSync)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckPlayerPosSync)
MergeFrom(*source);
}
}
void ReqAckPlayerPosSync::MergeFrom(const ReqAckPlayerPosSync& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckPlayerPosSync)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_mover()) {
_internal_mutable_mover()->::NFMsg::Ident::MergeFrom(from._internal_mover());
}
if (from.has_position()) {
_internal_mutable_position()->::NFMsg::Vector3::MergeFrom(from._internal_position());
}
if (from.has_direction()) {
_internal_mutable_direction()->::NFMsg::Vector3::MergeFrom(from._internal_direction());
}
if (from.time() != 0) {
_internal_set_time(from._internal_time());
}
if (!(from.interpolationtime() <= 0 && from.interpolationtime() >= 0)) {
_internal_set_interpolationtime(from._internal_interpolationtime());
}
if (from.status() != 0) {
_internal_set_status(from._internal_status());
}
if (from.frame() != 0) {
_internal_set_frame(from._internal_frame());
}
}
void ReqAckPlayerPosSync::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckPlayerPosSync)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckPlayerPosSync::CopyFrom(const ReqAckPlayerPosSync& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckPlayerPosSync)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckPlayerPosSync::IsInitialized() const {
return true;
}
void ReqAckPlayerPosSync::InternalSwap(ReqAckPlayerPosSync* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(mover_, other->mover_);
swap(position_, other->position_);
swap(direction_, other->direction_);
swap(time_, other->time_);
swap(interpolationtime_, other->interpolationtime_);
swap(status_, other->status_);
swap(frame_, other->frame_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckPlayerPosSync::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void EffectData::InitAsDefaultInstance() {
::NFMsg::_EffectData_default_instance_._instance.get_mutable()->effect_ident_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class EffectData::_Internal {
public:
static const ::NFMsg::Ident& effect_ident(const EffectData* msg);
};
const ::NFMsg::Ident&
EffectData::_Internal::effect_ident(const EffectData* msg) {
return *msg->effect_ident_;
}
void EffectData::clear_effect_ident() {
if (GetArenaNoVirtual() == nullptr && effect_ident_ != nullptr) {
delete effect_ident_;
}
effect_ident_ = nullptr;
}
EffectData::EffectData()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.EffectData)
}
EffectData::EffectData(const EffectData& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_effect_ident()) {
effect_ident_ = new ::NFMsg::Ident(*from.effect_ident_);
} else {
effect_ident_ = nullptr;
}
::memcpy(&effect_value_, &from.effect_value_,
static_cast<size_t>(reinterpret_cast<char*>(&effect_rlt_) -
reinterpret_cast<char*>(&effect_value_)) + sizeof(effect_rlt_));
// @@protoc_insertion_point(copy_constructor:NFMsg.EffectData)
}
void EffectData::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_EffectData_NFMsgShare_2eproto.base);
::memset(&effect_ident_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&effect_rlt_) -
reinterpret_cast<char*>(&effect_ident_)) + sizeof(effect_rlt_));
}
EffectData::~EffectData() {
// @@protoc_insertion_point(destructor:NFMsg.EffectData)
SharedDtor();
}
void EffectData::SharedDtor() {
if (this != internal_default_instance()) delete effect_ident_;
}
void EffectData::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const EffectData& EffectData::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_EffectData_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void EffectData::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.EffectData)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && effect_ident_ != nullptr) {
delete effect_ident_;
}
effect_ident_ = nullptr;
::memset(&effect_value_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&effect_rlt_) -
reinterpret_cast<char*>(&effect_value_)) + sizeof(effect_rlt_));
_internal_metadata_.Clear();
}
const char* EffectData::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident effect_ident = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_effect_ident(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 effect_value = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
effect_value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.EffectData.EResultType effect_rlt = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_effect_rlt(static_cast<::NFMsg::EffectData_EResultType>(val));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* EffectData::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.EffectData)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident effect_ident = 1;
if (this->has_effect_ident()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::effect_ident(this), target, stream);
}
// int32 effect_value = 2;
if (this->effect_value() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_effect_value(), target);
}
// .NFMsg.EffectData.EResultType effect_rlt = 3;
if (this->effect_rlt() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
3, this->_internal_effect_rlt(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.EffectData)
return target;
}
size_t EffectData::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.EffectData)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident effect_ident = 1;
if (this->has_effect_ident()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*effect_ident_);
}
// int32 effect_value = 2;
if (this->effect_value() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_effect_value());
}
// .NFMsg.EffectData.EResultType effect_rlt = 3;
if (this->effect_rlt() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_effect_rlt());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void EffectData::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.EffectData)
GOOGLE_DCHECK_NE(&from, this);
const EffectData* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<EffectData>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.EffectData)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.EffectData)
MergeFrom(*source);
}
}
void EffectData::MergeFrom(const EffectData& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.EffectData)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_effect_ident()) {
_internal_mutable_effect_ident()->::NFMsg::Ident::MergeFrom(from._internal_effect_ident());
}
if (from.effect_value() != 0) {
_internal_set_effect_value(from._internal_effect_value());
}
if (from.effect_rlt() != 0) {
_internal_set_effect_rlt(from._internal_effect_rlt());
}
}
void EffectData::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.EffectData)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void EffectData::CopyFrom(const EffectData& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.EffectData)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool EffectData::IsInitialized() const {
return true;
}
void EffectData::InternalSwap(EffectData* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(effect_ident_, other->effect_ident_);
swap(effect_value_, other->effect_value_);
swap(effect_rlt_, other->effect_rlt_);
}
::PROTOBUF_NAMESPACE_ID::Metadata EffectData::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckUseSkill::InitAsDefaultInstance() {
::NFMsg::_ReqAckUseSkill_default_instance_._instance.get_mutable()->user_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckUseSkill::_Internal {
public:
static const ::NFMsg::Ident& user(const ReqAckUseSkill* msg);
};
const ::NFMsg::Ident&
ReqAckUseSkill::_Internal::user(const ReqAckUseSkill* msg) {
return *msg->user_;
}
void ReqAckUseSkill::clear_user() {
if (GetArenaNoVirtual() == nullptr && user_ != nullptr) {
delete user_;
}
user_ = nullptr;
}
ReqAckUseSkill::ReqAckUseSkill()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckUseSkill)
}
ReqAckUseSkill::ReqAckUseSkill(const ReqAckUseSkill& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
effect_data_(from.effect_data_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
skill_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_skill_id().empty()) {
skill_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.skill_id_);
}
if (from._internal_has_user()) {
user_ = new ::NFMsg::Ident(*from.user_);
} else {
user_ = nullptr;
}
use_index_ = from.use_index_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckUseSkill)
}
void ReqAckUseSkill::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckUseSkill_NFMsgShare_2eproto.base);
skill_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&user_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&use_index_) -
reinterpret_cast<char*>(&user_)) + sizeof(use_index_));
}
ReqAckUseSkill::~ReqAckUseSkill() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckUseSkill)
SharedDtor();
}
void ReqAckUseSkill::SharedDtor() {
skill_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete user_;
}
void ReqAckUseSkill::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckUseSkill& ReqAckUseSkill::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckUseSkill_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckUseSkill::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckUseSkill)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
effect_data_.Clear();
skill_id_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && user_ != nullptr) {
delete user_;
}
user_ = nullptr;
use_index_ = 0;
_internal_metadata_.Clear();
}
const char* ReqAckUseSkill::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident user = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_user(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes skill_id = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_skill_id(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 use_index = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
use_index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .NFMsg.EffectData effect_data = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_effect_data(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckUseSkill::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckUseSkill)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident user = 1;
if (this->has_user()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::user(this), target, stream);
}
// bytes skill_id = 2;
if (this->skill_id().size() > 0) {
target = stream->WriteBytesMaybeAliased(
2, this->_internal_skill_id(), target);
}
// int32 use_index = 3;
if (this->use_index() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_use_index(), target);
}
// repeated .NFMsg.EffectData effect_data = 4;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_effect_data_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(4, this->_internal_effect_data(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckUseSkill)
return target;
}
size_t ReqAckUseSkill::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckUseSkill)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.EffectData effect_data = 4;
total_size += 1UL * this->_internal_effect_data_size();
for (const auto& msg : this->effect_data_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// bytes skill_id = 2;
if (this->skill_id().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_skill_id());
}
// .NFMsg.Ident user = 1;
if (this->has_user()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*user_);
}
// int32 use_index = 3;
if (this->use_index() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_use_index());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckUseSkill::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckUseSkill)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckUseSkill* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckUseSkill>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckUseSkill)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckUseSkill)
MergeFrom(*source);
}
}
void ReqAckUseSkill::MergeFrom(const ReqAckUseSkill& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckUseSkill)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
effect_data_.MergeFrom(from.effect_data_);
if (from.skill_id().size() > 0) {
skill_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.skill_id_);
}
if (from.has_user()) {
_internal_mutable_user()->::NFMsg::Ident::MergeFrom(from._internal_user());
}
if (from.use_index() != 0) {
_internal_set_use_index(from._internal_use_index());
}
}
void ReqAckUseSkill::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckUseSkill)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckUseSkill::CopyFrom(const ReqAckUseSkill& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckUseSkill)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckUseSkill::IsInitialized() const {
return true;
}
void ReqAckUseSkill::InternalSwap(ReqAckUseSkill* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
effect_data_.InternalSwap(&other->effect_data_);
skill_id_.Swap(&other->skill_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(user_, other->user_);
swap(use_index_, other->use_index_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckUseSkill::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckUseItem::InitAsDefaultInstance() {
::NFMsg::_ReqAckUseItem_default_instance_._instance.get_mutable()->user_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckUseItem_default_instance_._instance.get_mutable()->item_guid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckUseItem_default_instance_._instance.get_mutable()->item_ = const_cast< ::NFMsg::ItemStruct*>(
::NFMsg::ItemStruct::internal_default_instance());
::NFMsg::_ReqAckUseItem_default_instance_._instance.get_mutable()->targetid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckUseItem_default_instance_._instance.get_mutable()->position_ = const_cast< ::NFMsg::Vector3*>(
::NFMsg::Vector3::internal_default_instance());
}
class ReqAckUseItem::_Internal {
public:
static const ::NFMsg::Ident& user(const ReqAckUseItem* msg);
static const ::NFMsg::Ident& item_guid(const ReqAckUseItem* msg);
static const ::NFMsg::ItemStruct& item(const ReqAckUseItem* msg);
static const ::NFMsg::Ident& targetid(const ReqAckUseItem* msg);
static const ::NFMsg::Vector3& position(const ReqAckUseItem* msg);
};
const ::NFMsg::Ident&
ReqAckUseItem::_Internal::user(const ReqAckUseItem* msg) {
return *msg->user_;
}
const ::NFMsg::Ident&
ReqAckUseItem::_Internal::item_guid(const ReqAckUseItem* msg) {
return *msg->item_guid_;
}
const ::NFMsg::ItemStruct&
ReqAckUseItem::_Internal::item(const ReqAckUseItem* msg) {
return *msg->item_;
}
const ::NFMsg::Ident&
ReqAckUseItem::_Internal::targetid(const ReqAckUseItem* msg) {
return *msg->targetid_;
}
const ::NFMsg::Vector3&
ReqAckUseItem::_Internal::position(const ReqAckUseItem* msg) {
return *msg->position_;
}
void ReqAckUseItem::clear_user() {
if (GetArenaNoVirtual() == nullptr && user_ != nullptr) {
delete user_;
}
user_ = nullptr;
}
void ReqAckUseItem::clear_item_guid() {
if (GetArenaNoVirtual() == nullptr && item_guid_ != nullptr) {
delete item_guid_;
}
item_guid_ = nullptr;
}
void ReqAckUseItem::clear_targetid() {
if (GetArenaNoVirtual() == nullptr && targetid_ != nullptr) {
delete targetid_;
}
targetid_ = nullptr;
}
void ReqAckUseItem::clear_position() {
if (GetArenaNoVirtual() == nullptr && position_ != nullptr) {
delete position_;
}
position_ = nullptr;
}
ReqAckUseItem::ReqAckUseItem()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckUseItem)
}
ReqAckUseItem::ReqAckUseItem(const ReqAckUseItem& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
effect_data_(from.effect_data_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_user()) {
user_ = new ::NFMsg::Ident(*from.user_);
} else {
user_ = nullptr;
}
if (from._internal_has_item_guid()) {
item_guid_ = new ::NFMsg::Ident(*from.item_guid_);
} else {
item_guid_ = nullptr;
}
if (from._internal_has_item()) {
item_ = new ::NFMsg::ItemStruct(*from.item_);
} else {
item_ = nullptr;
}
if (from._internal_has_targetid()) {
targetid_ = new ::NFMsg::Ident(*from.targetid_);
} else {
targetid_ = nullptr;
}
if (from._internal_has_position()) {
position_ = new ::NFMsg::Vector3(*from.position_);
} else {
position_ = nullptr;
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckUseItem)
}
void ReqAckUseItem::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckUseItem_NFMsgShare_2eproto.base);
::memset(&user_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&position_) -
reinterpret_cast<char*>(&user_)) + sizeof(position_));
}
ReqAckUseItem::~ReqAckUseItem() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckUseItem)
SharedDtor();
}
void ReqAckUseItem::SharedDtor() {
if (this != internal_default_instance()) delete user_;
if (this != internal_default_instance()) delete item_guid_;
if (this != internal_default_instance()) delete item_;
if (this != internal_default_instance()) delete targetid_;
if (this != internal_default_instance()) delete position_;
}
void ReqAckUseItem::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckUseItem& ReqAckUseItem::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckUseItem_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckUseItem::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckUseItem)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
effect_data_.Clear();
if (GetArenaNoVirtual() == nullptr && user_ != nullptr) {
delete user_;
}
user_ = nullptr;
if (GetArenaNoVirtual() == nullptr && item_guid_ != nullptr) {
delete item_guid_;
}
item_guid_ = nullptr;
if (GetArenaNoVirtual() == nullptr && item_ != nullptr) {
delete item_;
}
item_ = nullptr;
if (GetArenaNoVirtual() == nullptr && targetid_ != nullptr) {
delete targetid_;
}
targetid_ = nullptr;
if (GetArenaNoVirtual() == nullptr && position_ != nullptr) {
delete position_;
}
position_ = nullptr;
_internal_metadata_.Clear();
}
const char* ReqAckUseItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident user = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_user(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident item_guid = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_item_guid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .NFMsg.EffectData effect_data = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_effect_data(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
} else goto handle_unusual;
continue;
// .NFMsg.ItemStruct item = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
ptr = ctx->ParseMessage(_internal_mutable_item(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident targetid = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
ptr = ctx->ParseMessage(_internal_mutable_targetid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Vector3 position = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
ptr = ctx->ParseMessage(_internal_mutable_position(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckUseItem::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckUseItem)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident user = 1;
if (this->has_user()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::user(this), target, stream);
}
// .NFMsg.Ident item_guid = 2;
if (this->has_item_guid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
2, _Internal::item_guid(this), target, stream);
}
// repeated .NFMsg.EffectData effect_data = 3;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_effect_data_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(3, this->_internal_effect_data(i), target, stream);
}
// .NFMsg.ItemStruct item = 4;
if (this->has_item()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
4, _Internal::item(this), target, stream);
}
// .NFMsg.Ident targetid = 5;
if (this->has_targetid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
5, _Internal::targetid(this), target, stream);
}
// .NFMsg.Vector3 position = 6;
if (this->has_position()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
6, _Internal::position(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckUseItem)
return target;
}
size_t ReqAckUseItem::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckUseItem)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.EffectData effect_data = 3;
total_size += 1UL * this->_internal_effect_data_size();
for (const auto& msg : this->effect_data_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// .NFMsg.Ident user = 1;
if (this->has_user()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*user_);
}
// .NFMsg.Ident item_guid = 2;
if (this->has_item_guid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*item_guid_);
}
// .NFMsg.ItemStruct item = 4;
if (this->has_item()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*item_);
}
// .NFMsg.Ident targetid = 5;
if (this->has_targetid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*targetid_);
}
// .NFMsg.Vector3 position = 6;
if (this->has_position()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*position_);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckUseItem::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckUseItem)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckUseItem* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckUseItem>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckUseItem)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckUseItem)
MergeFrom(*source);
}
}
void ReqAckUseItem::MergeFrom(const ReqAckUseItem& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckUseItem)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
effect_data_.MergeFrom(from.effect_data_);
if (from.has_user()) {
_internal_mutable_user()->::NFMsg::Ident::MergeFrom(from._internal_user());
}
if (from.has_item_guid()) {
_internal_mutable_item_guid()->::NFMsg::Ident::MergeFrom(from._internal_item_guid());
}
if (from.has_item()) {
_internal_mutable_item()->::NFMsg::ItemStruct::MergeFrom(from._internal_item());
}
if (from.has_targetid()) {
_internal_mutable_targetid()->::NFMsg::Ident::MergeFrom(from._internal_targetid());
}
if (from.has_position()) {
_internal_mutable_position()->::NFMsg::Vector3::MergeFrom(from._internal_position());
}
}
void ReqAckUseItem::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckUseItem)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckUseItem::CopyFrom(const ReqAckUseItem& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckUseItem)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckUseItem::IsInitialized() const {
return true;
}
void ReqAckUseItem::InternalSwap(ReqAckUseItem* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
effect_data_.InternalSwap(&other->effect_data_);
swap(user_, other->user_);
swap(item_guid_, other->item_guid_);
swap(item_, other->item_);
swap(targetid_, other->targetid_);
swap(position_, other->position_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckUseItem::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckSwapScene::InitAsDefaultInstance() {
}
class ReqAckSwapScene::_Internal {
public:
};
ReqAckSwapScene::ReqAckSwapScene()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckSwapScene)
}
ReqAckSwapScene::ReqAckSwapScene(const ReqAckSwapScene& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_data().empty()) {
data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.data_);
}
::memcpy(&transfer_type_, &from.transfer_type_,
static_cast<size_t>(reinterpret_cast<char*>(&z_) -
reinterpret_cast<char*>(&transfer_type_)) + sizeof(z_));
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckSwapScene)
}
void ReqAckSwapScene::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckSwapScene_NFMsgShare_2eproto.base);
data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&transfer_type_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&z_) -
reinterpret_cast<char*>(&transfer_type_)) + sizeof(z_));
}
ReqAckSwapScene::~ReqAckSwapScene() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckSwapScene)
SharedDtor();
}
void ReqAckSwapScene::SharedDtor() {
data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void ReqAckSwapScene::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckSwapScene& ReqAckSwapScene::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckSwapScene_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckSwapScene::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckSwapScene)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
data_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&transfer_type_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&z_) -
reinterpret_cast<char*>(&transfer_type_)) + sizeof(z_));
_internal_metadata_.Clear();
}
const char* ReqAckSwapScene::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.ReqAckSwapScene.EGameSwapType transfer_type = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_transfer_type(static_cast<::NFMsg::ReqAckSwapScene_EGameSwapType>(val));
} else goto handle_unusual;
continue;
// int32 scene_id = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
scene_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 line_id = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
line_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// float x = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37)) {
x_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else goto handle_unusual;
continue;
// float y = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 45)) {
y_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else goto handle_unusual;
continue;
// float z = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 53)) {
z_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else goto handle_unusual;
continue;
// bytes data = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_data(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckSwapScene::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckSwapScene)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.ReqAckSwapScene.EGameSwapType transfer_type = 1;
if (this->transfer_type() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1, this->_internal_transfer_type(), target);
}
// int32 scene_id = 2;
if (this->scene_id() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_scene_id(), target);
}
// int32 line_id = 3;
if (this->line_id() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_line_id(), target);
}
// float x = 4;
if (!(this->x() <= 0 && this->x() >= 0)) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_x(), target);
}
// float y = 5;
if (!(this->y() <= 0 && this->y() >= 0)) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->_internal_y(), target);
}
// float z = 6;
if (!(this->z() <= 0 && this->z() >= 0)) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(6, this->_internal_z(), target);
}
// bytes data = 7;
if (this->data().size() > 0) {
target = stream->WriteBytesMaybeAliased(
7, this->_internal_data(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckSwapScene)
return target;
}
size_t ReqAckSwapScene::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckSwapScene)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes data = 7;
if (this->data().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_data());
}
// .NFMsg.ReqAckSwapScene.EGameSwapType transfer_type = 1;
if (this->transfer_type() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_transfer_type());
}
// int32 scene_id = 2;
if (this->scene_id() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_scene_id());
}
// int32 line_id = 3;
if (this->line_id() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_line_id());
}
// float x = 4;
if (!(this->x() <= 0 && this->x() >= 0)) {
total_size += 1 + 4;
}
// float y = 5;
if (!(this->y() <= 0 && this->y() >= 0)) {
total_size += 1 + 4;
}
// float z = 6;
if (!(this->z() <= 0 && this->z() >= 0)) {
total_size += 1 + 4;
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckSwapScene::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckSwapScene)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckSwapScene* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckSwapScene>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckSwapScene)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckSwapScene)
MergeFrom(*source);
}
}
void ReqAckSwapScene::MergeFrom(const ReqAckSwapScene& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckSwapScene)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.data().size() > 0) {
data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.data_);
}
if (from.transfer_type() != 0) {
_internal_set_transfer_type(from._internal_transfer_type());
}
if (from.scene_id() != 0) {
_internal_set_scene_id(from._internal_scene_id());
}
if (from.line_id() != 0) {
_internal_set_line_id(from._internal_line_id());
}
if (!(from.x() <= 0 && from.x() >= 0)) {
_internal_set_x(from._internal_x());
}
if (!(from.y() <= 0 && from.y() >= 0)) {
_internal_set_y(from._internal_y());
}
if (!(from.z() <= 0 && from.z() >= 0)) {
_internal_set_z(from._internal_z());
}
}
void ReqAckSwapScene::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckSwapScene)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckSwapScene::CopyFrom(const ReqAckSwapScene& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckSwapScene)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckSwapScene::IsInitialized() const {
return true;
}
void ReqAckSwapScene::InternalSwap(ReqAckSwapScene* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
data_.Swap(&other->data_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(transfer_type_, other->transfer_type_);
swap(scene_id_, other->scene_id_);
swap(line_id_, other->line_id_);
swap(x_, other->x_);
swap(y_, other->y_);
swap(z_, other->z_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckSwapScene::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckHomeScene::InitAsDefaultInstance() {
}
class ReqAckHomeScene::_Internal {
public:
};
ReqAckHomeScene::ReqAckHomeScene()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckHomeScene)
}
ReqAckHomeScene::ReqAckHomeScene(const ReqAckHomeScene& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_data().empty()) {
data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.data_);
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckHomeScene)
}
void ReqAckHomeScene::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckHomeScene_NFMsgShare_2eproto.base);
data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
ReqAckHomeScene::~ReqAckHomeScene() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckHomeScene)
SharedDtor();
}
void ReqAckHomeScene::SharedDtor() {
data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void ReqAckHomeScene::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckHomeScene& ReqAckHomeScene::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckHomeScene_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckHomeScene::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckHomeScene)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
data_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
_internal_metadata_.Clear();
}
const char* ReqAckHomeScene::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// bytes data = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_data(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckHomeScene::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckHomeScene)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// bytes data = 1;
if (this->data().size() > 0) {
target = stream->WriteBytesMaybeAliased(
1, this->_internal_data(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckHomeScene)
return target;
}
size_t ReqAckHomeScene::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckHomeScene)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes data = 1;
if (this->data().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_data());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckHomeScene::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckHomeScene)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckHomeScene* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckHomeScene>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckHomeScene)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckHomeScene)
MergeFrom(*source);
}
}
void ReqAckHomeScene::MergeFrom(const ReqAckHomeScene& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckHomeScene)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.data().size() > 0) {
data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.data_);
}
}
void ReqAckHomeScene::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckHomeScene)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckHomeScene::CopyFrom(const ReqAckHomeScene& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckHomeScene)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckHomeScene::IsInitialized() const {
return true;
}
void ReqAckHomeScene::InternalSwap(ReqAckHomeScene* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
data_.Swap(&other->data_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckHomeScene::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ItemStruct::InitAsDefaultInstance() {
}
class ItemStruct::_Internal {
public:
};
ItemStruct::ItemStruct()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ItemStruct)
}
ItemStruct::ItemStruct(const ItemStruct& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
item_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_item_id().empty()) {
item_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.item_id_);
}
item_count_ = from.item_count_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ItemStruct)
}
void ItemStruct::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ItemStruct_NFMsgShare_2eproto.base);
item_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
item_count_ = 0;
}
ItemStruct::~ItemStruct() {
// @@protoc_insertion_point(destructor:NFMsg.ItemStruct)
SharedDtor();
}
void ItemStruct::SharedDtor() {
item_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void ItemStruct::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ItemStruct& ItemStruct::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ItemStruct_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ItemStruct::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ItemStruct)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
item_id_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
item_count_ = 0;
_internal_metadata_.Clear();
}
const char* ItemStruct::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// bytes item_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_item_id(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 item_count = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
item_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ItemStruct::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ItemStruct)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// bytes item_id = 1;
if (this->item_id().size() > 0) {
target = stream->WriteBytesMaybeAliased(
1, this->_internal_item_id(), target);
}
// int32 item_count = 2;
if (this->item_count() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_item_count(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ItemStruct)
return target;
}
size_t ItemStruct::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ItemStruct)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes item_id = 1;
if (this->item_id().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_item_id());
}
// int32 item_count = 2;
if (this->item_count() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_item_count());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ItemStruct::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ItemStruct)
GOOGLE_DCHECK_NE(&from, this);
const ItemStruct* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ItemStruct>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ItemStruct)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ItemStruct)
MergeFrom(*source);
}
}
void ItemStruct::MergeFrom(const ItemStruct& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ItemStruct)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.item_id().size() > 0) {
item_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.item_id_);
}
if (from.item_count() != 0) {
_internal_set_item_count(from._internal_item_count());
}
}
void ItemStruct::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ItemStruct)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ItemStruct::CopyFrom(const ItemStruct& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ItemStruct)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ItemStruct::IsInitialized() const {
return true;
}
void ItemStruct::InternalSwap(ItemStruct* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
item_id_.Swap(&other->item_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(item_count_, other->item_count_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ItemStruct::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void CurrencyStruct::InitAsDefaultInstance() {
}
class CurrencyStruct::_Internal {
public:
};
CurrencyStruct::CurrencyStruct()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.CurrencyStruct)
}
CurrencyStruct::CurrencyStruct(const CurrencyStruct& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(¤cy_type_, &from.currency_type_,
static_cast<size_t>(reinterpret_cast<char*>(¤cy_count_) -
reinterpret_cast<char*>(¤cy_type_)) + sizeof(currency_count_));
// @@protoc_insertion_point(copy_constructor:NFMsg.CurrencyStruct)
}
void CurrencyStruct::SharedCtor() {
::memset(¤cy_type_, 0, static_cast<size_t>(
reinterpret_cast<char*>(¤cy_count_) -
reinterpret_cast<char*>(¤cy_type_)) + sizeof(currency_count_));
}
CurrencyStruct::~CurrencyStruct() {
// @@protoc_insertion_point(destructor:NFMsg.CurrencyStruct)
SharedDtor();
}
void CurrencyStruct::SharedDtor() {
}
void CurrencyStruct::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const CurrencyStruct& CurrencyStruct::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CurrencyStruct_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void CurrencyStruct::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.CurrencyStruct)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
::memset(¤cy_type_, 0, static_cast<size_t>(
reinterpret_cast<char*>(¤cy_count_) -
reinterpret_cast<char*>(¤cy_type_)) + sizeof(currency_count_));
_internal_metadata_.Clear();
}
const char* CurrencyStruct::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 currency_type = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
currency_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 currency_count = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
currency_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* CurrencyStruct::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.CurrencyStruct)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 currency_type = 1;
if (this->currency_type() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_currency_type(), target);
}
// int32 currency_count = 2;
if (this->currency_count() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_currency_count(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.CurrencyStruct)
return target;
}
size_t CurrencyStruct::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.CurrencyStruct)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// int32 currency_type = 1;
if (this->currency_type() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_currency_type());
}
// int32 currency_count = 2;
if (this->currency_count() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_currency_count());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void CurrencyStruct::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.CurrencyStruct)
GOOGLE_DCHECK_NE(&from, this);
const CurrencyStruct* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<CurrencyStruct>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.CurrencyStruct)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.CurrencyStruct)
MergeFrom(*source);
}
}
void CurrencyStruct::MergeFrom(const CurrencyStruct& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.CurrencyStruct)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.currency_type() != 0) {
_internal_set_currency_type(from._internal_currency_type());
}
if (from.currency_count() != 0) {
_internal_set_currency_count(from._internal_currency_count());
}
}
void CurrencyStruct::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.CurrencyStruct)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CurrencyStruct::CopyFrom(const CurrencyStruct& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.CurrencyStruct)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool CurrencyStruct::IsInitialized() const {
return true;
}
void CurrencyStruct::InternalSwap(CurrencyStruct* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(currency_type_, other->currency_type_);
swap(currency_count_, other->currency_count_);
}
::PROTOBUF_NAMESPACE_ID::Metadata CurrencyStruct::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckReliveHero::InitAsDefaultInstance() {
::NFMsg::_ReqAckReliveHero_default_instance_._instance.get_mutable()->hero_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckReliveHero::_Internal {
public:
static const ::NFMsg::Ident& hero_id(const ReqAckReliveHero* msg);
};
const ::NFMsg::Ident&
ReqAckReliveHero::_Internal::hero_id(const ReqAckReliveHero* msg) {
return *msg->hero_id_;
}
void ReqAckReliveHero::clear_hero_id() {
if (GetArenaNoVirtual() == nullptr && hero_id_ != nullptr) {
delete hero_id_;
}
hero_id_ = nullptr;
}
ReqAckReliveHero::ReqAckReliveHero()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckReliveHero)
}
ReqAckReliveHero::ReqAckReliveHero(const ReqAckReliveHero& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_hero_id()) {
hero_id_ = new ::NFMsg::Ident(*from.hero_id_);
} else {
hero_id_ = nullptr;
}
diamond_ = from.diamond_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckReliveHero)
}
void ReqAckReliveHero::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckReliveHero_NFMsgShare_2eproto.base);
::memset(&hero_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&diamond_) -
reinterpret_cast<char*>(&hero_id_)) + sizeof(diamond_));
}
ReqAckReliveHero::~ReqAckReliveHero() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckReliveHero)
SharedDtor();
}
void ReqAckReliveHero::SharedDtor() {
if (this != internal_default_instance()) delete hero_id_;
}
void ReqAckReliveHero::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckReliveHero& ReqAckReliveHero::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckReliveHero_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckReliveHero::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckReliveHero)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && hero_id_ != nullptr) {
delete hero_id_;
}
hero_id_ = nullptr;
diamond_ = 0;
_internal_metadata_.Clear();
}
const char* ReqAckReliveHero::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 diamond = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
diamond_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident hero_id = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_hero_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckReliveHero::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckReliveHero)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 diamond = 1;
if (this->diamond() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_diamond(), target);
}
// .NFMsg.Ident hero_id = 2;
if (this->has_hero_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
2, _Internal::hero_id(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckReliveHero)
return target;
}
size_t ReqAckReliveHero::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckReliveHero)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident hero_id = 2;
if (this->has_hero_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*hero_id_);
}
// int32 diamond = 1;
if (this->diamond() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_diamond());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckReliveHero::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckReliveHero)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckReliveHero* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckReliveHero>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckReliveHero)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckReliveHero)
MergeFrom(*source);
}
}
void ReqAckReliveHero::MergeFrom(const ReqAckReliveHero& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckReliveHero)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_hero_id()) {
_internal_mutable_hero_id()->::NFMsg::Ident::MergeFrom(from._internal_hero_id());
}
if (from.diamond() != 0) {
_internal_set_diamond(from._internal_diamond());
}
}
void ReqAckReliveHero::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckReliveHero)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckReliveHero::CopyFrom(const ReqAckReliveHero& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckReliveHero)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckReliveHero::IsInitialized() const {
return true;
}
void ReqAckReliveHero::InternalSwap(ReqAckReliveHero* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(hero_id_, other->hero_id_);
swap(diamond_, other->diamond_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckReliveHero::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqPickDropItem::InitAsDefaultInstance() {
::NFMsg::_ReqPickDropItem_default_instance_._instance.get_mutable()->item_guid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqPickDropItem::_Internal {
public:
static const ::NFMsg::Ident& item_guid(const ReqPickDropItem* msg);
};
const ::NFMsg::Ident&
ReqPickDropItem::_Internal::item_guid(const ReqPickDropItem* msg) {
return *msg->item_guid_;
}
void ReqPickDropItem::clear_item_guid() {
if (GetArenaNoVirtual() == nullptr && item_guid_ != nullptr) {
delete item_guid_;
}
item_guid_ = nullptr;
}
ReqPickDropItem::ReqPickDropItem()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqPickDropItem)
}
ReqPickDropItem::ReqPickDropItem(const ReqPickDropItem& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_item_guid()) {
item_guid_ = new ::NFMsg::Ident(*from.item_guid_);
} else {
item_guid_ = nullptr;
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqPickDropItem)
}
void ReqPickDropItem::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqPickDropItem_NFMsgShare_2eproto.base);
item_guid_ = nullptr;
}
ReqPickDropItem::~ReqPickDropItem() {
// @@protoc_insertion_point(destructor:NFMsg.ReqPickDropItem)
SharedDtor();
}
void ReqPickDropItem::SharedDtor() {
if (this != internal_default_instance()) delete item_guid_;
}
void ReqPickDropItem::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqPickDropItem& ReqPickDropItem::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqPickDropItem_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqPickDropItem::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqPickDropItem)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && item_guid_ != nullptr) {
delete item_guid_;
}
item_guid_ = nullptr;
_internal_metadata_.Clear();
}
const char* ReqPickDropItem::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident item_guid = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_item_guid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqPickDropItem::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqPickDropItem)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident item_guid = 2;
if (this->has_item_guid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
2, _Internal::item_guid(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqPickDropItem)
return target;
}
size_t ReqPickDropItem::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqPickDropItem)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident item_guid = 2;
if (this->has_item_guid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*item_guid_);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqPickDropItem::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqPickDropItem)
GOOGLE_DCHECK_NE(&from, this);
const ReqPickDropItem* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqPickDropItem>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqPickDropItem)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqPickDropItem)
MergeFrom(*source);
}
}
void ReqPickDropItem::MergeFrom(const ReqPickDropItem& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqPickDropItem)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_item_guid()) {
_internal_mutable_item_guid()->::NFMsg::Ident::MergeFrom(from._internal_item_guid());
}
}
void ReqPickDropItem::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqPickDropItem)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqPickDropItem::CopyFrom(const ReqPickDropItem& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqPickDropItem)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqPickDropItem::IsInitialized() const {
return true;
}
void ReqPickDropItem::InternalSwap(ReqPickDropItem* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(item_guid_, other->item_guid_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqPickDropItem::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAcceptTask::InitAsDefaultInstance() {
}
class ReqAcceptTask::_Internal {
public:
};
ReqAcceptTask::ReqAcceptTask()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAcceptTask)
}
ReqAcceptTask::ReqAcceptTask(const ReqAcceptTask& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
task_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_task_id().empty()) {
task_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.task_id_);
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAcceptTask)
}
void ReqAcceptTask::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAcceptTask_NFMsgShare_2eproto.base);
task_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
ReqAcceptTask::~ReqAcceptTask() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAcceptTask)
SharedDtor();
}
void ReqAcceptTask::SharedDtor() {
task_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void ReqAcceptTask::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAcceptTask& ReqAcceptTask::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAcceptTask_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAcceptTask::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAcceptTask)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
task_id_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
_internal_metadata_.Clear();
}
const char* ReqAcceptTask::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// bytes task_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_task_id(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAcceptTask::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAcceptTask)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// bytes task_id = 1;
if (this->task_id().size() > 0) {
target = stream->WriteBytesMaybeAliased(
1, this->_internal_task_id(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAcceptTask)
return target;
}
size_t ReqAcceptTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAcceptTask)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes task_id = 1;
if (this->task_id().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_task_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAcceptTask::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAcceptTask)
GOOGLE_DCHECK_NE(&from, this);
const ReqAcceptTask* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAcceptTask>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAcceptTask)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAcceptTask)
MergeFrom(*source);
}
}
void ReqAcceptTask::MergeFrom(const ReqAcceptTask& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAcceptTask)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.task_id().size() > 0) {
task_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.task_id_);
}
}
void ReqAcceptTask::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAcceptTask)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAcceptTask::CopyFrom(const ReqAcceptTask& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAcceptTask)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAcceptTask::IsInitialized() const {
return true;
}
void ReqAcceptTask::InternalSwap(ReqAcceptTask* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
task_id_.Swap(&other->task_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAcceptTask::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqCompeleteTask::InitAsDefaultInstance() {
}
class ReqCompeleteTask::_Internal {
public:
};
ReqCompeleteTask::ReqCompeleteTask()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqCompeleteTask)
}
ReqCompeleteTask::ReqCompeleteTask(const ReqCompeleteTask& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
task_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_task_id().empty()) {
task_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.task_id_);
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqCompeleteTask)
}
void ReqCompeleteTask::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqCompeleteTask_NFMsgShare_2eproto.base);
task_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
ReqCompeleteTask::~ReqCompeleteTask() {
// @@protoc_insertion_point(destructor:NFMsg.ReqCompeleteTask)
SharedDtor();
}
void ReqCompeleteTask::SharedDtor() {
task_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void ReqCompeleteTask::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqCompeleteTask& ReqCompeleteTask::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqCompeleteTask_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqCompeleteTask::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqCompeleteTask)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
task_id_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
_internal_metadata_.Clear();
}
const char* ReqCompeleteTask::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// bytes task_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_task_id(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqCompeleteTask::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqCompeleteTask)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// bytes task_id = 1;
if (this->task_id().size() > 0) {
target = stream->WriteBytesMaybeAliased(
1, this->_internal_task_id(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqCompeleteTask)
return target;
}
size_t ReqCompeleteTask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqCompeleteTask)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes task_id = 1;
if (this->task_id().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_task_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqCompeleteTask::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqCompeleteTask)
GOOGLE_DCHECK_NE(&from, this);
const ReqCompeleteTask* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqCompeleteTask>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqCompeleteTask)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqCompeleteTask)
MergeFrom(*source);
}
}
void ReqCompeleteTask::MergeFrom(const ReqCompeleteTask& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqCompeleteTask)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.task_id().size() > 0) {
task_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.task_id_);
}
}
void ReqCompeleteTask::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqCompeleteTask)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqCompeleteTask::CopyFrom(const ReqCompeleteTask& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqCompeleteTask)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqCompeleteTask::IsInitialized() const {
return true;
}
void ReqCompeleteTask::InternalSwap(ReqCompeleteTask* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
task_id_.Swap(&other->task_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqCompeleteTask::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAddSceneBuilding::InitAsDefaultInstance() {
::NFMsg::_ReqAddSceneBuilding_default_instance_._instance.get_mutable()->pos_ = const_cast< ::NFMsg::Vector3*>(
::NFMsg::Vector3::internal_default_instance());
::NFMsg::_ReqAddSceneBuilding_default_instance_._instance.get_mutable()->guid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAddSceneBuilding_default_instance_._instance.get_mutable()->master_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAddSceneBuilding::_Internal {
public:
static const ::NFMsg::Vector3& pos(const ReqAddSceneBuilding* msg);
static const ::NFMsg::Ident& guid(const ReqAddSceneBuilding* msg);
static const ::NFMsg::Ident& master(const ReqAddSceneBuilding* msg);
};
const ::NFMsg::Vector3&
ReqAddSceneBuilding::_Internal::pos(const ReqAddSceneBuilding* msg) {
return *msg->pos_;
}
const ::NFMsg::Ident&
ReqAddSceneBuilding::_Internal::guid(const ReqAddSceneBuilding* msg) {
return *msg->guid_;
}
const ::NFMsg::Ident&
ReqAddSceneBuilding::_Internal::master(const ReqAddSceneBuilding* msg) {
return *msg->master_;
}
void ReqAddSceneBuilding::clear_pos() {
if (GetArenaNoVirtual() == nullptr && pos_ != nullptr) {
delete pos_;
}
pos_ = nullptr;
}
void ReqAddSceneBuilding::clear_guid() {
if (GetArenaNoVirtual() == nullptr && guid_ != nullptr) {
delete guid_;
}
guid_ = nullptr;
}
void ReqAddSceneBuilding::clear_master() {
if (GetArenaNoVirtual() == nullptr && master_ != nullptr) {
delete master_;
}
master_ = nullptr;
}
ReqAddSceneBuilding::ReqAddSceneBuilding()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAddSceneBuilding)
}
ReqAddSceneBuilding::ReqAddSceneBuilding(const ReqAddSceneBuilding& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
config_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_config_id().empty()) {
config_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.config_id_);
}
master_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_master_name().empty()) {
master_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.master_name_);
}
if (from._internal_has_pos()) {
pos_ = new ::NFMsg::Vector3(*from.pos_);
} else {
pos_ = nullptr;
}
if (from._internal_has_guid()) {
guid_ = new ::NFMsg::Ident(*from.guid_);
} else {
guid_ = nullptr;
}
if (from._internal_has_master()) {
master_ = new ::NFMsg::Ident(*from.master_);
} else {
master_ = nullptr;
}
::memcpy(&scene_id_, &from.scene_id_,
static_cast<size_t>(reinterpret_cast<char*>(&is_building_) -
reinterpret_cast<char*>(&scene_id_)) + sizeof(is_building_));
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAddSceneBuilding)
}
void ReqAddSceneBuilding::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAddSceneBuilding_NFMsgShare_2eproto.base);
config_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
master_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&pos_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&is_building_) -
reinterpret_cast<char*>(&pos_)) + sizeof(is_building_));
}
ReqAddSceneBuilding::~ReqAddSceneBuilding() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAddSceneBuilding)
SharedDtor();
}
void ReqAddSceneBuilding::SharedDtor() {
config_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
master_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete pos_;
if (this != internal_default_instance()) delete guid_;
if (this != internal_default_instance()) delete master_;
}
void ReqAddSceneBuilding::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAddSceneBuilding& ReqAddSceneBuilding::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAddSceneBuilding_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAddSceneBuilding::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAddSceneBuilding)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
config_id_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
master_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && pos_ != nullptr) {
delete pos_;
}
pos_ = nullptr;
if (GetArenaNoVirtual() == nullptr && guid_ != nullptr) {
delete guid_;
}
guid_ = nullptr;
if (GetArenaNoVirtual() == nullptr && master_ != nullptr) {
delete master_;
}
master_ = nullptr;
::memset(&scene_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&is_building_) -
reinterpret_cast<char*>(&scene_id_)) + sizeof(is_building_));
_internal_metadata_.Clear();
}
const char* ReqAddSceneBuilding::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Vector3 pos = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_pos(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident guid = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_guid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident master = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr = ctx->ParseMessage(_internal_mutable_master(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes config_id = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_config_id(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 scene_id = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
scene_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes master_name = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_master_name(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 is_home_scene = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
is_home_scene_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 is_building = 8;
case 8:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
is_building_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAddSceneBuilding::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAddSceneBuilding)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Vector3 pos = 1;
if (this->has_pos()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::pos(this), target, stream);
}
// .NFMsg.Ident guid = 2;
if (this->has_guid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
2, _Internal::guid(this), target, stream);
}
// .NFMsg.Ident master = 3;
if (this->has_master()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
3, _Internal::master(this), target, stream);
}
// bytes config_id = 4;
if (this->config_id().size() > 0) {
target = stream->WriteBytesMaybeAliased(
4, this->_internal_config_id(), target);
}
// int32 scene_id = 5;
if (this->scene_id() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_scene_id(), target);
}
// bytes master_name = 6;
if (this->master_name().size() > 0) {
target = stream->WriteBytesMaybeAliased(
6, this->_internal_master_name(), target);
}
// int32 is_home_scene = 7;
if (this->is_home_scene() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_is_home_scene(), target);
}
// int32 is_building = 8;
if (this->is_building() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(8, this->_internal_is_building(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAddSceneBuilding)
return target;
}
size_t ReqAddSceneBuilding::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAddSceneBuilding)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes config_id = 4;
if (this->config_id().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_config_id());
}
// bytes master_name = 6;
if (this->master_name().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_master_name());
}
// .NFMsg.Vector3 pos = 1;
if (this->has_pos()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*pos_);
}
// .NFMsg.Ident guid = 2;
if (this->has_guid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*guid_);
}
// .NFMsg.Ident master = 3;
if (this->has_master()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*master_);
}
// int32 scene_id = 5;
if (this->scene_id() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_scene_id());
}
// int32 is_home_scene = 7;
if (this->is_home_scene() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_is_home_scene());
}
// int32 is_building = 8;
if (this->is_building() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_is_building());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAddSceneBuilding::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAddSceneBuilding)
GOOGLE_DCHECK_NE(&from, this);
const ReqAddSceneBuilding* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAddSceneBuilding>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAddSceneBuilding)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAddSceneBuilding)
MergeFrom(*source);
}
}
void ReqAddSceneBuilding::MergeFrom(const ReqAddSceneBuilding& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAddSceneBuilding)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.config_id().size() > 0) {
config_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.config_id_);
}
if (from.master_name().size() > 0) {
master_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.master_name_);
}
if (from.has_pos()) {
_internal_mutable_pos()->::NFMsg::Vector3::MergeFrom(from._internal_pos());
}
if (from.has_guid()) {
_internal_mutable_guid()->::NFMsg::Ident::MergeFrom(from._internal_guid());
}
if (from.has_master()) {
_internal_mutable_master()->::NFMsg::Ident::MergeFrom(from._internal_master());
}
if (from.scene_id() != 0) {
_internal_set_scene_id(from._internal_scene_id());
}
if (from.is_home_scene() != 0) {
_internal_set_is_home_scene(from._internal_is_home_scene());
}
if (from.is_building() != 0) {
_internal_set_is_building(from._internal_is_building());
}
}
void ReqAddSceneBuilding::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAddSceneBuilding)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAddSceneBuilding::CopyFrom(const ReqAddSceneBuilding& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAddSceneBuilding)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAddSceneBuilding::IsInitialized() const {
return true;
}
void ReqAddSceneBuilding::InternalSwap(ReqAddSceneBuilding* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
config_id_.Swap(&other->config_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
master_name_.Swap(&other->master_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(pos_, other->pos_);
swap(guid_, other->guid_);
swap(master_, other->master_);
swap(scene_id_, other->scene_id_);
swap(is_home_scene_, other->is_home_scene_);
swap(is_building_, other->is_building_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAddSceneBuilding::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqSceneBuildings::InitAsDefaultInstance() {
::NFMsg::_ReqSceneBuildings_default_instance_._instance.get_mutable()->pos_ = const_cast< ::NFMsg::Vector3*>(
::NFMsg::Vector3::internal_default_instance());
}
class ReqSceneBuildings::_Internal {
public:
static const ::NFMsg::Vector3& pos(const ReqSceneBuildings* msg);
};
const ::NFMsg::Vector3&
ReqSceneBuildings::_Internal::pos(const ReqSceneBuildings* msg) {
return *msg->pos_;
}
void ReqSceneBuildings::clear_pos() {
if (GetArenaNoVirtual() == nullptr && pos_ != nullptr) {
delete pos_;
}
pos_ = nullptr;
}
ReqSceneBuildings::ReqSceneBuildings()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqSceneBuildings)
}
ReqSceneBuildings::ReqSceneBuildings(const ReqSceneBuildings& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_pos()) {
pos_ = new ::NFMsg::Vector3(*from.pos_);
} else {
pos_ = nullptr;
}
scene_id_ = from.scene_id_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqSceneBuildings)
}
void ReqSceneBuildings::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqSceneBuildings_NFMsgShare_2eproto.base);
::memset(&pos_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&scene_id_) -
reinterpret_cast<char*>(&pos_)) + sizeof(scene_id_));
}
ReqSceneBuildings::~ReqSceneBuildings() {
// @@protoc_insertion_point(destructor:NFMsg.ReqSceneBuildings)
SharedDtor();
}
void ReqSceneBuildings::SharedDtor() {
if (this != internal_default_instance()) delete pos_;
}
void ReqSceneBuildings::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqSceneBuildings& ReqSceneBuildings::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqSceneBuildings_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqSceneBuildings::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqSceneBuildings)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && pos_ != nullptr) {
delete pos_;
}
pos_ = nullptr;
scene_id_ = 0;
_internal_metadata_.Clear();
}
const char* ReqSceneBuildings::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 scene_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
scene_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Vector3 pos = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_pos(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqSceneBuildings::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqSceneBuildings)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 scene_id = 1;
if (this->scene_id() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_scene_id(), target);
}
// .NFMsg.Vector3 pos = 2;
if (this->has_pos()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
2, _Internal::pos(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqSceneBuildings)
return target;
}
size_t ReqSceneBuildings::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqSceneBuildings)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Vector3 pos = 2;
if (this->has_pos()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*pos_);
}
// int32 scene_id = 1;
if (this->scene_id() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_scene_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqSceneBuildings::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqSceneBuildings)
GOOGLE_DCHECK_NE(&from, this);
const ReqSceneBuildings* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqSceneBuildings>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqSceneBuildings)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqSceneBuildings)
MergeFrom(*source);
}
}
void ReqSceneBuildings::MergeFrom(const ReqSceneBuildings& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqSceneBuildings)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_pos()) {
_internal_mutable_pos()->::NFMsg::Vector3::MergeFrom(from._internal_pos());
}
if (from.scene_id() != 0) {
_internal_set_scene_id(from._internal_scene_id());
}
}
void ReqSceneBuildings::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqSceneBuildings)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqSceneBuildings::CopyFrom(const ReqSceneBuildings& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqSceneBuildings)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqSceneBuildings::IsInitialized() const {
return true;
}
void ReqSceneBuildings::InternalSwap(ReqSceneBuildings* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(pos_, other->pos_);
swap(scene_id_, other->scene_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqSceneBuildings::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void AckSceneBuildings::InitAsDefaultInstance() {
}
class AckSceneBuildings::_Internal {
public:
};
AckSceneBuildings::AckSceneBuildings()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.AckSceneBuildings)
}
AckSceneBuildings::AckSceneBuildings(const AckSceneBuildings& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
buildings_(from.buildings_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:NFMsg.AckSceneBuildings)
}
void AckSceneBuildings::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AckSceneBuildings_NFMsgShare_2eproto.base);
}
AckSceneBuildings::~AckSceneBuildings() {
// @@protoc_insertion_point(destructor:NFMsg.AckSceneBuildings)
SharedDtor();
}
void AckSceneBuildings::SharedDtor() {
}
void AckSceneBuildings::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const AckSceneBuildings& AckSceneBuildings::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AckSceneBuildings_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void AckSceneBuildings::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.AckSceneBuildings)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
buildings_.Clear();
_internal_metadata_.Clear();
}
const char* AckSceneBuildings::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// repeated .NFMsg.ReqAddSceneBuilding buildings = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_buildings(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* AckSceneBuildings::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.AckSceneBuildings)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .NFMsg.ReqAddSceneBuilding buildings = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_buildings_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(1, this->_internal_buildings(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.AckSceneBuildings)
return target;
}
size_t AckSceneBuildings::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.AckSceneBuildings)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.ReqAddSceneBuilding buildings = 1;
total_size += 1UL * this->_internal_buildings_size();
for (const auto& msg : this->buildings_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void AckSceneBuildings::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.AckSceneBuildings)
GOOGLE_DCHECK_NE(&from, this);
const AckSceneBuildings* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AckSceneBuildings>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.AckSceneBuildings)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.AckSceneBuildings)
MergeFrom(*source);
}
}
void AckSceneBuildings::MergeFrom(const AckSceneBuildings& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.AckSceneBuildings)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
buildings_.MergeFrom(from.buildings_);
}
void AckSceneBuildings::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.AckSceneBuildings)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AckSceneBuildings::CopyFrom(const AckSceneBuildings& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.AckSceneBuildings)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AckSceneBuildings::IsInitialized() const {
return true;
}
void AckSceneBuildings::InternalSwap(AckSceneBuildings* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
buildings_.InternalSwap(&other->buildings_);
}
::PROTOBUF_NAMESPACE_ID::Metadata AckSceneBuildings::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqStoreSceneBuildings::InitAsDefaultInstance() {
::NFMsg::_ReqStoreSceneBuildings_default_instance_._instance.get_mutable()->guid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqStoreSceneBuildings::_Internal {
public:
static const ::NFMsg::Ident& guid(const ReqStoreSceneBuildings* msg);
};
const ::NFMsg::Ident&
ReqStoreSceneBuildings::_Internal::guid(const ReqStoreSceneBuildings* msg) {
return *msg->guid_;
}
void ReqStoreSceneBuildings::clear_guid() {
if (GetArenaNoVirtual() == nullptr && guid_ != nullptr) {
delete guid_;
}
guid_ = nullptr;
}
ReqStoreSceneBuildings::ReqStoreSceneBuildings()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqStoreSceneBuildings)
}
ReqStoreSceneBuildings::ReqStoreSceneBuildings(const ReqStoreSceneBuildings& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
buildings_(from.buildings_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_guid()) {
guid_ = new ::NFMsg::Ident(*from.guid_);
} else {
guid_ = nullptr;
}
home_scene_id_ = from.home_scene_id_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqStoreSceneBuildings)
}
void ReqStoreSceneBuildings::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqStoreSceneBuildings_NFMsgShare_2eproto.base);
::memset(&guid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&home_scene_id_) -
reinterpret_cast<char*>(&guid_)) + sizeof(home_scene_id_));
}
ReqStoreSceneBuildings::~ReqStoreSceneBuildings() {
// @@protoc_insertion_point(destructor:NFMsg.ReqStoreSceneBuildings)
SharedDtor();
}
void ReqStoreSceneBuildings::SharedDtor() {
if (this != internal_default_instance()) delete guid_;
}
void ReqStoreSceneBuildings::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqStoreSceneBuildings& ReqStoreSceneBuildings::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqStoreSceneBuildings_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqStoreSceneBuildings::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqStoreSceneBuildings)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
buildings_.Clear();
if (GetArenaNoVirtual() == nullptr && guid_ != nullptr) {
delete guid_;
}
guid_ = nullptr;
home_scene_id_ = 0;
_internal_metadata_.Clear();
}
const char* ReqStoreSceneBuildings::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident guid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_guid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 home_scene_id = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
home_scene_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .NFMsg.ReqAddSceneBuilding buildings = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_buildings(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqStoreSceneBuildings::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqStoreSceneBuildings)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident guid = 1;
if (this->has_guid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::guid(this), target, stream);
}
// int32 home_scene_id = 2;
if (this->home_scene_id() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_home_scene_id(), target);
}
// repeated .NFMsg.ReqAddSceneBuilding buildings = 3;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_buildings_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(3, this->_internal_buildings(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqStoreSceneBuildings)
return target;
}
size_t ReqStoreSceneBuildings::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqStoreSceneBuildings)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.ReqAddSceneBuilding buildings = 3;
total_size += 1UL * this->_internal_buildings_size();
for (const auto& msg : this->buildings_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// .NFMsg.Ident guid = 1;
if (this->has_guid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*guid_);
}
// int32 home_scene_id = 2;
if (this->home_scene_id() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_home_scene_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqStoreSceneBuildings::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqStoreSceneBuildings)
GOOGLE_DCHECK_NE(&from, this);
const ReqStoreSceneBuildings* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqStoreSceneBuildings>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqStoreSceneBuildings)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqStoreSceneBuildings)
MergeFrom(*source);
}
}
void ReqStoreSceneBuildings::MergeFrom(const ReqStoreSceneBuildings& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqStoreSceneBuildings)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
buildings_.MergeFrom(from.buildings_);
if (from.has_guid()) {
_internal_mutable_guid()->::NFMsg::Ident::MergeFrom(from._internal_guid());
}
if (from.home_scene_id() != 0) {
_internal_set_home_scene_id(from._internal_home_scene_id());
}
}
void ReqStoreSceneBuildings::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqStoreSceneBuildings)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqStoreSceneBuildings::CopyFrom(const ReqStoreSceneBuildings& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqStoreSceneBuildings)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqStoreSceneBuildings::IsInitialized() const {
return true;
}
void ReqStoreSceneBuildings::InternalSwap(ReqStoreSceneBuildings* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
buildings_.InternalSwap(&other->buildings_);
swap(guid_, other->guid_);
swap(home_scene_id_, other->home_scene_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqStoreSceneBuildings::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckCreateClan::InitAsDefaultInstance() {
::NFMsg::_ReqAckCreateClan_default_instance_._instance.get_mutable()->clan_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckCreateClan_default_instance_._instance.get_mutable()->clan_player_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckCreateClan::_Internal {
public:
static const ::NFMsg::Ident& clan_id(const ReqAckCreateClan* msg);
static const ::NFMsg::Ident& clan_player_id(const ReqAckCreateClan* msg);
};
const ::NFMsg::Ident&
ReqAckCreateClan::_Internal::clan_id(const ReqAckCreateClan* msg) {
return *msg->clan_id_;
}
const ::NFMsg::Ident&
ReqAckCreateClan::_Internal::clan_player_id(const ReqAckCreateClan* msg) {
return *msg->clan_player_id_;
}
void ReqAckCreateClan::clear_clan_id() {
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
}
void ReqAckCreateClan::clear_clan_player_id() {
if (GetArenaNoVirtual() == nullptr && clan_player_id_ != nullptr) {
delete clan_player_id_;
}
clan_player_id_ = nullptr;
}
ReqAckCreateClan::ReqAckCreateClan()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckCreateClan)
}
ReqAckCreateClan::ReqAckCreateClan(const ReqAckCreateClan& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
clan_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_clan_name().empty()) {
clan_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_name_);
}
clan_desc_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_clan_desc().empty()) {
clan_desc_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_desc_);
}
clan_player_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_clan_player_name().empty()) {
clan_player_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_player_name_);
}
if (from._internal_has_clan_id()) {
clan_id_ = new ::NFMsg::Ident(*from.clan_id_);
} else {
clan_id_ = nullptr;
}
if (from._internal_has_clan_player_id()) {
clan_player_id_ = new ::NFMsg::Ident(*from.clan_player_id_);
} else {
clan_player_id_ = nullptr;
}
clan_player_bp_ = from.clan_player_bp_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckCreateClan)
}
void ReqAckCreateClan::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckCreateClan_NFMsgShare_2eproto.base);
clan_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
clan_desc_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
clan_player_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&clan_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&clan_player_bp_) -
reinterpret_cast<char*>(&clan_id_)) + sizeof(clan_player_bp_));
}
ReqAckCreateClan::~ReqAckCreateClan() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckCreateClan)
SharedDtor();
}
void ReqAckCreateClan::SharedDtor() {
clan_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
clan_desc_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
clan_player_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete clan_id_;
if (this != internal_default_instance()) delete clan_player_id_;
}
void ReqAckCreateClan::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckCreateClan& ReqAckCreateClan::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckCreateClan_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckCreateClan::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckCreateClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
clan_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
clan_desc_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
clan_player_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
if (GetArenaNoVirtual() == nullptr && clan_player_id_ != nullptr) {
delete clan_player_id_;
}
clan_player_id_ = nullptr;
clan_player_bp_ = 0;
_internal_metadata_.Clear();
}
const char* ReqAckCreateClan::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident clan_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_clan_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes clan_name = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_clan_name(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes clan_desc = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_clan_desc(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident clan_player_id = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
ptr = ctx->ParseMessage(_internal_mutable_clan_player_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes clan_player_name = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_clan_player_name(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 clan_player_bp = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
clan_player_bp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckCreateClan::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckCreateClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::clan_id(this), target, stream);
}
// bytes clan_name = 2;
if (this->clan_name().size() > 0) {
target = stream->WriteBytesMaybeAliased(
2, this->_internal_clan_name(), target);
}
// bytes clan_desc = 3;
if (this->clan_desc().size() > 0) {
target = stream->WriteBytesMaybeAliased(
3, this->_internal_clan_desc(), target);
}
// .NFMsg.Ident clan_player_id = 4;
if (this->has_clan_player_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
4, _Internal::clan_player_id(this), target, stream);
}
// bytes clan_player_name = 5;
if (this->clan_player_name().size() > 0) {
target = stream->WriteBytesMaybeAliased(
5, this->_internal_clan_player_name(), target);
}
// int32 clan_player_bp = 6;
if (this->clan_player_bp() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_clan_player_bp(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckCreateClan)
return target;
}
size_t ReqAckCreateClan::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckCreateClan)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes clan_name = 2;
if (this->clan_name().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_clan_name());
}
// bytes clan_desc = 3;
if (this->clan_desc().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_clan_desc());
}
// bytes clan_player_name = 5;
if (this->clan_player_name().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_clan_player_name());
}
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*clan_id_);
}
// .NFMsg.Ident clan_player_id = 4;
if (this->has_clan_player_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*clan_player_id_);
}
// int32 clan_player_bp = 6;
if (this->clan_player_bp() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_clan_player_bp());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckCreateClan::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckCreateClan)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckCreateClan* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckCreateClan>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckCreateClan)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckCreateClan)
MergeFrom(*source);
}
}
void ReqAckCreateClan::MergeFrom(const ReqAckCreateClan& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckCreateClan)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.clan_name().size() > 0) {
clan_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_name_);
}
if (from.clan_desc().size() > 0) {
clan_desc_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_desc_);
}
if (from.clan_player_name().size() > 0) {
clan_player_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_player_name_);
}
if (from.has_clan_id()) {
_internal_mutable_clan_id()->::NFMsg::Ident::MergeFrom(from._internal_clan_id());
}
if (from.has_clan_player_id()) {
_internal_mutable_clan_player_id()->::NFMsg::Ident::MergeFrom(from._internal_clan_player_id());
}
if (from.clan_player_bp() != 0) {
_internal_set_clan_player_bp(from._internal_clan_player_bp());
}
}
void ReqAckCreateClan::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckCreateClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckCreateClan::CopyFrom(const ReqAckCreateClan& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckCreateClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckCreateClan::IsInitialized() const {
return true;
}
void ReqAckCreateClan::InternalSwap(ReqAckCreateClan* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
clan_name_.Swap(&other->clan_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clan_desc_.Swap(&other->clan_desc_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clan_player_name_.Swap(&other->clan_player_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(clan_id_, other->clan_id_);
swap(clan_player_id_, other->clan_player_id_);
swap(clan_player_bp_, other->clan_player_bp_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckCreateClan::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqSearchClan::InitAsDefaultInstance() {
}
class ReqSearchClan::_Internal {
public:
};
ReqSearchClan::ReqSearchClan()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqSearchClan)
}
ReqSearchClan::ReqSearchClan(const ReqSearchClan& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
clan_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_clan_name().empty()) {
clan_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_name_);
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqSearchClan)
}
void ReqSearchClan::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqSearchClan_NFMsgShare_2eproto.base);
clan_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
ReqSearchClan::~ReqSearchClan() {
// @@protoc_insertion_point(destructor:NFMsg.ReqSearchClan)
SharedDtor();
}
void ReqSearchClan::SharedDtor() {
clan_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void ReqSearchClan::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqSearchClan& ReqSearchClan::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqSearchClan_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqSearchClan::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqSearchClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
clan_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
_internal_metadata_.Clear();
}
const char* ReqSearchClan::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// bytes clan_name = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_clan_name(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqSearchClan::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqSearchClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// bytes clan_name = 1;
if (this->clan_name().size() > 0) {
target = stream->WriteBytesMaybeAliased(
1, this->_internal_clan_name(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqSearchClan)
return target;
}
size_t ReqSearchClan::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqSearchClan)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes clan_name = 1;
if (this->clan_name().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_clan_name());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqSearchClan::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqSearchClan)
GOOGLE_DCHECK_NE(&from, this);
const ReqSearchClan* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqSearchClan>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqSearchClan)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqSearchClan)
MergeFrom(*source);
}
}
void ReqSearchClan::MergeFrom(const ReqSearchClan& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqSearchClan)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.clan_name().size() > 0) {
clan_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_name_);
}
}
void ReqSearchClan::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqSearchClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqSearchClan::CopyFrom(const ReqSearchClan& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqSearchClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqSearchClan::IsInitialized() const {
return true;
}
void ReqSearchClan::InternalSwap(ReqSearchClan* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
clan_name_.Swap(&other->clan_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqSearchClan::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void AckSearchClan_SearchClanObject::InitAsDefaultInstance() {
::NFMsg::_AckSearchClan_SearchClanObject_default_instance_._instance.get_mutable()->clan_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class AckSearchClan_SearchClanObject::_Internal {
public:
static const ::NFMsg::Ident& clan_id(const AckSearchClan_SearchClanObject* msg);
};
const ::NFMsg::Ident&
AckSearchClan_SearchClanObject::_Internal::clan_id(const AckSearchClan_SearchClanObject* msg) {
return *msg->clan_id_;
}
void AckSearchClan_SearchClanObject::clear_clan_id() {
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
}
AckSearchClan_SearchClanObject::AckSearchClan_SearchClanObject()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.AckSearchClan.SearchClanObject)
}
AckSearchClan_SearchClanObject::AckSearchClan_SearchClanObject(const AckSearchClan_SearchClanObject& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
clan_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_clan_name().empty()) {
clan_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_name_);
}
clan_icon_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_clan_icon().empty()) {
clan_icon_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_icon_);
}
if (from._internal_has_clan_id()) {
clan_id_ = new ::NFMsg::Ident(*from.clan_id_);
} else {
clan_id_ = nullptr;
}
::memcpy(&clan_member_count_, &from.clan_member_count_,
static_cast<size_t>(reinterpret_cast<char*>(&clan_rank_) -
reinterpret_cast<char*>(&clan_member_count_)) + sizeof(clan_rank_));
// @@protoc_insertion_point(copy_constructor:NFMsg.AckSearchClan.SearchClanObject)
}
void AckSearchClan_SearchClanObject::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AckSearchClan_SearchClanObject_NFMsgShare_2eproto.base);
clan_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
clan_icon_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&clan_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&clan_rank_) -
reinterpret_cast<char*>(&clan_id_)) + sizeof(clan_rank_));
}
AckSearchClan_SearchClanObject::~AckSearchClan_SearchClanObject() {
// @@protoc_insertion_point(destructor:NFMsg.AckSearchClan.SearchClanObject)
SharedDtor();
}
void AckSearchClan_SearchClanObject::SharedDtor() {
clan_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
clan_icon_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete clan_id_;
}
void AckSearchClan_SearchClanObject::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const AckSearchClan_SearchClanObject& AckSearchClan_SearchClanObject::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AckSearchClan_SearchClanObject_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void AckSearchClan_SearchClanObject::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.AckSearchClan.SearchClanObject)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
clan_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
clan_icon_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
::memset(&clan_member_count_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&clan_rank_) -
reinterpret_cast<char*>(&clan_member_count_)) + sizeof(clan_rank_));
_internal_metadata_.Clear();
}
const char* AckSearchClan_SearchClanObject::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident clan_ID = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_clan_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes clan_name = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_clan_name(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes clan_icon = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_clan_icon(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 clan_member_count = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
clan_member_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 clan_member_max_count = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
clan_member_max_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 clan_honor = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
clan_honor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 clan_rank = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
clan_rank_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* AckSearchClan_SearchClanObject::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.AckSearchClan.SearchClanObject)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident clan_ID = 1;
if (this->has_clan_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::clan_id(this), target, stream);
}
// bytes clan_name = 2;
if (this->clan_name().size() > 0) {
target = stream->WriteBytesMaybeAliased(
2, this->_internal_clan_name(), target);
}
// bytes clan_icon = 3;
if (this->clan_icon().size() > 0) {
target = stream->WriteBytesMaybeAliased(
3, this->_internal_clan_icon(), target);
}
// int32 clan_member_count = 4;
if (this->clan_member_count() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_clan_member_count(), target);
}
// int32 clan_member_max_count = 5;
if (this->clan_member_max_count() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_clan_member_max_count(), target);
}
// int32 clan_honor = 6;
if (this->clan_honor() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_clan_honor(), target);
}
// int32 clan_rank = 7;
if (this->clan_rank() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_clan_rank(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.AckSearchClan.SearchClanObject)
return target;
}
size_t AckSearchClan_SearchClanObject::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.AckSearchClan.SearchClanObject)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes clan_name = 2;
if (this->clan_name().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_clan_name());
}
// bytes clan_icon = 3;
if (this->clan_icon().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_clan_icon());
}
// .NFMsg.Ident clan_ID = 1;
if (this->has_clan_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*clan_id_);
}
// int32 clan_member_count = 4;
if (this->clan_member_count() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_clan_member_count());
}
// int32 clan_member_max_count = 5;
if (this->clan_member_max_count() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_clan_member_max_count());
}
// int32 clan_honor = 6;
if (this->clan_honor() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_clan_honor());
}
// int32 clan_rank = 7;
if (this->clan_rank() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_clan_rank());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void AckSearchClan_SearchClanObject::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.AckSearchClan.SearchClanObject)
GOOGLE_DCHECK_NE(&from, this);
const AckSearchClan_SearchClanObject* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AckSearchClan_SearchClanObject>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.AckSearchClan.SearchClanObject)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.AckSearchClan.SearchClanObject)
MergeFrom(*source);
}
}
void AckSearchClan_SearchClanObject::MergeFrom(const AckSearchClan_SearchClanObject& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.AckSearchClan.SearchClanObject)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.clan_name().size() > 0) {
clan_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_name_);
}
if (from.clan_icon().size() > 0) {
clan_icon_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_icon_);
}
if (from.has_clan_id()) {
_internal_mutable_clan_id()->::NFMsg::Ident::MergeFrom(from._internal_clan_id());
}
if (from.clan_member_count() != 0) {
_internal_set_clan_member_count(from._internal_clan_member_count());
}
if (from.clan_member_max_count() != 0) {
_internal_set_clan_member_max_count(from._internal_clan_member_max_count());
}
if (from.clan_honor() != 0) {
_internal_set_clan_honor(from._internal_clan_honor());
}
if (from.clan_rank() != 0) {
_internal_set_clan_rank(from._internal_clan_rank());
}
}
void AckSearchClan_SearchClanObject::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.AckSearchClan.SearchClanObject)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AckSearchClan_SearchClanObject::CopyFrom(const AckSearchClan_SearchClanObject& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.AckSearchClan.SearchClanObject)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AckSearchClan_SearchClanObject::IsInitialized() const {
return true;
}
void AckSearchClan_SearchClanObject::InternalSwap(AckSearchClan_SearchClanObject* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
clan_name_.Swap(&other->clan_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
clan_icon_.Swap(&other->clan_icon_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(clan_id_, other->clan_id_);
swap(clan_member_count_, other->clan_member_count_);
swap(clan_member_max_count_, other->clan_member_max_count_);
swap(clan_honor_, other->clan_honor_);
swap(clan_rank_, other->clan_rank_);
}
::PROTOBUF_NAMESPACE_ID::Metadata AckSearchClan_SearchClanObject::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void AckSearchClan::InitAsDefaultInstance() {
}
class AckSearchClan::_Internal {
public:
};
AckSearchClan::AckSearchClan()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.AckSearchClan)
}
AckSearchClan::AckSearchClan(const AckSearchClan& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
clan_list_(from.clan_list_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:NFMsg.AckSearchClan)
}
void AckSearchClan::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AckSearchClan_NFMsgShare_2eproto.base);
}
AckSearchClan::~AckSearchClan() {
// @@protoc_insertion_point(destructor:NFMsg.AckSearchClan)
SharedDtor();
}
void AckSearchClan::SharedDtor() {
}
void AckSearchClan::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const AckSearchClan& AckSearchClan::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AckSearchClan_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void AckSearchClan::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.AckSearchClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
clan_list_.Clear();
_internal_metadata_.Clear();
}
const char* AckSearchClan::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// repeated .NFMsg.AckSearchClan.SearchClanObject clan_list = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_clan_list(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* AckSearchClan::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.AckSearchClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .NFMsg.AckSearchClan.SearchClanObject clan_list = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_clan_list_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(1, this->_internal_clan_list(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.AckSearchClan)
return target;
}
size_t AckSearchClan::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.AckSearchClan)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.AckSearchClan.SearchClanObject clan_list = 1;
total_size += 1UL * this->_internal_clan_list_size();
for (const auto& msg : this->clan_list_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void AckSearchClan::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.AckSearchClan)
GOOGLE_DCHECK_NE(&from, this);
const AckSearchClan* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AckSearchClan>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.AckSearchClan)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.AckSearchClan)
MergeFrom(*source);
}
}
void AckSearchClan::MergeFrom(const AckSearchClan& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.AckSearchClan)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
clan_list_.MergeFrom(from.clan_list_);
}
void AckSearchClan::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.AckSearchClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AckSearchClan::CopyFrom(const AckSearchClan& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.AckSearchClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AckSearchClan::IsInitialized() const {
return true;
}
void AckSearchClan::InternalSwap(AckSearchClan* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
clan_list_.InternalSwap(&other->clan_list_);
}
::PROTOBUF_NAMESPACE_ID::Metadata AckSearchClan::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckJoinClan::InitAsDefaultInstance() {
::NFMsg::_ReqAckJoinClan_default_instance_._instance.get_mutable()->clan_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckJoinClan_default_instance_._instance.get_mutable()->clan_player_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckJoinClan::_Internal {
public:
static const ::NFMsg::Ident& clan_id(const ReqAckJoinClan* msg);
static const ::NFMsg::Ident& clan_player_id(const ReqAckJoinClan* msg);
};
const ::NFMsg::Ident&
ReqAckJoinClan::_Internal::clan_id(const ReqAckJoinClan* msg) {
return *msg->clan_id_;
}
const ::NFMsg::Ident&
ReqAckJoinClan::_Internal::clan_player_id(const ReqAckJoinClan* msg) {
return *msg->clan_player_id_;
}
void ReqAckJoinClan::clear_clan_id() {
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
}
void ReqAckJoinClan::clear_clan_player_id() {
if (GetArenaNoVirtual() == nullptr && clan_player_id_ != nullptr) {
delete clan_player_id_;
}
clan_player_id_ = nullptr;
}
ReqAckJoinClan::ReqAckJoinClan()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckJoinClan)
}
ReqAckJoinClan::ReqAckJoinClan(const ReqAckJoinClan& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
clan_player_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_clan_player_name().empty()) {
clan_player_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_player_name_);
}
if (from._internal_has_clan_id()) {
clan_id_ = new ::NFMsg::Ident(*from.clan_id_);
} else {
clan_id_ = nullptr;
}
if (from._internal_has_clan_player_id()) {
clan_player_id_ = new ::NFMsg::Ident(*from.clan_player_id_);
} else {
clan_player_id_ = nullptr;
}
clan_player_bp_ = from.clan_player_bp_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckJoinClan)
}
void ReqAckJoinClan::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckJoinClan_NFMsgShare_2eproto.base);
clan_player_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&clan_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&clan_player_bp_) -
reinterpret_cast<char*>(&clan_id_)) + sizeof(clan_player_bp_));
}
ReqAckJoinClan::~ReqAckJoinClan() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckJoinClan)
SharedDtor();
}
void ReqAckJoinClan::SharedDtor() {
clan_player_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete clan_id_;
if (this != internal_default_instance()) delete clan_player_id_;
}
void ReqAckJoinClan::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckJoinClan& ReqAckJoinClan::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckJoinClan_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckJoinClan::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckJoinClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
clan_player_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
if (GetArenaNoVirtual() == nullptr && clan_player_id_ != nullptr) {
delete clan_player_id_;
}
clan_player_id_ = nullptr;
clan_player_bp_ = 0;
_internal_metadata_.Clear();
}
const char* ReqAckJoinClan::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident clan_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_clan_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident clan_player_id = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
ptr = ctx->ParseMessage(_internal_mutable_clan_player_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes clan_player_name = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_clan_player_name(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 clan_player_bp = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
clan_player_bp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckJoinClan::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckJoinClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::clan_id(this), target, stream);
}
// .NFMsg.Ident clan_player_id = 4;
if (this->has_clan_player_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
4, _Internal::clan_player_id(this), target, stream);
}
// bytes clan_player_name = 5;
if (this->clan_player_name().size() > 0) {
target = stream->WriteBytesMaybeAliased(
5, this->_internal_clan_player_name(), target);
}
// int32 clan_player_bp = 6;
if (this->clan_player_bp() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_clan_player_bp(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckJoinClan)
return target;
}
size_t ReqAckJoinClan::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckJoinClan)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes clan_player_name = 5;
if (this->clan_player_name().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_clan_player_name());
}
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*clan_id_);
}
// .NFMsg.Ident clan_player_id = 4;
if (this->has_clan_player_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*clan_player_id_);
}
// int32 clan_player_bp = 6;
if (this->clan_player_bp() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_clan_player_bp());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckJoinClan::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckJoinClan)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckJoinClan* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckJoinClan>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckJoinClan)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckJoinClan)
MergeFrom(*source);
}
}
void ReqAckJoinClan::MergeFrom(const ReqAckJoinClan& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckJoinClan)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.clan_player_name().size() > 0) {
clan_player_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.clan_player_name_);
}
if (from.has_clan_id()) {
_internal_mutable_clan_id()->::NFMsg::Ident::MergeFrom(from._internal_clan_id());
}
if (from.has_clan_player_id()) {
_internal_mutable_clan_player_id()->::NFMsg::Ident::MergeFrom(from._internal_clan_player_id());
}
if (from.clan_player_bp() != 0) {
_internal_set_clan_player_bp(from._internal_clan_player_bp());
}
}
void ReqAckJoinClan::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckJoinClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckJoinClan::CopyFrom(const ReqAckJoinClan& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckJoinClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckJoinClan::IsInitialized() const {
return true;
}
void ReqAckJoinClan::InternalSwap(ReqAckJoinClan* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
clan_player_name_.Swap(&other->clan_player_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(clan_id_, other->clan_id_);
swap(clan_player_id_, other->clan_player_id_);
swap(clan_player_bp_, other->clan_player_bp_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckJoinClan::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckLeaveClan::InitAsDefaultInstance() {
::NFMsg::_ReqAckLeaveClan_default_instance_._instance.get_mutable()->clan_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckLeaveClan_default_instance_._instance.get_mutable()->clan_player_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckLeaveClan::_Internal {
public:
static const ::NFMsg::Ident& clan_id(const ReqAckLeaveClan* msg);
static const ::NFMsg::Ident& clan_player_id(const ReqAckLeaveClan* msg);
};
const ::NFMsg::Ident&
ReqAckLeaveClan::_Internal::clan_id(const ReqAckLeaveClan* msg) {
return *msg->clan_id_;
}
const ::NFMsg::Ident&
ReqAckLeaveClan::_Internal::clan_player_id(const ReqAckLeaveClan* msg) {
return *msg->clan_player_id_;
}
void ReqAckLeaveClan::clear_clan_id() {
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
}
void ReqAckLeaveClan::clear_clan_player_id() {
if (GetArenaNoVirtual() == nullptr && clan_player_id_ != nullptr) {
delete clan_player_id_;
}
clan_player_id_ = nullptr;
}
ReqAckLeaveClan::ReqAckLeaveClan()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckLeaveClan)
}
ReqAckLeaveClan::ReqAckLeaveClan(const ReqAckLeaveClan& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_clan_id()) {
clan_id_ = new ::NFMsg::Ident(*from.clan_id_);
} else {
clan_id_ = nullptr;
}
if (from._internal_has_clan_player_id()) {
clan_player_id_ = new ::NFMsg::Ident(*from.clan_player_id_);
} else {
clan_player_id_ = nullptr;
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckLeaveClan)
}
void ReqAckLeaveClan::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckLeaveClan_NFMsgShare_2eproto.base);
::memset(&clan_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&clan_player_id_) -
reinterpret_cast<char*>(&clan_id_)) + sizeof(clan_player_id_));
}
ReqAckLeaveClan::~ReqAckLeaveClan() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckLeaveClan)
SharedDtor();
}
void ReqAckLeaveClan::SharedDtor() {
if (this != internal_default_instance()) delete clan_id_;
if (this != internal_default_instance()) delete clan_player_id_;
}
void ReqAckLeaveClan::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckLeaveClan& ReqAckLeaveClan::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckLeaveClan_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckLeaveClan::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckLeaveClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
if (GetArenaNoVirtual() == nullptr && clan_player_id_ != nullptr) {
delete clan_player_id_;
}
clan_player_id_ = nullptr;
_internal_metadata_.Clear();
}
const char* ReqAckLeaveClan::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident clan_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_clan_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident clan_player_id = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_clan_player_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckLeaveClan::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckLeaveClan)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::clan_id(this), target, stream);
}
// .NFMsg.Ident clan_player_id = 2;
if (this->has_clan_player_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
2, _Internal::clan_player_id(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckLeaveClan)
return target;
}
size_t ReqAckLeaveClan::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckLeaveClan)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*clan_id_);
}
// .NFMsg.Ident clan_player_id = 2;
if (this->has_clan_player_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*clan_player_id_);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckLeaveClan::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckLeaveClan)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckLeaveClan* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckLeaveClan>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckLeaveClan)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckLeaveClan)
MergeFrom(*source);
}
}
void ReqAckLeaveClan::MergeFrom(const ReqAckLeaveClan& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckLeaveClan)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_clan_id()) {
_internal_mutable_clan_id()->::NFMsg::Ident::MergeFrom(from._internal_clan_id());
}
if (from.has_clan_player_id()) {
_internal_mutable_clan_player_id()->::NFMsg::Ident::MergeFrom(from._internal_clan_player_id());
}
}
void ReqAckLeaveClan::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckLeaveClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckLeaveClan::CopyFrom(const ReqAckLeaveClan& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckLeaveClan)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckLeaveClan::IsInitialized() const {
return true;
}
void ReqAckLeaveClan::InternalSwap(ReqAckLeaveClan* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(clan_id_, other->clan_id_);
swap(clan_player_id_, other->clan_player_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckLeaveClan::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckOprClanMember::InitAsDefaultInstance() {
::NFMsg::_ReqAckOprClanMember_default_instance_._instance.get_mutable()->clan_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckOprClanMember_default_instance_._instance.get_mutable()->player_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqAckOprClanMember_default_instance_._instance.get_mutable()->member_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckOprClanMember::_Internal {
public:
static const ::NFMsg::Ident& clan_id(const ReqAckOprClanMember* msg);
static const ::NFMsg::Ident& player_id(const ReqAckOprClanMember* msg);
static const ::NFMsg::Ident& member_id(const ReqAckOprClanMember* msg);
};
const ::NFMsg::Ident&
ReqAckOprClanMember::_Internal::clan_id(const ReqAckOprClanMember* msg) {
return *msg->clan_id_;
}
const ::NFMsg::Ident&
ReqAckOprClanMember::_Internal::player_id(const ReqAckOprClanMember* msg) {
return *msg->player_id_;
}
const ::NFMsg::Ident&
ReqAckOprClanMember::_Internal::member_id(const ReqAckOprClanMember* msg) {
return *msg->member_id_;
}
void ReqAckOprClanMember::clear_clan_id() {
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
}
void ReqAckOprClanMember::clear_player_id() {
if (GetArenaNoVirtual() == nullptr && player_id_ != nullptr) {
delete player_id_;
}
player_id_ = nullptr;
}
void ReqAckOprClanMember::clear_member_id() {
if (GetArenaNoVirtual() == nullptr && member_id_ != nullptr) {
delete member_id_;
}
member_id_ = nullptr;
}
ReqAckOprClanMember::ReqAckOprClanMember()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckOprClanMember)
}
ReqAckOprClanMember::ReqAckOprClanMember(const ReqAckOprClanMember& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_clan_id()) {
clan_id_ = new ::NFMsg::Ident(*from.clan_id_);
} else {
clan_id_ = nullptr;
}
if (from._internal_has_player_id()) {
player_id_ = new ::NFMsg::Ident(*from.player_id_);
} else {
player_id_ = nullptr;
}
if (from._internal_has_member_id()) {
member_id_ = new ::NFMsg::Ident(*from.member_id_);
} else {
member_id_ = nullptr;
}
type_ = from.type_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckOprClanMember)
}
void ReqAckOprClanMember::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckOprClanMember_NFMsgShare_2eproto.base);
::memset(&clan_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&type_) -
reinterpret_cast<char*>(&clan_id_)) + sizeof(type_));
}
ReqAckOprClanMember::~ReqAckOprClanMember() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckOprClanMember)
SharedDtor();
}
void ReqAckOprClanMember::SharedDtor() {
if (this != internal_default_instance()) delete clan_id_;
if (this != internal_default_instance()) delete player_id_;
if (this != internal_default_instance()) delete member_id_;
}
void ReqAckOprClanMember::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckOprClanMember& ReqAckOprClanMember::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckOprClanMember_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckOprClanMember::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckOprClanMember)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
if (GetArenaNoVirtual() == nullptr && player_id_ != nullptr) {
delete player_id_;
}
player_id_ = nullptr;
if (GetArenaNoVirtual() == nullptr && member_id_ != nullptr) {
delete member_id_;
}
member_id_ = nullptr;
type_ = 0;
_internal_metadata_.Clear();
}
const char* ReqAckOprClanMember::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident clan_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_clan_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident player_id = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_player_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident member_id = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr = ctx->ParseMessage(_internal_mutable_member_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.ReqAckOprClanMember.EGClanMemberOprType type = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_type(static_cast<::NFMsg::ReqAckOprClanMember_EGClanMemberOprType>(val));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckOprClanMember::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckOprClanMember)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::clan_id(this), target, stream);
}
// .NFMsg.Ident player_id = 2;
if (this->has_player_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
2, _Internal::player_id(this), target, stream);
}
// .NFMsg.Ident member_id = 3;
if (this->has_member_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
3, _Internal::member_id(this), target, stream);
}
// .NFMsg.ReqAckOprClanMember.EGClanMemberOprType type = 4;
if (this->type() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
4, this->_internal_type(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckOprClanMember)
return target;
}
size_t ReqAckOprClanMember::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckOprClanMember)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*clan_id_);
}
// .NFMsg.Ident player_id = 2;
if (this->has_player_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*player_id_);
}
// .NFMsg.Ident member_id = 3;
if (this->has_member_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*member_id_);
}
// .NFMsg.ReqAckOprClanMember.EGClanMemberOprType type = 4;
if (this->type() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckOprClanMember::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckOprClanMember)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckOprClanMember* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckOprClanMember>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckOprClanMember)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckOprClanMember)
MergeFrom(*source);
}
}
void ReqAckOprClanMember::MergeFrom(const ReqAckOprClanMember& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckOprClanMember)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_clan_id()) {
_internal_mutable_clan_id()->::NFMsg::Ident::MergeFrom(from._internal_clan_id());
}
if (from.has_player_id()) {
_internal_mutable_player_id()->::NFMsg::Ident::MergeFrom(from._internal_player_id());
}
if (from.has_member_id()) {
_internal_mutable_member_id()->::NFMsg::Ident::MergeFrom(from._internal_member_id());
}
if (from.type() != 0) {
_internal_set_type(from._internal_type());
}
}
void ReqAckOprClanMember::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckOprClanMember)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckOprClanMember::CopyFrom(const ReqAckOprClanMember& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckOprClanMember)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckOprClanMember::IsInitialized() const {
return true;
}
void ReqAckOprClanMember::InternalSwap(ReqAckOprClanMember* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(clan_id_, other->clan_id_);
swap(player_id_, other->player_id_);
swap(member_id_, other->member_id_);
swap(type_, other->type_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckOprClanMember::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqEnterClanEctype::InitAsDefaultInstance() {
::NFMsg::_ReqEnterClanEctype_default_instance_._instance.get_mutable()->clan_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqEnterClanEctype::_Internal {
public:
static const ::NFMsg::Ident& clan_id(const ReqEnterClanEctype* msg);
};
const ::NFMsg::Ident&
ReqEnterClanEctype::_Internal::clan_id(const ReqEnterClanEctype* msg) {
return *msg->clan_id_;
}
void ReqEnterClanEctype::clear_clan_id() {
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
}
ReqEnterClanEctype::ReqEnterClanEctype()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqEnterClanEctype)
}
ReqEnterClanEctype::ReqEnterClanEctype(const ReqEnterClanEctype& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_clan_id()) {
clan_id_ = new ::NFMsg::Ident(*from.clan_id_);
} else {
clan_id_ = nullptr;
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqEnterClanEctype)
}
void ReqEnterClanEctype::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqEnterClanEctype_NFMsgShare_2eproto.base);
clan_id_ = nullptr;
}
ReqEnterClanEctype::~ReqEnterClanEctype() {
// @@protoc_insertion_point(destructor:NFMsg.ReqEnterClanEctype)
SharedDtor();
}
void ReqEnterClanEctype::SharedDtor() {
if (this != internal_default_instance()) delete clan_id_;
}
void ReqEnterClanEctype::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqEnterClanEctype& ReqEnterClanEctype::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqEnterClanEctype_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqEnterClanEctype::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqEnterClanEctype)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && clan_id_ != nullptr) {
delete clan_id_;
}
clan_id_ = nullptr;
_internal_metadata_.Clear();
}
const char* ReqEnterClanEctype::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident clan_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_clan_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqEnterClanEctype::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqEnterClanEctype)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::clan_id(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqEnterClanEctype)
return target;
}
size_t ReqEnterClanEctype::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqEnterClanEctype)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident clan_id = 1;
if (this->has_clan_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*clan_id_);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqEnterClanEctype::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqEnterClanEctype)
GOOGLE_DCHECK_NE(&from, this);
const ReqEnterClanEctype* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqEnterClanEctype>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqEnterClanEctype)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqEnterClanEctype)
MergeFrom(*source);
}
}
void ReqEnterClanEctype::MergeFrom(const ReqEnterClanEctype& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqEnterClanEctype)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_clan_id()) {
_internal_mutable_clan_id()->::NFMsg::Ident::MergeFrom(from._internal_clan_id());
}
}
void ReqEnterClanEctype::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqEnterClanEctype)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqEnterClanEctype::CopyFrom(const ReqEnterClanEctype& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqEnterClanEctype)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqEnterClanEctype::IsInitialized() const {
return true;
}
void ReqEnterClanEctype::InternalSwap(ReqEnterClanEctype* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(clan_id_, other->clan_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqEnterClanEctype::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqSetFightHero::InitAsDefaultInstance() {
::NFMsg::_ReqSetFightHero_default_instance_._instance.get_mutable()->heroid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqSetFightHero::_Internal {
public:
static const ::NFMsg::Ident& heroid(const ReqSetFightHero* msg);
};
const ::NFMsg::Ident&
ReqSetFightHero::_Internal::heroid(const ReqSetFightHero* msg) {
return *msg->heroid_;
}
void ReqSetFightHero::clear_heroid() {
if (GetArenaNoVirtual() == nullptr && heroid_ != nullptr) {
delete heroid_;
}
heroid_ = nullptr;
}
ReqSetFightHero::ReqSetFightHero()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqSetFightHero)
}
ReqSetFightHero::ReqSetFightHero(const ReqSetFightHero& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_heroid()) {
heroid_ = new ::NFMsg::Ident(*from.heroid_);
} else {
heroid_ = nullptr;
}
set_ = from.set_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqSetFightHero)
}
void ReqSetFightHero::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqSetFightHero_NFMsgShare_2eproto.base);
::memset(&heroid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&set_) -
reinterpret_cast<char*>(&heroid_)) + sizeof(set_));
}
ReqSetFightHero::~ReqSetFightHero() {
// @@protoc_insertion_point(destructor:NFMsg.ReqSetFightHero)
SharedDtor();
}
void ReqSetFightHero::SharedDtor() {
if (this != internal_default_instance()) delete heroid_;
}
void ReqSetFightHero::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqSetFightHero& ReqSetFightHero::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqSetFightHero_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqSetFightHero::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqSetFightHero)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && heroid_ != nullptr) {
delete heroid_;
}
heroid_ = nullptr;
set_ = 0;
_internal_metadata_.Clear();
}
const char* ReqSetFightHero::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident Heroid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_heroid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 Set = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
set_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqSetFightHero::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqSetFightHero)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident Heroid = 1;
if (this->has_heroid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::heroid(this), target, stream);
}
// int32 Set = 2;
if (this->set() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_set(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqSetFightHero)
return target;
}
size_t ReqSetFightHero::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqSetFightHero)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident Heroid = 1;
if (this->has_heroid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*heroid_);
}
// int32 Set = 2;
if (this->set() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_set());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqSetFightHero::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqSetFightHero)
GOOGLE_DCHECK_NE(&from, this);
const ReqSetFightHero* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqSetFightHero>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqSetFightHero)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqSetFightHero)
MergeFrom(*source);
}
}
void ReqSetFightHero::MergeFrom(const ReqSetFightHero& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqSetFightHero)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_heroid()) {
_internal_mutable_heroid()->::NFMsg::Ident::MergeFrom(from._internal_heroid());
}
if (from.set() != 0) {
_internal_set_set(from._internal_set());
}
}
void ReqSetFightHero::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqSetFightHero)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqSetFightHero::CopyFrom(const ReqSetFightHero& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqSetFightHero)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqSetFightHero::IsInitialized() const {
return true;
}
void ReqSetFightHero::InternalSwap(ReqSetFightHero* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(heroid_, other->heroid_);
swap(set_, other->set_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqSetFightHero::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqSwitchFightHero::InitAsDefaultInstance() {
::NFMsg::_ReqSwitchFightHero_default_instance_._instance.get_mutable()->heroid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqSwitchFightHero::_Internal {
public:
static const ::NFMsg::Ident& heroid(const ReqSwitchFightHero* msg);
};
const ::NFMsg::Ident&
ReqSwitchFightHero::_Internal::heroid(const ReqSwitchFightHero* msg) {
return *msg->heroid_;
}
void ReqSwitchFightHero::clear_heroid() {
if (GetArenaNoVirtual() == nullptr && heroid_ != nullptr) {
delete heroid_;
}
heroid_ = nullptr;
}
ReqSwitchFightHero::ReqSwitchFightHero()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqSwitchFightHero)
}
ReqSwitchFightHero::ReqSwitchFightHero(const ReqSwitchFightHero& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_heroid()) {
heroid_ = new ::NFMsg::Ident(*from.heroid_);
} else {
heroid_ = nullptr;
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqSwitchFightHero)
}
void ReqSwitchFightHero::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqSwitchFightHero_NFMsgShare_2eproto.base);
heroid_ = nullptr;
}
ReqSwitchFightHero::~ReqSwitchFightHero() {
// @@protoc_insertion_point(destructor:NFMsg.ReqSwitchFightHero)
SharedDtor();
}
void ReqSwitchFightHero::SharedDtor() {
if (this != internal_default_instance()) delete heroid_;
}
void ReqSwitchFightHero::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqSwitchFightHero& ReqSwitchFightHero::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqSwitchFightHero_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqSwitchFightHero::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqSwitchFightHero)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && heroid_ != nullptr) {
delete heroid_;
}
heroid_ = nullptr;
_internal_metadata_.Clear();
}
const char* ReqSwitchFightHero::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident Heroid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_heroid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqSwitchFightHero::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqSwitchFightHero)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident Heroid = 1;
if (this->has_heroid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::heroid(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqSwitchFightHero)
return target;
}
size_t ReqSwitchFightHero::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqSwitchFightHero)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident Heroid = 1;
if (this->has_heroid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*heroid_);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqSwitchFightHero::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqSwitchFightHero)
GOOGLE_DCHECK_NE(&from, this);
const ReqSwitchFightHero* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqSwitchFightHero>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqSwitchFightHero)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqSwitchFightHero)
MergeFrom(*source);
}
}
void ReqSwitchFightHero::MergeFrom(const ReqSwitchFightHero& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqSwitchFightHero)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_heroid()) {
_internal_mutable_heroid()->::NFMsg::Ident::MergeFrom(from._internal_heroid());
}
}
void ReqSwitchFightHero::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqSwitchFightHero)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqSwitchFightHero::CopyFrom(const ReqSwitchFightHero& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqSwitchFightHero)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqSwitchFightHero::IsInitialized() const {
return true;
}
void ReqSwitchFightHero::InternalSwap(ReqSwitchFightHero* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(heroid_, other->heroid_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqSwitchFightHero::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqBuyItemFromShop::InitAsDefaultInstance() {
}
class ReqBuyItemFromShop::_Internal {
public:
};
ReqBuyItemFromShop::ReqBuyItemFromShop()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqBuyItemFromShop)
}
ReqBuyItemFromShop::ReqBuyItemFromShop(const ReqBuyItemFromShop& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
itemid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_itemid().empty()) {
itemid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.itemid_);
}
count_ = from.count_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqBuyItemFromShop)
}
void ReqBuyItemFromShop::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqBuyItemFromShop_NFMsgShare_2eproto.base);
itemid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
count_ = 0;
}
ReqBuyItemFromShop::~ReqBuyItemFromShop() {
// @@protoc_insertion_point(destructor:NFMsg.ReqBuyItemFromShop)
SharedDtor();
}
void ReqBuyItemFromShop::SharedDtor() {
itemid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void ReqBuyItemFromShop::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqBuyItemFromShop& ReqBuyItemFromShop::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqBuyItemFromShop_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqBuyItemFromShop::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqBuyItemFromShop)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
itemid_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
count_ = 0;
_internal_metadata_.Clear();
}
const char* ReqBuyItemFromShop::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// bytes itemID = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_itemid(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 count = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqBuyItemFromShop::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqBuyItemFromShop)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// bytes itemID = 1;
if (this->itemid().size() > 0) {
target = stream->WriteBytesMaybeAliased(
1, this->_internal_itemid(), target);
}
// int32 count = 2;
if (this->count() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_count(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqBuyItemFromShop)
return target;
}
size_t ReqBuyItemFromShop::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqBuyItemFromShop)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes itemID = 1;
if (this->itemid().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_itemid());
}
// int32 count = 2;
if (this->count() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_count());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqBuyItemFromShop::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqBuyItemFromShop)
GOOGLE_DCHECK_NE(&from, this);
const ReqBuyItemFromShop* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqBuyItemFromShop>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqBuyItemFromShop)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqBuyItemFromShop)
MergeFrom(*source);
}
}
void ReqBuyItemFromShop::MergeFrom(const ReqBuyItemFromShop& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqBuyItemFromShop)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.itemid().size() > 0) {
itemid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.itemid_);
}
if (from.count() != 0) {
_internal_set_count(from._internal_count());
}
}
void ReqBuyItemFromShop::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqBuyItemFromShop)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqBuyItemFromShop::CopyFrom(const ReqBuyItemFromShop& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqBuyItemFromShop)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqBuyItemFromShop::IsInitialized() const {
return true;
}
void ReqBuyItemFromShop::InternalSwap(ReqBuyItemFromShop* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
itemid_.Swap(&other->itemid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(count_, other->count_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqBuyItemFromShop::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void PVPPlayerInfo::InitAsDefaultInstance() {
::NFMsg::_PVPPlayerInfo_default_instance_._instance.get_mutable()->id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_PVPPlayerInfo_default_instance_._instance.get_mutable()->hero_id1_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_PVPPlayerInfo_default_instance_._instance.get_mutable()->hero_id2_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_PVPPlayerInfo_default_instance_._instance.get_mutable()->hero_id3_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class PVPPlayerInfo::_Internal {
public:
static const ::NFMsg::Ident& id(const PVPPlayerInfo* msg);
static const ::NFMsg::Ident& hero_id1(const PVPPlayerInfo* msg);
static const ::NFMsg::Ident& hero_id2(const PVPPlayerInfo* msg);
static const ::NFMsg::Ident& hero_id3(const PVPPlayerInfo* msg);
};
const ::NFMsg::Ident&
PVPPlayerInfo::_Internal::id(const PVPPlayerInfo* msg) {
return *msg->id_;
}
const ::NFMsg::Ident&
PVPPlayerInfo::_Internal::hero_id1(const PVPPlayerInfo* msg) {
return *msg->hero_id1_;
}
const ::NFMsg::Ident&
PVPPlayerInfo::_Internal::hero_id2(const PVPPlayerInfo* msg) {
return *msg->hero_id2_;
}
const ::NFMsg::Ident&
PVPPlayerInfo::_Internal::hero_id3(const PVPPlayerInfo* msg) {
return *msg->hero_id3_;
}
void PVPPlayerInfo::clear_id() {
if (GetArenaNoVirtual() == nullptr && id_ != nullptr) {
delete id_;
}
id_ = nullptr;
}
void PVPPlayerInfo::clear_hero_id1() {
if (GetArenaNoVirtual() == nullptr && hero_id1_ != nullptr) {
delete hero_id1_;
}
hero_id1_ = nullptr;
}
void PVPPlayerInfo::clear_hero_id2() {
if (GetArenaNoVirtual() == nullptr && hero_id2_ != nullptr) {
delete hero_id2_;
}
hero_id2_ = nullptr;
}
void PVPPlayerInfo::clear_hero_id3() {
if (GetArenaNoVirtual() == nullptr && hero_id3_ != nullptr) {
delete hero_id3_;
}
hero_id3_ = nullptr;
}
PVPPlayerInfo::PVPPlayerInfo()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.PVPPlayerInfo)
}
PVPPlayerInfo::PVPPlayerInfo(const PVPPlayerInfo& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_name().empty()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
head_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_head().empty()) {
head_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.head_);
}
hero_cnf1_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_hero_cnf1().empty()) {
hero_cnf1_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.hero_cnf1_);
}
hero_cnf2_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_hero_cnf2().empty()) {
hero_cnf2_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.hero_cnf2_);
}
hero_cnf3_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_hero_cnf3().empty()) {
hero_cnf3_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.hero_cnf3_);
}
if (from._internal_has_id()) {
id_ = new ::NFMsg::Ident(*from.id_);
} else {
id_ = nullptr;
}
if (from._internal_has_hero_id1()) {
hero_id1_ = new ::NFMsg::Ident(*from.hero_id1_);
} else {
hero_id1_ = nullptr;
}
if (from._internal_has_hero_id2()) {
hero_id2_ = new ::NFMsg::Ident(*from.hero_id2_);
} else {
hero_id2_ = nullptr;
}
if (from._internal_has_hero_id3()) {
hero_id3_ = new ::NFMsg::Ident(*from.hero_id3_);
} else {
hero_id3_ = nullptr;
}
::memcpy(&battle_mode_, &from.battle_mode_,
static_cast<size_t>(reinterpret_cast<char*>(&hero_star3_) -
reinterpret_cast<char*>(&battle_mode_)) + sizeof(hero_star3_));
// @@protoc_insertion_point(copy_constructor:NFMsg.PVPPlayerInfo)
}
void PVPPlayerInfo::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PVPPlayerInfo_NFMsgShare_2eproto.base);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
head_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
hero_cnf1_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
hero_cnf2_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
hero_cnf3_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&hero_star3_) -
reinterpret_cast<char*>(&id_)) + sizeof(hero_star3_));
}
PVPPlayerInfo::~PVPPlayerInfo() {
// @@protoc_insertion_point(destructor:NFMsg.PVPPlayerInfo)
SharedDtor();
}
void PVPPlayerInfo::SharedDtor() {
name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
head_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
hero_cnf1_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
hero_cnf2_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
hero_cnf3_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete id_;
if (this != internal_default_instance()) delete hero_id1_;
if (this != internal_default_instance()) delete hero_id2_;
if (this != internal_default_instance()) delete hero_id3_;
}
void PVPPlayerInfo::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const PVPPlayerInfo& PVPPlayerInfo::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PVPPlayerInfo_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void PVPPlayerInfo::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.PVPPlayerInfo)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
head_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
hero_cnf1_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
hero_cnf2_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
hero_cnf3_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && id_ != nullptr) {
delete id_;
}
id_ = nullptr;
if (GetArenaNoVirtual() == nullptr && hero_id1_ != nullptr) {
delete hero_id1_;
}
hero_id1_ = nullptr;
if (GetArenaNoVirtual() == nullptr && hero_id2_ != nullptr) {
delete hero_id2_;
}
hero_id2_ = nullptr;
if (GetArenaNoVirtual() == nullptr && hero_id3_ != nullptr) {
delete hero_id3_;
}
hero_id3_ = nullptr;
::memset(&battle_mode_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&hero_star3_) -
reinterpret_cast<char*>(&battle_mode_)) + sizeof(hero_star3_));
_internal_metadata_.Clear();
}
const char* PVPPlayerInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.EBattleType battle_mode = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_battle_mode(static_cast<::NFMsg::EBattleType>(val));
} else goto handle_unusual;
continue;
// int32 level = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 battle_point = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
battle_point_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes name = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_name(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes head = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_head(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 gold = 8;
case 8:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
gold_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 diamond = 9;
case 9:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) {
diamond_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes hero_cnf1 = 20;
case 20:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 162)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_hero_cnf1(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes hero_cnf2 = 21;
case 21:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 170)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_hero_cnf2(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// bytes hero_cnf3 = 22;
case 22:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 178)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(_internal_mutable_hero_cnf3(), ptr, ctx);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 hero_star1 = 25;
case 25:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 200)) {
hero_star1_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 hero_star2 = 26;
case 26:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 208)) {
hero_star2_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 hero_star3 = 27;
case 27:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 216)) {
hero_star3_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident hero_id1 = 28;
case 28:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 226)) {
ptr = ctx->ParseMessage(_internal_mutable_hero_id1(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident hero_id2 = 29;
case 29:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 234)) {
ptr = ctx->ParseMessage(_internal_mutable_hero_id2(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident hero_id3 = 30;
case 30:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 242)) {
ptr = ctx->ParseMessage(_internal_mutable_hero_id3(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* PVPPlayerInfo::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.PVPPlayerInfo)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident id = 1;
if (this->has_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::id(this), target, stream);
}
// .NFMsg.EBattleType battle_mode = 2;
if (this->battle_mode() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2, this->_internal_battle_mode(), target);
}
// int32 level = 4;
if (this->level() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_level(), target);
}
// int32 battle_point = 5;
if (this->battle_point() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_battle_point(), target);
}
// bytes name = 6;
if (this->name().size() > 0) {
target = stream->WriteBytesMaybeAliased(
6, this->_internal_name(), target);
}
// bytes head = 7;
if (this->head().size() > 0) {
target = stream->WriteBytesMaybeAliased(
7, this->_internal_head(), target);
}
// int32 gold = 8;
if (this->gold() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(8, this->_internal_gold(), target);
}
// int32 diamond = 9;
if (this->diamond() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(9, this->_internal_diamond(), target);
}
// bytes hero_cnf1 = 20;
if (this->hero_cnf1().size() > 0) {
target = stream->WriteBytesMaybeAliased(
20, this->_internal_hero_cnf1(), target);
}
// bytes hero_cnf2 = 21;
if (this->hero_cnf2().size() > 0) {
target = stream->WriteBytesMaybeAliased(
21, this->_internal_hero_cnf2(), target);
}
// bytes hero_cnf3 = 22;
if (this->hero_cnf3().size() > 0) {
target = stream->WriteBytesMaybeAliased(
22, this->_internal_hero_cnf3(), target);
}
// int32 hero_star1 = 25;
if (this->hero_star1() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(25, this->_internal_hero_star1(), target);
}
// int32 hero_star2 = 26;
if (this->hero_star2() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(26, this->_internal_hero_star2(), target);
}
// int32 hero_star3 = 27;
if (this->hero_star3() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(27, this->_internal_hero_star3(), target);
}
// .NFMsg.Ident hero_id1 = 28;
if (this->has_hero_id1()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
28, _Internal::hero_id1(this), target, stream);
}
// .NFMsg.Ident hero_id2 = 29;
if (this->has_hero_id2()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
29, _Internal::hero_id2(this), target, stream);
}
// .NFMsg.Ident hero_id3 = 30;
if (this->has_hero_id3()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
30, _Internal::hero_id3(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.PVPPlayerInfo)
return target;
}
size_t PVPPlayerInfo::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.PVPPlayerInfo)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// bytes name = 6;
if (this->name().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_name());
}
// bytes head = 7;
if (this->head().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_head());
}
// bytes hero_cnf1 = 20;
if (this->hero_cnf1().size() > 0) {
total_size += 2 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_hero_cnf1());
}
// bytes hero_cnf2 = 21;
if (this->hero_cnf2().size() > 0) {
total_size += 2 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_hero_cnf2());
}
// bytes hero_cnf3 = 22;
if (this->hero_cnf3().size() > 0) {
total_size += 2 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_hero_cnf3());
}
// .NFMsg.Ident id = 1;
if (this->has_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*id_);
}
// .NFMsg.Ident hero_id1 = 28;
if (this->has_hero_id1()) {
total_size += 2 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*hero_id1_);
}
// .NFMsg.Ident hero_id2 = 29;
if (this->has_hero_id2()) {
total_size += 2 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*hero_id2_);
}
// .NFMsg.Ident hero_id3 = 30;
if (this->has_hero_id3()) {
total_size += 2 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*hero_id3_);
}
// .NFMsg.EBattleType battle_mode = 2;
if (this->battle_mode() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_battle_mode());
}
// int32 level = 4;
if (this->level() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_level());
}
// int32 battle_point = 5;
if (this->battle_point() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_battle_point());
}
// int32 gold = 8;
if (this->gold() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_gold());
}
// int32 diamond = 9;
if (this->diamond() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_diamond());
}
// int32 hero_star1 = 25;
if (this->hero_star1() != 0) {
total_size += 2 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_hero_star1());
}
// int32 hero_star2 = 26;
if (this->hero_star2() != 0) {
total_size += 2 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_hero_star2());
}
// int32 hero_star3 = 27;
if (this->hero_star3() != 0) {
total_size += 2 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_hero_star3());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void PVPPlayerInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.PVPPlayerInfo)
GOOGLE_DCHECK_NE(&from, this);
const PVPPlayerInfo* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<PVPPlayerInfo>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.PVPPlayerInfo)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.PVPPlayerInfo)
MergeFrom(*source);
}
}
void PVPPlayerInfo::MergeFrom(const PVPPlayerInfo& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.PVPPlayerInfo)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.name().size() > 0) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (from.head().size() > 0) {
head_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.head_);
}
if (from.hero_cnf1().size() > 0) {
hero_cnf1_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.hero_cnf1_);
}
if (from.hero_cnf2().size() > 0) {
hero_cnf2_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.hero_cnf2_);
}
if (from.hero_cnf3().size() > 0) {
hero_cnf3_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.hero_cnf3_);
}
if (from.has_id()) {
_internal_mutable_id()->::NFMsg::Ident::MergeFrom(from._internal_id());
}
if (from.has_hero_id1()) {
_internal_mutable_hero_id1()->::NFMsg::Ident::MergeFrom(from._internal_hero_id1());
}
if (from.has_hero_id2()) {
_internal_mutable_hero_id2()->::NFMsg::Ident::MergeFrom(from._internal_hero_id2());
}
if (from.has_hero_id3()) {
_internal_mutable_hero_id3()->::NFMsg::Ident::MergeFrom(from._internal_hero_id3());
}
if (from.battle_mode() != 0) {
_internal_set_battle_mode(from._internal_battle_mode());
}
if (from.level() != 0) {
_internal_set_level(from._internal_level());
}
if (from.battle_point() != 0) {
_internal_set_battle_point(from._internal_battle_point());
}
if (from.gold() != 0) {
_internal_set_gold(from._internal_gold());
}
if (from.diamond() != 0) {
_internal_set_diamond(from._internal_diamond());
}
if (from.hero_star1() != 0) {
_internal_set_hero_star1(from._internal_hero_star1());
}
if (from.hero_star2() != 0) {
_internal_set_hero_star2(from._internal_hero_star2());
}
if (from.hero_star3() != 0) {
_internal_set_hero_star3(from._internal_hero_star3());
}
}
void PVPPlayerInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.PVPPlayerInfo)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void PVPPlayerInfo::CopyFrom(const PVPPlayerInfo& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.PVPPlayerInfo)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool PVPPlayerInfo::IsInitialized() const {
return true;
}
void PVPPlayerInfo::InternalSwap(PVPPlayerInfo* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
head_.Swap(&other->head_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
hero_cnf1_.Swap(&other->hero_cnf1_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
hero_cnf2_.Swap(&other->hero_cnf2_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
hero_cnf3_.Swap(&other->hero_cnf3_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(id_, other->id_);
swap(hero_id1_, other->hero_id1_);
swap(hero_id2_, other->hero_id2_);
swap(hero_id3_, other->hero_id3_);
swap(battle_mode_, other->battle_mode_);
swap(level_, other->level_);
swap(battle_point_, other->battle_point_);
swap(gold_, other->gold_);
swap(diamond_, other->diamond_);
swap(hero_star1_, other->hero_star1_);
swap(hero_star2_, other->hero_star2_);
swap(hero_star3_, other->hero_star3_);
}
::PROTOBUF_NAMESPACE_ID::Metadata PVPPlayerInfo::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqSearchOppnent::InitAsDefaultInstance() {
}
class ReqSearchOppnent::_Internal {
public:
};
void ReqSearchOppnent::clear_friends() {
friends_.Clear();
}
ReqSearchOppnent::ReqSearchOppnent()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqSearchOppnent)
}
ReqSearchOppnent::ReqSearchOppnent(const ReqSearchOppnent& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
friends_(from.friends_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
::memcpy(&self_scene_, &from.self_scene_,
static_cast<size_t>(reinterpret_cast<char*>(&battle_mode_) -
reinterpret_cast<char*>(&self_scene_)) + sizeof(battle_mode_));
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqSearchOppnent)
}
void ReqSearchOppnent::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqSearchOppnent_NFMsgShare_2eproto.base);
::memset(&self_scene_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&battle_mode_) -
reinterpret_cast<char*>(&self_scene_)) + sizeof(battle_mode_));
}
ReqSearchOppnent::~ReqSearchOppnent() {
// @@protoc_insertion_point(destructor:NFMsg.ReqSearchOppnent)
SharedDtor();
}
void ReqSearchOppnent::SharedDtor() {
}
void ReqSearchOppnent::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqSearchOppnent& ReqSearchOppnent::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqSearchOppnent_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqSearchOppnent::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqSearchOppnent)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
friends_.Clear();
::memset(&self_scene_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&battle_mode_) -
reinterpret_cast<char*>(&self_scene_)) + sizeof(battle_mode_));
_internal_metadata_.Clear();
}
const char* ReqSearchOppnent::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 self_scene = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
self_scene_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 diamond = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
diamond_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 battle_point = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
battle_point_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.EBattleType battle_mode = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_battle_mode(static_cast<::NFMsg::EBattleType>(val));
} else goto handle_unusual;
continue;
// repeated .NFMsg.Ident friends = 10;
case 10:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_friends(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqSearchOppnent::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqSearchOppnent)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 self_scene = 1;
if (this->self_scene() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_self_scene(), target);
}
// int32 diamond = 2;
if (this->diamond() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_diamond(), target);
}
// int32 battle_point = 3;
if (this->battle_point() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_battle_point(), target);
}
// .NFMsg.EBattleType battle_mode = 4;
if (this->battle_mode() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
4, this->_internal_battle_mode(), target);
}
// repeated .NFMsg.Ident friends = 10;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_friends_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(10, this->_internal_friends(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqSearchOppnent)
return target;
}
size_t ReqSearchOppnent::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqSearchOppnent)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.Ident friends = 10;
total_size += 1UL * this->_internal_friends_size();
for (const auto& msg : this->friends_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// int32 self_scene = 1;
if (this->self_scene() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_self_scene());
}
// int32 diamond = 2;
if (this->diamond() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_diamond());
}
// int32 battle_point = 3;
if (this->battle_point() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_battle_point());
}
// .NFMsg.EBattleType battle_mode = 4;
if (this->battle_mode() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_battle_mode());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqSearchOppnent::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqSearchOppnent)
GOOGLE_DCHECK_NE(&from, this);
const ReqSearchOppnent* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqSearchOppnent>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqSearchOppnent)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqSearchOppnent)
MergeFrom(*source);
}
}
void ReqSearchOppnent::MergeFrom(const ReqSearchOppnent& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqSearchOppnent)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
friends_.MergeFrom(from.friends_);
if (from.self_scene() != 0) {
_internal_set_self_scene(from._internal_self_scene());
}
if (from.diamond() != 0) {
_internal_set_diamond(from._internal_diamond());
}
if (from.battle_point() != 0) {
_internal_set_battle_point(from._internal_battle_point());
}
if (from.battle_mode() != 0) {
_internal_set_battle_mode(from._internal_battle_mode());
}
}
void ReqSearchOppnent::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqSearchOppnent)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqSearchOppnent::CopyFrom(const ReqSearchOppnent& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqSearchOppnent)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqSearchOppnent::IsInitialized() const {
return true;
}
void ReqSearchOppnent::InternalSwap(ReqSearchOppnent* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
friends_.InternalSwap(&other->friends_);
swap(self_scene_, other->self_scene_);
swap(diamond_, other->diamond_);
swap(battle_point_, other->battle_point_);
swap(battle_mode_, other->battle_mode_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqSearchOppnent::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void AckSearchOppnent::InitAsDefaultInstance() {
::NFMsg::_AckSearchOppnent_default_instance_._instance.get_mutable()->team_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_AckSearchOppnent_default_instance_._instance.get_mutable()->opponent_ = const_cast< ::NFMsg::PVPPlayerInfo*>(
::NFMsg::PVPPlayerInfo::internal_default_instance());
}
class AckSearchOppnent::_Internal {
public:
static const ::NFMsg::Ident& team_id(const AckSearchOppnent* msg);
static const ::NFMsg::PVPPlayerInfo& opponent(const AckSearchOppnent* msg);
};
const ::NFMsg::Ident&
AckSearchOppnent::_Internal::team_id(const AckSearchOppnent* msg) {
return *msg->team_id_;
}
const ::NFMsg::PVPPlayerInfo&
AckSearchOppnent::_Internal::opponent(const AckSearchOppnent* msg) {
return *msg->opponent_;
}
void AckSearchOppnent::clear_team_id() {
if (GetArenaNoVirtual() == nullptr && team_id_ != nullptr) {
delete team_id_;
}
team_id_ = nullptr;
}
void AckSearchOppnent::clear_team_members() {
team_members_.Clear();
}
AckSearchOppnent::AckSearchOppnent()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.AckSearchOppnent)
}
AckSearchOppnent::AckSearchOppnent(const AckSearchOppnent& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
team_members_(from.team_members_),
buildings_(from.buildings_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_team_id()) {
team_id_ = new ::NFMsg::Ident(*from.team_id_);
} else {
team_id_ = nullptr;
}
if (from._internal_has_opponent()) {
opponent_ = new ::NFMsg::PVPPlayerInfo(*from.opponent_);
} else {
opponent_ = nullptr;
}
::memcpy(&scene_id_, &from.scene_id_,
static_cast<size_t>(reinterpret_cast<char*>(&gamble_diamond_) -
reinterpret_cast<char*>(&scene_id_)) + sizeof(gamble_diamond_));
// @@protoc_insertion_point(copy_constructor:NFMsg.AckSearchOppnent)
}
void AckSearchOppnent::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AckSearchOppnent_NFMsgShare_2eproto.base);
::memset(&team_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&gamble_diamond_) -
reinterpret_cast<char*>(&team_id_)) + sizeof(gamble_diamond_));
}
AckSearchOppnent::~AckSearchOppnent() {
// @@protoc_insertion_point(destructor:NFMsg.AckSearchOppnent)
SharedDtor();
}
void AckSearchOppnent::SharedDtor() {
if (this != internal_default_instance()) delete team_id_;
if (this != internal_default_instance()) delete opponent_;
}
void AckSearchOppnent::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const AckSearchOppnent& AckSearchOppnent::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AckSearchOppnent_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void AckSearchOppnent::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.AckSearchOppnent)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
team_members_.Clear();
buildings_.Clear();
if (GetArenaNoVirtual() == nullptr && team_id_ != nullptr) {
delete team_id_;
}
team_id_ = nullptr;
if (GetArenaNoVirtual() == nullptr && opponent_ != nullptr) {
delete opponent_;
}
opponent_ = nullptr;
::memset(&scene_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&gamble_diamond_) -
reinterpret_cast<char*>(&scene_id_)) + sizeof(gamble_diamond_));
_internal_metadata_.Clear();
}
const char* AckSearchOppnent::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 scene_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
scene_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident team_id = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_team_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 gamble_diamond = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
gamble_diamond_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .NFMsg.Ident team_members = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_team_members(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
} else goto handle_unusual;
continue;
// .NFMsg.PVPPlayerInfo opponent = 14;
case 14:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) {
ptr = ctx->ParseMessage(_internal_mutable_opponent(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .NFMsg.ReqAddSceneBuilding buildings = 20;
case 20:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 162)) {
ptr -= 2;
do {
ptr += 2;
ptr = ctx->ParseMessage(_internal_add_buildings(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<162>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* AckSearchOppnent::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.AckSearchOppnent)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 scene_id = 1;
if (this->scene_id() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_scene_id(), target);
}
// .NFMsg.Ident team_id = 2;
if (this->has_team_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
2, _Internal::team_id(this), target, stream);
}
// int32 gamble_diamond = 3;
if (this->gamble_diamond() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_gamble_diamond(), target);
}
// repeated .NFMsg.Ident team_members = 5;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_team_members_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(5, this->_internal_team_members(i), target, stream);
}
// .NFMsg.PVPPlayerInfo opponent = 14;
if (this->has_opponent()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
14, _Internal::opponent(this), target, stream);
}
// repeated .NFMsg.ReqAddSceneBuilding buildings = 20;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_buildings_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(20, this->_internal_buildings(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.AckSearchOppnent)
return target;
}
size_t AckSearchOppnent::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.AckSearchOppnent)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.Ident team_members = 5;
total_size += 1UL * this->_internal_team_members_size();
for (const auto& msg : this->team_members_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// repeated .NFMsg.ReqAddSceneBuilding buildings = 20;
total_size += 2UL * this->_internal_buildings_size();
for (const auto& msg : this->buildings_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// .NFMsg.Ident team_id = 2;
if (this->has_team_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*team_id_);
}
// .NFMsg.PVPPlayerInfo opponent = 14;
if (this->has_opponent()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*opponent_);
}
// int32 scene_id = 1;
if (this->scene_id() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_scene_id());
}
// int32 gamble_diamond = 3;
if (this->gamble_diamond() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_gamble_diamond());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void AckSearchOppnent::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.AckSearchOppnent)
GOOGLE_DCHECK_NE(&from, this);
const AckSearchOppnent* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AckSearchOppnent>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.AckSearchOppnent)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.AckSearchOppnent)
MergeFrom(*source);
}
}
void AckSearchOppnent::MergeFrom(const AckSearchOppnent& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.AckSearchOppnent)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
team_members_.MergeFrom(from.team_members_);
buildings_.MergeFrom(from.buildings_);
if (from.has_team_id()) {
_internal_mutable_team_id()->::NFMsg::Ident::MergeFrom(from._internal_team_id());
}
if (from.has_opponent()) {
_internal_mutable_opponent()->::NFMsg::PVPPlayerInfo::MergeFrom(from._internal_opponent());
}
if (from.scene_id() != 0) {
_internal_set_scene_id(from._internal_scene_id());
}
if (from.gamble_diamond() != 0) {
_internal_set_gamble_diamond(from._internal_gamble_diamond());
}
}
void AckSearchOppnent::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.AckSearchOppnent)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AckSearchOppnent::CopyFrom(const AckSearchOppnent& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.AckSearchOppnent)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AckSearchOppnent::IsInitialized() const {
return true;
}
void AckSearchOppnent::InternalSwap(AckSearchOppnent* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
team_members_.InternalSwap(&other->team_members_);
buildings_.InternalSwap(&other->buildings_);
swap(team_id_, other->team_id_);
swap(opponent_, other->opponent_);
swap(scene_id_, other->scene_id_);
swap(gamble_diamond_, other->gamble_diamond_);
}
::PROTOBUF_NAMESPACE_ID::Metadata AckSearchOppnent::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqAckCancelSearch::InitAsDefaultInstance() {
::NFMsg::_ReqAckCancelSearch_default_instance_._instance.get_mutable()->selfid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqAckCancelSearch::_Internal {
public:
static const ::NFMsg::Ident& selfid(const ReqAckCancelSearch* msg);
};
const ::NFMsg::Ident&
ReqAckCancelSearch::_Internal::selfid(const ReqAckCancelSearch* msg) {
return *msg->selfid_;
}
void ReqAckCancelSearch::clear_selfid() {
if (GetArenaNoVirtual() == nullptr && selfid_ != nullptr) {
delete selfid_;
}
selfid_ = nullptr;
}
ReqAckCancelSearch::ReqAckCancelSearch()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqAckCancelSearch)
}
ReqAckCancelSearch::ReqAckCancelSearch(const ReqAckCancelSearch& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_selfid()) {
selfid_ = new ::NFMsg::Ident(*from.selfid_);
} else {
selfid_ = nullptr;
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqAckCancelSearch)
}
void ReqAckCancelSearch::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqAckCancelSearch_NFMsgShare_2eproto.base);
selfid_ = nullptr;
}
ReqAckCancelSearch::~ReqAckCancelSearch() {
// @@protoc_insertion_point(destructor:NFMsg.ReqAckCancelSearch)
SharedDtor();
}
void ReqAckCancelSearch::SharedDtor() {
if (this != internal_default_instance()) delete selfid_;
}
void ReqAckCancelSearch::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqAckCancelSearch& ReqAckCancelSearch::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqAckCancelSearch_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqAckCancelSearch::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqAckCancelSearch)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && selfid_ != nullptr) {
delete selfid_;
}
selfid_ = nullptr;
_internal_metadata_.Clear();
}
const char* ReqAckCancelSearch::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident selfid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_selfid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqAckCancelSearch::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqAckCancelSearch)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident selfid = 1;
if (this->has_selfid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::selfid(this), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqAckCancelSearch)
return target;
}
size_t ReqAckCancelSearch::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqAckCancelSearch)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident selfid = 1;
if (this->has_selfid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*selfid_);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqAckCancelSearch::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqAckCancelSearch)
GOOGLE_DCHECK_NE(&from, this);
const ReqAckCancelSearch* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqAckCancelSearch>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqAckCancelSearch)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqAckCancelSearch)
MergeFrom(*source);
}
}
void ReqAckCancelSearch::MergeFrom(const ReqAckCancelSearch& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqAckCancelSearch)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_selfid()) {
_internal_mutable_selfid()->::NFMsg::Ident::MergeFrom(from._internal_selfid());
}
}
void ReqAckCancelSearch::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqAckCancelSearch)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqAckCancelSearch::CopyFrom(const ReqAckCancelSearch& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqAckCancelSearch)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqAckCancelSearch::IsInitialized() const {
return true;
}
void ReqAckCancelSearch::InternalSwap(ReqAckCancelSearch* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(selfid_, other->selfid_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqAckCancelSearch::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqEndBattle::InitAsDefaultInstance() {
}
class ReqEndBattle::_Internal {
public:
};
ReqEndBattle::ReqEndBattle()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqEndBattle)
}
ReqEndBattle::ReqEndBattle(const ReqEndBattle& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
auto_end_ = from.auto_end_;
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqEndBattle)
}
void ReqEndBattle::SharedCtor() {
auto_end_ = 0;
}
ReqEndBattle::~ReqEndBattle() {
// @@protoc_insertion_point(destructor:NFMsg.ReqEndBattle)
SharedDtor();
}
void ReqEndBattle::SharedDtor() {
}
void ReqEndBattle::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqEndBattle& ReqEndBattle::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqEndBattle_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqEndBattle::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqEndBattle)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
auto_end_ = 0;
_internal_metadata_.Clear();
}
const char* ReqEndBattle::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 auto_end = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
auto_end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqEndBattle::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqEndBattle)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 auto_end = 1;
if (this->auto_end() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_auto_end(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqEndBattle)
return target;
}
size_t ReqEndBattle::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqEndBattle)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// int32 auto_end = 1;
if (this->auto_end() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_auto_end());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqEndBattle::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqEndBattle)
GOOGLE_DCHECK_NE(&from, this);
const ReqEndBattle* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqEndBattle>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqEndBattle)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqEndBattle)
MergeFrom(*source);
}
}
void ReqEndBattle::MergeFrom(const ReqEndBattle& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqEndBattle)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.auto_end() != 0) {
_internal_set_auto_end(from._internal_auto_end());
}
}
void ReqEndBattle::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqEndBattle)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqEndBattle::CopyFrom(const ReqEndBattle& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqEndBattle)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqEndBattle::IsInitialized() const {
return true;
}
void ReqEndBattle::InternalSwap(ReqEndBattle* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(auto_end_, other->auto_end_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqEndBattle::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void AckEndBattle::InitAsDefaultInstance() {
::NFMsg::_AckEndBattle_default_instance_._instance.get_mutable()->team_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_AckEndBattle_default_instance_._instance.get_mutable()->match_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class AckEndBattle::_Internal {
public:
static const ::NFMsg::Ident& team_id(const AckEndBattle* msg);
static const ::NFMsg::Ident& match_id(const AckEndBattle* msg);
};
const ::NFMsg::Ident&
AckEndBattle::_Internal::team_id(const AckEndBattle* msg) {
return *msg->team_id_;
}
const ::NFMsg::Ident&
AckEndBattle::_Internal::match_id(const AckEndBattle* msg) {
return *msg->match_id_;
}
void AckEndBattle::clear_team_id() {
if (GetArenaNoVirtual() == nullptr && team_id_ != nullptr) {
delete team_id_;
}
team_id_ = nullptr;
}
void AckEndBattle::clear_match_id() {
if (GetArenaNoVirtual() == nullptr && match_id_ != nullptr) {
delete match_id_;
}
match_id_ = nullptr;
}
void AckEndBattle::clear_members() {
members_.Clear();
}
AckEndBattle::AckEndBattle()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.AckEndBattle)
}
AckEndBattle::AckEndBattle(const AckEndBattle& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
members_(from.members_),
item_list_(from.item_list_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_team_id()) {
team_id_ = new ::NFMsg::Ident(*from.team_id_);
} else {
team_id_ = nullptr;
}
if (from._internal_has_match_id()) {
match_id_ = new ::NFMsg::Ident(*from.match_id_);
} else {
match_id_ = nullptr;
}
::memcpy(&win_, &from.win_,
static_cast<size_t>(reinterpret_cast<char*>(&battle_mode_) -
reinterpret_cast<char*>(&win_)) + sizeof(battle_mode_));
// @@protoc_insertion_point(copy_constructor:NFMsg.AckEndBattle)
}
void AckEndBattle::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AckEndBattle_NFMsgShare_2eproto.base);
::memset(&team_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&battle_mode_) -
reinterpret_cast<char*>(&team_id_)) + sizeof(battle_mode_));
}
AckEndBattle::~AckEndBattle() {
// @@protoc_insertion_point(destructor:NFMsg.AckEndBattle)
SharedDtor();
}
void AckEndBattle::SharedDtor() {
if (this != internal_default_instance()) delete team_id_;
if (this != internal_default_instance()) delete match_id_;
}
void AckEndBattle::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const AckEndBattle& AckEndBattle::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AckEndBattle_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void AckEndBattle::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.AckEndBattle)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
members_.Clear();
item_list_.Clear();
if (GetArenaNoVirtual() == nullptr && team_id_ != nullptr) {
delete team_id_;
}
team_id_ = nullptr;
if (GetArenaNoVirtual() == nullptr && match_id_ != nullptr) {
delete match_id_;
}
match_id_ = nullptr;
::memset(&win_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&battle_mode_) -
reinterpret_cast<char*>(&win_)) + sizeof(battle_mode_));
_internal_metadata_.Clear();
}
const char* AckEndBattle::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// int32 win = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
win_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 star = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
star_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 gold = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
gold_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 cup = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
cup_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int32 diamond = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
diamond_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.EBattleType battle_mode = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
_internal_set_battle_mode(static_cast<::NFMsg::EBattleType>(val));
} else goto handle_unusual;
continue;
// .NFMsg.Ident team_id = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
ptr = ctx->ParseMessage(_internal_mutable_team_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident match_id = 8;
case 8:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
ptr = ctx->ParseMessage(_internal_mutable_match_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .NFMsg.Ident members = 9;
case 9:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_members(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<74>(ptr));
} else goto handle_unusual;
continue;
// repeated .NFMsg.ItemStruct item_list = 10;
case 10:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_item_list(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* AckEndBattle::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.AckEndBattle)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int32 win = 1;
if (this->win() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_win(), target);
}
// int32 star = 2;
if (this->star() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_star(), target);
}
// int32 gold = 3;
if (this->gold() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_gold(), target);
}
// int32 cup = 4;
if (this->cup() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_cup(), target);
}
// int32 diamond = 5;
if (this->diamond() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_diamond(), target);
}
// .NFMsg.EBattleType battle_mode = 6;
if (this->battle_mode() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
6, this->_internal_battle_mode(), target);
}
// .NFMsg.Ident team_id = 7;
if (this->has_team_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
7, _Internal::team_id(this), target, stream);
}
// .NFMsg.Ident match_id = 8;
if (this->has_match_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
8, _Internal::match_id(this), target, stream);
}
// repeated .NFMsg.Ident members = 9;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_members_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(9, this->_internal_members(i), target, stream);
}
// repeated .NFMsg.ItemStruct item_list = 10;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_item_list_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(10, this->_internal_item_list(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.AckEndBattle)
return target;
}
size_t AckEndBattle::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.AckEndBattle)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.Ident members = 9;
total_size += 1UL * this->_internal_members_size();
for (const auto& msg : this->members_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// repeated .NFMsg.ItemStruct item_list = 10;
total_size += 1UL * this->_internal_item_list_size();
for (const auto& msg : this->item_list_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// .NFMsg.Ident team_id = 7;
if (this->has_team_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*team_id_);
}
// .NFMsg.Ident match_id = 8;
if (this->has_match_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*match_id_);
}
// int32 win = 1;
if (this->win() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_win());
}
// int32 star = 2;
if (this->star() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_star());
}
// int32 gold = 3;
if (this->gold() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_gold());
}
// int32 cup = 4;
if (this->cup() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_cup());
}
// int32 diamond = 5;
if (this->diamond() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
this->_internal_diamond());
}
// .NFMsg.EBattleType battle_mode = 6;
if (this->battle_mode() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_battle_mode());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void AckEndBattle::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.AckEndBattle)
GOOGLE_DCHECK_NE(&from, this);
const AckEndBattle* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AckEndBattle>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.AckEndBattle)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.AckEndBattle)
MergeFrom(*source);
}
}
void AckEndBattle::MergeFrom(const AckEndBattle& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.AckEndBattle)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
members_.MergeFrom(from.members_);
item_list_.MergeFrom(from.item_list_);
if (from.has_team_id()) {
_internal_mutable_team_id()->::NFMsg::Ident::MergeFrom(from._internal_team_id());
}
if (from.has_match_id()) {
_internal_mutable_match_id()->::NFMsg::Ident::MergeFrom(from._internal_match_id());
}
if (from.win() != 0) {
_internal_set_win(from._internal_win());
}
if (from.star() != 0) {
_internal_set_star(from._internal_star());
}
if (from.gold() != 0) {
_internal_set_gold(from._internal_gold());
}
if (from.cup() != 0) {
_internal_set_cup(from._internal_cup());
}
if (from.diamond() != 0) {
_internal_set_diamond(from._internal_diamond());
}
if (from.battle_mode() != 0) {
_internal_set_battle_mode(from._internal_battle_mode());
}
}
void AckEndBattle::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.AckEndBattle)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AckEndBattle::CopyFrom(const AckEndBattle& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.AckEndBattle)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AckEndBattle::IsInitialized() const {
return true;
}
void AckEndBattle::InternalSwap(AckEndBattle* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
members_.InternalSwap(&other->members_);
item_list_.InternalSwap(&other->item_list_);
swap(team_id_, other->team_id_);
swap(match_id_, other->match_id_);
swap(win_, other->win_);
swap(star_, other->star_);
swap(gold_, other->gold_);
swap(cup_, other->cup_);
swap(diamond_, other->diamond_);
swap(battle_mode_, other->battle_mode_);
}
::PROTOBUF_NAMESPACE_ID::Metadata AckEndBattle::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqSendMail::InitAsDefaultInstance() {
::NFMsg::_ReqSendMail_default_instance_._instance.get_mutable()->reciever_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqSendMail::_Internal {
public:
static const ::NFMsg::Ident& reciever(const ReqSendMail* msg);
};
const ::NFMsg::Ident&
ReqSendMail::_Internal::reciever(const ReqSendMail* msg) {
return *msg->reciever_;
}
void ReqSendMail::clear_reciever() {
if (GetArenaNoVirtual() == nullptr && reciever_ != nullptr) {
delete reciever_;
}
reciever_ = nullptr;
}
ReqSendMail::ReqSendMail()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqSendMail)
}
ReqSendMail::ReqSendMail(const ReqSendMail& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
item_list_(from.item_list_),
currency_list_(from.currency_list_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_reciever()) {
reciever_ = new ::NFMsg::Ident(*from.reciever_);
} else {
reciever_ = nullptr;
}
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqSendMail)
}
void ReqSendMail::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqSendMail_NFMsgShare_2eproto.base);
reciever_ = nullptr;
}
ReqSendMail::~ReqSendMail() {
// @@protoc_insertion_point(destructor:NFMsg.ReqSendMail)
SharedDtor();
}
void ReqSendMail::SharedDtor() {
if (this != internal_default_instance()) delete reciever_;
}
void ReqSendMail::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqSendMail& ReqSendMail::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqSendMail_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqSendMail::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqSendMail)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
item_list_.Clear();
currency_list_.Clear();
if (GetArenaNoVirtual() == nullptr && reciever_ != nullptr) {
delete reciever_;
}
reciever_ = nullptr;
_internal_metadata_.Clear();
}
const char* ReqSendMail::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident reciever = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_reciever(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// repeated .NFMsg.ItemStruct item_list = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_item_list(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
} else goto handle_unusual;
continue;
// repeated .NFMsg.CurrencyStruct currency_list = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_currency_list(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqSendMail::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqSendMail)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident reciever = 1;
if (this->has_reciever()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::reciever(this), target, stream);
}
// repeated .NFMsg.ItemStruct item_list = 2;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_item_list_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(2, this->_internal_item_list(i), target, stream);
}
// repeated .NFMsg.CurrencyStruct currency_list = 3;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->_internal_currency_list_size()); i < n; i++) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(3, this->_internal_currency_list(i), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqSendMail)
return target;
}
size_t ReqSendMail::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqSendMail)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .NFMsg.ItemStruct item_list = 2;
total_size += 1UL * this->_internal_item_list_size();
for (const auto& msg : this->item_list_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// repeated .NFMsg.CurrencyStruct currency_list = 3;
total_size += 1UL * this->_internal_currency_list_size();
for (const auto& msg : this->currency_list_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
// .NFMsg.Ident reciever = 1;
if (this->has_reciever()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*reciever_);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqSendMail::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqSendMail)
GOOGLE_DCHECK_NE(&from, this);
const ReqSendMail* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqSendMail>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqSendMail)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqSendMail)
MergeFrom(*source);
}
}
void ReqSendMail::MergeFrom(const ReqSendMail& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqSendMail)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
item_list_.MergeFrom(from.item_list_);
currency_list_.MergeFrom(from.currency_list_);
if (from.has_reciever()) {
_internal_mutable_reciever()->::NFMsg::Ident::MergeFrom(from._internal_reciever());
}
}
void ReqSendMail::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqSendMail)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqSendMail::CopyFrom(const ReqSendMail& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqSendMail)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqSendMail::IsInitialized() const {
return true;
}
void ReqSendMail::InternalSwap(ReqSendMail* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
item_list_.InternalSwap(&other->item_list_);
currency_list_.InternalSwap(&other->currency_list_);
swap(reciever_, other->reciever_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqSendMail::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void ReqSwitchServer::InitAsDefaultInstance() {
::NFMsg::_ReqSwitchServer_default_instance_._instance.get_mutable()->selfid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
::NFMsg::_ReqSwitchServer_default_instance_._instance.get_mutable()->client_id_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class ReqSwitchServer::_Internal {
public:
static const ::NFMsg::Ident& selfid(const ReqSwitchServer* msg);
static const ::NFMsg::Ident& client_id(const ReqSwitchServer* msg);
};
const ::NFMsg::Ident&
ReqSwitchServer::_Internal::selfid(const ReqSwitchServer* msg) {
return *msg->selfid_;
}
const ::NFMsg::Ident&
ReqSwitchServer::_Internal::client_id(const ReqSwitchServer* msg) {
return *msg->client_id_;
}
void ReqSwitchServer::clear_selfid() {
if (GetArenaNoVirtual() == nullptr && selfid_ != nullptr) {
delete selfid_;
}
selfid_ = nullptr;
}
void ReqSwitchServer::clear_client_id() {
if (GetArenaNoVirtual() == nullptr && client_id_ != nullptr) {
delete client_id_;
}
client_id_ = nullptr;
}
ReqSwitchServer::ReqSwitchServer()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.ReqSwitchServer)
}
ReqSwitchServer::ReqSwitchServer(const ReqSwitchServer& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_selfid()) {
selfid_ = new ::NFMsg::Ident(*from.selfid_);
} else {
selfid_ = nullptr;
}
if (from._internal_has_client_id()) {
client_id_ = new ::NFMsg::Ident(*from.client_id_);
} else {
client_id_ = nullptr;
}
::memcpy(&self_serverid_, &from.self_serverid_,
static_cast<size_t>(reinterpret_cast<char*>(&groupid_) -
reinterpret_cast<char*>(&self_serverid_)) + sizeof(groupid_));
// @@protoc_insertion_point(copy_constructor:NFMsg.ReqSwitchServer)
}
void ReqSwitchServer::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ReqSwitchServer_NFMsgShare_2eproto.base);
::memset(&selfid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&groupid_) -
reinterpret_cast<char*>(&selfid_)) + sizeof(groupid_));
}
ReqSwitchServer::~ReqSwitchServer() {
// @@protoc_insertion_point(destructor:NFMsg.ReqSwitchServer)
SharedDtor();
}
void ReqSwitchServer::SharedDtor() {
if (this != internal_default_instance()) delete selfid_;
if (this != internal_default_instance()) delete client_id_;
}
void ReqSwitchServer::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ReqSwitchServer& ReqSwitchServer::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ReqSwitchServer_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void ReqSwitchServer::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.ReqSwitchServer)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && selfid_ != nullptr) {
delete selfid_;
}
selfid_ = nullptr;
if (GetArenaNoVirtual() == nullptr && client_id_ != nullptr) {
delete client_id_;
}
client_id_ = nullptr;
::memset(&self_serverid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&groupid_) -
reinterpret_cast<char*>(&self_serverid_)) + sizeof(groupid_));
_internal_metadata_.Clear();
}
const char* ReqSwitchServer::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident selfid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_selfid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int64 self_serverid = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
self_serverid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int64 target_serverid = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
target_serverid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int64 gate_serverid = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
gate_serverid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int64 SceneID = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
sceneid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// .NFMsg.Ident client_id = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
ptr = ctx->ParseMessage(_internal_mutable_client_id(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int64 groupID = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
groupid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* ReqSwitchServer::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.ReqSwitchServer)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident selfid = 1;
if (this->has_selfid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::selfid(this), target, stream);
}
// int64 self_serverid = 2;
if (this->self_serverid() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_self_serverid(), target);
}
// int64 target_serverid = 3;
if (this->target_serverid() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->_internal_target_serverid(), target);
}
// int64 gate_serverid = 4;
if (this->gate_serverid() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->_internal_gate_serverid(), target);
}
// int64 SceneID = 5;
if (this->sceneid() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->_internal_sceneid(), target);
}
// .NFMsg.Ident client_id = 6;
if (this->has_client_id()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
6, _Internal::client_id(this), target, stream);
}
// int64 groupID = 7;
if (this->groupid() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->_internal_groupid(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.ReqSwitchServer)
return target;
}
size_t ReqSwitchServer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.ReqSwitchServer)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident selfid = 1;
if (this->has_selfid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*selfid_);
}
// .NFMsg.Ident client_id = 6;
if (this->has_client_id()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*client_id_);
}
// int64 self_serverid = 2;
if (this->self_serverid() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
this->_internal_self_serverid());
}
// int64 target_serverid = 3;
if (this->target_serverid() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
this->_internal_target_serverid());
}
// int64 gate_serverid = 4;
if (this->gate_serverid() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
this->_internal_gate_serverid());
}
// int64 SceneID = 5;
if (this->sceneid() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
this->_internal_sceneid());
}
// int64 groupID = 7;
if (this->groupid() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
this->_internal_groupid());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ReqSwitchServer::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.ReqSwitchServer)
GOOGLE_DCHECK_NE(&from, this);
const ReqSwitchServer* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ReqSwitchServer>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.ReqSwitchServer)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.ReqSwitchServer)
MergeFrom(*source);
}
}
void ReqSwitchServer::MergeFrom(const ReqSwitchServer& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.ReqSwitchServer)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_selfid()) {
_internal_mutable_selfid()->::NFMsg::Ident::MergeFrom(from._internal_selfid());
}
if (from.has_client_id()) {
_internal_mutable_client_id()->::NFMsg::Ident::MergeFrom(from._internal_client_id());
}
if (from.self_serverid() != 0) {
_internal_set_self_serverid(from._internal_self_serverid());
}
if (from.target_serverid() != 0) {
_internal_set_target_serverid(from._internal_target_serverid());
}
if (from.gate_serverid() != 0) {
_internal_set_gate_serverid(from._internal_gate_serverid());
}
if (from.sceneid() != 0) {
_internal_set_sceneid(from._internal_sceneid());
}
if (from.groupid() != 0) {
_internal_set_groupid(from._internal_groupid());
}
}
void ReqSwitchServer::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.ReqSwitchServer)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ReqSwitchServer::CopyFrom(const ReqSwitchServer& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.ReqSwitchServer)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ReqSwitchServer::IsInitialized() const {
return true;
}
void ReqSwitchServer::InternalSwap(ReqSwitchServer* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(selfid_, other->selfid_);
swap(client_id_, other->client_id_);
swap(self_serverid_, other->self_serverid_);
swap(target_serverid_, other->target_serverid_);
swap(gate_serverid_, other->gate_serverid_);
swap(sceneid_, other->sceneid_);
swap(groupid_, other->groupid_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ReqSwitchServer::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
void AckSwitchServer::InitAsDefaultInstance() {
::NFMsg::_AckSwitchServer_default_instance_._instance.get_mutable()->selfid_ = const_cast< ::NFMsg::Ident*>(
::NFMsg::Ident::internal_default_instance());
}
class AckSwitchServer::_Internal {
public:
static const ::NFMsg::Ident& selfid(const AckSwitchServer* msg);
};
const ::NFMsg::Ident&
AckSwitchServer::_Internal::selfid(const AckSwitchServer* msg) {
return *msg->selfid_;
}
void AckSwitchServer::clear_selfid() {
if (GetArenaNoVirtual() == nullptr && selfid_ != nullptr) {
delete selfid_;
}
selfid_ = nullptr;
}
AckSwitchServer::AckSwitchServer()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:NFMsg.AckSwitchServer)
}
AckSwitchServer::AckSwitchServer(const AckSwitchServer& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_selfid()) {
selfid_ = new ::NFMsg::Ident(*from.selfid_);
} else {
selfid_ = nullptr;
}
::memcpy(&self_serverid_, &from.self_serverid_,
static_cast<size_t>(reinterpret_cast<char*>(&gate_serverid_) -
reinterpret_cast<char*>(&self_serverid_)) + sizeof(gate_serverid_));
// @@protoc_insertion_point(copy_constructor:NFMsg.AckSwitchServer)
}
void AckSwitchServer::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AckSwitchServer_NFMsgShare_2eproto.base);
::memset(&selfid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&gate_serverid_) -
reinterpret_cast<char*>(&selfid_)) + sizeof(gate_serverid_));
}
AckSwitchServer::~AckSwitchServer() {
// @@protoc_insertion_point(destructor:NFMsg.AckSwitchServer)
SharedDtor();
}
void AckSwitchServer::SharedDtor() {
if (this != internal_default_instance()) delete selfid_;
}
void AckSwitchServer::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const AckSwitchServer& AckSwitchServer::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AckSwitchServer_NFMsgShare_2eproto.base);
return *internal_default_instance();
}
void AckSwitchServer::Clear() {
// @@protoc_insertion_point(message_clear_start:NFMsg.AckSwitchServer)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaNoVirtual() == nullptr && selfid_ != nullptr) {
delete selfid_;
}
selfid_ = nullptr;
::memset(&self_serverid_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&gate_serverid_) -
reinterpret_cast<char*>(&self_serverid_)) + sizeof(gate_serverid_));
_internal_metadata_.Clear();
}
const char* AckSwitchServer::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// .NFMsg.Ident selfid = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_selfid(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int64 self_serverid = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
self_serverid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int64 target_serverid = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
target_serverid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
// int64 gate_serverid = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
gate_serverid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* AckSwitchServer::InternalSerializeWithCachedSizesToArray(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:NFMsg.AckSwitchServer)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .NFMsg.Ident selfid = 1;
if (this->has_selfid()) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
1, _Internal::selfid(this), target, stream);
}
// int64 self_serverid = 2;
if (this->self_serverid() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_self_serverid(), target);
}
// int64 target_serverid = 3;
if (this->target_serverid() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->_internal_target_serverid(), target);
}
// int64 gate_serverid = 4;
if (this->gate_serverid() != 0) {
stream->EnsureSpace(&target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->_internal_gate_serverid(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:NFMsg.AckSwitchServer)
return target;
}
size_t AckSwitchServer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:NFMsg.AckSwitchServer)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .NFMsg.Ident selfid = 1;
if (this->has_selfid()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*selfid_);
}
// int64 self_serverid = 2;
if (this->self_serverid() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
this->_internal_self_serverid());
}
// int64 target_serverid = 3;
if (this->target_serverid() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
this->_internal_target_serverid());
}
// int64 gate_serverid = 4;
if (this->gate_serverid() != 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
this->_internal_gate_serverid());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void AckSwitchServer::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:NFMsg.AckSwitchServer)
GOOGLE_DCHECK_NE(&from, this);
const AckSwitchServer* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AckSwitchServer>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:NFMsg.AckSwitchServer)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:NFMsg.AckSwitchServer)
MergeFrom(*source);
}
}
void AckSwitchServer::MergeFrom(const AckSwitchServer& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:NFMsg.AckSwitchServer)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.has_selfid()) {
_internal_mutable_selfid()->::NFMsg::Ident::MergeFrom(from._internal_selfid());
}
if (from.self_serverid() != 0) {
_internal_set_self_serverid(from._internal_self_serverid());
}
if (from.target_serverid() != 0) {
_internal_set_target_serverid(from._internal_target_serverid());
}
if (from.gate_serverid() != 0) {
_internal_set_gate_serverid(from._internal_gate_serverid());
}
}
void AckSwitchServer::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:NFMsg.AckSwitchServer)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AckSwitchServer::CopyFrom(const AckSwitchServer& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:NFMsg.AckSwitchServer)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AckSwitchServer::IsInitialized() const {
return true;
}
void AckSwitchServer::InternalSwap(AckSwitchServer* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(selfid_, other->selfid_);
swap(self_serverid_, other->self_serverid_);
swap(target_serverid_, other->target_serverid_);
swap(gate_serverid_, other->gate_serverid_);
}
::PROTOBUF_NAMESPACE_ID::Metadata AckSwitchServer::GetMetadata() const {
return GetMetadataStatic();
}
// @@protoc_insertion_point(namespace_scope)
} // namespace NFMsg
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::NFMsg::ReqEnterGameServer* Arena::CreateMaybeMessage< ::NFMsg::ReqEnterGameServer >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqEnterGameServer >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckEnterGameSuccess* Arena::CreateMaybeMessage< ::NFMsg::ReqAckEnterGameSuccess >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckEnterGameSuccess >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqHeartBeat* Arena::CreateMaybeMessage< ::NFMsg::ReqHeartBeat >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqHeartBeat >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqLeaveGameServer* Arena::CreateMaybeMessage< ::NFMsg::ReqLeaveGameServer >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqLeaveGameServer >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::PlayerEntryInfo* Arena::CreateMaybeMessage< ::NFMsg::PlayerEntryInfo >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::PlayerEntryInfo >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::AckPlayerEntryList* Arena::CreateMaybeMessage< ::NFMsg::AckPlayerEntryList >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::AckPlayerEntryList >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::AckPlayerLeaveList* Arena::CreateMaybeMessage< ::NFMsg::AckPlayerLeaveList >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::AckPlayerLeaveList >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckSynData* Arena::CreateMaybeMessage< ::NFMsg::ReqAckSynData >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckSynData >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckPlayerMove* Arena::CreateMaybeMessage< ::NFMsg::ReqAckPlayerMove >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckPlayerMove >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckPlayerChat* Arena::CreateMaybeMessage< ::NFMsg::ReqAckPlayerChat >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckPlayerChat >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckPlayerPosSync* Arena::CreateMaybeMessage< ::NFMsg::ReqAckPlayerPosSync >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckPlayerPosSync >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::EffectData* Arena::CreateMaybeMessage< ::NFMsg::EffectData >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::EffectData >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckUseSkill* Arena::CreateMaybeMessage< ::NFMsg::ReqAckUseSkill >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckUseSkill >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckUseItem* Arena::CreateMaybeMessage< ::NFMsg::ReqAckUseItem >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckUseItem >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckSwapScene* Arena::CreateMaybeMessage< ::NFMsg::ReqAckSwapScene >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckSwapScene >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckHomeScene* Arena::CreateMaybeMessage< ::NFMsg::ReqAckHomeScene >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckHomeScene >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ItemStruct* Arena::CreateMaybeMessage< ::NFMsg::ItemStruct >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ItemStruct >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::CurrencyStruct* Arena::CreateMaybeMessage< ::NFMsg::CurrencyStruct >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::CurrencyStruct >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckReliveHero* Arena::CreateMaybeMessage< ::NFMsg::ReqAckReliveHero >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckReliveHero >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqPickDropItem* Arena::CreateMaybeMessage< ::NFMsg::ReqPickDropItem >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqPickDropItem >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAcceptTask* Arena::CreateMaybeMessage< ::NFMsg::ReqAcceptTask >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAcceptTask >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqCompeleteTask* Arena::CreateMaybeMessage< ::NFMsg::ReqCompeleteTask >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqCompeleteTask >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAddSceneBuilding* Arena::CreateMaybeMessage< ::NFMsg::ReqAddSceneBuilding >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAddSceneBuilding >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqSceneBuildings* Arena::CreateMaybeMessage< ::NFMsg::ReqSceneBuildings >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqSceneBuildings >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::AckSceneBuildings* Arena::CreateMaybeMessage< ::NFMsg::AckSceneBuildings >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::AckSceneBuildings >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqStoreSceneBuildings* Arena::CreateMaybeMessage< ::NFMsg::ReqStoreSceneBuildings >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqStoreSceneBuildings >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckCreateClan* Arena::CreateMaybeMessage< ::NFMsg::ReqAckCreateClan >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckCreateClan >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqSearchClan* Arena::CreateMaybeMessage< ::NFMsg::ReqSearchClan >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqSearchClan >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::AckSearchClan_SearchClanObject* Arena::CreateMaybeMessage< ::NFMsg::AckSearchClan_SearchClanObject >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::AckSearchClan_SearchClanObject >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::AckSearchClan* Arena::CreateMaybeMessage< ::NFMsg::AckSearchClan >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::AckSearchClan >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckJoinClan* Arena::CreateMaybeMessage< ::NFMsg::ReqAckJoinClan >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckJoinClan >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckLeaveClan* Arena::CreateMaybeMessage< ::NFMsg::ReqAckLeaveClan >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckLeaveClan >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckOprClanMember* Arena::CreateMaybeMessage< ::NFMsg::ReqAckOprClanMember >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckOprClanMember >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqEnterClanEctype* Arena::CreateMaybeMessage< ::NFMsg::ReqEnterClanEctype >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqEnterClanEctype >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqSetFightHero* Arena::CreateMaybeMessage< ::NFMsg::ReqSetFightHero >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqSetFightHero >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqSwitchFightHero* Arena::CreateMaybeMessage< ::NFMsg::ReqSwitchFightHero >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqSwitchFightHero >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqBuyItemFromShop* Arena::CreateMaybeMessage< ::NFMsg::ReqBuyItemFromShop >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqBuyItemFromShop >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::PVPPlayerInfo* Arena::CreateMaybeMessage< ::NFMsg::PVPPlayerInfo >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::PVPPlayerInfo >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqSearchOppnent* Arena::CreateMaybeMessage< ::NFMsg::ReqSearchOppnent >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqSearchOppnent >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::AckSearchOppnent* Arena::CreateMaybeMessage< ::NFMsg::AckSearchOppnent >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::AckSearchOppnent >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqAckCancelSearch* Arena::CreateMaybeMessage< ::NFMsg::ReqAckCancelSearch >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqAckCancelSearch >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqEndBattle* Arena::CreateMaybeMessage< ::NFMsg::ReqEndBattle >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqEndBattle >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::AckEndBattle* Arena::CreateMaybeMessage< ::NFMsg::AckEndBattle >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::AckEndBattle >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqSendMail* Arena::CreateMaybeMessage< ::NFMsg::ReqSendMail >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqSendMail >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::ReqSwitchServer* Arena::CreateMaybeMessage< ::NFMsg::ReqSwitchServer >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::ReqSwitchServer >(arena);
}
template<> PROTOBUF_NOINLINE ::NFMsg::AckSwitchServer* Arena::CreateMaybeMessage< ::NFMsg::AckSwitchServer >(Arena* arena) {
return Arena::CreateInternal< ::NFMsg::AckSwitchServer >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
| 37.144087 | 167 | 0.723924 | bytemode |
2fa4d82ec3604390d96209ed3a2b62c80f805e4e | 3,773 | hpp | C++ | Connection.hpp | 15-466/15-466-f21-intro | c3e1d2643fed8757f1345b46718d406d20a72c8e | [
"RSA-MD"
] | null | null | null | Connection.hpp | 15-466/15-466-f21-intro | c3e1d2643fed8757f1345b46718d406d20a72c8e | [
"RSA-MD"
] | null | null | null | Connection.hpp | 15-466/15-466-f21-intro | c3e1d2643fed8757f1345b46718d406d20a72c8e | [
"RSA-MD"
] | null | null | null | #pragma once
/*
* Connection is a simple wrapper around a TCP socket connection.
* You don't create 'Connection' objects yourself, rather, you
* create a Client or Server object which will manage connection(s)
* for you.
* For example:
//simple server
int main(int argc, char **argv) {
Server server("1337"); //start a server on port 1337
while (true) {
server.poll([](Connection *connection, Connection::Event evt){
if (evt == Connection::OnRecv) {
//extract and erase data from the connection's recv_buffer:
std::vector< uint8_t > data = connection->recv_buffer;
connection->recv_buffer.clear();
//send to other connections:
}
},
1.0 //timeout (in seconds)
);
}
}
//simple client
int main(int argc, char **argv) {
Client client("localhost", "1337"); //connect to a local server at port 1337
while (true) {
client.poll([](Connection *connection, Connection::Event evt){
},
0.0 //timeout (in seconds)
);
}
}
*/
//NOTE: much of the sockets code herein is based on http-tweak's single-header http server
// see: https://github.com/ixchow/http-tweak
//--------- 'Socket' is of different types on different OS's -------
#ifdef _WIN32
// (this is a work-around so that we don't expose the rest of the code
// to the horrors of windows.h )
//on windows, 'Socket' will match 'SOCKET' / 'INVALID_SOCKET'
#ifdef _WIN64
typedef unsigned __int64 Socket;
#else
typedef unsigned int Socket;
#endif
constexpr const Socket InvalidSocket = -1;
#else
//on linux, 'Socket' is just int and we'll use '-1' for an invalid value:
typedef int Socket;
constexpr const Socket InvalidSocket = -1;
#endif
//--------- ---------------------------------- ---------
#include <vector>
#include <list>
#include <string>
#include <functional>
//Thin wrapper around a (polling-based) TCP socket connection:
struct Connection {
//Helper that will append any type to the send buffer:
template< typename T >
void send(T const &t) {
send_raw(&t, sizeof(T));
}
//Helper that will append raw bytes to the send buffer:
void send_raw(void const *data, size_t size) {
send_buffer.insert(send_buffer.end(), reinterpret_cast< uint8_t const * >(data), reinterpret_cast< uint8_t const * >(data) + size);
}
//Call 'close' to mark a connection for discard:
void close();
//so you can if(connection) ... to check for validity:
explicit operator bool() { return socket != InvalidSocket; }
//To send data over a connection, append it to send_buffer:
std::vector< uint8_t > send_buffer;
//When the connection receives data, it is appended to recv_buffer:
std::vector< uint8_t > recv_buffer;
//internals:
Socket socket = InvalidSocket;
enum Event {
OnOpen,
OnRecv,
OnClose
};
};
struct Server {
Server(std::string const &port); //pass the port number to listen on, as a string (servname, really)
//poll() updates the list of active connections and sends/receives data if possible:
// (will wait up to 'timeout' for first event)
void poll(
std::function< void(Connection *, Connection::Event event) > const &connection_event = nullptr,
double timeout = 0.0 //timeout (seconds)
);
std::list< Connection > connections;
Socket listen_socket = InvalidSocket;
};
struct Client {
Client(std::string const &host, std::string const &port);
//poll() checks the status of the active connection and sends/receives data if possible:
// (will wait up to 'timeout' for first event)
void poll(
std::function< void(Connection *, Connection::Event event) > const &connection_event = nullptr,
double timeout = 0.0 //timeout (seconds)
);
std::list< Connection > connections; //will only ever contain exactly one connection
Connection &connection; //reference to the only connection in the connections list
};
| 29.248062 | 133 | 0.693878 | 15-466 |
2fa7361af6b9e99e44fd971b9339aa240add43e3 | 2,186 | cpp | C++ | src/spriterenderer.cpp | Foltik/K5 | a347b7c252c38e0b9190554ce25b9a399f9b66c4 | [
"WTFPL"
] | 2 | 2017-05-11T10:53:34.000Z | 2017-09-07T19:32:35.000Z | src/spriterenderer.cpp | Foltik/K5 | a347b7c252c38e0b9190554ce25b9a399f9b66c4 | [
"WTFPL"
] | 1 | 2017-10-01T03:46:52.000Z | 2017-10-16T20:59:56.000Z | src/spriterenderer.cpp | Foltik/K5 | a347b7c252c38e0b9190554ce25b9a399f9b66c4 | [
"WTFPL"
] | null | null | null | #include "spriterenderer.h"
#include <glm/gtc/matrix_transform.hpp>
#include "texture.h"
#include "shader.h"
constexpr const char* vertexSource = R"(
#version 330 Core
layout (location = 0) in vec4 vertex;
out vec2 texCoord;
uniform mat4 model;
uniform mat4 proj;
void main() {
texCoord = vertex.zw;
gl_Position = proj * model * vec4(vertex.xy, 0.0, 1.0);
}
)";
constexpr const char* fragmentSource = R"(
#version 330 Core
in vec2 texCoord;
out vec4 color;
uniform sampler2D sprite;
uniform vec3 spriteColor;
void main() {
color = vec4(spriteColor, 1.0) * texture(sprite, texCoord);
}
)";
SpriteRenderer::SpriteRenderer(glm::mat4 projection) {
proj = projection;
shader = new Shader(ShaderSource(vertexSource, fragmentSource));
GLfloat quad[] = {
0.0f, 1.0f, 0.0f, 1.0f,
1.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 1.0f,
1.0f, 1.0f, 1.0f, 1.0f,
1.0f, 0.0f, 1.0f, 0.0f
};
GLuint vbo;
glGenBuffers(1, &vbo);
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(quad), quad, GL_STATIC_DRAW);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), (GLvoid*)0);
glEnableVertexAttribArray(0);
glBindVertexArray(0);
}
SpriteRenderer::~SpriteRenderer() {
delete shader;
}
void SpriteRenderer::DrawSprite(Texture* tex, glm::vec2 pos, glm::vec2 size, float rotate = 0.0f, glm::vec3 color = glm::vec3(1.0f)) {
shader->Use();
// Apply Transformations
glm::mat4 model;
model = glm::translate(model, glm::vec3(pos, 0.0f));
model = glm::translate(model, glm::vec3(0.5f * size, 0.0f));
model = glm::rotate(model, rotate, glm::vec3(0.0f, 0.0f, 1.0f));
model = glm::translate(model, glm::vec3(-0.5f * size, 0.0f));
model = glm::scale(model, glm::vec3(size, 1.0f));
shader->uMatrix4("model", model);
shader->uMatrix4("proj", proj);
shader->uVector3("spriteColor", color);
glActiveTexture(GL_TEXTURE0);
tex->Use();
glBindVertexArray(vao);
glDrawArrays(GL_TRIANGLES, 0, 6);
glBindVertexArray(0);
} | 24.561798 | 134 | 0.646386 | Foltik |
2fab1ff8d8acf572be3967eac62aa98b8242c3e9 | 36,423 | cpp | C++ | blackmeta/sprites.cpp | frenchcomp/blackmeta | 198938021b3e9cc7aaab330de707899a10b5beba | [
"MIT"
] | null | null | null | blackmeta/sprites.cpp | frenchcomp/blackmeta | 198938021b3e9cc7aaab330de707899a10b5beba | [
"MIT"
] | null | null | null | blackmeta/sprites.cpp | frenchcomp/blackmeta | 198938021b3e9cc7aaab330de707899a10b5beba | [
"MIT"
] | null | null | null | /**
* LICENSE
*
* This source file is subject to the MIT license and the version 3 of the GPL3
* license that are bundled with this package in the folder licences
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
*
* @copyright Copyright (c) Richard Déloge ([email protected])
*
* @license http://teknoo.software/license/mit MIT License
*
* @author Andy O'Neil <https://github.com/aoneill01>
* @author Richard Déloge <[email protected]>
*/
#include "sprites.h"
#define TRANSPARENT_COLOR 0x1f
#define RGB565 (const uint16_t)ColorMode::rgb565
const uint16_t backgroundData[] = {80,64,1,0,TRANSPARENT_COLOR,RGB565,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x44a,0x409,0x44a,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409,0x409,0x409,0x409,0x409,0x409,0x409,0x44a,0x44a,0x44a,0x44a,0x44a,0x409};
Image extBackgroundImage(backgroundData);
const uint16_t cardSpriteData[] = {9,14,2,0,TRANSPARENT_COLOR,RGB565,0x1f,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0x1f,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0x1f,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0x1f,0x1f,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0x1f,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xcc68,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xcc68,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xcc68,0xcc68,0xcc68,0xcc68,0xcc68,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xcc68,0xcc68,0xcc68,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xcc68,0xfeb2,0xcc68,0xfeb2,0xcc68,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfd42,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0x1f,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0xfeb2,0x1f};
Image extCardSprite(cardSpriteData);
const uint16_t valueSpriteData[] = {3,5,28,0,TRANSPARENT_COLOR,RGB565,0x1f,0x1f,0x1f,0x1f,0x1f,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x0,0x1f,0x0,0x1f,0x0,0x1f,0x0,0x0,0x0,0x0,0x0,0x1f,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x1f,0x0,0x0,0x1f,0x1f,0x0,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x1f,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x0,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x0,0x0,0x1f,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x0,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x0,0x0,0x0,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x0,0x0,0x1f,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x1f,0x0,0x1f,0x0,0x1f,0x0,0x0,0x1f,0x0,0x0,0x0,0x1f,0x0,0x1f,0x0,0x0,0x1f,0x0,0x1f,0x1f,0x1f,0x1f,0x1f,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0xb8a2,0x1f,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0x1f,0xb8a2,0x1f,0x1f,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0x1f,0xb8a2,0x1f,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0x1f,0xb8a2,0xb8a2,0x1f,0xb8a2};
Image extValueSprite(valueSpriteData);
const uint16_t suitSpriteData[] = {5,5,4,0,TRANSPARENT_COLOR,RGB565,0x1f,0x1f,0x0,0x1f,0x1f,0x1f,0x0,0x0,0x0,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x1f,0x0,0x0,0x0,0x1f,0x0,0x1f,0x0,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x0,0x1f,0x0,0x1f,0x1f,0x0,0x1f,0x1f,0x1f,0xb8a2,0x1f,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0x1f,0xb8a2,0x1f,0x1f,0x1f,0x1f,0xb8a2,0x1f,0x1f,0x1f,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0xb8a2,0x1f,0xb8a2,0xb8a2,0xb8a2,0x1f,0x1f,0x1f,0xb8a2,0x1f,0x1f};
Image extSuitSprite(suitSpriteData);
| 1,011.75 | 30,791 | 0.829943 | frenchcomp |
2fab615191b2a6c4e6d749856f038bb4a97aa66f | 15,869 | cxx | C++ | Examples/Projections/SensorModelExample.cxx | lfyater/Orfeo | eb3d4d56089065b99641d8ae7338d2ed0358d28a | [
"Apache-2.0"
] | 2 | 2019-02-13T14:48:19.000Z | 2019-12-03T02:54:28.000Z | Examples/Projections/SensorModelExample.cxx | lfyater/Orfeo | eb3d4d56089065b99641d8ae7338d2ed0358d28a | [
"Apache-2.0"
] | null | null | null | Examples/Projections/SensorModelExample.cxx | lfyater/Orfeo | eb3d4d56089065b99641d8ae7338d2ed0358d28a | [
"Apache-2.0"
] | 2 | 2019-01-17T10:36:14.000Z | 2019-12-03T02:54:36.000Z | /*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "itkUnaryFunctorImageFilter.h"
#include "itkExtractImageFilter.h"
#include "itkRescaleIntensityImageFilter.h"
#include "itkLinearInterpolateImageFunction.h"
// Software Guide : BeginLatex
//
// This example illustrates how to use the sensor model read from
// image meta-data in order to perform ortho-rectification. This is a
// very basic, step-by-step example, so you understand the different
// components involved in the process. When performing real
// ortho-rectifications, you can use the example presented in section
// \ref{sec:OrthorectificationwithOTB}.
//
// We will start by including the header file for the inverse sensor model.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
#include "otbInverseSensorModel.h"
// Software Guide : EndCodeSnippet
int main(int argc, char* argv[])
{
if (argc != 8)
{
std::cout << argv[0] << " <input_filename> <output_filename>"
<< " <upper_left_corner_longitude> <upper_left_corner_latitude>"
<< " <size_x> <size_y> <number_of_stream_divisions>"
<< std::endl;
return EXIT_FAILURE;
}
// Software Guide : BeginLatex
//
// As explained before, the first thing to do is to create the sensor
// model in order to transform the ground coordinates in sensor
// geometry coordinates. The geoetric model will automatically be
// created by the image file reader. So we begin by declaring the
// types for the input image and the image reader.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef otb::Image<unsigned int, 2> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
ImageType::Pointer inputImage = reader->GetOutput();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We have just instantiated the reader and set the file name, but the
// image data and meta-data has not yet been accessed by it. Since we
// need the creation of the sensor model and all the image information
// (size, spacing, etc.), but we do not want to read the pixel data --
// it could be huge -- we just ask the reader to generate the output
// information needed.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
reader->GenerateOutputInformation();
std::cout << "Original input imagine spacing: " <<
reader->GetOutput()->GetSignedSpacing() << std::endl;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We can now instantiate the sensor model -- an inverse one, since we
// want to convert ground coordinates to sensor geometry. Note that
// the choice of the specific model (SPOT5, Ikonos, etc.) is done by
// the reader and we only need to instantiate a generic model.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef otb::InverseSensorModel<double> ModelType;
ModelType::Pointer model = ModelType::New();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The model is parameterized by passing to it the {\em keyword list}
// containing the needed information.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
model->SetImageGeometry(reader->GetOutput()->GetImageKeywordlist());
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Since we can not be sure that the image we read actually has sensor
// model information, we must check for the model validity.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
if (model->IsValidSensorModel() == false)
{
std::cerr << "Unable to create a model" << std::endl;
return 1;
}
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The types for the input and output coordinate points can be now
// declared. The same is done for the index types.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
ModelType::OutputPointType inputPoint;
typedef itk::Point <double, 2> PointType;
PointType outputPoint;
ImageType::IndexType currentIndex;
ImageType::IndexType currentIndexBis;
ImageType::IndexType pixelIndexBis;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We will now create the output image over which we will iterate in
// order to transform ground coordinates to sensor coordinates and get
// the corresponding pixel values.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
ImageType::Pointer outputImage = ImageType::New();
ImageType::PixelType pixelValue;
ImageType::IndexType start;
start[0] = 0;
start[1] = 0;
ImageType::SizeType size;
size[0] = atoi(argv[5]);
size[1] = atoi(argv[6]);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The spacing in y direction is negative since origin is the upper left corner.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
ImageType::SpacingType spacing;
spacing[0] = 0.00001;
spacing[1] = -0.00001;
ImageType::PointType origin;
origin[0] = strtod(argv[3], ITK_NULLPTR); //longitude
origin[1] = strtod(argv[4], ITK_NULLPTR); //latitude
ImageType::RegionType region;
region.SetSize(size);
region.SetIndex(start);
outputImage->SetOrigin(origin);
outputImage->SetRegions(region);
outputImage->SetSignedSpacing(spacing);
outputImage->Allocate();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We will now instantiate an extractor filter in order to get input
// regions by manual tiling.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef itk::ExtractImageFilter<ImageType, ImageType> ExtractType;
ExtractType::Pointer extract = ExtractType::New();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Since the transformed coordinates in sensor geometry may not be
// integer ones, we will need an interpolator to retrieve the pixel
// values (note that this assumes that the input image was correctly
// sampled by the acquisition system).
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef itk::LinearInterpolateImageFunction<ImageType, double>
InterpolatorType;
InterpolatorType::Pointer interpolator = InterpolatorType::New();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We proceed now to create the image writer. We will also use a
// writer plugged to the output of the extractor filter which will
// write the temporary extracted regions. This is just for monitoring
// the process.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef otb::Image<unsigned char, 2> CharImageType;
typedef otb::ImageFileWriter<CharImageType> CharWriterType;
typedef otb::ImageFileWriter<ImageType> WriterType;
WriterType::Pointer extractorWriter = WriterType::New();
CharWriterType::Pointer writer = CharWriterType::New();
extractorWriter->SetFileName("image_temp.jpeg");
extractorWriter->SetInput(extract->GetOutput());
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Since the output pixel type and the input pixel type are different,
// we will need to rescale the intensity values before writing them to
// a file.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef itk::RescaleIntensityImageFilter
<ImageType, CharImageType> RescalerType;
RescalerType::Pointer rescaler = RescalerType::New();
rescaler->SetOutputMinimum(10);
rescaler->SetOutputMaximum(255);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The tricky part starts here. Note that this example is only
// intended for educationnal purposes and that you do not need to proceed
// as this. See the example in section
// \ref{sec:OrthorectificationwithOTB} in order to code
// ortho-rectification chains in a very simple way.
//
// You want to go on? OK. You have been warned.
//
// We will start by declaring an image region iterator and some
// convenience variables.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef itk::ImageRegionIteratorWithIndex<ImageType> IteratorType;
unsigned int NumberOfStreamDivisions;
if (atoi(argv[7]) == 0)
{
NumberOfStreamDivisions = 10;
}
else
{
NumberOfStreamDivisions = atoi(argv[7]);
}
unsigned int count = 0;
unsigned int It, j, k;
int max_x, max_y, min_x, min_y;
ImageType::IndexType iterationRegionStart;
ImageType::SizeType iteratorRegionSize;
ImageType::RegionType iteratorRegion;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The loop starts here.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
for (count = 0; count < NumberOfStreamDivisions; count++)
{
iteratorRegionSize[0] = atoi(argv[5]);
if (count == NumberOfStreamDivisions - 1)
{
iteratorRegionSize[1] = (atoi(argv[6])) - ((int) (((atoi(argv[6])) /
NumberOfStreamDivisions)
+ 0.5)) * (count);
iterationRegionStart[1] = (atoi(argv[5])) - (iteratorRegionSize[1]);
}
else
{
iteratorRegionSize[1] = (int) (((atoi(argv[6])) /
NumberOfStreamDivisions) + 0.5);
iterationRegionStart[1] = count * iteratorRegionSize[1];
}
iterationRegionStart[0] = 0;
iteratorRegion.SetSize(iteratorRegionSize);
iteratorRegion.SetIndex(iterationRegionStart);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We create an array for storing the pixel indexes.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
unsigned int pixelIndexArrayDimension = iteratorRegionSize[0] *
iteratorRegionSize[1] * 2;
int *pixelIndexArray = new int[pixelIndexArrayDimension];
int *currentIndexArray = new int[pixelIndexArrayDimension];
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We create an iterator for each piece of the image, and we iterate
// over them.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
IteratorType outputIt(outputImage, iteratorRegion);
It = 0;
for (outputIt.GoToBegin(); !outputIt.IsAtEnd(); ++outputIt)
{
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We get the current index.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
currentIndex = outputIt.GetIndex();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We transform the index to physical coordinates.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
outputImage->TransformIndexToPhysicalPoint(currentIndex, outputPoint);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We use the sensor model to get the pixel coordinates in the input
// image and we transform this coordinates to an index. Then we store
// the index in the array. Note that the \code{TransformPoint()}
// method of the model has been overloaded so that it can be used with
// a 3D point when the height of the ground point is known (DEM availability).
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
inputPoint = model->TransformPoint(outputPoint);
pixelIndexArray[It] = static_cast<int>(inputPoint[0]);
pixelIndexArray[It + 1] = static_cast<int>(inputPoint[1]);
currentIndexArray[It] = static_cast<int>(currentIndex[0]);
currentIndexArray[It + 1] = static_cast<int>(currentIndex[1]);
It = It + 2;
}
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// At this point, we have stored all the indexes we need for the piece
// of image we are processing. We can now compute the bounds of the
// area in the input image we need to extract.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
max_x = pixelIndexArray[0];
min_x = pixelIndexArray[0];
max_y = pixelIndexArray[1];
min_y = pixelIndexArray[1];
for (j = 0; j < It; ++j)
{
if (j % 2 == 0 && pixelIndexArray[j] > max_x)
{
max_x = pixelIndexArray[j];
}
if (j % 2 == 0 && pixelIndexArray[j] < min_x)
{
min_x = pixelIndexArray[j];
}
if (j % 2 != 0 && pixelIndexArray[j] > max_y)
{
max_y = pixelIndexArray[j];
}
if (j % 2 != 0 && pixelIndexArray[j] < min_y)
{
min_y = pixelIndexArray[j];
}
}
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We can now set the parameters for the extractor using a little bit
// of margin in order to cope with irregular geometric distortions
// which could be due to topography, for instance.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
ImageType::RegionType extractRegion;
ImageType::IndexType extractStart;
if (min_x < 10 && min_y < 10)
{
extractStart[0] = 0;
extractStart[1] = 0;
}
else
{
extractStart[0] = min_x - 10;
extractStart[1] = min_y - 10;
}
ImageType::SizeType extractSize;
extractSize[0] = (max_x - min_x) + 20;
extractSize[1] = (max_y - min_y) + 20;
extractRegion.SetSize(extractSize);
extractRegion.SetIndex(extractStart);
extract->SetExtractionRegion(extractRegion);
extract->SetInput(reader->GetOutput());
extractorWriter->Update();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We give the input image to the interpolator and we loop through the
// index array in order to get the corresponding pixel values. Note
// that for every point we check whether it is inside the extracted region.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
interpolator->SetInputImage(extract->GetOutput());
for (k = 0; k < It / 2; ++k)
{
pixelIndexBis[0] = pixelIndexArray[2 * k];
pixelIndexBis[1] = pixelIndexArray[2 * k + 1];
currentIndexBis[0] = currentIndexArray[2 * k];
currentIndexBis[1] = currentIndexArray[2 * k + 1];
if (interpolator->IsInsideBuffer(pixelIndexBis))
{
pixelValue = int(interpolator->EvaluateAtIndex(pixelIndexBis));
}
else
{
pixelValue = 0;
}
outputImage->SetPixel(currentIndexBis, pixelValue);
}
delete[] pixelIndexArray;
delete[] currentIndexArray;
}
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// So we are done. We can now write the output image to a file after
// performing the intensity rescaling.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
writer->SetFileName(argv[2]);
rescaler->SetInput(outputImage);
writer->SetInput(rescaler->GetOutput());
writer->Update();
// Software Guide : EndCodeSnippet
return EXIT_SUCCESS;
}
| 31.674651 | 81 | 0.696452 | lfyater |
2fac20bc3cb0bc379ed01b3c621c920274a32869 | 676 | hh | C++ | build/x86/params/X86System.hh | billionshang/gem5 | 18cc4294f32315595f865d07d1f33434e92b06b2 | [
"BSD-3-Clause"
] | 5 | 2019-12-12T16:26:09.000Z | 2022-03-17T03:23:33.000Z | build/X86/params/X86System.hh | zhoushuxin/impl_of_HPCA2018 | 594d807fb0c0712bb7766122c4efe3321d012687 | [
"BSD-3-Clause"
] | 1 | 2020-08-20T05:53:30.000Z | 2020-08-20T05:53:30.000Z | build/X86/params/X86System.hh | zhoushuxin/impl_of_HPCA2018 | 594d807fb0c0712bb7766122c4efe3321d012687 | [
"BSD-3-Clause"
] | null | null | null | #ifndef __PARAMS__X86System__
#define __PARAMS__X86System__
class X86System;
#include <cstddef>
#include "params/X86ACPIRSDP.hh"
#include <cstddef>
#include "params/X86IntelMPFloatingPointer.hh"
#include <cstddef>
#include "params/X86IntelMPConfigTable.hh"
#include <cstddef>
#include "params/X86SMBiosSMBiosTable.hh"
#include "params/System.hh"
struct X86SystemParams
: public SystemParams
{
X86System * create();
X86ISA::ACPI::RSDP * acpi_description_table_pointer;
X86ISA::IntelMP::FloatingPointer * intel_mp_pointer;
X86ISA::IntelMP::ConfigTable * intel_mp_table;
X86ISA::SMBios::SMBiosTable * smbios_table;
};
#endif // __PARAMS__X86System__
| 24.142857 | 56 | 0.773669 | billionshang |
2fb05814055f460e452efaa09d389272346efb5d | 917 | cpp | C++ | 01-Iterations/BinaryGap.cpp | hNrChVz/codility-lessons-solution | b76e802c97ed95feb69a1038736db6d494418777 | [
"FSFAP"
] | null | null | null | 01-Iterations/BinaryGap.cpp | hNrChVz/codility-lessons-solution | b76e802c97ed95feb69a1038736db6d494418777 | [
"FSFAP"
] | null | null | null | 01-Iterations/BinaryGap.cpp | hNrChVz/codility-lessons-solution | b76e802c97ed95feb69a1038736db6d494418777 | [
"FSFAP"
] | null | null | null | #include <bitset>
#include <algorithm>
using namespace std;
/*
My first impression here is to have an array of binary representaion of N.
e.g.
N = 9 ; will have an array of { 1, 0, 0, 1 }
With that, I can use std::bitset, std::bitset<64> nBit (N);
NOTE:
N is from [1..2,147,483,647], so 32-bit long will suffice. I've used 64 to to be sure.
Now, I'll just to need iterate through each bit.
Time complexity: O(N)
*/
int solution(int N) {
int binGap = 0;
bitset<64> nBit(N);
bool start = false; //flag telling me i have encountered 1, also acts as an end
int gap = 0; //current gap size holder
for (unsigned int i = 0; i < nBit.size(); i++) {
if (start) {
//start counting
if (nBit[i] == 1) {
//it reached the end of the current gap
binGap = max(binGap, gap);
gap = 0;
}
else {
gap++;
}
}
else {
if (nBit[i] == 1) {
start = true;
}
}
}
return binGap;
}
| 18.714286 | 86 | 0.607415 | hNrChVz |
2fb3ff3f057f16f6add625d930f6938c82cb0dd5 | 2,654 | hpp | C++ | include/km/Console.hpp | keymaker-io/keymaker-alpha | ffe5310ed1304654ff4ae3a7025fff34b629588b | [
"MIT"
] | 3 | 2017-02-04T17:17:11.000Z | 2017-03-04T22:41:26.000Z | include/km/Console.hpp | keymaker-io/keymaker-alpha | ffe5310ed1304654ff4ae3a7025fff34b629588b | [
"MIT"
] | null | null | null | include/km/Console.hpp | keymaker-io/keymaker-alpha | ffe5310ed1304654ff4ae3a7025fff34b629588b | [
"MIT"
] | null | null | null | /*!
* Title ---- km/Console.hpp
* Author --- Giacomo Trudu aka `Wicker25` - wicker25[at]gmail[dot]com
*
* Copyright (C) 2017 by Giacomo Trudu.
* All rights reserved.
*
* This file is part of KeyMaker software.
*/
#ifndef __KM_CONSOLE_HPP__
#define __KM_CONSOLE_HPP__
#include <km.hpp>
#include <km/Exception.hpp>
#include <km/Buffer.hpp>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <chrono>
#include <thread>
#include <boost/system/api_config.hpp>
# if defined(BOOST_POSIX_API)
# include <unistd.h>
# include <termios.h>
# elif defined(BOOST_WINDOWS_API)
# include <windows.h>
# endif
#include <termcolor/termcolor.hpp>
#include <spdlog/spdlog.h>
#define BEGIN_TASK(AGENT, MESSAGE) \
{ \
std::stringstream ss; \
ss << MESSAGE; \
\
::km::TaskTracker __tracker(AGENT, ss.str()); \
\
try {
#define END_TASK() \
__tracker.done(); \
} \
catch (::km::TaskException e) { __tracker.fail(); } \
catch (::km::Exception e) { __tracker.fail(); throw e; } \
}
using namespace boost;
namespace km { // Begin main namespace
/*!
* Prompts for a secret.
*
* @return The input data.
*/
Buffer promptSecret();
/*!
* Prompts for a secret.
*
* @param[in] message The prompt message.
*
* @return The input data.
*/
Buffer promptSecret(const Buffer &message);
/*!
* The console.
*/
class Console
{
public:
/*!
* Sets the debug state.
*/
static void setDebug(bool state);
/*!
* Returns the debug state.
*/
static bool getDebug();
protected:
/*!
* The name of the agent that initiated the task.
*/
static bool mDebug;
};
/*!
* The task tracker.
*/
class TaskTracker
{
public:
/*!
* Constructor method.
*
* @param[in] agent The agent name.
* @param[in] description The task description.
*/
TaskTracker(const std::string &agent, const std::string &description);
/*!
* Destructor method.
*/
virtual ~TaskTracker();
/*!
* Marks the task as done.
*/
void done();
/*!
* Marks the task as failed.
*/
void fail();
protected:
/*!
* The name of the agent that initiated the task.
*/
std::string mAgent;
/*!
* The task description.
*/
std::string mDescription;
/*!
* Indicates whether or not the task is processed.
*/
bool mProcessed;
};
/*!
* The task exception.
*/
class TaskException : public Exception
{
using Exception::Exception;
};
} // End of main namespace
#endif /* __KM_CONSOLE_HPP__ */
// Include inline methods
#include <km/Console-inl.hpp> | 15.892216 | 74 | 0.608892 | keymaker-io |
2fb453ebb76486bc333d65bd5c8a8e393bb84ac4 | 2,975 | cpp | C++ | src/concurrent/mutex.cpp | tkng/pficommon | 1301e1c9f958656e4bc882ae2db9452e8cffab7e | [
"BSD-3-Clause"
] | 48 | 2017-04-03T18:46:24.000Z | 2022-02-28T01:44:05.000Z | src/concurrent/mutex.cpp | tkng/pficommon | 1301e1c9f958656e4bc882ae2db9452e8cffab7e | [
"BSD-3-Clause"
] | 44 | 2017-02-21T13:13:52.000Z | 2021-02-06T13:08:31.000Z | src/concurrent/mutex.cpp | tkng/pficommon | 1301e1c9f958656e4bc882ae2db9452e8cffab7e | [
"BSD-3-Clause"
] | 13 | 2016-12-28T05:04:58.000Z | 2021-10-01T02:17:23.000Z | // Copyright (c)2008-2011, Preferred Infrastructure Inc.
//
// 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 Preferred Infrastructure nor the names of other
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "mutex.h"
#include "mutex_impl.h"
namespace pfi{
namespace concurrent{
mutex_base::mutex_base(bool recursive)
:pimpl(new impl(recursive))
{
}
mutex_base::~mutex_base()
{
}
bool mutex_base::lock()
{
return pimpl->lock();
}
bool mutex_base::unlock()
{
return pimpl->unlock();
}
mutex_base::impl::impl(bool recursive)
: holder(-1)
, cnt(recursive?0:-1)
{
// always succeed
pthread_mutex_init(&mid,NULL);
}
mutex_base::impl::~impl()
{
// when it locks, it returns EBUSY
pthread_mutex_destroy(&mid);
}
bool mutex_base::impl::lock()
{
thread::tid_t self=thread::id();
// non-recursive
if (cnt<0) {
int r=pthread_mutex_lock(&mid);
if (r==0)
holder=self;
return r==0;
}
if (self==holder){
cnt++;
return true;
}
if (pthread_mutex_lock(&mid)!=0)
return false;
// it can acquire lock, iff
// current counter must not be equal to 0
cnt=1;
holder=self;
return true;
}
bool mutex_base::impl::unlock()
{
if (cnt<0) {
// non-recursive
holder=-1;
return pthread_mutex_unlock(&mid)==0;
}
thread::tid_t self=thread::id();
if (self==holder){
if (--cnt==0){
holder=-1;
if (pthread_mutex_unlock(&mid)!=0)
return false;
return true;
}
return true;
}
return false;
}
} // concurrent
} // pfi
| 23.991935 | 78 | 0.688739 | tkng |
2fb50156f68c6695b68a1caad1c9c83cd801e263 | 884 | hpp | C++ | android-31/android/service/controls/templates/RangeTemplate.hpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 12 | 2020-03-26T02:38:56.000Z | 2022-03-14T08:17:26.000Z | android-31/android/service/controls/templates/RangeTemplate.hpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 1 | 2021-01-27T06:07:45.000Z | 2021-11-13T19:19:43.000Z | android-31/android/service/controls/templates/RangeTemplate.hpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 3 | 2021-02-02T12:34:55.000Z | 2022-03-08T07:45:57.000Z | #pragma once
#include "./ControlTemplate.hpp"
class JString;
class JString;
namespace android::service::controls::templates
{
class RangeTemplate : public android::service::controls::templates::ControlTemplate
{
public:
// Fields
// QJniObject forward
template<typename ...Ts> explicit RangeTemplate(const char *className, const char *sig, Ts...agv) : android::service::controls::templates::ControlTemplate(className, sig, std::forward<Ts>(agv)...) {}
RangeTemplate(QJniObject obj);
// Constructors
RangeTemplate(JString arg0, jfloat arg1, jfloat arg2, jfloat arg3, jfloat arg4, JString arg5);
// Methods
jfloat getCurrentValue() const;
JString getFormatString() const;
jfloat getMaxValue() const;
jfloat getMinValue() const;
jfloat getStepValue() const;
jint getTemplateType() const;
};
} // namespace android::service::controls::templates
| 27.625 | 201 | 0.734163 | YJBeetle |
2fb59d9b2cee9e409976fff49c37cb2504d4b1a1 | 19,696 | cpp | C++ | sources/SceneGraph/Collision/spCollisionCapsule.cpp | rontrek/softpixel | 73a13a67e044c93f5c3da9066eedbaf3805d6807 | [
"Zlib"
] | 14 | 2015-08-16T21:05:20.000Z | 2019-08-21T17:22:01.000Z | sources/SceneGraph/Collision/spCollisionCapsule.cpp | rontrek/softpixel | 73a13a67e044c93f5c3da9066eedbaf3805d6807 | [
"Zlib"
] | null | null | null | sources/SceneGraph/Collision/spCollisionCapsule.cpp | rontrek/softpixel | 73a13a67e044c93f5c3da9066eedbaf3805d6807 | [
"Zlib"
] | 3 | 2020-02-15T09:17:41.000Z | 2020-05-21T14:10:40.000Z | /*
* Collision sphere file
*
* This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns)
* See "SoftPixelEngine.hpp" for license information.
*/
#include "SceneGraph/Collision/spCollisionCapsule.hpp"
#include "SceneGraph/Collision/spCollisionSphere.hpp"
#include "SceneGraph/Collision/spCollisionBox.hpp"
#include "SceneGraph/Collision/spCollisionPlane.hpp"
#include "SceneGraph/Collision/spCollisionMesh.hpp"
#include <boost/foreach.hpp>
namespace sp
{
namespace scene
{
CollisionCapsule::CollisionCapsule(
CollisionMaterial* Material, SceneNode* Node, f32 Radius, f32 Height) :
CollisionLineBased(Material, Node, COLLISION_CAPSULE, Radius, Height)
{
}
CollisionCapsule::~CollisionCapsule()
{
}
s32 CollisionCapsule::getSupportFlags() const
{
return COLLISIONSUPPORT_SPHERE | COLLISIONSUPPORT_CAPSULE | COLLISIONSUPPORT_BOX | COLLISIONSUPPORT_PLANE | COLLISIONSUPPORT_MESH;
}
bool CollisionCapsule::checkIntersection(const dim::line3df &Line, SIntersectionContact &Contact) const
{
dim::vector3df PointP, PointQ;
const dim::line3df CapsuleLine(getLine());
/* Make an intersection test with both lines */
const f32 DistanceSq = math::CollisionLibrary::getLineLineDistanceSq(CapsuleLine, Line, PointP, PointQ);
if (DistanceSq < math::pow2(getRadius()))
{
Contact.Normal = (PointQ - PointP).normalize();
Contact.Point = PointP + Contact.Normal * getRadius();
Contact.Object = this;
return true;
}
return false;
}
bool CollisionCapsule::checkIntersection(const dim::line3df &Line, bool ExcludeCorners) const
{
/* Make an intersection test with both lines */
dim::vector3df PointP, PointQ;
if (math::CollisionLibrary::getLineLineDistanceSq(getLine(), Line, PointP, PointQ) < math::pow2(getRadius()))
{
if (ExcludeCorners)
{
dim::vector3df Dir(PointQ - PointP);
Dir.setLength(getRadius());
return checkCornerExlusion(Line, PointP + Dir);
}
return true;
}
return false;
}
/*
* ======= Private: =======
*/
bool CollisionCapsule::checkCollisionToSphere(const CollisionSphere* Rival, SCollisionContact &Contact) const
{
if (!Rival)
return false;
/* Store transformation */
const dim::vector3df SpherePos(Rival->getPosition());
const dim::line3df CapsuleLine(getLine());
const f32 MaxRadius = Radius_ + Rival->getRadius();
/* Get the closest point from this sphere to the capsule */
const dim::vector3df ClosestPoint = CapsuleLine.getClosestPoint(SpherePos);
/* Check if this object and the other collide with each other */
if (math::getDistanceSq(SpherePos, ClosestPoint) < math::pow2(MaxRadius))
return setupCollisionContact(ClosestPoint, SpherePos, MaxRadius, Rival->getRadius(), Contact);
return false;
}
bool CollisionCapsule::checkCollisionToCapsule(const CollisionCapsule* Rival, SCollisionContact &Contact) const
{
if (!Rival)
return false;
/* Store transformation */
const dim::vector3df SpherePos(Rival->getPosition());
const dim::line3df CapsuleLine(getLine());
const f32 MaxRadius = Radius_ + Rival->getRadius();
/* Get the closest points between this and the rival capsule */
dim::vector3df PointP, PointQ;
const f32 DistanceSq = math::CollisionLibrary::getLineLineDistanceSq(getLine(), Rival->getLine(), PointP, PointQ);
/* Check if this object and the other collide with each other */
if (DistanceSq < math::pow2(MaxRadius))
return setupCollisionContact(PointP, PointQ, MaxRadius, Rival->getRadius(), Contact);
return false;
}
bool CollisionCapsule::checkCollisionToBox(const CollisionBox* Rival, SCollisionContact &Contact) const
{
if (!Rival)
return false;
/* Store transformation */
const dim::matrix4f Mat(Rival->getTransformation().getPositionRotationMatrix());
const dim::matrix4f InvMat(Mat.getInverse());
const dim::aabbox3df Box(Rival->getBox().getScaled(Rival->getScale()));
const dim::line3df CapsuleLine(getLine());
const dim::line3df CapsuleLineInv(
InvMat * CapsuleLine.Start, InvMat * CapsuleLine.End
);
/* Get the closest point from this capsule and the box */
if (Box.isPointInside(CapsuleLineInv.Start) || Box.isPointInside(CapsuleLineInv.End))
return false;
const dim::line3df Line = math::CollisionLibrary::getClosestLine(Box, CapsuleLineInv);
/* Check if this object and the other collide with each other */
if (math::getDistanceSq(Line.Start, Line.End) < math::pow2(getRadius()))
{
Contact.Point = Mat * Line.Start;
/* Compute normal and impact together to avoid calling square-root twice */
Contact.Normal = (Mat * Line.End) - Contact.Point;
Contact.Impact = Contact.Normal.getLength();
if (Contact.Impact < math::ROUNDING_ERROR)
return false;
Contact.Normal *= (1.0f / Contact.Impact);
Contact.Impact = getRadius() - Contact.Impact;
return true;
}
return false;
}
bool CollisionCapsule::checkCollisionToPlane(const CollisionPlane* Rival, SCollisionContact &Contact) const
{
if (!Rival)
return false;
/* Store transformation */
const dim::line3df CapsuleLine(getLine());
const dim::plane3df RivalPlane(
Rival->getTransformation().getPositionRotationMatrix() * Rival->getPlane()
);
/* Check if this object and the other collide with each other */
const f32 DistA = RivalPlane.getPointDistance(CapsuleLine.Start);
const f32 DistB = RivalPlane.getPointDistance(CapsuleLine.End);
if ( DistA > 0.0f && DistB > 0.0f && ( DistA < getRadius() || DistB < getRadius() ) )
{
Contact.Normal = RivalPlane.Normal;
Contact.Point = Contact.Normal;
if (DistA <= DistB)
{
Contact.Point *= -DistA;
Contact.Point += CapsuleLine.Start;
Contact.Impact = getRadius() - DistA;
}
else
{
Contact.Point *= -DistB;
Contact.Point += CapsuleLine.End;
Contact.Impact = getRadius() - DistB;
}
return true;
}
return false;
}
bool CollisionCapsule::checkCollisionToMesh(const CollisionMesh* Rival, SCollisionContact &Contact) const
{
if (!Rival)
return false;
/* Check if rival mesh has a tree-hierarchy */
KDTreeNode* RootTreeNode = Rival->getRootTreeNode();
if (!RootTreeNode)
return false;
/* Store transformation */
const dim::line3df CapsuleLine(getLine());
const video::EFaceTypes CollFace(Rival->getCollFace());
const dim::matrix4f RivalMat(Rival->getTransformation());
const dim::matrix4f RivalMatInv(RivalMat.getInverse());
const dim::line3df CapsuleLineInv(
RivalMatInv * CapsuleLine.Start, RivalMatInv * CapsuleLine.End
);
f32 DistanceSq = math::pow2(getRadius());
SCollisionFace* ClosestFace = 0;
dim::vector3df ClosestPoint;
#ifndef _DEB_NEW_KDTREE_
std::map<SCollisionFace*, bool> FaceMap;
#endif
/* Get tree node list */
std::list<const TreeNode*> TreeNodeList;
RootTreeNode->findLeafList(
TreeNodeList, CapsuleLineInv, (RivalMatInv.getScale() * getRadius()).getMax()
);
/* Check collision with triangles of each tree-node */
foreach (const TreeNode* Node, TreeNodeList)
{
/* Get tree node data */
CollisionMesh::TreeNodeDataType* TreeNodeData = static_cast<CollisionMesh::TreeNodeDataType*>(Node->getUserData());
if (!TreeNodeData)
continue;
/* Check collision with each triangle */
#ifndef _DEB_NEW_KDTREE_
foreach (SCollisionFace* Face, *TreeNodeData)
#else
foreach (SCollisionFace &NodeFace, *TreeNodeData)
#endif
{
#ifndef _DEB_NEW_KDTREE_
/* Check for unique usage */
if (FaceMap.find(Face) != FaceMap.end())
continue;
FaceMap[Face] = true;
#else
SCollisionFace* Face = &NodeFace;
#endif
/* Check for face-culling */
if (Face->isBackFaceCulling(CollFace, CapsuleLineInv))
continue;
/* Make sphere-triangle collision test */
const dim::line3df CurClosestLine(
math::CollisionLibrary::getClosestLine(RivalMat * Face->Triangle, CapsuleLine)
);
/* Check if this is a potentially new closest face */
const f32 CurDistSq = math::getDistanceSq(CurClosestLine.Start, CurClosestLine.End);
if (CurDistSq < DistanceSq)
{
/* Store link to new closest face */
DistanceSq = CurDistSq;
ClosestPoint = CurClosestLine.Start;
ClosestFace = Face;
}
}
}
/* Check if a collision has been detected */
if (ClosestFace)
{
Contact.Normal = (RivalMat * ClosestFace->Triangle).getNormal();
Contact.Point = ClosestPoint;
Contact.Face = ClosestFace;
return true;
}
return false;
}
bool CollisionCapsule::checkAnyCollisionToMesh(const CollisionMesh* Rival) const
{
if (!Rival)
return false;
/* Check if rival mesh has a tree-hierarchy */
KDTreeNode* RootTreeNode = Rival->getRootTreeNode();
if (!RootTreeNode)
return false;
/* Store transformation */
const dim::line3df CapsuleLine(getLine());
const video::EFaceTypes CollFace(Rival->getCollFace());
const dim::matrix4f RivalMat(Rival->getTransformation());
const dim::matrix4f RivalMatInv(RivalMat.getInverse());
const dim::line3df CapsuleLineInv(
RivalMatInv * CapsuleLine.Start, RivalMatInv * CapsuleLine.End
);
const f32 RadiusSq = math::pow2(getRadius());
#ifndef _DEB_NEW_KDTREE_
std::map<SCollisionFace*, bool> FaceMap;
#endif
/* Get tree node list */
std::list<const TreeNode*> TreeNodeList;
RootTreeNode->findLeafList(
TreeNodeList, CapsuleLineInv, (RivalMatInv.getScale() * getRadius()).getMax()
);
/* Check collision with triangles of each tree-node */
foreach (const TreeNode* Node, TreeNodeList)
{
/* Get tree node data */
CollisionMesh::TreeNodeDataType* TreeNodeData = static_cast<CollisionMesh::TreeNodeDataType*>(Node->getUserData());
if (!TreeNodeData)
continue;
/* Check collision with each triangle */
#ifndef _DEB_NEW_KDTREE_
foreach (SCollisionFace* Face, *TreeNodeData)
#else
foreach (SCollisionFace &NodeFace, *TreeNodeData)
#endif
{
#ifndef _DEB_NEW_KDTREE_
/* Check for unique usage */
if (FaceMap.find(Face) != FaceMap.end())
continue;
FaceMap[Face] = true;
#else
SCollisionFace* Face = &NodeFace;
#endif
/* Check for face-culling */
if (Face->isBackFaceCulling(CollFace, CapsuleLineInv))
continue;
/* Make sphere-triangle collision test */
const dim::line3df CurClosestLine(
math::CollisionLibrary::getClosestLine(Face->Triangle, CapsuleLineInv)
);
/* Check if the first collision has been detected and return on succeed */
if (math::getDistanceSq(CurClosestLine.Start, CurClosestLine.End) < RadiusSq)
return true;
}
}
return false;
}
void CollisionCapsule::performCollisionResolvingToSphere(const CollisionSphere* Rival)
{
SCollisionContact Contact;
if (checkCollisionToSphere(Rival, Contact))
performDetectedContact(Rival, Contact);
}
void CollisionCapsule::performCollisionResolvingToCapsule(const CollisionCapsule* Rival)
{
SCollisionContact Contact;
if (checkCollisionToCapsule(Rival, Contact))
performDetectedContact(Rival, Contact);
}
void CollisionCapsule::performCollisionResolvingToBox(const CollisionBox* Rival)
{
SCollisionContact Contact;
if (checkCollisionToBox(Rival, Contact))
performDetectedContact(Rival, Contact);
}
void CollisionCapsule::performCollisionResolvingToPlane(const CollisionPlane* Rival)
{
SCollisionContact Contact;
if (checkCollisionToPlane(Rival, Contact))
performDetectedContact(Rival, Contact);
}
void CollisionCapsule::performCollisionResolvingToMesh(const CollisionMesh* Rival)
{
if (!Rival)
return;
/* Check if rival mesh has a tree-hierarchy */
KDTreeNode* RootTreeNode = Rival->getRootTreeNode();
if (!RootTreeNode)
return;
/* Store transformation */
const video::EFaceTypes CollFace(Rival->getCollFace());
const dim::matrix4f RivalMat(Rival->getTransformation());
const dim::matrix4f RivalMatInv(RivalMat.getInverse());
dim::line3df CapsuleLine(getLine());
dim::line3df CapsuleLineInv(
RivalMatInv * CapsuleLine.Start, RivalMatInv * CapsuleLine.End
);
dim::line3df ClosestLine;
const f32 RadiusSq = math::pow2(getRadius());
#ifndef _DEB_NEW_KDTREE_
std::map<SCollisionFace*, bool> FaceMap, EdgeFaceMap;
#endif
/* Get tree node list */
std::list<const TreeNode*> TreeNodeList;
RootTreeNode->findLeafList(
TreeNodeList, CapsuleLineInv, (RivalMatInv.getScale() * getRadius()).getMax()
);
/* Check collision with triangle faces of each tree-node */
foreach (const TreeNode* Node, TreeNodeList)
{
/* Get tree node data */
CollisionMesh::TreeNodeDataType* TreeNodeData = static_cast<CollisionMesh::TreeNodeDataType*>(Node->getUserData());
if (!TreeNodeData)
continue;
/* Check collision with each triangle face */
#ifndef _DEB_NEW_KDTREE_
foreach (SCollisionFace* Face, *TreeNodeData)
#else
foreach (SCollisionFace &NodeFace, *TreeNodeData)
#endif
{
#ifndef _DEB_NEW_KDTREE_
/* Check for unique usage */
if (FaceMap.find(Face) != FaceMap.end())
continue;
FaceMap[Face] = true;
#else
SCollisionFace* Face = &NodeFace;
#endif
/* Check for face-culling */
if (Face->isBackFaceCulling(CollFace, CapsuleLineInv))
continue;
/* Make capsule-triangle collision test */
const dim::triangle3df Triangle(RivalMat * Face->Triangle);
if (!math::CollisionLibrary::getClosestLineStraight(Triangle, CapsuleLine, ClosestLine))
continue;
/* Check if this is a potentially new closest face */
if (math::getDistanceSq(ClosestLine.Start, ClosestLine.End) < RadiusSq)
{
/* Perform detected collision contact */
SCollisionContact Contact;
{
Contact.Point = ClosestLine.Start;
Contact.Normal = Triangle.getNormal();
Contact.Impact = getRadius() - (ClosestLine.End - Contact.Point).getLength();
Contact.Triangle = Triangle;
Contact.Face = Face;
}
performDetectedContact(Rival, Contact);
if (getFlags() & COLLISIONFLAG_RESOLVE)
{
/* Update capsule position */
CapsuleLine = getLine();
CapsuleLineInv.Start = RivalMatInv * CapsuleLine.Start;
CapsuleLineInv.End = RivalMatInv * CapsuleLine.End;
}
}
}
}
/* Check collision with triangle edges of each tree-node */
foreach (const TreeNode* Node, TreeNodeList)
{
/* Get tree node data */
CollisionMesh::TreeNodeDataType* TreeNodeData = static_cast<CollisionMesh::TreeNodeDataType*>(Node->getUserData());
if (!TreeNodeData)
continue;
/* Check collision with each triangle edge */
#ifndef _DEB_NEW_KDTREE_
foreach (SCollisionFace* Face, *TreeNodeData)
#else
foreach (SCollisionFace &NodeFace, *TreeNodeData)
#endif
{
#ifndef _DEB_NEW_KDTREE_
/* Check for unique usage */
if (EdgeFaceMap.find(Face) != EdgeFaceMap.end())
continue;
EdgeFaceMap[Face] = true;
#else
SCollisionFace* Face = &NodeFace;
#endif
/* Check for face-culling */
if (Face->isBackFaceCulling(CollFace, CapsuleLineInv))
continue;
/* Make capsule-triangle collision test */
const dim::triangle3df Triangle(RivalMat * Face->Triangle);
ClosestLine = math::CollisionLibrary::getClosestLine(Triangle, CapsuleLine);
/* Check if this is a potentially new closest face */
if (math::getDistanceSq(ClosestLine.Start, ClosestLine.End) < RadiusSq)
{
/* Perform detected collision contact */
SCollisionContact Contact;
{
Contact.Point = ClosestLine.Start;
Contact.Normal = ClosestLine.End;
Contact.Normal -= ClosestLine.Start;
Contact.Normal.normalize();
Contact.Impact = getRadius() - (ClosestLine.End - Contact.Point).getLength();
Contact.Triangle = Triangle;
Contact.Face = Face;
}
performDetectedContact(Rival, Contact);
if (getFlags() & COLLISIONFLAG_RESOLVE)
{
/* Update capsule position */
CapsuleLine = getLine();
CapsuleLineInv.Start = RivalMatInv * CapsuleLine.Start;
CapsuleLineInv.End = RivalMatInv * CapsuleLine.End;
}
}
}
}
}
bool CollisionCapsule::setupCollisionContact(
const dim::vector3df &PointP, const dim::vector3df &PointQ,
f32 MaxRadius, f32 RivalRadius, SCollisionContact &Contact) const
{
/* Compute normal and impact together to avoid calling square-root twice */
Contact.Normal = PointP;
Contact.Normal -= PointQ;
Contact.Impact = Contact.Normal.getLength();
if (Contact.Impact < math::ROUNDING_ERROR)
return false;
Contact.Normal *= (1.0f / Contact.Impact);
Contact.Impact = MaxRadius - Contact.Impact;
Contact.Point = Contact.Normal;
Contact.Point *= RivalRadius;
Contact.Point += PointQ;
return true;
}
} // /namespace scene
} // /namespace sp
// ================================================================================
| 32.66335 | 134 | 0.602 | rontrek |
2fb8c4642ad2dab5b8a8f68d75a5a15cd96318df | 2,357 | cpp | C++ | Game files/Algorithm1.cpp | morisscofield/Suicide_Checkers | 2f059b9ba32d8581bb77e1f313979d49ef72fd1d | [
"Apache-2.0"
] | null | null | null | Game files/Algorithm1.cpp | morisscofield/Suicide_Checkers | 2f059b9ba32d8581bb77e1f313979d49ef72fd1d | [
"Apache-2.0"
] | null | null | null | Game files/Algorithm1.cpp | morisscofield/Suicide_Checkers | 2f059b9ba32d8581bb77e1f313979d49ef72fd1d | [
"Apache-2.0"
] | null | null | null | #include "Algorithm1.h"
// Public methods
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool Algorithm1::can_move() const
{
vector<coordinates> movable = _calculate.movable_pieces();
if (movable.empty() == true)
return false;
return true;
}
bool Algorithm1::can_capture() const
{
vector<coordinates> attack = _calculate.attack_pieces();
if (attack.empty() == true)
return false;
return true;
}
vector<coordinates> Algorithm1::latest_move() const
{
return _move;
}
int Algorithm1::pieces_left() const
{
return _calculate.pieces_left();
}
void Algorithm1::capture()
{
vector<coordinates> pieces = _calculate.attack_pieces(); // Calculate which pieces can attack
// Cycle through available pieces and pick one
int choice = _counter % pieces.size();
coordinates piece = pieces.at(choice);
// Calculate what moves are available
vector<coordinates> moves = _calculate.possible_attack_moves(piece);
// Pick a move based on the position of the counter
choice = _counter % moves.size();
coordinates jump = moves.at(choice);
// Make the move
_board->move_player2_piece(piece, jump);
// Remove the opponent's piece from the board
coordinates opponent = _calculate.vulnerable_position(piece, jump);
_board->remove_player1_piece(opponent);
// Increment the counter for the next move
_counter++;
// Store the latest move made
_move.clear();
_move.push_back(piece);
_move.push_back(jump);
_move.push_back(opponent);
}
void Algorithm1::move()
{
vector<coordinates> pieces = _calculate.movable_pieces(); // Calculate which pieces can be moved
// Cycle through available pieces and pick one
int choice = _counter % pieces.size();
coordinates piece = pieces.at(choice);
// Calculate what moves are available
vector<coordinates> moves = _calculate.possible_empty_moves(piece);
// Pick a move based on the position of the counter
choice = _counter % moves.size();
coordinates move = moves.at(choice);
// Make the move
_board->move_player2_piece(piece, move);
// Increment the counter for the next move
_counter++;
// Store the latest move made
_move.clear();
_move.push_back(piece);
_move.push_back(move);
} | 25.344086 | 151 | 0.661434 | morisscofield |
2fc40702519049e0224042135223e111a2ce32a8 | 704 | cpp | C++ | #1006 Sign In and Sign Out .cpp | ZachVec/PAT-Advanced | 52ba5989c095ddbee3c297e82a4b3d0d2e0cd449 | [
"MIT"
] | 1 | 2021-12-26T08:34:47.000Z | 2021-12-26T08:34:47.000Z | #1006 Sign In and Sign Out .cpp | ZachVec/PAT-Advanced | 52ba5989c095ddbee3c297e82a4b3d0d2e0cd449 | [
"MIT"
] | null | null | null | #1006 Sign In and Sign Out .cpp | ZachVec/PAT-Advanced | 52ba5989c095ddbee3c297e82a4b3d0d2e0cd449 | [
"MIT"
] | null | null | null | #include <iostream>
using namespace std;
int main() {
size_t n, t1 = (size_t)(-1), t2 = 0;
string in, out, temp;
if(scanf("%zu", &n) == EOF) return 0;
for(size_t i = 0, t, h, m, s; i < n; ++i) {
cin >> temp;
scanf("%zu:%zu:%zu", &h, &m, &s);
if((t = h * 3600 + m * 60 + s) < t1) {
t1 = t;
in = temp;
}
scanf("%zu:%zu:%zu", &h, &m, &s);
if((t = h * 3600 + m * 60 + s) > t2) {
t2 = t;
out = temp;
}
}
printf("%s %s\n", in.c_str(), out.c_str());
return 0;
}
/* input
3
CS301111 15:30:28 17:00:10
SC3021234 08:00:00 11:25:25
CS301133 21:45:00 21:58:40
SC3021234 CS301133
*/ | 22 | 47 | 0.4375 | ZachVec |
7c7c6a3e81d20d6db294fbc3b3efd29a099d3bd2 | 670 | hpp | C++ | src/io.hpp | davidstraka2/gamebook-engine | 53fa8d825a056e28ddd90e718af73ab691019fe5 | [
"MIT"
] | null | null | null | src/io.hpp | davidstraka2/gamebook-engine | 53fa8d825a056e28ddd90e718af73ab691019fe5 | [
"MIT"
] | null | null | null | src/io.hpp | davidstraka2/gamebook-engine | 53fa8d825a056e28ddd90e718af73ab691019fe5 | [
"MIT"
] | null | null | null | #pragma once
#include <string>
#include <vector>
namespace io {
/**
* Have user choose from a list of options
*
* @return Index of chosen option in list
*/
int choose(const std::vector<std::string>& options);
/** Finalize curses */
void finCurses();
/** Initialize curses */
void initCurses();
/**
* Ask user for input
*
* @param[in] output This will be written to the left of input field
* @param[out] input User input
*/
void prompt(const std::string& output, std::string& input);
/** Print text to console and wait for any key press */
void tell(const std::string& text);
}
| 21.612903 | 72 | 0.601493 | davidstraka2 |
7c835a7b92393af44f07dda02187705dea54a191 | 204 | cpp | C++ | stm32/Core/Src/RadioConfig/radio_config_c2_64_32.cpp | tk20dk/garfield | b2602125c80d024cd55f1d25f3c9bf56067aba05 | [
"MIT"
] | null | null | null | stm32/Core/Src/RadioConfig/radio_config_c2_64_32.cpp | tk20dk/garfield | b2602125c80d024cd55f1d25f3c9bf56067aba05 | [
"MIT"
] | null | null | null | stm32/Core/Src/RadioConfig/radio_config_c2_64_32.cpp | tk20dk/garfield | b2602125c80d024cd55f1d25f3c9bf56067aba05 | [
"MIT"
] | null | null | null | #include <stdint.h>
#include "RadioConfig/radio_config_c2_64_32.h"
uint8_t const RADIO__CONFIG_C2_64_32[] = RADIO_CONFIGURATION_DATA_ARRAY;
uint8_t const *RADIO_CONFIG_C2_64_32 = RADIO__CONFIG_C2_64_32;
| 34 | 72 | 0.848039 | tk20dk |
7c8e85e1de525a9d79b597fb774df78e132e0c9e | 490 | hxx | C++ | src/mod/pub/demo/gl-frag-shader-demo/mod-gl-frag-shader-demo.hxx | indigoabstract/appplex | 83c3b903db6c6ea83690ccffbd533ff6ab01d246 | [
"MIT"
] | 1 | 2017-12-26T14:29:37.000Z | 2017-12-26T14:29:37.000Z | src/mod/pub/demo/gl-frag-shader-demo/mod-gl-frag-shader-demo.hxx | indigoabstract/appplex | 83c3b903db6c6ea83690ccffbd533ff6ab01d246 | [
"MIT"
] | null | null | null | src/mod/pub/demo/gl-frag-shader-demo/mod-gl-frag-shader-demo.hxx | indigoabstract/appplex | 83c3b903db6c6ea83690ccffbd533ff6ab01d246 | [
"MIT"
] | null | null | null | #pragma once
#include "appplex-conf.hxx"
#ifdef MOD_GL_FRAG_SHADER_DEMO
#include "mws-mod.hxx"
class mod_gl_frag_shader_demo_impl;
class mod_gl_frag_shader_demo_page;
class mod_gl_frag_shader_demo : public mws_mod
{
public:
static mws_sp<mod_gl_frag_shader_demo> nwi();
virtual void init();
virtual void build_sws();
virtual void load();
private:
mod_gl_frag_shader_demo();
mws_sp<mod_gl_frag_shader_demo_impl> p;
friend class mod_gl_frag_shader_demo_page;
};
#endif
| 16.333333 | 46 | 0.785714 | indigoabstract |
7ca2edc706e3f9101e9f413ff912cd851a79facb | 388 | cc | C++ | net/socket/unix_domain_socket.cc | mayah/base | aec046929938d2aaebaadce5c5abb58b5cf342b4 | [
"MIT"
] | 115 | 2015-02-21T15:08:26.000Z | 2022-02-05T01:38:10.000Z | net/socket/unix_domain_socket.cc | mayah/base | aec046929938d2aaebaadce5c5abb58b5cf342b4 | [
"MIT"
] | 214 | 2015-01-16T04:53:35.000Z | 2019-03-23T11:39:59.000Z | net/socket/unix_domain_socket.cc | mayah/base | aec046929938d2aaebaadce5c5abb58b5cf342b4 | [
"MIT"
] | 56 | 2015-01-16T05:14:13.000Z | 2020-09-22T07:22:49.000Z | #include "net/socket/unix_domain_socket.h"
#include <utility>
namespace net {
UnixDomainSocket::UnixDomainSocket(UnixDomainSocket&& socket) noexcept :
Socket(std::move(socket))
{
}
UnixDomainSocket::~UnixDomainSocket()
{
}
UnixDomainSocket& UnixDomainSocket::operator=(UnixDomainSocket&& socket) noexcept
{
std::swap(sd_, socket.sd_);
return *this;
}
} // namespace net
| 16.869565 | 81 | 0.734536 | mayah |
7ca6cf8f8c8509a7cd0a4ec6ee70327bd7865f5a | 2,937 | cpp | C++ | lib/cpptest-lite/src/TextOutput.cpp | Kaayy-J/OHMComm-Light | 08a67e20da3369d199a285071105404daeb33d6c | [
"MIT"
] | null | null | null | lib/cpptest-lite/src/TextOutput.cpp | Kaayy-J/OHMComm-Light | 08a67e20da3369d199a285071105404daeb33d6c | [
"MIT"
] | 1 | 2016-01-31T16:12:10.000Z | 2016-01-31T16:12:10.000Z | lib/cpptest-lite/src/TextOutput.cpp | Kaayy-J/OHMComm | 08a67e20da3369d199a285071105404daeb33d6c | [
"MIT"
] | null | null | null | /*
* File: TextOutput.cpp
* Author: daniel
*
* Created on September 11, 2015, 7:07 PM
*/
#include "TextOutput.h"
#include <iostream>
#include <string.h>
#include <errno.h>
using namespace Test;
TextOutput::TextOutput(const unsigned int mode) : TextOutput(mode, std::cout)
{ }
TextOutput::TextOutput(const unsigned int mode, std::ostream& stream) : Output(), mode(mode), stream(stream)
{ }
TextOutput::~TextOutput()
{
stream.flush();
}
void TextOutput::initializeSuite(const std::string& suiteName, const unsigned int numTests)
{
if(mode <= Verbose)
stream << "Running suite '" << suiteName << "' with " << numTests << " tests..." << std::endl;
}
void TextOutput::finishSuite(const std::string& suiteName, const unsigned int numTests, const unsigned int numPositiveTests, const std::chrono::microseconds totalDuration)
{
if(mode <= Verbose || numTests != numPositiveTests)
stream << "Suite '" << suiteName << "' finished, " << numPositiveTests << '/' << numTests << " successful (" << prettifyPercentage(numPositiveTests, numTests) << "%) in " << totalDuration.count() << " microseconds (" << totalDuration.count()/1000.0 << " ms)." << std::endl;
}
void TextOutput::initializeTestMethod(const std::string& suiteName, const std::string& methodName, const std::string& argString)
{
if(mode <= Debug)
stream << "Running method '" << methodName << "'" << (argString.empty() ? "" : "with argument: ") << argString << "..." << std::endl;;
}
void TextOutput::finishTestMethod(const std::string& suiteName, const std::string& methodName, const bool withSuccess)
{
if(mode <= Debug || (mode <= Verbose && !withSuccess))
stream << "Test-method '" << methodName << "' finished with " << (withSuccess ? "success!" : "errors!") << std::endl;
}
void TextOutput::printSuccess(const Assertion& assertion)
{
if(mode <= Debug)
stream << "Test '" << assertion.method << "' line " << assertion.lineNumber << " successful!" << std::endl;
}
void TextOutput::printFailure(const Assertion& assertion)
{
stream << "Test '" << assertion.method << "' failed!" << std::endl;
stream << "\tSuite: " << assertion.suite << std::endl;
stream << "\tFile: " << Private::getFileName(assertion.file) << std::endl;
stream << "\tLine: " << assertion.lineNumber << std::endl;
if(!assertion.errorMessage.empty())
stream << "\tFailure: " << assertion.errorMessage << std::endl;
if(!assertion.userMessage.empty())
stream << "\tMessage: " << assertion.userMessage << std::endl;
}
void TextOutput::printException(const std::string& suiteName, const std::string& methodName, const std::exception& ex)
{
stream << "Test-method '" << methodName << "' failed with exception!" << std::endl;
stream << "\tException: " << ex.what() << std::endl;
stream << "\tErrno: " << errno << std::endl;
stream << "\tError: " << strerror(errno) << std::endl;
}
| 37.177215 | 277 | 0.64113 | Kaayy-J |
7cb3c971694646e9bda191fd319f85d87787ed07 | 3,050 | cpp | C++ | app/PluginManager.cpp | ospray/ospray_studio | 1549ac72c7c561b4aafdea976189bbe95bd32ff2 | [
"Apache-2.0"
] | 52 | 2018-10-09T23:56:32.000Z | 2022-03-25T09:27:40.000Z | app/PluginManager.cpp | ospray/ospray_studio | 1549ac72c7c561b4aafdea976189bbe95bd32ff2 | [
"Apache-2.0"
] | 11 | 2018-11-19T18:51:47.000Z | 2022-03-28T14:03:57.000Z | app/PluginManager.cpp | ospray/ospray_studio | 1549ac72c7c561b4aafdea976189bbe95bd32ff2 | [
"Apache-2.0"
] | 8 | 2019-02-10T00:16:24.000Z | 2022-02-17T19:50:15.000Z | // Copyright 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "PluginManager.h"
#include <iterator>
void PluginManager::loadPlugin(const std::string &name)
{
std::cout << "...attempting to load plugin '" << name << "'\n";
std::string libName = "ospray_studio_plugin_" + name;
try {
rkcommon::loadLibrary(libName, false);
} catch (std::runtime_error &e) {
std::cout << "...failed to load plugin '" << name << "'!"
<< " (plugin was not found). Please verify the name of the plugin"
<< " is correct and that it is on your LD_LIBRARY_PATH."
<< e.what() << std::endl;
return;
}
std::string initSymName = "init_plugin_" + name;
void *initSym = rkcommon::getSymbol(initSymName);
if (!initSym) {
std::cout << "...failed to load plugin, could not find init function!\n";
return;
}
Plugin *(*initMethod)() = (Plugin * (*)()) initSym;
try {
auto pluginInstance =
std::unique_ptr<Plugin>(static_cast<Plugin *>(initMethod()));
addPlugin(std::move(pluginInstance));
} catch (const std::exception &e) {
std::cout << "...failed to initialize plugin '" << name << "'!\n";
std::cout << " " << e.what() << std::endl;
} catch (...) {
std::cout << "...failed to initialize plugin '" << name << "'!\n";
}
}
void PluginManager::addPlugin(std::unique_ptr<Plugin> plugin)
{
plugins.emplace_back(LoadedPlugin{std::move(plugin), true});
}
void PluginManager::removePlugin(const std::string &name)
{
plugins.erase(std::remove_if(plugins.begin(), plugins.end(), [&](auto &p) {
return p.instance->name() == name;
}));
}
void PluginManager::removeAllPlugins()
{
plugins.clear();
}
bool PluginManager::hasPlugin(const std::string &pluginName)
{
for (auto &p : plugins)
if (p.instance->name() == pluginName)
return true;
return false;
}
LoadedPlugin* PluginManager::getPlugin(std::string &pluginName)
{
for (auto &l : plugins)
if (l.instance->name() == pluginName)
return &l;
return nullptr;
}
void PluginManager::main(
std::shared_ptr<StudioContext> ctx, PanelList *allPanels) const
{
if (!plugins.empty())
for (auto &plugin : plugins) {
plugin.instance->mainMethod(ctx);
if (!plugin.instance->panels.empty() && allPanels) {
auto &pluginPanels = plugin.instance->panels;
std::move(pluginPanels.begin(),
pluginPanels.end(),
std::back_inserter(*allPanels));
}
}
}
void PluginManager::mainPlugin(std::shared_ptr<StudioContext> ctx,
std::string &pluginName,
PanelList *allPanels) const
{
if (!plugins.empty())
for (auto &plugin : plugins) {
if (plugin.instance->name() == pluginName) {
plugin.instance->mainMethod(ctx);
if (!plugin.instance->panels.empty() && allPanels) {
auto &pluginPanels = plugin.instance->panels;
std::move(pluginPanels.begin(),
pluginPanels.end(),
std::back_inserter(*allPanels));
}
}
}
}
| 27.981651 | 80 | 0.615738 | ospray |
7cb7021c2d107fcd32e181297eade1899e8b0b5a | 33,314 | cpp | C++ | day24/main.cpp | kjelloh/advent_of_code_2021 | 656c26a418a4b379ef48a45ac6ffd978c17a744f | [
"CC0-1.0"
] | null | null | null | day24/main.cpp | kjelloh/advent_of_code_2021 | 656c26a418a4b379ef48a45ac6ffd978c17a744f | [
"CC0-1.0"
] | null | null | null | day24/main.cpp | kjelloh/advent_of_code_2021 | 656c26a418a4b379ef48a45ac6ffd978c17a744f | [
"CC0-1.0"
] | null | null | null | #include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>
#include <variant>
#include <optional>
#include <ranges>
#include <unordered_set>
#include <unordered_map>
extern std::vector<std::string> pData;
using Result = std::string;
using Answers = std::vector<std::pair<std::string,Result>>;
/*
inp a - Read an input value and write it to variable a.
add a b - Add the value of a to the value of b, then store the result in variable a.
mul a b - Multiply the value of a by the value of b, then store the result in variable a.
div a b - Divide the value of a by the value of b, truncate the result to an integer, then store the result in variable a. (Here, "truncate" means to round the value toward zero.)
mod a b - Divide the value of a by the value of b, then store the remainder in variable a. (This is also called the modulo operation.)
eql a b - If the value of a and b are equal, then store the value 1 in variable a. Otherwise, store the value 0 in variable a.
*/
enum Operation {
op_unknown
,op_inp
,op_add
,op_mul
,op_div
,op_mod
,op_eql
,op_undefined
};
using Operand = std::variant<char,int>;
using Operands = std::vector<Operand>;
std::optional<Operand> to_operand(std::string const& s) {
try {
return std::stoi(s);
}
catch (std::exception const& e) {}
if (s.size()==1) return s[0];
else return std::nullopt;
}
std::string to_string(Operation const& op) {
switch (op) {
case op_inp: return "inp";
case op_add: return "add";
case op_mul: return "mul";
case op_div: return "div";
case op_mod: return "mod";
case op_eql: return "eql";
default: return std::string{"op ?? "} + std::to_string(static_cast<int>(op));
}
}
template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
std::string to_string(Operand const& opr) {
std::string result{};
std::visit(overloaded {
[&result](char arg) { result = arg;}
,[&result](int arg) { result = std::to_string(arg);}
}, opr);
return result;
}
class Statement {
public:
Statement(std::string const& sOp,std::string const& sopr1,std::string const& sopr2) {
this->m_op = op_undefined;
bool done{false};
for (int op = op_unknown;op<op_undefined;op++) {
switch (op) {
case op_inp: done = (sOp=="inp"); break;
case op_add: done = (sOp=="add"); break;
case op_mul: done = (sOp=="mul"); break;
case op_div: done = (sOp=="div"); break;
case op_mod: done = (sOp=="mod"); break;
case op_eql: done = (sOp=="eql"); break;
}
if (done) {
m_op = static_cast<Operation>(op);
break;
}
}
if (auto opr = to_operand(sopr1);opr) m_operands.push_back(*opr);
if (auto opr = to_operand(sopr2);opr) m_operands.push_back(*opr);
}
Operation const& op() const {return m_op;}
Operands const& operands() const {return m_operands;}
private:
Operation m_op;
Operands m_operands;
};
using Program = std::vector<Statement>;
using Model = Program;
using Environment = std::map<char,int>;
// custom specialization of std::hash for Environment injected into namespace std
template<>
struct std::hash<Environment>
{
std::size_t operator()(Environment const& env) const noexcept
{
std::size_t result;
for (auto const me : env) {
result ^= std::hash<char>{}(me.first);
result ^= std::hash<int>{}(me.second);
}
return result;
}
};
// custom specialization of std::hash for std::pair<int,size_t> injected into namespace std
template<>
struct std::hash<std::pair<int,size_t>>
{
std::size_t operator()(std::pair<int,size_t> const& pair) const noexcept
{
std::size_t result;
result ^= std::hash<int>{}(pair.first);
result ^= std::hash<int>{}(pair.second);
return result;
}
};
std::string to_string(Environment const& env) {
std::ostringstream os{};
os << "<environment>";
for (auto const me : env) {
os << " " << me.first << " = " << me.second;
}
return os.str();
}
class ALU {
public:
ALU(std::istream& in) : m_in{in} {}
ALU& execute(Program const& program,bool verbose=false) {
for (auto const& statement : program) {
// log
if (verbose){
std::cout << "\nexecute: "
<< to_string(statement.op()) << "|"
<< to_string(statement.operands()[0]);
if (statement.operands().size()>1) std::cout << "|" << to_string(statement.operands()[1]);
}
char a = std::get<char>(statement.operands()[0]);
int b;
if (statement.operands().size()==2) {
std::visit(overloaded {
[this,&b](char arg) {b = this->environment()[arg];}
,[this,&b](int arg) { b = arg;}
}, statement.operands()[1]);
}
switch (statement.op()) {
case op_inp: {
int b;
if (verbose) std::cout << " >";
if (m_in >> b) {
m_environment[a] = b;
}
else {
std::cout << " ERROR: insufficient input";
}
} break;
case op_add: {
m_environment[a] += b;
} break;
case op_mul: {
m_environment[a] *= b;
} break;
case op_div: {
m_environment[a] /= b;
} break;
case op_mod: {
m_environment[a] %= b;
} break;
case op_eql: {
int val_a = m_environment[a];
m_environment[a] = (val_a==b)?1:0;
} break;
}
if (verbose) std::cout << "\t" << a << " = " << m_environment[a];
}
if (verbose) std::cout << "\n" << this->env_dump();
return *this;
}
std::string env_dump() {
return to_string(m_environment);
}
Environment& environment() {return m_environment;}
private:
std::istream& m_in;
Environment m_environment;
};
std::pair<std::string,std::string> split(std::string const& token,std::string const& delim) {
auto pos = token.find(delim);
auto left = token.substr(0,pos);
auto right = token.substr(pos+delim.size());
if (pos == std::string::npos) return {left,""};
else return {left,right};
}
Model parse(auto& in) {
Model result{};
std::string line{};
while (std::getline(in,line)) {
auto [sOp,sOperands] = split(line," ");
// std::cout << "\n" << sOp << " | " << sOperands;
auto [sopr1,sopr2] = split(sOperands," ");
// std::cout << "\n[" << sOp << "|" << sopr1 << "|" << sopr2 << "]";
Statement statement{sOp,sopr1,sopr2};
result.push_back(statement);
}
return result;
}
// Memoize on visitied state {digit index 13..0 int, z so far size_t} mapped to best digit string from here to z=0
// Use std::optional for the result to handle that there may be NO passable digits from current state
using Visited = std::unordered_map<std::pair<int,size_t>,std::optional<std::string>>;
std::optional<std::string> best_digits(bool part1, int ix,std::vector<Program> const& snippets,size_t z,Visited& visited) {
// Get the best digits i..0 for z so far
// Init with ix=13, z=0
// Expands to ix=12, z= one for each digit 13 '9','8',...
// Victory if ix==0 and next z for a digit == 0 ==> return the victory digit
static int call_count{0};
call_count++;
// Log
{
if (ix>10) std::cout << "\n" << call_count << " " << ix << " " << visited.size() << " " << z;
}
if (ix<0) return std::nullopt; // Give up
else if (visited.find({ix,z}) != visited.end()) return visited[{ix,z}];
else {
// Not memoized - run program for step 13-ix (step 13 for digit index 0 = last one)
static auto base_digits_1 = {'9','8','7','6','5','4','3','2','1'}; // Search high to low
static auto base_digits_2 = {'1','2','3','4','5','6','7','8','9'}; // Search low to high
auto& digits = base_digits_1;
if (!part1) digits = base_digits_2; // search low to high
for (char digit : digits) {
std::string input{digit};
std::istringstream d_in{input};
ALU alu{d_in};
alu.environment()['z'] = z; // Run with provided in z
alu.execute(snippets[13-ix]);
auto next_z = alu.environment()['z']; // Get next z
if (ix==0 and next_z==0) return std::string{digit}; // VICTORY
else {
// pass the new z along down the chain unless we are done
auto result = best_digits(part1,ix-1,snippets,next_z,visited); // Recurse down
visited[{ix-1,next_z}] = result; // Memoize best digit down from this state
if (result) return std::string{digit} + result.value();
else continue; // Try next digit
}
}
}
return std::nullopt;
}
namespace part1 {
// Contains different investigate code (impl last in this sorurce file)
void investigate(std::string const& sData);
Result solve_for(std::string const& sData, std::string sIn) {
std::cout << "\nsolve_for in: " << sIn;
Result result{};
std::stringstream in{ sData };
auto program = parse(in);
if (sIn == "REPL") {
// Provide user with a REPL :)
bool done{false};
size_t call_count{0};
do {
std::cout << "\nNOMAD>";
ALU alu{std::cin};
alu.execute(program);
std::cout << "\n" << alu.env_dump();
int z = alu.environment()['z'];
done = (z == 0);
call_count++;
} while (!done);
}
else if (sIn.size()>0) {
// compute Test data
std::istringstream d_in{sIn};
ALU alu{d_in};
bool verbose=true;
alu.execute(program,verbose);
result = to_string(alu.environment());
}
else {
// Split the program into snippets for each digit processing
std::vector<Program> snippets{};
for (auto const& statement : program) {
if (statement.op() == op_inp) snippets.push_back({});
snippets.back().push_back(statement);
}
std::cout << "\nsnippets count " << snippets.size();
Visited visited{};
bool part1=true;
auto opt_result = best_digits(part1,13,snippets,0,visited); // Get the best digits 13..0 for z=0 so far
if (opt_result) result = opt_result.value();
else result = "FAILED";
}
return result;
}
}
namespace part2 {
Result solve_for(std::string const sData) {
Result result{};
std::stringstream in{ sData };
auto program = parse(in);
// Split the program into snippets for each digit processing
std::vector<Program> snippets{};
for (auto const& statement : program) {
if (statement.op() == op_inp) snippets.push_back({});
snippets.back().push_back(statement);
}
std::cout << "\nsnippets count " << snippets.size();
Visited visited{};
bool part1=false;
auto opt_result = best_digits(part1,13,snippets,0,visited); // Get the best digits 13..0 for z=0 so far
if (opt_result) result = opt_result.value();
else result = "FAILED";
return result;
}
}
int main(int argc, char *argv[])
{
Answers answers{};
answers.push_back({"Part 1 Test 0",part1::solve_for(pData[0],"-17")});
answers.push_back({"Part 1 Test 1",part1::solve_for(pData[1],"3 9")});
answers.push_back({"Part 1 Test 2",part1::solve_for(pData[2],"10")});
// I interpreted the program and...
// Each digit is processed by the program so that z(i+1) = 0 for w(i) = z(i)%26 + N(i)
// So if we identify N(i) in the program for each step and enters them for input
// we actually get a z=0. They are: 11 13 11 10 -3 -4 12 -8 -3 -12 14 -6 11 -12
// BUT - This is of course invalid as the actual input must be digits 1..9
// ==> Can we use this knowledge somehow though?
answers.push_back({"Part 1 Test 3",part1::solve_for(pData[3],"11 13 11 10 -3 -4 12 -8 -3 -12 14 -6 11 -12")});
// part1::investigate(pData[3]); // Activate appropriate part in "investigate" to see my try to understand this problem
// answers.push_back({"Part 1 ",part1::solve_for(pData[3],"REPL")}); // A REPL to try different NOMAD inputs (ctrl-c to end)
answers.push_back({"Part 1 ",part1::solve_for(pData[3],"")});
answers.push_back({"Part 2 ",part2::solve_for(pData[3])});
for (auto const& answer : answers) {
std::cout << "\nanswer[" << answer.first << "] : " << answer.second;
}
// std::cout << "\nPress <enter>...";
// std::cin.get();
std::cout << "\n";
return 0;
}
std::vector<std::string> pData{
R"(inp x
mul x -1)"
,R"(inp z
inp x
mul z 3
eql z x)"
,R"(inp w
add z w
mod z 2
div w 2
add y w
mod y 2
div w 2
add x w
mod x 2
div w 2
mod w 2)"
,R"(inp w
mul x 0
add x z
mod x 26
div z 1
add x 11
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 14
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 1
add x 13
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 8
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 1
add x 11
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 4
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 1
add x 10
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 10
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 26
add x -3
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 14
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 26
add x -4
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 10
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 1
add x 12
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 4
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 26
add x -8
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 14
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 26
add x -3
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 1
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 26
add x -12
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 6
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 1
add x 14
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 0
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 26
add x -6
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 9
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 1
add x 11
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 13
mul y x
add z y
inp w
mul x 0
add x z
mod x 26
div z 26
add x -12
eql x w
eql x 0
mul y 0
add y 25
mul y x
add y 1
mul z y
mul y 0
add y w
add y 12
mul y x
add z y)"
};
// custom specialization of std::hash for std::tuple<int,char,Environment> injected into namespace std
template<>
struct std::hash<std::tuple<int,char,Environment>>
{
std::size_t operator()(std::tuple<int,char,Environment> const& triad) const noexcept
{
std::size_t result;
result ^= std::hash<int>{}(std::get<int>(triad));
result ^= std::hash<int>{}(std::get<char>(triad));
for (auto const me : std::get<Environment>(triad)) {
result ^= std::hash<char>{}(me.first);
result ^= std::hash<int>{}(me.second);
}
return result;
}
};
// NOT part of the solution (kept for historical reasons...)
// See solutions in main() above
namespace part1 {
void investigate(std::string const& sData) {
std::stringstream in{ sData };
auto program = parse(in);
// Observation: The program reads one digit input at a time and performs
// a set of computations on that input before reading and processing the next digit.
// Split the program into snippets for each digit processing
std::vector<Program> snippets{};
for (auto const& statement : program) {
if (statement.op() == op_inp) snippets.push_back({});
snippets.back().push_back(statement);
}
std::cout << "\nsnippets count " << snippets.size();
// 1. What are the possible program states after the first digit processing?
if (false) {
std::vector<Environment> envs{};
for (char digit : {'9','8','7','6','5','4','3','2','1'}) {
// Run the program from the start state with the digit and store the resulting state
std::string input{digit};
std::istringstream d_in{input};
// Run snippet[0]
ALU alu{d_in};
alu.execute(snippets[0]);
envs.push_back(alu.environment());
}
// Log
{
std::cout << "\n<possible states after first digit>";
for (auto const& env : envs) std::cout << "\n" << to_string(env);
}
}
// 2. What possible states after each step (if we run each step/snippet in isolation)
if (false) {
std::vector<std::tuple<int,char,Environment>> envs{};
for (int i=0;i<14;i++) {
for (char digit : {'9','8','7','6','5','4','3','2','1'}) {
// Run the program from the start state with the digit and store the resulting state
std::string input{digit};
std::istringstream d_in{input};
// Run snippet[0]
ALU alu{d_in};
alu.execute(snippets[i]);
envs.push_back({i,digit,alu.environment()});
}
}
// Log
{
std::cout << "\n<possible states after each snippet in isolation per digit>";
for (auto const& tripple : envs) std::cout
<< "\n"
<< std::get<int>(tripple)
<< " " << std::get<char>(tripple)
<< " " << to_string(std::get<Environment>(tripple));
}
}
// 3. How does each step/snippet process a large input z?
if (false) {
std::vector<std::tuple<int,char,Environment>> envs{};
for (int i=0;i<14;i++) {
for (char digit : {'9','8','7','6','5','4','3','2','1'}) {
// Run the program from the start state with the digit and store the resulting state
std::string input{digit};
std::istringstream d_in{input};
// Run snippet[0]
ALU alu{d_in};
// alu.environment()['z'] = 1000000; // large z
alu.environment()['z'] = 10000000; // even largee z
alu.execute(snippets[i]);
envs.push_back({i,digit,alu.environment()});
}
}
// Log
{
std::cout << "\n<possible states after each snippet in isolation per digit for LARGE in-z>";
for (auto const& tripple : envs) std::cout
<< "\n"
<< std::get<int>(tripple)
<< " " << std::get<char>(tripple)
<< " " << to_string(std::get<Environment>(tripple));
/*
These steps drastically reduced z
4 7 <environment> w = 7 x = 0 y = 0 z = 384615
5 6 <environment> w = 6 x = 0 y = 0 z = 384615
7 2 <environment> w = 2 x = 0 y = 0 z = 384615
8 7 <environment> w = 7 x = 0 y = 0 z = 384615
11 4 <environment> w = 4 x = 0 y = 0 z = 384615
==> Seems we MUST choose
digit 4 = '7'
digit 5 = '6'
digit 7 = '2'
digit 8 = '7'
digit 11 = '4'
to have any chance of reducing z down to 0?
These steps also reduced z, although just a little bit
9 3 <environment> w = 3 x = 1 y = 9 z = 9999999
9 2 <environment> w = 2 x = 1 y = 8 z = 9999998
9 1 <environment> w = 1 x = 1 y = 7 z = 9999997
This step increased z very little
13 1 <environment> w = 1 x = 1 y = 13 z = 10000003
Lowest increase for the really bad steps
0 1 <environment> w = 1 x = 1 y = 15 z = 260000015
1 1 <environment> w = 1 x = 1 y = 9 z = 260000009
2 1 <environment> w = 1 x = 1 y = 5 z = 260000005
3 1 <environment> w = 1 x = 1 y = 11 z = 260000011
6 1 <environment> w = 1 x = 1 y = 5 z = 260000005
10 1 <environment> w = 1 x = 1 y = 1 z = 260000001
12 1 <environment> w = 1 x = 1 y = 14 z = 260000014
Speculation: The digits affects z very bad to very kindly in the following way
digit z affect
0 BAD
1 BAD
2 BAD
3 BAD
4 '7' good
5 '6' good
6 BAD
7 '2' good
8 '7' good
9 kind. '3','2','1' reduces z a little
10 BAD
11 '4' good
12 BAD
13 kind. all increase z but a small amount
We have 7 very BAD digits.
We have 2 kind digits
We have 5 fixed digits!
[Future me] For my input...
max monad: 74929995999389
min monad: 11118151637112
==> So - Nope, We do NOT need to fix those digits...
(Brute force with memoisation was the way to go)
*/
}
}
// 4. Lets try the whole program for all possible BAD digits
// with 4,5,7,8,11 fixated
// 9 set to the kind '1' and 13 to the kind '1'
// NOMAD = NNNN76N271N4N1 where N is '9' for this test
if (false) {
//NOMAD = xNNN76N271N4N1 where N is '9' for this test
std::string nomad="9 9 9 9 7 6 9 2 7 1 9 4 9 1";
std::vector<std::tuple<int,char,Environment>> envs{};
for (int i : {0,1,2,3,6,10,12}) {
for (char digit : {'9','8','7','6','5','4','3','2','1'}) {
// Run the program from the start state with the digit and store the resulting state
nomad[2*i] = digit;
std::string input{nomad};
std::istringstream d_in{input};
ALU alu{d_in};
alu.execute(program);
envs.push_back({i,digit,alu.environment()});
}
}
// Log
{
std::cout << "\n<possible states after each nomad xNNN76N271N4N1 (x='1'..'9'";
for (auto const& tripple : envs) std::cout
<< "\n"
<< std::get<int>(tripple)
<< " " << std::get<char>(tripple)
<< " " << to_string(std::get<Environment>(tripple));
/*
Ok, quite unconclosive but for digit 0 where we can control z to both negative and positive!
0 9 <environment> w = 1 x = 1 y = 13 z = -1276661321
0 8 <environment> w = 1 x = 1 y = 13 z = -1585577097
0 7 <environment> w = 1 x = 1 y = 13 z = -1894492873
0 6 <environment> w = 1 x = 1 y = 13 z = 2091558625
0 5 <environment> w = 1 x = 1 y = 13 z = 1782642849
0 4 <environment> w = 1 x = 1 y = 13 z = 1473727073
0 3 <environment> w = 1 x = 1 y = 13 z = 1164811297
0 2 <environment> w = 1 x = 1 y = 13 z = 855895521
0 1 <environment> w = 1 x = 1 y = 13 z = 546979745
*/
}
}
// What can we learn by brute force the 7 BAD digits?
// If we store the environmet after each step we can get a grasp of the search space?
if (false) {
// Brute force digit with index {0,1,2,3,6,10,12}
std::unordered_set<Environment> visited{};
size_t call_count{0};
std::string nomad="9 9 9 9 7 6 9 2 7 1 9 4 9 1";
for (auto i0 : {1,2,3,4,5,6,7,8,9}) {
for (auto i1 : {1,2,3,4,5,6,7,8,9}) {
for (auto i2 : {1,2,3,4,5,6,7,8,9}) {
for (auto i3 : {1,2,3,4,5,6,7,8,9}) {
for (auto i6 : {1,2,3,4,5,6,7,8,9}) {
for (auto i10 : {1,2,3,4,5,6,7,8,9}) {
for (auto i12 : {1,2,3,4,5,6,7,8,9}) {
++call_count;
nomad[0] = '0'+i0;
nomad[2] = '0'+i1;
nomad[4] = '0'+i2;
nomad[6] = '0'+i3;
nomad[12] = '0'+i6;
nomad[20] = '0'+i10;
nomad[24] = '0'+i12;
std::string input{nomad};
std::istringstream d_in{input};
ALU alu{d_in};
alu.execute(program);
visited.insert(alu.environment());
if (call_count%10000==0) std::cout << "\n" << call_count << std::flush;
}
}
}
}
}
}
}
// Log
{
std::cout << "\n" << call_count << std::flush;
std::cout << "\n" << visited.size();
// 2187 unique states only! (Should be correct even with a sloppy hash function)?
// Note: I implemented a quick-and-dirty hash function for Envronment.
// But the unordered set should still keep track if unique elements
// even if the hash but them in buckets defined by the same hash?
}
}
// What can we learn by brute force the 7 BAD digits and map the environment to the tested nomad?
if (false) {
// Brute force BAD digits,i.e., those with index {0,1,2,3,6,10,12}
std::unordered_map<Environment,std::string> visited{};
size_t call_count{0};
std::string nomad="9 9 9 9 7 6 9 2 7 1 9 4 9 1";
for (auto i0 : {1,2,3,4,5,6,7,8,9}) {
for (auto i1 : {1,2,3,4,5,6,7,8,9}) {
for (auto i2 : {1,2,3,4,5,6,7,8,9}) {
for (auto i3 : {1,2,3,4,5,6,7,8,9}) {
for (auto i6 : {1,2,3,4,5,6,7,8,9}) {
for (auto i10 : {1,2,3,4,5,6,7,8,9}) {
for (auto i12 : {1,2,3,4,5,6,7,8,9}) {
++call_count;
nomad[0] = '0'+i0;
nomad[2] = '0'+i1;
nomad[4] = '0'+i2;
nomad[6] = '0'+i3;
nomad[12] = '0'+i6;
nomad[20] = '0'+i10;
nomad[24] = '0'+i12;
std::string input{nomad};
std::istringstream d_in{input};
ALU alu{d_in};
alu.execute(program);
visited[alu.environment()] = nomad;
if (call_count%10000==0) std::cout << "\n" << call_count << " " << nomad << std::flush;
}
}
}
}
}
}
}
// Log
{
std::cout << "\n" << call_count << std::flush;
std::cout << "\n" << visited.size();
// 2187
for (auto const& em : visited) {
if (em.first.at('z') == 0) std::cout << "\nvalid:" << em.second;
}
// But none of them are z=0.
}
// How low z have we found (Note that we have two kind digits to find also)
std::vector<Environment> qv{};
std::transform(visited.begin(),visited.end(),std::back_inserter(qv),[](auto em) {
return em.first;
});
std::sort(qv.begin(),qv.end(),[](auto em1,auto em2){
return (em1['z'] < em2['z']);
});
for (auto const& env : qv) {
std::cout << "\n" << to_string(env);
}
/*
Observation: For some reason we get the same w,x and y for the input we generated.
Probably because the last digit processed is the same and w,x and y does NOT
propagate between "steps" (digit processing)
And we basically get two chunks of z, negative and one positive (large in any case)
==> So much for getting close to a low z this way...
...
<environment> w = 1 x = 1 y = 13 z = -1277575273
<environment> w = 1 x = 1 y = 13 z = -1277118323
<environment> w = 1 x = 1 y = 13 z = -1277118297
<environment> w = 1 x = 1 y = 13 z = -1276661347
<environment> w = 1 x = 1 y = 13 z = -1276661321
<environment> w = 1 x = 1 y = 13 z = 182426387
<environment> w = 1 x = 1 y = 13 z = 182443963
<environment> w = 1 x = 1 y = 13 z = 182461539
<environment> w = 1 x = 1 y = 13 z = 182479115
<environment> w = 1 x = 1 y = 13 z = 182496691
<environment> w = 1 x = 1 y = 13 z = 182514267
...
Still, for out input 9pow7 = 4782969
We get only 2187 possible environments.
We should be able to leverage that?
==> Even if we save all intermediate states we only get 14*2187 = 30618 states.
Does this men we can brute force all 9 unknown digits
by memoize encountered states to short-cut the evaluation?
*/
}
// *) Lets asume w,x and y does not affekt the "cost" to z for each "step" (digit in the input)?
// We are thyen interested in the possible space of z-changes for each step
// given some z-input.
if (false) {
size_t const Z = 10000;
std::unordered_map<std::tuple<int,char,Environment>,size_t> visited{};
for (int i=0;i<14;i++) {
// Run program snippet i for digit '9'..'1' for some range of input z 0..Z
// count the number each state is reached
// Note: Requires a specialisation to hash std::tuple<int,char,Environment> injected into
// the std namespace (see code below Environment type above)
for (auto digit : {'9','8','7','6','5','4','3','2','1'}) {
for (size_t z = 0;z<Z;z++) {
std::string input{digit};
std::istringstream d_in{input};
ALU alu{d_in};
alu.environment()['z'] = z;
alu.execute(snippets[i]);
visited[{i,digit,alu.environment()}] += 1; // count reach of this state
}
}
}
// Log
{
std::cout << "\nstate count: " << visited.size();
auto max_e_z = std::max_element(visited.begin(),visited.end(),[](auto const& entry1, auto const& entry2){
auto z1 = std::get<Environment>(entry1.first).at('z');
auto z2 = std::get<Environment>(entry2.first).at('z');
return z1<z2;
});
auto max_z = std::get<Environment>(max_e_z->first).at('z');
auto min_e_z = std::min_element(visited.begin(),visited.end(),[](auto const& entry1, auto const& entry2){
auto z1 = std::get<Environment>(entry1.first).at('z');
auto z2 = std::get<Environment>(entry2.first).at('z');
return z1<z2;
});
auto min_z = std::get<Environment>(min_e_z->first).at('z');
auto max_e_c = std::max_element(visited.begin(),visited.end(),[](auto const& entry1, auto const& entry2){
auto c1 = entry1.second;
auto c2 = entry2.second;
return c1<c2;
});
auto max_c = max_e_c->second;
auto min_e_c = std::min_element(visited.begin(),visited.end(),[](auto const& entry1, auto const& entry2){
auto c1 = entry1.second;
auto c2 = entry2.second;
return c1<c2;
});
auto min_c = max_e_c->second;
std::cout << "\nmin z :" << std::get<int>(min_e_z->first) << " " << std::get<char>(min_e_z->first) << " " << to_string(std::get<Environment>(min_e_z->first)) << " " << min_e_z->second;
std::cout << "\nmax z :" << std::get<int>(max_e_z->first) << " " << std::get<char>(max_e_z->first) << " " << to_string(std::get<Environment>(max_e_z->first)) << " " << max_e_z->second;
std::cout << "\nmin count:" << std::get<int>(min_e_c->first) << " " << std::get<char>(min_e_c->first) << " " << to_string(std::get<Environment>(min_e_c->first)) << " " << min_e_c->second;
std::cout << "\nmax count:" << std::get<int>(max_e_c->first) << " " << std::get<char>(max_e_c->first) << " " << to_string(std::get<Environment>(max_e_c->first)) << " " << max_e_c->second;
/*
state count: 678496
min z :11 1 <environment> w = 1 x = 0 y = 0 z = 0 1
max z :0 9 <environment> w = 9 x = 1 y = 23 z = 259997 1
min count:12 1 <environment> w = 1 x = 1 y = 14 z = 259988 1
max count:13 2 <environment> w = 2 x = 1 y = 14 z = 9920 25
So still, we have tried 10 000 z and 9 digits for each step and only got 678496 different states
Worst case would have been 14*9*10000 = 1 260 000 (we have half the expected state counts...)
We actually got one snippet to produce a zero z output (digit 11 input '1')
Digit 12 = '1' is hit only once
Digit 13 = '2' is hit 25 times (there are 25 input z:s for digit '2' that produce the same output z 9920)
*/
}
}
// So, are we ready to just tey and brute force this?
// It seems we care only about z at each step (digit). Adn we are looking for the highest sequence of 14 digits
// that causes z to become 0.
// And we know the space of states {digit index, z} are limited so we can memoize on this state.
if (false) {
// So, what question can we iterate?
// Lets try - Given digit index i and z so far, what are the highets remaining digits to get z down to 0?
// This qiestion can be asked at every level of digit index.
// And at each level we can return the digit seuqence below us with the current digit at the front.
// What is a good name for this function?
// What about best_digits(i,z)
Visited visited{};
bool part1{true};
auto result = best_digits(part1,13,snippets,0,visited); // Get the best digits 13..0 for z=0 so far
if (result) std::cout << "\nbest monad: " << result.value();
else std::cout << "\nFAILED - no monad found";
}
}
}
| 31.280751 | 195 | 0.557453 | kjelloh |
7cbb1347cce1d40c6aca97055352e6f1381187e9 | 2,465 | cpp | C++ | core/args_parser.cpp | SmallJoker/NyisBotCPP | 48ec353d103ac09f1c538578543d99e9d205f47a | [
"MIT"
] | null | null | null | core/args_parser.cpp | SmallJoker/NyisBotCPP | 48ec353d103ac09f1c538578543d99e9d205f47a | [
"MIT"
] | 1 | 2021-03-28T09:49:33.000Z | 2021-03-28T09:49:33.000Z | core/args_parser.cpp | SmallJoker/NyisBotCPP | 48ec353d103ac09f1c538578543d99e9d205f47a | [
"MIT"
] | null | null | null | #include "args_parser.h"
#include "logger.h"
#include <map>
std::map<std::string, CLIArg *> g_args;
CLIArg::CLIArg(cstr_t &pfx, bool *out) : CLIArg(pfx)
{
m_handler = &CLIArg::parseFlag;
m_dst.b = out;
}
CLIArg::CLIArg(cstr_t &pfx, long *out) : CLIArg(pfx)
{
m_handler = &CLIArg::parseLong;
m_dst.l = out;
}
CLIArg::CLIArg(cstr_t &pfx, float *out) : CLIArg(pfx)
{
m_handler = &CLIArg::parseFloat;
m_dst.f = out;
}
CLIArg::CLIArg(cstr_t &pfx, std::string *out) : CLIArg(pfx)
{
m_handler = &CLIArg::parseString;
m_dst.s = out;
}
CLIArg::CLIArg(cstr_t &pfx)
{
g_args.insert({"--" + pfx, this});
}
static const std::string HELPCMD("--help");
void CLIArg::parseArgs(int argc, char **argv)
{
for (int i = 1; i < argc; ++i) {
if (argv[i] == HELPCMD) {
showHelp();
exit(EXIT_SUCCESS);
}
auto it = g_args.find(argv[i]);
if (it == g_args.end()) {
WARN("Unknown argument '" << argv[i] << "'");
continue;
}
bool has_argv = (it->second->m_handler != &CLIArg::parseFlag);
bool ok = (i + 1 < argc) || !has_argv;
if (ok) {
// Note: argv is NULL-terminated
ok = (it->second->*(it->second)->m_handler)(argv[i + 1]);
if (ok && has_argv)
i++;
}
if (!ok)
WARN("Cannot parse argument '" << argv[i] << "'");
}
g_args.clear();
}
void CLIArg::showHelp()
{
LoggerAssistant la(LL_NORMAL);
la << "Available commands:\n";
for (const auto &it : g_args) {
const CLIArg *a = it.second;
const char *type = "invalid";
std::string initval;
// Switch-case does not work ....
if (a->m_handler == &CLIArg::parseFlag) {
type = "flag";
} else if (a->m_handler == &CLIArg::parseLong) {
type = "integer";
initval = std::to_string(*a->m_dst.l);
} else if (a->m_handler == &CLIArg::parseFloat) {
type = "float";
initval = std::to_string(*a->m_dst.f);
} else if (a->m_handler == &CLIArg::parseString) {
type = "string";
initval = '"' + *a->m_dst.s + '"';
}
la << "\t" << it.first << "\t (Type: " << type;
if (!initval.empty())
la << ", Default: " << initval;
la << ")\n";
}
}
bool CLIArg::parseFlag(const char *str)
{
*m_dst.b ^= true;
return 1;
}
bool CLIArg::parseLong(const char *str)
{
int status = sscanf(str, "%li", m_dst.l);
return status == 1;
}
bool CLIArg::parseFloat(const char *str)
{
int status = sscanf(str, "%f", m_dst.f);
return status == 1;
}
bool CLIArg::parseString(const char *str)
{
if (!str[0])
return false;
m_dst.s->assign(str);
return true;
}
| 20.04065 | 64 | 0.594726 | SmallJoker |
7cbe5492978a198a96c652b2c7b7b5e4b066da5e | 39 | cpp | C++ | src/Events/ButtonClickEvent.cpp | DarthGeek01/TowerDefense | c1421c04c6bc05c73b39084106fd6a17b7fee4e5 | [
"MIT"
] | null | null | null | src/Events/ButtonClickEvent.cpp | DarthGeek01/TowerDefense | c1421c04c6bc05c73b39084106fd6a17b7fee4e5 | [
"MIT"
] | null | null | null | src/Events/ButtonClickEvent.cpp | DarthGeek01/TowerDefense | c1421c04c6bc05c73b39084106fd6a17b7fee4e5 | [
"MIT"
] | null | null | null | //
// Created by ariel on 11/6/16.
//
| 7.8 | 31 | 0.538462 | DarthGeek01 |
7cbf3abc676be906a676d25d721cf95df84cab21 | 11,015 | cpp | C++ | src/opengl/xGSGLutil.cpp | livingcreative/xgs | 2fc51c8b8f04e23740466414092f0ca1e0acb436 | [
"BSD-3-Clause"
] | 6 | 2016-03-17T16:11:39.000Z | 2021-02-08T18:03:23.000Z | src/opengl/xGSGLutil.cpp | livingcreative/xgs | 2fc51c8b8f04e23740466414092f0ca1e0acb436 | [
"BSD-3-Clause"
] | 6 | 2016-07-15T07:02:44.000Z | 2018-05-24T20:39:57.000Z | src/opengl/xGSGLutil.cpp | livingcreative/xgs | 2fc51c8b8f04e23740466414092f0ca1e0acb436 | [
"BSD-3-Clause"
] | 4 | 2016-03-20T11:43:11.000Z | 2022-01-21T21:07:54.000Z | /*
xGS 3D Low-level rendering API
Low-level 3D rendering wrapper API with multiple back-end support
(c) livingcreative, 2015 - 2018
https://github.com/livingcreative/xgs
opengl/xGSGLutil.cpp
OpenGL specific utility functions and classes
*/
#include "xGSGLutil.h"
#include "xGSimpl.h"
#include "xGSstate.h"
#include "xGStexture.h"
#include "xGSdatabuffer.h"
using namespace xGS;
#ifdef _DEBUG
const char* xGS::uniform_type(GLenum type)
{
switch (type) {
case GL_SAMPLER_1D: return "SAMPLER_1D";
case GL_SAMPLER_1D_ARRAY: return "SAMPLER_1D_ARRAY";
case GL_SAMPLER_2D: return "SAMPLER_2D";
case GL_SAMPLER_2D_MULTISAMPLE: return "SAMPLER_2D_MULTISAMPLE";
case GL_SAMPLER_2D_ARRAY: return "SAMPLER_2D_ARRAY";
case GL_SAMPLER_3D: return "SAMPLER_3D";
case GL_SAMPLER_CUBE: return "SAMPLER_CUBE";
case GL_SAMPLER_CUBE_MAP_ARRAY: return "SAMPLER_CUBE_MAP_ARRAY";
case GL_SAMPLER_1D_SHADOW: return "SAMPLER_1D_SHADOW";
case GL_SAMPLER_1D_ARRAY_SHADOW: return "SAMPLER_1D_ARRAY_SHADOW";
case GL_SAMPLER_2D_SHADOW: return "SAMPLER_2D_SHADOW";
case GL_SAMPLER_2D_ARRAY_SHADOW: return "SAMPLER_2D_ARRAY_SHADOW";
case GL_SAMPLER_CUBE_SHADOW: return "SAMPLER_CUBE_SHADOW";
case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW: return "SAMPLER_CUBE_MAP_ARRAY_SHADOW";
case GL_SAMPLER_2D_RECT: return "GL_SAMPLER_2D_RECT";
case GL_SAMPLER_2D_RECT_SHADOW: return "GL_SAMPLER_2D_RECT_SHADOW";
case GL_SAMPLER_BUFFER: return "SAMPLER_BUFFER";
case GL_FLOAT: return "FLOAT";
case GL_FLOAT_VEC2: return "FLOAT_VEC2";
case GL_FLOAT_VEC3: return "FLOAT_VEC3";
case GL_FLOAT_VEC4: return "FLOAT_VEC4";
case GL_FLOAT_MAT2: return "FLOAT_MAT2";
case GL_FLOAT_MAT3: return "FLOAT_MAT3";
case GL_FLOAT_MAT4: return "FLOAT_MAT4";
case GL_INT: return "INT";
case GL_INT_VEC2: return "INT_VEC2";
case GL_INT_VEC3: return "INT_VEC3";
case GL_INT_VEC4: return "INT_VEC4";
case GL_BOOL: return "BOOL";
case GL_BOOL_VEC2: return "BOOL_VEC2";
case GL_BOOL_VEC3: return "BOOL_VEC3";
case GL_BOOL_VEC4: return "BOOL_VEC4";
}
return "? uniform";
}
#endif
GSParametersState::GSParametersState() :
p_uniformblockdata(),
p_textures(),
p_firstslot(0),
p_texture_targets(),
p_texture_binding(),
p_texture_samplers()
{}
GSerror GSParametersState::allocate(xGSImpl *impl, xGSStateImpl *state, const GSParameterSet &set, const GSuniformbinding *uniforms, const GStexturebinding *textures, const GSconstantvalue *constants)
{
// TODO: think about what to do with slots which weren't present in state program
// so their samplers weren't allocated
GSuint slotcount = set.onepastlast - set.first;
GSuint samplercount = set.onepastlastsampler - set.firstsampler;
GSuint blockscount = slotcount - samplercount - set.constantcount;
p_firstslot = set.firstsampler;
p_uniformblockdata.clear();
p_uniformblockdata.reserve(blockscount);
// bind uniform blocks
if (uniforms) {
const GSuniformbinding *binding = uniforms;
while (binding->slot != GSPS_END) {
GSuint slotindex = binding->slot - GSPS_0;
if (slotindex >= slotcount) {
return GSE_INVALIDVALUE;
}
const xGSStateImpl::ParameterSlot &slot = state->parameterSlot(slotindex + set.first);
if (slot.type != GSPD_BLOCK) {
return GSE_INVALIDENUM;
}
if (slot.location != GS_DEFAULT) {
xGSDataBufferImpl *buffer = static_cast<xGSDataBufferImpl*>(binding->buffer);
if (binding->block >= buffer->blockCount()) {
return GSE_INVALIDVALUE;
}
const xGSDataBufferImpl::UniformBlock &block = buffer->block(binding->block);
UniformBlockData ub = {
GLuint(slot.location),
block.offset + block.size * binding->index, block.size,
buffer
};
p_uniformblockdata.push_back(ub);
}
++binding;
}
}
p_textures.clear();
p_texture_targets.clear();
p_texture_binding.clear();
p_texture_samplers.clear();
p_textures.reserve(samplercount);
p_texture_targets.resize(samplercount);
p_texture_binding.resize(samplercount);
p_texture_samplers.resize(samplercount);
// bind textures & samplers
if (textures) {
const GStexturebinding *binding = textures;
while (binding->slot != GSPS_END) {
GSuint slotindex = binding->slot - GSPS_0;
if (slotindex >= slotcount) {
return GSE_INVALIDVALUE;
}
const xGSStateImpl::ParameterSlot &slot = state->parameterSlot(slotindex + set.first);
if (slot.type != GSPD_TEXTURE) {
return GSE_INVALIDENUM;
}
if (slot.location != GS_DEFAULT) {
xGSTextureImpl *texture = static_cast<xGSTextureImpl*>(binding->texture);
GSuint sampler = binding->sampler - GSS_0;
if (sampler >= impl->samplerCount()) {
return GSE_INVALIDVALUE;
}
TextureSlot t = { texture, sampler };
p_textures.push_back(t);
p_texture_targets[slot.location] = texture->target();
p_texture_binding[slot.location] = texture->getID();
p_texture_samplers[slot.location] = impl->sampler(sampler);
}
++binding;
}
}
// copy constant values
if (constants) {
p_constants.reserve(set.constantcount);
size_t memoffset = 0;
const GSconstantvalue *constval = constants;
while (constval->slot != GSPS_END) {
GSuint slotindex = constval->slot - GSPS_0;
if (slotindex >= slotcount) {
return GSE_INVALIDVALUE;
}
const xGSStateImpl::ParameterSlot &slot = state->parameterSlot(slotindex + set.first);
if (slot.type != GSPD_CONSTANT) {
return GSE_INVALIDENUM;
}
if (slot.location != GS_DEFAULT) {
ConstantValue cv = {
constval->type,
slot.location,
memoffset
};
size_t size = 0;
switch (constval->type) {
case GSU_SCALAR: size = sizeof(float) * 1; break;
case GSU_VEC2: size = sizeof(float) * 2; break;
case GSU_VEC3: size = sizeof(float) * 3; break;
case GSU_VEC4: size = sizeof(float) * 4; break;
case GSU_MAT2: size = sizeof(float) * 4; break;
case GSU_MAT3: size = sizeof(float) * 9; break;
case GSU_MAT4: size = sizeof(float) * 16; break;
default:
return GSE_INVALIDENUM;
}
// TODO: optimize constant memory, change for more robust container
p_constantmemory.resize(p_constantmemory.size() + size);
memcpy(p_constantmemory.data() + cv.offset, constval->value, size);
memoffset += size;
p_constants.push_back(cv);
}
++constval;
}
}
for (auto &b : p_uniformblockdata) {
b.buffer->AddRef();
}
for (auto &t : p_textures) {
t.texture->AddRef();
impl->referenceSampler(t.sampler);
}
return GS_OK;
}
void GSParametersState::apply(const GScaps &caps, xGSImpl *impl, xGSStateImpl *state)
{
// set up uniform blocks
for (auto u : p_uniformblockdata) {
glBindBufferRange(GL_UNIFORM_BUFFER, u.index, u.buffer->getID(), u.offset, u.size);
}
if (p_textures.size()) {
if (caps.multi_bind) {
GLuint count = GLuint(p_texture_binding.size());
glBindTextures(p_firstslot, count, p_texture_binding.data());
glBindSamplers(p_firstslot, count, p_texture_samplers.data());
} else {
// set up textures
for (size_t n = 0; n < p_texture_binding.size(); ++n) {
glActiveTexture(GL_TEXTURE0 + p_firstslot + GLenum(n));
if (p_texture_binding[n]) {
glBindTexture(
p_texture_targets[n],
p_texture_binding[n]
);
glBindSampler(GLuint(n) + p_firstslot, p_texture_samplers[n]);
#ifdef _DEBUG
} else {
xGSTextureImpl::bindNullTexture();
glBindSampler(GLuint(n) + p_firstslot, 0);
#endif
}
}
}
}
for (auto c : p_constants) {
// TODO: copypasta - similar code in Impl::SetUniformValue
const GLfloat *value = reinterpret_cast<const GLfloat*>(p_constantmemory.data() + c.offset);
switch (c.type) {
case GSU_SCALAR:
glUniform1fv(c.location, 1, value);
break;
case GSU_VEC2:
glUniform2fv(c.location, 1, value);
break;
case GSU_VEC3:
glUniform3fv(c.location, 1, value);
break;
case GSU_VEC4:
glUniform4fv(c.location, 1, value);
break;
case GSU_MAT2:
glUniformMatrix2fv(c.location, 1, GL_FALSE, value);
break;
case GSU_MAT3:
glUniformMatrix3fv(c.location, 1, GL_FALSE, value);
break;
case GSU_MAT4:
glUniformMatrix4fv(c.location, 1, GL_FALSE, value);
break;
}
}
#ifdef _DEBUG
for (size_t n = 0; n < p_textures.size(); ++n) {
xGSTextureImpl *texture = p_textures[n].texture;
bool depthtexture =
texture->format() == GS_DEPTH_16 ||
texture->format() == GS_DEPTH_24 ||
texture->format() == GS_DEPTH_32 ||
texture->format() == GS_DEPTH_32_FLOAT ||
texture->format() == GS_DEPTHSTENCIL_D24S8;
if (texture->boundAsRT() && (!depthtexture || state->depthMask())) {
//impl->debug(DebugMessageLevel::Warning, "Texture bound as RT is being used as source [id=%i]\n", p_textures[n].texture->getID());
}
}
#endif
}
void GSParametersState::ReleaseRendererResources(xGSImpl *impl)
{
for (auto &u : p_uniformblockdata) {
if (u.buffer) {
u.buffer->Release();
}
}
for (auto &t : p_textures) {
if (t.texture) {
t.texture->Release();
}
impl->dereferenceSampler(t.sampler);
}
}
| 32.68546 | 200 | 0.578484 | livingcreative |
7cc17e094b97871d82c1a87abdfc70a311414c91 | 341 | cpp | C++ | src/op/grid5.cpp | pfuchs/riesling | 2e0f12f5cd1943cb6e96eca40f4e68ef88e12130 | [
"MIT"
] | null | null | null | src/op/grid5.cpp | pfuchs/riesling | 2e0f12f5cd1943cb6e96eca40f4e68ef88e12130 | [
"MIT"
] | null | null | null | src/op/grid5.cpp | pfuchs/riesling | 2e0f12f5cd1943cb6e96eca40f4e68ef88e12130 | [
"MIT"
] | null | null | null | #include "grid.hpp"
std::unique_ptr<GridBase> make_5_e(Kernel const *k, Mapping const &m, bool const fg)
{
if (k->throughPlane() == 1) {
return std::make_unique<Grid<5, 1>>(dynamic_cast<SizedKernel<5, 1> const *>(k), m, fg);
} else {
return std::make_unique<Grid<5, 5>>(dynamic_cast<SizedKernel<5, 5> const *>(k), m, fg);
}
}
| 31 | 91 | 0.642229 | pfuchs |
7cc1b0c066fe51564b4db7a66c005b01880a24a8 | 2,851 | cc | C++ | demo/misc/uri_demo.cc | Rokid/mingutils | b0c7865b928c8c46fdf769bfda0f05b1965b5372 | [
"MIT"
] | 1,144 | 2018-12-18T09:46:47.000Z | 2022-03-07T14:51:46.000Z | demo/misc/uri_demo.cc | Rokid/mingutils | b0c7865b928c8c46fdf769bfda0f05b1965b5372 | [
"MIT"
] | 16 | 2019-01-28T06:08:40.000Z | 2019-12-04T10:26:41.000Z | demo/misc/uri_demo.cc | Rokid/mingutils | b0c7865b928c8c46fdf769bfda0f05b1965b5372 | [
"MIT"
] | 129 | 2018-12-18T09:46:50.000Z | 2022-03-30T07:30:13.000Z | #include "uri.h"
using namespace rokid;
using namespace std;
#define URI_COUNT 7
static const char* test_uris[] = {
"https://[email protected]:123/forum/questions/?tag=networking&order=newest#top",
"mailto:[email protected]",
"news:comp.infosystems.www.servers.unix",
"tel:+1-816-555-1212",
"telnet://192.0.2.16:80/",
"urn:oasis:names:specification:docbook:dtd:xml:4.1.2",
"unix:rokid-flora#foo"
};
typedef struct {
string scheme;
string user;
string host;
int32_t port = 0;
string path;
string query;
string fragment;
} UriResult;
static UriResult correct_results[URI_COUNT];
static void prepare_correct_results() {
correct_results[0].scheme = "https";
correct_results[0].user = "john.doe";
correct_results[0].host = "www.example.com";
correct_results[0].port = 123;
correct_results[0].path = "/forum/questions/";
correct_results[0].query = "tag=networking&order=newest";
correct_results[0].fragment = "top";
correct_results[1].scheme = "mailto";
correct_results[1].path = "[email protected]";
correct_results[2].scheme = "news";
correct_results[2].path = "comp.infosystems.www.servers.unix";
correct_results[3].scheme = "tel";
correct_results[3].path = "+1-816-555-1212";
correct_results[4].scheme = "telnet";
correct_results[4].host = "192.0.2.16";
correct_results[4].port = 80;
correct_results[4].path = "/";
correct_results[5].scheme = "urn";
correct_results[5].path = "oasis:names:specification:docbook:dtd:xml:4.1.2";
correct_results[6].scheme = "unix";
correct_results[6].path = "rokid-flora";
correct_results[6].fragment = "foo";
}
static bool check_result(Uri& uri, UriResult& r) {
if (uri.scheme != r.scheme) {
printf("scheme incorrect: %s != %s\n", uri.scheme.c_str(), r.scheme.c_str());
return false;
}
if (uri.user != r.user) {
printf("user incorrect: %s != %s\n", uri.user.c_str(), r.user.c_str());
return false;
}
if (uri.host != r.host) {
printf("host incorrect: %s != %s\n", uri.host.c_str(), r.host.c_str());
return false;
}
if (uri.port != r.port) {
printf("port incorrect: %d != %d\n", uri.port, r.port);
return false;
}
if (uri.path != r.path) {
printf("path incorrect: %s != %s\n", uri.path.c_str(), r.path.c_str());
return false;
}
if (uri.query != r.query) {
printf("query incorrect: %s != %s\n", uri.query.c_str(), r.query.c_str());
return false;
}
if (uri.fragment != r.fragment) {
printf("fragment incorrect: %s != %s\n", uri.fragment.c_str(), r.fragment.c_str());
return false;
}
return true;
}
int main(int argc, char** argv) {
prepare_correct_results();
int32_t i;
Uri uri;
for (i = 0; i < URI_COUNT; ++i) {
if (!uri.parse(test_uris[i])) {
printf("parse uri %s failed\n", test_uris[i]);
return 1;
}
if (!check_result(uri, correct_results[i]))
return 1;
}
printf("uri test success\n");
return 0;
}
| 27.679612 | 89 | 0.668888 | Rokid |
7cc25f769f8089c602d3de999ea8e8d20d710a88 | 2,189 | cpp | C++ | Tests/unit-tests/Source/opennwa/namespace-query/states-overlap.cpp | jusito/WALi-OpenNWA | 2bb4aca02c5a5d444fd038e8aa3eecd7d1ccbb99 | [
"MIT"
] | 15 | 2015-03-07T17:25:57.000Z | 2022-02-04T20:17:00.000Z | src/wpds/Tests/unit-tests/Source/opennwa/namespace-query/states-overlap.cpp | ucd-plse/mpi-error-prop | 4367df88bcdc4d82c9a65b181d0e639d04962503 | [
"BSD-3-Clause"
] | 1 | 2018-03-03T05:58:55.000Z | 2018-03-03T12:26:10.000Z | src/wpds/Tests/unit-tests/Source/opennwa/namespace-query/states-overlap.cpp | ucd-plse/mpi-error-prop | 4367df88bcdc4d82c9a65b181d0e639d04962503 | [
"BSD-3-Clause"
] | 15 | 2015-09-25T17:44:35.000Z | 2021-07-18T18:25:38.000Z | #include "gtest/gtest.h"
#include "opennwa/Nwa.hpp"
#include "opennwa/query/automaton.hpp"
#include "Tests/unit-tests/Source/opennwa/fixtures.hpp"
#include "Tests/unit-tests/Source/opennwa/class-NWA/supporting.hpp"
namespace opennwa {
namespace query {
TEST(opennwa$query$$statesOverlap, emptyDoesNotOverlap)
{
OddNumEvenGroupsNwa fixture;
Nwa empty;
EXPECT_FALSE(statesOverlap(empty, empty));
EXPECT_FALSE(statesOverlap(empty, fixture.nwa));
}
TEST(opennwa$query$$statesOverlap, oddEvenOverlapsWithItself)
{
OddNumEvenGroupsNwa f1, f2;
EXPECT_TRUE(statesOverlap(f1.nwa, f2.nwa));
}
TEST(opennwa$query$$statesOverlap, subsetsOverlap)
{
OddNumEvenGroupsNwa fixture;
Nwa nwa;
// 1 element overlap
ASSERT_TRUE(nwa.addState(fixture.q0));
EXPECT_TRUE(statesOverlap(fixture.nwa, nwa));
// 2 element overlap
ASSERT_TRUE(nwa.addState(fixture.q1));
EXPECT_TRUE(statesOverlap(fixture.nwa, nwa));
// Large overlap
nwa = fixture.nwa;
ASSERT_TRUE(nwa.removeState(fixture.dummy));
EXPECT_TRUE(statesOverlap(fixture.nwa, nwa));
}
TEST(opennwa$query$$statesOverlap, largeDisjointLargeDoNotOverlap)
{
OddNumEvenGroupsNwa fixture;
SomeElements e;
Nwa nwa;
e.add_to_nwa(&nwa);
EXPECT_FALSE(statesOverlap(fixture.nwa, nwa));
}
TEST(opennwa$query$$statesOverlap, incomparableDoNotOverlap)
{
OddNumEvenGroupsNwa fixture;
Nwa nwa1 = fixture.nwa;
Nwa nwa2 = fixture.nwa;
ASSERT_TRUE(nwa1.removeState(fixture.dummy));
ASSERT_TRUE(nwa2.removeState(fixture.q0));
EXPECT_TRUE(statesOverlap(nwa1, nwa2));
}
}
}
| 28.428571 | 78 | 0.539516 | jusito |
7cc6f8b65c023da7b5d1209a6c254884081e3697 | 77,980 | cpp | C++ | EBUCoreProcessor/src/EBUCore_1_4/EBUCoreMapping.cpp | Limecraft/ebu-mxfsdk | d2461c778f7980c4e116a53123c2ba744b1362a0 | [
"Apache-2.0"
] | 20 | 2015-02-24T23:54:23.000Z | 2022-03-29T12:42:32.000Z | EBUCoreProcessor/src/EBUCore_1_4/EBUCoreMapping.cpp | ebu/ebu-mxfsdk | d66e4b05354ec2b80365f1956f14678c6f7f6514 | [
"Apache-2.0"
] | 1 | 2018-10-26T00:44:05.000Z | 2018-10-26T00:44:05.000Z | EBUCoreProcessor/src/EBUCore_1_4/EBUCoreMapping.cpp | ebu/ebu-mxfsdk | d66e4b05354ec2b80365f1956f14678c6f7f6514 | [
"Apache-2.0"
] | 6 | 2015-02-05T09:54:14.000Z | 2022-02-26T20:56:32.000Z | /*
* Copyright 2012-2013 European Broadcasting Union and Limecraft, NV.
*
* 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 "EBUCore_1_4/EBUCoreMapping.h"
#include "AppUtils.h"
#include <xercesc/util/TransService.hpp>
using namespace ebuCore_2012;
using namespace mxfpp;
//using namespace bmx;
namespace EBUSDK {
namespace EBUCore {
namespace EBUCore_1_4 {
#define SIMPLE_MAP(source, sourceProperty, dest, destProperty) \
dest->destProperty(source.sourceProperty().get());
#define SIMPLE_MAP_NO_GET(source, sourceProperty, dest, destProperty) \
dest->destProperty(source.sourceProperty());
#define SIMPLE_MAP_OPTIONAL(source, sourceProperty, dest, destProperty) \
if (source.sourceProperty().present()) \
dest->destProperty(source.sourceProperty().get());
#define SIMPLE_MAP_OPTIONAL_CONVERT(source, sourceProperty, dest, destProperty, convertFunction) \
if (source.sourceProperty().present()) \
dest->destProperty(convertFunction(source.sourceProperty().get()));
#define NEW_OBJECT_AND_ASSIGN(source, sourceProperty, destType, mapMethod, dest, destProperty) \
{ \
destType *obj = newAndModifyObject<destType>(dest->getHeaderMetadata(), mod); \
mapMethod(source.sourceProperty(), obj, mod); \
dest->destProperty(obj); \
}
#define NEW_OBJECT_AND_ASSIGN_DIRECT(source, destType, mapMethod, dest, destProperty) \
{ \
destType *obj = newAndModifyObject<destType>(dest->getHeaderMetadata(), mod); \
mapMethod(source, obj, mod); \
dest->destProperty(obj); \
}
#define NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, sourceProperty, destType, mapMethod, dest, destProperty) \
if (source.sourceProperty().present()) { \
destType *obj = newAndModifyObject<destType>(dest->getHeaderMetadata(), mod); \
mapMethod(source.sourceProperty().get(), obj, mod); \
dest->destProperty(obj); \
}
#define NEW_VECTOR_AND_ASSIGN(source, sourceProperty, destType, iteratorType, mapMethod, dest, destProperty) \
if (source.sourceProperty().size() > 0) \
{ std::vector<destType*> vec_dest_destProperty; \
for (iteratorType it = source.sourceProperty().begin(); it != source.sourceProperty().end(); it++) { \
destType *obj = newAndModifyObject<destType>(dest->getHeaderMetadata(), mod); \
mapMethod(*it, obj, mod); \
vec_dest_destProperty.push_back(obj); \
} \
dest->destProperty(vec_dest_destProperty); }
#define NEW_VECTOR_AND_APPEND(source, sourceProperty, destType, iteratorType, mapMethod, dest, destVector) \
{ \
for (iteratorType it = source.sourceProperty().begin(); it != source.sourceProperty().end(); it++) { \
destType *obj = newAndModifyObject<destType>(dest->getHeaderMetadata(), mod); \
mapMethod(*it, obj, mod); \
destVector.push_back(obj); \
} }
#define SIMPLE_MAP_OPTIONAL_TO_NEW_VECTOR_AND_ASSIGN(source, sourceProperty, destType, mapMethod, dest, destProperty) \
if (source.sourceProperty().present()) { \
destType *obj = newAndModifyObject<destType>(dest->getHeaderMetadata(), mod); \
mapMethod(source.sourceProperty().get(), obj, mod); \
std::vector<destType*> v_dest_destProperty; \
v_dest_destProperty.push_back(obj); \
dest->destProperty(v_dest_destProperty); \
}
#define MAP_TYPE_GROUP(source, dest) \
SIMPLE_MAP_OPTIONAL(source, typeDefinition, dest, settypeGroupDefinition) \
SIMPLE_MAP_OPTIONAL(source, typeLabel, dest, settypeGroupLabel) \
SIMPLE_MAP_OPTIONAL(source, typeLink, dest, settypeGroupLink) \
SIMPLE_MAP_OPTIONAL(source, typeLanguage, dest, settypeGroupLanguage)
/*
This macro is not defined as a function since typeGroups are not separate types
but are more like duck typing (just a group of included attributes).
Same for other such groups (format-, status-)
*/
#define MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, destProperty) \
ebucoreTypeGroup *typeGroup = newAndModifyObject<ebucoreTypeGroup>(dest->getHeaderMetadata(), mod); \
MAP_TYPE_GROUP(source, typeGroup) \
dest->destProperty(typeGroup); \
#define MAP_STATUS_GROUP(source, dest) \
SIMPLE_MAP_OPTIONAL(source, statusDefinition, dest, setstatusGroupDefinition) \
SIMPLE_MAP_OPTIONAL(source, statusLabel, dest, setstatusGroupLabel) \
SIMPLE_MAP_OPTIONAL(source, statusLink, dest, setstatusGroupLink) \
SIMPLE_MAP_OPTIONAL(source, statusLanguage, dest, setstatusGroupLanguage)
#define MAP_NEW_STATUS_GROUP_AND_ASSIGN(source, dest, destProperty) \
ebucoreStatusGroup *statusGroup = newAndModifyObject<ebucoreStatusGroup>(dest->getHeaderMetadata(), mod); \
MAP_STATUS_GROUP(source, statusGroup) \
dest->destProperty(statusGroup);
#define MAP_FORMAT_GROUP(source, dest) \
SIMPLE_MAP_OPTIONAL(source, formatDefinition, dest, setformatGroupDefinition) \
SIMPLE_MAP_OPTIONAL(source, formatLabel, dest, setformatGroupLabel) \
SIMPLE_MAP_OPTIONAL(source, formatLink, dest, setformatGroupLink) \
SIMPLE_MAP_OPTIONAL(source, formatLanguage, dest, setformatGroupLanguage)
#define MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source, dest, destProperty) \
ebucoreFormatGroup *statusGroup = newAndModifyObject<ebucoreFormatGroup>(dest->getHeaderMetadata(), mod); \
MAP_FORMAT_GROUP(source, statusGroup) \
dest->destProperty(statusGroup);
template <class T> T* newAndModifyObject(HeaderMetadata *headerMetadata, ObjectModifier *mod) {
T *obj = new T(headerMetadata);
if (mod != NULL)
mod->Modify(obj);
return obj;
}
void mapRole(role& source, ebucoreRole *dest, ObjectModifier* mod = NULL) {
// [TODO]
// [XSD] Fix attribute type of costcenter to string so we can map it here
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setroleTypeGroup)
}
void mapTextualAnnotation(std::string source, ebucoreTextualAnnotation *dest, ObjectModifier* mod = NULL) {
/* cannot deal with lang as source is single string */
dest->settext(source);
}
void mapTextualAnnotation(dc::elementType source, ebucoreTextualAnnotation *dest, ObjectModifier* mod = NULL) {
dest->settext(source);
dest->settextLanguage(source.lang());
}
void mapCountry(country& source, ebucoreCountry *dest, ObjectModifier* mod = NULL) {
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setcountryTypeGroup)
}
void mapCountry(regionType::country_type& source, ebucoreCountry *dest, ObjectModifier* mod = NULL) {
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setcountryTypeGroup)
}
void mapAddress(addressType& source, ebucoreAddress *dest, ObjectModifier* mod = NULL) {
if (source.addressLine().size() > 0) {
NEW_VECTOR_AND_ASSIGN(source, addressLine, ebucoreTextualAnnotation, addressType::addressLine_iterator, mapTextualAnnotation, dest, setaddressLines)
}
SIMPLE_MAP_OPTIONAL_TO_NEW_VECTOR_AND_ASSIGN(source, addressTownCity, ebucoreTextualAnnotation, mapTextualAnnotation, dest, settownCity)
SIMPLE_MAP_OPTIONAL_TO_NEW_VECTOR_AND_ASSIGN(source, addressCountyState, ebucoreTextualAnnotation, mapTextualAnnotation, dest, setcountyState)
SIMPLE_MAP_OPTIONAL(source, addressDeliveryCode, dest, setdeliveryCode)
SIMPLE_MAP_OPTIONAL_TO_NEW_VECTOR_AND_ASSIGN(source, country, ebucoreCountry, mapCountry, dest, setcountry)
}
void mapDetails(detailsType& source, ebucoreContactDetails *dest, ObjectModifier* mod = NULL) {
if (source.emailAddress().size() > 0) {
dest->setemailAddress(source.emailAddress()[0]);
}
SIMPLE_MAP_OPTIONAL(source, webAddress, dest, setwebAddress)
// map address
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, address, ebucoreAddress, mapAddress, dest, setaddress)
SIMPLE_MAP_OPTIONAL(source, telephoneNumber, dest, settelephoneNumber)
SIMPLE_MAP_OPTIONAL(source, mobileTelephoneNumber, dest, setmobileTelephoneNumber)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setdetailsType)
}
void mapName(compoundNameType& source, ebucoreCompoundName *dest, ObjectModifier* mod = NULL) {
dest->setcompoundName(source);
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setcompoundNameTypeGroup)
MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source, dest, setcompoundNameFormatGroup)
}
void mapIdentifier(identifierType& source, ebucoreIdentifier *dest, ObjectModifier* mod = NULL);
void mapBasicLink(relatedInformationLink& source, ebucoreBasicLink *dest, ObjectModifier* mod = NULL) {
dest->setbasicLinkURI(source);
}
void mapBasicLink(relatedInformationLink1& source, ebucoreBasicLink *dest, ObjectModifier* mod = NULL) {
dest->setbasicLinkURI(source);
}
void mapContact(contactDetailsType& source, ebucoreContact *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, contactId, dest, setcontactId)
NEW_VECTOR_AND_ASSIGN(source, name, ebucoreCompoundName, contactDetailsType::name_iterator, mapName, dest, setcontactName)
SIMPLE_MAP_OPTIONAL(source, givenName, dest, setgivenName)
SIMPLE_MAP_OPTIONAL(source, familyName, dest, setfamilyName)
SIMPLE_MAP_OPTIONAL(source, suffix, dest, setsuffix)
SIMPLE_MAP_OPTIONAL(source, salutation, dest, setsalutation)
SIMPLE_MAP_OPTIONAL(source, guest, dest, setguestFlag)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, gender, ebucoreTextualAnnotation, mapTextualAnnotation, dest, setgender)
NEW_VECTOR_AND_ASSIGN(source, otherGivenName, ebucoreTextualAnnotation, contactDetailsType::otherGivenName_iterator, mapTextualAnnotation, dest, setotherGivenName)
if (source.username().size() > 0) {
dest->setusername(source.username()[0]);
}
SIMPLE_MAP_OPTIONAL(source, occupation, dest, setoccupation)
NEW_VECTOR_AND_ASSIGN(source, details, ebucoreContactDetails, contactDetailsType::details_sequence::iterator, mapDetails, dest, setcontactDetails)
NEW_VECTOR_AND_ASSIGN(source, stageName, ebucoreTextualAnnotation, contactDetailsType::stageName_iterator, mapTextualAnnotation, dest, setstageName)
NEW_VECTOR_AND_ASSIGN(source, relatedContacts, ebucoreEntity, contactDetailsType::relatedContacts_iterator, mapEntity, dest, setcontactRelatedContacts)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setcontactType)
NEW_VECTOR_AND_ASSIGN(source, relatedInformationLink, ebucoreBasicLink, contactDetailsType::relatedInformationLink_iterator, mapBasicLink, dest, setcontactRelatedInformationLink)
}
void mapOrganisationDepartment(organisationDepartment& source, ebucoreOrganisationDepartment *dest, ObjectModifier* mod = NULL) {
dest->setdepartmentName(source);
SIMPLE_MAP_OPTIONAL(source, departmentId, dest, setdepartmentId)
}
void mapOrganisation(organisationDetailsType& source, ebucoreOrganisation *dest, ObjectModifier* mod = NULL) {
// [TODO] The KLV mapping is somewhat inconsistent at this point with the XSD:
// - XSD departmentId is not present in KLV
SIMPLE_MAP_OPTIONAL(source, organisationId, dest, setorganisationId)
NEW_VECTOR_AND_ASSIGN(source, organisationName, ebucoreCompoundName, organisationDetailsType::organisationName_iterator, mapName, dest, setorganisationName)
NEW_VECTOR_AND_ASSIGN(source, organisationCode, ebucoreIdentifier, organisationDetailsType::organisationCode_iterator, mapIdentifier, dest, setorganisationCode)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, organisationDepartment, ebucoreOrganisationDepartment, mapOrganisationDepartment, dest, setorganisationDepartment)
NEW_VECTOR_AND_ASSIGN(source, details, ebucoreContactDetails, contactDetailsType::details_sequence::iterator, mapDetails, dest, setorganisationDetails)
NEW_VECTOR_AND_ASSIGN(source, contacts, ebucoreEntity, organisationDetailsType::contacts_iterator, mapEntity, dest, setorganisationRelatedContacts)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setorganisationType)
NEW_VECTOR_AND_ASSIGN(source, relatedInformationLink, ebucoreBasicLink, organisationDetailsType::relatedInformationLink_iterator,
mapBasicLink, dest, setorganisationRelatedInformationLink)
}
void mapEntity(entityType& source, ebucoreEntity *dest, ObjectModifier* mod) {
SIMPLE_MAP_OPTIONAL(source, entityId, dest, setentityId)
NEW_VECTOR_AND_ASSIGN(source, contactDetails, ebucoreContact, entityType::contactDetails_iterator, mapContact, dest, setentityContact)
NEW_VECTOR_AND_ASSIGN(source, organisationDetails, ebucoreOrganisation, entityType::organisationDetails_iterator, mapOrganisation, dest, setentityOrganisation)
NEW_VECTOR_AND_ASSIGN(source, role, ebucoreRole, entityType::role_iterator, mapRole, dest, setentityRole)
}
void mapMetadataSchemeInformation(ebuCoreMainType& source, ebucoreMetadataSchemeInformation *dest, ObjectModifier* mod) {
/*
<sequence>
<element name="coreMetadata" type="ebucore:coreMetadataType">
</element>
<element name="metadataProvider" type="ebucore:entityType" minOccurs="0">
</element>
</sequence>
<attribute name="schema" default="EBU_CORE_20110531.xsd">
</attribute>
<attribute name="version" default="1.3">
</attribute>
<attribute name="dateLastModified" type="date">
</attribute>
<attribute name="documentId" type="NMTOKEN">
</attribute>
<attribute ref="xml:lang">
</attribute>
*/
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, metadataProvider, ebucoreEntity, mapEntity, dest, setebucoreMetadataProvider)
// is there a version node? appearently, no easier way to check than
// to look through the attributes of the source node and see if there
// is a matching attribute
xercesc::DOMNamedNodeMap* attrs = source._node()->getAttributes();
XMLCh* str_version = xercesc::XMLString::transcode("version");
const xercesc::DOMNode* version_node = attrs->getNamedItem(str_version);
xercesc::XMLString::release(&str_version);
if (version_node != NULL) {
xercesc::TranscodeToStr version(source.version()._node()->getTextContent(), "UTF-8");
std::string std_version((char*)version.str());
dest->setebucoreMetadataSchemeVersion(std_version);
}
/* EBUCore1.4:
XMLCh* str_schema = xercesc_3_1::XMLString::transcode("schema");
const xercesc_3_1::DOMNode* schema_node = attrs->getNamedItem(str_schema);
xercesc_3_1::XMLString::release(&str_schema);
if (schema_node != NULL) {
xercesc_3_1::TranscodeToStr schema(source.schema()._node()->getTextContent(), "UTF-8");
std::string std_schema((char*)schema.str());
dest->setebucoreMetadataScheme(std_schema);
}*/
}
mxfTimestamp convert_timestamp(xml_schema::date& source) {
mxfTimestamp ts = {0,0,0,0,0,0,0};
ts.day = source.day();
ts.month = source.month();
ts.year = source.year();
return ts;
}
mxfTimestamp convert_timestamp(xml_schema::gyear& source) {
mxfTimestamp ts = {0,0,0,0,0,0,0};
ts.year = source.year();
return ts;
}
std::string convert(xml_schema::gyear& source) {
std::stringstream ss;
ss << source.year();
return ss.str();
}
std::string convert(xml_schema::date& source) {
std::stringstream ss;
ss << source.day() << '/' << source.month() << '/' << source.year();
return ss.str();
}
std::string convert(xml_schema::time& source) {
std::stringstream ss;
ss << source.hours() << ':' << source.minutes() << ':' << source.seconds();
return ss.str();
}
mxfTimestamp convert_timestamp(xml_schema::time& source) {
mxfTimestamp ts = {0,0,0,0,0,0,0};
ts.hour = source.hours();
ts.min = source.minutes();
ts.sec = source.seconds();
return ts;
}
std::string convert(xml_schema::idrefs& source) {
std::stringstream ss;
size_t l = source.size(); size_t i = 0;
for (xml_schema::idrefs::iterator it = source.begin(); it != source.end(); it++) {
i++;
ss << (*it);
if (i < l) ss << ' ';
}
return ss.str();
}
mxfRational convert(xml_schema::long_& source) {
mxfRational r = {source, 1};
return r;
}
mxfRational convert(rationalType& source) {
mxfRational r = {source.factorNumerator(), source.factorDenominator()};
return r;
}
std::string convert_to_string(::xml_schema::integer& source) {
std::stringstream ss;
ss << source;
return ss.str();
}
mxfRational convert_rational(xml_schema::duration& source) {
mxfRational r = {
(source.years() * 365 * 86400 +
source.months() * 30 * 86400 +
source.days() * 86400 +
source.hours() * 3600 +
source.minutes() * 60 +
source.seconds()) * 100,
100};
return r;
}
mxfRational convert_rational(xml_schema::time& source) {
mxfRational r = {
(source.hours() * 3600 +
source.minutes() * 60 +
source.seconds()) * 100,
100};
return r;
}
void mapTitle(titleType& source, ebucoreTitle *dest, ObjectModifier* mod = NULL) {
NEW_VECTOR_AND_ASSIGN(source, title, ebucoreTextualAnnotation, titleType::title_iterator, mapTextualAnnotation, dest, settitleValue)
SIMPLE_MAP_OPTIONAL(source, note, dest, settitleNote)
SIMPLE_MAP_OPTIONAL_CONVERT(source, attributiondate, dest, settitleAttributionDate, convert_timestamp)
}
void mapAlternativeTitle(alternativeTitleType& source, ebucoreAlternativeTitle *dest, ObjectModifier* mod = NULL) {
NEW_VECTOR_AND_ASSIGN(source, title, ebucoreTextualAnnotation, alternativeTitleType::title_iterator, mapTextualAnnotation, dest, setalternativeTitleValue)
SIMPLE_MAP_OPTIONAL(source, note, dest, setalternativeTitleNote)
SIMPLE_MAP_OPTIONAL_CONVERT(source, startDate, dest, setalternativeTitleAttributionDate, convert_timestamp)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setalternativeTitleTypeGroup)
MAP_NEW_STATUS_GROUP_AND_ASSIGN(source, dest, setalternativeTitleStatusGroup)
}
void mapIdentifier(identifierType& source, ebucoreIdentifier *dest, ObjectModifier* mod) {
SIMPLE_MAP_NO_GET(source, identifier, dest, setidentifierValue)
SIMPLE_MAP_OPTIONAL(source, note, dest, setidentifierNote)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setidentifierTypeGroup)
MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source, dest, setidentifierFormatGroup)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, attributor, ebucoreEntity, mapEntity, dest, setidentifierAttributorEntity)
}
void mapDescription(descriptionType& source, ebucoreDescription *dest, ObjectModifier* mod = NULL) {
NEW_VECTOR_AND_ASSIGN(source, description, ebucoreTextualAnnotation, descriptionType::description_iterator, mapTextualAnnotation, dest, setdescriptionValue)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setdescriptionTypeGroup)
SIMPLE_MAP_OPTIONAL(source, note, dest, setdescriptionNote)
}
void mapSubject(subjectType& source, ebucoreSubject *dest, ObjectModifier* mod = NULL) {
NEW_VECTOR_AND_ASSIGN(source, subject, ebucoreTextualAnnotation, subjectType::subject_const_iterator, mapTextualAnnotation, dest, setsubjectValue)
SIMPLE_MAP_OPTIONAL(source, subjectCode, dest, setsubjectCode)
NEW_VECTOR_AND_ASSIGN(source, subjectDefinition, ebucoreTextualAnnotation, subjectType::subjectDefinition_const_iterator, mapTextualAnnotation, dest, setsubjectDefinition)
SIMPLE_MAP_OPTIONAL(source, note, dest, setsubjectNote)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setsubjectTypeGroup)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, attributor, ebucoreEntity, mapEntity, dest, setsubjectAttributorEntity)
}
void mapRegion(regionType& source, ebucoreRegion *dest, ObjectModifier* mod = NULL) {
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, country, ebucoreCountry, mapCountry, dest, setcountry)
if (source.countryRegion().size() > 0) {
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source.countryRegion()[0], dest, setcountryRegion)
}
}
void mapRating(ratingType& source, ebucoreRating *dest, ObjectModifier* mod = NULL) {
NEW_VECTOR_AND_ASSIGN(source, ratingValue, ebucoreTextualAnnotation, ratingType::ratingValue_const_iterator, mapTextualAnnotation, dest, setratingValue)
NEW_VECTOR_AND_ASSIGN(source, ratingScaleMaxValue, ebucoreTextualAnnotation, ratingType::ratingScaleMaxValue_const_iterator, mapTextualAnnotation, dest, setratingScaleMaxValue)
NEW_VECTOR_AND_ASSIGN(source, ratingScaleMinValue, ebucoreTextualAnnotation, ratingType::ratingScaleMinValue_const_iterator, mapTextualAnnotation, dest, setratingScaleMinValue)
SIMPLE_MAP_OPTIONAL(source, reason, dest, setratingReason)
SIMPLE_MAP_OPTIONAL(source, linkToLogo, dest, setratingLinkToLogo)
SIMPLE_MAP_OPTIONAL(source, notRated, dest, setratingNotRatedFlag)
SIMPLE_MAP_OPTIONAL(source, adultContent, dest, setratingAdultContentFlag)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, ratingProvider, ebucoreEntity, mapEntity, dest, setratingProviderEntity)
if (source.ratingRegion().size() > 0) {
NEW_OBJECT_AND_ASSIGN_DIRECT(source.ratingRegion()[0], ebucoreRegion, mapRegion, dest, setratingRegion)
}
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setratingTypeGroup)
MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source, dest, setratingFormatGroup)
}
void mapVersion(coreMetadataType::version_type& source, ebucoreVersion *dest, ObjectModifier* mod = NULL) {
ebucoreTextualAnnotation *obj = newAndModifyObject<ebucoreTextualAnnotation>(dest->getHeaderMetadata(), mod);
mapTextualAnnotation(source, obj, mod);
std::vector<ebucoreTextualAnnotation*> v_dest_destProperty;
v_dest_destProperty.push_back(obj);
dest->setversionValue(v_dest_destProperty);
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setversionTypeGroup)
}
void mapLanguage(languageType& source, ebucoreLanguage *dest, ObjectModifier* mod = NULL) {
// TODO: KLV Language has an indirection for languagepurpose via a languagepurposeset which contains
// only a reference to the typegroup, required?
SIMPLE_MAP_OPTIONAL(source, language, dest, setlanguageCode)
if (source.language().present()) {
dest->setlanguageLanguageCode(source.language().get().lang());
}
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setlanguagePurposeSet)
SIMPLE_MAP_OPTIONAL(source, note, dest, setlanguageNote)
}
void mapTargetAudience(targetAudience& source, ebucoreTargetAudience *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, reason, dest, settargetAudienceReason)
SIMPLE_MAP_OPTIONAL(source, linkToLogo, dest, settargetAudienceLinkToLogo)
SIMPLE_MAP_OPTIONAL(source, notRated, dest, settargetAudienceNotRatedFlag)
SIMPLE_MAP_OPTIONAL(source, adultContent, dest, settargetAudienceAdultContentFlag)
NEW_VECTOR_AND_ASSIGN(source, targetRegion, ebucoreRegion, targetAudience::targetRegion_iterator, mapRegion, dest, settargetAudienceRegion)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, settargetAudienceTypeGroup)
}
void mapGenre(genre& source, ebucoreGenre *dest, ObjectModifier* mod = NULL) {
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setgenreKindGroup)
}
void mapType(typeType& source, ebucoreType *dest, ObjectModifier* mod = NULL) {
NEW_VECTOR_AND_ASSIGN(source, type, ebucoreTextualAnnotation, typeType::type_iterator, mapTextualAnnotation, dest, settypeValue)
std::vector<ebucoreObjectType*> vec_dest_objecttype;
for (typeType::objectType_iterator it = source.objectType().begin(); it != source.objectType().end(); it++) {
ebucoreObjectType *obj = newAndModifyObject<ebucoreObjectType>(dest->getHeaderMetadata(), mod);
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source.objectType().front(), obj, setobjectTypeGroup)
vec_dest_objecttype.push_back(obj);
}
dest->setobjectType(vec_dest_objecttype);
NEW_VECTOR_AND_ASSIGN(source, targetAudience, ebucoreTargetAudience, typeType::targetAudience_iterator, mapTargetAudience, dest, settargetAudience)
NEW_VECTOR_AND_ASSIGN(source, genre, ebucoreGenre, typeType::genre_iterator, mapGenre, dest, setgenre)
SIMPLE_MAP_OPTIONAL(source, note, dest, settypeNote)
}
void mapDateType(alternative& source, ebucoreDateType *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL_CONVERT(source, startDate, dest, setdateValue, convert_timestamp)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setdateTypeGroup)
}
void mapDate(dateType& source, ebucoreDate* dest, ObjectModifier* mod = NULL) {
// no valid mapping currently for a single note element (DC date is candidate, but cardinality is wrong)
if (source.created().present()) {
dateType::created_type& date = source.created().get();
SIMPLE_MAP_OPTIONAL_CONVERT(date, startYear, dest, setyearCreated, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(date, startDate, dest, setdateCreated, convert_timestamp)
}
if (source.issued().present()) {
dateType::issued_type& date = source.issued().get();
SIMPLE_MAP_OPTIONAL_CONVERT(date, startYear, dest, setyearIssued, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(date, startDate, dest, setdateIssued, convert_timestamp)
}
if (source.modified().present()) {
dateType::modified_type& date = source.modified().get();
SIMPLE_MAP_OPTIONAL_CONVERT(date, startYear, dest, setyearModified, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(date, startDate, dest, setdateModified, convert_timestamp)
}
if (source.digitised().present()) {
dateType::digitised_type& date = source.digitised().get();
SIMPLE_MAP_OPTIONAL_CONVERT(date, startYear, dest, setyearDigitized, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(date, startDate, dest, setdateDigitized, convert_timestamp)
}
if (source.released().present()) {
dateType::released_type& date = source.released().get();
SIMPLE_MAP_OPTIONAL_CONVERT(date, startYear, dest, setyearReleased, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(date, startDate, dest, setdateReleased, convert_timestamp)
}
if (source.copyrighted().present()) {
dateType::copyrighted_type& date = source.copyrighted().get();
SIMPLE_MAP_OPTIONAL_CONVERT(date, startYear, dest, setyearCopyrighted, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(date, startDate, dest, setdateCopyrighted, convert_timestamp)
}
NEW_VECTOR_AND_ASSIGN(source, alternative, ebucoreDateType, dateType::alternative_iterator, mapDateType, dest, setalternativeDate)
}
void mapPeriodOfTime(periodOfTimeType& source, ebucorePeriodOfTime* dest, ObjectModifier* mod = NULL) {
// [TODO] PeriodId is at temporal level
//SIMPLE_MAP_OPTIONAL(source, period, dest, setperiodId)
SIMPLE_MAP_OPTIONAL_TO_NEW_VECTOR_AND_ASSIGN(source, periodName, ebucoreTextualAnnotation, mapTextualAnnotation, dest, setperiodName)
SIMPLE_MAP_OPTIONAL_CONVERT(source, startYear, dest, setperiodStartYear, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(source, startDate, dest, setperiodStartDate, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(source, startTime, dest, setperiodStartTime, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(source, endYear, dest, setperiodEndYear, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(source, endDate, dest, setperiodEndDate, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(source, endTime, dest, setperiodEndTime, convert_timestamp)
}
void mapTemporal(temporal& source, ebucoreTemporal *dest, ObjectModifier* mod = NULL) {
// [EBUCore1.4] PeriodId in temporal??
NEW_VECTOR_AND_ASSIGN(source, PeriodOfTime, ebucorePeriodOfTime, temporal::PeriodOfTime_iterator, mapPeriodOfTime, dest, setperiodOfTime)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, settemporalTypeGroup)
SIMPLE_MAP_OPTIONAL(source, note, dest, settemporalDefinitionNote)
}
void mapCoordinates(coordinates& source, ebucoreCoordinates *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_NO_GET(source, posx, dest, setposX)
SIMPLE_MAP_NO_GET(source, posy, dest, setposY)
MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source, dest, setcoordinatesFormatGroup)
}
void mapLocation(spatial::location_type& source, ebucoreLocation *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, locationId, dest, setlocationId)
SIMPLE_MAP_OPTIONAL(source, code, dest, setlocationCode)
SIMPLE_MAP_OPTIONAL(source, note, dest, setlocationDefinitionNote)
SIMPLE_MAP_OPTIONAL_TO_NEW_VECTOR_AND_ASSIGN(source, name, ebucoreTextualAnnotation, mapTextualAnnotation, dest, setlocationName)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, region, ebucoreRegion, mapRegion, dest, setlocationRegion)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, coordinates, ebucoreCoordinates, mapCoordinates, dest, setlocationCoordinates)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setlocationTypeGroup)
}
void mapSpatial(spatial& source, ebucoreSpatial *dest, ObjectModifier* mod = NULL) {
NEW_VECTOR_AND_ASSIGN(source, location, ebucoreLocation, spatial::location_iterator, mapLocation, dest, setlocation)
}
void mapMetadataCoverage(coverageType& source, ebucoreCoverage *dest, ObjectModifier* mod = NULL) {
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, coverage, ebucoreTextualAnnotation, mapTextualAnnotation, dest, setcoverageValue)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, temporal, ebucoreTemporal, mapTemporal, dest, settemporal)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, spatial, ebucoreSpatial, mapSpatial, dest, setspatial)
}
void mapRights(rightsType& source, ebucoreRights *dest, std::map<xml_schema::id, ebucoreFormat*>& formatMap, std::map<xml_schema::id, ebucoreRights*>& rightsMap, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, rightsID, dest, setrightsId)
NEW_VECTOR_AND_ASSIGN(source, rightsAttributedId, ebucoreIdentifier, rightsType::rightsAttributedId_iterator, mapIdentifier, dest, setrightsAttributeID)
NEW_VECTOR_AND_ASSIGN(source, rights, ebucoreTextualAnnotation, rightsType::rights_iterator, mapTextualAnnotation, dest, setrightsValue)
SIMPLE_MAP_OPTIONAL(source, rightsClearanceFlag, dest, setrightsClearanceFlag)
NEW_VECTOR_AND_ASSIGN(source, exploitationIssues, ebucoreTextualAnnotation, rightsType::exploitationIssues_iterator, mapTextualAnnotation, dest, setexploitationIssues)
NEW_VECTOR_AND_ASSIGN(source, copyrightStatement, ebucoreTextualAnnotation, rightsType::copyrightStatement_iterator, mapTextualAnnotation, dest, setcopyrightStatement)
SIMPLE_MAP_OPTIONAL(source, rightsLink, dest, setrightsLink)
SIMPLE_MAP_OPTIONAL(source, note, dest, setrightsNote)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, coverage, ebucoreCoverage, mapMetadataCoverage, dest, setrightsCoverage)
NEW_VECTOR_AND_ASSIGN(source, rightsHolder, ebucoreEntity, rightsType::rightsHolder_iterator, mapEntity, dest, setrightsHolderEntity)
NEW_VECTOR_AND_ASSIGN(source, contactDetails, ebucoreContact, rightsType::contactDetails_sequence::iterator, mapContact, dest, setrightsContacts)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setrightsTypeGroup)
// [TODO] Deal with format references
//SIMPLE_MAP_OPTIONAL_CONVERT(source, formatIDRefs, dest, setrightsFormatIDRef, convert)
// find this formatIdRef in the map of formats
if (source.formatIDRefs().present()) {
std::vector<ebucoreFormat*> destRefs;
rightsType::formatIDRefs_type& refs = source.formatIDRefs().get();
for (xml_schema::idrefs::iterator it = refs.begin(); it != refs.end(); it++) {
if (formatMap.find(*it) != formatMap.end()) {
// present!
destRefs.push_back(formatMap[*it]);
}
}
if (destRefs.size() > 0)
dest->setrightsFormatReferences(destRefs);
}
// and put the rights object in the map for further use
if (source.rightsID().present()) {
rightsMap[source.rightsID().get()] = dest;
}
}
void mapPublicationChannel(publicationChannelType& source, ebucorePublicationChannel* dest, ObjectModifier* mod = NULL) {
dest->setpublicationChannelName(source);
SIMPLE_MAP_OPTIONAL(source, publicationChannelId, dest, setpublicationChannelId)
SIMPLE_MAP_OPTIONAL(source, linkToLogo, dest, setpublicationChannelLinkToLogo)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setpublicationChannelType)
}
void mapPublicationMedium(publicationMediumType& source, ebucorePublicationMedium* dest, ObjectModifier* mod = NULL) {
dest->setpublicationMediumName(source);
SIMPLE_MAP_OPTIONAL(source, publicationMediumId, dest, setpublicationMediumName)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setpublicationMediumType)
}
void mapPublicationService(publicationServiceType& source, ebucorePublicationService* dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, publicationServiceName, dest, setpublicationServiceName)
SIMPLE_MAP_OPTIONAL(source, linkToLogo, dest, setpublicationServiceLinkToLogo)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, publicationSource, ebucoreOrganisation, mapOrganisation, dest, setpublicationServiceSource)
}
void mapPublicationHistoryEvent(publicationEventType& source, ebucorePublicationHistoryEvent* dest,
std::map<xml_schema::id, ebucoreFormat*>& formatMap, std::map<xml_schema::id, ebucoreRights*>& rightsMap, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, publicationEventName, dest, setpublicationEventName)
SIMPLE_MAP_OPTIONAL(source, publicationEventId, dest, setpublicationEventId)
SIMPLE_MAP_OPTIONAL(source, firstShowing, dest, setfirstPublicationFlag)
SIMPLE_MAP_OPTIONAL(source, free, dest, setfreePublicationFlag)
SIMPLE_MAP_OPTIONAL(source, live, dest, setlivePublicationFlag)
SIMPLE_MAP_OPTIONAL(source, note, dest, setpublicationNote)
SIMPLE_MAP_OPTIONAL_CONVERT(source, publicationDate, dest, setpublicationDate, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(source, publicationTime, dest, setpublicationDate, convert_timestamp)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, publicationChannel, ebucorePublicationChannel, mapPublicationChannel, dest, setpublicationChannel)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, publicationMedium, ebucorePublicationMedium, mapPublicationMedium, dest, setpublicationMedium)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, publicationService, ebucorePublicationService, mapPublicationService, dest, setpublicationService)
NEW_VECTOR_AND_ASSIGN(source, publicationRegion, ebucoreRegion, publicationEventType::publicationRegion_iterator, mapRegion, dest, setpublicationRegion)
if (source.formatIdRef().present()) {
// find this formatIdRef in the map of formats
if (formatMap.find(source.formatIdRef().get()) != formatMap.end()) {
// present!
dest->setpublicationFormatReference(formatMap[source.formatIdRef().get()]);
}
}
if (source.rightsIDRefs().present()) {
publicationEventType::rightsIDRefs_type& rightsrefs = source.rightsIDRefs().get();
if (rightsrefs.size() > 0) {
// for each of the references to a rights object, locate it in the rights map
std::vector<ebucoreRights*> vec_rights;
for (publicationEventType::rightsIDRefs_type::const_iterator it = rightsrefs.begin(); it != rightsrefs.end(); it++) {
if (rightsMap.find(*it) != rightsMap.end()) {
// present!
vec_rights.push_back(rightsMap[*it]);
}
}
dest->setpublicationRightsReference(vec_rights);
// find this formatIdRef in the map of formats
}
}
}
void mapPublicationHistory(publicationHistoryType& source, ebucorePublicationHistory *dest, mxfpp::HeaderMetadata *header_metadata,
std::map<xml_schema::id, ebucoreFormat*>& formatMap, std::map<xml_schema::id, ebucoreRights*>& rightsMap, ObjectModifier* mod = NULL) {
std::vector<ebucorePublicationHistoryEvent*> vec_dest_hist;
for (publicationHistoryType::publicationEvent_iterator it = source.publicationEvent().begin(); it != source.publicationEvent().end(); it++) {
ebucorePublicationHistoryEvent *obj = newAndModifyObject<ebucorePublicationHistoryEvent>(header_metadata, mod);
// special case of conversion using the format map
mapPublicationHistoryEvent(*it, obj, formatMap, rightsMap, mod);
vec_dest_hist.push_back(obj);
}
dest->setpublicationEvent(vec_dest_hist);
}
#define MAP_BASIC_RELATION_FUNCTION(destProperty) \
void mapBasicRelation_##destProperty(relationType& source, ebucoreBasicRelation *dest, ObjectModifier* mod = NULL) { \
SIMPLE_MAP_OPTIONAL(source, relationLink, dest, destProperty) \
}
MAP_BASIC_RELATION_FUNCTION(setisVersionOf)
MAP_BASIC_RELATION_FUNCTION(sethasVersion)
MAP_BASIC_RELATION_FUNCTION(setisReplacedBy)
MAP_BASIC_RELATION_FUNCTION(setreplaces)
MAP_BASIC_RELATION_FUNCTION(setisRequiredBy)
MAP_BASIC_RELATION_FUNCTION(setrequires)
MAP_BASIC_RELATION_FUNCTION(setisPartOf)
MAP_BASIC_RELATION_FUNCTION(sethasPart)
MAP_BASIC_RELATION_FUNCTION(setisReferencedBy)
MAP_BASIC_RELATION_FUNCTION(setreferences)
MAP_BASIC_RELATION_FUNCTION(setisFormatOf)
MAP_BASIC_RELATION_FUNCTION(sethasFormat)
MAP_BASIC_RELATION_FUNCTION(setisEpisodeOf)
MAP_BASIC_RELATION_FUNCTION(setisMemberOf)
void mapBasicRelations(coreMetadataType& source, ebucoreCoreMetadata *dest, ObjectModifier* mod = NULL) {
std::vector<ebucoreBasicRelation*> rels;
NEW_VECTOR_AND_APPEND(source, isVersionOf, ebucoreBasicRelation,
coreMetadataType::isVersionOf_iterator, mapBasicRelation_setisVersionOf, dest, rels)
NEW_VECTOR_AND_APPEND(source, hasVersion, ebucoreBasicRelation,
coreMetadataType::hasVersion_iterator, mapBasicRelation_sethasVersion, dest, rels)
NEW_VECTOR_AND_APPEND(source, isReplacedBy, ebucoreBasicRelation,
coreMetadataType::isReplacedBy_iterator, mapBasicRelation_setisReplacedBy, dest, rels)
NEW_VECTOR_AND_APPEND(source, replaces, ebucoreBasicRelation,
coreMetadataType::replaces_iterator, mapBasicRelation_setreplaces, dest, rels)
NEW_VECTOR_AND_APPEND(source, isRequiredBy, ebucoreBasicRelation,
coreMetadataType::isRequiredBy_iterator, mapBasicRelation_setisRequiredBy, dest, rels)
NEW_VECTOR_AND_APPEND(source, requires, ebucoreBasicRelation,
coreMetadataType::requires_iterator, mapBasicRelation_setrequires, dest, rels)
NEW_VECTOR_AND_APPEND(source, isPartOf, ebucoreBasicRelation,
coreMetadataType::isPartOf_iterator, mapBasicRelation_setisPartOf, dest, rels)
NEW_VECTOR_AND_APPEND(source, hasPart, ebucoreBasicRelation,
coreMetadataType::hasPart_iterator, mapBasicRelation_sethasVersion, dest, rels)
NEW_VECTOR_AND_APPEND(source, isReferencedBy, ebucoreBasicRelation,
coreMetadataType::isReferencedBy_iterator, mapBasicRelation_setisReferencedBy, dest, rels)
NEW_VECTOR_AND_APPEND(source, references, ebucoreBasicRelation,
coreMetadataType::references_iterator, mapBasicRelation_setreferences, dest, rels)
NEW_VECTOR_AND_APPEND(source, isFormatOf, ebucoreBasicRelation,
coreMetadataType::isFormatOf_iterator, mapBasicRelation_setisFormatOf, dest, rels)
NEW_VECTOR_AND_APPEND(source, hasFormat, ebucoreBasicRelation,
coreMetadataType::hasFormat_iterator, mapBasicRelation_sethasFormat, dest, rels)
NEW_VECTOR_AND_APPEND(source, isEpisodeOf, ebucoreBasicRelation,
coreMetadataType::isEpisodeOf_iterator, mapBasicRelation_setisEpisodeOf, dest, rels)
NEW_VECTOR_AND_APPEND(source, isMemberOf, ebucoreBasicRelation,
coreMetadataType::isMemberOf_iterator, mapBasicRelation_setisMemberOf, dest, rels)
dest->setbasicRelation(rels);
}
void mapCustomRelation(relationType& source, ebucoreCustomRelation *dest, ObjectModifier* mod = NULL) {
// [TODO] XSD relationIdentifier is identifierType, KLV identifier is a UMID, how do we resolve?
SIMPLE_MAP_OPTIONAL(source, relation, dest, setrelationByName)
SIMPLE_MAP_OPTIONAL(source, relationLink, dest, setrelationLink)
SIMPLE_MAP_OPTIONAL(source, runningOrderNumber, dest, setrunningOrderNumber)
SIMPLE_MAP_OPTIONAL(source, totalNumberOfGroupMembers, dest, settotalNumberOfGroupMembers)
SIMPLE_MAP_OPTIONAL(source, orderedGroupFlag, dest, setorderedGroupFlag)
SIMPLE_MAP_OPTIONAL(source, note, dest, setrelationNote)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setcustomRelationTypeGroup)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, relationIdentifier, ebucoreIdentifier, mapIdentifier, dest, setrelationIdentifier)
}
#define MAP_TECHNICAL_ATTRIBUTE_FUNCTION(functionName, sourceType, destType, destProperty) \
void functionName(sourceType& source, destType *dest, ObjectModifier* mod) { \
dest->destProperty(source); \
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, settechnicalAttributeTypeGroup) \
}
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeString, String, ebucoreTechnicalAttributeString, settechnicalAttributeStringValue)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeInt8, Int8, ebucoreTechnicalAttributeInt8, settechnicalAttributeInt8Value)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeInt16, Int16, ebucoreTechnicalAttributeInt16, settechnicalAttributeInt16Value)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeInt32, Int32, ebucoreTechnicalAttributeInt32, settechnicalAttributeInt32Value)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeInt64, Int64, ebucoreTechnicalAttributeInt64, settechnicalAttributeInt64Value)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeUInt8, UInt8, ebucoreTechnicalAttributeUInt8, settechnicalAttributeUInt8Value)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeUInt16, UInt16, ebucoreTechnicalAttributeUInt16, settechnicalAttributeUInt16Value)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeUInt32, UInt32, ebucoreTechnicalAttributeUInt32, settechnicalAttributeUInt32Value)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeUInt64, UInt64, ebucoreTechnicalAttributeUInt64, settechnicalAttributeUInt64Value)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeFloat, Float, ebucoreTechnicalAttributeFloat, settechnicalAttributeFloatValue)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeAnyURI, technicalAttributeUriType, ebucoreTechnicalAttributeAnyURI, settechnicalAttributeAnyURIValue)
MAP_TECHNICAL_ATTRIBUTE_FUNCTION(mapTechnicalAttributeBoolean, Boolean, ebucoreTechnicalAttributeBoolean, settechnicalAttributeBooleanValue)
void mapTechnicalAttributeRational(technicalAttributeRationalType& source, ebucoreTechnicalAttributeRational *dest, ObjectModifier* mod) {
mxfRational r = { source.factorNumerator(), source.factorDenominator() };
dest->settechnicalAttributeRationalValue(r);
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, settechnicalAttributeTypeGroup)
}
void mapMedium(medium& source, ebucoreMedium *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, mediumId, dest, setmediumID)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setmediumTypeGroup)
}
void mapPackageInfo(formatType& source, ebucorePackageInfo *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, fileName, dest, setpackageName)
SIMPLE_MAP_OPTIONAL(source, fileSize, dest, setpackageSize)
if (source.locator().size() > 0) {
dest->setpackageLocator( source.locator()[0] );
}
}
void mapSigningFormat(signingFormat& source, ebucoreSigningFormat *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, trackId, dest, setsigningTrackID)
SIMPLE_MAP_OPTIONAL(source, trackName, dest, setsigningTrackName)
SIMPLE_MAP_OPTIONAL(source, language, dest, setsigningTrackLanguageCode)
SIMPLE_MAP_OPTIONAL(source, signingSourceUri, dest, setsigningSourceUri)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setsigningTypeGroup)
MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source, dest, setsigningFormatGroup)
}
void mapCodec(codecType& source, ebucoreCodec *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, name, dest, setname)
SIMPLE_MAP_OPTIONAL(source, vendor, dest, setvendor)
SIMPLE_MAP_OPTIONAL(source, version, dest, setversion)
SIMPLE_MAP_OPTIONAL(source, family, dest, setfamily)
// [TODO] XSD Codec identifier is an identifiertype, KLV is string
//SIMPLE_MAP_OPTIONAL(source, codecIdentifier, dest, setcodecIdentifier)
}
void mapAudioTrack(audioTrack& source, ebucoreTrack *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, trackId, dest, settrackID)
SIMPLE_MAP_OPTIONAL(source, trackName, dest, settrackName)
SIMPLE_MAP_OPTIONAL(source, trackLanguage, dest, settrackLanguageCode)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, settrackTypeGroup)
}
void mapVideoTrack(videoTrack& source, ebucoreTrack *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, trackId, dest, settrackID)
SIMPLE_MAP_OPTIONAL(source, trackName, dest, settrackName)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, settrackTypeGroup)
}
void mapAudioFormat(audioFormatType& source, ebucoreAudioFormat *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, audioFormatId, dest, setaudioFormatID)
SIMPLE_MAP_OPTIONAL(source, audioFormatName, dest, setaudioFormatName)
SIMPLE_MAP_OPTIONAL(source, audioFormatDefinition, dest, setaudioFormatDefinition)
if (source.audioTrackConfiguration().present()) {
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source.audioTrackConfiguration().get(), dest, setaudioTrackConfiguration)
}
SIMPLE_MAP_OPTIONAL(source, sampleSize, dest, setaudioSamplingSize)
SIMPLE_MAP_OPTIONAL(source, sampleType, dest, setaudioSamplingType)
SIMPLE_MAP_OPTIONAL(source, channels, dest, setaudioTotalNumberOfChannels)
SIMPLE_MAP_OPTIONAL(source, bitRate, dest, setaudioBitRate)
SIMPLE_MAP_OPTIONAL(source, bitRateMax, dest, setaudioMaxBitRate)
SIMPLE_MAP_OPTIONAL(source, bitRateMode, dest, setaudioBitRateMode)
SIMPLE_MAP_OPTIONAL_CONVERT(source, samplingRate, dest, setaudioSamplingRate, convert)
if (source.audioEncoding().present()) {
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source.audioEncoding().get(), dest, setaudioEncoding)
}
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, codec, ebucoreCodec, mapCodec, dest, setaudioCodec)
NEW_VECTOR_AND_ASSIGN(source, audioTrack, ebucoreTrack, audioFormatType::audioTrack_iterator, mapAudioTrack, dest, setaudioTrack)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeString, ebucoreTechnicalAttributeString,
audioFormatType::technicalAttributeString_iterator, mapTechnicalAttributeString, dest, setaudioTechnicalAttributeString)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeByte, ebucoreTechnicalAttributeInt8,
audioFormatType::technicalAttributeByte_iterator, mapTechnicalAttributeInt8, dest, setaudioTechnicalAttributeInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeShort, ebucoreTechnicalAttributeInt16,
audioFormatType::technicalAttributeShort_iterator, mapTechnicalAttributeInt16, dest, setaudioTechnicalAttributeInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeInteger, ebucoreTechnicalAttributeInt32,
audioFormatType::technicalAttributeInteger_iterator, mapTechnicalAttributeInt32, dest, setaudioTechnicalAttributeInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeLong, ebucoreTechnicalAttributeInt64,
audioFormatType::technicalAttributeLong_iterator, mapTechnicalAttributeInt64, dest, setaudioTechnicalAttributeInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedByte, ebucoreTechnicalAttributeUInt8,
audioFormatType::technicalAttributeUnsignedByte_iterator, mapTechnicalAttributeUInt8, dest, setaudioTechnicalAttributeUInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedShort, ebucoreTechnicalAttributeUInt16,
audioFormatType::technicalAttributeUnsignedShort_iterator, mapTechnicalAttributeUInt16, dest, setaudioTechnicalAttributeUInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedInteger, ebucoreTechnicalAttributeUInt32,
audioFormatType::technicalAttributeUnsignedInteger_iterator, mapTechnicalAttributeUInt32, dest, setaudioTechnicalAttributeUInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedLong, ebucoreTechnicalAttributeUInt64,
audioFormatType::technicalAttributeUnsignedLong_iterator, mapTechnicalAttributeUInt64, dest, setaudioTechnicalAttributeUInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeFloat, ebucoreTechnicalAttributeFloat,
audioFormatType::technicalAttributeFloat_iterator, mapTechnicalAttributeFloat, dest, setaudioTechnicalAttributeFloat)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeRational, ebucoreTechnicalAttributeRational,
audioFormatType::technicalAttributeRational_iterator, mapTechnicalAttributeRational, dest, setaudioTechnicalAttributeRational)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUri, ebucoreTechnicalAttributeAnyURI,
audioFormatType::technicalAttributeUri_iterator, mapTechnicalAttributeAnyURI, dest, setaudioTechnicalAttributeAnyURI)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeBoolean, ebucoreTechnicalAttributeBoolean,
audioFormatType::technicalAttributeBoolean_iterator, mapTechnicalAttributeBoolean, dest, setaudioTechnicalAttributeBoolean)
}
void mapAspectRatio(aspectRatioType& source, ebucoreAspectRatio *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_NO_GET(source, factorNumerator, dest, setaspectRatioFactorNumerator)
SIMPLE_MAP_NO_GET(source, factorDenominator, dest, setaspectRatioFactorDenominator)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setaspectRatioTypeGroup)
}
void mapDimension(lengthType& source, ebucoreDimension *dest, ObjectModifier* mod = NULL) {
dest->setdimensionValue(source);
SIMPLE_MAP_OPTIONAL(source, unit, dest, setdimensionUnit)
}
void mapDimension(dimensionType& source, ebucoreDimension *dest, ObjectModifier* mod = NULL) {
dest->setdimensionValue(source);
SIMPLE_MAP_OPTIONAL(source, unit, dest, setdimensionUnit)
}
void mapWidth(width& source, ebucoreWidth *dest, ObjectModifier* mod = NULL) {
ebucoreDimension *obj = newAndModifyObject<ebucoreDimension>(dest->getHeaderMetadata(), mod);
mapDimension(source, obj, mod);
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setwidthTypeGroup)
}
void mapHeight(height& source, ebucoreHeight *dest, ObjectModifier* mod = NULL) {
ebucoreDimension *obj = newAndModifyObject<ebucoreDimension>(dest->getHeaderMetadata(), mod);
mapDimension(source, obj, mod);
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setheightTypeGroup)
}
void mapImageFormat(imageFormatType& source, ebucoreImageFormat *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, imageFormatId, dest, setimageFormatID)
SIMPLE_MAP_OPTIONAL(source, imageFormatName, dest, setimageFormatName)
SIMPLE_MAP_OPTIONAL(source, imageFormatDefinition, dest, setimageFormatDefinition)
SIMPLE_MAP_OPTIONAL(source, orientation, dest, setimageOrientation)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, aspectRatio, ebucoreAspectRatio, mapAspectRatio, dest, setimageAspectRatio)
if (source.imageEncoding().present()) {
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source.imageEncoding().get(), dest, setimageEncoding)
}
/* [TODO] XSD is missing image codec!!
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, codec, ebucoreCodec, mapCodec, dest, setimageCodec) */
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, width, ebucoreDimension, mapDimension, dest, setimageWidth)
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, height, ebucoreDimension, mapDimension, dest, setimageHeight)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeString, ebucoreTechnicalAttributeString,
imageFormatType::technicalAttributeString_iterator, mapTechnicalAttributeString, dest, setimageTechnicalAttributeString)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeByte, ebucoreTechnicalAttributeInt8,
imageFormatType::technicalAttributeByte_iterator, mapTechnicalAttributeInt8, dest, setimageTechnicalAttributeInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeShort, ebucoreTechnicalAttributeInt16,
imageFormatType::technicalAttributeShort_iterator, mapTechnicalAttributeInt16, dest, setimageTechnicalAttributeInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeInteger, ebucoreTechnicalAttributeInt32,
imageFormatType::technicalAttributeInteger_iterator, mapTechnicalAttributeInt32, dest, setimageTechnicalAttributeInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeLong, ebucoreTechnicalAttributeInt64,
imageFormatType::technicalAttributeLong_iterator, mapTechnicalAttributeInt64, dest, setimageTechnicalAttributeInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedByte, ebucoreTechnicalAttributeUInt8,
imageFormatType::technicalAttributeUnsignedByte_iterator, mapTechnicalAttributeUInt8, dest, setimageTechnicalAttributeUInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedShort, ebucoreTechnicalAttributeUInt16,
imageFormatType::technicalAttributeUnsignedShort_iterator, mapTechnicalAttributeUInt16, dest, setimageTechnicalAttributeUInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedInteger, ebucoreTechnicalAttributeUInt32,
imageFormatType::technicalAttributeUnsignedInteger_iterator, mapTechnicalAttributeUInt32, dest, setimageTechnicalAttributeUInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedLong, ebucoreTechnicalAttributeUInt64,
imageFormatType::technicalAttributeUnsignedLong_iterator, mapTechnicalAttributeUInt64, dest, setimageTechnicalAttributeUInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeFloat, ebucoreTechnicalAttributeFloat,
imageFormatType::technicalAttributeFloat_iterator, mapTechnicalAttributeFloat, dest, setimageTechnicalAttributeFloat)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeRational, ebucoreTechnicalAttributeRational,
imageFormatType::technicalAttributeRational_iterator, mapTechnicalAttributeRational, dest, setimageTechnicalAttributeRational)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUri, ebucoreTechnicalAttributeAnyURI,
imageFormatType::technicalAttributeUri_iterator, mapTechnicalAttributeAnyURI, dest, setimageTechnicalAttributeAnyURI)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeBoolean, ebucoreTechnicalAttributeBoolean,
imageFormatType::technicalAttributeBoolean_iterator, mapTechnicalAttributeBoolean, dest, setimageTechnicalAttributeBoolean)
}
void mapVideoFormat(videoFormatType& source, ebucoreVideoFormat *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, videoFormatId, dest, setvideoFormatID)
SIMPLE_MAP_OPTIONAL(source, videoFormatName, dest, setvideoFormatName)
SIMPLE_MAP_OPTIONAL(source, videoFormatDefinition, dest, setvideoFormatDefinition)
SIMPLE_MAP_OPTIONAL(source, bitRate, dest, setvideoBitRate)
SIMPLE_MAP_OPTIONAL(source, bitRateMax, dest, setvideoMaxBitRate)
SIMPLE_MAP_OPTIONAL(source, bitRateMode, dest, setvideoBitRateMode)
SIMPLE_MAP_OPTIONAL(source, scanningFormat, dest, setvideoSamplingFormat)
SIMPLE_MAP_OPTIONAL(source, scanningOrder, dest, setvideoScanningOrder)
SIMPLE_MAP_OPTIONAL(source, lines, dest, setvideoActiveLines)
SIMPLE_MAP_OPTIONAL(source, noiseFilter, dest, setvideoNoiseFilterFlag)
SIMPLE_MAP_OPTIONAL(source, flag_3D, dest, setvideo3DFlag)
NEW_VECTOR_AND_ASSIGN(source, aspectRatio, ebucoreAspectRatio, videoFormatType::aspectRatio_iterator, mapAspectRatio, dest, setvideoAspectRatio)
SIMPLE_MAP_OPTIONAL_CONVERT(source, frameRate, dest, setvideoFrameRate, convert)
if (source.width().size() > 0) {
NEW_OBJECT_AND_ASSIGN_DIRECT(source.width()[0], ebucoreWidth, mapWidth, dest, setvideoWidth)
}
if (source.height().size() > 0) {
NEW_OBJECT_AND_ASSIGN_DIRECT(source.height()[0], ebucoreHeight, mapHeight, dest, setvideoHeight)
}
if (source.videoEncoding().present()) {
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source.videoEncoding().get(), dest, setvideoEncoding)
}
NEW_OBJECT_AND_ASSIGN_OPTIONAL(source, codec, ebucoreCodec, mapCodec, dest, setvideoCodec)
NEW_VECTOR_AND_ASSIGN(source, videoTrack, ebucoreTrack, videoFormatType::videoTrack_iterator, mapVideoTrack, dest, setvideoTrack)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeString, ebucoreTechnicalAttributeString,
videoFormatType::technicalAttributeString_iterator, mapTechnicalAttributeString, dest, setvideoTechnicalAttributeString)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeByte, ebucoreTechnicalAttributeInt8,
videoFormatType::technicalAttributeByte_iterator, mapTechnicalAttributeInt8, dest, setvideoTechnicalAttributeInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeShort, ebucoreTechnicalAttributeInt16,
videoFormatType::technicalAttributeShort_iterator, mapTechnicalAttributeInt16, dest, setvideoTechnicalAttributeInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeInteger, ebucoreTechnicalAttributeInt32,
videoFormatType::technicalAttributeInteger_iterator, mapTechnicalAttributeInt32, dest, setvideoTechnicalAttributeInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeLong, ebucoreTechnicalAttributeInt64,
videoFormatType::technicalAttributeLong_iterator, mapTechnicalAttributeInt64, dest, setvideoTechnicalAttributeInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedByte, ebucoreTechnicalAttributeUInt8,
videoFormatType::technicalAttributeUnsignedByte_iterator, mapTechnicalAttributeUInt8, dest, setvideoTechnicalAttributeUInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedShort, ebucoreTechnicalAttributeUInt16,
videoFormatType::technicalAttributeUnsignedShort_iterator, mapTechnicalAttributeUInt16, dest, setvideoTechnicalAttributeUInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedInteger, ebucoreTechnicalAttributeUInt32,
videoFormatType::technicalAttributeUnsignedInteger_iterator, mapTechnicalAttributeUInt32, dest, setvideoTechnicalAttributeUInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedLong, ebucoreTechnicalAttributeUInt64,
videoFormatType::technicalAttributeUnsignedLong_iterator, mapTechnicalAttributeUInt64, dest, setvideoTechnicalAttributeUInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeFloat, ebucoreTechnicalAttributeFloat,
videoFormatType::technicalAttributeFloat_iterator, mapTechnicalAttributeFloat, dest, setvideoTechnicalAttributeFloat)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeRational, ebucoreTechnicalAttributeRational,
videoFormatType::technicalAttributeRational_iterator, mapTechnicalAttributeRational, dest, setvideoTechnicalAttributeRational)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUri, ebucoreTechnicalAttributeAnyURI,
videoFormatType::technicalAttributeUri_iterator, mapTechnicalAttributeAnyURI, dest, setvideoTechnicalAttributeAnyURI)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeBoolean, ebucoreTechnicalAttributeBoolean,
videoFormatType::technicalAttributeBoolean_iterator, mapTechnicalAttributeBoolean, dest, setvideoTechnicalAttributeBoolean)
}
void mapCaptioning(captioningFormat& source, ebucoreCaptioning* dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, captioningFormatId, dest, setcaptioningFormatID)
SIMPLE_MAP_OPTIONAL(source, captioningFormatName, dest, setcaptioningFormatName)
SIMPLE_MAP_OPTIONAL(source, captioningSourceUri, dest, setcaptioningSourceUri)
SIMPLE_MAP_OPTIONAL(source, trackId, dest, setcaptioningTrackID)
SIMPLE_MAP_OPTIONAL(source, trackName, dest, setcaptioningTrackName)
SIMPLE_MAP_OPTIONAL(source, language, dest, setcaptioningLanguageCode)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setcaptioningTypeGroup)
MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source, dest, setcaptioningFormatGroup)
}
void mapSubtitling(subtitlingFormat& source, ebucoreSubtitling* dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, subtitlingFormatId, dest, setsubtitlingFormatID)
SIMPLE_MAP_OPTIONAL(source, subtitlingFormatName, dest, setsubtitlingFormatName)
SIMPLE_MAP_OPTIONAL(source, subtitlingSourceUri, dest, setsubtitlingSourceUri)
SIMPLE_MAP_OPTIONAL(source, trackId, dest, setsubtitlingTrackID)
SIMPLE_MAP_OPTIONAL(source, trackName, dest, setsubtitlingTrackName)
SIMPLE_MAP_OPTIONAL(source, language, dest, setsubtitlingLanguageCode)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setsubtitlingTypeGroup)
MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source, dest, setsubtitlingFormatGroup)
}
void mapSigning(signingFormat& source, ebucoreSigningFormat* dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, signingFormatId, dest, setsigningFormatID)
SIMPLE_MAP_OPTIONAL(source, signingFormatName, dest, setsigningFormatName)
SIMPLE_MAP_OPTIONAL(source, signingSourceUri, dest, setsigningSourceUri)
SIMPLE_MAP_OPTIONAL(source, trackId, dest, setsigningTrackID)
SIMPLE_MAP_OPTIONAL(source, trackName, dest, setsigningTrackName)
SIMPLE_MAP_OPTIONAL(source, language, dest, setsigningTrackLanguageCode)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setsigningTypeGroup)
MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source, dest, setsigningFormatGroup)
}
void mapAncillaryData(ancillaryDataFormat& source, ebucoreAncillaryData* dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, DID, dest, setDID)
SIMPLE_MAP_OPTIONAL(source, SDID, dest, setSDID)
std::vector<uint32_t> vec_lines;
for (ancillaryDataFormat::lineNumber_const_iterator it = source.lineNumber().begin(); it != source.lineNumber().end(); it++) {
vec_lines.push_back(*it);
}
dest->setlineNumber(vec_lines);
ebucoreTypeGroup *obj = newAndModifyObject<ebucoreTypeGroup>(dest->getHeaderMetadata(), mod);
// source is only an integer to map from, lets be creative
SIMPLE_MAP_OPTIONAL(source, ancillaryDataFormatName, obj, settypeGroupLabel)
SIMPLE_MAP_OPTIONAL(source, ancillaryDataFormatId, obj, settypeGroupLink)
SIMPLE_MAP_OPTIONAL_CONVERT(source, wrappingType, obj, settypeGroupDefinition, convert_to_string)
}
void mapDataFormat(dataFormatType& source, ebucoreDataFormat *dest, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, dataFormatId, dest, setdataFormatID)
SIMPLE_MAP_OPTIONAL(source, dataFormatVersionId, dest, setdataFormatVersionID)
SIMPLE_MAP_OPTIONAL(source, dataFormatName, dest, setdataFormatName)
SIMPLE_MAP_OPTIONAL(source, dataFormatDefinition, dest, setdataFormatDefinition)
SIMPLE_MAP_OPTIONAL(source, dataTrackId, dest, setdataTrackId)
SIMPLE_MAP_OPTIONAL(source, dataTrackName, dest, setdataTrackName)
SIMPLE_MAP_OPTIONAL(source, dataTrackLanguage, dest, setdataTrackLanguageCode)
NEW_VECTOR_AND_ASSIGN(source, captioningFormat, ebucoreCaptioning, dataFormatType::captioningFormat_iterator, mapCaptioning, dest, setcaptioning)
NEW_VECTOR_AND_ASSIGN(source, subtitlingFormat, ebucoreSubtitling, dataFormatType::subtitlingFormat_iterator, mapSubtitling, dest, setsubtitling)
NEW_VECTOR_AND_ASSIGN(source, ancillaryDataFormat, ebucoreAncillaryData, dataFormatType::ancillaryDataFormat_iterator, mapAncillaryData, dest, setancillaryData)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeString, ebucoreTechnicalAttributeString,
dataFormatType::technicalAttributeString_iterator, mapTechnicalAttributeString, dest, setdataTechnicalAttributeString)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeByte, ebucoreTechnicalAttributeInt8,
dataFormatType::technicalAttributeByte_iterator, mapTechnicalAttributeInt8, dest, setdataTechnicalAttributeInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeShort, ebucoreTechnicalAttributeInt16,
dataFormatType::technicalAttributeShort_iterator, mapTechnicalAttributeInt16, dest, setdataTechnicalAttributeInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeInteger, ebucoreTechnicalAttributeInt32,
dataFormatType::technicalAttributeInteger_iterator, mapTechnicalAttributeInt32, dest, setdataTechnicalAttributeInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeLong, ebucoreTechnicalAttributeInt64,
dataFormatType::technicalAttributeLong_iterator, mapTechnicalAttributeInt64, dest, setdataTechnicalAttributeInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedByte, ebucoreTechnicalAttributeUInt8,
dataFormatType::technicalAttributeUnsignedByte_iterator, mapTechnicalAttributeUInt8, dest, setdataTechnicalAttributeUInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedShort, ebucoreTechnicalAttributeUInt16,
dataFormatType::technicalAttributeUnsignedShort_iterator, mapTechnicalAttributeUInt16, dest, setdataTechnicalAttributeUInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedInteger, ebucoreTechnicalAttributeUInt32,
dataFormatType::technicalAttributeUnsignedInteger_iterator, mapTechnicalAttributeUInt32, dest, setdataTechnicalAttributeUInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedLong, ebucoreTechnicalAttributeUInt64,
dataFormatType::technicalAttributeUnsignedLong_iterator, mapTechnicalAttributeUInt64, dest, setdataTechnicalAttributeUInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeFloat, ebucoreTechnicalAttributeFloat,
dataFormatType::technicalAttributeFloat_iterator, mapTechnicalAttributeFloat, dest, setdataTechnicalAttributeFloat)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeRational, ebucoreTechnicalAttributeRational,
dataFormatType::technicalAttributeRational_iterator, mapTechnicalAttributeRational, dest, setdataTechnicalAttributeRational)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUri, ebucoreTechnicalAttributeAnyURI,
dataFormatType::technicalAttributeUri_iterator, mapTechnicalAttributeAnyURI, dest, setdataTechnicalAttributeAnyURI)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeBoolean, ebucoreTechnicalAttributeBoolean,
dataFormatType::technicalAttributeBoolean_iterator, mapTechnicalAttributeBoolean, dest, setdataTechnicalAttributeBoolean)
}
void mapFormat(formatType& source, ebucoreFormat *dest, std::map<xml_schema::id, ebucoreFormat*>& formatMap, ObjectModifier* mod = NULL) {
SIMPLE_MAP_OPTIONAL(source, formatId, dest, setformatID)
SIMPLE_MAP_OPTIONAL(source, formatVersionId, dest, setformatVersionID)
SIMPLE_MAP_OPTIONAL(source, formatName, dest, setformatName)
SIMPLE_MAP_OPTIONAL(source, formatDefinition, dest, setformatDefinition)
if (source.dateCreated().present()) {
SIMPLE_MAP_OPTIONAL_CONVERT(source, dateCreated().get().startYear, dest, setformatYearCreated, convert_timestamp)
SIMPLE_MAP_OPTIONAL_CONVERT(source, dateCreated().get().startDate, dest, setformatDateCreated, convert_timestamp)
}
if (source.duration().present()) {
// [NOTE] Mapped playtime as duration because we need a numeric value (rational) # of seconds.
// [NOTE] We just map the timecode as a string to the KLV representation
SIMPLE_MAP_OPTIONAL(source, duration().get().editUnitNumber, dest, setoverallDurationEditUnit)
SIMPLE_MAP_OPTIONAL(source, duration().get().timecode, dest, setoverallDurationTimecode)
SIMPLE_MAP_OPTIONAL_CONVERT(source, duration().get().normalPlayTime, dest, setoverallDurationTime, convert_rational)
}
if (source.containerFormat().size() > 0) {
MAP_NEW_FORMAT_GROUP_AND_ASSIGN(source.containerFormat()[0], dest, setcontainerFormat)
}
if (source.medium().size() > 0) {
NEW_OBJECT_AND_ASSIGN_DIRECT(source.medium()[0], ebucoreMedium, mapMedium, dest, setmedium)
}
ebucorePackageInfo *obj = newAndModifyObject<ebucorePackageInfo>(dest->getHeaderMetadata(), mod);
mapPackageInfo(source, obj, mod);
dest->setpackageInfo(obj);
if (source.mimeType().size() > 0) {
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source.mimeType()[0], dest, setmimeType)
}
NEW_VECTOR_AND_ASSIGN(source, audioFormat, ebucoreAudioFormat, formatType::audioFormat_iterator, mapAudioFormat, dest, setmaterialAudioFormat)
NEW_VECTOR_AND_ASSIGN(source, videoFormat, ebucoreVideoFormat, formatType::videoFormat_iterator, mapVideoFormat, dest, setmaterialVideoFormat)
NEW_VECTOR_AND_ASSIGN(source, imageFormat, ebucoreImageFormat, formatType::imageFormat_iterator, mapImageFormat, dest, setmaterialImageFormat)
NEW_VECTOR_AND_ASSIGN(source, dataFormat, ebucoreDataFormat, formatType::dataFormat_iterator, mapDataFormat, dest, setmaterialDataFormat)
NEW_VECTOR_AND_ASSIGN(source, signingFormat, ebucoreSigningFormat, formatType::signingFormat_iterator, mapSigningFormat, dest, setmaterialSigningFormat)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeString, ebucoreTechnicalAttributeString,
formatType::technicalAttributeString_iterator, mapTechnicalAttributeString, dest, setmaterialTechnicalAttributeString)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeByte, ebucoreTechnicalAttributeInt8,
formatType::technicalAttributeByte_iterator, mapTechnicalAttributeInt8, dest, setmaterialTechnicalAttributeInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeShort, ebucoreTechnicalAttributeInt16,
formatType::technicalAttributeShort_iterator, mapTechnicalAttributeInt16, dest, setmaterialTechnicalAttributeInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeInteger, ebucoreTechnicalAttributeInt32,
formatType::technicalAttributeInteger_iterator, mapTechnicalAttributeInt32, dest, setmaterialTechnicalAttributeInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeLong, ebucoreTechnicalAttributeInt64,
formatType::technicalAttributeLong_iterator, mapTechnicalAttributeInt64, dest, setmaterialTechnicalAttributeInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedByte, ebucoreTechnicalAttributeUInt8,
formatType::technicalAttributeUnsignedByte_iterator, mapTechnicalAttributeUInt8, dest, setmaterialTechnicalAttributeUInt8)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedShort, ebucoreTechnicalAttributeUInt16,
formatType::technicalAttributeUnsignedShort_iterator, mapTechnicalAttributeUInt16, dest, setmaterialTechnicalAttributeUInt16)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedInteger, ebucoreTechnicalAttributeUInt32,
formatType::technicalAttributeUnsignedInteger_iterator, mapTechnicalAttributeUInt32, dest, setmaterialTechnicalAttributeUInt32)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUnsignedLong, ebucoreTechnicalAttributeUInt64,
formatType::technicalAttributeUnsignedLong_iterator, mapTechnicalAttributeUInt64, dest, setmaterialTechnicalAttributeUInt64)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeFloat, ebucoreTechnicalAttributeFloat,
formatType::technicalAttributeFloat_iterator, mapTechnicalAttributeFloat, dest, setmaterialTechnicalAttributeFloat)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeRational, ebucoreTechnicalAttributeRational,
formatType::technicalAttributeRational_iterator, mapTechnicalAttributeRational, dest, setmaterialTechnicalAttributeRational)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeUri, ebucoreTechnicalAttributeAnyURI,
formatType::technicalAttributeUri_iterator, mapTechnicalAttributeAnyURI, dest, setmaterialTechnicalAttributeAnyURI)
NEW_VECTOR_AND_ASSIGN(source, technicalAttributeBoolean, ebucoreTechnicalAttributeBoolean,
formatType::technicalAttributeBoolean_iterator, mapTechnicalAttributeBoolean, dest, setmaterialTechnicalAttributeBoolean)
// add this format element to the list
if (source.formatId().present()) {
formatMap[source.formatId().get()] = dest;
}
}
void mapPart(partType& source, ebucorePartMetadata *dest, mxfRational overallFrameRate, std::vector<ebucorePartMetadata*>& timelineParts, ObjectModifier* mod) {
SIMPLE_MAP_OPTIONAL(source, partId, dest, setpartId)
SIMPLE_MAP_OPTIONAL(source, partName, dest, setpartName)
SIMPLE_MAP_OPTIONAL(source, partDefinition, dest, setpartDefinition)
MAP_NEW_TYPE_GROUP_AND_ASSIGN(source, dest, setpartTypeGroup)
if (source.partStartTime().present()) {
timeType& start = source.partStartTime().get();
SIMPLE_MAP_OPTIONAL(start, editUnitNumber, dest, setpartStartEditUnitNumber)
SIMPLE_MAP_OPTIONAL(start, timecode, dest, setpartStartTimecode)
SIMPLE_MAP_OPTIONAL_CONVERT(start, normalPlayTime, dest, setpartStartTime, convert_rational)
}
if (source.partDuration().present()) {
durationType& dur = source.partDuration().get();
// [NOTE] Mapped playtime as duration because we need a numeric value (rational) # of seconds.
// [NOTE] We just map the timecode as a string to the KLV representation
SIMPLE_MAP_OPTIONAL(dur, editUnitNumber, dest, setpartDurationEditUnitNumber)
SIMPLE_MAP_OPTIONAL(dur, timecode, dest, setpartDurationTimecode)
SIMPLE_MAP_OPTIONAL_CONVERT(dur, normalPlayTime, dest, setpartDurationTime, convert_rational)
}
// map ourselves (we are an extension of the coreMetadataType) onto a new ebucoreCoreMetadata object
ebucoreCoreMetadata *obj = newAndModifyObject<ebucoreCoreMetadata>(dest->getHeaderMetadata(), mod);
mapCoreMetadata(source, obj, overallFrameRate, timelineParts, mod);
dest->setpartMeta(obj);
}
void mapCoreMetadata(coreMetadataType& source, ebucoreCoreMetadata *dest, mxfRational overallFrameRate, std::vector<ebucorePartMetadata*>& timelineParts, ObjectModifier* mod) {
std::map<xml_schema::id, ebucoreFormat*> formatMap;
std::map<xml_schema::id, ebucoreRights*> rightsMap;
NEW_VECTOR_AND_ASSIGN(source, title, ebucoreTitle, coreMetadataType::title_iterator, mapTitle, dest, settitle)
NEW_VECTOR_AND_ASSIGN(source, alternativeTitle, ebucoreAlternativeTitle, coreMetadataType::alternativeTitle_iterator, mapAlternativeTitle, dest, setalternativeTitle)
NEW_VECTOR_AND_ASSIGN(source, creator, ebucoreEntity, coreMetadataType::creator_iterator, mapEntity, dest, setcreator)
NEW_VECTOR_AND_ASSIGN(source, subject, ebucoreSubject, coreMetadataType::subject_iterator, mapSubject, dest, setsubject)
NEW_VECTOR_AND_ASSIGN(source, description, ebucoreDescription, coreMetadataType::description_iterator, mapDescription, dest, setdescription)
NEW_VECTOR_AND_ASSIGN(source, publisher, ebucoreEntity, coreMetadataType::publisher_iterator, mapEntity, dest, setpublisher)
NEW_VECTOR_AND_ASSIGN(source, contributor, ebucoreEntity, coreMetadataType::contributor_iterator, mapEntity, dest, setcontributor)
NEW_VECTOR_AND_ASSIGN(source, date, ebucoreDate, coreMetadataType::date_iterator, mapDate, dest, setdate)
NEW_VECTOR_AND_ASSIGN(source, type, ebucoreType, coreMetadataType::type_iterator, mapType, dest, settype)
NEW_VECTOR_AND_ASSIGN(source, identifier, ebucoreIdentifier, coreMetadataType::identifier_iterator, mapIdentifier, dest, setidentifier)
NEW_VECTOR_AND_ASSIGN(source, language, ebucoreLanguage, coreMetadataType::language_iterator, mapLanguage, dest, setlanguage)
NEW_VECTOR_AND_ASSIGN(source, coverage, ebucoreCoverage, coreMetadataType::coverage_iterator, mapMetadataCoverage, dest, setcoverage)
// do formats before rights and publicationhistory to make sure references are available in the map
std::vector<ebucoreFormat*> vec_dest_fmt;
for (coreMetadataType::format_iterator it = source.format().begin(); it != source.format().end(); it++) {
ebucoreFormat *obj = newAndModifyObject<ebucoreFormat>(dest->getHeaderMetadata(), mod);
mapFormat(*it, obj, formatMap, mod);
vec_dest_fmt.push_back(obj);
}
dest->setformat(vec_dest_fmt);
//NEW_VECTOR_AND_ASSIGN(source, format, ebucoreFormat, coreMetadataType::format_iterator, mapFormat, dest, setformat)
std::vector<ebucoreRights*> vec_dest_rights;
for (coreMetadataType::rights_iterator it = source.rights().begin(); it != source.rights().end(); it++) {
ebucoreRights *obj = newAndModifyObject<ebucoreRights>(dest->getHeaderMetadata(), mod);
mapRights(*it, obj, formatMap, rightsMap, mod);
vec_dest_rights.push_back(obj);
}
dest->setrights(vec_dest_rights);
//NEW_VECTOR_AND_ASSIGN(source, rights, ebucoreRights, coreMetadataType::rights_iterator, mapRights, dest, setrights)
NEW_VECTOR_AND_ASSIGN(source, rating, ebucoreRating, coreMetadataType::rating_iterator, mapRating, dest, setrating)
if (source.version().size() > 0) {
NEW_OBJECT_AND_ASSIGN_DIRECT(source.version()[0], ebucoreVersion, mapVersion, dest, setversion)
}
if (source.publicationHistory().present()) {
ebucorePublicationHistory *obj = newAndModifyObject<ebucorePublicationHistory>(dest->getHeaderMetadata(), mod);
mapPublicationHistory(source.publicationHistory().get(), obj, dest->getHeaderMetadata(), formatMap, rightsMap, mod);
dest->setpublicationHistory(obj);
}
mapBasicRelations(source, dest, mod);
NEW_VECTOR_AND_ASSIGN(source, relation, ebucoreCustomRelation, coreMetadataType::relation_iterator, mapCustomRelation, dest, setcustomRelation)
std::vector<ebucorePartMetadata*> vec_parts;
for (coreMetadataType::part_iterator it = source.part().begin(); it != source.part().end(); it++) {
ebucorePartMetadata *obj = newAndModifyObject<ebucorePartMetadata>(dest->getHeaderMetadata(), mod);
mapPart(*it, obj, overallFrameRate, timelineParts, mod);
vec_parts.push_back(obj);
// set extremes to start with
mxfPosition partStart = -1;
mxfLength partDuration = -1;
// determine which of our parts belong on a timeline
partType& part = *it;
if (part.partStartTime().present() && part.partDuration().present()) {
timeType &start = part.partStartTime().get();
// sensible values are present!
mxfPosition formatStart;
mxfLength formatDuration;
if (start.editUnitNumber().present()) {
partStart = start.editUnitNumber().get();
} else if (start.normalPlayTime().present()) {
// convert a duration
mxfRational d = convert_rational(start.normalPlayTime().get());
partStart = (d.numerator * overallFrameRate.numerator) / (d.denominator * overallFrameRate.denominator);
} else {
// convert a time code
bmx::Timecode tc;
bmx::parse_timecode(start.timecode().get().c_str(), overallFrameRate, &tc);
partStart = tc.GetOffset();
}
formatType::duration_type &dur = part.partDuration().get();
if (dur.editUnitNumber().present()) {
partDuration = dur.editUnitNumber().get();
} else if (dur.normalPlayTime().present()) {
// convert a duration
mxfRational d = convert_rational(dur.normalPlayTime().get());
partDuration = (d.numerator * overallFrameRate.numerator) / (d.denominator * overallFrameRate.denominator);
} else {
// convert a time code
bmx::Timecode tc;
bmx::parse_timecode(dur.timecode().get().c_str(), overallFrameRate, &tc);
partDuration = tc.GetOffset();
}
if (partStart != -1 && partDuration != -1) {
// this goes onto the timeline!
obj->setpartStartEditUnitNumber(partStart);
obj->setpartDurationEditUnitNumber(partDuration);
timelineParts.push_back(obj);
}
}
}
dest->setpart(vec_parts);
}
} // namespace EBUCore_1_4
} // namespace EBUCore
} // namespace EBUSDK
| 56.712727 | 192 | 0.812054 | Limecraft |
7cc8140fb18d6f0563cbe2c37353ade3e04c7ede | 3,266 | hpp | C++ | cpp/include/cugraph/visitors/ret_terased.hpp | BradReesWork/cugraph | 9ddea03a724e9b32950ed6282120007c76482cbc | [
"Apache-2.0"
] | 991 | 2018-12-05T22:07:52.000Z | 2022-03-31T10:45:45.000Z | cpp/include/cugraph/visitors/ret_terased.hpp | BradReesWork/cugraph | 9ddea03a724e9b32950ed6282120007c76482cbc | [
"Apache-2.0"
] | 1,929 | 2018-12-06T14:06:18.000Z | 2022-03-31T20:01:00.000Z | cpp/include/cugraph/visitors/ret_terased.hpp | BradReesWork/cugraph | 9ddea03a724e9b32950ed6282120007c76482cbc | [
"Apache-2.0"
] | 227 | 2018-12-06T18:10:15.000Z | 2022-03-28T19:03:15.000Z | /*
* Copyright (c) 2021, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Andrei Schaffer, [email protected]
//
#pragma once
#include <memory>
#include <stdexcept>
#include <type_traits>
namespace cugraph {
namespace visitors {
struct return_t {
struct base_return_t {
virtual ~base_return_t(void) {}
virtual void copy(return_t&&) = 0;
virtual std::unique_ptr<base_return_t> clone(void) const = 0;
};
template <typename T>
struct generic_return_t : base_return_t {
generic_return_t(T const& t) : return_(t) {}
generic_return_t(T&& t) : return_(std::move(t)) {}
void copy(return_t&& r) override
{
if constexpr (std::is_copy_constructible_v<T>) {
base_return_t const* p_B = static_cast<base_return_t const*>(r.p_impl_.get());
return_ = *(dynamic_cast<T const*>(p_B));
} else {
base_return_t* p_B = static_cast<base_return_t*>(r.p_impl_.get());
return_ = std::move(*(dynamic_cast<T*>(p_B)));
}
}
std::unique_ptr<base_return_t> clone(void) const override
{
if constexpr (std::is_copy_constructible_v<T>)
return std::make_unique<generic_return_t<T>>(return_);
else
throw std::runtime_error("ERROR: cannot clone object that is not copy constructible.");
}
T const& get(void) const { return return_; }
private:
T return_;
};
return_t(void) = default;
template <typename T>
return_t(T const& t) : p_impl_(std::make_unique<generic_return_t<T>>(t))
{
}
template <typename T>
return_t(T&& t) : p_impl_(std::make_unique<generic_return_t<T>>(std::move(t)))
{
}
return_t(return_t const& r) : p_impl_{r.clone()} {}
return_t& operator=(return_t const& r)
{
p_impl_ = r.clone();
return *this;
}
return_t(return_t&& other) : p_impl_(std::move(other.p_impl_)) {}
return_t& operator=(return_t&& other)
{
p_impl_ = std::move(other.p_impl_);
return *this;
}
std::unique_ptr<base_return_t> clone(void) const
{
if (p_impl_)
return p_impl_->clone();
else
return nullptr;
}
template <typename T>
T const& get(void) const
{
if (p_impl_) {
generic_return_t<T> const* p = static_cast<generic_return_t<T> const*>(p_impl_.get());
return p->get();
} else
throw std::runtime_error("ERROR: nullptr impl.");
}
void const* get_ptr(void) const
{
if (p_impl_)
return static_cast<void const*>(p_impl_.get());
else
return nullptr;
}
void* release(void) { return static_cast<void*>(p_impl_.release()); }
private:
std::unique_ptr<base_return_t> p_impl_;
};
} // namespace visitors
} // namespace cugraph
| 25.515625 | 95 | 0.6485 | BradReesWork |
7cc999ec9ec8ff3cbd566a4119fc6e0615d39717 | 29,791 | cpp | C++ | artifact/storm/src/storm-pomdp-cli/storm-pomdp.cpp | glatteis/tacas21-artifact | 30b4f522bd3bdb4bebccbfae93f19851084a3db5 | [
"MIT"
] | null | null | null | artifact/storm/src/storm-pomdp-cli/storm-pomdp.cpp | glatteis/tacas21-artifact | 30b4f522bd3bdb4bebccbfae93f19851084a3db5 | [
"MIT"
] | null | null | null | artifact/storm/src/storm-pomdp-cli/storm-pomdp.cpp | glatteis/tacas21-artifact | 30b4f522bd3bdb4bebccbfae93f19851084a3db5 | [
"MIT"
] | 1 | 2022-02-05T12:39:53.000Z | 2022-02-05T12:39:53.000Z | #include "storm/utility/initialize.h"
#include "storm/settings/modules/GeneralSettings.h"
#include "storm/settings/modules/DebugSettings.h"
#include "storm-pomdp-cli/settings/modules/POMDPSettings.h"
#include "storm-pomdp-cli/settings/modules/QualitativePOMDPAnalysisSettings.h"
#include "storm-pomdp-cli/settings/modules/BeliefExplorationSettings.h"
#include "storm-pomdp-cli/settings/modules/ToParametricSettings.h"
#include "storm-pomdp-cli/settings/PomdpSettings.h"
#include "storm/analysis/GraphConditions.h"
#include "storm-cli-utilities/cli.h"
#include "storm-cli-utilities/model-handling.h"
#include "storm-pomdp/transformer/KnownProbabilityTransformer.h"
#include "storm-pomdp/transformer/ApplyFiniteSchedulerToPomdp.h"
#include "storm-pomdp/transformer/GlobalPOMDPSelfLoopEliminator.h"
#include "storm-pomdp/transformer/GlobalPomdpMecChoiceEliminator.h"
#include "storm-pomdp/transformer/PomdpMemoryUnfolder.h"
#include "storm-pomdp/transformer/BinaryPomdpTransformer.h"
#include "storm-pomdp/transformer/MakePOMDPCanonic.h"
#include "storm-pomdp/analysis/UniqueObservationStates.h"
#include "storm-pomdp/analysis/QualitativeAnalysisOnGraphs.h"
#include "storm-pomdp/modelchecker/BeliefExplorationPomdpModelChecker.h"
#include "storm-pomdp/analysis/FormulaInformation.h"
#include "storm-pomdp/analysis/IterativePolicySearch.h"
#include "storm-pomdp/analysis/OneShotPolicySearch.h"
#include "storm/api/storm.h"
#include "storm/modelchecker/results/ExplicitQuantitativeCheckResult.h"
#include "storm/modelchecker/results/ExplicitQualitativeCheckResult.h"
#include "storm/utility/NumberTraits.h"
#include "storm/utility/Stopwatch.h"
#include "storm/utility/SignalHandler.h"
#include "storm/exceptions/UnexpectedException.h"
#include "storm/exceptions/NotSupportedException.h"
#include <typeinfo>
namespace storm {
namespace pomdp {
namespace cli {
/// Perform preprocessings based on the graph structure (if requested or necessary). Return true, if some preprocessing has been done
template<typename ValueType, storm::dd::DdType DdType>
bool performPreprocessing(std::shared_ptr<storm::models::sparse::Pomdp<ValueType>>& pomdp, storm::pomdp::analysis::FormulaInformation& formulaInfo, storm::logic::Formula const& formula) {
auto const& pomdpSettings = storm::settings::getModule<storm::settings::modules::POMDPSettings>();
bool preprocessingPerformed = false;
if (pomdpSettings.isSelfloopReductionSet()) {
storm::transformer::GlobalPOMDPSelfLoopEliminator<ValueType> selfLoopEliminator(*pomdp);
if (selfLoopEliminator.preservesFormula(formula)) {
STORM_PRINT_AND_LOG("Eliminating self-loop choices ...");
uint64_t oldChoiceCount = pomdp->getNumberOfChoices();
pomdp = selfLoopEliminator.transform();
STORM_PRINT_AND_LOG(oldChoiceCount - pomdp->getNumberOfChoices() << " choices eliminated through self-loop elimination." << std::endl);
preprocessingPerformed = true;
} else {
STORM_PRINT_AND_LOG("Not eliminating self-loop choices as it does not preserve the formula." << std::endl);
}
}
if (pomdpSettings.isQualitativeReductionSet() && formulaInfo.isNonNestedReachabilityProbability()) {
storm::analysis::QualitativeAnalysisOnGraphs<ValueType> qualitativeAnalysis(*pomdp);
STORM_PRINT_AND_LOG("Computing states with probability 0 ...");
storm::storage::BitVector prob0States = qualitativeAnalysis.analyseProb0(formula.asProbabilityOperatorFormula());
std::cout << prob0States << std::endl;
STORM_PRINT_AND_LOG(" done. " << prob0States.getNumberOfSetBits() << " states found." << std::endl);
STORM_PRINT_AND_LOG("Computing states with probability 1 ...");
storm::storage::BitVector prob1States = qualitativeAnalysis.analyseProb1(formula.asProbabilityOperatorFormula());
STORM_PRINT_AND_LOG(" done. " << prob1States.getNumberOfSetBits() << " states found." << std::endl);
storm::pomdp::transformer::KnownProbabilityTransformer<ValueType> kpt = storm::pomdp::transformer::KnownProbabilityTransformer<ValueType>();
pomdp = kpt.transform(*pomdp, prob0States, prob1States);
// Update formulaInfo to changes from Preprocessing
formulaInfo.updateTargetStates(*pomdp, std::move(prob1States));
formulaInfo.updateSinkStates(*pomdp, std::move(prob0States));
preprocessingPerformed = true;
}
return preprocessingPerformed;
}
template<typename ValueType>
void printResult(ValueType const& lowerBound, ValueType const& upperBound) {
if (lowerBound == upperBound) {
if (storm::utility::isInfinity(lowerBound)) {
STORM_PRINT_AND_LOG("inf");
} else {
STORM_PRINT_AND_LOG(lowerBound);
}
} else if (storm::utility::isInfinity<ValueType>(-lowerBound)) {
if (storm::utility::isInfinity(upperBound)) {
STORM_PRINT_AND_LOG("[-inf, inf] (width=inf)");
} else {
// Only upper bound is known
STORM_PRINT_AND_LOG("≤ " << upperBound);
}
} else if (storm::utility::isInfinity(upperBound)) {
STORM_PRINT_AND_LOG("≥ " << lowerBound);
} else {
STORM_PRINT_AND_LOG("[" << lowerBound << ", " << upperBound << "] (width=" << ValueType(upperBound - lowerBound) << ")");
}
if (storm::NumberTraits<ValueType>::IsExact) {
STORM_PRINT_AND_LOG(" (approx. ");
double roundedLowerBound = storm::utility::isInfinity<ValueType>(-lowerBound) ? -storm::utility::infinity<double>() : storm::utility::convertNumber<double>(lowerBound);
double roundedUpperBound = storm::utility::isInfinity(upperBound) ? storm::utility::infinity<double>() : storm::utility::convertNumber<double>(upperBound);
printResult(roundedLowerBound, roundedUpperBound);
STORM_PRINT_AND_LOG(")");
}
}
MemlessSearchOptions fillMemlessSearchOptionsFromSettings() {
storm::pomdp::MemlessSearchOptions options;
auto const& qualSettings = storm::settings::getModule<storm::settings::modules::QualitativePOMDPAnalysisSettings>();
options.onlyDeterministicStrategies = qualSettings.isOnlyDeterministicSet();
uint64_t loglevel = 0;
// TODO a big ugly, but we have our own loglevels (for technical reasons)
if(storm::utility::getLogLevel() == l3pp::LogLevel::INFO) {
loglevel = 1;
}
else if(storm::utility::getLogLevel() == l3pp::LogLevel::DEBUG) {
loglevel = 2;
}
else if(storm::utility::getLogLevel() == l3pp::LogLevel::TRACE) {
loglevel = 3;
}
options.setDebugLevel(loglevel);
options.validateEveryStep = qualSettings.validateIntermediateSteps();
options.validateResult = qualSettings.validateFinalResult();
options.pathVariableType = storm::pomdp::pathVariableTypeFromString(qualSettings.getLookaheadType());
if (qualSettings.isExportSATCallsSet()) {
options.setExportSATCalls(qualSettings.getExportSATCallsPath());
}
return options;
}
template<typename ValueType>
void performQualitativeAnalysis(std::shared_ptr<storm::models::sparse::Pomdp<ValueType>> const& origpomdp, storm::pomdp::analysis::FormulaInformation const& formulaInfo, storm::logic::Formula const& formula) {
auto const& qualSettings = storm::settings::getModule<storm::settings::modules::QualitativePOMDPAnalysisSettings>();
auto const& coreSettings = storm::settings::getModule<storm::settings::modules::CoreSettings>();
std::stringstream sstr;
origpomdp->printModelInformationToStream(sstr);
STORM_LOG_INFO(sstr.str());
STORM_LOG_THROW(formulaInfo.isNonNestedReachabilityProbability(), storm::exceptions::NotSupportedException, "Qualitative memoryless scheduler search is not implemented for this property type.");
STORM_LOG_TRACE("Run qualitative preprocessing...");
storm::models::sparse::Pomdp<ValueType> pomdp(*origpomdp);
storm::analysis::QualitativeAnalysisOnGraphs<ValueType> qualitativeAnalysis(pomdp);
// After preprocessing, this might be done cheaper.
storm::storage::BitVector surelyNotAlmostSurelyReachTarget = qualitativeAnalysis.analyseProbSmaller1(
formula.asProbabilityOperatorFormula());
pomdp.getTransitionMatrix().makeRowGroupsAbsorbing(surelyNotAlmostSurelyReachTarget);
storm::storage::BitVector targetStates = qualitativeAnalysis.analyseProb1(formula.asProbabilityOperatorFormula());
storm::expressions::ExpressionManager expressionManager;
std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::Z3SmtSolverFactory>();
storm::pomdp::MemlessSearchOptions options = fillMemlessSearchOptionsFromSettings();
uint64_t lookahead = qualSettings.getLookahead();
if (lookahead == 0) {
lookahead = pomdp.getNumberOfStates();
}
if (qualSettings.getMemlessSearchMethod() == "one-shot") {
storm::pomdp::OneShotPolicySearch<ValueType> memlessSearch(pomdp, targetStates, surelyNotAlmostSurelyReachTarget, smtSolverFactory);
if (qualSettings.isWinningRegionSet()) {
STORM_LOG_ERROR("Computing winning regions is not supported by ccd-memless.");
} else {
memlessSearch.analyzeForInitialStates(lookahead);
}
} else if (qualSettings.getMemlessSearchMethod() == "iterative") {
storm::pomdp::IterativePolicySearch<ValueType> search(pomdp, targetStates, surelyNotAlmostSurelyReachTarget, smtSolverFactory, options);
if (qualSettings.isWinningRegionSet()) {
search.computeWinningRegion(lookahead);
} else {
search.analyzeForInitialStates(lookahead);
}
if (qualSettings.isPrintWinningRegionSet()) {
search.getLastWinningRegion().print();
std::cout << std::endl;
}
if (qualSettings.isExportWinningRegionSet()) {
std::size_t hash = pomdp.hash();
search.getLastWinningRegion().storeToFile(qualSettings.exportWinningRegionPath(), "model hash: " + std::to_string(hash));
}
search.finalizeStatistics();
if(pomdp.getInitialStates().getNumberOfSetBits() == 1) {
uint64_t initialState = pomdp.getInitialStates().getNextSetIndex(0);
uint64_t initialObservation = pomdp.getObservation(initialState);
// TODO this is inefficient.
uint64_t offset = 0;
for (uint64_t state = 0; state < pomdp.getNumberOfStates(); ++state) {
if (state == initialState) {
break;
}
if (pomdp.getObservation(state) == initialObservation) {
++offset;
}
}
STORM_PRINT_AND_LOG("Initial state is safe: " << search.getLastWinningRegion().isWinning(initialObservation, offset));
} else {
STORM_LOG_WARN("Output for multiple initial states is incomplete");
}
std::cout << "Number of belief support states: " << search.getLastWinningRegion().beliefSupportStates() << std::endl;
if (coreSettings.isShowStatisticsSet() && qualSettings.computeExpensiveStats()) {
auto wbss = search.getLastWinningRegion().computeNrWinningBeliefs();
STORM_PRINT_AND_LOG( "Number of winning belief support states: [" << wbss.first << "," << wbss.second
<< "]");
}
if (coreSettings.isShowStatisticsSet()) {
search.getStatistics().print();
}
} else {
STORM_LOG_ERROR("This method is not implemented.");
}
}
template<typename ValueType, storm::dd::DdType DdType>
bool performAnalysis(std::shared_ptr<storm::models::sparse::Pomdp<ValueType>> const& pomdp, storm::pomdp::analysis::FormulaInformation const& formulaInfo, storm::logic::Formula const& formula) {
auto const& pomdpSettings = storm::settings::getModule<storm::settings::modules::POMDPSettings>();
bool analysisPerformed = false;
if (pomdpSettings.isBeliefExplorationSet()) {
STORM_PRINT_AND_LOG("Exploring the belief MDP... ");
auto options = storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>(pomdpSettings.isBeliefExplorationDiscretizeSet(), pomdpSettings.isBeliefExplorationUnfoldSet());
auto const& beliefExplorationSettings = storm::settings::getModule<storm::settings::modules::BeliefExplorationSettings>();
beliefExplorationSettings.setValuesInOptionsStruct(options);
storm::pomdp::modelchecker::BeliefExplorationPomdpModelChecker<storm::models::sparse::Pomdp<ValueType>> checker(pomdp, options);
auto result = checker.check(formula);
checker.printStatisticsToStream(std::cout);
if (storm::utility::resources::isTerminate()) {
STORM_PRINT_AND_LOG("\nResult till abort: ")
} else {
STORM_PRINT_AND_LOG("\nResult: ")
}
printResult(result.lowerBound, result.upperBound);
STORM_PRINT_AND_LOG(std::endl);
analysisPerformed = true;
}
if (pomdpSettings.isQualitativeAnalysisSet()) {
performQualitativeAnalysis(pomdp, formulaInfo, formula);
analysisPerformed = true;
}
if (pomdpSettings.isCheckFullyObservableSet()) {
STORM_PRINT_AND_LOG("Analyzing the formula on the fully observable MDP ... ");
auto resultPtr = storm::api::verifyWithSparseEngine<ValueType>(pomdp->template as<storm::models::sparse::Mdp<ValueType>>(), storm::api::createTask<ValueType>(formula.asSharedPointer(), true));
if (resultPtr) {
auto result = resultPtr->template asExplicitQuantitativeCheckResult<ValueType>();
result.filter(storm::modelchecker::ExplicitQualitativeCheckResult(pomdp->getInitialStates()));
if (storm::utility::resources::isTerminate()) {
STORM_PRINT_AND_LOG("\nResult till abort: ")
} else {
STORM_PRINT_AND_LOG("\nResult: ")
}
printResult(result.getMin(), result.getMax());
STORM_PRINT_AND_LOG(std::endl);
} else {
STORM_PRINT_AND_LOG("\nResult: Not available." << std::endl);
}
analysisPerformed = true;
}
return analysisPerformed;
}
template<typename ValueType, storm::dd::DdType DdType>
bool performTransformation(std::shared_ptr<storm::models::sparse::Pomdp<ValueType>>& pomdp, storm::logic::Formula const& formula) {
auto const& pomdpSettings = storm::settings::getModule<storm::settings::modules::POMDPSettings>();
auto const& ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
auto const& transformSettings = storm::settings::getModule<storm::settings::modules::ToParametricSettings>();
bool transformationPerformed = false;
bool memoryUnfolded = false;
if (pomdpSettings.getMemoryBound() > 1) {
STORM_PRINT_AND_LOG("Computing the unfolding for memory bound " << pomdpSettings.getMemoryBound() << " and memory pattern '" << storm::storage::toString(pomdpSettings.getMemoryPattern()) << "' ...");
storm::storage::PomdpMemory memory = storm::storage::PomdpMemoryBuilder().build(pomdpSettings.getMemoryPattern(), pomdpSettings.getMemoryBound());
std::cout << memory.toString() << std::endl;
storm::transformer::PomdpMemoryUnfolder<ValueType> memoryUnfolder(*pomdp, memory);
pomdp = memoryUnfolder.transform();
STORM_PRINT_AND_LOG(" done." << std::endl);
pomdp->printModelInformationToStream(std::cout);
transformationPerformed = true;
memoryUnfolded = true;
}
// From now on the pomdp is considered memoryless
if (transformSettings.isMecReductionSet()) {
STORM_PRINT_AND_LOG("Eliminating mec choices ...");
// Note: Elimination of mec choices only preserves memoryless schedulers.
uint64_t oldChoiceCount = pomdp->getNumberOfChoices();
storm::transformer::GlobalPomdpMecChoiceEliminator<ValueType> mecChoiceEliminator(*pomdp);
pomdp = mecChoiceEliminator.transform(formula);
STORM_PRINT_AND_LOG(" done." << std::endl);
STORM_PRINT_AND_LOG(oldChoiceCount - pomdp->getNumberOfChoices() << " choices eliminated through MEC choice elimination." << std::endl);
pomdp->printModelInformationToStream(std::cout);
transformationPerformed = true;
}
if (transformSettings.isTransformBinarySet() || transformSettings.isTransformSimpleSet()) {
if (transformSettings.isTransformSimpleSet()) {
STORM_PRINT_AND_LOG("Transforming the POMDP to a simple POMDP.");
pomdp = storm::transformer::BinaryPomdpTransformer<ValueType>().transform(*pomdp, true);
} else {
STORM_PRINT_AND_LOG("Transforming the POMDP to a binary POMDP.");
pomdp = storm::transformer::BinaryPomdpTransformer<ValueType>().transform(*pomdp, false);
}
pomdp->printModelInformationToStream(std::cout);
STORM_PRINT_AND_LOG(" done." << std::endl);
transformationPerformed = true;
}
if (pomdpSettings.isExportToParametricSet()) {
STORM_PRINT_AND_LOG("Transforming memoryless POMDP to pMC...");
storm::transformer::ApplyFiniteSchedulerToPomdp<ValueType> toPMCTransformer(*pomdp);
std::string transformMode = transformSettings.getFscApplicationTypeString();
auto pmc = toPMCTransformer.transform(storm::transformer::parsePomdpFscApplicationMode(transformMode));
STORM_PRINT_AND_LOG(" done." << std::endl);
pmc->printModelInformationToStream(std::cout);
if (transformSettings.allowPostSimplifications()) {
STORM_PRINT_AND_LOG("Simplifying pMC...");
pmc = storm::api::performBisimulationMinimization<storm::RationalFunction>(pmc->template as<storm::models::sparse::Dtmc<storm::RationalFunction>>(),{formula.asSharedPointer()}, storm::storage::BisimulationType::Strong)->template as<storm::models::sparse::Dtmc<storm::RationalFunction>>();
STORM_PRINT_AND_LOG(" done." << std::endl);
pmc->printModelInformationToStream(std::cout);
}
STORM_PRINT_AND_LOG("Exporting pMC...");
storm::analysis::ConstraintCollector<storm::RationalFunction> constraints(*pmc);
auto const& parameterSet = constraints.getVariables();
std::vector<storm::RationalFunctionVariable> parameters(parameterSet.begin(), parameterSet.end());
std::vector<std::string> parameterNames;
for (auto const& parameter : parameters) {
parameterNames.push_back(parameter.name());
}
storm::api::exportSparseModelAsDrn(pmc, pomdpSettings.getExportToParametricFilename(), parameterNames, !ioSettings.isExplicitExportPlaceholdersDisabled());
STORM_PRINT_AND_LOG(" done." << std::endl);
transformationPerformed = true;
}
if (transformationPerformed && !memoryUnfolded) {
STORM_PRINT_AND_LOG("Implicitly assumed restriction to memoryless schedulers for at least one transformation." << std::endl);
}
return transformationPerformed;
}
template<typename ValueType, storm::dd::DdType DdType>
void processOptionsWithValueTypeAndDdLib(storm::cli::SymbolicInput const& symbolicInput, storm::cli::ModelProcessingInformation const& mpi) {
auto const& pomdpSettings = storm::settings::getModule<storm::settings::modules::POMDPSettings>();
auto model = storm::cli::buildPreprocessExportModelWithValueTypeAndDdlib<DdType, ValueType>(symbolicInput, mpi);
if (!model) {
STORM_PRINT_AND_LOG("No input model given." << std::endl);
return;
}
STORM_LOG_THROW(model->getType() == storm::models::ModelType::Pomdp && model->isSparseModel(), storm::exceptions::WrongFormatException, "Expected a POMDP in sparse representation.");
std::shared_ptr<storm::models::sparse::Pomdp<ValueType>> pomdp = model->template as<storm::models::sparse::Pomdp<ValueType>>();
if (!pomdpSettings.isNoCanonicSet()) {
storm::transformer::MakePOMDPCanonic<ValueType> makeCanonic(*pomdp);
pomdp = makeCanonic.transform();
}
std::shared_ptr<storm::logic::Formula const> formula;
if (!symbolicInput.properties.empty()) {
formula = symbolicInput.properties.front().getRawFormula();
STORM_PRINT_AND_LOG("Analyzing property '" << *formula << "'" << std::endl);
STORM_LOG_WARN_COND(symbolicInput.properties.size() == 1, "There is currently no support for multiple properties. All other properties will be ignored.");
}
if (pomdpSettings.isAnalyzeUniqueObservationsSet()) {
STORM_PRINT_AND_LOG("Analyzing states with unique observation ..." << std::endl);
storm::analysis::UniqueObservationStates<ValueType> uniqueAnalysis(*pomdp);
std::cout << uniqueAnalysis.analyse() << std::endl;
}
if (formula) {
auto formulaInfo = storm::pomdp::analysis::getFormulaInformation(*pomdp, *formula);
STORM_LOG_THROW(!formulaInfo.isUnsupported(), storm::exceptions::InvalidPropertyException, "The formula '" << *formula << "' is not supported by storm-pomdp.");
storm::utility::Stopwatch sw(true);
// Note that formulaInfo contains state-based information which potentially needs to be updated during preprocessing
if (performPreprocessing<ValueType, DdType>(pomdp, formulaInfo, *formula)) {
sw.stop();
STORM_PRINT_AND_LOG("Time for graph-based POMDP (pre-)processing: " << sw << "." << std::endl);
pomdp->printModelInformationToStream(std::cout);
}
sw.restart();
if (performTransformation<ValueType, DdType>(pomdp, *formula)) {
sw.stop();
STORM_PRINT_AND_LOG("Time for POMDP transformation(s): " << sw << "s." << std::endl);
}
sw.restart();
if (performAnalysis<ValueType, DdType>(pomdp, formulaInfo, *formula)) {
sw.stop();
STORM_PRINT_AND_LOG("Time for POMDP analysis: " << sw << "s." << std::endl);
}
} else {
STORM_LOG_WARN("Nothing to be done. Did you forget to specify a formula?");
}
}
template <storm::dd::DdType DdType>
void processOptionsWithDdLib(storm::cli::SymbolicInput const& symbolicInput, storm::cli::ModelProcessingInformation const& mpi) {
STORM_LOG_ERROR_COND(mpi.buildValueType == mpi.verificationValueType, "Build value type differs from verification value type. Will ignore Verification value type.");
switch (mpi.buildValueType) {
case storm::cli::ModelProcessingInformation::ValueType::FinitePrecision:
processOptionsWithValueTypeAndDdLib<double, DdType>(symbolicInput, mpi);
break;
case storm::cli::ModelProcessingInformation::ValueType::Exact:
STORM_LOG_THROW(DdType == storm::dd::DdType::Sylvan, storm::exceptions::UnexpectedException, "Exact arithmetic is only supported with Dd library Sylvan.");
processOptionsWithValueTypeAndDdLib<storm::RationalNumber, storm::dd::DdType::Sylvan>(symbolicInput, mpi);
break;
default:
STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Unexpected ValueType for model building.");
}
}
void processOptions() {
auto symbolicInput = storm::cli::parseSymbolicInput();
storm::cli::ModelProcessingInformation mpi;
std::tie(symbolicInput, mpi) = storm::cli::preprocessSymbolicInput(symbolicInput);
switch (mpi.ddType) {
case storm::dd::DdType::CUDD:
processOptionsWithDdLib<storm::dd::DdType::CUDD>(symbolicInput, mpi);
break;
case storm::dd::DdType::Sylvan:
processOptionsWithDdLib<storm::dd::DdType::Sylvan>(symbolicInput, mpi);
break;
default:
STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Unexpected Dd Type.");
}
}
}
}
}
/*!
* Entry point for the pomdp backend.
*
* @param argc The argc argument of main().
* @param argv The argv argument of main().
* @return Return code, 0 if successfull, not 0 otherwise.
*/
int main(const int argc, const char** argv) {
//try {
storm::utility::setUp();
storm::cli::printHeader("Storm-pomdp", argc, argv);
storm::settings::initializePomdpSettings("Storm-POMDP", "storm-pomdp");
bool optionsCorrect = storm::cli::parseOptions(argc, argv);
if (!optionsCorrect) {
return -1;
}
storm::cli::setUrgentOptions();
// Invoke storm-pomdp with obtained settings
storm::pomdp::cli::processOptions();
// All operations have now been performed, so we clean up everything and terminate.
storm::utility::cleanUp();
return 0;
// } catch (storm::exceptions::BaseException const &exception) {
// STORM_LOG_ERROR("An exception caused Storm-pomdp to terminate. The message of the exception is: " << exception.what());
// return 1;
//} catch (std::exception const &exception) {
// STORM_LOG_ERROR("An unexpected exception occurred and caused Storm-pomdp to terminate. The message of this exception is: " << exception.what());
// return 2;
//}
}
| 62.586134 | 312 | 0.59095 | glatteis |
7ccb4ad509d2aec2592a7b1458ddb2436e6ca652 | 561 | cc | C++ | cpp/leetcode/153.find-minimum-in-rotated-sorted-array.cc | liubang/laboratory | 747f239a123cd0c2e5eeba893b9a4d1536555b1e | [
"MIT"
] | 3 | 2021-03-03T13:18:23.000Z | 2022-02-09T07:49:24.000Z | cpp/leetcode/153.find-minimum-in-rotated-sorted-array.cc | liubang/laboratory | 747f239a123cd0c2e5eeba893b9a4d1536555b1e | [
"MIT"
] | null | null | null | cpp/leetcode/153.find-minimum-in-rotated-sorted-array.cc | liubang/laboratory | 747f239a123cd0c2e5eeba893b9a4d1536555b1e | [
"MIT"
] | 1 | 2021-03-29T15:21:42.000Z | 2021-03-29T15:21:42.000Z | #include <gtest/gtest.h>
#include <vector>
namespace {
class Solution {
public:
int findMin(const std::vector<int>& nums) {
int s = 0, e = nums.size() - 1;
while (s < e) {
int m = (s + e) / 2;
if (nums[m] < nums[e]) {
e = m;
} else {
s = m + 1;
}
}
return nums[s];
}
};
} // namespace
TEST(Leetcode, find_minimum_in_rotated_sorted_array) {
Solution s;
EXPECT_EQ(0, s.findMin({4, 5, 6, 7, 0, 1, 2}));
EXPECT_EQ(1, s.findMin({3, 4, 5, 1, 2}));
EXPECT_EQ(11, s.findMin({11, 13, 15, 17}));
}
| 19.344828 | 54 | 0.520499 | liubang |
7cd0fe7d92d1caf1a13914a8428202ce0fce3c65 | 699 | hpp | C++ | Source/WinSandbox/Physics/Collision/Collider.hpp | wradley/Freight | 91eda2ca0af64036202309f6adbf2d80c406e031 | [
"MIT"
] | null | null | null | Source/WinSandbox/Physics/Collision/Collider.hpp | wradley/Freight | 91eda2ca0af64036202309f6adbf2d80c406e031 | [
"MIT"
] | null | null | null | Source/WinSandbox/Physics/Collision/Collider.hpp | wradley/Freight | 91eda2ca0af64036202309f6adbf2d80c406e031 | [
"MIT"
] | null | null | null | #pragma once
#include <Freight/Math.hpp>
class Rigidbody;
struct Collider
{
std::shared_ptr<Rigidbody> body;
enum class Type {
HALF_SPACE,
SPHERE,
BOX,
};
virtual Type getType() const = 0;
};
struct SphereCollider : public Collider
{
fr::Vec3 position;
fr::Real radius;
inline virtual Type getType() const { return Type::SPHERE; }
};
struct HalfSpace : public Collider
{
fr::Vec3 normal;
fr::Real offset;
inline virtual Type getType() const { return Type::HALF_SPACE; }
};
struct BoxCollider : public Collider
{
fr::Vec3 halfSizes;
fr::Transform offset;
inline virtual Type getType() const { return Type::BOX; }
}; | 17.475 | 68 | 0.648069 | wradley |
7cd21489770eaa88635076b6ff2d7e5bfdad942a | 1,422 | hpp | C++ | include/Client/PlayerMovementSystem.hpp | maximaximal/BomberPi | 365c806e3feda7296fc10d5f9655ec696f0ab491 | [
"Zlib"
] | null | null | null | include/Client/PlayerMovementSystem.hpp | maximaximal/BomberPi | 365c806e3feda7296fc10d5f9655ec696f0ab491 | [
"Zlib"
] | null | null | null | include/Client/PlayerMovementSystem.hpp | maximaximal/BomberPi | 365c806e3feda7296fc10d5f9655ec696f0ab491 | [
"Zlib"
] | null | null | null | #ifndef CLIENT_PLAYERMOVEMENTSYSTEM_HPP_INCLUDED
#define CLIENT_PLAYERMOVEMENTSYSTEM_HPP_INCLUDED
#include <anax/System.hpp>
#include <map>
#include <Client/BombermanMap.hpp>
#include <Client/BodyComponent.hpp>
#include <Client/CollisionSystem.hpp>
#include <Client/PositionComponent.hpp>
#include <Client/PlayerInputComponent.hpp>
#include <Client/SpriteComponent.hpp>
#include <Client/BodyComponent.hpp>
#include <Client/BombLayerComponent.hpp>
#include <Client/SpeedComponent.hpp>
namespace Client
{
class PositionComponent;
class PlayerMovementSystem : public anax::System<anax::Requires<PositionComponent, PlayerInputComponent, SpriteComponent, BodyComponent, BombLayerComponent, SpeedComponent>>
{
public:
PlayerMovementSystem(BombermanMap *bombermanMap, CollisionSystem *collisionSystem);
virtual ~PlayerMovementSystem();
void setMap(BombermanMap *map);
void update(float frameTime);
void onPlayerCollision(std::shared_ptr<Collision> collision);
protected:
virtual void onEntityRemoved(anax::Entity &e);
void calculateTarget(PlayerInputEnum dir, BodyComponent &body, Client::PositionComponent &pos);
private:
BombermanMap *m_bombermanMap;
CollisionSystem *m_collisionSystem;
std::map<anax::Entity::Id, sigc::connection> m_collisionConnections;
};
}
#endif
| 33.069767 | 177 | 0.73699 | maximaximal |
7cd356fd0e27b6a0958aa5f0985faeae1eb4a94e | 23 | cpp | C++ | src/collider.cpp | trevorGalivan/lavaGameEngine | 9a8ce6845a8e1fd728a376d5665c5b57abcfed4c | [
"MIT"
] | 1 | 2021-03-04T23:39:46.000Z | 2021-03-04T23:39:46.000Z | src/collider.cpp | trevorGalivan/lavaGameEngine | 9a8ce6845a8e1fd728a376d5665c5b57abcfed4c | [
"MIT"
] | null | null | null | src/collider.cpp | trevorGalivan/lavaGameEngine | 9a8ce6845a8e1fd728a376d5665c5b57abcfed4c | [
"MIT"
] | null | null | null | #include "collider.h"
| 11.5 | 22 | 0.695652 | trevorGalivan |
7cd5bc778ceaf5a9aa1d1181dafa0d9b48770328 | 3,487 | cpp | C++ | lanchonete-array.cpp | jonasnunes/Cpp | f58c03ee63e37285b4a1455cc55f184672fdaf5c | [
"MIT"
] | null | null | null | lanchonete-array.cpp | jonasnunes/Cpp | f58c03ee63e37285b4a1455cc55f184672fdaf5c | [
"MIT"
] | null | null | null | lanchonete-array.cpp | jonasnunes/Cpp | f58c03ee63e37285b4a1455cc55f184672fdaf5c | [
"MIT"
] | null | null | null | #include <iostream>
#include <locale>
using namespace std;
int main()
{
setlocale(LC_CTYPE, "Portuguese");
// mesmo exemplo da lanchonete, mas usando array ao invés de struct.
string comboNome[] = {"Prata da Casa", "+ Light", "Lanche Pobre"};
int numeroItens[] = {4, 3, 2};
string comboItens[] = {"X-Tudo", "Batata Frita", "Pastel", "Coca lata", "X-Frango", "Batata Frita", "Fanta Laranja", "Hamburguer", "Coca lata"};
double comboValor[] = {49.90, 32.50, 19.90};
string nome;
long long int codigoCliente;
int opc, qtd;
double valorTotal;
cout << "Bem vindo ao Big Lanches!" << endl;
cout << "Não perca tempo... Faça já o seu pedido!" << endl;
cout << "Qual é o seu nome? ";
cin.ignore();
getline(cin, nome);
cout << "Digite o código do cliente.: ";
cin >> codigoCliente;
cout << "Pressione 1 para ver o nosso cardápio.: ";
cin >> opc;
switch(opc)
{
case 1:
cout << "\nCombo 1" << endl;
cout << "Nome do combo.: " << comboNome[0] << "\n" << "Número de Itens.: " << numeroItens[0] << "\n" << "Itens.: " << comboItens[0] << ", " << comboItens[1] << ", " << comboItens[2] << ", " << comboItens[3] << ".\n";
cout << "-----------------------------------------------------" << endl;
cout << "\nCombo 2" << endl;
cout << "Nome do combo.: " << comboNome[1] << "\n" << "Número de Itens.: " << numeroItens[1] << "\n" << "Itens.: " << comboItens[4] << ", " << comboItens[5] << ", " << comboItens[6] << ".\n";
cout << "-----------------------------------------------------" << endl;
cout << "\nCombo 3" << endl;
cout << "Nome do combo.: " << comboNome[2] << "\n" << "Número de Itens.: " << numeroItens[2] << "\n" << "Itens.: " << comboItens[7] << ", " << comboItens[8] << ".\n";
cout << "-----------------------------------------------------" << endl;
cout << "\nQual desses o(a) Senhor(a) deseja?" << endl;
cin >> opc;
switch(opc)
{
case 1:
cout << "\nProduto escolhido.: Combo 1" << endl;
cout << "Quantos o(a) Senhor(a) vai querer? " << endl;
cin >> qtd;
valorTotal = qtd * comboValor[0];
cout << "\nSeu pedido irá custar R$ " << valorTotal << ". Dirija-se ao caixa mais próximo." << endl;
break;
case 2:
cout << "\nProduto escolhido.: Combo 2" << endl;
cout << "Quantos o(a) Senhor(a) vai querer? " << endl;
cin >> qtd;
valorTotal = qtd * comboValor[1];
cout << "\nSeu pedido irá custar R$ " << valorTotal << ". Dirija-se ao caixa mais próximo." << endl;
break;
case 3:
cout << "\nProduto escolhido.: Combo 3" << endl;
cout << "Quantos o(a) Senhor(a) vai querer? " << endl;
cin >> qtd;
valorTotal = qtd * comboValor[2];
cout << "\nSeu pedido irá custar R$ " << valorTotal << ". Dirija-se ao caixa mais próximo." << endl;
break;
default:
cout << "\nOpção Inválida!" << endl;
}
}
cout << "\nMuito obrigado! Volte sempre...\n\n";
system("pause");
return 0;
} | 39.625 | 228 | 0.443648 | jonasnunes |
7cd936262513cfad24e74c8d2ef95e84c78d425c | 327 | cpp | C++ | AT-Task3-OpenGL/VoxelTextureAtlas.cpp | gualtyphone/AT-Task3-OpenGL | b14461f71b1766882082cd1481d21bd00f49cdb5 | [
"MIT"
] | 1 | 2018-11-25T10:52:57.000Z | 2018-11-25T10:52:57.000Z | AT-Task3-OpenGL/VoxelTextureAtlas.cpp | gualtyphone/AT-Task3-OpenGL | b14461f71b1766882082cd1481d21bd00f49cdb5 | [
"MIT"
] | null | null | null | AT-Task3-OpenGL/VoxelTextureAtlas.cpp | gualtyphone/AT-Task3-OpenGL | b14461f71b1766882082cd1481d21bd00f49cdb5 | [
"MIT"
] | null | null | null | #include "VoxelTextureData.h"
// UV Structure
// 0--1
// | |
// 3--2
Vector2 VoxelTextureAtlas::UVOffsets[4] =
{
Vector2(0, 0),
Vector2(1.0f / (float)numberOfTexturesWidth, 0),
Vector2(1.0f / (float)numberOfTexturesWidth, (1.0f / (float)numberOfTexturesHeight)),
Vector2(0, (1.0f / (float)numberOfTexturesHeight)),
};
| 20.4375 | 86 | 0.681957 | gualtyphone |
7cdf666b3b837a4683272fd4dbcef1e9ec646b7f | 4,315 | cpp | C++ | thread/task/task_scheduler.cpp | aconstlink/snakeoil | 3c6e02655e1134f8422f01073090efdde80fc109 | [
"MIT"
] | 1 | 2017-08-11T19:12:24.000Z | 2017-08-11T19:12:24.000Z | thread/task/task_scheduler.cpp | aconstlink/snakeoil | 3c6e02655e1134f8422f01073090efdde80fc109 | [
"MIT"
] | 11 | 2018-07-07T20:09:44.000Z | 2020-02-16T22:45:09.000Z | thread/task/task_scheduler.cpp | aconstlink/snakeoil | 3c6e02655e1134f8422f01073090efdde80fc109 | [
"MIT"
] | null | null | null | //------------------------------------------------------------
// snakeoil (c) Alexis Constantin Link
// Distributed under the MIT license
//------------------------------------------------------------
#include "task_graph.h"
#include "task_scheduler.h"
#include "serial_executor.h"
#include "async_executor.h"
using namespace so_thread ;
//*************************************************************************************
task_scheduler::task_scheduler( void_t )
{
}
//*************************************************************************************
task_scheduler::task_scheduler( this_rref_t rhv )
{
_asyncs = std::move(rhv._asyncs) ;
_serials = std::move(rhv._serials) ;
}
//*************************************************************************************
task_scheduler::~task_scheduler( void_t )
{
}
//*************************************************************************************
task_scheduler::this_ptr_t task_scheduler::create( so_memory::purpose_cref_t p )
{
return so_thread::memory::alloc( this_t(), p ) ;
}
//*************************************************************************************
task_scheduler::this_ptr_t task_scheduler::create( this_rref_t rhv, so_memory::purpose_cref_t p )
{
return so_thread::memory::alloc( std::move(rhv), p ) ;
}
//*************************************************************************************
void_t task_scheduler::destroy( this_ptr_t ptr )
{
so_thread::memory::dealloc( ptr ) ;
}
//*************************************************************************************
void_t task_scheduler::update( void_t )
{
// update all serial tasks
{
tasks_t serials ;
{
so_thread::lock_guard_t lk(_mtx_serial) ;
serials = std::move( _serials ) ;
}
so_thread::serial_executor se ;
se.consume( std::move(serials) ) ;
}
// update all async tasks
{
tasks_t asyncs ;
{
so_thread::lock_guard_t lk( _mtx_async ) ;
asyncs = std::move( _asyncs ) ;
}
so_thread::async_executor ae ;
ae.consume_and_wait( std::move( asyncs ) ) ;
}
}
//*************************************************************************************
void_t task_scheduler::async_now( so_thread::itask_ptr_t tptr, so_thread::sync_object_ptr_t sptr )
{
/*
std::async( std::launch::async, [=]( void_t )
{
so_thread::async_executor_t ae ;
ae.consume_and_wait( tptr ) ;
so_thread::sync_object::set_and_signal( sptr ) ;
} ) ;
*/
// @todo make async again. future will block on destruction
std::thread t( [=] ( void_t )
{
so_thread::async_executor_t ae ;
ae.consume_and_wait( tptr ) ;
so_thread::sync_object::set_and_signal( sptr ) ;
} ) ;
t.detach( ) ;
}
//*************************************************************************************
void_t task_scheduler::async_now( so_thread::task_graph_rref_t tg, so_thread::sync_object_ptr_t sptr )
{
// invalidate the end task pointer.
tg.end_moved() ;
this->async_now( tg.begin_moved(), sptr ) ;
}
//*************************************************************************************
void_t task_scheduler::serial_now( so_thread::itask_ptr_t tptr, so_thread::sync_object_ptr_t sptr )
{
std::thread t([=] (void_t)
{
so_thread::serial_executor_t se ;
se.consume( tptr ) ;
so_thread::sync_object::set_and_signal( sptr ) ;
} ) ;
t.detach() ;
}
//*************************************************************************************
void_t task_scheduler::async_on_update( so_thread::itask_ptr_t ptr )
{
if( so_core::is_nullptr(ptr) )
return ;
so_thread::lock_guard_t lk(_mtx_async) ;
_asyncs.push_back( ptr ) ;
}
//*************************************************************************************
void_t task_scheduler::serial_on_update( so_thread::itask_ptr_t ptr )
{
if( so_core::is_nullptr( ptr ) )
return ;
so_thread::lock_guard_t lk( _mtx_serial ) ;
_serials.push_back( ptr ) ;
}
//*************************************************************************************
void_t task_scheduler::destroy( void_t )
{
this_t::destroy( this ) ;
}
| 28.959732 | 103 | 0.451217 | aconstlink |
7ce36e0a29e0abf213c345f6ad29a83274348bc8 | 2,016 | hpp | C++ | libraries/app/include/graphene/app/api_access.hpp | siwelo/bitshares-2 | 03561bfcf97801b44863bd51c400aae3ba51e3b0 | [
"MIT"
] | null | null | null | libraries/app/include/graphene/app/api_access.hpp | siwelo/bitshares-2 | 03561bfcf97801b44863bd51c400aae3ba51e3b0 | [
"MIT"
] | null | null | null | libraries/app/include/graphene/app/api_access.hpp | siwelo/bitshares-2 | 03561bfcf97801b44863bd51c400aae3ba51e3b0 | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Any modified source or binaries are used only with the BitShares network.
*
* 2. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#pragma once
#include <fc/reflect/reflect.hpp>
#include <map>
#include <string>
#include <vector>
namespace graphene { namespace app {
struct api_access_info
{
std::string password_hash_b64;
std::string password_salt_b64;
std::vector< std::string > allowed_apis;
};
struct api_access
{
std::map< std::string, api_access_info > permission_map;
};
} } // graphene::app
FC_REFLECT( graphene::app::api_access_info,
(password_hash_b64)
(password_salt_b64)
(allowed_apis)
)
FC_REFLECT( graphene::app::api_access,
(permission_map)
)
| 37.333333 | 208 | 0.761905 | siwelo |
7ce48eaa8a35c604b4165f73d7b9b328bef2d88f | 4,822 | cpp | C++ | Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.cpp | zhaomengxiao/MITK | a09fd849a4328276806008bfa92487f83a9e2437 | [
"BSD-3-Clause"
] | 1 | 2022-03-03T12:03:32.000Z | 2022-03-03T12:03:32.000Z | Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.cpp | zhaomengxiao/MITK | a09fd849a4328276806008bfa92487f83a9e2437 | [
"BSD-3-Clause"
] | 1 | 2021-12-22T10:19:02.000Z | 2021-12-22T10:19:02.000Z | Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.cpp | zhaomengxiao/MITK_lancet | a09fd849a4328276806008bfa92487f83a9e2437 | [
"BSD-3-Clause"
] | 1 | 2020-11-27T09:41:18.000Z | 2020-11-27T09:41:18.000Z | /*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkFileOpenAction.h"
#include "internal/org_mitk_gui_qt_application_Activator.h"
#include <mitkIDataStorageService.h>
#include <mitkNodePredicateProperty.h>
#include <mitkWorkbenchUtil.h>
#include <QmitkIOUtil.h>
#include <berryIPreferences.h>
#include <QFileDialog>
namespace
{
mitk::DataStorage::Pointer GetDataStorage()
{
auto context = mitk::org_mitk_gui_qt_application_Activator::GetContext();
if (nullptr == context)
return nullptr;
auto dataStorageServiceReference = context->getServiceReference<mitk::IDataStorageService>();
if (!dataStorageServiceReference)
return nullptr;
auto dataStorageService = context->getService<mitk::IDataStorageService>(dataStorageServiceReference);
if (nullptr == dataStorageService)
return nullptr;
auto dataStorageReference = dataStorageService->GetDataStorage();
if (dataStorageReference.IsNull())
return nullptr;
return dataStorageReference->GetDataStorage();
}
mitk::DataNode::Pointer GetFirstSelectedNode()
{
auto dataStorage = GetDataStorage();
if (dataStorage.IsNull())
return nullptr;
auto selectedNodes = dataStorage->GetSubset(mitk::NodePredicateProperty::New("selected", mitk::BoolProperty::New(true)));
if (selectedNodes->empty())
return nullptr;
return selectedNodes->front();
}
QString GetPathOfFirstSelectedNode()
{
auto firstSelectedNode = GetFirstSelectedNode();
if (firstSelectedNode.IsNull())
return "";
auto data = firstSelectedNode->GetData();
if (nullptr == data)
return "";
auto pathProperty = data->GetConstProperty("path");
if (pathProperty.IsNull())
return "";
return QFileInfo(QString::fromStdString(pathProperty->GetValueAsString())).canonicalPath();
}
}
class QmitkFileOpenActionPrivate
{
public:
void Init(berry::IWorkbenchWindow* window, QmitkFileOpenAction* action)
{
m_Window = window;
action->setText("&Open File...");
action->setToolTip("Open data files (images, surfaces,...)");
QObject::connect(action, SIGNAL(triggered(bool)), action, SLOT(Run()));
}
berry::IPreferences::Pointer GetPreferences() const
{
berry::IPreferencesService* prefService = mitk::PluginActivator::GetInstance()->GetPreferencesService();
if (prefService != nullptr)
{
return prefService->GetSystemPreferences()->Node("/General");
}
return berry::IPreferences::Pointer(nullptr);
}
QString GetLastFileOpenPath() const
{
berry::IPreferences::Pointer prefs = GetPreferences();
if (prefs.IsNotNull())
{
return prefs->Get("LastFileOpenPath", "");
}
return QString();
}
void SetLastFileOpenPath(const QString& path) const
{
berry::IPreferences::Pointer prefs = GetPreferences();
if (prefs.IsNotNull())
{
prefs->Put("LastFileOpenPath", path);
prefs->Flush();
}
}
bool GetOpenEditor() const
{
berry::IPreferences::Pointer prefs = GetPreferences();
if (prefs.IsNotNull())
{
return prefs->GetBool("OpenEditor", true);
}
return true;
}
berry::IWorkbenchWindow* m_Window;
};
QmitkFileOpenAction::QmitkFileOpenAction(berry::IWorkbenchWindow::Pointer window)
: QAction(nullptr)
, d(new QmitkFileOpenActionPrivate)
{
d->Init(window.GetPointer(), this);
}
QmitkFileOpenAction::QmitkFileOpenAction(const QIcon& icon, berry::IWorkbenchWindow::Pointer window)
: QAction(nullptr)
, d(new QmitkFileOpenActionPrivate)
{
d->Init(window.GetPointer(), this);
setIcon(icon);
}
QmitkFileOpenAction::QmitkFileOpenAction(const QIcon& icon, berry::IWorkbenchWindow* window)
: QAction(nullptr), d(new QmitkFileOpenActionPrivate)
{
d->Init(window, this);
setIcon(icon);
}
QmitkFileOpenAction::~QmitkFileOpenAction()
{
}
void QmitkFileOpenAction::Run()
{
auto path = GetPathOfFirstSelectedNode();
if (path.isEmpty())
path = d->GetLastFileOpenPath();
// Ask the user for a list of files to open
QStringList fileNames = QFileDialog::getOpenFileNames(nullptr, "Open",
path,
QmitkIOUtil::GetFileOpenFilterString());
if (fileNames.empty())
{
return;
}
d->SetLastFileOpenPath(fileNames.front());
mitk::WorkbenchUtil::LoadFiles(fileNames, berry::IWorkbenchWindow::Pointer(d->m_Window), d->GetOpenEditor());
}
| 25.114583 | 125 | 0.669432 | zhaomengxiao |
7ce77ec9347b82ef01455f6a7ab6f1304b65f116 | 605 | cpp | C++ | Strings/Words/Reverse the String.cpp | cenation092/InterviewBit-Solutions | ac4510a10d965fb681f7b3c80990407e18bc2668 | [
"MIT"
] | 7 | 2019-06-29T08:57:07.000Z | 2021-02-13T06:43:40.000Z | Strings/Words/Reverse the String.cpp | cenation092/InterviewBit-Solutions | ac4510a10d965fb681f7b3c80990407e18bc2668 | [
"MIT"
] | null | null | null | Strings/Words/Reverse the String.cpp | cenation092/InterviewBit-Solutions | ac4510a10d965fb681f7b3c80990407e18bc2668 | [
"MIT"
] | 3 | 2020-06-17T04:26:26.000Z | 2021-02-12T04:51:40.000Z | void Solution::reverseWords(string &A) {
reverse(A.begin(), A.end());
string s = "";
int i = 0;
while( A[i] == ' ')i++;
string temp = "";
while( i < A.size() && A[i] != ' ' ){
temp += A[i];
i++;
}
reverse(temp.begin(), temp.end());
s += temp;
while( i < A.size() ){
temp = "";
while( i < A.size() && A[i] != ' ' ){
temp += A[i];
i++;
}
if( temp.size() > 0 ){
s += ' ';
reverse(temp.begin(), temp.end());
s += temp;
}
i++;
}
A = s;
}
| 21.607143 | 46 | 0.33719 | cenation092 |
7ce9280eba22cc0b6b5fa464cec9212ece3cc0f2 | 5,930 | cpp | C++ | Sample18_2/app/src/main/cpp/util/LoadUtil.cpp | luopan007/Vulkan_Develpment_Samples | 1be40631e3b2d44aae7140f0ef17c5643a86545e | [
"Unlicense"
] | 5 | 2020-11-20T00:06:30.000Z | 2021-12-07T11:39:17.000Z | Sample18_2/app/src/main/cpp/util/LoadUtil.cpp | luopan007/Vulkan_Develpment_Samples | 1be40631e3b2d44aae7140f0ef17c5643a86545e | [
"Unlicense"
] | null | null | null | Sample18_2/app/src/main/cpp/util/LoadUtil.cpp | luopan007/Vulkan_Develpment_Samples | 1be40631e3b2d44aae7140f0ef17c5643a86545e | [
"Unlicense"
] | 7 | 2021-01-01T10:54:58.000Z | 2022-01-13T02:21:54.000Z | #include "LoadUtil.h"
#include <iostream>
#include <string>
#include <string.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <fstream>
#include <sstream>
#include <stdlib.h>
#include <vulkan/vulkan.h>
#include "FileUtil.h"
using namespace std;
size_t splitString(const string& strSrc, const string& strDelims, vector<string>& strDest)
{
string delims = strDelims;
string STR;
if (delims.empty()) delims = " **";
string::size_type pos = 0;
string::size_type LEN = strSrc.size();
while (pos < LEN) {
STR = "";
while ((delims.find(strSrc[pos]) != std::string::npos) && (pos < LEN))
{
++pos;
}
if (pos == LEN) {
return strDest.size();
}
while ((delims.find(strSrc[pos]) == std::string::npos) && (pos < LEN))
{
STR += strSrc[pos++];
}
if (!STR.empty())
{
strDest.push_back(STR);
}
}
return strDest.size();
}
bool tryParseDouble(const char *s, const char *s_end, double *result)
{
if (s >= s_end)
{
return false;
}
double mantissa = 0.0;
int exponent = 0;
char sign = '+';
char exp_sign = '+';
char const *curr = s;
int read = 0;
bool end_not_reached = false;
if (*curr == '+' || *curr == '-')
{
sign = *curr;
curr++;
}
else if (isdigit(*curr)) { /* Pass through. */ }
else
{
goto fail;
}
while ((end_not_reached = (curr != s_end)) && isdigit(*curr))
{
mantissa *= 10;
mantissa += static_cast<int>(*curr - 0x30);
curr++; read++;
}
if (read == 0)
goto fail;
if (!end_not_reached)
goto assemble;
if (*curr == '.')
{
curr++;
read = 1;
while ((end_not_reached = (curr != s_end)) && isdigit(*curr))
{
mantissa += static_cast<int>(*curr - 0x30) * pow(10.0, -read);
read++; curr++;
}
}
else if (*curr == 'e' || *curr == 'E') {}
else
{
goto assemble;
}
if (!end_not_reached)
goto assemble;
if (*curr == 'e' || *curr == 'E')
{
curr++;
if ((end_not_reached = (curr != s_end)) && (*curr == '+' || *curr == '-'))
{
exp_sign = *curr;
curr++;
}
else if (isdigit(*curr)) { /* Pass through. */ }
else
{
goto fail;
}
read = 0;
while ((end_not_reached = (curr != s_end)) && isdigit(*curr))
{
exponent *= 10;
exponent += static_cast<int>(*curr - 0x30);
curr++; read++;
}
exponent *= (exp_sign == '+' ? 1 : -1);
if (read == 0)
goto fail;
}
assemble:
*result = (sign == '+' ? 1 : -1) * ldexp(mantissa * pow(5.0, exponent), exponent);
return true;
fail:
return false;
}
float parseFloat(const char* token)
{
token += strspn(token, " \t");
#ifdef TINY_OBJ_LOADER_OLD_FLOAT_PARSER
float f = atof(token);
#else
const char *end = token + strcspn(token, " \t\r");
double val = 0.0;
tryParseDouble(token, end, &val);
float f = static_cast<float>(val);
#endif
return f;
}
int parseInt(const char *token) {
token += strspn(token, " \t");
int i = atoi(token);
return i;
}
ObjObject* LoadUtil::loadFromFile(const string& vname, VkDevice& device, VkPhysicalDeviceMemoryProperties& memoryroperties) {
ObjObject * lo;
vector<float> alv;
vector<float> alvResult;
vector<float> aln;
vector<float>alnResult;
std::string resultStr = FileUtil::loadAssetStr(vname);
vector<string> lines;
splitString(resultStr, "\n", lines);
vector<string> splitStrs;
vector<string> splitStrsF;
string tempContents;
for (int i = 0; i<lines.size(); i++)
{
tempContents = lines[i];
if (tempContents.compare("") == 0)
{
continue;
}
string delims = "[ ]+";
splitStrs.clear();
splitString(tempContents, delims, splitStrs);
if (splitStrs[0] == "v")
{
alv.push_back(parseFloat(splitStrs[1].c_str()));
alv.push_back(parseFloat(splitStrs[2].c_str()));
alv.push_back(parseFloat(splitStrs[3].c_str()));
}
else if (splitStrs[0] == "vn")
{
aln.push_back(parseFloat(splitStrs[1].c_str()));
aln.push_back(parseFloat(splitStrs[2].c_str()));
aln.push_back(parseFloat(splitStrs[3].c_str()));
}
else if (splitStrs[0] == "f")
{
int index[3];
string delimsF = "/";
splitStrsF.clear();
splitString(splitStrs[1].c_str(), delimsF, splitStrsF);
index[0] = parseInt(splitStrsF[0].c_str()) - 1;
alvResult.push_back(alv[3 * index[0]]);
alvResult.push_back(alv[3 * index[0] + 1]);
alvResult.push_back(alv[3 * index[0] + 2]);
int indexN = parseInt(splitStrsF[2].c_str()) - 1;
alnResult.push_back(aln[3 * indexN]);
alnResult.push_back(aln[3 * indexN + 1]);
alnResult.push_back(aln[3 * indexN + 2]);
splitStrsF.clear();
splitString(splitStrs[2].c_str(), delimsF, splitStrsF);
index[1] = parseInt(splitStrsF[0].c_str()) - 1;
alvResult.push_back(alv[3 * index[1]]);
alvResult.push_back(alv[3 * index[1] + 1]);
alvResult.push_back(alv[3 * index[1] + 2]);
indexN = parseInt(splitStrsF[2].c_str()) - 1;
alnResult.push_back(aln[3 * indexN]);
alnResult.push_back(aln[3 * indexN + 1]);
alnResult.push_back(aln[3 * indexN + 2]);
splitStrsF.clear();
splitString(splitStrs[3].c_str(), delimsF, splitStrsF);
index[2] = parseInt(splitStrsF[0].c_str()) - 1;
alvResult.push_back(alv[3 * index[2]]);
alvResult.push_back(alv[3 * index[2] + 1]);
alvResult.push_back(alv[3 * index[2] + 2]);
indexN = parseInt(splitStrsF[2].c_str()) - 1;
alnResult.push_back(aln[3 * indexN]);
alnResult.push_back(aln[3 * indexN + 1]);
alnResult.push_back(aln[3 * indexN + 2]);
}
splitStrs.clear();
}
int vCount = (int)alvResult.size() / 3;
int dataByteCount = vCount * 6 * sizeof(float);
float* vdataIn = new float[vCount * 6];
int indexTemp = 0;
for (int i = 0; i<vCount; i++) {
vdataIn[indexTemp++] = alvResult[i * 3 + 0];
vdataIn[indexTemp++] = alvResult[i * 3 + 1];
vdataIn[indexTemp++] = alvResult[i * 3 + 2];
vdataIn[indexTemp++] = alnResult[i * 3 + 0];
vdataIn[indexTemp++] = alnResult[i * 3 + 1];
vdataIn[indexTemp++] = alnResult[i * 3 + 2];
}
lo = new ObjObject(vdataIn, dataByteCount, vCount, device, memoryroperties);
return lo;
}
| 26.238938 | 125 | 0.616863 | luopan007 |
7cec34c9a68fd99cd10d58595333207bf912a1d2 | 1,659 | hpp | C++ | src/common/interfaces/models/ibrush.hpp | squeevee/Addle | 20ec4335669fbd88d36742f586899d8416920959 | [
"MIT"
] | 3 | 2020-03-05T06:36:51.000Z | 2020-06-20T03:25:02.000Z | src/common/interfaces/models/ibrush.hpp | squeevee/Addle | 20ec4335669fbd88d36742f586899d8416920959 | [
"MIT"
] | 13 | 2020-03-11T17:43:42.000Z | 2020-12-11T03:36:05.000Z | src/common/interfaces/models/ibrush.hpp | squeevee/Addle | 20ec4335669fbd88d36742f586899d8416920959 | [
"MIT"
] | 1 | 2020-09-28T06:53:46.000Z | 2020-09-28T06:53:46.000Z | /**
* Addle source code
* @file
* @copyright Copyright 2020 Eleanor Hawk
* @copyright Modification and distribution permitted under the terms of the
* MIT License. See "LICENSE" for full details.
*/
#ifndef IBRUSH_HPP
#define IBRUSH_HPP
#include <QIcon>
#include <QList>
#include "idtypes/brushid.hpp"
#include "idtypes/brushengineid.hpp"
#include "interfaces/traits.hpp"
namespace Addle {
class BrushBuilder;
class IBrush
{
public:
enum PreviewHint
{
Subtractive = 1
};
Q_DECLARE_FLAGS(PreviewHints, PreviewHint);
virtual ~IBrush() = default;
virtual void initialize(const BrushBuilder& builder) = 0;
virtual BrushId id() const = 0;
virtual BrushEngineId engineId() const = 0;
virtual QIcon icon() const = 0;
// Common engine parameters, like pressure and velocity dynamics, will be
// given properties here.
// virtual QVariantHash& customEngineParameters() = 0;
virtual QVariantHash customEngineParameters() const = 0;
virtual bool isSizeInvariant() const = 0;
virtual bool isPixelAliased() const = 0;
virtual bool eraserMode() const = 0;
virtual bool copyMode() const = 0;
virtual double minSize() const = 0;
virtual double maxSize() const = 0;
virtual QList<double> preferredSizes() const = 0;
virtual bool strictSizing() const = 0;
virtual double preferredStartingSize() const = 0;
virtual PreviewHints previewHints() const = 0;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(IBrush::PreviewHints);
DECL_PERSISTENT_OBJECT_TYPE(IBrush, BrushId);
} // namespace Addle
Q_DECLARE_INTERFACE(Addle::IBrush, "org.addle.IBrush")
#endif // IBRUSH_HPP | 24.043478 | 77 | 0.711272 | squeevee |
7cf2a97a5b01882b2de3acf43af4fc9e2525da7d | 2,166 | cc | C++ | IOMultiplexing/poll/poll_srv.cc | HONGYU-LEE/NetWorkProgram | 0ce15d2211c56f635f8fde948632c16009d8d96f | [
"MIT"
] | null | null | null | IOMultiplexing/poll/poll_srv.cc | HONGYU-LEE/NetWorkProgram | 0ce15d2211c56f635f8fde948632c16009d8d96f | [
"MIT"
] | null | null | null | IOMultiplexing/poll/poll_srv.cc | HONGYU-LEE/NetWorkProgram | 0ce15d2211c56f635f8fde948632c16009d8d96f | [
"MIT"
] | null | null | null | #include<poll.h>
#include<vector>
#include <sys/socket.h>
#include"TcpSocket.hpp"
#define MAX_SIZE 10
using namespace std;
int main(int argc, char* argv[])
{
if(argc != 3)
{
cerr << "正确输入方式: ./select_srv.cc ip port\n" << endl;
return -1;
}
string srv_ip = argv[1];
uint16_t srv_port = stoi(argv[2]);
TcpSocket lst_socket;
//创建监听套接字
CheckSafe(lst_socket.Socket());
//绑定地址信息
CheckSafe(lst_socket.Bind(srv_ip, srv_port));
//开始监听
CheckSafe(lst_socket.Listen());
struct pollfd poll_fd[MAX_SIZE];
poll_fd[0].fd = lst_socket.GetFd();
poll_fd[0].events = POLLIN;
int i = 0, maxi = 0;
for(i = 1; i < MAX_SIZE; i++)
{
poll_fd[i].fd = -1;
}
while(1)
{
int ret = poll(poll_fd, maxi + 1, 2000);
if(ret < 0)
{
cerr << "not ready" << endl;
continue;
}
else if(ret == 0)
{
cerr << "wait timeout" << endl;
continue;
}
//监听套接字就绪则增加新连接
if(poll_fd[0].revents & (POLLIN | POLLERR))
{
struct sockaddr_in addr;
socklen_t len = sizeof(sockaddr_in);
//创建一个新的套接字与客户端建立连接
int new_fd = accept(lst_socket.GetFd(), (sockaddr*)&addr, &len);
for(i = 1; i < MAX_SIZE; i++)
{
if(poll_fd[i].fd == -1)
{
poll_fd[i].fd = new_fd;
poll_fd[i].events = POLLIN;
break;
}
}
if(i > maxi)
{
maxi = i;
}
if(--ret <= 0)
{
continue;
}
}
for(i = 1; i <= maxi; i++)
{
if(poll_fd[i].fd == -1)
{
continue;
}
if(poll_fd[i].revents & (POLLIN | POLLERR))
{
//新数据到来
char buff[4096] = { 0 };
int ret = recv(poll_fd[i].fd, buff, 4096, 0);
if(ret == 0)
{
std::cerr << "connect error" << std::endl;
close(poll_fd[i].fd);
poll_fd[i].fd = -1;
}
else if(ret < 0)
{
std::cerr << "recv error" << std::endl;
close(poll_fd[i].fd);
poll_fd[i].fd = -1;
}
else
{
cout << "cli send message: " << buff << endl;
}
if(--ret <= 0)
{
break;
}
}
}
}
lst_socket.Close();
return 0;
}
| 16.661538 | 67 | 0.495845 | HONGYU-LEE |
7cf504084893fb79c4ca0e3a7d8686499d78e081 | 5,719 | hpp | C++ | include/elemental/blas-like/level2/Syr.hpp | ahmadia/Elemental-1 | f9a82c76a06728e9e04a4316e41803efbadb5a19 | [
"BSD-3-Clause"
] | null | null | null | include/elemental/blas-like/level2/Syr.hpp | ahmadia/Elemental-1 | f9a82c76a06728e9e04a4316e41803efbadb5a19 | [
"BSD-3-Clause"
] | null | null | null | include/elemental/blas-like/level2/Syr.hpp | ahmadia/Elemental-1 | f9a82c76a06728e9e04a4316e41803efbadb5a19 | [
"BSD-3-Clause"
] | null | null | null | /*
Copyright (c) 2009-2013, Jack Poulson
All rights reserved.
This file is part of Elemental and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
*/
#pragma once
#ifndef BLAS_SYR_HPP
#define BLAS_SYR_HPP
namespace elem {
template<typename T>
inline void
Syr
( UpperOrLower uplo, T alpha, const Matrix<T>& x, Matrix<T>& A,
bool conjugate=false )
{
#ifndef RELEASE
CallStackEntry entry("Syr");
if( A.Height() != A.Width() )
throw std::logic_error("A must be square");
if( x.Width() != 1 && x.Height() != 1 )
throw std::logic_error("x must be a vector");
const int xLength = ( x.Width()==1 ? x.Height() : x.Width() );
if( xLength != A.Height() )
throw std::logic_error("x must conform with A");
#endif
const char uploChar = UpperOrLowerToChar( uplo );
const int m = A.Height();
const int incx = ( x.Width()==1 ? 1 : x.LDim() );
if( conjugate )
{
blas::Her
( uploChar, m, alpha, x.LockedBuffer(), incx, A.Buffer(), A.LDim() );
}
else
{
blas::Syr
( uploChar, m, alpha, x.LockedBuffer(), incx, A.Buffer(), A.LDim() );
}
}
template<typename T>
inline void
Syr
( UpperOrLower uplo,
T alpha, const DistMatrix<T>& x,
DistMatrix<T>& A,
bool conjugate=false )
{
#ifndef RELEASE
CallStackEntry entry("Syr");
if( A.Grid() != x.Grid() )
throw std::logic_error
("A and x must be distributed over the same grid");
if( A.Height() != A.Width() )
throw std::logic_error("A must be square");
const int xLength = ( x.Width()==1 ? x.Height() : x.Width() );
if( A.Height() != xLength )
{
std::ostringstream msg;
msg << "A must conform with x: \n"
<< " A ~ " << A.Height() << " x " << A.Width() << "\n"
<< " x ~ " << x.Height() << " x " << x.Width() << "\n";
throw std::logic_error( msg.str() );
}
#endif
const Grid& g = A.Grid();
const int localHeight = A.LocalHeight();
const int localWidth = A.LocalWidth();
const int r = g.Height();
const int c = g.Width();
const int colShift = A.ColShift();
const int rowShift = A.RowShift();
if( x.Width() == 1 )
{
DistMatrix<T,MC,STAR> x_MC_STAR(g);
DistMatrix<T,MR,STAR> x_MR_STAR(g);
x_MC_STAR.AlignWith( A );
x_MR_STAR.AlignWith( A );
//--------------------------------------------------------------------//
x_MC_STAR = x;
x_MR_STAR = x_MC_STAR;
const T* xBuffer = x_MC_STAR.LockedBuffer();
if( uplo == LOWER )
{
for( int jLocal=0; jLocal<localWidth; ++jLocal )
{
const int j = rowShift + jLocal*c;
const int heightAboveDiag = Length(j,colShift,r);
const T beta = x_MR_STAR.GetLocal(jLocal,0);
const T gamma = ( conjugate ? alpha*Conj(beta) : alpha*beta );
T* ACol = A.Buffer(0,jLocal);
for( int iLocal=heightAboveDiag; iLocal<localHeight; ++iLocal )
ACol[iLocal] += gamma*xBuffer[iLocal];
}
}
else
{
for( int jLocal=0; jLocal<localWidth; ++jLocal )
{
const int j = rowShift + jLocal*c;
const int heightToDiag = Length(j+1,colShift,r);
const T beta = x_MR_STAR.GetLocal(jLocal,0);
const T gamma = ( conjugate ? alpha*Conj(beta) : alpha*beta );
T* ACol = A.Buffer(0,jLocal);
for( int iLocal=0; iLocal<heightToDiag; ++iLocal )
ACol[iLocal] += gamma*xBuffer[iLocal];
}
}
//--------------------------------------------------------------------//
x_MC_STAR.FreeAlignments();
x_MR_STAR.FreeAlignments();
}
else
{
DistMatrix<T,STAR,MC> x_STAR_MC(g);
DistMatrix<T,STAR,MR> x_STAR_MR(g);
x_STAR_MC.AlignWith( A );
x_STAR_MR.AlignWith( A );
//--------------------------------------------------------------------//
x_STAR_MR = x;
x_STAR_MC = x_STAR_MR;
const T* xBuffer = x_STAR_MC.LockedBuffer();
const int incx = x_STAR_MC.LDim();
if( uplo == LOWER )
{
for( int jLocal=0; jLocal<localWidth; ++jLocal )
{
const int j = rowShift + jLocal*c;
const int heightAboveDiag = Length(j,colShift,r);
const T beta = x_STAR_MR.GetLocal(0,jLocal);
const T gamma = ( conjugate ? alpha*Conj(beta) : alpha*beta );
T* ACol = A.Buffer(0,jLocal);
for( int iLocal=heightAboveDiag; iLocal<localHeight; ++iLocal )
ACol[iLocal] += gamma*xBuffer[iLocal*incx];
}
}
else
{
for( int jLocal=0; jLocal<localWidth; ++jLocal )
{
const int j = rowShift + jLocal*c;
const int heightToDiag = Length(j+1,colShift,r);
const T beta = x_STAR_MR.GetLocal(0,jLocal);
const T gamma = ( conjugate ? alpha*Conj(beta) : alpha*beta );
T* ACol = A.Buffer(0,jLocal);
for( int iLocal=0; iLocal<heightToDiag; ++iLocal )
ACol[iLocal] += gamma*xBuffer[iLocal*incx];
}
}
//--------------------------------------------------------------------//
x_STAR_MC.FreeAlignments();
x_STAR_MR.FreeAlignments();
}
}
} // namespace elem
#endif // ifndef BLAS_SYR_HPP
| 32.867816 | 80 | 0.503934 | ahmadia |
7cf553e2bf5442978a22d937f8e2cf5584a52da9 | 2,018 | cpp | C++ | libs/base/src/ring_log.cpp | blagodarin/yttrium | 534289c3082355e5537a03c0b5855b60f0c344ad | [
"Apache-2.0"
] | null | null | null | libs/base/src/ring_log.cpp | blagodarin/yttrium | 534289c3082355e5537a03c0b5855b60f0c344ad | [
"Apache-2.0"
] | null | null | null | libs/base/src/ring_log.cpp | blagodarin/yttrium | 534289c3082355e5537a03c0b5855b60f0c344ad | [
"Apache-2.0"
] | null | null | null | // This file is part of the Yttrium toolkit.
// Copyright (C) Sergei Blagodarin.
// SPDX-License-Identifier: Apache-2.0
#include "ring_log.h"
#include <seir_base/int_utils.hpp>
#include <algorithm>
#include <cassert>
#include <cstring>
namespace
{
static_assert(seir::isPowerOf2(Yt::RingLog::BufferSize));
// If BufferSize is a power of two, we can wrap offsets using masking.
constexpr auto OffsetMask = Yt::RingLog::BufferSize - 1;
}
namespace Yt
{
bool RingLog::pop(std::string& text)
{
if (_size == 0)
return false;
const auto text_offset = (_offset + 1) & OffsetMask;
const auto text_size = size_t{ _buffer[_offset] };
_offset = (text_offset + text_size) & OffsetMask;
assert(_size >= text_size + 1);
_size -= text_size + 1;
if (const auto continuous_size = _buffer.size() - text_offset; continuous_size < text_size)
{
text.assign(reinterpret_cast<const char*>(_buffer.data() + text_offset), continuous_size);
text.append(reinterpret_cast<const char*>(_buffer.data()), text_size - continuous_size);
}
else
text.assign(reinterpret_cast<const char*>(_buffer.data() + text_offset), text_size);
return true;
}
void RingLog::push(std::string_view text) noexcept
{
const auto text_size = std::min(text.size(), MaxStringSize);
while (text_size >= _buffer.size() - _size)
{
const auto skip = 1 + size_t{ _buffer[_offset] };
_offset = (_offset + skip) & OffsetMask;
assert(_size >= skip);
_size -= skip;
}
_buffer[(_offset + _size++) & OffsetMask] = static_cast<uint8_t>(text_size);
const auto text_offset = (_offset + _size) & OffsetMask;
if (const auto continuous_size = _buffer.size() - text_offset; continuous_size < text_size)
{
std::memcpy(_buffer.data() + text_offset, text.data(), continuous_size);
std::memcpy(_buffer.data(), text.data() + continuous_size, text_size - continuous_size);
}
else
std::memcpy(_buffer.data() + text_offset, text.data(), text_size);
_size += text_size;
assert(_size <= _buffer.size());
}
}
| 31.046154 | 93 | 0.697721 | blagodarin |
7cf6473f1e8501b080c2e6ec1449e8cb4db9fe60 | 1,478 | hpp | C++ | HN_DateTime/HN_Clock.hpp | Jusdetalent/JT_Utility | 2dec8ff0e8a0263a589f0829d63cf01dcae46d79 | [
"MIT"
] | null | null | null | HN_DateTime/HN_Clock.hpp | Jusdetalent/JT_Utility | 2dec8ff0e8a0263a589f0829d63cf01dcae46d79 | [
"MIT"
] | null | null | null | HN_DateTime/HN_Clock.hpp | Jusdetalent/JT_Utility | 2dec8ff0e8a0263a589f0829d63cf01dcae46d79 | [
"MIT"
] | null | null | null | #ifndef HN_CLOCK_HPP_INCLUDED
#define HN_CLOCK_HPP_INCLUDED
#include <sys/time.h>
#include <string>
#include "HN_TimePoint.hpp"
namespace hnapi
{
namespace datetime
{
// Time category definition
enum HN_ClockMode{
HN_YEARS_MODE = 1,
HN_MOUTHS_MODE = 2,
HN_WEEKS_MODE = 3,
HN_DAYS_MODE = 4,
HN_HOURS_MODE = 5,
HN_MINUTES_MODE = 6,
HN_SECONDS_MODE = 7,
HN_MILLISECONDS_MODE = 8,
HN_MICROSECONDS_MODE = 9,
HN_NANOSECONDS_MODE = 10,
HN_TIMESTAMP_MODE = 11
};
// define ticks pointer us long long
typedef long long HN_ClockPoint;
// Clock class
class HN_Clock
{
public:
// Static Methods
static HN_ClockPoint now(HN_ClockMode _mode);
static HN_TimePoint makeNowTimePoint(void);
static HN_TimePoint makeTimePoint(
// Date data
int _mday, int _mon, int _year,
// Time data
int _hour = 0, int _min = 0, int _sec = 0
);
static HN_TimePoint makeTimePoint(std::string date_time);
static HN_TimePoint makeTimePoint(time_t timestamp);
};
}
}
#endif // HN_CLOCK_H_INCLUDED
| 28.423077 | 74 | 0.504736 | Jusdetalent |
7cf7da24a72b18a9f275569f4b62621b471c2f10 | 6,386 | cpp | C++ | transport_catalogue/json/__tests__/json__tests.cpp | oleg-nazarov/cpp-yandex-praktikum | a09781c198b0aff469c4d1175c91d72800909bf2 | [
"MIT"
] | 1 | 2022-03-15T19:01:03.000Z | 2022-03-15T19:01:03.000Z | transport_catalogue/json/__tests__/json__tests.cpp | oleg-nazarov/cpp-yandex-praktikum | a09781c198b0aff469c4d1175c91d72800909bf2 | [
"MIT"
] | 1 | 2022-03-15T19:11:59.000Z | 2022-03-15T19:11:59.000Z | transport_catalogue/json/__tests__/json__tests.cpp | oleg-nazarov/cpp-yandex-praktikum | a09781c198b0aff469c4d1175c91d72800909bf2 | [
"MIT"
] | null | null | null | #include <cassert>
#include <chrono>
#include <iostream>
#include <sstream>
#include <string_view>
#include "../../../helpers/run_test.h"
#include "../json.h"
using namespace json;
using namespace std::literals;
namespace {
json::Document LoadJSON(const std::string& s) {
std::istringstream strm(s);
return json::Load(strm);
}
std::string Print(const Node& node) {
std::ostringstream out;
Print(Document{node}, out);
return out.str();
}
void MustFailToLoad(const std::string& s) {
try {
LoadJSON(s);
std::cerr << "ParsingError exception is expected on '"sv << s << "'"sv << std::endl;
assert(false);
} catch (const json::ParsingError&) {
// ok
} catch (const std::exception& e) {
std::cerr << "exception thrown: "sv << e.what() << std::endl;
assert(false);
} catch (...) {
std::cerr << "Unexpected error"sv << std::endl;
assert(false);
}
}
template <typename Fn>
void MustThrowLogicError(Fn fn) {
try {
fn();
std::cerr << "logic_error is expected"sv << std::endl;
assert(false);
} catch (const std::logic_error&) {
// ok
} catch (const std::exception& e) {
std::cerr << "exception thrown: "sv << e.what() << std::endl;
assert(false);
} catch (...) {
std::cerr << "Unexpected error"sv << std::endl;
assert(false);
}
}
void TestNull() {
Node null_node;
assert(null_node.IsNull());
Node null_node1{nullptr};
assert(null_node1.IsNull());
assert(Print(null_node) == "null"s);
const Node node = LoadJSON("null"s).GetRoot();
assert(node.IsNull());
assert(node == null_node);
}
void TestNumbers() {
Node int_node{42};
assert(int_node.IsInt());
assert(int_node.AsInt() == 42);
// целые числа являются подмножеством чисел с плавающей запятой
assert(int_node.IsDouble());
// Когда узел хранит int, можно получить соответствующее ему double-значение
assert(int_node.AsDouble() == 42.0);
assert(!int_node.IsPureDouble());
Node dbl_node{123.45};
assert(dbl_node.IsDouble());
assert(dbl_node.AsDouble() == 123.45);
assert(dbl_node.IsPureDouble()); // Значение содержит число с плавающей запятой
assert(!dbl_node.IsInt());
assert(Print(int_node) == "42"s);
assert(Print(dbl_node) == "123.45"s);
assert(LoadJSON("42"s).GetRoot() == int_node);
assert(LoadJSON("123.45"s).GetRoot() == dbl_node);
assert(LoadJSON("0.25"s).GetRoot().AsDouble() == 0.25);
assert(LoadJSON("3e5"s).GetRoot().AsDouble() == 3e5);
assert(LoadJSON("1.2e-5"s).GetRoot().AsDouble() == 1.2e-5);
assert(LoadJSON("1.2e+5"s).GetRoot().AsDouble() == 1.2e5);
assert(LoadJSON("-123456"s).GetRoot().AsInt() == -123456);
}
void TestStrings() {
Node str_node{"Hello, \"everybody\""s};
assert(str_node.IsString());
assert(str_node.AsString() == "Hello, \"everybody\""s);
assert(!str_node.IsInt());
assert(!str_node.IsDouble());
assert(Print(str_node) == "\"Hello, \\\"everybody\\\"\""s);
assert(LoadJSON(Print(str_node)).GetRoot() == str_node);
}
void TestStringEscapeSequences() {
Node str_node = LoadJSON("\" \\r\\n \\\" \\t\\t \\\\ \""s).GetRoot();
assert(str_node.AsString() == " \r\n \" \t\t \\ "s);
}
void TestBool() {
Node true_node{true};
assert(true_node.IsBool());
assert(true_node.AsBool());
Node false_node{false};
assert(false_node.IsBool());
assert(!false_node.AsBool());
assert(Print(true_node) == "true"s);
assert(Print(false_node) == "false"s);
assert(LoadJSON("true"s).GetRoot() == true_node);
assert(LoadJSON("false"s).GetRoot() == false_node);
}
void TestArray() {
Node arr_node{Array{1, 1.23, "Hello"s}};
assert(arr_node.IsArray());
const Array& arr = arr_node.AsArray();
assert(arr.size() == 3);
assert(arr.at(0).AsInt() == 1);
assert(LoadJSON("[1, 1.23, \"Hello\"]"s).GetRoot() == arr_node);
assert(LoadJSON(Print(arr_node)).GetRoot() == arr_node);
}
void TestMap() {
Node dict_node{Dict{{"key1"s, "value1"s}, {"key2"s, 42}}};
assert(dict_node.IsDict());
const Dict& dict = dict_node.AsDict();
assert(dict.size() == 2);
assert(dict.at("key1"s).AsString() == "value1"s);
assert(dict.at("key2"s).AsInt() == 42);
assert(LoadJSON("{ \"key1\": \"value1\", \"key2\": 42 }"s).GetRoot() == dict_node);
assert(LoadJSON(Print(dict_node)).GetRoot() == dict_node);
}
void TestErrorHandling() {
MustFailToLoad("["s);
MustFailToLoad("]"s);
MustFailToLoad("{"s);
MustFailToLoad("}"s);
MustFailToLoad("\"hello"s); // незакрытая кавычка
MustFailToLoad("tru"s);
MustFailToLoad("fals"s);
MustFailToLoad("nul"s);
Node dbl_node{3.5};
MustThrowLogicError([&dbl_node] {
dbl_node.AsInt();
});
MustThrowLogicError([&dbl_node] {
dbl_node.AsString();
});
MustThrowLogicError([&dbl_node] {
dbl_node.AsArray();
});
Node array_node{Array{}};
MustThrowLogicError([&array_node] {
array_node.AsDict();
});
MustThrowLogicError([&array_node] {
array_node.AsDouble();
});
MustThrowLogicError([&array_node] {
array_node.AsBool();
});
}
void Benchmark() {
const auto start = std::chrono::steady_clock::now();
Array arr;
arr.reserve(1'000);
for (int i = 0; i < 1'000; ++i) {
arr.emplace_back(Dict{
{"int"s, 42},
{"double"s, 42.1},
{"null"s, nullptr},
{"string"s, "hello"s},
{"array"s, Array{1, 2, 3}},
{"bool"s, true},
{"map"s, Dict{{"key"s, "value"s}}},
});
}
std::stringstream strm;
json::Print(Document{arr}, strm);
const auto doc = json::Load(strm);
assert(doc.GetRoot().AsArray() == arr);
const auto duration = std::chrono::steady_clock::now() - start;
std::cout << "Benchmark: "s << std::chrono::duration_cast<std::chrono::milliseconds>(duration).count() << "ms"sv << std::endl;
}
} // namespace
int main() {
RUN_TEST(TestNull);
RUN_TEST(TestNumbers);
RUN_TEST(TestStrings);
RUN_TEST(TestStringEscapeSequences);
RUN_TEST(TestBool);
RUN_TEST(TestArray);
RUN_TEST(TestMap);
RUN_TEST(TestErrorHandling);
RUN_TEST(Benchmark);
return 0;
} // namespace
| 27.407725 | 130 | 0.596461 | oleg-nazarov |
7cf87a8d1cc883576c03473d174f297c4087aaa3 | 81,920 | cpp | C++ | T3000/T3000CO2_NET/CT3000CO2_NET.cpp | DHSERVICE56/T3000_Building_Automation_System | 77bd47a356211b1c8ad09fb8d785e9f880d3cd26 | [
"MIT"
] | 1 | 2019-12-11T05:14:08.000Z | 2019-12-11T05:14:08.000Z | T3000/T3000CO2_NET/CT3000CO2_NET.cpp | DHSERVICE56/T3000_Building_Automation_System | 77bd47a356211b1c8ad09fb8d785e9f880d3cd26 | [
"MIT"
] | null | null | null | T3000/T3000CO2_NET/CT3000CO2_NET.cpp | DHSERVICE56/T3000_Building_Automation_System | 77bd47a356211b1c8ad09fb8d785e9f880d3cd26 | [
"MIT"
] | 1 | 2021-05-31T18:56:31.000Z | 2021-05-31T18:56:31.000Z |
///////////////////////////////// Includes //////////////////////////////////
#include "stdafx.h"
#include "CT3000CO2_NET.h"
//////////////////////////////// Statics / Macros /////////////////////////////
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
////////////////////////////////// Implementation /////////////////////////////
IMPLEMENT_DYNAMIC(CCT3000CO2_NET, CWnd)
CCT3000CO2_NET::CCT3000CO2_NET() : m_DirectFunction(0),
m_DirectPointer(0)
{
}
BOOL CCT3000CO2_NET::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, DWORD dwExStyle, LPVOID lpParam)
{
//Call our base class implementation of CWnd::CreateEx
BOOL bSuccess = CreateEx(dwExStyle, _T("scintilla"), NULL, dwStyle, rect, pParentWnd, nID, lpParam);
//Setup the direct access data
if (bSuccess)
SetupDirectAccess();
//If we are running as Unicode, then use the UTF8 codepage
#ifdef _UNICODE
SetCodePage(SC_CP_UTF8);
#endif
return bSuccess;
}
void CCT3000CO2_NET::SetupDirectAccess()
{
//Setup the direct access data
m_DirectFunction = GetDirectFunction();
m_DirectPointer = GetDirectPointer();
}
CCT3000CO2_NET::~CCT3000CO2_NET()
{
DestroyWindow();
}
inline LRESULT CCT3000CO2_NET::Call(UINT message, WPARAM wParam, LPARAM lParam, BOOL bDirect)
{
ASSERT(::IsWindow(m_hWnd)); //Window must be valid
if (bDirect)
{
ASSERT(m_DirectFunction); //Direct function must be valid
return (reinterpret_cast<SciFnDirect>(m_DirectFunction))(m_DirectPointer, message, wParam, lParam);
}
else
return SendMessage(message, wParam, lParam);
}
LRESULT CCT3000CO2_NET::GetDirectFunction()
{
return SendMessage(SCI_GETDIRECTFUNCTION, 0, 0);
}
LRESULT CCT3000CO2_NET::GetDirectPointer()
{
return SendMessage(SCI_GETDIRECTPOINTER, 0, 0);
}
CString CCT3000CO2_NET::GetSelText()
{
//Call the function which does the work
CString sSelText;
GetSelText(sSelText.GetBufferSetLength(GetSelectionEnd() - GetSelectionStart()));
sSelText.ReleaseBuffer();
return sSelText;
}
#ifdef _UNICODE
int CCT3000CO2_NET::W2UTF8(const wchar_t* pszText, int nLength, char*& pszUTF8Text)
{
//Validate our parameters
ASSERT(pszText);
//First call the function to determine how much heap space we need to allocate
int nUTF8Length = WideCharToMultiByte(CP_UTF8, 0, pszText, nLength, NULL, 0, NULL, NULL);
//If the calculated length is zero, then ensure we have at least room for a NULL terminator
if (nUTF8Length == 0)
nUTF8Length = 1;
//Now allocate the heap space
pszUTF8Text = new char[nUTF8Length];
pszUTF8Text[0] = '\0';
//And now recall with the buffer to get the converted text
int nCharsWritten = WideCharToMultiByte(CP_UTF8, 0, pszText, nLength, pszUTF8Text, nUTF8Length, NULL, NULL);
if (nLength != -1)
return nCharsWritten; //Trust the return value
else
return nCharsWritten ? nCharsWritten - 1 : 0; //Exclude the NULL terminator written
}
int CCT3000CO2_NET::UTF82W(const char* pszText, int nLength, wchar_t*& pszWText)
{
//Validate our parameters
ASSERT(pszText);
//First call the function to determine how much heap space we need to allocate
int nWideLength = MultiByteToWideChar(CP_UTF8, 0, pszText, nLength, NULL, 0);
//If the calculated length is zero, then ensure we have at least room for a NULL terminator
if (nWideLength == 0)
nWideLength = 1;
//Now allocate the heap space
pszWText = new wchar_t[nWideLength];
pszWText[0] = '\0';
//And now recall with the buffer to get the converted text
int nCharsWritten = MultiByteToWideChar(CP_UTF8, 0, pszText, nLength, pszWText, nWideLength);
if (nLength != -1)
return nCharsWritten; //Trust the return value
else
return nCharsWritten ? nCharsWritten - 1 : 0; //Exclude the NULL terminator written
}
void CCT3000CO2_NET::AddText(int length, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
int nUTF8Length = W2UTF8(text, length, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
AddText(nUTF8Length, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::InsertText(long pos, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(text, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
InsertText(pos, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
int CCT3000CO2_NET::GetSelText(wchar_t* text, BOOL bDirect)
{
//Allocate some heap memory to contain the UTF8 text
char* pszUTF8 = new char[GetSelectionEnd() - GetSelectionStart() + 1];
//Call the function which does the work
GetSelText(pszUTF8, bDirect);
//Now convert the UTF8 text back to Unicode
wchar_t* pszWText;
int nWLength = UTF82W(pszUTF8, -1, pszWText);
ASSERT(text);
#if (_MSC_VER >= 1400)
wcscpy_s(text, nWLength+1, pszWText);
#else
wcscpy(text, pszWText);
#endif
//Tidy up the heap memory before we return
delete [] pszWText;
delete [] pszUTF8;
return nWLength;
}
int CCT3000CO2_NET::GetCurLine(int length, wchar_t* text, BOOL bDirect)
{
//Allocate some heap memory to contain the UTF8 text
int nUTF8Length = text ? length*4 : GetCurLine(0, static_cast<char*>(NULL), bDirect)*4;
char* pszUTF8 = new char[nUTF8Length]; //A Unicode character can take up to 4 octets when expressed as UTF8
//Call the function which does the work
int nOriginalReturn = GetCurLine(nUTF8Length, pszUTF8, bDirect);
//Now convert the UTF8 text back to Unicode
wchar_t* pszWText;
int nReturnLength = UTF82W(pszUTF8, -1, pszWText);
int nReturn = nReturnLength + 1;
if (text)
{
//Copy as much text as possible into the output parameter
int i;
for (i=0; i<length-1 && i<nReturnLength; i++)
text[i] = pszWText[i];
text[i] = L'\0';
//What we have text to return, use the original return value
nReturn = nOriginalReturn;
}
//Tidy up the heap memory before we return
delete [] pszWText;
delete [] pszUTF8;
return nReturn;
}
void CCT3000CO2_NET::StyleSetFont(int style, const wchar_t* fontName, BOOL bDirect)
{
char* pszUTF8;
W2UTF8(fontName, -1, pszUTF8);
StyleSetFont(style, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::SetWordChars(const wchar_t* characters, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(characters, -1, pszUTF8);
SetWordChars(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::AutoCShow(int lenEntered, const wchar_t* itemList, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(itemList, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
AutoCShow(lenEntered, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::AutoCStops(const wchar_t* characterSet, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(characterSet, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
AutoCStops(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::AutoCSelect(const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(text, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
AutoCSelect(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::AutoCSetFillUps(const wchar_t* characterSet, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(characterSet, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
AutoCSetFillUps(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::UserListShow(int listType, const wchar_t* itemList, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(itemList, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
UserListShow(listType, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
int CCT3000CO2_NET::GetLine(int line, wchar_t* text, BOOL bDirect)
{
//Validate our parameters
ASSERT(text);
//Work out how big the input buffer is (for details on this, see the EM_GETLINE documentation)
WORD* wBuffer = reinterpret_cast<WORD*>(text);
WORD wInputBufferSize = wBuffer[0];
//Allocate some heap memory to contain the UTF8 text
int nUTF8Length = wInputBufferSize*4;
char* pszUTF8 = new char[nUTF8Length]; //A Unicode character can take up to 4 octets when expressed as UTF8
//Set the buffer size in the new buffer
wBuffer = reinterpret_cast<WORD*>(pszUTF8);
wBuffer[0] = wInputBufferSize;
//Call the function which does the work
int nChars = GetLine(line, pszUTF8, bDirect);
//Now convert the UTF8 text back to Unicode
wchar_t* pszWText;
int nWLength = UTF82W(pszUTF8, nChars, pszWText);
for (int i=0; i<=nWLength && i<=wInputBufferSize; i++)
text[i] = pszWText[i];
//Tidy up the heap memory before we return
delete [] pszWText;
delete [] pszUTF8;
return nWLength;
}
void CCT3000CO2_NET::ReplaceSel(const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(text, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
ReplaceSel(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::SetText(const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(text, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
SetText(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
int CCT3000CO2_NET::GetText(int length, wchar_t* text, BOOL bDirect)
{
//Allocate some heap memory to contain the UTF8 text
int nUTF8Length = length*4;
char* pszUTF8 = new char[nUTF8Length]; //A Unicode character can take up to 4 octets when expressed as UTF8
//Call the function which does the work
GetText(nUTF8Length, pszUTF8, bDirect);
//Now convert the UTF8 text back to Unicode
wchar_t* pszWText;
int nWLength = UTF82W(pszUTF8, -1, pszWText);
//Copy as much text as possible into the output parameter
ASSERT(text);
int i;
for (i=0; i<length-1 && i<nWLength; i++)
text[i] = pszWText[i];
text[i] = L'\0';
//Tidy up the heap memory before we return
delete [] pszWText;
delete [] pszUTF8;
return nWLength;
}
int CCT3000CO2_NET::ReplaceTarget(int length, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
int nUTF8Length = W2UTF8(text, length, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
int nReturn = ReplaceTarget(nUTF8Length, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
return nReturn;
}
int CCT3000CO2_NET::ReplaceTargetRE(int length, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
int nUTF8Length = W2UTF8(text, length, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
int nReturn = ReplaceTargetRE(nUTF8Length, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
return nReturn;
}
int CCT3000CO2_NET::SearchInTarget(int length, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
int nUTF8Length = W2UTF8(text, length, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
int nReturn = SearchInTarget(nUTF8Length, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
return nReturn;
}
void CCT3000CO2_NET::CallTipShow(long pos, const wchar_t* definition, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(definition, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
CallTipShow(pos, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
int CCT3000CO2_NET::TextWidth(int style, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(text, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
int nReturn = TextWidth(style, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
return nReturn;
}
void CCT3000CO2_NET::AppendText(int length, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
int nUTF8Length = W2UTF8(text, length, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
AppendText(nUTF8Length, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
int CCT3000CO2_NET::SearchNext(int flags, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(text, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
int nReturn = SearchNext(flags, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
return nReturn;
}
int CCT3000CO2_NET::SearchPrev(int flags, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(text, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
int nReturn = SearchPrev(flags, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
return nReturn;
}
void CCT3000CO2_NET::CopyText(int length, const wchar_t* text, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
int nUTF8Length = W2UTF8(text, length, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
CopyText(nUTF8Length, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::SetWhitespaceChars(const wchar_t* characters, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(characters, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
SetWhitespaceChars(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::SetProperty(const wchar_t* key, const wchar_t* value, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8Key;
W2UTF8(key, -1, pszUTF8Key);
char* pszUTF8Value;
W2UTF8(value, -1, pszUTF8Value);
//Call the native scintilla version of the function with the UTF8 text
SetProperty(pszUTF8Key, pszUTF8Value, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8Value;
delete [] pszUTF8Key;
}
void CCT3000CO2_NET::SetKeyWords(int keywordSet, const wchar_t* keyWords, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(keyWords, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
SetKeyWords(keywordSet, pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::SetLexerLanguage(const wchar_t* language, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(language, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
SetLexerLanguage(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
void CCT3000CO2_NET::LoadLexerLibrary(const wchar_t* path, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(path, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
LoadLexerLibrary(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
}
int CCT3000CO2_NET::GetProperty(const wchar_t* key, wchar_t* buf, BOOL bDirect)
{
//Validate our parameters
ASSERT(key);
//Convert the Key value to UTF8
char* pszUTF8Key;
W2UTF8(key, -1, pszUTF8Key);
//Allocate some heap memory to contain the UTF8 text
int nUTF8ValueLength = GetProperty(pszUTF8Key, 0, bDirect);
char* pszUTF8Value = new char[nUTF8ValueLength + 1]; //Don't forget the NULL terminator
//Call the function which does the work
GetProperty(pszUTF8Key, pszUTF8Value, bDirect);
//Now convert the UTF8 text back to Unicode
wchar_t* pszWText;
int nWLength = UTF82W(pszUTF8Value, -1, pszWText);
if (buf)
#if (_MSC_VER >= 1400)
wcscpy_s(buf, nWLength+1, pszWText);
#else
wcscpy(buf, pszWText);
#endif
//Tidy up the heap memory before we return
delete [] pszWText;
delete [] pszUTF8Value;
delete [] pszUTF8Key;
return nWLength;
}
int CCT3000CO2_NET::GetPropertyExpanded(const wchar_t* key, wchar_t* buf, BOOL bDirect)
{
//Validate our parameters
ASSERT(key);
//Convert the Key value to UTF8
char* pszUTF8Key;
W2UTF8(key, -1, pszUTF8Key);
//Allocate some heap memory to contain the UTF8 text
int nUTF8ValueLength = GetPropertyExpanded(pszUTF8Key, 0, bDirect);
char* pszUTF8Value = new char[nUTF8ValueLength + 1]; //Don't forget the NULL terminator
//Call the function which does the work
GetPropertyExpanded(pszUTF8Key, pszUTF8Value, bDirect);
//Now convert the UTF8 text back to Unicode
wchar_t* pszWText;
int nWLength = UTF82W(pszUTF8Value, -1, pszWText);
if (buf)
#if (_MSC_VER >= 1400)
wcscpy_s(buf, nWLength+1, pszWText);
#else
wcscpy(buf, pszWText);
#endif
//Tidy up the heap memory before we return
delete [] pszWText;
delete [] pszUTF8Value;
delete [] pszUTF8Key;
return nWLength;
}
int CCT3000CO2_NET::GetPropertyInt(const wchar_t* key, BOOL bDirect)
{
//Convert the unicode text to UTF8
char* pszUTF8;
W2UTF8(key, -1, pszUTF8);
//Call the native scintilla version of the function with the UTF8 text
int nReturn = GetPropertyInt(pszUTF8, bDirect);
//Tidy up the heap memory before we return
delete [] pszUTF8;
return nReturn;
}
int CCT3000CO2_NET::StyleGetFont(int style, wchar_t* fontName, BOOL bDirect)
{
//Allocate a UTF8 buffer to contain the font name. See the notes for
//SCI_STYLEGETFONT / SCI_STYLESETFONT on the reasons why we can use
//a statically sized buffer of 32 characters in size. Note it is 33 below
//to include space for the NULL terminator
char szUTF8FontName[33*4]; //A Unicode character can take up to 4 octets when expressed as UTF8
//Call the native scintilla version of the function with a UTF8 text buffer
int nReturn = StyleGetFont(style, szUTF8FontName, bDirect);
//Now convert the UTF8 text back to Unicode
wchar_t* pszWFontName;
int nWLength = UTF82W(szUTF8FontName, -1, pszWFontName);
if (fontName)
#if (_MSC_VER >= 1400)
wcscpy_s(fontName, nWLength+1, pszWFontName);
#else
wcscpy(fontName, pszWFontName);
nWLength; //To get rid of "local variable is initialized but not referenced" warning when compiled in VC 6
#endif
//Tidy up the heap memory before we return
delete [] pszWFontName;
return nReturn;
}
#endif //#ifdef _UNICODE
int CCT3000CO2_NET::GetLineEx(int line, TCHAR* text, int nMaxChars, BOOL bDirect)
{
//Validate out parameters
ASSERT(text);
//Explicitly set the first value of text to nMaxChars (for details on this, see the EM_GETLINE documentation)
WORD* wBuffer = reinterpret_cast<WORD*>(text);
wBuffer[0] = nMaxChars;
//now call off to the other implementation to do the real work
return GetLine(line, text, bDirect);
}
//Everything else after this point was auto generated using the "ConvertScintillaiface.js" script
void CCT3000CO2_NET::AddText(int length, const char* text, BOOL bDirect)
{
Call(SCI_ADDTEXT, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(text), bDirect);
}
void CCT3000CO2_NET::AddStyledText(int length, char* c, BOOL bDirect)
{
Call(SCI_ADDSTYLEDTEXT, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(c), bDirect);
}
void CCT3000CO2_NET::InsertText(long pos, const char* text, BOOL bDirect)
{
Call(SCI_INSERTTEXT, static_cast<WPARAM>(pos), reinterpret_cast<LPARAM>(text), bDirect);
}
void CCT3000CO2_NET::ClearAll(BOOL bDirect)
{
Call(SCI_CLEARALL, 0, 0, bDirect);
}
void CCT3000CO2_NET::ClearDocumentStyle(BOOL bDirect)
{
Call(SCI_CLEARDOCUMENTSTYLE, 0, 0, bDirect);
}
int CCT3000CO2_NET::GetLength(BOOL bDirect)
{
return Call(SCI_GETLENGTH, 0, 0, bDirect);
}
int CCT3000CO2_NET::GetCharAt(long pos, BOOL bDirect)
{
return Call(SCI_GETCHARAT, static_cast<WPARAM>(pos), 0, bDirect);
}
long CCT3000CO2_NET::GetCurrentPos(BOOL bDirect)
{
return Call(SCI_GETCURRENTPOS, 0, 0, bDirect);
}
long CCT3000CO2_NET::GetAnchor(BOOL bDirect)
{
return Call(SCI_GETANCHOR, 0, 0, bDirect);
}
int CCT3000CO2_NET::GetStyleAt(long pos, BOOL bDirect)
{
return Call(SCI_GETSTYLEAT, static_cast<WPARAM>(pos), 0, bDirect);
}
void CCT3000CO2_NET::Redo(BOOL bDirect)
{
Call(SCI_REDO, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetUndoCollection(BOOL collectUndo, BOOL bDirect)
{
Call(SCI_SETUNDOCOLLECTION, static_cast<WPARAM>(collectUndo), 0, bDirect);
}
void CCT3000CO2_NET::SelectAll(BOOL bDirect)
{
Call(SCI_SELECTALL, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetSavePoint(BOOL bDirect)
{
Call(SCI_SETSAVEPOINT, 0, 0, bDirect);
}
int CCT3000CO2_NET::GetStyledText(TextRange* tr, BOOL bDirect)
{
return Call(SCI_GETSTYLEDTEXT, 0, reinterpret_cast<LPARAM>(tr), bDirect);
}
BOOL CCT3000CO2_NET::CanRedo(BOOL bDirect)
{
return Call(SCI_CANREDO, 0, 0, bDirect);
}
int CCT3000CO2_NET::MarkerLineFromHandle(int handle, BOOL bDirect)
{
return Call(SCI_MARKERLINEFROMHANDLE, static_cast<WPARAM>(handle), 0, bDirect);
}
void CCT3000CO2_NET::MarkerDeleteHandle(int handle, BOOL bDirect)
{
Call(SCI_MARKERDELETEHANDLE, static_cast<WPARAM>(handle), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetUndoCollection(BOOL bDirect)
{
return Call(SCI_GETUNDOCOLLECTION, 0, 0, bDirect);
}
int CCT3000CO2_NET::GetViewWS(BOOL bDirect)
{
return Call(SCI_GETVIEWWS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetViewWS(int viewWS, BOOL bDirect)
{
Call(SCI_SETVIEWWS, static_cast<WPARAM>(viewWS), 0, bDirect);
}
long CCT3000CO2_NET::PositionFromPoint(int x, int y, BOOL bDirect)
{
return Call(SCI_POSITIONFROMPOINT, static_cast<WPARAM>(x), static_cast<LPARAM>(y), bDirect);
}
long CCT3000CO2_NET::PositionFromPointClose(int x, int y, BOOL bDirect)
{
return Call(SCI_POSITIONFROMPOINTCLOSE, static_cast<WPARAM>(x), static_cast<LPARAM>(y), bDirect);
}
void CCT3000CO2_NET::GotoLine(int line, BOOL bDirect)
{
Call(SCI_GOTOLINE, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::GotoPos(long pos, BOOL bDirect)
{
Call(SCI_GOTOPOS, static_cast<WPARAM>(pos), 0, bDirect);
}
void CCT3000CO2_NET::SetAnchor(long posAnchor, BOOL bDirect)
{
Call(SCI_SETANCHOR, static_cast<WPARAM>(posAnchor), 0, bDirect);
}
int CCT3000CO2_NET::GetCurLine(int length, char* text, BOOL bDirect)
{
return Call(SCI_GETCURLINE, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(text), bDirect);
}
long CCT3000CO2_NET::GetEndStyled(BOOL bDirect)
{
return Call(SCI_GETENDSTYLED, 0, 0, bDirect);
}
void CCT3000CO2_NET::ConvertEOLs(int eolMode, BOOL bDirect)
{
Call(SCI_CONVERTEOLS, static_cast<WPARAM>(eolMode), 0, bDirect);
}
int CCT3000CO2_NET::GetEOLMode(BOOL bDirect)
{
return Call(SCI_GETEOLMODE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetEOLMode(int eolMode, BOOL bDirect)
{
Call(SCI_SETEOLMODE, static_cast<WPARAM>(eolMode), 0, bDirect);
}
void CCT3000CO2_NET::StartStyling(long pos, int mask, BOOL bDirect)
{
Call(SCI_STARTSTYLING, static_cast<WPARAM>(pos), static_cast<LPARAM>(mask), bDirect);
}
void CCT3000CO2_NET::SetStyling(int length, int style, BOOL bDirect)
{
Call(SCI_SETSTYLING, static_cast<WPARAM>(length), static_cast<LPARAM>(style), bDirect);
}
BOOL CCT3000CO2_NET::GetBufferedDraw(BOOL bDirect)
{
return Call(SCI_GETBUFFEREDDRAW, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetBufferedDraw(BOOL buffered, BOOL bDirect)
{
Call(SCI_SETBUFFEREDDRAW, static_cast<WPARAM>(buffered), 0, bDirect);
}
void CCT3000CO2_NET::SetTabWidth(int tabWidth, BOOL bDirect)
{
Call(SCI_SETTABWIDTH, static_cast<WPARAM>(tabWidth), 0, bDirect);
}
int CCT3000CO2_NET::GetTabWidth(BOOL bDirect)
{
return Call(SCI_GETTABWIDTH, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCodePage(int codePage, BOOL bDirect)
{
Call(SCI_SETCODEPAGE, static_cast<WPARAM>(codePage), 0, bDirect);
}
void CCT3000CO2_NET::SetUsePalette(BOOL usePalette, BOOL bDirect)
{
Call(SCI_SETUSEPALETTE, static_cast<WPARAM>(usePalette), 0, bDirect);
}
void CCT3000CO2_NET::MarkerDefine(int markerNumber, int markerSymbol, BOOL bDirect)
{
Call(SCI_MARKERDEFINE, static_cast<WPARAM>(markerNumber), static_cast<LPARAM>(markerSymbol), bDirect);
}
void CCT3000CO2_NET::MarkerSetFore(int markerNumber, COLORREF fore, BOOL bDirect)
{
Call(SCI_MARKERSETFORE, static_cast<WPARAM>(markerNumber), static_cast<LPARAM>(fore), bDirect);
}
void CCT3000CO2_NET::MarkerSetBack(int markerNumber, COLORREF back, BOOL bDirect)
{
Call(SCI_MARKERSETBACK, static_cast<WPARAM>(markerNumber), static_cast<LPARAM>(back), bDirect);
}
int CCT3000CO2_NET::MarkerAdd(int line, int markerNumber, BOOL bDirect)
{
return Call(SCI_MARKERADD, static_cast<WPARAM>(line), static_cast<LPARAM>(markerNumber), bDirect);
}
void CCT3000CO2_NET::MarkerDelete(int line, int markerNumber, BOOL bDirect)
{
Call(SCI_MARKERDELETE, static_cast<WPARAM>(line), static_cast<LPARAM>(markerNumber), bDirect);
}
void CCT3000CO2_NET::MarkerDeleteAll(int markerNumber, BOOL bDirect)
{
Call(SCI_MARKERDELETEALL, static_cast<WPARAM>(markerNumber), 0, bDirect);
}
int CCT3000CO2_NET::MarkerGet(int line, BOOL bDirect)
{
return Call(SCI_MARKERGET, static_cast<WPARAM>(line), 0, bDirect);
}
int CCT3000CO2_NET::MarkerNext(int lineStart, int markerMask, BOOL bDirect)
{
return Call(SCI_MARKERNEXT, static_cast<WPARAM>(lineStart), static_cast<LPARAM>(markerMask), bDirect);
}
int CCT3000CO2_NET::MarkerPrevious(int lineStart, int markerMask, BOOL bDirect)
{
return Call(SCI_MARKERPREVIOUS, static_cast<WPARAM>(lineStart), static_cast<LPARAM>(markerMask), bDirect);
}
void CCT3000CO2_NET::MarkerDefinePixmap(int markerNumber, const char* pixmap, BOOL bDirect)
{
Call(SCI_MARKERDEFINEPIXMAP, static_cast<WPARAM>(markerNumber), reinterpret_cast<LPARAM>(pixmap), bDirect);
}
void CCT3000CO2_NET::MarkerAddSet(int line, int set, BOOL bDirect)
{
Call(SCI_MARKERADDSET, static_cast<WPARAM>(line), static_cast<LPARAM>(set), bDirect);
}
void CCT3000CO2_NET::MarkerSetAlpha(int markerNumber, int alpha, BOOL bDirect)
{
Call(SCI_MARKERSETALPHA, static_cast<WPARAM>(markerNumber), static_cast<LPARAM>(alpha), bDirect);
}
void CCT3000CO2_NET::SetMarginTypeN(int margin, int marginType, BOOL bDirect)
{
Call(SCI_SETMARGINTYPEN, static_cast<WPARAM>(margin), static_cast<LPARAM>(marginType), bDirect);
}
int CCT3000CO2_NET::GetMarginTypeN(int margin, BOOL bDirect)
{
return Call(SCI_GETMARGINTYPEN, static_cast<WPARAM>(margin), 0, bDirect);
}
void CCT3000CO2_NET::SetMarginWidthN(int margin, int pixelWidth, BOOL bDirect)
{
Call(SCI_SETMARGINWIDTHN, static_cast<WPARAM>(margin), static_cast<LPARAM>(pixelWidth), bDirect);
}
int CCT3000CO2_NET::GetMarginWidthN(int margin, BOOL bDirect)
{
return Call(SCI_GETMARGINWIDTHN, static_cast<WPARAM>(margin), 0, bDirect);
}
void CCT3000CO2_NET::SetMarginMaskN(int margin, int mask, BOOL bDirect)
{
Call(SCI_SETMARGINMASKN, static_cast<WPARAM>(margin), static_cast<LPARAM>(mask), bDirect);
}
int CCT3000CO2_NET::GetMarginMaskN(int margin, BOOL bDirect)
{
return Call(SCI_GETMARGINMASKN, static_cast<WPARAM>(margin), 0, bDirect);
}
void CCT3000CO2_NET::SetMarginSensitiveN(int margin, BOOL sensitive, BOOL bDirect)
{
Call(SCI_SETMARGINSENSITIVEN, static_cast<WPARAM>(margin), static_cast<LPARAM>(sensitive), bDirect);
}
BOOL CCT3000CO2_NET::GetMarginSensitiveN(int margin, BOOL bDirect)
{
return Call(SCI_GETMARGINSENSITIVEN, static_cast<WPARAM>(margin), 0, bDirect);
}
void CCT3000CO2_NET::StyleClearAll(BOOL bDirect)
{
Call(SCI_STYLECLEARALL, 0, 0, bDirect);
}
void CCT3000CO2_NET::StyleSetFore(int style, COLORREF fore, BOOL bDirect)
{
Call(SCI_STYLESETFORE, static_cast<WPARAM>(style), static_cast<LPARAM>(fore), bDirect);
}
void CCT3000CO2_NET::StyleSetBack(int style, COLORREF back, BOOL bDirect)
{
Call(SCI_STYLESETBACK, static_cast<WPARAM>(style), static_cast<LPARAM>(back), bDirect);
}
void CCT3000CO2_NET::StyleSetBold(int style, BOOL bold, BOOL bDirect)
{
Call(SCI_STYLESETBOLD, static_cast<WPARAM>(style), static_cast<LPARAM>(bold), bDirect);
}
void CCT3000CO2_NET::StyleSetItalic(int style, BOOL italic, BOOL bDirect)
{
Call(SCI_STYLESETITALIC, static_cast<WPARAM>(style), static_cast<LPARAM>(italic), bDirect);
}
void CCT3000CO2_NET::StyleSetSize(int style, int sizePoints, BOOL bDirect)
{
Call(SCI_STYLESETSIZE, static_cast<WPARAM>(style), static_cast<LPARAM>(sizePoints), bDirect);
}
void CCT3000CO2_NET::StyleSetFont(int style, const char* fontName, BOOL bDirect)
{
Call(SCI_STYLESETFONT, static_cast<WPARAM>(style), reinterpret_cast<LPARAM>(fontName), bDirect);
}
void CCT3000CO2_NET::StyleSetEOLFilled(int style, BOOL filled, BOOL bDirect)
{
Call(SCI_STYLESETEOLFILLED, static_cast<WPARAM>(style), static_cast<LPARAM>(filled), bDirect);
}
void CCT3000CO2_NET::StyleResetDefault(BOOL bDirect)
{
Call(SCI_STYLERESETDEFAULT, 0, 0, bDirect);
}
void CCT3000CO2_NET::StyleSetUnderline(int style, BOOL underline, BOOL bDirect)
{
Call(SCI_STYLESETUNDERLINE, static_cast<WPARAM>(style), static_cast<LPARAM>(underline), bDirect);
}
COLORREF CCT3000CO2_NET::StyleGetFore(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETFORE, static_cast<WPARAM>(style), 0, bDirect);
}
COLORREF CCT3000CO2_NET::StyleGetBack(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETBACK, static_cast<WPARAM>(style), 0, bDirect);
}
BOOL CCT3000CO2_NET::StyleGetBold(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETBOLD, static_cast<WPARAM>(style), 0, bDirect);
}
BOOL CCT3000CO2_NET::StyleGetItalic(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETITALIC, static_cast<WPARAM>(style), 0, bDirect);
}
int CCT3000CO2_NET::StyleGetSize(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETSIZE, static_cast<WPARAM>(style), 0, bDirect);
}
int CCT3000CO2_NET::StyleGetFont(int style, char* fontName, BOOL bDirect)
{
return Call(SCI_STYLEGETFONT, static_cast<WPARAM>(style), reinterpret_cast<LPARAM>(fontName), bDirect);
}
BOOL CCT3000CO2_NET::StyleGetEOLFilled(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETEOLFILLED, static_cast<WPARAM>(style), 0, bDirect);
}
BOOL CCT3000CO2_NET::StyleGetUnderline(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETUNDERLINE, static_cast<WPARAM>(style), 0, bDirect);
}
int CCT3000CO2_NET::StyleGetCase(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETCASE, static_cast<WPARAM>(style), 0, bDirect);
}
int CCT3000CO2_NET::StyleGetCharacterSet(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETCHARACTERSET, static_cast<WPARAM>(style), 0, bDirect);
}
BOOL CCT3000CO2_NET::StyleGetVisible(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETVISIBLE, static_cast<WPARAM>(style), 0, bDirect);
}
BOOL CCT3000CO2_NET::StyleGetChangeable(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETCHANGEABLE, static_cast<WPARAM>(style), 0, bDirect);
}
BOOL CCT3000CO2_NET::StyleGetHotSpot(int style, BOOL bDirect)
{
return Call(SCI_STYLEGETHOTSPOT, static_cast<WPARAM>(style), 0, bDirect);
}
void CCT3000CO2_NET::StyleSetCase(int style, int caseForce, BOOL bDirect)
{
Call(SCI_STYLESETCASE, static_cast<WPARAM>(style), static_cast<LPARAM>(caseForce), bDirect);
}
void CCT3000CO2_NET::StyleSetCharacterSet(int style, int characterSet, BOOL bDirect)
{
Call(SCI_STYLESETCHARACTERSET, static_cast<WPARAM>(style), static_cast<LPARAM>(characterSet), bDirect);
}
void CCT3000CO2_NET::StyleSetHotSpot(int style, BOOL hotspot, BOOL bDirect)
{
Call(SCI_STYLESETHOTSPOT, static_cast<WPARAM>(style), static_cast<LPARAM>(hotspot), bDirect);
}
void CCT3000CO2_NET::SetSelFore(BOOL useSetting, COLORREF fore, BOOL bDirect)
{
Call(SCI_SETSELFORE, static_cast<WPARAM>(useSetting), static_cast<LPARAM>(fore), bDirect);
}
void CCT3000CO2_NET::SetSelBack(BOOL useSetting, COLORREF back, BOOL bDirect)
{
Call(SCI_SETSELBACK, static_cast<WPARAM>(useSetting), static_cast<LPARAM>(back), bDirect);
}
int CCT3000CO2_NET::GetSelAlpha(BOOL bDirect)
{
return Call(SCI_GETSELALPHA, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetSelAlpha(int alpha, BOOL bDirect)
{
Call(SCI_SETSELALPHA, static_cast<WPARAM>(alpha), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetSelEOLFilled(BOOL bDirect)
{
return Call(SCI_GETSELEOLFILLED, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetSelEOLFilled(BOOL filled, BOOL bDirect)
{
Call(SCI_SETSELEOLFILLED, static_cast<WPARAM>(filled), 0, bDirect);
}
void CCT3000CO2_NET::SetCaretFore(COLORREF fore, BOOL bDirect)
{
Call(SCI_SETCARETFORE, static_cast<WPARAM>(fore), 0, bDirect);
}
void CCT3000CO2_NET::AssignCmdKey(DWORD km, int msg, BOOL bDirect)
{
Call(SCI_ASSIGNCMDKEY, static_cast<WPARAM>(km), static_cast<LPARAM>(msg), bDirect);
}
void CCT3000CO2_NET::ClearCmdKey(DWORD km, BOOL bDirect)
{
Call(SCI_CLEARCMDKEY, static_cast<WPARAM>(km), 0, bDirect);
}
void CCT3000CO2_NET::ClearAllCmdKeys(BOOL bDirect)
{
Call(SCI_CLEARALLCMDKEYS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetStylingEx(int length, const char* styles, BOOL bDirect)
{
Call(SCI_SETSTYLINGEX, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(styles), bDirect);
}
void CCT3000CO2_NET::StyleSetVisible(int style, BOOL visible, BOOL bDirect)
{
Call(SCI_STYLESETVISIBLE, static_cast<WPARAM>(style), static_cast<LPARAM>(visible), bDirect);
}
int CCT3000CO2_NET::GetCaretPeriod(BOOL bDirect)
{
return Call(SCI_GETCARETPERIOD, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCaretPeriod(int periodMilliseconds, BOOL bDirect)
{
Call(SCI_SETCARETPERIOD, static_cast<WPARAM>(periodMilliseconds), 0, bDirect);
}
void CCT3000CO2_NET::SetWordChars(const char* characters, BOOL bDirect)
{
Call(SCI_SETWORDCHARS, 0, reinterpret_cast<LPARAM>(characters), bDirect);
}
void CCT3000CO2_NET::BeginUndoAction(BOOL bDirect)
{
Call(SCI_BEGINUNDOACTION, 0, 0, bDirect);
}
void CCT3000CO2_NET::EndUndoAction(BOOL bDirect)
{
Call(SCI_ENDUNDOACTION, 0, 0, bDirect);
}
void CCT3000CO2_NET::IndicSetStyle(int indic, int style, BOOL bDirect)
{
Call(SCI_INDICSETSTYLE, static_cast<WPARAM>(indic), static_cast<LPARAM>(style), bDirect);
}
int CCT3000CO2_NET::IndicGetStyle(int indic, BOOL bDirect)
{
return Call(SCI_INDICGETSTYLE, static_cast<WPARAM>(indic), 0, bDirect);
}
void CCT3000CO2_NET::IndicSetFore(int indic, COLORREF fore, BOOL bDirect)
{
Call(SCI_INDICSETFORE, static_cast<WPARAM>(indic), static_cast<LPARAM>(fore), bDirect);
}
COLORREF CCT3000CO2_NET::IndicGetFore(int indic, BOOL bDirect)
{
return Call(SCI_INDICGETFORE, static_cast<WPARAM>(indic), 0, bDirect);
}
void CCT3000CO2_NET::IndicSetUnder(int indic, BOOL under, BOOL bDirect)
{
Call(SCI_INDICSETUNDER, static_cast<WPARAM>(indic), static_cast<LPARAM>(under), bDirect);
}
BOOL CCT3000CO2_NET::IndicGetUnder(int indic, BOOL bDirect)
{
return Call(SCI_INDICGETUNDER, static_cast<WPARAM>(indic), 0, bDirect);
}
void CCT3000CO2_NET::SetWhitespaceFore(BOOL useSetting, COLORREF fore, BOOL bDirect)
{
Call(SCI_SETWHITESPACEFORE, static_cast<WPARAM>(useSetting), static_cast<LPARAM>(fore), bDirect);
}
void CCT3000CO2_NET::SetWhitespaceBack(BOOL useSetting, COLORREF back, BOOL bDirect)
{
Call(SCI_SETWHITESPACEBACK, static_cast<WPARAM>(useSetting), static_cast<LPARAM>(back), bDirect);
}
void CCT3000CO2_NET::SetStyleBits(int bits, BOOL bDirect)
{
Call(SCI_SETSTYLEBITS, static_cast<WPARAM>(bits), 0, bDirect);
}
int CCT3000CO2_NET::GetStyleBits(BOOL bDirect)
{
return Call(SCI_GETSTYLEBITS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetLineState(int line, int state, BOOL bDirect)
{
Call(SCI_SETLINESTATE, static_cast<WPARAM>(line), static_cast<LPARAM>(state), bDirect);
}
int CCT3000CO2_NET::GetLineState(int line, BOOL bDirect)
{
return Call(SCI_GETLINESTATE, static_cast<WPARAM>(line), 0, bDirect);
}
int CCT3000CO2_NET::GetMaxLineState(BOOL bDirect)
{
return Call(SCI_GETMAXLINESTATE, 0, 0, bDirect);
}
BOOL CCT3000CO2_NET::GetCaretLineVisible(BOOL bDirect)
{
return Call(SCI_GETCARETLINEVISIBLE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCaretLineVisible(BOOL show, BOOL bDirect)
{
Call(SCI_SETCARETLINEVISIBLE, static_cast<WPARAM>(show), 0, bDirect);
}
COLORREF CCT3000CO2_NET::GetCaretLineBack(BOOL bDirect)
{
return Call(SCI_GETCARETLINEBACK, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCaretLineBack(COLORREF back, BOOL bDirect)
{
Call(SCI_SETCARETLINEBACK, static_cast<WPARAM>(back), 0, bDirect);
}
void CCT3000CO2_NET::StyleSetChangeable(int style, BOOL changeable, BOOL bDirect)
{
Call(SCI_STYLESETCHANGEABLE, static_cast<WPARAM>(style), static_cast<LPARAM>(changeable), bDirect);
}
void CCT3000CO2_NET::AutoCShow(int lenEntered, const char* itemList, BOOL bDirect)
{
Call(SCI_AUTOCSHOW, static_cast<WPARAM>(lenEntered), reinterpret_cast<LPARAM>(itemList), bDirect);
}
void CCT3000CO2_NET::AutoCCancel(BOOL bDirect)
{
Call(SCI_AUTOCCANCEL, 0, 0, bDirect);
}
BOOL CCT3000CO2_NET::AutoCActive(BOOL bDirect)
{
return Call(SCI_AUTOCACTIVE, 0, 0, bDirect);
}
long CCT3000CO2_NET::AutoCPosStart(BOOL bDirect)
{
return Call(SCI_AUTOCPOSSTART, 0, 0, bDirect);
}
void CCT3000CO2_NET::AutoCComplete(BOOL bDirect)
{
Call(SCI_AUTOCCOMPLETE, 0, 0, bDirect);
}
void CCT3000CO2_NET::AutoCStops(const char* characterSet, BOOL bDirect)
{
Call(SCI_AUTOCSTOPS, 0, reinterpret_cast<LPARAM>(characterSet), bDirect);
}
void CCT3000CO2_NET::AutoCSetSeparator(int separatorCharacter, BOOL bDirect)
{
Call(SCI_AUTOCSETSEPARATOR, static_cast<WPARAM>(separatorCharacter), 0, bDirect);
}
int CCT3000CO2_NET::AutoCGetSeparator(BOOL bDirect)
{
return Call(SCI_AUTOCGETSEPARATOR, 0, 0, bDirect);
}
void CCT3000CO2_NET::AutoCSelect(const char* text, BOOL bDirect)
{
Call(SCI_AUTOCSELECT, 0, reinterpret_cast<LPARAM>(text), bDirect);
}
void CCT3000CO2_NET::AutoCSetCancelAtStart(BOOL cancel, BOOL bDirect)
{
Call(SCI_AUTOCSETCANCELATSTART, static_cast<WPARAM>(cancel), 0, bDirect);
}
BOOL CCT3000CO2_NET::AutoCGetCancelAtStart(BOOL bDirect)
{
return Call(SCI_AUTOCGETCANCELATSTART, 0, 0, bDirect);
}
void CCT3000CO2_NET::AutoCSetFillUps(const char* characterSet, BOOL bDirect)
{
Call(SCI_AUTOCSETFILLUPS, 0, reinterpret_cast<LPARAM>(characterSet), bDirect);
}
void CCT3000CO2_NET::AutoCSetChooseSingle(BOOL chooseSingle, BOOL bDirect)
{
Call(SCI_AUTOCSETCHOOSESINGLE, static_cast<WPARAM>(chooseSingle), 0, bDirect);
}
BOOL CCT3000CO2_NET::AutoCGetChooseSingle(BOOL bDirect)
{
return Call(SCI_AUTOCGETCHOOSESINGLE, 0, 0, bDirect);
}
void CCT3000CO2_NET::AutoCSetIgnoreCase(BOOL ignoreCase, BOOL bDirect)
{
Call(SCI_AUTOCSETIGNORECASE, static_cast<WPARAM>(ignoreCase), 0, bDirect);
}
BOOL CCT3000CO2_NET::AutoCGetIgnoreCase(BOOL bDirect)
{
return Call(SCI_AUTOCGETIGNORECASE, 0, 0, bDirect);
}
void CCT3000CO2_NET::UserListShow(int listType, const char* itemList, BOOL bDirect)
{
Call(SCI_USERLISTSHOW, static_cast<WPARAM>(listType), reinterpret_cast<LPARAM>(itemList), bDirect);
}
void CCT3000CO2_NET::AutoCSetAutoHide(BOOL autoHide, BOOL bDirect)
{
Call(SCI_AUTOCSETAUTOHIDE, static_cast<WPARAM>(autoHide), 0, bDirect);
}
BOOL CCT3000CO2_NET::AutoCGetAutoHide(BOOL bDirect)
{
return Call(SCI_AUTOCGETAUTOHIDE, 0, 0, bDirect);
}
void CCT3000CO2_NET::AutoCSetDropRestOfWord(BOOL dropRestOfWord, BOOL bDirect)
{
Call(SCI_AUTOCSETDROPRESTOFWORD, static_cast<WPARAM>(dropRestOfWord), 0, bDirect);
}
BOOL CCT3000CO2_NET::AutoCGetDropRestOfWord(BOOL bDirect)
{
return Call(SCI_AUTOCGETDROPRESTOFWORD, 0, 0, bDirect);
}
void CCT3000CO2_NET::RegisterImage(int type, const char* xpmData, BOOL bDirect)
{
Call(SCI_REGISTERIMAGE, static_cast<WPARAM>(type), reinterpret_cast<LPARAM>(xpmData), bDirect);
}
void CCT3000CO2_NET::ClearRegisteredImages(BOOL bDirect)
{
Call(SCI_CLEARREGISTEREDIMAGES, 0, 0, bDirect);
}
int CCT3000CO2_NET::AutoCGetTypeSeparator(BOOL bDirect)
{
return Call(SCI_AUTOCGETTYPESEPARATOR, 0, 0, bDirect);
}
void CCT3000CO2_NET::AutoCSetTypeSeparator(int separatorCharacter, BOOL bDirect)
{
Call(SCI_AUTOCSETTYPESEPARATOR, static_cast<WPARAM>(separatorCharacter), 0, bDirect);
}
void CCT3000CO2_NET::AutoCSetMaxWidth(int characterCount, BOOL bDirect)
{
Call(SCI_AUTOCSETMAXWIDTH, static_cast<WPARAM>(characterCount), 0, bDirect);
}
int CCT3000CO2_NET::AutoCGetMaxWidth(BOOL bDirect)
{
return Call(SCI_AUTOCGETMAXWIDTH, 0, 0, bDirect);
}
void CCT3000CO2_NET::AutoCSetMaxHeight(int rowCount, BOOL bDirect)
{
Call(SCI_AUTOCSETMAXHEIGHT, static_cast<WPARAM>(rowCount), 0, bDirect);
}
int CCT3000CO2_NET::AutoCGetMaxHeight(BOOL bDirect)
{
return Call(SCI_AUTOCGETMAXHEIGHT, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetIndent(int indentSize, BOOL bDirect)
{
Call(SCI_SETINDENT, static_cast<WPARAM>(indentSize), 0, bDirect);
}
int CCT3000CO2_NET::GetIndent(BOOL bDirect)
{
return Call(SCI_GETINDENT, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetUseTabs(BOOL useTabs, BOOL bDirect)
{
Call(SCI_SETUSETABS, static_cast<WPARAM>(useTabs), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetUseTabs(BOOL bDirect)
{
return Call(SCI_GETUSETABS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetLineIndentation(int line, int indentSize, BOOL bDirect)
{
Call(SCI_SETLINEINDENTATION, static_cast<WPARAM>(line), static_cast<LPARAM>(indentSize), bDirect);
}
int CCT3000CO2_NET::GetLineIndentation(int line, BOOL bDirect)
{
return Call(SCI_GETLINEINDENTATION, static_cast<WPARAM>(line), 0, bDirect);
}
long CCT3000CO2_NET::GetLineIndentPosition(int line, BOOL bDirect)
{
return Call(SCI_GETLINEINDENTPOSITION, static_cast<WPARAM>(line), 0, bDirect);
}
int CCT3000CO2_NET::GetColumn(long pos, BOOL bDirect)
{
return Call(SCI_GETCOLUMN, static_cast<WPARAM>(pos), 0, bDirect);
}
void CCT3000CO2_NET::SetHScrollBar(BOOL show, BOOL bDirect)
{
Call(SCI_SETHSCROLLBAR, static_cast<WPARAM>(show), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetHScrollBar(BOOL bDirect)
{
return Call(SCI_GETHSCROLLBAR, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetIndentationGuides(int indentView, BOOL bDirect)
{
Call(SCI_SETINDENTATIONGUIDES, static_cast<WPARAM>(indentView), 0, bDirect);
}
int CCT3000CO2_NET::GetIndentationGuides(BOOL bDirect)
{
return Call(SCI_GETINDENTATIONGUIDES, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetHighlightGuide(int column, BOOL bDirect)
{
Call(SCI_SETHIGHLIGHTGUIDE, static_cast<WPARAM>(column), 0, bDirect);
}
int CCT3000CO2_NET::GetHighlightGuide(BOOL bDirect)
{
return Call(SCI_GETHIGHLIGHTGUIDE, 0, 0, bDirect);
}
int CCT3000CO2_NET::GetLineEndPosition(int line, BOOL bDirect)
{
return Call(SCI_GETLINEENDPOSITION, static_cast<WPARAM>(line), 0, bDirect);
}
int CCT3000CO2_NET::GetCodePage(BOOL bDirect)
{
return Call(SCI_GETCODEPAGE, 0, 0, bDirect);
}
COLORREF CCT3000CO2_NET::GetCaretFore(BOOL bDirect)
{
return Call(SCI_GETCARETFORE, 0, 0, bDirect);
}
BOOL CCT3000CO2_NET::GetUsePalette(BOOL bDirect)
{
return Call(SCI_GETUSEPALETTE, 0, 0, bDirect);
}
BOOL CCT3000CO2_NET::GetReadOnly(BOOL bDirect)
{
return Call(SCI_GETREADONLY, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCurrentPos(long pos, BOOL bDirect)
{
Call(SCI_SETCURRENTPOS, static_cast<WPARAM>(pos), 0, bDirect);
}
void CCT3000CO2_NET::SetSelectionStart(long pos, BOOL bDirect)
{
Call(SCI_SETSELECTIONSTART, static_cast<WPARAM>(pos), 0, bDirect);
}
long CCT3000CO2_NET::GetSelectionStart(BOOL bDirect)
{
return Call(SCI_GETSELECTIONSTART, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetSelectionEnd(long pos, BOOL bDirect)
{
Call(SCI_SETSELECTIONEND, static_cast<WPARAM>(pos), 0, bDirect);
}
long CCT3000CO2_NET::GetSelectionEnd(BOOL bDirect)
{
return Call(SCI_GETSELECTIONEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetPrintMagnification(int magnification, BOOL bDirect)
{
Call(SCI_SETPRINTMAGNIFICATION, static_cast<WPARAM>(magnification), 0, bDirect);
}
int CCT3000CO2_NET::GetPrintMagnification(BOOL bDirect)
{
return Call(SCI_GETPRINTMAGNIFICATION, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetPrintColourMode(int mode, BOOL bDirect)
{
Call(SCI_SETPRINTCOLOURMODE, static_cast<WPARAM>(mode), 0, bDirect);
}
int CCT3000CO2_NET::GetPrintColourMode(BOOL bDirect)
{
return Call(SCI_GETPRINTCOLOURMODE, 0, 0, bDirect);
}
long CCT3000CO2_NET::FindText(int flags, TextToFind* ft, BOOL bDirect)
{
return Call(SCI_FINDTEXT, static_cast<WPARAM>(flags), reinterpret_cast<LPARAM>(ft), bDirect);
}
long CCT3000CO2_NET::FormatRange(BOOL draw, RangeToFormat* fr, BOOL bDirect)
{
return Call(SCI_FORMATRANGE, static_cast<WPARAM>(draw), reinterpret_cast<LPARAM>(fr), bDirect);
}
int CCT3000CO2_NET::GetFirstVisibleLine(BOOL bDirect)
{
return Call(SCI_GETFIRSTVISIBLELINE, 0, 0, bDirect);
}
int CCT3000CO2_NET::GetLine(int line, char* text, BOOL bDirect)
{
return Call(SCI_GETLINE, static_cast<WPARAM>(line), reinterpret_cast<LPARAM>(text), bDirect);
}
int CCT3000CO2_NET::GetLineCount(BOOL bDirect)
{
return Call(SCI_GETLINECOUNT, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetMarginLeft(int pixelWidth, BOOL bDirect)
{
Call(SCI_SETMARGINLEFT, 0, static_cast<LPARAM>(pixelWidth), bDirect);
}
int CCT3000CO2_NET::GetMarginLeft(BOOL bDirect)
{
return Call(SCI_GETMARGINLEFT, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetMarginRight(int pixelWidth, BOOL bDirect)
{
Call(SCI_SETMARGINRIGHT, 0, static_cast<LPARAM>(pixelWidth), bDirect);
}
int CCT3000CO2_NET::GetMarginRight(BOOL bDirect)
{
return Call(SCI_GETMARGINRIGHT, 0, 0, bDirect);
}
BOOL CCT3000CO2_NET::GetModify(BOOL bDirect)
{
return Call(SCI_GETMODIFY, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetSel(long start, long end, BOOL bDirect)
{
Call(SCI_SETSEL, static_cast<WPARAM>(start), static_cast<LPARAM>(end), bDirect);
}
int CCT3000CO2_NET::GetSelText(char* text, BOOL bDirect)
{
return Call(SCI_GETSELTEXT, 0, reinterpret_cast<LPARAM>(text), bDirect);
}
int CCT3000CO2_NET::GetTextRange(TextRange* tr, BOOL bDirect)
{
return Call(SCI_GETTEXTRANGE, 0, reinterpret_cast<LPARAM>(tr), bDirect);
}
void CCT3000CO2_NET::HideSelection(BOOL normal, BOOL bDirect)
{
Call(SCI_HIDESELECTION, static_cast<WPARAM>(normal), 0, bDirect);
}
int CCT3000CO2_NET::PointXFromPosition(long pos, BOOL bDirect)
{
return Call(SCI_POINTXFROMPOSITION, 0, static_cast<LPARAM>(pos), bDirect);
}
int CCT3000CO2_NET::PointYFromPosition(long pos, BOOL bDirect)
{
return Call(SCI_POINTYFROMPOSITION, 0, static_cast<LPARAM>(pos), bDirect);
}
int CCT3000CO2_NET::LineFromPosition(long pos, BOOL bDirect)
{
return Call(SCI_LINEFROMPOSITION, static_cast<WPARAM>(pos), 0, bDirect);
}
long CCT3000CO2_NET::PositionFromLine(int line, BOOL bDirect)
{
return Call(SCI_POSITIONFROMLINE, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::LineScroll(int columns, int lines, BOOL bDirect)
{
Call(SCI_LINESCROLL, static_cast<WPARAM>(columns), static_cast<LPARAM>(lines), bDirect);
}
void CCT3000CO2_NET::ScrollCaret(BOOL bDirect)
{
Call(SCI_SCROLLCARET, 0, 0, bDirect);
}
void CCT3000CO2_NET::ReplaceSel(const char* text, BOOL bDirect)
{
Call(SCI_REPLACESEL, 0, reinterpret_cast<LPARAM>(text), bDirect);
}
void CCT3000CO2_NET::SetReadOnly(BOOL readOnly, BOOL bDirect)
{
Call(SCI_SETREADONLY, static_cast<WPARAM>(readOnly), 0, bDirect);
}
void CCT3000CO2_NET::Null(BOOL bDirect)
{
Call(SCI_NULL, 0, 0, bDirect);
}
BOOL CCT3000CO2_NET::CanPaste(BOOL bDirect)
{
return Call(SCI_CANPASTE, 0, 0, bDirect);
}
BOOL CCT3000CO2_NET::CanUndo(BOOL bDirect)
{
return Call(SCI_CANUNDO, 0, 0, bDirect);
}
void CCT3000CO2_NET::EmptyUndoBuffer(BOOL bDirect)
{
Call(SCI_EMPTYUNDOBUFFER, 0, 0, bDirect);
}
void CCT3000CO2_NET::Undo(BOOL bDirect)
{
Call(SCI_UNDO, 0, 0, bDirect);
}
void CCT3000CO2_NET::Cut(BOOL bDirect)
{
Call(SCI_CUT, 0, 0, bDirect);
}
void CCT3000CO2_NET::Copy(BOOL bDirect)
{
Call(SCI_COPY, 0, 0, bDirect);
}
void CCT3000CO2_NET::Paste(BOOL bDirect)
{
Call(SCI_PASTE, 0, 0, bDirect);
}
void CCT3000CO2_NET::Clear(BOOL bDirect)
{
Call(SCI_CLEAR, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetText(const char* text, BOOL bDirect)
{
Call(SCI_SETTEXT, 0, reinterpret_cast<LPARAM>(text), bDirect);
}
int CCT3000CO2_NET::GetText(int length, char* text, BOOL bDirect)
{
return Call(SCI_GETTEXT, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(text), bDirect);
}
int CCT3000CO2_NET::GetTextLength(BOOL bDirect)
{
return Call(SCI_GETTEXTLENGTH, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetOvertype(BOOL overtype, BOOL bDirect)
{
Call(SCI_SETOVERTYPE, static_cast<WPARAM>(overtype), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetOvertype(BOOL bDirect)
{
return Call(SCI_GETOVERTYPE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCaretWidth(int pixelWidth, BOOL bDirect)
{
Call(SCI_SETCARETWIDTH, static_cast<WPARAM>(pixelWidth), 0, bDirect);
}
int CCT3000CO2_NET::GetCaretWidth(BOOL bDirect)
{
return Call(SCI_GETCARETWIDTH, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetTargetStart(long pos, BOOL bDirect)
{
Call(SCI_SETTARGETSTART, static_cast<WPARAM>(pos), 0, bDirect);
}
long CCT3000CO2_NET::GetTargetStart(BOOL bDirect)
{
return Call(SCI_GETTARGETSTART, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetTargetEnd(long pos, BOOL bDirect)
{
Call(SCI_SETTARGETEND, static_cast<WPARAM>(pos), 0, bDirect);
}
long CCT3000CO2_NET::GetTargetEnd(BOOL bDirect)
{
return Call(SCI_GETTARGETEND, 0, 0, bDirect);
}
int CCT3000CO2_NET::ReplaceTarget(int length, const char* text, BOOL bDirect)
{
return Call(SCI_REPLACETARGET, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(text), bDirect);
}
int CCT3000CO2_NET::ReplaceTargetRE(int length, const char* text, BOOL bDirect)
{
return Call(SCI_REPLACETARGETRE, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(text), bDirect);
}
int CCT3000CO2_NET::SearchInTarget(int length, const char* text, BOOL bDirect)
{
return Call(SCI_SEARCHINTARGET, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(text), bDirect);
}
void CCT3000CO2_NET::SetSearchFlags(int flags, BOOL bDirect)
{
Call(SCI_SETSEARCHFLAGS, static_cast<WPARAM>(flags), 0, bDirect);
}
int CCT3000CO2_NET::GetSearchFlags(BOOL bDirect)
{
return Call(SCI_GETSEARCHFLAGS, 0, 0, bDirect);
}
void CCT3000CO2_NET::CallTipShow(long pos, const char* definition, BOOL bDirect)
{
Call(SCI_CALLTIPSHOW, static_cast<WPARAM>(pos), reinterpret_cast<LPARAM>(definition), bDirect);
}
void CCT3000CO2_NET::CallTipCancel(BOOL bDirect)
{
Call(SCI_CALLTIPCANCEL, 0, 0, bDirect);
}
BOOL CCT3000CO2_NET::CallTipActive(BOOL bDirect)
{
return Call(SCI_CALLTIPACTIVE, 0, 0, bDirect);
}
long CCT3000CO2_NET::CallTipPosStart(BOOL bDirect)
{
return Call(SCI_CALLTIPPOSSTART, 0, 0, bDirect);
}
void CCT3000CO2_NET::CallTipSetHlt(int start, int end, BOOL bDirect)
{
Call(SCI_CALLTIPSETHLT, static_cast<WPARAM>(start), static_cast<LPARAM>(end), bDirect);
}
void CCT3000CO2_NET::CallTipSetBack(COLORREF back, BOOL bDirect)
{
Call(SCI_CALLTIPSETBACK, static_cast<WPARAM>(back), 0, bDirect);
}
void CCT3000CO2_NET::CallTipSetFore(COLORREF fore, BOOL bDirect)
{
Call(SCI_CALLTIPSETFORE, static_cast<WPARAM>(fore), 0, bDirect);
}
void CCT3000CO2_NET::CallTipSetForeHlt(COLORREF fore, BOOL bDirect)
{
Call(SCI_CALLTIPSETFOREHLT, static_cast<WPARAM>(fore), 0, bDirect);
}
void CCT3000CO2_NET::CallTipUseStyle(int tabSize, BOOL bDirect)
{
Call(SCI_CALLTIPUSESTYLE, static_cast<WPARAM>(tabSize), 0, bDirect);
}
int CCT3000CO2_NET::VisibleFromDocLine(int line, BOOL bDirect)
{
return Call(SCI_VISIBLEFROMDOCLINE, static_cast<WPARAM>(line), 0, bDirect);
}
int CCT3000CO2_NET::DocLineFromVisible(int lineDisplay, BOOL bDirect)
{
return Call(SCI_DOCLINEFROMVISIBLE, static_cast<WPARAM>(lineDisplay), 0, bDirect);
}
int CCT3000CO2_NET::WrapCount(int line, BOOL bDirect)
{
return Call(SCI_WRAPCOUNT, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::SetFoldLevel(int line, int level, BOOL bDirect)
{
Call(SCI_SETFOLDLEVEL, static_cast<WPARAM>(line), static_cast<LPARAM>(level), bDirect);
}
int CCT3000CO2_NET::GetFoldLevel(int line, BOOL bDirect)
{
return Call(SCI_GETFOLDLEVEL, static_cast<WPARAM>(line), 0, bDirect);
}
int CCT3000CO2_NET::GetLastChild(int line, int level, BOOL bDirect)
{
return Call(SCI_GETLASTCHILD, static_cast<WPARAM>(line), static_cast<LPARAM>(level), bDirect);
}
int CCT3000CO2_NET::GetFoldParent(int line, BOOL bDirect)
{
return Call(SCI_GETFOLDPARENT, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::ShowLines(int lineStart, int lineEnd, BOOL bDirect)
{
Call(SCI_SHOWLINES, static_cast<WPARAM>(lineStart), static_cast<LPARAM>(lineEnd), bDirect);
}
void CCT3000CO2_NET::HideLines(int lineStart, int lineEnd, BOOL bDirect)
{
Call(SCI_HIDELINES, static_cast<WPARAM>(lineStart), static_cast<LPARAM>(lineEnd), bDirect);
}
BOOL CCT3000CO2_NET::GetLineVisible(int line, BOOL bDirect)
{
return Call(SCI_GETLINEVISIBLE, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::SetFoldExpanded(int line, BOOL expanded, BOOL bDirect)
{
Call(SCI_SETFOLDEXPANDED, static_cast<WPARAM>(line), static_cast<LPARAM>(expanded), bDirect);
}
BOOL CCT3000CO2_NET::GetFoldExpanded(int line, BOOL bDirect)
{
return Call(SCI_GETFOLDEXPANDED, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::ToggleFold(int line, BOOL bDirect)
{
Call(SCI_TOGGLEFOLD, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::EnsureVisible(int line, BOOL bDirect)
{
Call(SCI_ENSUREVISIBLE, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::SetFoldFlags(int flags, BOOL bDirect)
{
Call(SCI_SETFOLDFLAGS, static_cast<WPARAM>(flags), 0, bDirect);
}
void CCT3000CO2_NET::EnsureVisibleEnforcePolicy(int line, BOOL bDirect)
{
Call(SCI_ENSUREVISIBLEENFORCEPOLICY, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::SetTabIndents(BOOL tabIndents, BOOL bDirect)
{
Call(SCI_SETTABINDENTS, static_cast<WPARAM>(tabIndents), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetTabIndents(BOOL bDirect)
{
return Call(SCI_GETTABINDENTS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetBackSpaceUnIndents(BOOL bsUnIndents, BOOL bDirect)
{
Call(SCI_SETBACKSPACEUNINDENTS, static_cast<WPARAM>(bsUnIndents), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetBackSpaceUnIndents(BOOL bDirect)
{
return Call(SCI_GETBACKSPACEUNINDENTS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetMouseDwellTime(int periodMilliseconds, BOOL bDirect)
{
Call(SCI_SETMOUSEDWELLTIME, static_cast<WPARAM>(periodMilliseconds), 0, bDirect);
}
int CCT3000CO2_NET::GetMouseDwellTime(BOOL bDirect)
{
return Call(SCI_GETMOUSEDWELLTIME, 0, 0, bDirect);
}
int CCT3000CO2_NET::WordStartPosition(long pos, BOOL onlyWordCharacters, BOOL bDirect)
{
return Call(SCI_WORDSTARTPOSITION, static_cast<WPARAM>(pos), static_cast<LPARAM>(onlyWordCharacters), bDirect);
}
int CCT3000CO2_NET::WordEndPosition(long pos, BOOL onlyWordCharacters, BOOL bDirect)
{
return Call(SCI_WORDENDPOSITION, static_cast<WPARAM>(pos), static_cast<LPARAM>(onlyWordCharacters), bDirect);
}
void CCT3000CO2_NET::SetWrapMode(int mode, BOOL bDirect)
{
Call(SCI_SETWRAPMODE, static_cast<WPARAM>(mode), 0, bDirect);
}
int CCT3000CO2_NET::GetWrapMode(BOOL bDirect)
{
return Call(SCI_GETWRAPMODE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetWrapVisualFlags(int wrapVisualFlags, BOOL bDirect)
{
Call(SCI_SETWRAPVISUALFLAGS, static_cast<WPARAM>(wrapVisualFlags), 0, bDirect);
}
int CCT3000CO2_NET::GetWrapVisualFlags(BOOL bDirect)
{
return Call(SCI_GETWRAPVISUALFLAGS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation, BOOL bDirect)
{
Call(SCI_SETWRAPVISUALFLAGSLOCATION, static_cast<WPARAM>(wrapVisualFlagsLocation), 0, bDirect);
}
int CCT3000CO2_NET::GetWrapVisualFlagsLocation(BOOL bDirect)
{
return Call(SCI_GETWRAPVISUALFLAGSLOCATION, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetWrapStartIndent(int indent, BOOL bDirect)
{
Call(SCI_SETWRAPSTARTINDENT, static_cast<WPARAM>(indent), 0, bDirect);
}
int CCT3000CO2_NET::GetWrapStartIndent(BOOL bDirect)
{
return Call(SCI_GETWRAPSTARTINDENT, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetLayoutCache(int mode, BOOL bDirect)
{
Call(SCI_SETLAYOUTCACHE, static_cast<WPARAM>(mode), 0, bDirect);
}
int CCT3000CO2_NET::GetLayoutCache(BOOL bDirect)
{
return Call(SCI_GETLAYOUTCACHE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetScrollWidth(int pixelWidth, BOOL bDirect)
{
Call(SCI_SETSCROLLWIDTH, static_cast<WPARAM>(pixelWidth), 0, bDirect);
}
int CCT3000CO2_NET::GetScrollWidth(BOOL bDirect)
{
return Call(SCI_GETSCROLLWIDTH, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetScrollWidthTracking(BOOL tracking, BOOL bDirect)
{
Call(SCI_SETSCROLLWIDTHTRACKING, static_cast<WPARAM>(tracking), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetScrollWidthTracking(BOOL bDirect)
{
return Call(SCI_GETSCROLLWIDTHTRACKING, 0, 0, bDirect);
}
int CCT3000CO2_NET::TextWidth(int style, const char* text, BOOL bDirect)
{
return Call(SCI_TEXTWIDTH, static_cast<WPARAM>(style), reinterpret_cast<LPARAM>(text), bDirect);
}
void CCT3000CO2_NET::SetEndAtLastLine(BOOL endAtLastLine, BOOL bDirect)
{
Call(SCI_SETENDATLASTLINE, static_cast<WPARAM>(endAtLastLine), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetEndAtLastLine(BOOL bDirect)
{
return Call(SCI_GETENDATLASTLINE, 0, 0, bDirect);
}
int CCT3000CO2_NET::TextHeight(int line, BOOL bDirect)
{
return Call(SCI_TEXTHEIGHT, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::SetVScrollBar(BOOL show, BOOL bDirect)
{
Call(SCI_SETVSCROLLBAR, static_cast<WPARAM>(show), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetVScrollBar(BOOL bDirect)
{
return Call(SCI_GETVSCROLLBAR, 0, 0, bDirect);
}
void CCT3000CO2_NET::AppendText(int length, const char* text, BOOL bDirect)
{
Call(SCI_APPENDTEXT, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(text), bDirect);
}
BOOL CCT3000CO2_NET::GetTwoPhaseDraw(BOOL bDirect)
{
return Call(SCI_GETTWOPHASEDRAW, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetTwoPhaseDraw(BOOL twoPhase, BOOL bDirect)
{
Call(SCI_SETTWOPHASEDRAW, static_cast<WPARAM>(twoPhase), 0, bDirect);
}
void CCT3000CO2_NET::TargetFromSelection(BOOL bDirect)
{
Call(SCI_TARGETFROMSELECTION, 0, 0, bDirect);
}
void CCT3000CO2_NET::LinesJoin(BOOL bDirect)
{
Call(SCI_LINESJOIN, 0, 0, bDirect);
}
void CCT3000CO2_NET::LinesSplit(int pixelWidth, BOOL bDirect)
{
Call(SCI_LINESSPLIT, static_cast<WPARAM>(pixelWidth), 0, bDirect);
}
void CCT3000CO2_NET::SetFoldMarginColour(BOOL useSetting, COLORREF back, BOOL bDirect)
{
Call(SCI_SETFOLDMARGINCOLOUR, static_cast<WPARAM>(useSetting), static_cast<LPARAM>(back), bDirect);
}
void CCT3000CO2_NET::SetFoldMarginHiColour(BOOL useSetting, COLORREF fore, BOOL bDirect)
{
Call(SCI_SETFOLDMARGINHICOLOUR, static_cast<WPARAM>(useSetting), static_cast<LPARAM>(fore), bDirect);
}
void CCT3000CO2_NET::LineDown(BOOL bDirect)
{
Call(SCI_LINEDOWN, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineDownExtend(BOOL bDirect)
{
Call(SCI_LINEDOWNEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineUp(BOOL bDirect)
{
Call(SCI_LINEUP, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineUpExtend(BOOL bDirect)
{
Call(SCI_LINEUPEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::CharLeft(BOOL bDirect)
{
Call(SCI_CHARLEFT, 0, 0, bDirect);
}
void CCT3000CO2_NET::CharLeftExtend(BOOL bDirect)
{
Call(SCI_CHARLEFTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::CharRight(BOOL bDirect)
{
Call(SCI_CHARRIGHT, 0, 0, bDirect);
}
void CCT3000CO2_NET::CharRightExtend(BOOL bDirect)
{
Call(SCI_CHARRIGHTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordLeft(BOOL bDirect)
{
Call(SCI_WORDLEFT, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordLeftExtend(BOOL bDirect)
{
Call(SCI_WORDLEFTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordRight(BOOL bDirect)
{
Call(SCI_WORDRIGHT, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordRightExtend(BOOL bDirect)
{
Call(SCI_WORDRIGHTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::Home(BOOL bDirect)
{
Call(SCI_HOME, 0, 0, bDirect);
}
void CCT3000CO2_NET::HomeExtend(BOOL bDirect)
{
Call(SCI_HOMEEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineEnd(BOOL bDirect)
{
Call(SCI_LINEEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineEndExtend(BOOL bDirect)
{
Call(SCI_LINEENDEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::DocumentStart(BOOL bDirect)
{
Call(SCI_DOCUMENTSTART, 0, 0, bDirect);
}
void CCT3000CO2_NET::DocumentStartExtend(BOOL bDirect)
{
Call(SCI_DOCUMENTSTARTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::DocumentEnd(BOOL bDirect)
{
Call(SCI_DOCUMENTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::DocumentEndExtend(BOOL bDirect)
{
Call(SCI_DOCUMENTENDEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::PageUp(BOOL bDirect)
{
Call(SCI_PAGEUP, 0, 0, bDirect);
}
void CCT3000CO2_NET::PageUpExtend(BOOL bDirect)
{
Call(SCI_PAGEUPEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::PageDown(BOOL bDirect)
{
Call(SCI_PAGEDOWN, 0, 0, bDirect);
}
void CCT3000CO2_NET::PageDownExtend(BOOL bDirect)
{
Call(SCI_PAGEDOWNEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::EditToggleOvertype(BOOL bDirect)
{
Call(SCI_EDITTOGGLEOVERTYPE, 0, 0, bDirect);
}
void CCT3000CO2_NET::Cancel(BOOL bDirect)
{
Call(SCI_CANCEL, 0, 0, bDirect);
}
void CCT3000CO2_NET::DeleteBack(BOOL bDirect)
{
Call(SCI_DELETEBACK, 0, 0, bDirect);
}
void CCT3000CO2_NET::Tab(BOOL bDirect)
{
Call(SCI_TAB, 0, 0, bDirect);
}
void CCT3000CO2_NET::BackTab(BOOL bDirect)
{
Call(SCI_BACKTAB, 0, 0, bDirect);
}
void CCT3000CO2_NET::NewLine(BOOL bDirect)
{
Call(SCI_NEWLINE, 0, 0, bDirect);
}
void CCT3000CO2_NET::FormFeed(BOOL bDirect)
{
Call(SCI_FORMFEED, 0, 0, bDirect);
}
void CCT3000CO2_NET::VCHome(BOOL bDirect)
{
Call(SCI_VCHOME, 0, 0, bDirect);
}
void CCT3000CO2_NET::VCHomeExtend(BOOL bDirect)
{
Call(SCI_VCHOMEEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::ZoomIn(BOOL bDirect)
{
Call(SCI_ZOOMIN, 0, 0, bDirect);
}
void CCT3000CO2_NET::ZoomOut(BOOL bDirect)
{
Call(SCI_ZOOMOUT, 0, 0, bDirect);
}
void CCT3000CO2_NET::DelWordLeft(BOOL bDirect)
{
Call(SCI_DELWORDLEFT, 0, 0, bDirect);
}
void CCT3000CO2_NET::DelWordRight(BOOL bDirect)
{
Call(SCI_DELWORDRIGHT, 0, 0, bDirect);
}
void CCT3000CO2_NET::DelWordRightEnd(BOOL bDirect)
{
Call(SCI_DELWORDRIGHTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineCut(BOOL bDirect)
{
Call(SCI_LINECUT, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineDelete(BOOL bDirect)
{
Call(SCI_LINEDELETE, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineTranspose(BOOL bDirect)
{
Call(SCI_LINETRANSPOSE, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineDuplicate(BOOL bDirect)
{
Call(SCI_LINEDUPLICATE, 0, 0, bDirect);
}
void CCT3000CO2_NET::LowerCase(BOOL bDirect)
{
Call(SCI_LOWERCASE, 0, 0, bDirect);
}
void CCT3000CO2_NET::UpperCase(BOOL bDirect)
{
Call(SCI_UPPERCASE, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineScrollDown(BOOL bDirect)
{
Call(SCI_LINESCROLLDOWN, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineScrollUp(BOOL bDirect)
{
Call(SCI_LINESCROLLUP, 0, 0, bDirect);
}
void CCT3000CO2_NET::DeleteBackNotLine(BOOL bDirect)
{
Call(SCI_DELETEBACKNOTLINE, 0, 0, bDirect);
}
void CCT3000CO2_NET::HomeDisplay(BOOL bDirect)
{
Call(SCI_HOMEDISPLAY, 0, 0, bDirect);
}
void CCT3000CO2_NET::HomeDisplayExtend(BOOL bDirect)
{
Call(SCI_HOMEDISPLAYEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineEndDisplay(BOOL bDirect)
{
Call(SCI_LINEENDDISPLAY, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineEndDisplayExtend(BOOL bDirect)
{
Call(SCI_LINEENDDISPLAYEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::HomeWrap(BOOL bDirect)
{
Call(SCI_HOMEWRAP, 0, 0, bDirect);
}
void CCT3000CO2_NET::HomeWrapExtend(BOOL bDirect)
{
Call(SCI_HOMEWRAPEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineEndWrap(BOOL bDirect)
{
Call(SCI_LINEENDWRAP, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineEndWrapExtend(BOOL bDirect)
{
Call(SCI_LINEENDWRAPEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::VCHomeWrap(BOOL bDirect)
{
Call(SCI_VCHOMEWRAP, 0, 0, bDirect);
}
void CCT3000CO2_NET::VCHomeWrapExtend(BOOL bDirect)
{
Call(SCI_VCHOMEWRAPEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineCopy(BOOL bDirect)
{
Call(SCI_LINECOPY, 0, 0, bDirect);
}
void CCT3000CO2_NET::MoveCaretInsideView(BOOL bDirect)
{
Call(SCI_MOVECARETINSIDEVIEW, 0, 0, bDirect);
}
int CCT3000CO2_NET::LineLength(int line, BOOL bDirect)
{
return Call(SCI_LINELENGTH, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::BraceHighlight(long pos1, long pos2, BOOL bDirect)
{
Call(SCI_BRACEHIGHLIGHT, static_cast<WPARAM>(pos1), static_cast<LPARAM>(pos2), bDirect);
}
void CCT3000CO2_NET::BraceBadLight(long pos, BOOL bDirect)
{
Call(SCI_BRACEBADLIGHT, static_cast<WPARAM>(pos), 0, bDirect);
}
long CCT3000CO2_NET::BraceMatch(long pos, BOOL bDirect)
{
return Call(SCI_BRACEMATCH, static_cast<WPARAM>(pos), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetViewEOL(BOOL bDirect)
{
return Call(SCI_GETVIEWEOL, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetViewEOL(BOOL visible, BOOL bDirect)
{
Call(SCI_SETVIEWEOL, static_cast<WPARAM>(visible), 0, bDirect);
}
int CCT3000CO2_NET::GetDocPointer(BOOL bDirect)
{
return Call(SCI_GETDOCPOINTER, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetDocPointer(int pointer, BOOL bDirect)
{
Call(SCI_SETDOCPOINTER, 0, static_cast<LPARAM>(pointer), bDirect);
}
void CCT3000CO2_NET::SetModEventMask(int mask, BOOL bDirect)
{
Call(SCI_SETMODEVENTMASK, static_cast<WPARAM>(mask), 0, bDirect);
}
int CCT3000CO2_NET::GetEdgeColumn(BOOL bDirect)
{
return Call(SCI_GETEDGECOLUMN, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetEdgeColumn(int column, BOOL bDirect)
{
Call(SCI_SETEDGECOLUMN, static_cast<WPARAM>(column), 0, bDirect);
}
int CCT3000CO2_NET::GetEdgeMode(BOOL bDirect)
{
return Call(SCI_GETEDGEMODE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetEdgeMode(int mode, BOOL bDirect)
{
Call(SCI_SETEDGEMODE, static_cast<WPARAM>(mode), 0, bDirect);
}
COLORREF CCT3000CO2_NET::GetEdgeColour(BOOL bDirect)
{
return Call(SCI_GETEDGECOLOUR, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetEdgeColour(COLORREF edgeColour, BOOL bDirect)
{
Call(SCI_SETEDGECOLOUR, static_cast<WPARAM>(edgeColour), 0, bDirect);
}
void CCT3000CO2_NET::SearchAnchor(BOOL bDirect)
{
Call(SCI_SEARCHANCHOR, 0, 0, bDirect);
}
int CCT3000CO2_NET::SearchNext(int flags, const char* text, BOOL bDirect)
{
return Call(SCI_SEARCHNEXT, static_cast<WPARAM>(flags), reinterpret_cast<LPARAM>(text), bDirect);
}
int CCT3000CO2_NET::SearchPrev(int flags, const char* text, BOOL bDirect)
{
return Call(SCI_SEARCHPREV, static_cast<WPARAM>(flags), reinterpret_cast<LPARAM>(text), bDirect);
}
int CCT3000CO2_NET::LinesOnScreen(BOOL bDirect)
{
return Call(SCI_LINESONSCREEN, 0, 0, bDirect);
}
void CCT3000CO2_NET::UsePopUp(BOOL allowPopUp, BOOL bDirect)
{
Call(SCI_USEPOPUP, static_cast<WPARAM>(allowPopUp), 0, bDirect);
}
BOOL CCT3000CO2_NET::SelectionIsRectangle(BOOL bDirect)
{
return Call(SCI_SELECTIONISRECTANGLE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetZoom(int zoom, BOOL bDirect)
{
Call(SCI_SETZOOM, static_cast<WPARAM>(zoom), 0, bDirect);
}
int CCT3000CO2_NET::GetZoom(BOOL bDirect)
{
return Call(SCI_GETZOOM, 0, 0, bDirect);
}
int CCT3000CO2_NET::CreateDocument(BOOL bDirect)
{
return Call(SCI_CREATEDOCUMENT, 0, 0, bDirect);
}
void CCT3000CO2_NET::AddRefDocument(int doc, BOOL bDirect)
{
Call(SCI_ADDREFDOCUMENT, 0, static_cast<LPARAM>(doc), bDirect);
}
void CCT3000CO2_NET::ReleaseDocument(int doc, BOOL bDirect)
{
Call(SCI_RELEASEDOCUMENT, 0, static_cast<LPARAM>(doc), bDirect);
}
int CCT3000CO2_NET::GetModEventMask(BOOL bDirect)
{
return Call(SCI_GETMODEVENTMASK, 0, 0, bDirect);
}
void CCT3000CO2_NET::SCISetFocus(BOOL focus, BOOL bDirect)
{
Call(SCI_SETFOCUS, static_cast<WPARAM>(focus), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetFocus(BOOL bDirect)
{
return Call(SCI_GETFOCUS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetStatus(int statusCode, BOOL bDirect)
{
Call(SCI_SETSTATUS, static_cast<WPARAM>(statusCode), 0, bDirect);
}
int CCT3000CO2_NET::GetStatus(BOOL bDirect)
{
return Call(SCI_GETSTATUS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetMouseDownCaptures(BOOL captures, BOOL bDirect)
{
Call(SCI_SETMOUSEDOWNCAPTURES, static_cast<WPARAM>(captures), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetMouseDownCaptures(BOOL bDirect)
{
return Call(SCI_GETMOUSEDOWNCAPTURES, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCursor(int cursorType, BOOL bDirect)
{
Call(SCI_SETCURSOR, static_cast<WPARAM>(cursorType), 0, bDirect);
}
int CCT3000CO2_NET::GetCursor(BOOL bDirect)
{
return Call(SCI_GETCURSOR, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetControlCharSymbol(int symbol, BOOL bDirect)
{
Call(SCI_SETCONTROLCHARSYMBOL, static_cast<WPARAM>(symbol), 0, bDirect);
}
int CCT3000CO2_NET::GetControlCharSymbol(BOOL bDirect)
{
return Call(SCI_GETCONTROLCHARSYMBOL, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordPartLeft(BOOL bDirect)
{
Call(SCI_WORDPARTLEFT, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordPartLeftExtend(BOOL bDirect)
{
Call(SCI_WORDPARTLEFTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordPartRight(BOOL bDirect)
{
Call(SCI_WORDPARTRIGHT, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordPartRightExtend(BOOL bDirect)
{
Call(SCI_WORDPARTRIGHTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetVisiblePolicy(int visiblePolicy, int visibleSlop, BOOL bDirect)
{
Call(SCI_SETVISIBLEPOLICY, static_cast<WPARAM>(visiblePolicy), static_cast<LPARAM>(visibleSlop), bDirect);
}
void CCT3000CO2_NET::DelLineLeft(BOOL bDirect)
{
Call(SCI_DELLINELEFT, 0, 0, bDirect);
}
void CCT3000CO2_NET::DelLineRight(BOOL bDirect)
{
Call(SCI_DELLINERIGHT, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetXOffset(int newOffset, BOOL bDirect)
{
Call(SCI_SETXOFFSET, static_cast<WPARAM>(newOffset), 0, bDirect);
}
int CCT3000CO2_NET::GetXOffset(BOOL bDirect)
{
return Call(SCI_GETXOFFSET, 0, 0, bDirect);
}
void CCT3000CO2_NET::ChooseCaretX(BOOL bDirect)
{
Call(SCI_CHOOSECARETX, 0, 0, bDirect);
}
void CCT3000CO2_NET::GrabFocus(BOOL bDirect)
{
Call(SCI_GRABFOCUS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetXCaretPolicy(int caretPolicy, int caretSlop, BOOL bDirect)
{
Call(SCI_SETXCARETPOLICY, static_cast<WPARAM>(caretPolicy), static_cast<LPARAM>(caretSlop), bDirect);
}
void CCT3000CO2_NET::SetYCaretPolicy(int caretPolicy, int caretSlop, BOOL bDirect)
{
Call(SCI_SETYCARETPOLICY, static_cast<WPARAM>(caretPolicy), static_cast<LPARAM>(caretSlop), bDirect);
}
void CCT3000CO2_NET::SetPrintWrapMode(int mode, BOOL bDirect)
{
Call(SCI_SETPRINTWRAPMODE, static_cast<WPARAM>(mode), 0, bDirect);
}
int CCT3000CO2_NET::GetPrintWrapMode(BOOL bDirect)
{
return Call(SCI_GETPRINTWRAPMODE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetHotspotActiveFore(BOOL useSetting, COLORREF fore, BOOL bDirect)
{
Call(SCI_SETHOTSPOTACTIVEFORE, static_cast<WPARAM>(useSetting), static_cast<LPARAM>(fore), bDirect);
}
COLORREF CCT3000CO2_NET::GetHotspotActiveFore(BOOL bDirect)
{
return Call(SCI_GETHOTSPOTACTIVEFORE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetHotspotActiveBack(BOOL useSetting, COLORREF back, BOOL bDirect)
{
Call(SCI_SETHOTSPOTACTIVEBACK, static_cast<WPARAM>(useSetting), static_cast<LPARAM>(back), bDirect);
}
COLORREF CCT3000CO2_NET::GetHotspotActiveBack(BOOL bDirect)
{
return Call(SCI_GETHOTSPOTACTIVEBACK, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetHotspotActiveUnderline(BOOL underline, BOOL bDirect)
{
Call(SCI_SETHOTSPOTACTIVEUNDERLINE, static_cast<WPARAM>(underline), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetHotspotActiveUnderline(BOOL bDirect)
{
return Call(SCI_GETHOTSPOTACTIVEUNDERLINE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetHotspotSingleLine(BOOL singleLine, BOOL bDirect)
{
Call(SCI_SETHOTSPOTSINGLELINE, static_cast<WPARAM>(singleLine), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetHotspotSingleLine(BOOL bDirect)
{
return Call(SCI_GETHOTSPOTSINGLELINE, 0, 0, bDirect);
}
void CCT3000CO2_NET::ParaDown(BOOL bDirect)
{
Call(SCI_PARADOWN, 0, 0, bDirect);
}
void CCT3000CO2_NET::ParaDownExtend(BOOL bDirect)
{
Call(SCI_PARADOWNEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::ParaUp(BOOL bDirect)
{
Call(SCI_PARAUP, 0, 0, bDirect);
}
void CCT3000CO2_NET::ParaUpExtend(BOOL bDirect)
{
Call(SCI_PARAUPEXTEND, 0, 0, bDirect);
}
long CCT3000CO2_NET::PositionBefore(long pos, BOOL bDirect)
{
return Call(SCI_POSITIONBEFORE, static_cast<WPARAM>(pos), 0, bDirect);
}
long CCT3000CO2_NET::PositionAfter(long pos, BOOL bDirect)
{
return Call(SCI_POSITIONAFTER, static_cast<WPARAM>(pos), 0, bDirect);
}
void CCT3000CO2_NET::CopyRange(long start, long end, BOOL bDirect)
{
Call(SCI_COPYRANGE, static_cast<WPARAM>(start), static_cast<LPARAM>(end), bDirect);
}
void CCT3000CO2_NET::CopyText(int length, const char* text, BOOL bDirect)
{
Call(SCI_COPYTEXT, static_cast<WPARAM>(length), reinterpret_cast<LPARAM>(text), bDirect);
}
void CCT3000CO2_NET::SetSelectionMode(int mode, BOOL bDirect)
{
Call(SCI_SETSELECTIONMODE, static_cast<WPARAM>(mode), 0, bDirect);
}
int CCT3000CO2_NET::GetSelectionMode(BOOL bDirect)
{
return Call(SCI_GETSELECTIONMODE, 0, 0, bDirect);
}
long CCT3000CO2_NET::GetLineSelStartPosition(int line, BOOL bDirect)
{
return Call(SCI_GETLINESELSTARTPOSITION, static_cast<WPARAM>(line), 0, bDirect);
}
long CCT3000CO2_NET::GetLineSelEndPosition(int line, BOOL bDirect)
{
return Call(SCI_GETLINESELENDPOSITION, static_cast<WPARAM>(line), 0, bDirect);
}
void CCT3000CO2_NET::LineDownRectExtend(BOOL bDirect)
{
Call(SCI_LINEDOWNRECTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineUpRectExtend(BOOL bDirect)
{
Call(SCI_LINEUPRECTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::CharLeftRectExtend(BOOL bDirect)
{
Call(SCI_CHARLEFTRECTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::CharRightRectExtend(BOOL bDirect)
{
Call(SCI_CHARRIGHTRECTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::HomeRectExtend(BOOL bDirect)
{
Call(SCI_HOMERECTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::VCHomeRectExtend(BOOL bDirect)
{
Call(SCI_VCHOMERECTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::LineEndRectExtend(BOOL bDirect)
{
Call(SCI_LINEENDRECTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::PageUpRectExtend(BOOL bDirect)
{
Call(SCI_PAGEUPRECTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::PageDownRectExtend(BOOL bDirect)
{
Call(SCI_PAGEDOWNRECTEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::StutteredPageUp(BOOL bDirect)
{
Call(SCI_STUTTEREDPAGEUP, 0, 0, bDirect);
}
void CCT3000CO2_NET::StutteredPageUpExtend(BOOL bDirect)
{
Call(SCI_STUTTEREDPAGEUPEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::StutteredPageDown(BOOL bDirect)
{
Call(SCI_STUTTEREDPAGEDOWN, 0, 0, bDirect);
}
void CCT3000CO2_NET::StutteredPageDownExtend(BOOL bDirect)
{
Call(SCI_STUTTEREDPAGEDOWNEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordLeftEnd(BOOL bDirect)
{
Call(SCI_WORDLEFTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordLeftEndExtend(BOOL bDirect)
{
Call(SCI_WORDLEFTENDEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordRightEnd(BOOL bDirect)
{
Call(SCI_WORDRIGHTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::WordRightEndExtend(BOOL bDirect)
{
Call(SCI_WORDRIGHTENDEXTEND, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetWhitespaceChars(const char* characters, BOOL bDirect)
{
Call(SCI_SETWHITESPACECHARS, 0, reinterpret_cast<LPARAM>(characters), bDirect);
}
void CCT3000CO2_NET::SetCharsDefault(BOOL bDirect)
{
Call(SCI_SETCHARSDEFAULT, 0, 0, bDirect);
}
int CCT3000CO2_NET::AutoCGetCurrent(BOOL bDirect)
{
return Call(SCI_AUTOCGETCURRENT, 0, 0, bDirect);
}
void CCT3000CO2_NET::Allocate(int bytes, BOOL bDirect)
{
Call(SCI_ALLOCATE, static_cast<WPARAM>(bytes), 0, bDirect);
}
int CCT3000CO2_NET::TargetAsUTF8(char* s, BOOL bDirect)
{
return Call(SCI_TARGETASUTF8, 0, reinterpret_cast<LPARAM>(s), bDirect);
}
void CCT3000CO2_NET::SetLengthForEncode(int bytes, BOOL bDirect)
{
Call(SCI_SETLENGTHFORENCODE, static_cast<WPARAM>(bytes), 0, bDirect);
}
int CCT3000CO2_NET::EncodedFromUTF8(const char* utf8, char* encoded, BOOL bDirect)
{
return Call(SCI_ENCODEDFROMUTF8, reinterpret_cast<WPARAM>(utf8), reinterpret_cast<LPARAM>(encoded), bDirect);
}
int CCT3000CO2_NET::FindColumn(int line, int column, BOOL bDirect)
{
return Call(SCI_FINDCOLUMN, static_cast<WPARAM>(line), static_cast<LPARAM>(column), bDirect);
}
BOOL CCT3000CO2_NET::GetCaretSticky(BOOL bDirect)
{
return Call(SCI_GETCARETSTICKY, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCaretSticky(BOOL useCaretStickyBehaviour, BOOL bDirect)
{
Call(SCI_SETCARETSTICKY, static_cast<WPARAM>(useCaretStickyBehaviour), 0, bDirect);
}
void CCT3000CO2_NET::ToggleCaretSticky(BOOL bDirect)
{
Call(SCI_TOGGLECARETSTICKY, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetPasteConvertEndings(BOOL convert, BOOL bDirect)
{
Call(SCI_SETPASTECONVERTENDINGS, static_cast<WPARAM>(convert), 0, bDirect);
}
BOOL CCT3000CO2_NET::GetPasteConvertEndings(BOOL bDirect)
{
return Call(SCI_GETPASTECONVERTENDINGS, 0, 0, bDirect);
}
void CCT3000CO2_NET::SelectionDuplicate(BOOL bDirect)
{
Call(SCI_SELECTIONDUPLICATE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCaretLineBackAlpha(int alpha, BOOL bDirect)
{
Call(SCI_SETCARETLINEBACKALPHA, static_cast<WPARAM>(alpha), 0, bDirect);
}
int CCT3000CO2_NET::GetCaretLineBackAlpha(BOOL bDirect)
{
return Call(SCI_GETCARETLINEBACKALPHA, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetCaretStyle(int caretStyle, BOOL bDirect)
{
Call(SCI_SETCARETSTYLE, static_cast<WPARAM>(caretStyle), 0, bDirect);
}
int CCT3000CO2_NET::GetCaretStyle(BOOL bDirect)
{
return Call(SCI_GETCARETSTYLE, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetIndicatorCurrent(int indicator, BOOL bDirect)
{
Call(SCI_SETINDICATORCURRENT, static_cast<WPARAM>(indicator), 0, bDirect);
}
int CCT3000CO2_NET::GetIndicatorCurrent(BOOL bDirect)
{
return Call(SCI_GETINDICATORCURRENT, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetIndicatorValue(int value, BOOL bDirect)
{
Call(SCI_SETINDICATORVALUE, static_cast<WPARAM>(value), 0, bDirect);
}
int CCT3000CO2_NET::GetIndicatorValue(BOOL bDirect)
{
return Call(SCI_GETINDICATORVALUE, 0, 0, bDirect);
}
void CCT3000CO2_NET::IndicatorFillRange(int position, int fillLength, BOOL bDirect)
{
Call(SCI_INDICATORFILLRANGE, static_cast<WPARAM>(position), static_cast<LPARAM>(fillLength), bDirect);
}
void CCT3000CO2_NET::IndicatorClearRange(int position, int clearLength, BOOL bDirect)
{
Call(SCI_INDICATORCLEARRANGE, static_cast<WPARAM>(position), static_cast<LPARAM>(clearLength), bDirect);
}
int CCT3000CO2_NET::IndicatorAllOnFor(int position, BOOL bDirect)
{
return Call(SCI_INDICATORALLONFOR, static_cast<WPARAM>(position), 0, bDirect);
}
int CCT3000CO2_NET::IndicatorValueAt(int indicator, int position, BOOL bDirect)
{
return Call(SCI_INDICATORVALUEAT, static_cast<WPARAM>(indicator), static_cast<LPARAM>(position), bDirect);
}
int CCT3000CO2_NET::IndicatorStart(int indicator, int position, BOOL bDirect)
{
return Call(SCI_INDICATORSTART, static_cast<WPARAM>(indicator), static_cast<LPARAM>(position), bDirect);
}
int CCT3000CO2_NET::IndicatorEnd(int indicator, int position, BOOL bDirect)
{
return Call(SCI_INDICATOREND, static_cast<WPARAM>(indicator), static_cast<LPARAM>(position), bDirect);
}
void CCT3000CO2_NET::SetPositionCache(int size, BOOL bDirect)
{
Call(SCI_SETPOSITIONCACHE, static_cast<WPARAM>(size), 0, bDirect);
}
int CCT3000CO2_NET::GetPositionCache(BOOL bDirect)
{
return Call(SCI_GETPOSITIONCACHE, 0, 0, bDirect);
}
void CCT3000CO2_NET::CopyAllowLine(BOOL bDirect)
{
Call(SCI_COPYALLOWLINE, 0, 0, bDirect);
}
void CCT3000CO2_NET::StartRecord(BOOL bDirect)
{
Call(SCI_STARTRECORD, 0, 0, bDirect);
}
void CCT3000CO2_NET::StopRecord(BOOL bDirect)
{
Call(SCI_STOPRECORD, 0, 0, bDirect);
}
void CCT3000CO2_NET::SetLexer(int lexer, BOOL bDirect)
{
Call(SCI_SETLEXER, static_cast<WPARAM>(lexer), 0, bDirect);
}
int CCT3000CO2_NET::GetLexer(BOOL bDirect)
{
return Call(SCI_GETLEXER, 0, 0, bDirect);
}
void CCT3000CO2_NET::Colourise(long start, long end, BOOL bDirect)
{
Call(SCI_COLOURISE, static_cast<WPARAM>(start), static_cast<LPARAM>(end), bDirect);
}
void CCT3000CO2_NET::SetProperty(const char* key, const char* value, BOOL bDirect)
{
Call(SCI_SETPROPERTY, reinterpret_cast<WPARAM>(key), reinterpret_cast<LPARAM>(value), bDirect);
}
void CCT3000CO2_NET::SetKeyWords(int keywordSet, const char* keyWords, BOOL bDirect)
{
Call(SCI_SETKEYWORDS, static_cast<WPARAM>(keywordSet), reinterpret_cast<LPARAM>(keyWords), bDirect);
}
void CCT3000CO2_NET::SetLexerLanguage(const char* language, BOOL bDirect)
{
Call(SCI_SETLEXERLANGUAGE, 0, reinterpret_cast<LPARAM>(language), bDirect);
}
void CCT3000CO2_NET::LoadLexerLibrary(const char* path, BOOL bDirect)
{
Call(SCI_LOADLEXERLIBRARY, 0, reinterpret_cast<LPARAM>(path), bDirect);
}
int CCT3000CO2_NET::GetProperty(const char* key, char* buf, BOOL bDirect)
{
return Call(SCI_GETPROPERTY, reinterpret_cast<WPARAM>(key), reinterpret_cast<LPARAM>(buf), bDirect);
}
int CCT3000CO2_NET::GetPropertyExpanded(const char* key, char* buf, BOOL bDirect)
{
return Call(SCI_GETPROPERTYEXPANDED, reinterpret_cast<WPARAM>(key), reinterpret_cast<LPARAM>(buf), bDirect);
}
int CCT3000CO2_NET::GetPropertyInt(const char* key, BOOL bDirect)
{
return Call(SCI_GETPROPERTYINT, reinterpret_cast<WPARAM>(key), 0, bDirect);
}
int CCT3000CO2_NET::GetStyleBitsNeeded(BOOL bDirect)
{
return Call(SCI_GETSTYLEBITSNEEDED, 0, 0, bDirect);
}
| 26.408769 | 121 | 0.758801 | DHSERVICE56 |
7cf90679a996e3f5739e32c797498b44e4d14691 | 1,320 | cpp | C++ | code-forces/Educational 87/DCopy.cpp | ErickJoestar/competitive-programming | 76afb766dbc18e16315559c863fbff19a955a569 | [
"MIT"
] | 1 | 2020-04-23T00:35:38.000Z | 2020-04-23T00:35:38.000Z | code-forces/Educational 87/DCopy.cpp | ErickJoestar/competitive-programming | 76afb766dbc18e16315559c863fbff19a955a569 | [
"MIT"
] | null | null | null | code-forces/Educational 87/DCopy.cpp | ErickJoestar/competitive-programming | 76afb766dbc18e16315559c863fbff19a955a569 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
#define ENDL '\n'
#define deb(u) cout << #u " : " << (u) << ENDL;
#define deba(alias, u) cout << alias << ": " << (u) << ENDL;
#define debp(u, v) cout << u << " : " << v << ENDL;
#define pb push_back
#define F first
#define S second
#define lli long long
#define pii pair<int, int>
#define pll pair<lli, lli>
#define ALL(a) (a).begin(), (a).end()
#define ALLR(a) (a).rbegin(), (a).rend()
#define FOR(i, a, n) for (int i = (a); i < (n); ++i)
#define FORN(i, a, n) for (int i = (a - 1); i >= n; --i)
#define IO \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)
using namespace std;
int main()
{
IO;
int n, q;
cin >> n >> q;
vector<pii> v;
vector<int> queries;
///Reasing all the numbers
FOR(i, 0, n)
{
pii aux = {0, -1};
cin >> aux.F;
v.pb(aux);
}
//Asigning the initial position
sort(ALL(v));
FOR(i, 0, n)
v[i].S = i;
//Reading all the queries
FOR(i, 0, q)
{
int opt;
cin >> opt;
if (opt < 0)
queries.pb(-opt);
else
v.pb(make_pair(opt, -1));
}
/// Reasigning position in the array
sort(ALL(v));
FOR(i, 1, v.size())
{
v[i].S = max(v[i].S, v[i - 1].S);
}
/*
-- > Debug
for (auto p : v)
{
debp(p.F, p.S);
}
*/
return 0;
} | 19.411765 | 60 | 0.496212 | ErickJoestar |
cfaa4a625fb4a16b09240046624c037b68a315b6 | 1,834 | cpp | C++ | src/data/long_distance_social_distancing_ii.cpp | ACM-UCI/ACM-UCI-Website | 6092db56b50f5c6d26a6e9ad65adb553f44ccb5f | [
"MIT"
] | 3 | 2019-02-02T02:46:23.000Z | 2020-08-14T14:04:04.000Z | src/data/long_distance_social_distancing_ii.cpp | ACM-UCI/ACM-UCI-Website | 6092db56b50f5c6d26a6e9ad65adb553f44ccb5f | [
"MIT"
] | 47 | 2019-02-01T08:50:24.000Z | 2022-03-01T18:35:05.000Z | src/data/long_distance_social_distancing_ii.cpp | ACM-UCI/ACM-UCI-Website | 6092db56b50f5c6d26a6e9ad65adb553f44ccb5f | [
"MIT"
] | 5 | 2018-11-30T03:10:08.000Z | 2020-09-22T06:37:50.000Z | #include <string>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <array>
using namespace std;
#define LL long long
#define UL unsigned long
#define matrix array<array<LL, 5>, 5>
#define vector array<LL, 5>
LL mod = 1000000007;
matrix matmul(matrix a, matrix b)
{
matrix c;
for (unsigned long i = 0; i < a.size(); i++)
{
for (unsigned long j = 0; j < b.size(); j++)
{
c[i][j] = 0;
for (unsigned long k = 0; k < 5; k++)
{
c[i][j] += (a[i][k] * b[k][j]) % mod;
c[i][j] %= mod;
}
}
}
return c;
}
vector matmul(matrix a, vector b)
{
vector c;
for (int i = 0; i < 5; i++)
{
c[i] = 0;
for (int j = 0; j < 5; j++)
{
c[i] += (a[i][j] * b[i]) % mod;
c[i] %= mod;
}
}
return c;
}
matrix pow(matrix mat, long p)
{
if (p == 0)
return matrix{{{1, 0, 0, 0, 0}, {0, 1, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}}};
matrix temp = pow(mat, p / 2);
if (p % 2 == 0)
return matmul(temp, temp);
return matmul(matmul(temp, temp), mat);
}
LL solve(LL t)
{
if (t == 0)
return 1;
matrix init = matrix{{{1, 1, 1, 1, 1},
{1, 0, 1, 1, 0},
{1, 1, 0, 1, 1},
{1, 1, 1, 0, 0},
{1, 0, 1, 0, 0}}};
matrix result = pow(init, t - 1);
vector lastRow = matmul(result, vector{1, 1, 1, 1, 1});
LL s = 0;
for (int i = 0; i < 5; i++)
{
s += lastRow[i];
s %= mod;
}
return (s * s) % mod;
}
int main()
{
int t;
LL c;
cin >> t;
for (int i = 0; i < t; i++)
{
cin >> c;
cout << solve(c) << endl;
}
} | 20.840909 | 109 | 0.401309 | ACM-UCI |
cfaead4da4e3c588cab43e9c6f64acff48fbb9dd | 4,198 | hpp | C++ | includes/zab/strong_types.hpp | HungMingWu/zab | 9e9fd78d192b4d037a6edbbd4c1474bd6e01feaf | [
"MIT"
] | null | null | null | includes/zab/strong_types.hpp | HungMingWu/zab | 9e9fd78d192b4d037a6edbbd4c1474bd6e01feaf | [
"MIT"
] | null | null | null | includes/zab/strong_types.hpp | HungMingWu/zab | 9e9fd78d192b4d037a6edbbd4c1474bd6e01feaf | [
"MIT"
] | null | null | null | /*
* MMM"""AMV db `7MM"""Yp,
* M' AMV ;MM: MM Yb
* ' AMV ,V^MM. MM dP
* AMV ,M `MM MM"""bg.
* AMV , AbmmmqMA MM `Y
* AMV ,M A' VML MM ,9
* AMVmmmmMM .AMA. .AMMA..JMMmmmd9
*
*
* MIT License
*
* Copyright (c) 2021 Donald-Rupin
*
* 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.
*
* @file strong_types.hpp
*
*/
#ifndef ZAB_STRONG_TYPES_HPP_
#define ZAB_STRONG_TYPES_HPP_
#include <chrono>
#include <concepts>
#include <cstdint>
#include <limits>
#include <ostream>
namespace zab {
/**
* @brief A struct for providing strict typing of thread ids'.
*/
struct thread_t {
std::uint16_t thread_ = std::numeric_limits<std::uint16_t>::max();
constexpr auto
operator<=>(const thread_t& _other) const = default;
template <std::integral Intergral>
constexpr auto
operator<=>(const Intergral _number) const
{
return thread_ <=> _number;
}
};
namespace thread {
constexpr auto
in(std::uint16_t _thread) noexcept
{
return thread_t{_thread};
}
constexpr auto
any() noexcept
{
return thread_t{};
}
}
inline std::ostream&
operator<<(std::ostream& os, const thread_t _thread)
{
os << "thread[" << _thread.thread_ << "]";
return os;
}
/**
* @brief A struct for providing strict typing for ordering.
*/
struct order_t {
int64_t order_ = std::chrono::high_resolution_clock::now().time_since_epoch().count();
constexpr auto
operator<=>(const order_t& _other) const = default;
template <std::integral Intergral>
constexpr auto
operator<=>(const Intergral _number) const
{
return order_ <=> _number;
}
friend constexpr auto
operator +(order_t _lhs, order_t _rhs) noexcept
{
return order_t{_lhs.order_ + _rhs.order_};
}
friend constexpr auto
operator -(order_t _lhs, order_t _rhs) noexcept
{
return order_t{_lhs.order_ - _rhs.order_};
}
};
namespace order {
inline constexpr order_t
seconds(int64_t _number) noexcept
{
return order_t{_number * 1000000000};
}
inline constexpr order_t
milli(int64_t _number) noexcept
{
return order_t{_number * 1000000};
}
inline order_t
now() noexcept
{
return order_t{};
}
inline order_t
in_seconds(int64_t _number) noexcept
{
return now() + order_t{_number * 1000000000};
}
inline order_t
in_milli(int64_t _number) noexcept
{
return now() + order_t{_number * 1000000000};
}
} // namespace order
} // namespace zab
#endif /* ZAB_STRONG_TYPES_HPP_ */ | 27.25974 | 98 | 0.579085 | HungMingWu |
cfb505f74f6d71b58ea0b4f34dc4e99796049a70 | 574 | cpp | C++ | _site/Competitive Programming/Hackerearth/Bishu and Soldiers.cpp | anujkyadav07/anuj-k-yadav.github.io | ac5cccc8cdada000ba559538cd84921437b3c5e6 | [
"MIT"
] | 1 | 2019-06-10T04:39:49.000Z | 2019-06-10T04:39:49.000Z | _site/Competitive Programming/Hackerearth/Bishu and Soldiers.cpp | anujkyadav07/anuj-k-yadav.github.io | ac5cccc8cdada000ba559538cd84921437b3c5e6 | [
"MIT"
] | 2 | 2021-09-27T23:34:07.000Z | 2022-02-26T05:54:27.000Z | _site/Competitive Programming/Hackerearth/Bishu and Soldiers.cpp | anujkyadav07/anuj-k-yadav.github.io | ac5cccc8cdada000ba559538cd84921437b3c5e6 | [
"MIT"
] | 3 | 2019-06-23T14:15:08.000Z | 2019-07-09T20:40:58.000Z | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, q, a;
cin>>n;
vector<int> arr;
for (int i = 0; i < n; ++i)
{
cin>>a;
arr.push_back(a);
}
cin>>q;
int p[q];
/*for (int i = 0; i < q; ++i)
{
cin>>p[i];
}*/
sort(arr.begin(),arr.end());
for (int i = 0; i < q; ++i)
{
cin>>a;
vector<int>::iterator lower;
lower = upper_bound(arr.begin(),arr.end(),a);
int idx = lower - arr.begin();
int sum = 0, cnt = 0;
for (int i = 0; i < idx; ++i)
{
if(arr[i] <= a){
sum += arr[i];
cnt++;
}
}
cout<<cnt<<" "<<sum<<"\n";
}
} | 15.513514 | 47 | 0.473868 | anujkyadav07 |
cfbbcc6c25f6bde73a20fbe38b313f5b067b00b5 | 1,474 | cpp | C++ | book/basics/names/Puzzle.cpp | luanics/cpp-illustrated | 6049de2119a53d656a63b65d9441e680355ef196 | [
"MIT"
] | null | null | null | book/basics/names/Puzzle.cpp | luanics/cpp-illustrated | 6049de2119a53d656a63b65d9441e680355ef196 | [
"MIT"
] | null | null | null | book/basics/names/Puzzle.cpp | luanics/cpp-illustrated | 6049de2119a53d656a63b65d9441e680355ef196 | [
"MIT"
] | null | null | null | #include <iostream>
int x;
namespace Y {
int a;
void f(float) {}
void h(int) {}
}
namespace Z {
void h(double) {}
}
namespace A {
using namespace Y;
void f(int) {}
void g(int) {}
void g() {}
int i;
}
namespace B {
using namespace Z;
void f(char) {}
int i;
}
namespace AB {
using namespace A;
using namespace B;
void g() {A::i = 2;}
void A() {g();}
}
void h()
{
int AB; // OK - this won't interfere with names below as nested name specifiers don't match variables
AB::g(); // AB is searched, AB::g found by lookup and is chosen AB::g(void)
// (A and B are not searched)
AB::f(1); // First, AB is searched, there is no f
// Then, A, B are searched
// A::f, B::f found by lookup (but Y is not searched so Y::f is not considered)
// overload resolution picks A::f(int)
// AB::x++; // First, AB is searched, there is no x
// Then A, B are searched. There is no x
// Then Y and Z are searched. There is still no x: this is an error
// AB::i++; // AB is searched, there is no i
// Then A, B are searched. A::i and B::i found by lookup: this is an error
AB::h(16.8); // First, AB is searched: there is no h
// Then A, B are searched. There is no h
// Then Y and Z are searched.
// lookup finds Y::h and Z::h. Overload resolution picks Z::h(double)
}
int main(int argc, char ** argv) {
return 0;
}
| 27.296296 | 102 | 0.565129 | luanics |
cfbc761c900f7fd17d6e2b0b00ef46aaeb0c8117 | 6,161 | hpp | C++ | src/vtu11/vtu11/impl/writer_impl.hpp | gtsc/HPC-divers-license | fa1493e217ff76a407feea9b80623eca4691e044 | [
"BSD-3-Clause"
] | 7 | 2020-01-07T16:38:31.000Z | 2022-01-26T19:23:26.000Z | src/vtu11/vtu11/impl/writer_impl.hpp | gtsc/HPC-divers-license | fa1493e217ff76a407feea9b80623eca4691e044 | [
"BSD-3-Clause"
] | 25 | 2020-01-13T17:38:43.000Z | 2021-12-09T11:58:15.000Z | vtu11/impl/writer_impl.hpp | phmkopp/vtu11 | 7afb9e33d076536af3ac333211a7a78576d582bf | [
"BSD-3-Clause"
] | 3 | 2020-04-08T10:46:23.000Z | 2020-04-15T18:34:41.000Z | // __ ____ ____
// ___ ___/ |_ __ _/_ /_ |
// \ \/ /\ __\ | \ || |
// \ / | | | | / || |
// \_/ |__| |____/|___||___|
//
// License: BSD License ; see LICENSE
//
#ifndef VTU11_WRITER_IMPL_HPP
#define VTU11_WRITER_IMPL_HPP
#include "vtu11/inc/utilities.hpp"
#include <fstream>
namespace vtu11
{
namespace detail
{
template<typename T> inline
void writeNumber( char (&buffer)[64], T value )
{
VTU11_THROW( "Invalid data type." );
}
#define __VTU11_WRITE_NUMBER_SPECIALIZATION( string, type ) \
template<> inline \
void writeNumber<type>( char (&buffer)[64], type value ) \
{ \
std::snprintf( buffer, sizeof( buffer ), string, value ); \
}
__VTU11_WRITE_NUMBER_SPECIALIZATION( VTU11_ASCII_FLOATING_POINT_FORMAT, double )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%lld", long long int )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%ld" , long int )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%d" , int )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%hd" , short )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%hhd", char )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%llu", unsigned long long int )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%ld" , unsigned long int )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%d" , unsigned int )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%hd" , unsigned short )
__VTU11_WRITE_NUMBER_SPECIALIZATION( "%hhd", unsigned char )
} // namespace detail
template<typename T>
inline void AsciiWriter::writeData( std::ostream& output,
const std::vector<T>& data )
{
char buffer[64];
for( auto value : data )
{
detail::writeNumber( buffer, value );
output << buffer << " ";
}
output << "\n";
}
template<>
inline void AsciiWriter::writeData( std::ostream& output,
const std::vector<std::int8_t>& data )
{
for( auto value : data )
{
// will otherwise interpret uint8 as char and output nonsense instead
// changed the datatype from unsigned to int
output << static_cast<int>( value ) << " ";
}
output << "\n";
}
inline void AsciiWriter::writeAppended( std::ostream& )
{
}
inline void AsciiWriter::addHeaderAttributes( StringStringMap& )
{
}
inline void AsciiWriter::addDataAttributes( StringStringMap& attributes )
{
attributes["format"] = "ascii";
}
inline StringStringMap AsciiWriter::appendedAttributes( )
{
return { };
}
// ----------------------------------------------------------------
template<typename T>
inline void Base64BinaryWriter::writeData( std::ostream& output,
const std::vector<T>& data )
{
HeaderType numberOfBytes = data.size( ) * sizeof( T );
output << base64Encode( &numberOfBytes, &numberOfBytes + 1 );
output << base64Encode( data.begin( ), data.end( ) );
output << "\n";
}
inline void Base64BinaryWriter::writeAppended( std::ostream& )
{
}
inline void Base64BinaryWriter::addHeaderAttributes( StringStringMap& attributes )
{
attributes["header_type"] = dataTypeString<HeaderType>( );
}
inline void Base64BinaryWriter::addDataAttributes( StringStringMap& attributes )
{
attributes["format"] = "binary";
}
inline StringStringMap Base64BinaryWriter::appendedAttributes( )
{
return { };
}
// ----------------------------------------------------------------
template<typename T>
inline void Base64BinaryAppendedWriter::writeData( std::ostream&,
const std::vector<T>& data )
{
HeaderType rawBytes = data.size( ) * sizeof( T );
appendedData.emplace_back( reinterpret_cast<const char*>( &data[0] ), rawBytes );
offset += encodedNumberOfBytes( rawBytes + sizeof( HeaderType ) );
}
inline void Base64BinaryAppendedWriter::writeAppended( std::ostream& output )
{
for( auto dataSet : appendedData )
{
// looks like header and data has to be encoded at once
std::vector<char> data( dataSet.second + sizeof( HeaderType ) );
*reinterpret_cast<HeaderType*>( &data[0] ) = dataSet.second;
std::copy( dataSet.first, dataSet.first + dataSet.second, &data[ sizeof( HeaderType ) ] );
output << base64Encode( data.begin( ), data.end( ) );
}
output << "\n";
}
inline void Base64BinaryAppendedWriter::addHeaderAttributes( StringStringMap& attributes )
{
attributes["header_type"] = dataTypeString<HeaderType>( );
}
inline void Base64BinaryAppendedWriter::addDataAttributes( StringStringMap& attributes )
{
attributes["format"] = "appended";
attributes["offset"] = std::to_string( offset );
}
inline StringStringMap Base64BinaryAppendedWriter::appendedAttributes( )
{
return { { "encoding", "base64" } };
}
// ----------------------------------------------------------------
template<typename T>
inline void RawBinaryAppendedWriter::writeData( std::ostream&,
const std::vector<T>& data )
{
HeaderType rawBytes = data.size( ) * sizeof( T );
appendedData.emplace_back( reinterpret_cast<const char*>( &data[0] ), rawBytes );
offset += sizeof( HeaderType ) + rawBytes;
}
inline void RawBinaryAppendedWriter::writeAppended( std::ostream& output )
{
for( auto dataSet : appendedData )
{
const char* headerBegin = reinterpret_cast<const char*>( &dataSet.second );
for( const char* ptr = headerBegin; ptr < headerBegin + sizeof( HeaderType ); ++ptr )
{
output << *ptr;
}
for( const char* ptr = dataSet.first; ptr < dataSet.first + dataSet.second; ++ptr )
{
output << *ptr;
}
}
output << "\n";
}
inline void RawBinaryAppendedWriter::addHeaderAttributes( StringStringMap& attributes )
{
attributes["header_type"] = dataTypeString<HeaderType>( );
}
inline void RawBinaryAppendedWriter::addDataAttributes( StringStringMap& attributes )
{
attributes["format"] = "appended";
attributes["offset"] = std::to_string( offset );
}
inline StringStringMap RawBinaryAppendedWriter::appendedAttributes( )
{
return { { "encoding", "raw" } };
}
} // namespace vtu11
#endif // VTU11_WRITER_IMPL_HPP
| 26.786957 | 94 | 0.635286 | gtsc |
cfbf4201b3f86c93d0709acd6e844cd5f6665646 | 4,168 | cpp | C++ | tests/test_configd/fetch/UnittestLayerTypeCommand.cpp | webOS-ports/configd | 707f158782b82417b197c00845d3fdf44dd5bcfd | [
"Apache-2.0"
] | 2 | 2018-03-22T19:07:50.000Z | 2019-05-06T05:20:31.000Z | tests/test_configd/fetch/UnittestLayerTypeCommand.cpp | webOS-ports/configd | 707f158782b82417b197c00845d3fdf44dd5bcfd | [
"Apache-2.0"
] | null | null | null | tests/test_configd/fetch/UnittestLayerTypeCommand.cpp | webOS-ports/configd | 707f158782b82417b197c00845d3fdf44dd5bcfd | [
"Apache-2.0"
] | 3 | 2018-03-22T19:07:52.000Z | 2022-02-26T04:28:53.000Z | // Copyright (c) 2016-2018 LG Electronics, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
#include <config/MockLayer.h>
#include <gtest/gtest.h>
#include <pbnjson.hpp>
#include "config/Layer.h"
#include "util/Platform.h"
#include "Environment.h"
#include "UnittestLayerType.hpp"
using namespace pbnjson;
using namespace std;
using ::testing::SetArgReferee;
using ::testing::_;
class UnittestLayerTypeCommand : public UnittestLayerType, public testing::Test {
protected:
UnittestLayerTypeCommand()
: UnittestLayerType(TEST_DATA_PATH, "command")
{
m_info = pbnjson::Object();
}
virtual void givenCMDOneLayer()
{
givenInfo(COMMAND_ONE_NAME, COMMAND_ONE_VALUE);
givenLayer();
}
virtual void givenCMDTwoLayer()
{
givenInfo(COMMAND_TWO_NAME, COMMAND_TWO_VALUE);
givenLayer();
}
const string COMMAND_ONE_NAME = "CommandOneLayer";
const string COMMAND_ONE_VALUE = "echo 'selection1'";
const string COMMAND_ONE_RESULT = "selection1";
const string COMMAND_TWO_NAME = "CommandTwoLayer";
const string COMMAND_TWO_VALUE = "echo 'selection2'";
const string COMMAND_TWO_RESULT = "selection2";
};
TEST_F(UnittestLayerTypeCommand, gettingWithoutSelectionOfCMDOneLayer)
{
givenCMDOneLayer();
thenTypeAndName(SelectorType_Command, COMMAND_ONE_NAME);
thenUnselectedStatus(TEST_DATA_PATH);
EXPECT_FALSE(m_layer->isReadOnlyType());
}
TEST_F(UnittestLayerTypeCommand, gettingWithSelectionOfCMDOneLayer)
{
givenCMDOneLayer();
EXPECT_TRUE(m_layer->select());
thenSelectedStatus(TEST_DATA_PATH, COMMAND_ONE_RESULT);
}
TEST_F(UnittestLayerTypeCommand, checkListenerWithSelectionOfCMDOneLayer)
{
givenCMDOneLayer();
EXPECT_CALL(m_listener, onSelectionChanged(_, _, _));
EXPECT_TRUE(m_layer->select());
}
TEST_F(UnittestLayerTypeCommand, gettingWithoutSelectionOfCMDTwoLayer)
{
givenCMDTwoLayer();
thenTypeAndName(SelectorType_Command, COMMAND_TWO_NAME);
thenUnselectedStatus(TEST_DATA_PATH);
EXPECT_FALSE(m_layer->isReadOnlyType());
}
TEST_F(UnittestLayerTypeCommand, gettingWithSelectionOfCMDTwoLayer)
{
givenCMDTwoLayer();
EXPECT_TRUE(m_layer->select());
thenSelectedStatus(TEST_DATA_PATH, COMMAND_TWO_RESULT);
}
TEST_F(UnittestLayerTypeCommand, fetchConfigs)
{
givenCMDTwoLayer();
m_layer->select();
string path = m_layer->getFullDirPath(true);
thenFetchConfigs(path);
}
TEST_F(UnittestLayerTypeCommand, fetchFullConfigs)
{
givenCMDOneLayer();
m_layer->select();
string path = m_layer->getFullDirPath(true);
thenFetchFullConfigs(path);
}
TEST_F(UnittestLayerTypeCommand, clearSelectAndSelectAgain)
{
givenCMDOneLayer();
EXPECT_TRUE(m_layer->select());
EXPECT_TRUE(m_layer->isSelected());
m_layer->clearSelection();
EXPECT_FALSE(m_layer->isSelected());
EXPECT_TRUE(m_layer->setSelection(COMMAND_TWO_RESULT));
thenSelectedStatus(TEST_DATA_PATH, COMMAND_TWO_RESULT);
EXPECT_TRUE(m_layer->select());
thenSelectedStatus(TEST_DATA_PATH, COMMAND_ONE_RESULT);
}
TEST_F(UnittestLayerTypeCommand, invalidCallOperation)
{
givenCMDOneLayer();
EXPECT_EQ(false, m_layer->call());
}
TEST_F(UnittestLayerTypeCommand, fetchFilesWithInvaildPath)
{
givenCMDOneLayer();
string path = "invalidPath";
JsonDB A;
EXPECT_FALSE(Layer::parseFiles(path, NULL, &A));
}
TEST_F(UnittestLayerTypeCommand, fetchFilesNotExistJsonInDir)
{
givenCMDOneLayer();
string path = TEST_DATA_PATH;
JsonDB A;
EXPECT_TRUE(Layer::parseFiles(path, NULL, &A));
}
| 24.662722 | 81 | 0.740883 | webOS-ports |
cfd5914eb8b72dfc901dc7a0666625c8023983d4 | 1,505 | cpp | C++ | src/prod/src/ServiceModel/management/FaultAnalysisService/RestartDeployedCodePackageStatus.cpp | AnthonyM/service-fabric | c396ea918714ea52eab9c94fd62e018cc2e09a68 | [
"MIT"
] | 2,542 | 2018-03-14T21:56:12.000Z | 2019-05-06T01:18:20.000Z | src/prod/src/ServiceModel/management/FaultAnalysisService/RestartDeployedCodePackageStatus.cpp | AnthonyM/service-fabric | c396ea918714ea52eab9c94fd62e018cc2e09a68 | [
"MIT"
] | 994 | 2019-05-07T02:39:30.000Z | 2022-03-31T13:23:04.000Z | src/prod/src/ServiceModel/management/FaultAnalysisService/RestartDeployedCodePackageStatus.cpp | AnthonyM/service-fabric | c396ea918714ea52eab9c94fd62e018cc2e09a68 | [
"MIT"
] | 300 | 2018-03-14T21:57:17.000Z | 2019-05-06T20:07:00.000Z | // ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
using namespace Common;
using namespace ServiceModel;
using namespace std;
using namespace Management::FaultAnalysisService;
StringLiteral const TraceComponent("RestartDeployedCodePackageStatus");
RestartDeployedCodePackageStatus::RestartDeployedCodePackageStatus()
: deployedCodePackageResultSPtr_()
{
}
RestartDeployedCodePackageStatus::RestartDeployedCodePackageStatus(
shared_ptr<Management::FaultAnalysisService::DeployedCodePackageResult> && deployedCodePackageResultSPtr)
: deployedCodePackageResultSPtr_(std::move(deployedCodePackageResultSPtr))
{
}
RestartDeployedCodePackageStatus::RestartDeployedCodePackageStatus(RestartDeployedCodePackageStatus && other)
: deployedCodePackageResultSPtr_(move(other.deployedCodePackageResultSPtr_))
{
}
RestartDeployedCodePackageStatus & RestartDeployedCodePackageStatus::operator=(RestartDeployedCodePackageStatus && other)
{
if (this != &other)
{
deployedCodePackageResultSPtr_ = move(other.deployedCodePackageResultSPtr_);
}
return *this;
}
shared_ptr<DeployedCodePackageResult> const & RestartDeployedCodePackageStatus::GetRestartDeployedCodePackageResult()
{
return deployedCodePackageResultSPtr_;
}
| 33.444444 | 121 | 0.756146 | AnthonyM |
cfdb15f2ec287001e85829552f57bd9597ff90b1 | 213 | cpp | C++ | UE4_Project_Hunt/Source/UE4_Project_Hunt/UE4_Project_Hunt.cpp | AhmedEhabAmer/project-hunt | 21d881ea9243101603d5b8d402fe7f3c46d29ecf | [
"MIT"
] | 1 | 2020-06-25T13:09:29.000Z | 2020-06-25T13:09:29.000Z | UE4_Project_Hunt/Source/UE4_Project_Hunt/UE4_Project_Hunt.cpp | AhmedEhabAmer/project-hunt | 21d881ea9243101603d5b8d402fe7f3c46d29ecf | [
"MIT"
] | null | null | null | UE4_Project_Hunt/Source/UE4_Project_Hunt/UE4_Project_Hunt.cpp | AhmedEhabAmer/project-hunt | 21d881ea9243101603d5b8d402fe7f3c46d29ecf | [
"MIT"
] | null | null | null | // Copyright Epic Games, Inc. All Rights Reserved.
#include "UE4_Project_Hunt.h"
#include "Modules/ModuleManager.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, UE4_Project_Hunt, "UE4_Project_Hunt" );
| 30.428571 | 94 | 0.812207 | AhmedEhabAmer |
cfdc370a63f2cb5d9590aa746bdc53be830fa883 | 599 | cpp | C++ | src/data/dmc_octree_node.cpp | Svennny/isomesh | be7ed638079a81b1ca468833aa2972656277aaaf | [
"MIT"
] | 4 | 2019-04-08T17:36:53.000Z | 2020-04-11T18:53:29.000Z | src/data/dmc_octree_node.cpp | Svennny/isomesh | be7ed638079a81b1ca468833aa2972656277aaaf | [
"MIT"
] | null | null | null | src/data/dmc_octree_node.cpp | Svennny/isomesh | be7ed638079a81b1ca468833aa2972656277aaaf | [
"MIT"
] | 2 | 2020-01-26T18:55:41.000Z | 2020-09-30T20:10:11.000Z | /* This file is part of Isomesh library, released under MIT license.
Copyright (c) 2018-2019 Pavel Asyutchenko ([email protected]) */
#include <isomesh/data/dmc_octree_node.hpp>
#include <stdexcept>
namespace isomesh
{
DMC_OctreeNode::DMC_OctreeNode () noexcept : children (nullptr)
{}
DMC_OctreeNode::~DMC_OctreeNode () noexcept {
collapse ();
}
void DMC_OctreeNode::subdivide () {
if (children)
throw std::logic_error ("Octree node is already subdivided");
children = new DMC_OctreeNode[8];
}
void DMC_OctreeNode::collapse () noexcept {
delete[] children;
children = nullptr;
}
}
| 20.655172 | 68 | 0.734558 | Svennny |
cfdd63392854982e1a705b102dac59599023d4ff | 1,298 | cpp | C++ | Breakout/src/Ball.cpp | Ebsidia/Mana | ebecc2a02ab65d634438e2c207b4bb0b8af01505 | [
"Apache-2.0"
] | null | null | null | Breakout/src/Ball.cpp | Ebsidia/Mana | ebecc2a02ab65d634438e2c207b4bb0b8af01505 | [
"Apache-2.0"
] | null | null | null | Breakout/src/Ball.cpp | Ebsidia/Mana | ebecc2a02ab65d634438e2c207b4bb0b8af01505 | [
"Apache-2.0"
] | null | null | null | #include "Ball.h"
Ball::Ball()
{
}
Ball::~Ball()
{
}
void Ball::loadAssets()
{
m_ballTexture = Mana::Texture2D::Create("assets/Breakout/textures/pongball.png");
}
void Ball::onUpdate(Mana::TimeStep dt)
{
if (Mana::Input::isKeyPressed(MA_KEY_SPACE))
m_isStuck = false;
if (!m_isStuck)
{
glm::vec2 velocity = { m_velocity.x * dt, m_velocity.y * dt };
m_position += velocity;
//setPosition({ m_velocity.x * dt, m_velocity.y * dt });
// Then check if outside window bounds and if so, reverse velocity and restore at correct position
if (getPosition().x <= 0.0f)
{
m_velocity.x = -m_velocity.x;
setPosition({0, getPosition().y });
}
else if (getPosition().x + m_size.x >= 1600)
{
m_velocity.x = -m_velocity.x;
setPosition({ 1600 - m_size.x, getPosition().y });
}
if (getPosition().y <= 0.0f)
{
m_velocity.y = -this->m_velocity.y;
setPosition({getPosition().x, 0});
}
}
}
void Ball::onRender()
{
Mana::Renderer2D::drawQuad({m_position.x, m_position.y, 0.1f}, m_size, m_ballTexture, 1.0f, glm::vec4(1.0f, 1.0f, 1.0f, 1.0f));
}
void Ball::onImGuiRender()
{
}
void Ball::reset()
{
}
| 19.969231 | 131 | 0.561633 | Ebsidia |
cfe24e0ddfc191105daa49549d0ef38d39e802f3 | 3,904 | cpp | C++ | FryEngine/tests/FryEngine/ECS/UT_ECS_System.cpp | Schtekt/FryEngine | eb36df4d0b42ca5a0549a130709c567e88b6a826 | [
"MIT"
] | null | null | null | FryEngine/tests/FryEngine/ECS/UT_ECS_System.cpp | Schtekt/FryEngine | eb36df4d0b42ca5a0549a130709c567e88b6a826 | [
"MIT"
] | null | null | null | FryEngine/tests/FryEngine/ECS/UT_ECS_System.cpp | Schtekt/FryEngine | eb36df4d0b42ca5a0549a130709c567e88b6a826 | [
"MIT"
] | null | null | null | #include <gtest/gtest.h>
#include <iostream>
#include "helperClasses.h"
TEST(ECS, CustomSystemSingleComponent)
{
ECS* ecs = new ECS();
DeleteIntClassSystem sys;
Entity* ent = ecs->CreateEntity();
int myNumber = 5;
ent->AddComponent<DeleteIntClass>(&myNumber);
ASSERT_EQ(myNumber, 5);
std::vector<BaseSystem*> systems;
systems.push_back(&sys);
ecs->UpdateSystems(0, systems);
ASSERT_EQ(myNumber, 4);
delete ecs;
ASSERT_EQ(myNumber, 5);
}
TEST(ECS, CustomSystemSingleComponentType)
{
ECS* ecs = new ECS();
DeleteIntClassSystem sys;
std::vector<int> myNumbers;
std::vector<int> origNumbers;
std::vector<Entity*> entities;
for(int i = 0; i < 20; i++)
{
myNumbers.push_back(i);
origNumbers.push_back(i);
entities.push_back(ecs->CreateEntity());
}
for(int i = 0; i < 20; i++)
{
entities[i]->AddComponent<DeleteIntClass>(&myNumbers[i]);
ASSERT_EQ(myNumbers[i], origNumbers[i]);
}
std::vector<BaseSystem*> systems;
systems.push_back(&sys);
ecs->UpdateSystems(0, systems);
for(size_t i = 0; i < 20; i++)
{
ASSERT_EQ(myNumbers[i], origNumbers[i] - 1);
}
delete ecs;
for(size_t i = 0; i < 20; i++)
{
ASSERT_EQ(myNumbers[i], origNumbers[i]);
}
}
TEST(ECS, CustomSystemMultipleComponentTypes)
{
ECS* ecs = new ECS();
CreateDeleteIntClassSystem sys;
std::vector<int> myNumbers;
std::vector<int> origNumbers;
std::vector<Entity*> entities;
for(int i = 0; i < 20; i++)
{
myNumbers.push_back(i);
origNumbers.push_back(i);
entities.push_back(ecs->CreateEntity());
}
for(int i = 0; i < 20; i++)
{
entities[i]->AddComponent<DeleteIntClass>(&myNumbers[i]);
entities[i]->AddComponent<CreateIntClass>(i);
ASSERT_EQ(myNumbers[i], origNumbers[i]);
ASSERT_EQ(*entities[i]->GetComponent<CreateIntClass>()->GetNumber(), i);
}
std::vector<BaseSystem*> systems;
systems.push_back(&sys);
ecs->UpdateSystems(0, systems);
for(size_t i = 0; i < 20; i++)
{
ASSERT_EQ(*entities[i]->GetComponent<CreateIntClass>()->GetNumber() - myNumbers[i], 2);
}
delete ecs;
for(size_t i = 0; i < 20; i++)
{
ASSERT_EQ(myNumbers[i], origNumbers[i]);
}
}
TEST(ECS, CustomSystemMultipleComponentTypesOptional)
{
ECS ecs;
SubtractionSystem sys;
std::vector<BaseSystem*> systems;
systems.push_back(&sys);
std::vector<Entity*> entities;
for(int i = 0; i < 20; i++)
{
entities.push_back(ecs.CreateEntity());
}
for(int i = 0; i < 20; i++)
{
entities[i]->AddComponent<int>(i);
ASSERT_EQ(*entities[i]->GetComponent<int>(), i);
if(i % 2 == 0)
{
entities[i]->AddComponent<unsigned int>(i);
ASSERT_EQ(*entities[i]->GetComponent<unsigned int>(), i);
}
}
ecs.UpdateSystems(0, systems);
for(int i = 0; i < 20; i++)
{
if(i % 2 == 0)
{
ASSERT_EQ(*entities[i]->GetComponent<int>(), 0);
}
else
{
ASSERT_EQ(*entities[i]->GetComponent<int>(), i);
}
}
}
TEST(ECS, MultipleCustomSystems)
{
ECS ecs;
SubtractionSystem subSys;
MultiplicationSystem mulSys;
std::vector<Entity*> entities;
for(int i = 0; i < 20; i++)
{
entities.push_back(ecs.CreateEntity());
entities[i]->AddComponent<int>(i);
entities[i]->AddComponent<unsigned int>(i);
}
// Order matters!
std::vector<BaseSystem*> systems;
systems.push_back(&mulSys);
systems.push_back(&subSys);
ecs.UpdateSystems(0, systems);
for(int i = 0; i < 20; i++)
{
ASSERT_EQ(*entities[i]->GetComponent<int>(), i * i - i);
}
} | 20.765957 | 95 | 0.573258 | Schtekt |
cfe7e8be38d0795cbd9830610e49d419ae073f94 | 1,416 | hpp | C++ | src/Engine.hpp | Galhad/firestorm | 3c1584b1e5b95f21d963b9cf226f6ec1a469d7af | [
"MIT"
] | null | null | null | src/Engine.hpp | Galhad/firestorm | 3c1584b1e5b95f21d963b9cf226f6ec1a469d7af | [
"MIT"
] | null | null | null | src/Engine.hpp | Galhad/firestorm | 3c1584b1e5b95f21d963b9cf226f6ec1a469d7af | [
"MIT"
] | null | null | null |
#ifndef FIRESTORM_ENGINE_HPP
#define FIRESTORM_ENGINE_HPP
#include "EngineCreationParams.hpp"
#include "graphics/GraphicsManager.hpp"
#include "scene/SceneManager.hpp"
#include "physics/PhysicsManager.hpp"
#include "io/InputManager.hpp"
#include "io/FileProvider.hpp"
#include "utils/Logger.hpp"
#include <memory>
#include <functional>
namespace fs
{
class Engine
{
public:
Engine();
virtual ~Engine();
void create(const EngineCreationParams& creationParams);
virtual void destroy();
void run();
virtual void update(float deltaTime);
graphics::GraphicsManager& getGraphicsManager() const;
scene::SceneManager& getSceneManager() const;
io::InputManager& getInputManager() const;
io::FileProvider& getFileProvider() const;
const utils::LoggerPtr& getLogger() const;
protected:
virtual void render(const VkCommandBuffer& commandBuffer,
const VkPipelineLayout& pipelineLayout,
const VkDescriptorSet& uniformDescriptorSet);
protected:
graphics::GraphicsManagerPtr graphicsManager;
io::InputManagerPtr inputManager;
io::FileProviderPtr fileProvider;
scene::SceneManagerPtr sceneManager;
physics::PhysicsManagerPtr physicsManager;
utils::LoggerPtr logger = spdlog::stdout_color_mt(utils::CONSOLE_LOGGER_NAME);
};
typedef std::unique_ptr<Engine> EnginePtr;
}
#endif //FIRESTORM_ENGINE_HPP
| 24.413793 | 82 | 0.737994 | Galhad |
cfe80dd1d50da4993f3e77635a4006f700c358ea | 63,477 | cpp | C++ | app/ValidateIABStream.cpp | DTSProAudio/iab-validator | 694b3782672aece877a3d5f79996f379e74299e9 | [
"MIT"
] | 3 | 2020-03-17T17:46:30.000Z | 2020-10-01T09:09:00.000Z | app/ValidateIABStream.cpp | DTSProAudio/iab-validator | 694b3782672aece877a3d5f79996f379e74299e9 | [
"MIT"
] | 1 | 2020-04-14T15:59:00.000Z | 2020-04-14T15:59:00.000Z | app/ValidateIABStream.cpp | DTSProAudio/iab-validator | 694b3782672aece877a3d5f79996f379e74299e9 | [
"MIT"
] | 3 | 2020-04-01T16:10:49.000Z | 2020-04-16T06:47:37.000Z | /* Copyright (c) 2020 Xperi Corporation (and its subsidiaries). All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <iomanip>
#include <fstream>
#include <iostream>
#include <sstream>
#include "ValidateIABStream.h"
#include "libjson.h"
#ifdef _LOG
#define LOG_ERR(x) (std::cerr << (x))
#define LOG_OUT(x) (std::cout << (x))
#else
#define LOG_ERR(x)
#define LOG_OUT(x)
#endif
std::string intToString(int32_t value)
{
char ch[32];
sprintf(ch, "%d", value);
return std::string(ch);
}
// Constructor
ValidateIABStream::ValidateIABStream()
{
iabParser_ = nullptr;
iabValidator_ = nullptr;
inputFile_ = nullptr;
hasInvalidSets_ = false;
hasValidationIssues_ = false;
inputFrameCount_ = 0;
numIssuesToReport_ = 0;
reportAllIssues_ = true;
jsonTree_ = json_new(JSON_NODE);
validationResultSummaryInJson_ = nullptr;
validationIssuesSummaryInJson_ = nullptr;
parserResultInJson_ = nullptr;
status_code_ = kIABValidatorSuccessful;
error_warnings_list_ = nullptr;
// Create an IAB Validator instance to validate bitstream
iabValidator_ = IABValidatorInterface::Create();
}
// Destructor
ValidateIABStream::~ValidateIABStream()
{
if (iabParser_)
{
IABParserInterface::Delete(iabParser_);
}
if (iabValidator_)
{
IABValidatorInterface::Delete(iabValidator_);
}
if (jsonTree_)
{
json_delete(jsonTree_);
}
// Delete error and warnings list.
struct ErrorList *current = error_warnings_list_;
struct ErrorList *next;
while (current != nullptr)
{
next = current->next_;
delete(current);
current = next;
}
CloseInputOutputFiles();
}
// ValidateIABStream::AreSettingsValid() implementation
bool ValidateIABStream::AreSettingsValid(ValidationSettings& iSettings)
{
if (iSettings.inputFileStem_.empty() ||
iSettings.inputFileExt_.empty() ||
iSettings.validationConstraintSets_.empty())
{
return false;
}
// Save settings to class internal members
inputFileStem_ = iSettings.inputFileStem_;
inputFileExt_ = iSettings.inputFileExt_;
outputPath_ = iSettings.outputPath_;
multiFilesInput_ = iSettings.multiFilesInput_;
validationConstraintSets_ = iSettings.validationConstraintSets_;
reportAllIssues_ = iSettings.reportAllIssues_;
numIssuesToReport_ = iSettings.numIssuesToReport_;
return true;
}
// ValidateIABStream::OpenInputFile() implementation
iabError ValidateIABStream::OpenInputFile(std::string iInputFileName)
{
inputFile_ = new std::ifstream(iInputFileName.c_str(), std::ifstream::in | std::ifstream::binary);
if (!inputFile_->good())
{
return kIABGeneralError;
}
return kIABNoError;
}
// ValidateIABStream::CloseInputOutputFiles() implementation
iabError ValidateIABStream::CloseInputOutputFiles()
{
// Close files
if (inputFile_)
{
inputFile_->close();
delete inputFile_;
inputFile_ = nullptr;
}
return kIABNoError;
}
// ValidateIABStream::Validate() implementation
ExitStatusCode ValidateIABStream::Validate(ValidationSettings& iSettings)
{
// Check settings and save if valid
if (!AreSettingsValid(iSettings))
{
// Invalid, return error
return kIABValidatorSetupFailed;
}
if (!iabValidator_)
{
// Error : Validator not instantiated
return kIABValidatorInstanceCannotBeCreated;
}
bool noProcessingError = true;
iabError returnCode = kIABNoError;
if (multiFilesInput_)
{
LOG_ERR("Processing bitstream frame sequence. This could take several minutes for complex or long bitstreams ........\n");
while (1)
{
// Construct next input file name
std::stringstream ss;
ss << inputFileStem_.c_str() << std::setfill('0') << std::setw(6) << inputFrameCount_ << inputFileExt_;
// open input file for processing. Break loop if there is no more input.
if (kIABNoError != OpenInputFile(ss.str()))
{
if (inputFrameCount_ == 0)
{
LOG_ERR("!Error in opening file : " + ss.str() + ". Input file name error or missing input file).\n");
noProcessingError = false;
status_code_ = kIABValidatorCannotOpenInputFile;
}
break;
}
// Use a new IABParser instance for each new file. If one exists, delete it
if (iabParser_)
{
IABParserInterface::Delete(iabParser_);
iabParser_ = nullptr;
}
// Create an IAB Parser instance to process current file
iabParser_ = IABParserInterface::Create(inputFile_);
// Parse the bitstream into IAB frame
returnCode = iabParser_->ParseIABFrame();
if (kIABNoError != returnCode)
{
if ((inputFrameCount_ == 0) || (returnCode != kIABParserEndOfStreamReached))
{
LOG_ERR("The application has encountered an error when parsing a frame from the bitstream.\n");
LOG_ERR("Error code: " + intToString(returnCode) + GetParserErrorString(returnCode));
parserResultInJson_ = json_new(JSON_NODE);
json_set_name(parserResultInJson_, "ParserState");
json_push_back(parserResultInJson_, json_new_a("Error", GetParserErrorString(returnCode).c_str()));
json_push_back(parserResultInJson_, json_new_i("FrameIndex", inputFrameCount_ + 1));
noProcessingError = false;
status_code_ = kIABValidatorParsingIABFrameFromBitStreamFailed;
}
break;
}
if (inputFile_)
{
// For multi-files input, finish with current input file, close it
inputFile_->close();
delete inputFile_;
inputFile_ = nullptr;
}
const IABFrameInterface *frameInterface = nullptr;
// Get the parsed IAB frame from IABParser
if (kIABNoError != iabParser_->GetIABFrame(frameInterface) || frameInterface == nullptr)
{
LOG_ERR("The application is unable to get the parsed IAB frame from the parser.\n");
noProcessingError = false;
status_code_ = kIABValidatorParsedIABFrameFromParserFailed;
break;
}
if (inputFrameCount_ > 0)
{
// Check and update maxRendered if necessary
IABMaxRenderedRangeType maxRendered = 0;
frameInterface->GetMaxRendered(maxRendered);
if (maxRendered > bitstreamMaxRendered_)
{
bitstreamMaxRendered_ = maxRendered;
}
}
else
{
// First frame, record bitstream summary for reporting
// Note that these items should be static for a valid bitstream and leave it to the validator to pick up any issues.
RecordBitstreamSummary(frameInterface);
}
// Validate the parsed frame. The validator will keep tracks of validation state, warnings and errors
// These will be checked when validation completes or aborted
returnCode = iabValidator_->ValidateIABFrame(frameInterface, inputFrameCount_);
if (kIABNoError != returnCode)
{
// Temporary reporting, parser error reporting will be finalised in PACL-669
LOG_ERR("The application has encountered an error when validating a parsed IAB frame.\n");
LOG_ERR("Error code: " + intToString(returnCode));
noProcessingError = false;
status_code_ = kIABValidatorIABParsedFrameValidationFailed;
break;
}
inputFrameCount_++;
if ((reportAllIssues_ == false) && (DoesNumOfIssuesExceed() == true))
{
status_code_ = kIABValidatorIssuesExceeded;
noProcessingError = false;
break;
}
// Display progress every 50 frames
if ((inputFrameCount_ % 50) == 0)
{
std::cout << "Frames processed: " << inputFrameCount_ << std::endl << std::flush;
}
}
}
else // single-file input
{
LOG_OUT("Processing input file : " + inputFileStem_ + inputFileExt_ + ". This could take several minutes for complex or long bitstreams ........\n" );
while (1)
{
if (inputFrameCount_ > 0)
{
if (inputFile_->eof())
{
// Finished processing
inputFile_->close();
delete inputFile_;
inputFile_ = nullptr;
break;
}
}
else
{
// First frame, open the input file for the Parser to use
std::string inputFile = inputFileStem_ + inputFileExt_;
if (kIABNoError != OpenInputFile(inputFile))
{
LOG_ERR( "!Error in opening file : " +inputFile + ". Input file name error or missing input file.\n");
noProcessingError = false;
status_code_ = kIABValidatorCannotOpenInputFile;
break;
}
}
if (inputFrameCount_ == 0)
{
if (iabParser_)
{
IABParserInterface::Delete(iabParser_);
iabParser_ = nullptr;
}
// Create an IAB Parser instance to process current file
iabParser_ = IABParserInterface::Create(inputFile_);
}
// Parse the bitstream into IAB frame
returnCode = iabParser_->ParseIABFrame();
// TODO Process error code to provide more info
if (kIABNoError != returnCode)
{
if ((inputFrameCount_ == 0) || (returnCode != kIABParserEndOfStreamReached))
{
// Temporary reporting, parser error reporting will be finalised in PACL-669
LOG_ERR("The application has encountered an error when parsing a frame from the bitstream.\n");
LOG_ERR("Error code: " + intToString(returnCode) + GetParserErrorString(returnCode) + "\n");
parserResultInJson_ = json_new(JSON_NODE);
json_set_name(parserResultInJson_, "ParserState");
json_push_back(parserResultInJson_, json_new_a("Error", GetParserErrorString(returnCode).c_str()));
json_push_back(parserResultInJson_, json_new_i("FrameIndex", inputFrameCount_ + 1));
noProcessingError = false;
status_code_ = kIABValidatorParsingIABFrameFromBitStreamFailed;
}
break;
}
const IABFrameInterface *frameInterface = nullptr;
if (kIABNoError != iabParser_->GetIABFrame(frameInterface) || frameInterface == nullptr)
{
LOG_ERR("The application is unable to get the parsed IAB frame from the parser.\n");
noProcessingError = false;
status_code_ = kIABValidatorParsedIABFrameFromParserFailed;
break;
}
if (inputFrameCount_ > 0)
{
// Check and update maxRendered if necessary
IABMaxRenderedRangeType maxRendered = 0;
frameInterface->GetMaxRendered(maxRendered);
if (maxRendered > bitstreamMaxRendered_)
{
bitstreamMaxRendered_ = maxRendered;
}
}
else
{
// First frame, record bitstream summary for reporting
RecordBitstreamSummary(frameInterface);
}
// Validate the parsed frame. The validator will keep tracks of validation state, warnings and errors
// These will be checked when validation completes or aborted
returnCode = iabValidator_->ValidateIABFrame(frameInterface, inputFrameCount_);
if (kIABNoError != returnCode)
{
// Temporary reporting, parser error reporting will be finalised in PACL-669
LOG_ERR("The application has encountered an error when validating a parsed IAB frame.\n");
LOG_ERR("Error code: " + intToString(returnCode) + "\n");
noProcessingError = false;
status_code_ = kIABValidatorIABParsedFrameValidationFailed;
break;
}
inputFrameCount_++;
if ((reportAllIssues_ == false) && (DoesNumOfIssuesExceed() == true))
{
status_code_ = kIABValidatorIssuesExceeded;
noProcessingError = false;
break;
}
// Display progress every 50 frames
if ((inputFrameCount_ % 50) == 0)
{
LOG_OUT("Frames processed: " + intToString(inputFrameCount_) + "\n");
}
}
}
LOG_OUT ( "Total frames processed: " + intToString(inputFrameCount_) + "\n\n");
if (noProcessingError)
{
return kIABValidatorSuccessful;
}
else
{
return status_code_;
}
}
// ValidateIABStream::RecordBitstreamSummary() implementation
void ValidateIABStream::RecordBitstreamSummary(const IABFrameInterface *iFrameInterface)
{
iFrameInterface->GetSampleRate(bitstreamSampleRate_);
iFrameInterface->GetFrameRate(bitstreamFrameRate_);
iFrameInterface->GetBitDepth(bitstreamBitDepth_);
iFrameInterface->GetMaxRendered(bitstreamMaxRendered_);
}
// Display the validation report on the console
void ValidateIABStream::DisplayValidationSummary()
{
std::cout << "Bitstream Summary Information:" << std::endl;
std::cout << "\tSampleRate: " << GetSampleRateString(bitstreamSampleRate_) << std::endl;
std::cout << "\tFrameRate: " << GetFrameRateString(bitstreamFrameRate_) << std::endl;
std::cout << "\tBitDepth: " << GetBitDepthString(bitstreamBitDepth_) << std::endl;
std::cout << "\tFrameCount: " << inputFrameCount_ << std::endl;
std::cout << "\tMaxRenderedInStream: " << bitstreamMaxRendered_ << std::endl << std::endl;
if (validationResultSummaryInJson_)
{
std::cout << "Validation Summary Information:\n" << json_write_formatted(validationResultSummaryInJson_) << std::endl << std::endl;
}
if (validationIssuesSummaryInJson_)
{
std::cout << "Issues Summary Information:\n" << json_write_formatted(validationIssuesSummaryInJson_) << std::endl << std::endl;
}
}
// Display parser fail state on console.
void ValidateIABStream::DisplayParserFailState()
{
if (parserResultInJson_)
{
std::cout << json_write_formatted(parserResultInJson_) << std::endl;
std::cout << "\n====================\n\n";
}
}
void ValidateIABStream::ReportBitstreamSummary()
{
JSONNODE * summaryNode = json_new(JSON_NODE);
json_set_name(summaryNode, "BitStreamSummary");
json_push_back(summaryNode, json_new_a("SampleRate", GetSampleRateString(bitstreamSampleRate_).c_str()));
json_push_back(summaryNode, json_new_a("FrameRate", GetFrameRateString(bitstreamFrameRate_).c_str()));
json_push_back(summaryNode, json_new_a("BitDepth", GetBitDepthString(bitstreamBitDepth_).c_str()));
// validation stopped, hence total number of frames yet to be known
if (status_code_ == kIABValidatorIssuesExceeded)
{
json_push_back(summaryNode, json_new_a("FrameCount", "?"));
json_push_back(summaryNode, json_new_a("MaxRendered", "?"));
}
else
{
json_push_back(summaryNode, json_new_a("FrameCount", intToString(inputFrameCount_).c_str()));
json_push_back(summaryNode, json_new_a("MaxRendered", intToString(bitstreamMaxRendered_).c_str()));
}
json_push_back(jsonTree_, summaryNode);
}
// Returns the json report
void ValidateIABStream::GetValidatedResultInJson(JSONNODE** oNode)
{
*oNode = jsonTree_;
}
// Check for number of issues found so far
bool ValidateIABStream::DoesNumOfIssuesExceed()
{
// if number of issues are said to be displayed restricted, after each frame validation check for number of issues
// captured so far.
if (reportAllIssues_ == false)
{
std::set<SupportedConstraintsSet>::iterator iterCS;
for (iterCS = validationConstraintSets_.begin(); iterCS != validationConstraintSets_.end(); iterCS++)
{
std::vector<ValidationIssue> validationIssues;
std::vector<ValidationIssue>::iterator iterIssues;
validationIssues = iabValidator_->GetValidationIssues(*iterCS);
if (validationIssues.size() >= numIssuesToReport_)
{
return true;
}
}
}
return false;
}
// ValidateIABStream::WriteValidationReport() implementation
void ValidateIABStream::GenerateValidationReport(ReportLevel iReportLevel)
{
// No parser error.
if (status_code_ != kIABValidatorParsingIABFrameFromBitStreamFailed)
{
// Report Summary
ReportBitstreamSummary();
LOG_OUT("Validation result:\n\n");
JSONNODE * validationResultsInJson = json_new(JSON_ARRAY);
json_set_name(validationResultsInJson, "ValidationResult");
validationResultSummaryInJson_ = json_new(JSON_ARRAY);
json_set_name(validationResultSummaryInJson_, "ValidationResultSummary");
validationIssuesSummaryInJson_ = json_new(JSON_ARRAY);
json_set_name(validationIssuesSummaryInJson_, "IssueOccurrenceSummary");
// Generate report for each constraint set specified in validation settings
std::set<SupportedConstraintsSet>::iterator iterCS;
for (iterCS = validationConstraintSets_.begin(); iterCS != validationConstraintSets_.end(); iterCS++)
{
JSONNODE * validationResultInJson = json_new(JSON_NODE);
WriteReportForConstrainSet(*iterCS, validationResultInJson, validationResultSummaryInJson_);
json_push_back(validationResultsInJson, validationResultInJson);
// Get the constriant set string for reporting
std::string constraintString;
constraintString = GetConstraintSetString(*iterCS);
AddErrorSummaryToReport(*iterCS, validationIssuesSummaryInJson_);
}
if (hasValidationIssues_)
{
LOG_OUT( "\nNote that due to the validation constraint hierrarchy design, issues from the base set(s) will be reported\n");
LOG_OUT( "before the requested constraint set. For example since ST-429-18-2019 is a super set of ST-2098-2, a bitstream\n");
LOG_OUT( "item could be reported as a warning issue for ST-2098-2 and additionally reported as an error issue for ST-429-18-2019.\n\n");
}
json_push_back(jsonTree_, validationResultSummaryInJson_);
json_push_back(jsonTree_, validationIssuesSummaryInJson_);
if (kIABValidatorReportFull == iReportLevel)
{
json_push_back(jsonTree_, validationResultsInJson);
}
}
else
{
json_push_back(jsonTree_, parserResultInJson_);
}
}
// WriteReportForConstrainSet functionality summary
// 1. Gets the issueList for the constraintSet
// 2. Generates the issues summary in Json structure (i.e indicates the valid, invalid or warning)
// 3. Generates Issue summary Linked list (Group the errors and warnings together for constraint set
// 4. Stores the issue in the JSON structure.
// ValidateIABStream::WriteReportForConstrainSet() implementation
bool ValidateIABStream::WriteReportForConstrainSet(SupportedConstraintsSet iValidationConstraintSet, JSONNODE* validationResultInJson, JSONNODE* iSummaryNode)
{
std::string constraintString;
ValidationResult validationResult;
// Get the constriant set string for reporting
constraintString = GetConstraintSetString(iValidationConstraintSet);
// Get validation result
validationResult = iabValidator_->GetValidationResult(iValidationConstraintSet);
json_push_back(validationResultInJson, json_new_a("Constraint", constraintString.c_str()));
JSONNODE * validationResultSummary = json_new(JSON_NODE);
json_push_back(validationResultSummary, json_new_a("Constraint", constraintString.c_str()));
// 1. Gets the issueList for the constraintSet
// combined issues list is needed to find out the origin of the issue.
std::vector<ValidationIssue> combinedIssuesList = iabValidator_->GetValidationIssues(iValidationConstraintSet);
std::string issueOrigin = "";
if (combinedIssuesList.size())
{
std::vector<ValidationIssue>::iterator iter = combinedIssuesList.begin();
issueOrigin = GetConstraintSetString(iter->isBeingValidated_);
}
std::vector<ValidationIssue> validationIssues;
std::vector<ValidationIssue>::iterator iterIssues;
// Get only constraint set interested in. For all constraints validaiton (-cA), we dont want to report the errors repeatedly.
// For single constraint validation, we shall report all errors in the hierarchy.
if (validationConstraintSets_.size() > 1)
{
validationIssues = iabValidator_->GetValidationIssuesSingleSetOnly(iValidationConstraintSet);
}
else
{
validationIssues = combinedIssuesList;
}
// 2. Generates the issues summary in Json structure (i.e indicates the valid, invalid or warning)
// 3. Generates Issue summary Linked list (Group the errors and warnings together for constraint set
if (validationResult == kValid)
{
json_push_back(validationResultInJson, json_new_a("ValidationState", "Valid"));
json_push_back(validationResultSummary, json_new_a("ValidationState", "Valid"));
// Bitstream is valid against this constraint set, no additional information to report
LOG_OUT( "Input stream complies with " + constraintString +"\n\n");
json_push_back(validationResultSummary, json_new_i("NumIssues", combinedIssuesList.size()));
}
else
{
std::string issueType = "";
if (validationResult == kValidWithWarning)
{
issueType = "ValidWithWarning";
LOG_OUT( "Input stream complies with " + constraintString + " but with warnings, see additional information below:\n" );
}
else
{
hasInvalidSets_ = true;
issueType = "Invalid";
LOG_OUT( "Input stream does not comply with " + constraintString + ", see additional information below:\n");
}
json_push_back(validationResultInJson, json_new_a("ValidationState", issueType.c_str())); // added to validation results
// added to summary
json_push_back(validationResultSummary, json_new_a("ValidationState", issueType.c_str()));
json_push_back(validationResultSummary, json_new_a("IssueRootConstraintSet", issueOrigin.c_str()));
// The below logic is for classifying the NumIssues for each constraint set.
if (iValidationConstraintSet == kConstraints_set_Cinema_ST2098_2_2018)
{
json_push_back(validationResultSummary, json_new_i("NumIssues", validationIssues.size()));
}
else if (iValidationConstraintSet == kConstraints_set_Cinema_ST429_18_2019)
{
std::string classification = "";
const std::vector<ValidationIssue> set_1 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_Cinema_ST2098_2_2018);
const std::vector<ValidationIssue> set_2 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_Cinema_ST429_18_2019);
if (set_1.size())
{
classification = "ST2098-2-2018(" + intToString(set_1.size()) + ") + ";
}
if (classification.length())
{
classification += "ST429-18-2019(" + intToString(set_2.size()) + ")";
classification = intToString(combinedIssuesList.size()) + " (= " + classification + ")";
json_push_back(validationResultSummary, json_new_a("NumIssues", classification.c_str()));
}
else
{
json_push_back(validationResultSummary, json_new_i("NumIssues", set_2.size()));
}
}
else if (iValidationConstraintSet == kConstraints_set_DbyCinema)
{
std::string classification = "";
const std::vector<ValidationIssue> set_1 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_Cinema_ST2098_2_2018);
const std::vector<ValidationIssue> set_2 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_Cinema_ST429_18_2019);
const std::vector<ValidationIssue> set_3 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_DbyCinema);
if (set_1.size())
{
classification = "ST2098-2-2018(" + intToString(set_1.size()) + ") + ";
}
if (set_2.size())
{
classification += "ST429-18-2019(" + intToString(set_2.size()) + ") + ";
}
if (classification.length())
{
classification += "DbyCinema(" + intToString(set_3.size()) + ")";
classification = intToString(combinedIssuesList.size()) + " (= " + classification + ")";
json_push_back(validationResultSummary, json_new_a("NumIssues", classification.c_str()));
}
else
{
json_push_back(validationResultSummary, json_new_i("NumIssues", set_3.size()));
}
}
/// IMF Constraint sets
// The following logic will group together errors and warnings depending upon the constraint set.
if (iValidationConstraintSet == kConstraints_set_IMF_ST2098_2_2019)
{
json_push_back(validationResultSummary, json_new_i("NumIssues", validationIssues.size()));
}
else if (iValidationConstraintSet == kConstraints_set_IMF_ST2067_201_2019)
{
std::string classification = "";
const std::vector<ValidationIssue> set_1 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_IMF_ST2098_2_2019);
const std::vector<ValidationIssue> set_2 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_IMF_ST2067_201_2019);
if (set_1.size())
{
classification = "IMF ST2098-2-2019(" + intToString(set_1.size()) + ") + ";
}
if (classification.length())
{
classification += "IMF ST2067-201-2019(" + intToString(set_2.size()) + ")";
classification = intToString(combinedIssuesList.size()) + " (= " + classification + ")";
json_push_back(validationResultSummary, json_new_a("NumIssues", classification.c_str()));
}
else
{
json_push_back(validationResultSummary, json_new_i("NumIssues", set_2.size()));
}
}
else if (iValidationConstraintSet == kConstraints_set_DbyIMF)
{
std::string classification = "";
const std::vector<ValidationIssue> set_1 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_IMF_ST2098_2_2019);
const std::vector<ValidationIssue> set_2 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_IMF_ST2067_201_2019);
const std::vector<ValidationIssue> set_3 = iabValidator_->GetValidationIssuesSingleSetOnly(kConstraints_set_DbyIMF);
if (set_1.size())
{
classification = "IMF ST2098-2-2019(" + intToString(set_1.size()) + ") + ";
}
if (set_2.size())
{
classification += "IMF ST2067-201-2019(" + intToString(set_2.size()) + ") + ";
}
if (classification.length())
{
classification += "DbyIMF(" + intToString(set_3.size()) + ")";
classification = intToString(combinedIssuesList.size()) + " (= " + classification + ")";
json_push_back(validationResultSummary, json_new_a("NumIssues", classification.c_str()));
}
else
{
json_push_back(validationResultSummary, json_new_i("NumIssues", set_3.size()));
}
}
// 4. Stores the issues in the JSON structure.
SupportedConstraintsSet lastReportingConstraintSet = iValidationConstraintSet;
std::string errorString;
if (validationIssues.size() > 0)
{
hasValidationIssues_ = true;
json_push_back(validationResultInJson, json_new_i("IssuesReported", validationIssues.size()));
JSONNODE * IssuesJson = json_new(JSON_ARRAY);
json_set_name(IssuesJson, "ReportedIssues");
for (iterIssues = validationIssues.begin(); iterIssues != validationIssues.end(); iterIssues++)
{
JSONNODE * IssueJson = json_new(JSON_NODE);
json_push_back(IssueJson, json_new_i("IssueNum", iterIssues - validationIssues.begin()+1));
// Check the reporting constraint set and display once per group
if ((iterIssues == validationIssues.begin()) || (lastReportingConstraintSet != iterIssues->isBeingValidated_))
{
lastReportingConstraintSet = iterIssues->isBeingValidated_;
constraintString = GetConstraintSetString(lastReportingConstraintSet);
LOG_ERR("\n\tIssues found when validating against " + constraintString + ":\n" );
}
switch(iterIssues->event_)
{
case ErrorEvent:
LOG_ERR( "\t\t- Error event found at frame #" + intToString(iterIssues->frameIndex_) + ", ID=" + intToString(iterIssues->id_));
if (kIABNoError != iterIssues->errorCode_)
{
LOG_ERR( ", ErrorCode=" + intToString(iterIssues->errorCode_) + GetValidationErrorString(iterIssues->errorCode_) +"\n");
json_push_back(IssueJson, json_new_a("EventType", "Error"));
}
else
{
LOG_OUT("\n");
}
break;
case WarningEvent:
LOG_ERR( "\t\t- Warning event found at frame #" + intToString(iterIssues->frameIndex_) + ", ID=" + intToString(iterIssues->id_));
if (kIABNoError != iterIssues->errorCode_)
{
LOG_ERR( ", ErrorCode=" + intToString(iterIssues->errorCode_) + GetValidationErrorString(iterIssues->errorCode_) + "\n");
json_push_back(IssueJson, json_new_a("EventType", "Warning"));
}
else
{
LOG_OUT("\n");
}
break;
default:
break;
}
json_push_back(IssueJson, json_new_i("FrameIndex", iterIssues->frameIndex_));
json_push_back(IssueJson, json_new_a("MetaID", GetIssueIDString(iterIssues->id_).c_str()));
json_push_back(IssueJson, json_new_a("ErrorText", GetValidationErrorString(iterIssues->errorCode_).c_str()));
json_push_back(IssueJson, json_new_a("Constraint", GetConstraintSetString(iterIssues->isBeingValidated_).c_str()));
AddEventToList(lastReportingConstraintSet, iterIssues->event_, iterIssues->errorCode_);
json_push_back(IssuesJson, IssueJson);
}
json_push_back(validationResultInJson, IssuesJson);
LOG_OUT("\n");
}
}
json_push_back(iSummaryNode, validationResultSummary);
return true;
}
// ValidateIABStream::GetIssueIDString() implementation
std::string ValidateIABStream::GetIssueIDString(int32_t issueId)
{
switch(issueId)
{
case kIssueID_IAFrame:
return "IABFrame";
case kIssueID_AuthoringToolInfo:
return "AuthoringTool Info";
case kIssueID_UserData:
return "UserData";
case kIssueID_ObjectZoneDefinition19:
return "ObjectZoneDefinition19";
default:
return intToString(issueId);
}
}
// ValidateIABStream::GetConstraintSetString() implementation
std::string ValidateIABStream::GetConstraintSetString(SupportedConstraintsSet iValidationConstraintSet)
{
switch(iValidationConstraintSet)
{
case kConstraints_set_Cinema_ST2098_2_2018:
return "Cinema 2098-2-2018 constraint";
case kConstraints_set_Cinema_ST429_18_2019:
return "Cinema ST429-18-2019 constraint";
case kConstraints_set_DbyCinema:
return "DbyCinema constraint";
case kConstraints_set_IMF_ST2098_2_2019:
return "IMF ST2098-2-2019 constraint";
case kConstraints_set_IMF_ST2067_201_2019:
return "IMF ST2067-201-2019 constraint";
case kConstraints_set_DbyIMF:
return "DbyIMF constraint";
default:
return "";
}
}
// ValidateIABStream::GetSampleRateString() implementation
std::string ValidateIABStream::GetSampleRateString(IABSampleRateType iSampleRateCode)
{
if (iSampleRateCode == kIABSampleRate_48000Hz)
{
return "48kHz";
}
else if (iSampleRateCode == kIABSampleRate_96000Hz)
{
return "96kHz";
}
else
{
return "unknown";
}
}
// ValidateIABStream::GetFrameRateString() implementation
std::string ValidateIABStream::GetFrameRateString(IABFrameRateType iFrameRateCode)
{
switch(iFrameRateCode)
{
case kIABFrameRate_24FPS:
return "24 fps";
case kIABFrameRate_25FPS:
return "25 fps";
case kIABFrameRate_30FPS:
return "30 fps";
case kIABFrameRate_48FPS:
return "48 fps";
case kIABFrameRate_50FPS:
return "50 fps";
case kIABFrameRate_60FPS:
return "60 fps";
case kIABFrameRate_96FPS:
return "96 fps";
case kIABFrameRate_100FPS:
return "100 fps";
case kIABFrameRate_120FPS:
return "120 fps";
case kIABFrameRate_23_976FPS:
return "23.976 fps";
default:
return "unknown";
}
}
// ValidateIABStream::GetBitDepthString() implementation
std::string ValidateIABStream::GetBitDepthString(IABBitDepthType iBitDepthCode)
{
if (iBitDepthCode == kIABBitDepth_24Bit)
{
return "24-bit";
}
else if (iBitDepthCode == kIABBitDepth_16Bit)
{
return "16-bit";
}
else
{
return "unknown";
}
}
// ValidateIABStream::GetValidationErrorString() implementation
std::string ValidateIABStream::GetParserErrorString(iabError iErrorCode)
{
std::string errorString = "!Parsing terminated: ";
// Not expecting any non-validation error code but just for completeness
if (iErrorCode < kValidateGeneralError)
{
switch (iErrorCode)
{
case kIABParserInvalidVersionNumberError:
errorString += "Invalid IAB Version number";
break;
case kIABParserInvalidSampleRateError:
errorString += "Invalid IAB Sample Rate";
break;
case kIABParserInvalidFrameRateError:
errorString += "Invalid IAB Frame Rate";
break;
case kIABParserInvalidBitDepthError:
errorString += "Invalid IAB Bit Depth";
break;
case kIABParserMissingPreambleError:
errorString += "IAB Preamble sub-frame is missing from bitstream";
break;
default:
errorString += "Input stream contains possible data corruption. Unable to continue parsing.";
break;
}
}
return errorString;
}
// ValidateIABStream::GetValidationErrorString() implementation
std::string ValidateIABStream::GetValidationErrorString(iabError iErrorCode)
{
std::string errorString;
// Map validation error code to error string
switch (iErrorCode)
{
case kValidateGeneralError:
errorString = "General validation error";
break;
case kValidateErrorIAFrameIllegalBitstreamVersion:
errorString = "Illegal version number";
break;
case kValidateErrorIAFrameUnsupportedSampleRate:
errorString = "Unsupported sample rate";
break;
case kValidateErrorIAFrameUnsupportedBitDepth:
errorString = "Unsupported bit depth";
break;
case kValidateErrorIAFrameUnsupportedFrameRate:
errorString = "Unsupported frame rate";
break;
case kValidateErrorIAFrameMaxRenderedExceeded:
errorString = "IAFrame MaxRendered limit exceeded";
break;
case kValidateWarningIAFrameMaxRenderedNotMatchObjectNumbers:
errorString = "IAFrame MaxRendered not matching number of bed channels and objects";
break;
case kValidateErrorIAFrameSubElementCountConflict:
errorString = "Frame sub-element count in conflict with sub-element list";
break;
case kValidateErrorIAFrameBitstreamVersionNotPersistent:
errorString = "Bitstream version number not persistent";
break;
case kValidateErrorIAFrameSampleRateNotPersistent:
errorString = "Sample rate not persistent";
break;
case kValidateErrorIAFrameBitDepthNotPersistent:
errorString = "Bit depth not persistent";
break;
case kValidateErrorIAFrameFrameRateNotPersistent:
errorString = "Frame rate not persistent";
break;
case kValidateErrorIAFrameUndefinedElementType:
errorString = "Undefined element found in IABFrame";
break;
case kValidateErrorIAFrameSizeLimitExceeded:
errorString = "IABFrame size limit exceeded";
break;
case kValidateErrorBedDefinitionDuplicateMetaID:
errorString = "Duplicate BedDefinition meta ID in frame";
break;
case kValidateErrorBedDefinitionMultiActiveSubElements:
errorString = "BedDefinition has multiple active sub-elements";
break;
case kValidateErrorBedDefinitionHierarchyLevelExceeded:
errorString = "BedDefinition hierarchy level exceeded";
break;
case kValidateErrorBedDefinitionChannelCountConflict:
errorString = "BedDefinition channel count in conflict with channel list";
break;
case kValidateErrorBedDefinitionDuplicateChannelID:
errorString = "BedDefinition contains duplicate channel ID";
break;
case kValidateErrorBedDefinitionUnsupportedGainPrefix:
errorString = "BedDefinition contains unsupported gain prefix";
break;
case kValidateErrorBedDefinitionUnsupportedDecorPrefix:
errorString = "BedDefinition contains unsupported decorrelation prefix";
break;
case kValidateErrorBedDefinitionAudioDescriptionTextExceeded:
errorString = "BedDefinition audio description text exceeded length limit";
break;
case kValidateErrorBedDefinitionSubElementCountConflict:
errorString = "BedDefinition sub-element count in conflict with sub-element list";
break;
case kValidateErrorBedDefinitionInvalidChannelID:
errorString = "BedDefinition contains invalid or reserved channel ID";
break;
case kValidateErrorBedDefinitionInvalidUseCase:
errorString = "BedDefinition contains invalid or reserved use case";
break;
case kValidateErrorBedDefinitionSubElementsNotAllowed:
errorString = "BedDefinition cannot have sub-element";
break;
case kValidateErrorBedDefinitionCountNotPersistent:
errorString = "BedDefinition count changes over program frames";
break;
case kValidateErrorBedDefinitionChannelCountNotPersistent:
errorString = "BedDefinition channel count changes over program frames";
break;
case kValidateErrorBedDefinitionMetaIDNotPersistent:
errorString = "BedDefinition meta ID changes over program frames";
break;
case kValidateErrorBedDefinitionChannelIDsNotPersistent:
errorString = "BedDefinition channel IDs change over program frames";
break;
case kValidateErrorBedDefinitionConditionalStateNotPersistent:
errorString = "BedDefinition conditional flag or use case changes over program frames";
break;
case kValidateErrorBedRemapDuplicateMetaID:
errorString = "Duplicate BedRemap meta ID";
break;
case kValidateErrorBedRemapSourceChannelCountNotEqualToBed:
errorString = "BedRemap source channel count not equal to parent bed";
break;
case kValidateErrorBedRemapSubblockCountConflict:
errorString = "BedRemap subblock count conflict";
break;
case kValidateErrorBedRemapSourceChannelCountConflict:
errorString = "BedRemap source channel count conflict";
break;
case kValidateErrorBedRemapDestinationChannelCountConflict:
errorString = "BedRemap destination channel count conflict";
break;
case kValidateErrorBedRemapInvalidDestChannelID:
errorString = "BedRemap contains invalid or reserved destination channel ID";
break;
case kValidateErrorBedRemapInvalidUseCase:
errorString = "BedRemap contains invalid or reserved use case";
break;
case kValidateErrorBedRemapNotAnAllowedSubElement:
errorString = "BedRemap is not an allowed sub-element";
break;
case kValidateErrorObjectDefinitionDuplicateMetaID:
errorString = "Duplicate ObjectDefinition meta ID in frame";
break;
case kValidateErrorObjectDefinitionMultiActiveSubElements:
errorString = "ObjectDefinition has multiple active sub-elements";
break;
case kValidateErrorObjectDefinitionHierarchyLevelExceeded:
errorString = "ObjectDefinition hierarchy level exceeded";
break;
case kValidateErrorObjectDefinitionPanSubblockCountConflict:
errorString = "ObjectDefinition panblock count conflict";
break;
case kValidateErrorObjectDefinitionUnsupportedGainPrefix:
errorString = "ObjectDefinition contains unsupported gain prefix";
break;
case kValidateErrorObjectDefinitionUnsupportedZoneGainPrefix:
errorString = "ObjectDefinition contains unsupported zone gain prefix";
break;
case kValidateErrorObjectDefinitionUnsupportedSpreadMode:
errorString = "ObjectDefinition contains unsupported spread mode";
break;
case kValidateErrorObjectDefinitionUnsupportedDecorPrefix:
errorString = "ObjectDefinition contains unsupported decorrelation prefix";
break;
case kValidateErrorObjectDefinitionAudioDescriptionTextExceeded:
errorString = "ObjectDefinition audio description text exceeded length limit";
break;
case kValidateErrorObjectDefinitionSubElementCountConflict:
errorString = "ObjectDefinition sub-element count in conflict with sub-element list";
break;
case kValidateErrorObjectDefinitionInvalidUseCase:
errorString = "ObjectDefinition contains invalid or reserved use case";
break;
case kValidateErrorObjectDefinitionInvalidSubElementType:
errorString = "ObjectDefinition contains invalid sub-element type";
break;
case kValidateErrorObjectDefinitionConditionalStateNotPersistent:
errorString = "ObjectDefinition conditional flag or use case changes over program frames";
break;
case kValidateErrorObjectZoneDefinition19SubblockCountConflict:
errorString = "Object zone19 subblock count conflict";
break;
case kValidateErrorObjectZoneDefinition19UnsupportedZoneGainPrefix:
errorString = "Object zone19 contains unsupported zone gain prefix";
break;
case kValidateErrorAudioDataDLCAudioDataIDZero:
errorString = "AudioDataDLC AudioDataID cannot be zero";
break;
case kValidateErrorAudioDataDLCDuplicateAudioDataID:
errorString = "Duplicate AudioDataDLC duplicate ID";
break;
case kValidateErrorAudioDataDLCUnsupportedSampleRate:
errorString = "AudioDataDLC has unsupported sample rate";
break;
case kValidateErrorAudioDataDLCSampleRateConflict:
errorString = "AudioDataDLC sample rate in conflict with frame sample rate";
break;
case kValidateErrorAudioDataDLCNotAnAllowedSubElement:
errorString = "AudioDataDLC is not allowed";
break;
case kValidateErrorAudioDataPCMAudioDataIDZero:
errorString = "AudioDataPCM AudioDataID cannot be zero";
break;
case kValidateErrorAudioDataPCMDuplicateAudioDataID:
errorString = "Duplicate AudioDataDPCM duplicate ID";
break;
case kValidateErrorAudioDataPCMNotAnAllowedSubElement:
errorString = "AudioDataPCM is not allowed";
break;
case kValidateErrorMissingAudioDataEssenceElement:
errorString = "A referenced audio essence element (DLC or PCM) is missing";
break;
case kValidateErrorUserDataNotAnAllowedSubElement:
errorString = "UserData is not allowed";
break;
case kValidateErrorDLCUsedWithIncompatibleFrameRate:
errorString = "AudioDataDLC cannot be used with the current frame rate";
break;
case kValidateErrorDolCinIAFrameUnsupportedSampleRate:
errorString = "Sample rate not valid for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionSubElementsNotAllowed:
errorString = "BedDefinition cannot have sub-element for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionInvalidChannelID:
errorString = "BedDefinition contains invalid channel ID for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionInvalidUseCase:
errorString = "BedDefinition contains invalid use case for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionMultipleBedsNotAllowed:
errorString = "Multiple BedDefinitions are not allowed for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionInvalidGainPrefix:
errorString = "BedDefinition contains invalid gain prefix for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionChannelDecorInfoExistNotZero:
errorString = "BedDefinition channel DecorInfoExist must = 0 for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionMaxChannelCountExceeded:
errorString = "BedDefinition channel count limit exceeded for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionCountNotPersistent:
errorString = "BedDefinition count must be persistent for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionMetaIDNotPersistent:
errorString = "BedDefinition meta ID must be persistent for DbyCinema";
break;
case kValidateErrorDolCinBedDefinitionChannelListNotPersistent:
errorString = "BedDefinition channel list must be persistent for DbyCinema";
break;
case kValidateErrorDolCinBedRemapUnsupportedGainPrefix:
errorString = "BedRemap contains unsupported gain prefix for DbyCinema";
break;
case kValidateErrorDolCinBedRemapNotAnAllowedSubElement:
errorString = "BedRemap is not allowed for DbyCinema";
break;
case kValidateErrorDolCinObjectDefinitionSubElementsNotAllowed:
errorString = "ObjectDefinition cannot have sub-element for DbyCinema";
break;
case kValidateErrorDolCinObjectDefinitionInvalidUseCase:
errorString = "ObjectDefinition contains invalid use case for DbyCinema";
break;
case kValidateErrorDolCinObjectDefinitionInvalidGainPrefix:
errorString = "ObjectDefinition contains invalid gain prefix for DbyCinema";
break;
case kValidateErrorDolCinObjectDefinitionInvalidZoneGainPrefix:
errorString = "ObjectDefinition contains invalid zone gain prefix for DbyCinema";
break;
case kValidateErrorDolCinObjectDefinitionInvalidSpreadMode:
errorString = "ObjectDefinition contains invalid spread mode for DbyCinema";
break;
case kValidateErrorDolCinObjectDefinitionInvalidDecorPrefix:
errorString = "ObjectDefinition contains invalid decorrelation prefix for DbyCinema";
break;
case kValidateErrorDolCinObjectDefinitionSnapTolExistsNotZero:
errorString = "ObjectDefinition SnapTolExist must = 0 for DbyCinema";
break;
case kValidateErrorDolCinObjectDefinitionMaxObjectCountExceeded:
errorString = "ObjectDefinition count limit exceeded for DbyCinema";
break;
case kValidateErrorDolCinObjectDefinitionNonSequenctialMetaID:
errorString = "ObjectDefinition meta ID must be sequential for DbyCinema";
break;
case kValidateErrorDolCinObjectZoneDefinition19NotAnAllowedSubElement:
errorString = "Object zone19 is not allowed for DbyCinema";
break;
case kValidateErrorDolCinAuthoringToolInfoNotAnAllowedSubElement:
errorString = "AuthoringToolInfo is not allowed for DbyCinema";
break;
case kValidateGeneralWarning:
errorString = "Validation general warning";
break;
case kValidateWarningFrameContainFrame:
errorString = "IABFrame contains an IABFrame as sub-element";
break;
case kValidateWarningFrameContainBedRemap:
errorString = "IABFrame contains an BedRemap as sub-element";
break;
case kValidateWarningFrameContainObjectZoneDefinition19:
errorString = "IABFrame contains an Object zone19 as sub-element";
break;
case kValidateWarningFrameContainUndefinedSubElement:
errorString = "IABFrame contains an undefined sub-element";
break;
case kValidateWarningAuthoringToolInfoMultipleElements:
errorString = "IABFrame contains multiple AuthoringToolInfo sub-elements";
break;
case kValidateWarningBedDefinitionUndefinedUseCase:
errorString = "BedDefinition contains undefined or reserved use case";
break;
case kValidateWarningBedDefinitionUndefinedChannelID:
errorString = "BedDefinition contains undefined or reserved channel ID";
break;
case kValidateWarningBedDefinitionUndefinedAudioDescription:
errorString = "BedDefinition contains undefined audio description";
break;
case kValidateWarningBedDefinitionContainUnsupportedSubElement:
errorString = "BedDefinition contains unsupported sub-element";
break;
case kValidateWarningBedDefinitionAlwaysActiveSubElement:
errorString = "BedDefinition contains unsupported sub-element";
break;
case kValidateWarningBedRemapUndefinedUseCase:
errorString = "BedRemap contains undefined or reserved use case";
break;
case kValidateWarningBedRemapUndefinedChannelID:
errorString = "BedRemap contains undefined or reserved channel ID";
break;
case kValidateWarningObjectDefinitionUndefinedUseCase:
errorString = "ObjectDefinition contains undefined or reserved use case";
break;
case kValidateWarningObjectDefinitionUndefinedAudioDescription:
errorString = "ObjectDefinition contains undefined audio description";
break;
case kValidateWarningObjectDefinitionMultipleZone19SubElements:
errorString = "ObjectDefinition contains multiple zone19 sub-elements";
break;
case kValidateWarningObjectDefinitionContainUnsupportedSubElement:
errorString = "ObjectDefinition contains unsupported sub-elements";
break;
case kValidateWarningObjectDefinitionAlwaysActiveSubElement:
errorString = "ObjectDefinition contains an always active sub-element";
break;
case kValidateWarningUnreferencedAudioDataDLCElement:
errorString = "AudioDataDLC element not referenced by any BedDefinition or ObjectDefinition";
break;
case kValidateWarningUnreferencedAudioDataPCMElement:
errorString = "AudioDataPCM element not referenced by any BedDefinition or ObjectDefinition";
break;
case kValidateErrorDolCinObjectDefinitionZoneGainsNotAPreset:
errorString = "ObjectDefinition zone gain is not a DbyCinema preset";
break;
case kValidateErrorDolIMFBedDefinitionInvalidChannelID:
errorString = "BedDefinition contains invalid channel ID for DbyIMF";
break;
case kValidateErrorDolIMFBedDefinitionInvalidGainPrefix:
errorString = "BedDefinition contains invalid gain prefix for DbyIMF";
break;
case kValidateErrorDolIMFBedDefinitionChannelDecorInfoExistNotZero:
errorString = "BedDefinition channel DecorInfoExist must = 0 for DbyIMF";
break;
case kValidateErrorDolIMFObjectDefinitionInvalidGainPrefix:
errorString = "ObjectDefinition contains invalid gain prefix for DbyIMF";
break;
case kValidateErrorDolIMFObjectDefinitionInvalidZoneGainPrefix:
errorString = "ObjectDefinition contains invalid zone gain prefix for DbyIMF";
break;
case kValidateErrorDolIMFObjectDefinitionInvalidSpreadMode:
errorString = "ObjectDefinition contains invalid spread mode for DbyIMF";
break;
case kValidateErrorDolIMFObjectDefinitionInvalidDecorPrefix:
errorString = "ObjectDefinition contains invalid decorrelation prefix for DbyIMF";
break;
case kValidateErrorDolIMFObjectDefinitionSnapTolExistsNotZero:
errorString = "ObjectDefinition SnapTolExist must = 0 for DbyIMF";
break;
case kValidateErrorDolIMFNotMeetingContinuousAudioSequence:
errorString = "Frame sub-element order not meeting continuous audio sequence for DbyIMF";
break;
case kValidateErrorDolIMFContinuousAudioSequenceNotPersistent:
errorString = "Frame sub-element continuous audio sequence not persistent for DbyIMF";
break;
case kValidateWarningDolIMFObjectDefinitionZoneGainsNotAPreset:
errorString = "ObjectDefinition zone gain is not a DbyIMF preset";
break;
default:
errorString = "Unknown err";
}
return errorString;
}
// Error code Map and List functions
// returns the item from the list
ErrorList* ValidateIABStream::FindListItem(std::string iConstraint, iabError iErrorCode, ErrorList** oLastNode)
{
ErrorList *element = error_warnings_list_;
while (element != nullptr)
{
*oLastNode = element;
if (element->node_.constraint_ == iConstraint && element->node_.errorCode_ == iErrorCode)
{
return element;
}
else
{
element = element->next_;
}
}
return element;
}
// Adds the summary to json
void ValidateIABStream::AddErrorSummaryToReport(SupportedConstraintsSet iConstraintSetId, JSONNODE* iSummaryNode)
{
ErrorList *element = error_warnings_list_;
std::string constraintName = GetConstraintSetString(iConstraintSetId);
JSONNODE * errorSummary = json_new(JSON_NODE);
json_push_back(errorSummary, json_new_a("Constraint", constraintName.c_str()));
JSONNODE * errors = json_new(JSON_NODE);
json_set_name(errors, "Errors");
JSONNODE * warnings = json_new(JSON_NODE);
json_set_name(warnings, "Warnings");
while (element != nullptr)
{
// For single constraint validation, group all the errors and warnings.
// For all constraints validation, display errors and warnings on its own constraint.
if ((element->node_.constraintId_ == iConstraintSetId) || (validationConstraintSets_.size() == 1))
{
if (element->node_.errorOccurrences_)
{
json_push_back(errors, json_new_i(GetValidationErrorString(element->node_.errorCode_).c_str(), element->node_.errorOccurrences_));
}
if (element->node_.warningOccurrences_)
{
json_push_back(warnings, json_new_i(GetValidationErrorString(element->node_.errorCode_).c_str(), element->node_.warningOccurrences_));
}
}
element = element->next_;
}
if (json_size(errors))
{
json_push_back(errorSummary, errors);
}
else
{
json_delete(errors);
json_push_back(errorSummary, json_new_i("Errors", 0));
}
if (json_size(warnings))
{
json_push_back(errorSummary, warnings);
}
else
{
json_delete(warnings);
json_push_back(errorSummary, json_new_i("Warnings", 0));
}
json_push_back(iSummaryNode, errorSummary);
}
// Increments the error code occurance.
void ValidateIABStream::AddEventToList(SupportedConstraintsSet iConstraintSetId, ValidatorEventKind iEventKind, iabError iErrorCode)
{
ErrorList *lastNode = nullptr;
std::string constraintString = GetConstraintSetString(iConstraintSetId);
ErrorList *element = FindListItem(constraintString, iErrorCode, &lastNode);
if (!element)
{
element = new ErrorList();
element->node_.constraint_ = constraintString;
element->node_.constraintId_ = iConstraintSetId;
element->node_.errorCode_ = iErrorCode;
element->next_ = nullptr;
if (error_warnings_list_ == nullptr)
{
error_warnings_list_ = element;
}
if (lastNode)
{
lastNode->next_ = element;
}
}
if (iEventKind == WarningEvent)
{
element->node_.warningOccurrences_++;
}
else if (iEventKind == ErrorEvent)
{
element->node_.errorOccurrences_++;
}
}
| 39.135018 | 158 | 0.626054 | DTSProAudio |
cfeb2bd73d4acbde2b977f44ced847f1ec2305fa | 14,039 | cpp | C++ | Libraries/RobsJuceModules/rosic/filters/rosic_MultiModeFilter.cpp | RobinSchmidt/RS-MET-Preliminary | 6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe | [
"FTL"
] | 34 | 2017-04-19T18:26:02.000Z | 2022-02-15T17:47:26.000Z | Libraries/RobsJuceModules/rosic/filters/rosic_MultiModeFilter.cpp | RobinSchmidt/RS-MET-Preliminary | 6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe | [
"FTL"
] | 307 | 2017-05-04T21:45:01.000Z | 2022-02-03T00:59:01.000Z | Libraries/RobsJuceModules/rosic/filters/rosic_MultiModeFilter.cpp | RobinSchmidt/RS-MET-Preliminary | 6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe | [
"FTL"
] | 4 | 2017-09-05T17:04:31.000Z | 2021-12-15T21:24:28.000Z | //#include "rosic_MultiModeFilter.h"
//using namespace rosic;
//-------------------------------------------------------------------------------------------------
// construction/destruction:
MultiModeFilter::MultiModeFilter()
{
parameters = new MultiModeFilterParameters;
isMaster = true;
freqWithKeyAndVel = 1000.0;
freqInstantaneous = 1000.0;
currentKey = 64.0;
currentVel = 64.0;
//glideMode = false;
//glideTime = 0.1;
resetBuffers();
//mode = MultiModeFilterParameters::BYPASS
//twoStageBiquad.setMode(FourPoleFilter::LOWPASS_RBJ);
//twoStageBiquad.setMode(FourPoleFilter::MORPH_LP_RES_HP);
//setMode(MultiModeFilterParameters::BYPASS);
//calculateCoefficients();
//markPresetAsClean();
}
MultiModeFilter::~MultiModeFilter()
{
if( isMaster && parameters != NULL )
delete parameters;
}
//-------------------------------------------------------------------------------------------------
// parameter settings:
void MultiModeFilter::setSampleRate(double newSampleRate)
{
ladderFilter.setSampleRate(newSampleRate);
twoStageBiquad.setSampleRate(newSampleRate);
}
void MultiModeFilter::setMode(int newMode)
{
if( newMode >= MultiModeFilterParameters::BYPASS
&& newMode < MultiModeFilterParameters::NUM_FILTER_MODES )
{
parameters->mode = newMode;
if( parameters->mode == MultiModeFilterParameters::BYPASS )
parameters->filterClass = MultiModeFilterParameters::NO_FILTER;
else if( parameters->mode == MultiModeFilterParameters::MOOGISH_LOWPASS )
parameters->filterClass = MultiModeFilterParameters::LADDER_FILTER;
else
{
parameters->filterClass = MultiModeFilterParameters::TWO_STAGE_BIQUAD;
switch( parameters->mode )
{
case MultiModeFilterParameters::LOWPASS_6:
twoStageBiquad.setMode(FourPoleFilterParameters::LOWPASS_6);
break;
case MultiModeFilterParameters::LOWPASS_RBJ:
twoStageBiquad.setMode(FourPoleFilterParameters::LOWPASS_12);
break;
case MultiModeFilterParameters::HIGHPASS_6:
twoStageBiquad.setMode(FourPoleFilterParameters::HIGHPASS_6);
break;
case MultiModeFilterParameters::HIGHPASS_RBJ:
twoStageBiquad.setMode(FourPoleFilterParameters::HIGHPASS_12);
break;
case MultiModeFilterParameters::BANDPASS_RBJ:
twoStageBiquad.setMode(FourPoleFilterParameters::BANDPASS_RBJ);
break;
case MultiModeFilterParameters::BANDREJECT_RBJ:
twoStageBiquad.setMode(FourPoleFilterParameters::BANDREJECT_RBJ);
break;
case MultiModeFilterParameters::PEAK_OR_DIP_RBJ:
twoStageBiquad.setMode(FourPoleFilterParameters::PEAK_OR_DIP_RBJ );
break;
case MultiModeFilterParameters::LOW_SHELV_1ST:
twoStageBiquad.setMode(FourPoleFilterParameters::LOW_SHELV_1ST );
break;
case MultiModeFilterParameters::LOW_SHELV_RBJ:
twoStageBiquad.setMode(FourPoleFilterParameters::LOW_SHELV_RBJ );
break;
case MultiModeFilterParameters::HIGH_SHELV_1ST:
twoStageBiquad.setMode(FourPoleFilterParameters::HIGH_SHELV_1ST );
break;
case MultiModeFilterParameters::HIGH_SHELV_RBJ:
twoStageBiquad.setMode(FourPoleFilterParameters::HIGH_SHELV_RBJ );
break;
case MultiModeFilterParameters::ALLPASS_1ST:
twoStageBiquad.setMode(FourPoleFilterParameters::ALLPASS_1ST );
break;
case MultiModeFilterParameters::ALLPASS_RBJ:
twoStageBiquad.setMode(FourPoleFilterParameters::ALLPASS_RBJ );
break;
case MultiModeFilterParameters::MORPH_LP_BP_HP:
twoStageBiquad.setMode(FourPoleFilterParameters::MORPH_LP_BP_HP);
break;
case MultiModeFilterParameters::MORPH_LP_PK_HP:
twoStageBiquad.setMode(FourPoleFilterParameters::MORPH_LP_PK_HP);
break;
}
}
calculateCoefficients();
for(unsigned int s = 0; s < slaves.size(); s++)
slaves[s]->setMode(newMode);
//markPresetAsDirty();
}
else
DEBUG_BREAK; // invalid filter mode index
}
void MultiModeFilter::setFrequencyNominal(double newFrequency)
{
parameters->freqNominal = newFrequency;
updateFreqWithKeyAndVel();
if( isMaster == true )
{
setFrequencyInstantaneous(newFrequency, true);
for(unsigned int s = 0; s < slaves.size(); s++)
slaves[s]->updateFreqWithKeyAndVel();
}
//markPresetAsDirty();
/*
if( updateCoefficients == true )
{
calculateCoefficients();
for(int s=0; s<slaves.size(); s++)
slaves[s]->calculateCoefficients();
}
*/
}
void MultiModeFilter::setFrequencyByKey(double newFrequencyByKey)
{
parameters->freqByKey = newFrequencyByKey;
updateFreqWithKeyAndVel();
for(unsigned int s = 0; s < slaves.size(); s++)
slaves[s]->updateFreqWithKeyAndVel();
//markPresetAsDirty();
}
void MultiModeFilter::setFrequencyByVel(double newFrequencyByVel)
{
parameters->freqByVel = newFrequencyByVel;
updateFreqWithKeyAndVel();
for(unsigned int s = 0; s < slaves.size(); s++)
slaves[s]->updateFreqWithKeyAndVel();
//markPresetAsDirty();
}
void MultiModeFilter::setKey(double newKey)
{
currentKey = newKey;
updateFreqWithKeyAndVel();
for(unsigned int s = 0; s < slaves.size(); s++)
slaves[s]->updateFreqWithKeyAndVel();
}
void MultiModeFilter::setKeyAndVel(double newKey, double newVel)
{
currentKey = newKey;
currentVel = newVel;
updateFreqWithKeyAndVel();
for(unsigned int s = 0; s < slaves.size(); s++)
slaves[s]->updateFreqWithKeyAndVel();
}
void MultiModeFilter::setResonance(double newResonance, bool updateCoefficients)
{
parameters->resonance = newResonance;
ladderFilter.setResonance(0.01*parameters->resonance, updateCoefficients);
/*
twoStageBiquad.setResonance(0.01*parameters->resonance);
if( updateCoefficients == true )
twoStageBiquad.updateFilterCoefficients();
*/
//markPresetAsDirty();
}
void MultiModeFilter::setQ(double newQ, bool updateCoefficients)
{
twoStageBiquad.setQ(newQ);
if( updateCoefficients == true )
twoStageBiquad.updateFilterCoefficients();
//markPresetAsDirty();
}
void MultiModeFilter::setGain(double newGain)
{
twoStageBiquad.setGain(newGain);
//markPresetAsDirty();
}
void MultiModeFilter::setDrive(double newDrive)
{
ladderFilter.setDrive(newDrive);
//twoStageBiquad.setDrive(newDrive);
//markPresetAsDirty();
}
void MultiModeFilter::setOrder(int newOrder)
{
parameters->order = newOrder;
//twoStageBiquad.setOrder(newOrder);
ladderFilter.setOutputStage(newOrder);
//markPresetAsDirty();
}
void MultiModeFilter::useTwoStages(bool shouldUseTwoStages)
{
twoStageBiquad.useTwoStages(shouldUseTwoStages);
//markPresetAsDirty();
}
void MultiModeFilter::setAllpassFreq(double newAllpassFreq)
{
ladderFilter.setAllpassFreq(newAllpassFreq);
//markPresetAsDirty();
}
void MultiModeFilter::setMakeUp(double newMakeUp)
{
ladderFilter.setMakeUp(newMakeUp, true);
//markPresetAsDirty();
}
//-------------------------------------------------------------------------------------------------
// inquiry:
Complex MultiModeFilter::getTransferFunctionAt(Complex z)
{
///< \todo switch or ifs
return ladderFilter.getTransferFunctionAt(z, true, true, true, ladderFilter.getOutputStage());
}
double MultiModeFilter::getMagnitudeAt(double frequency)
{
switch( parameters->filterClass )
{
case MultiModeFilterParameters::LADDER_FILTER:
return ladderFilter.getMagnitudeAt(frequency, true, true, true, ladderFilter.getOutputStage());
case MultiModeFilterParameters::TWO_STAGE_BIQUAD:
return twoStageBiquad.getMagnitudeAt(frequency);
default:
return 1.0;
}
/*
if( parameters->mode == BYPASS )
return 1.0;
else if( parameters->mode == MOOGISH_LOWPASS )
return ladderFilter.getMagnitudeAt(frequency, true, true, true, ladderFilter.getOutputStage());
else
return twoStageBiquad.getMagnitudeAt(frequency);
*/
}
void MultiModeFilter::getMagnitudeResponse(double *frequencies, double *magnitudes, int numBins,
bool inDecibels, bool accumulate)
{
if( parameters->filterClass == MultiModeFilterParameters::NO_FILTER )
{
// fill magnitude-array with bypass-rspeonse:
int k;
if( accumulate == false && inDecibels == true )
{
for(k=0; k<numBins; k++)
magnitudes[k] = 0.0;
}
else if( accumulate == false && inDecibels == false )
{
for(k=0; k<numBins; k++)
magnitudes[k] = 1.0;
}
return;
}
/*
else if( parameters->mode == MOOGISH_LOWPASS )
ladderFilter.getMagnitudeResponse(frequencies, magnitudes, numBins, inDecibels, accumulate);
else
twoStageBiquad.getMagnitudeResponse(frequencies, magnitudes, numBins, inDecibels, accumulate);
*/
switch( parameters->filterClass )
{
case MultiModeFilterParameters::LADDER_FILTER:
ladderFilter.getMagnitudeResponse(frequencies, magnitudes, numBins, inDecibels, accumulate);
break;
case MultiModeFilterParameters::TWO_STAGE_BIQUAD:
twoStageBiquad.getMagnitudeResponse(frequencies, magnitudes, numBins, inDecibels, accumulate);
break;
}
}
int MultiModeFilter::getMode()
{
return parameters->mode;
}
double MultiModeFilter::getFrequencyNominal()
{
return parameters->freqNominal;
}
double MultiModeFilter::getFrequencyByKey()
{
return parameters->freqByKey;
}
double MultiModeFilter::getFrequencyByVel()
{
return parameters->freqByVel;
}
double MultiModeFilter::getFrequencyWithKeyAndVel()
{
return freqWithKeyAndVel;
}
double MultiModeFilter::getResonance()
{
return parameters->resonance;
}
double MultiModeFilter::getQ()
{
return twoStageBiquad.getQ();;
}
double MultiModeFilter::getGain()
{
return twoStageBiquad.getGain();
}
double MultiModeFilter::getDrive()
{
return ladderFilter.getDrive();
}
int MultiModeFilter::getOrder()
{
return parameters->order;
}
bool MultiModeFilter::usesTwoStages()
{
return twoStageBiquad.usesTwoStages();
}
double MultiModeFilter::getMorph()
{
return twoStageBiquad.getMorph();
}
double MultiModeFilter::getAllpassFreq()
{
return ladderFilter.getAllpassFreq();
}
double MultiModeFilter::getMakeUp()
{
return ladderFilter.getMakeUp();
}
bool MultiModeFilter::currentModeSupportsQ()
{
if( parameters->mode == MultiModeFilterParameters::LOWPASS_RBJ
|| parameters->mode == MultiModeFilterParameters::HIGHPASS_RBJ
|| parameters->mode == MultiModeFilterParameters::BANDPASS_RBJ
|| parameters->mode == MultiModeFilterParameters::BANDREJECT_RBJ
|| parameters->mode == MultiModeFilterParameters::ALLPASS_RBJ
|| parameters->mode == MultiModeFilterParameters::PEAK_OR_DIP_RBJ
|| parameters->mode == MultiModeFilterParameters::LOW_SHELV_RBJ
|| parameters->mode == MultiModeFilterParameters::HIGH_SHELV_RBJ
|| parameters->mode == MultiModeFilterParameters::MORPH_LP_PK_HP )
{
return true;
}
else
return false;
}
bool MultiModeFilter::currentModeSupportsGain()
{
if( parameters->mode == MultiModeFilterParameters::PEAK_OR_DIP_RBJ
|| parameters->mode == MultiModeFilterParameters::LOW_SHELV_1ST
|| parameters->mode == MultiModeFilterParameters::LOW_SHELV_RBJ
|| parameters->mode == MultiModeFilterParameters::HIGH_SHELV_1ST
|| parameters->mode == MultiModeFilterParameters::HIGH_SHELV_RBJ )
{
return true;
}
else
return false;
}
bool MultiModeFilter::currentModeSupportsTwoStages()
{
if( parameters->filterClass == MultiModeFilterParameters::TWO_STAGE_BIQUAD )
return true;
else
return false;
/*
if( parameters->mode == MultiModeFilterParameters::LOWPASS_6
|| parameters->mode == MultiModeFilterParameters::LOWPASS_RBJ
|| parameters->mode == MultiModeFilterParameters::HIGHPASS_6
|| parameters->mode == MultiModeFilterParameters::HIGHPASS_RBJ
|| parameters->mode == MultiModeFilterParameters::BANDPASS_RBJ
|| parameters->mode == MultiModeFilterParameters::BANDREJECT_RBJ
|| parameters->mode == MultiModeFilterParameters::ALLPASS_1ST
|| parameters->mode == MultiModeFilterParameters::ALLPASS_RBJ
|| parameters->mode == MultiModeFilterParameters::MORPH_LP_PK_HP )
{
return true;
}
else
return false;
*/
}
//-------------------------------------------------------------------------------------------------
// master/slave config:
void MultiModeFilter::addSlave(MultiModeFilter* newSlave)
{
// add the new slave to the vector of slaves:
slaves.push_back(newSlave);
// delete the original parameter-set of the new slave and redirect it to ours (with some safety
// checks):
if( newSlave->parameters != NULL && newSlave->parameters != this->parameters )
{
delete newSlave->parameters;
newSlave->parameters = this->parameters;
}
else
{
DEBUG_BREAK;
// the object to be added as slave did not contain a valid parameter-pointer - maybe it has
// been already added as slave to another master?
}
// add the embedded filters in the newSlave as slaves to the respective embedded filter here in
// this instance:
ladderFilter.addSlave( &(newSlave->ladderFilter) );
twoStageBiquad.addSlave( &(newSlave->twoStageBiquad) );
// set the isMaster-flag of the new slave to false:
newSlave->isMaster = false;
// this flag will prevent the destructor of the slave from trying to delete the parameter-set
// which is now shared - only masters delete their parameter-set on destruction
}
//-------------------------------------------------------------------------------------------------
// others:
void MultiModeFilter::updateFreqWithKeyAndVel()
{
freqWithKeyAndVel = parameters->freqNominal;
freqWithKeyAndVel *= pow(2.0, (0.01*parameters->freqByKey/12.0) * (currentKey-64.0) );
freqWithKeyAndVel *= pow(2.0, (0.01*parameters->freqByVel/63.0) * (currentVel-64.0) );
}
void MultiModeFilter::resetBuffers()
{
ladderFilter.reset();
twoStageBiquad.reset();
} | 29.247917 | 99 | 0.697557 | RobinSchmidt |
cfed7ff24ed2cca2f5564f91eadf82b54ff46306 | 3,577 | cpp | C++ | Classes/Scenes/LogoScene.cpp | irfanf/Galvighas3D | b180b18f840efbeac9c5b84b9901f30d7889e123 | [
"MIT"
] | null | null | null | Classes/Scenes/LogoScene.cpp | irfanf/Galvighas3D | b180b18f840efbeac9c5b84b9901f30d7889e123 | [
"MIT"
] | null | null | null | Classes/Scenes/LogoScene.cpp | irfanf/Galvighas3D | b180b18f840efbeac9c5b84b9901f30d7889e123 | [
"MIT"
] | null | null | null | //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//!
//! IRFAN FAHMI RAMADHAN
//!
//! 2016/5/24
//!
//! LogoScene.cpp
//!
//! Copyright ©2016 IrGame All Right Reserved
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//---------------------------------------------------------------------
#include "LogoScene.h"
#include "ui/CocosGUI.h"
#include "TitleScene.h"
//---------------------------------------------------------------------
USING_NS_CC;
//---------------------------------------------------------------------
//------------------------------------
//@! クラス作成
//------------------------------------
Scene* LogoScene::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = LogoScene::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
//------------------------------------
//@! クラスの初期化
//------------------------------------
bool LogoScene::init()
{
//////////////////////////////
// 1. super init first
if (!Layer::init())
{
return false;
}
//タッチしたら移動
auto listener = EventListenerTouchOneByOne::create();
listener->onTouchBegan = CC_CALLBACK_2(LogoScene::onTouchBegan, this);
this->getEventDispatcher()->addEventListenerWithSceneGraphPriority(listener, this);
Size visibleSize = Director::getInstance()->getVisibleSize();
//-----------------------------------------------------------------
//ロゴを出す
auto logo_bg = Sprite::create("Logo/Logo_bg.png");
logo_bg->setPosition(Vec2(visibleSize.width / 2, visibleSize.height / 2));
logo_bg->setScale(0.0001);
this->addChild(logo_bg);
//ロゴ名を出す
auto logo_tag = Sprite::create("Logo/Logo_name.png");
logo_tag->setPosition(Vec2(-1000.0f, visibleSize.width / 2));
this->addChild(logo_tag);
//ロゴのパーティクル
CCParticleSystemQuad* logo_particle = CCParticleSystemQuad::create("Logo/particleLogo2.plist");
logo_particle->resetSystem();
logo_particle->setPosition(Vec2(visibleSize.width / 2, visibleSize.height / 2));
logo_particle->setScale(1.5);
this->addChild(logo_particle);
//ロゴのアクション
DelayTime* delay = DelayTime::create(1.5f);
RotateBy* rot = RotateBy::create(1.5f, 360);
ScaleTo* scale = ScaleTo::create(1.0f,1);
Spawn* spawn = Spawn::create(rot, scale, nullptr);
Sequence* seq = Sequence::create(delay, spawn, nullptr);
logo_bg->runAction(seq);
//ロゴ名のアクション
MoveTo* move = MoveTo::create(2.0f, Vec2(visibleSize.width / 2, visibleSize.height / 2));
Sequence* seq2 = Sequence::create(delay, move, nullptr);
logo_tag->runAction(seq2);
//-----------------------------------------------------------------
//シーン生成されてから4秒後に"ChangeScene"が呼ばれる
this->scheduleOnce(schedule_selector(LogoScene::changeScene), 5.0f);
//-----------------------------------------------------------------
return true;
}
//------------------------------------
//@! 時間たったら,シーン移動する
//@! 時間
//------------------------------------
void LogoScene::changeScene(float dt)
{
//移動先シーンの作成
auto scene = TitleScene::createScene();
scene = TitleScene::createScene();
auto transition = TransitionFade::create(3.0f, scene);
Director::getInstance()->replaceScene(transition);
}
//------------------------------------
//@! 時間たったら,シーン移動する
//@! 時間
//------------------------------------
bool LogoScene::onTouchBegan(Touch* touch, Event* unused_event)
{
//移動先シーンの作成
auto scene = TitleScene::createScene();
auto transition = TransitionFade::create(1.0f, scene);
Director::getInstance()->replaceScene(transition);
this->unscheduleAllSelectors();
return false;
}
| 27.945313 | 96 | 0.55745 | irfanf |
cff5ef77e14bec558baaf5c6901fa4a20001e9ef | 785 | hpp | C++ | server/memory_resource_manager.hpp | photonmaster/scymnus | bcbf580091a730c63e15b67b6331705a281ba20b | [
"MIT"
] | 7 | 2021-08-19T01:11:21.000Z | 2021-08-31T15:25:51.000Z | server/memory_resource_manager.hpp | photonmaster/scymnus | bcbf580091a730c63e15b67b6331705a281ba20b | [
"MIT"
] | null | null | null | server/memory_resource_manager.hpp | photonmaster/scymnus | bcbf580091a730c63e15b67b6331705a281ba20b | [
"MIT"
] | null | null | null | #pragma once
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <iostream>
#include <list>
#include <memory_resource>
#include <thread>
namespace scymnus {
class memory_resource_manager {
public:
static memory_resource_manager &instance() {
thread_local memory_resource_manager manager;
return manager;
}
auto pool() {
// return std::pmr::new_delete_resource();
return &pool_;
}
private:
std::pmr::unsynchronized_pool_resource
pool_{}; //{std::data(buffer_), std::size(buffer_)};
memory_resource_manager() = default;
memory_resource_manager(const memory_resource_manager &) = delete;
memory_resource_manager &operator=(const memory_resource_manager &) = delete;
};
} // namespace scymnus
| 21.805556 | 81 | 0.699363 | photonmaster |
cff603a933870fbf2c96e5292f1ec7e006175709 | 326 | cpp | C++ | 1183/1681782_AC_15MS_124K.cpp | vandreas19/POJ_sol | 4895764ab800e8c2c4b2334a562dec2f07fa243e | [
"MIT"
] | 18 | 2017-08-14T07:34:42.000Z | 2022-01-29T14:20:29.000Z | 1183/1681782_AC_15MS_124K.cpp | pinepara/poj_solutions | 4895764ab800e8c2c4b2334a562dec2f07fa243e | [
"MIT"
] | null | null | null | 1183/1681782_AC_15MS_124K.cpp | pinepara/poj_solutions | 4895764ab800e8c2c4b2334a562dec2f07fa243e | [
"MIT"
] | 14 | 2016-12-21T23:37:22.000Z | 2021-07-24T09:38:57.000Z | #include<iostream>
using namespace std;
void main()
{
unsigned long iA,iB,iSum=0;
cin>>iA;
for(iB=iA+1;iB<=iA*2;iB+=1)
if(!((iA*iB+1)%(iB-iA)) && (iB+((iA*iB+1)/(iB-iA))<iSum || !iSum))
{
iSum=iB+((iA*iB+1)/(iB-iA));
//cout<<iB<<"+"<<((iA*iB+1)/(iB-iA))<<"="<<iSum<<endl;
}
cout<<iSum<<endl;
} | 20.375 | 69 | 0.496933 | vandreas19 |
cff6b61bd9a794f33363be172a9586b242d71d6e | 8,432 | hpp | C++ | include/g6/http/message.hpp | Garcia6l20/g6-web | 6e9a1f9d85f26a977407d4c895f357e5f045efb9 | [
"MIT"
] | 3 | 2021-05-16T11:37:59.000Z | 2022-01-30T13:52:59.000Z | include/g6/http/message.hpp | Garcia6l20/g6-web | 6e9a1f9d85f26a977407d4c895f357e5f045efb9 | [
"MIT"
] | null | null | null | include/g6/http/message.hpp | Garcia6l20/g6-web | 6e9a1f9d85f26a977407d4c895f357e5f045efb9 | [
"MIT"
] | 1 | 2021-11-06T12:36:37.000Z | 2021-11-06T12:36:37.000Z | /**
* @file cppcoro/http/htt_message.hpp
* @author Garcia Sylvain <[email protected]>
*/
#pragma once
#include <cppcoro/http/details/static_parser_handler.hpp>
#include <cppcoro/detail/is_specialization.hpp>
#include <fmt/format.h>
#include <span>
namespace cppcoro::http
{
namespace detail
{
enum
{
max_body_size = 1024
};
struct base_message
{
base_message() = default;
explicit base_message(http::headers&& headers)
: headers{ std::forward<http::headers>(headers) }
{
}
base_message(base_message const& other) = delete;
base_message& operator=(base_message const& other) = delete;
base_message(base_message&& other) = default;
base_message& operator=(base_message&& other) = default;
std::optional<std::reference_wrapper<std::string>>
header(const std::string& key) noexcept
{
if (auto it = headers.find(key); it != headers.end())
{
return it->second;
}
return {};
}
http::headers headers;
byte_span body;
// virtual bool is_chunked() = 0;
// virtual std::string build_header() = 0;
// virtual task<std::span<std::byte, std::dynamic_extent>> read_body(size_t
//max_size = max_body_size) = 0; virtual task<size_t> write_body(std::span<std::byte,
//std::dynamic_extent> data) = 0;
};
struct base_request : base_message
{
static constexpr bool is_request = true;
static constexpr bool is_response = false;
using base_message::base_message;
base_request(base_request&& other) = default;
base_request& operator=(base_request&& other) = default;
base_request(http::method method, std::string&& path, http::headers&& headers = {})
: base_message{ std::forward<http::headers>(headers) }
, method{ method }
, path{ std::forward<std::string>(path) }
{
}
http::method method;
std::string path;
[[nodiscard]] auto method_str() const
{
return http_method_str(static_cast<detail::http_method>(method));
}
std::string to_string() const { return fmt::format("{} {}", method_str(), path); }
};
struct base_response : base_message
{
static constexpr bool is_response = true;
static constexpr bool is_request = false;
using base_message::base_message;
base_response(base_response&& other) = default;
base_response& operator=(base_response&& other) = default;
base_response(http::status status, http::headers&& headers = {})
: base_message{ std::forward<http::headers>(headers) }
, status{ status }
{
}
http::status status;
[[nodiscard]] auto status_str() const
{
return http_status_str(static_cast<detail::http_status>(status));
}
std::string to_string() const { return status_str(); }
};
template<bool _is_response, is_body BodyT>
struct abstract_message : std::conditional_t<_is_response, base_response, base_request>
{
using base_type = std::conditional_t<_is_response, base_response, base_request>;
static constexpr bool is_response = _is_response;
static constexpr bool is_request = !_is_response;
using parser_type = http::detail::static_parser_handler<is_request>;
using base_type::base_type;
std::optional<async_generator<std::string_view>> chunk_generator_;
std::optional<async_generator<std::string_view>::iterator> chunk_generator_it_;
abstract_message(abstract_message::parser_type& parser)
: base_response{ parser.template status_code_or_method<is_request>(),
std::move(parser.headers_), std::move(parser.url()), std::move(parser.header_) }
{
}
abstract_message(
auto status_or_method,
http::headers&& headers = {})
: base_response{ status_or_method, std::forward<http::headers>(headers) }
{
}
abstract_message(
http::method method,
std::string&& path,
http::headers&& headers = {}) requires(is_request)
: base_request{ method,
std::forward<std::string>(path),
std::forward<http::headers>(headers) }
{
}
auto& operator=(parser_type& parser) noexcept requires(is_request)
{
this->method = parser.method();
this->path = std::move(parser.url());
this->headers = std::move(parser.headers_);
return *this;
}
// explicit abstract_message(base_type &&base) noexcept :
// base_type(std::move(base)) {} abstract_message& operator=(base_type
// &&base) noexcept {
// static_cast<base_type>(*this) = std::move(base);
// }
//
// bool is_chunked() final
// {
// if constexpr (ro_chunked_body<body_type> or wo_chunked_body<body_type>)
// {
// return true;
// }
// else
// {
// return false;
// }
// }
// task<std::span<std::byte, std::dynamic_extent>> read_body(size_t max_size =
//max_body_size) final
// {
// if constexpr (ro_basic_body<BodyT>)
// {
// co_return std::span{ body_access };
// }
// else if constexpr (ro_chunked_body<BodyT>)
// {
// if (not chunk_generator_)
// {
// chunk_generator_ = body_access.read(max_size);
// chunk_generator_it_ = co_await chunk_generator_->begin();
// if (*chunk_generator_it_ != chunk_generator_->end())
// {
// co_return** chunk_generator_it_;
// }
// }
// else if (
// chunk_generator_it_ and
// co_await ++*chunk_generator_it_ != chunk_generator_->end())
// {
// co_return** chunk_generator_it_;
// }
// co_return {};
// }
// }
// task<size_t> write_body(std::span<std::byte, std::dynamic_extent> data)
//final
// {
// if constexpr (wo_basic_body<BodyT>)
// {
// auto size =
// std::min(data.size(),
//std::as_writable_bytes(this->body_access).size()); std::memmove(
// std::as_writable_bytes(this->body_access).data(), data.data(),
//size); co_return size;
// }
// else if constexpr (wo_chunked_body<BodyT>)
// {
// co_return co_await this->body_access.write(data);
// }
// }
inline std::string build_header()
{
for (auto& [k, v] : this->headers)
{
spdlog::debug("- {}: {}", k, v);
}
std::string output = _header_base();
auto write_header = [&output](const std::string& field, const std::string& value) {
output += fmt::format("{}: {}\r\n", field, value);
};
if constexpr (ro_basic_body<BodyT>)
{
auto sz = this->body.size();
if (auto node = this->headers.extract("Content-Length"); !node.empty())
{
node.mapped() = std::to_string(sz);
this->headers.insert(std::move(node));
}
else
{
this->headers.emplace("Content-Length", std::to_string(sz));
}
}
else if constexpr (ro_chunked_body<BodyT>)
{
this->headers.emplace("Transfer-Encoding", "chunked");
}
for (auto& [field, value] : this->headers)
{
write_header(field, value);
}
output += "\r\n";
return output;
}
private:
inline auto _header_base()
{
if constexpr (is_response)
{
return fmt::format(
"HTTP/1.1 {} {}\r\n"
"UserAgent: cppcoro-http/0.0\r\n",
int(this->status),
http_status_str(this->status));
}
else
{
return fmt::format(
"{} {} HTTP/1.1\r\n"
"UserAgent: cppcoro-http/0.0\r\n",
this->method_str(),
this->path);
}
}
};
template<bool response, typename T>
struct abstract_span_message : detail::abstract_message<response, T> {
abstract_span_message(auto status_or_method, T span, http::headers &&headers = {}) noexcept
: detail::abstract_message<response, T>{status_or_method} {
this->body = std::as_writable_bytes(span);
}
};
} // namespace detail
template<detail::is_body BodyT>
using abstract_request = detail::abstract_message<false, BodyT>;
template<detail::is_body BodyT>
using abstract_response = detail::abstract_message<true, BodyT>;
template<detail::is_body BodyT>
using abstract_request = detail::abstract_message<false, BodyT>;
struct request_parser : detail::static_parser_handler<true>
{
using detail::static_parser_handler<true>::static_parser_handler;
};
struct response_parser : detail::static_parser_handler<false>
{
using detail::static_parser_handler<false>::static_parser_handler;
};
} // namespace cppcoro::http | 27.736842 | 103 | 0.631641 | Garcia6l20 |
cfff77bf78c067378423efa49bf841301e9bf67d | 1,587 | hpp | C++ | include/termox/widget/detail/pipe_utility.hpp | a-n-t-h-o-n-y/MCurses | c9184a0fefbdc4eb9a044f815ee2270e6b8f202c | [
"MIT"
] | 284 | 2017-11-07T10:06:48.000Z | 2021-01-12T15:32:51.000Z | include/termox/widget/detail/pipe_utility.hpp | a-n-t-h-o-n-y/MCurses | c9184a0fefbdc4eb9a044f815ee2270e6b8f202c | [
"MIT"
] | 38 | 2018-01-14T12:34:54.000Z | 2020-09-26T15:32:43.000Z | include/termox/widget/detail/pipe_utility.hpp | a-n-t-h-o-n-y/MCurses | c9184a0fefbdc4eb9a044f815ee2270e6b8f202c | [
"MIT"
] | 31 | 2017-11-30T11:22:21.000Z | 2020-11-03T05:27:47.000Z | #ifndef TERMOX_WIDGET_DETAIL_PIPE_UTILITY_HPP
#define TERMOX_WIDGET_DETAIL_PIPE_UTILITY_HPP
#include <memory>
#include <type_traits>
#include <termox/widget/widget.hpp>
namespace ox::pipe::detail {
/// Used to call operator| overload to create a new Range from filter predicate
template <typename Predicate>
class Filter_predicate {
public:
explicit Filter_predicate(Predicate p) : predicate{p} {}
public:
Predicate predicate;
};
/// Used to call operator| overload to create a new Range from filter predicate
template <typename W>
class Dynamic_filter_predicate {
public:
using Widget_t = W;
};
template <typename T>
struct is_widget_ptr : std::false_type {};
template <typename X>
struct is_widget_ptr<std::unique_ptr<X>> : std::is_base_of<ox::Widget, X> {};
/// True if T is a std::unique_ptr<> to a ox::Widget type.
template <typename T>
constexpr bool is_widget_ptr_v = is_widget_ptr<T>::value;
/// True if T is a Widget type.
template <typename T>
constexpr bool is_widget_v = std::is_base_of_v<Widget, std::decay_t<T>>;
/// True if T is a Widget type or a Widget pointer.
template <typename T>
constexpr bool is_widget_or_wptr =
is_widget_v<T> || is_widget_ptr_v<std::decay_t<T>>;
} // namespace ox::pipe::detail
namespace ox {
/// Return *x if x is a unique_ptr to a Widget type, otherwise x.
template <typename T>
[[nodiscard]] constexpr auto get(T& x) -> auto&
{
if constexpr (::ox::pipe::detail::is_widget_ptr_v<T>)
return *x;
else
return x;
}
} // namespace ox
#endif // TERMOX_WIDGET_DETAIL_PIPE_UTILITY_HPP
| 25.596774 | 79 | 0.724008 | a-n-t-h-o-n-y |
3205b4dd8cffd38079a04954c2bd51830e0387cb | 1,325 | hpp | C++ | src/endpoint.hpp | pcdangio/ros-driver_tcpip | 7e2aa0d727cd3a86ec5ddc7f3495a6f461e55702 | [
"MIT"
] | 2 | 2021-03-23T19:15:55.000Z | 2021-04-04T13:55:53.000Z | src/endpoint.hpp | pcdangio/ros-driver_tcpip | 7e2aa0d727cd3a86ec5ddc7f3495a6f461e55702 | [
"MIT"
] | 1 | 2019-07-30T01:36:43.000Z | 2019-07-31T23:52:49.000Z | src/endpoint.hpp | pcdangio/ros-driver_modem | 7e2aa0d727cd3a86ec5ddc7f3495a6f461e55702 | [
"MIT"
] | 1 | 2022-03-16T03:46:55.000Z | 2022-03-16T03:46:55.000Z | /// \file endpoint.hpp
/// \brief Defines endpoint conversion functions.
#ifndef DRIVER_TCPIP___ENDPOINT_H
#define DRIVER_TCPIP___ENDPOINT_H
#include <driver_tcpip_msgs/endpoint.h>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ip/udp.hpp>
namespace driver_tcpip {
namespace endpoint {
// TCP
/// \brief Converts a ROS endpoint to an ASIO TCP endpoint.
/// \param endpoint_ros The ROS endpoint to convert.
/// \returns The converted ASIO TCP endpoint.
boost::asio::ip::tcp::endpoint to_asio_tcp(const driver_tcpip_msgs::endpoint& endpoint_ros);
/// \brief Converts an ASIO TCP endpoint to a ROS endpoint.
/// \param endpoint_asio The ASIO TCP endpoint to convert.
/// \returns The converted ROS endpoint.
driver_tcpip_msgs::endpoint to_ros(const boost::asio::ip::tcp::endpoint& endpoint_asio);
// UDP
/// \brief Converts a ROS endpoint to an ASIO UDP endpoint.
/// \param endpoint_ros The ROS endpoint to convert.
/// \returns The converted ASIO UDP endpoint.
boost::asio::ip::udp::endpoint to_asio_udp(const driver_tcpip_msgs::endpoint& endpoint_ros);
/// \brief Converts an ASIO UDP endpoint to a ROS endpoint.
/// \param endpoint_asio The ASIO UDP endpoint to convert.
/// \returns The converted ROS endpoint.
driver_tcpip_msgs::endpoint to_ros(const boost::asio::ip::udp::endpoint& endpoint_asio);
}}
#endif | 36.805556 | 92 | 0.763774 | pcdangio |
32127331669f0d118c8f3c2d68bfffd83c3d9cff | 13,169 | cpp | C++ | src/dogfood/output/text_modifier_test.cpp | lsilvest/crpcut | e9d694fb04599b72ebdcf6fea7d6ad598807ff41 | [
"BSD-2-Clause"
] | 1 | 2019-04-09T12:48:41.000Z | 2019-04-09T12:48:41.000Z | src/dogfood/output/text_modifier_test.cpp | lsilvest/crpcut | e9d694fb04599b72ebdcf6fea7d6ad598807ff41 | [
"BSD-2-Clause"
] | 2 | 2020-05-06T16:22:07.000Z | 2020-05-07T04:02:41.000Z | src/dogfood/output/text_modifier_test.cpp | lsilvest/crpcut | e9d694fb04599b72ebdcf6fea7d6ad598807ff41 | [
"BSD-2-Clause"
] | 1 | 2019-04-10T12:47:11.000Z | 2019-04-10T12:47:11.000Z | /*
* Copyright 2012 Bjorn Fahller <[email protected]>
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <trompeloeil.hpp>
#include <crpcut.hpp>
#include "../../output/writer.hpp"
#include "../../output/buffer.hpp"
#include "../../output/text_modifier.hpp"
#include <sstream>
TESTSUITE(output)
{
using trompeloeil::_;
TESTSUITE(text_modifier)
{
class test_buffer : public crpcut::output::buffer
{
public:
typedef std::pair<const char*, std::size_t> buff;
MAKE_CONST_MOCK0(get_buffer, buff());
MAKE_MOCK0(advance, void());
MAKE_MOCK2(write, ssize_t(const char*, std::size_t));
MAKE_CONST_MOCK0(is_empty, bool());
};
using crpcut::output::text_modifier;
TEST(nullstring_does_nothing)
{
text_modifier obj(0);
std::ostringstream os;
obj.write_to(os, text_modifier::NORMAL);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::PASSED);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::FAILED);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::NCFAILED);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::NCPASSED);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::BLOCKED);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::PASSED_SUM);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::FAILED_SUM);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::NCPASSED_SUM);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::NCFAILED_SUM);
ASSERT_TRUE(os.str() == "");
obj.write_to(os, text_modifier::BLOCKED_SUM);
ASSERT_TRUE(os.str() == "");
test_buffer buff;
FORBID_CALL(buff, write(_,_));
crpcut::output::writer w(buff, "UTF-8", "--illegal--");
obj.write_to(w, text_modifier::NORMAL);
obj.write_to(w, text_modifier::PASSED);
obj.write_to(w, text_modifier::FAILED);
obj.write_to(w, text_modifier::NCFAILED);
obj.write_to(w, text_modifier::NCPASSED);
obj.write_to(w, text_modifier::BLOCKED);
obj.write_to(w, text_modifier::PASSED_SUM);
obj.write_to(w, text_modifier::FAILED_SUM);
obj.write_to(w, text_modifier::NCPASSED_SUM);
obj.write_to(w, text_modifier::NCFAILED_SUM);
obj.write_to(w, text_modifier::BLOCKED_SUM);
}
class fix
{
protected:
fix() : writer(buff, "UTF-8", "--illegal--") {}
test_buffer buff;
crpcut::output::writer writer;
trompeloeil::sequence seq;
};
TEST(set_values_are_honoured, fix)
{
static const char config[] =
" 0"
" PASSED=1"
" FAILED=2"
" NCFAILED=3"
" NCPASSED=4"
" BLOCKED=5"
" PASSED_SUM=6"
" FAILED_SUM=7"
" NCPASSED_SUM=8"
" NCFAILED_SUM=9"
" BLOCKED_SUM=10"
" ";
text_modifier modifier(config);
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='0').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='1').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='2').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='3').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='4').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='5').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='6').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='7').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='8').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,1U)).WITH(*_1=='9').IN_SEQUENCE(seq).RETURN(ssize_t(_2));
REQUIRE_CALL(buff, write(_,2U))
.WITH(std::string(_1,_2) == "10")
.IN_SEQUENCE(seq)
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NORMAL);
modifier.write_to(writer, text_modifier::PASSED);
modifier.write_to(writer, text_modifier::FAILED);
modifier.write_to(writer, text_modifier::NCFAILED);
modifier.write_to(writer, text_modifier::NCPASSED);
modifier.write_to(writer, text_modifier::BLOCKED);
modifier.write_to(writer, text_modifier::PASSED_SUM);
modifier.write_to(writer, text_modifier::FAILED_SUM);
modifier.write_to(writer, text_modifier::NCPASSED_SUM);
modifier.write_to(writer, text_modifier::NCFAILED_SUM);
modifier.write_to(writer, text_modifier::BLOCKED_SUM);
}
TEST(failed_propagates, fix)
{
static const char config[] =
" 0"
" FAILED=F"
" ";
text_modifier modifier(config);
{
REQUIRE_CALL(buff, write(_,_))
.WITH(std::string(_1,_2) == "F")
.TIMES(4)
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::FAILED);
modifier.write_to(writer, text_modifier::NCFAILED);
modifier.write_to(writer, text_modifier::FAILED_SUM);
modifier.write_to(writer, text_modifier::NCFAILED_SUM);
}
{
REQUIRE_CALL(buff, write(_,_))
.WITH(std::string(_1,_2) == "0")
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NORMAL);
modifier.write_to(writer, text_modifier::PASSED);
modifier.write_to(writer, text_modifier::NCPASSED);
modifier.write_to(writer, text_modifier::BLOCKED);
modifier.write_to(writer, text_modifier::PASSED_SUM);
modifier.write_to(writer, text_modifier::NCPASSED_SUM);
modifier.write_to(writer, text_modifier::BLOCKED_SUM);
}
}
TEST(ncfailed_propagates, fix)
{
static const char config[] =
" 0"
" NCFAILED=F"
" ";
text_modifier modifier(config);
{
REQUIRE_CALL(buff, write(_,_))
.WITH(std::string(_1,_2) == "F")
.TIMES(2)
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NCFAILED);
modifier.write_to(writer, text_modifier::NCFAILED_SUM);
}
{
REQUIRE_CALL(buff, write(_,_))
.WITH(std::string(_1,_2) == "0")
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NORMAL);
}
modifier.write_to(writer, text_modifier::FAILED_SUM);
modifier.write_to(writer, text_modifier::FAILED);
modifier.write_to(writer, text_modifier::PASSED);
modifier.write_to(writer, text_modifier::NCPASSED);
modifier.write_to(writer, text_modifier::BLOCKED);
modifier.write_to(writer, text_modifier::PASSED_SUM);
modifier.write_to(writer, text_modifier::NCPASSED_SUM);
modifier.write_to(writer, text_modifier::BLOCKED_SUM);
}
TEST(ncpassed_propagates, fix)
{
static const char config[] =
" 0"
" NCPASSED=P"
" ";
text_modifier modifier(config);
{
REQUIRE_CALL(buff, write(_,_))
.WITH(std::string(_1,_2) == "P")
.TIMES(2)
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NCPASSED);
modifier.write_to(writer, text_modifier::NCPASSED_SUM);
}
{
REQUIRE_CALL(buff, write(_,_))
.WITH(std::string(_1,_2) == "0")
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NORMAL);
}
FORBID_CALL(buff, write(_,_));
modifier.write_to(writer, text_modifier::NCFAILED);
modifier.write_to(writer, text_modifier::NCFAILED_SUM);
modifier.write_to(writer, text_modifier::FAILED_SUM);
modifier.write_to(writer, text_modifier::FAILED);
modifier.write_to(writer, text_modifier::PASSED);
modifier.write_to(writer, text_modifier::BLOCKED);
modifier.write_to(writer, text_modifier::PASSED_SUM);
modifier.write_to(writer, text_modifier::BLOCKED_SUM);
}
TEST(blocked_propagates, fix)
{
static const char config[] =
" 0"
" BLOCKED=B"
" ";
text_modifier modifier(config);
{
REQUIRE_CALL(buff, write(_,_))
.WITH(std::string(_1,_2) == "B")
.TIMES(2)
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::BLOCKED);
modifier.write_to(writer, text_modifier::BLOCKED_SUM);
}
{
REQUIRE_CALL(buff, write(_,_))
.WITH(std::string(_1,_2) == "0")
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NORMAL);
}
FORBID_CALL(buff, write(_,_));
modifier.write_to(writer, text_modifier::NCPASSED);
modifier.write_to(writer, text_modifier::NCPASSED_SUM);
modifier.write_to(writer, text_modifier::NCFAILED);
modifier.write_to(writer, text_modifier::NCFAILED_SUM);
modifier.write_to(writer, text_modifier::FAILED_SUM);
modifier.write_to(writer, text_modifier::FAILED);
modifier.write_to(writer, text_modifier::PASSED);
modifier.write_to(writer, text_modifier::PASSED_SUM);
}
TEST(terminals_do_not_propagate, fix)
{
static const char config[] =
" 0"
" PASSED_SUM=PS"
" FAILED_SUM=FS"
" NCFAILED_SUM=NFS"
" NCPASSED_SUM=NPS"
" BLOCKED_SUM=BS"
" ";
text_modifier modifier(config);
{
REQUIRE_CALL(buff, write(_, _))
.WITH(std::string(_1,_2) == "PS")
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::PASSED_SUM);
}
{
REQUIRE_CALL(buff, write(_, _))
.WITH(std::string(_1,_2) == "FS")
.RETURN(2);
modifier.write_to(writer, text_modifier::FAILED_SUM);
}
{
REQUIRE_CALL(buff, write(_, _))
.WITH(std::string(_1, _2) == "BS")
.RETURN(2);
modifier.write_to(writer, text_modifier::BLOCKED_SUM);
}
{
REQUIRE_CALL(buff, write(_, _))
.WITH(std::string(_1,_2) == "NFS")
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NCFAILED_SUM);
}
{
REQUIRE_CALL(buff, write(_, _))
.WITH(std::string(_1, _2) == "NPS")
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NCPASSED_SUM);
}
{
REQUIRE_CALL(buff, write(_, _))
.WITH(std::string(_1, _2) == "0")
.RETURN(ssize_t(_2));
modifier.write_to(writer, text_modifier::NORMAL);
}
FORBID_CALL(buff, write(_,_));
modifier.write_to(writer, text_modifier::PASSED);
modifier.write_to(writer, text_modifier::FAILED);
modifier.write_to(writer, text_modifier::NCFAILED);
modifier.write_to(writer, text_modifier::NCPASSED);
modifier.write_to(writer, text_modifier::BLOCKED);
}
TEST(variable_subset_length_throws)
{
ASSERT_THROW(text_modifier(" 0 BLOCKED_SU=apa "),
text_modifier::illegal_decoration_format,
"BLOCKED_SU is not a decorator");
}
TEST(variable_superset_length_throws)
{
ASSERT_THROW(text_modifier(" 0 BLOCKED_SUMM=apa "),
text_modifier::illegal_decoration_format,
"BLOCKED_SUMM is not a decorator");
}
TEST(lacking_assign_throws)
{
ASSERT_THROW(text_modifier(" 0 BLOCKED_SUM "),
text_modifier::illegal_decoration_format,
"Missing = after name");
}
TEST(lacking_terminator_throws)
{
ASSERT_THROW(text_modifier(" 0 BLOCKED_SUM=apa"),
text_modifier::illegal_decoration_format,
"Missing separator after value for BLOCKED_SUM");
}
}
}
| 35.980874 | 90 | 0.62594 | lsilvest |
3212a591afacd990ed550c13bbdfa5b4c1bb3425 | 42 | cpp | C++ | testStateMachine/IWaveFile.cpp | wp4398151/TestApp | 7dffb4ca275801043f9e911f4f699dfaa1e906ae | [
"Apache-2.0"
] | null | null | null | testStateMachine/IWaveFile.cpp | wp4398151/TestApp | 7dffb4ca275801043f9e911f4f699dfaa1e906ae | [
"Apache-2.0"
] | null | null | null | testStateMachine/IWaveFile.cpp | wp4398151/TestApp | 7dffb4ca275801043f9e911f4f699dfaa1e906ae | [
"Apache-2.0"
] | null | null | null | #include "stdafx.h"
#include "IWaveFile.h" | 21 | 22 | 0.738095 | wp4398151 |
3215df03438b6a784c0dd3c350199cccc67cc4b6 | 2,674 | cpp | C++ | file-commander-core/src/diskenumerator/cvolumeenumerator_impl_win.cpp | treehugging-green-wolf/file-commander | 5e6f5372e70de68981d0001035a6d2a110293ebb | [
"Apache-2.0"
] | null | null | null | file-commander-core/src/diskenumerator/cvolumeenumerator_impl_win.cpp | treehugging-green-wolf/file-commander | 5e6f5372e70de68981d0001035a6d2a110293ebb | [
"Apache-2.0"
] | null | null | null | file-commander-core/src/diskenumerator/cvolumeenumerator_impl_win.cpp | treehugging-green-wolf/file-commander | 5e6f5372e70de68981d0001035a6d2a110293ebb | [
"Apache-2.0"
] | null | null | null | #include "cvolumeenumerator.h"
#include "../filesystemhelpers/filesystemhelpers.hpp"
#include "windows/windowsutils.h"
#include "utility/on_scope_exit.hpp"
#include "system/ctimeelapsed.h"
#include <Windows.h>
DISABLE_COMPILER_WARNINGS
#include <QDebug>
RESTORE_COMPILER_WARNINGS
inline QString parseVolumePathFromPathsList(WCHAR* paths)
{
QString qstring;
for (auto string = paths; string[0] != L'\0'; string += wcslen(string) + 1)
{
qstring = QString::fromWCharArray(string);
if (qstring.contains(':'))
return qstring;
}
return qstring;
}
static VolumeInfo volumeInfoForDriveLetter(const QString& driveLetter)
{
if (!FileSystemHelpers::pathIsAccessible(driveLetter))
return {};
WCHAR volumeName[256], filesystemName[256];
const DWORD error = GetVolumeInformationW((WCHAR*)driveLetter.utf16(), volumeName, 256, nullptr, nullptr, nullptr, filesystemName, 256) != 0 ? 0 : GetLastError();
if (error != 0 && error != ERROR_NOT_READY)
{
const auto text = ErrorStringFromLastError();
qInfo() << "GetVolumeInformationW() returned error for" << driveLetter << text;
return {};
}
VolumeInfo info;
info.isReady = error != ERROR_NOT_READY;
info.rootObjectInfo = driveLetter;
if (info.isReady)
{
ULARGE_INTEGER totalSpace, freeSpace;
if (GetDiskFreeSpaceExW((WCHAR*)driveLetter.utf16(), &freeSpace, &totalSpace, nullptr) != 0)
{
info.volumeSize = totalSpace.QuadPart;
info.freeSize = freeSpace.QuadPart;
}
else
qInfo() << "GetDiskFreeSpaceExW() returned error:" << ErrorStringFromLastError();
}
info.volumeLabel = QString::fromWCharArray(volumeName);
info.fileSystemName = QString::fromWCharArray(filesystemName);
return info;
}
const std::vector<VolumeInfo> CVolumeEnumerator::enumerateVolumesImpl()
{
std::vector<VolumeInfo> volumes;
const auto oldErrorMode = ::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
EXEC_ON_SCOPE_EXIT([oldErrorMode]() {::SetErrorMode(oldErrorMode);});
DWORD drives = ::GetLogicalDrives();
if (drives == 0)
{
qInfo() << "GetLogicalDrives() returned an error:" << ErrorStringFromLastError();
return volumes;
}
for (char driveLetter = 'A'; drives != 0 && driveLetter <= 'Z'; ++driveLetter, drives >>= 1)
{
if ((drives & 0x1) == 0)
continue;
CTimeElapsed timer{ true };
auto volumeInfo = volumeInfoForDriveLetter(QString(driveLetter) + QStringLiteral(":\\"));
const auto elapsedMs = timer.elapsed();
if (elapsedMs > 100)
qInfo() << "volumeInfoForDriveLetter for" << QString(driveLetter) + QStringLiteral(":\\") << "took" << elapsedMs << "ms";
if (!volumeInfo.isEmpty())
volumes.emplace_back(std::move(volumeInfo));
}
return volumes;
}
| 28.147368 | 163 | 0.720269 | treehugging-green-wolf |
321916c75aa69ce94b9c77f9fd3c81404f44abb9 | 3,076 | cpp | C++ | engine/generators/fortresses/source/MotteBaileyCastleGeneratorStrategy.cpp | sidav/shadow-of-the-wyrm | 747afdeebed885b1a4f7ab42f04f9f756afd3e52 | [
"MIT"
] | 60 | 2019-08-21T04:08:41.000Z | 2022-03-10T13:48:04.000Z | engine/generators/fortresses/source/MotteBaileyCastleGeneratorStrategy.cpp | cleancoindev/shadow-of-the-wyrm | 51b23e98285ecb8336324bfd41ebf00f67b30389 | [
"MIT"
] | 3 | 2021-03-18T15:11:14.000Z | 2021-10-20T12:13:07.000Z | engine/generators/fortresses/source/MotteBaileyCastleGeneratorStrategy.cpp | cleancoindev/shadow-of-the-wyrm | 51b23e98285ecb8336324bfd41ebf00f67b30389 | [
"MIT"
] | 8 | 2019-11-16T06:29:05.000Z | 2022-01-23T17:33:43.000Z | #include "MotteBaileyCastleGeneratorStrategy.hpp"
#include "CoordUtils.hpp"
#include "DirectionUtils.hpp"
#include "GeneratorUtils.hpp"
#include "TileGenerator.hpp"
#include "RNG.hpp"
using namespace std;
const int MotteBaileyCastleGeneratorStrategy::MIN_MOTTE_WIDTH = 8;
const int MotteBaileyCastleGeneratorStrategy::MIN_MOTTE_HEIGHT = 6;
// The motte is the keep, bailey is the courtyard.
void MotteBaileyCastleGeneratorStrategy::generate(MapPtr castle_map)
{
Dimensions d;
int start_y = RNG::range(2, d.get_y() / 4);
int start_x = RNG::range(5, d.get_x() / 4);
int end_y = d.get_y() - start_y;
int end_x = d.get_x() - start_x;
int motte_width = RNG::range(MIN_MOTTE_WIDTH, end_x - start_x - 4);
int motte_height = RNG::range(MIN_MOTTE_HEIGHT, end_y - start_y - 4);
generate_moat(castle_map, start_y, start_x, end_y, end_x);
generate_motte(castle_map, motte_height, motte_width);
generate_bridge(castle_map, start_y, start_x, end_y, end_x);
}
// Generate the moat around the castle structure, generated on the
// centre of the map.
void MotteBaileyCastleGeneratorStrategy::generate_moat(MapPtr castle_map, const int start_y, const int start_x, int end_y, int end_x)
{
TileGenerator tg;
Dimensions dim = castle_map->size();
vector<Coordinate> coords = CoordUtils::get_perimeter_coordinates(make_pair(start_y, start_x), make_pair(end_y, end_x));
for (const Coordinate& c : coords)
{
TilePtr river_tile = tg.generate(TileType::TILE_TYPE_RIVER);
castle_map->insert(c.first, c.second, river_tile);
}
}
// Generate the motte (the keep).
void MotteBaileyCastleGeneratorStrategy::generate_motte(MapPtr castle_map, const int motte_height, const int motte_width)
{
Dimensions dim = castle_map->size();
int start_row = (dim.get_y() / 2) - (motte_height / 2);
int start_col = (dim.get_x() / 2) - (motte_width / 2);
Coordinate top_left = make_pair(start_row, start_col);
Coordinate bottom_right = make_pair(start_row + motte_height, start_col + motte_width);
GeneratorUtils::generate_building(castle_map, start_row, start_col, motte_height+1, motte_width+1);
map<CardinalDirection, Coordinate> midway_points = CoordUtils::get_midway_coordinates(top_left, bottom_right);
for (const auto& c : midway_points)
{
GeneratorUtils::generate_door(castle_map, c.second.first, c.second.second);
}
}
// Generate a land bridge over the moat.
void MotteBaileyCastleGeneratorStrategy::generate_bridge(MapPtr castle_map, const int start_y, const int start_x, const int end_y, const int end_x)
{
Coordinate a = make_pair(start_y, start_x);
Coordinate b = make_pair(end_y, end_x);
map<CardinalDirection, Coordinate> bridge_coords = CoordUtils::get_midway_coordinates(a, b);
auto b_it = bridge_coords.begin();
std::advance(b_it, RNG::range(0, bridge_coords.size() - 1));
Coordinate c = b_it->second;
TilePtr bridge_tile = castle_map->at(c);
TileGenerator tg;
if (bridge_tile != nullptr)
{
bridge_tile = tg.generate(TileType::TILE_TYPE_ROAD);
castle_map->insert(c.first, c.second, bridge_tile);
}
}
| 37.060241 | 147 | 0.75 | sidav |
32200a137c740c636e320e64d84e85856db410c3 | 4,090 | hpp | C++ | VSDataReduction/VBFHiLoCalc.hpp | sfegan/ChiLA | 916bdd95348c2df2ecc736511d5f5b2bfb4a831e | [
"BSD-3-Clause"
] | 1 | 2018-04-17T14:03:36.000Z | 2018-04-17T14:03:36.000Z | VSDataReduction/VBFHiLoCalc.hpp | sfegan/ChiLA | 916bdd95348c2df2ecc736511d5f5b2bfb4a831e | [
"BSD-3-Clause"
] | null | null | null | VSDataReduction/VBFHiLoCalc.hpp | sfegan/ChiLA | 916bdd95348c2df2ecc736511d5f5b2bfb4a831e | [
"BSD-3-Clause"
] | null | null | null | //-*-mode:c++; mode:font-lock;-*-
/*! \file VBFHiLoCalc.hpp
Class designed for use with logain.cpp...
\author Timothy C. Arlen \n
UCLA \n
[email protected] \n
\author Stephen Fegan \n
UCLA \n
[email protected] \n
\version 1.0
\date 05/18/2005
$Id: VBFHiLoCalc.hpp,v 3.1 2009/12/22 19:43:30 matthew Exp $
*/
#ifndef VBFHILOCALC_HPP
#define VBFHILOCALC_HPP
#include<vector>
// Not sure if all these are needed??
#include "VBFSimplePeds.hpp"
#include "VSSimpleHist.hpp"
#include "VBFLaserCalc.hpp"
#include "VSHiLoData.hpp"
#include "VSFileUtility.hpp"
#include "VSChannelMap.hpp"
// ============================================================================
// VBFHiLoCalc
// ============================================================================
// (Every new ChiLA class goes into the VERITAS namespace)
namespace VERITAS
{
class VBFHiLoCalc: public VSSimpleVBFVisitor
{
public:
struct ChanData
{
ChanData(): ped_stat(), nevent() { }
// Statistics counters -------------------------------------------------
VSSimpleStat1<double> ped_stat; // Amplitude
unsigned nevent;
};
struct ScopeData
{
ScopeData(unsigned nchan=0): chan(nchan,ChanData()), nevent() { }
// Channel data
std::vector<ChanData> chan;
// Statistics counters --------------------------------------------------
unsigned nevent;
};
typedef std::vector<ScopeData*> ArrayData;
VBFHiLoCalc(int sample_0, unsigned sample_N);
virtual ~VBFHiLoCalc();
virtual void visitArrayTrigger(bool& veto_array_event, void* user_data,
uint32_t event_num,
const VEventType& event_type,
uint32_t trigger_mask,
uint32_t flags,
const VSTime& raw_time,
uint32_t at_flags,
uint32_t config_mask,
uint32_t num_telescopes,
uint32_t num_trigger_telescopes,
uint32_t run_number,
const uint32_t* ten_mhz_clocks,
const uint32_t* cal_count,
const uint32_t* ped_count,
const VArrayTrigger* trigger);
virtual void visitScopeEvent(bool& veto_scope_event, void* user_data,
uint32_t event_num,
uint32_t telescope_num,
const VEventType& event_type,
uint32_t trigger_mask,
uint32_t flags,
const VSTime& raw_time,
uint32_t num_samples,
uint32_t num_channels_saved,
uint32_t num_channels_total,
uint32_t num_clock_trigger,
const VEvent* event);
virtual void visitChannel(bool& veto_channel, void* user_data,
uint32_t channel_num,
bool hit,
bool trigger);
virtual void visitHitChannel(void* user_data,
uint32_t channel_num,
uint32_t charge,
uint32_t pedestal,
bool lo_gain,
unsigned nsample,
const uint32_t* samples,
const uint32_t* integrated);
virtual void leaveScopeEvent(bool veto_scope_event, void* user_data);
virtual void leaveArrayEvent(bool veto_array_event, void* user_data);
void getData(VSHiLoData& data, unsigned nevent_min = 10) const;
ArrayData scope;
private:
VBFHiLoCalc(VBFLaserCalc&);
VBFHiLoCalc& operator= (const VBFLaserCalc&);
// Settings
int m_sample_0;
unsigned m_sample_N;
// State
unsigned m_runno;
unsigned m_scope_id;
};
}
#endif // VBFHILOCALC_HPP
| 30.073529 | 79 | 0.513447 | sfegan |
322713e384e250dd9e0f0a2f5d169e98dca4a2dc | 1,301 | hpp | C++ | include/armadillo_bits/fn_chol.hpp | jshahbazi/mnist-cpp | d757d07c03b2c24df94af4c0762b99db21c21538 | [
"MIT"
] | 80 | 2015-06-23T04:51:27.000Z | 2022-03-09T08:15:36.000Z | include/armadillo_bits/fn_chol.hpp | jshahbazi/mnist-cpp | d757d07c03b2c24df94af4c0762b99db21c21538 | [
"MIT"
] | 4 | 2017-06-18T03:40:48.000Z | 2018-10-31T09:55:32.000Z | include/armadillo_bits/fn_chol.hpp | jshahbazi/mnist-cpp | d757d07c03b2c24df94af4c0762b99db21c21538 | [
"MIT"
] | 37 | 2015-08-20T03:26:28.000Z | 2022-03-08T10:54:49.000Z | // Copyright (C) 2009-2014 Conrad Sanderson
// Copyright (C) 2009-2014 NICTA (www.nicta.com.au)
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup fn_chol
//! @{
template<typename T1>
inline
const Op<T1, op_chol>
chol
(
const Base<typename T1::elem_type,T1>& X,
const char* layout = "upper",
const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
const char sig = (layout != NULL) ? layout[0] : char(0);
arma_debug_check( ((sig != 'u') && (sig != 'l')), "chol(): layout must be \"upper\" or \"lower\"" );
return Op<T1, op_chol>(X.get_ref(), ((sig == 'u') ? 0 : 1), 0 );
}
template<typename T1>
inline
bool
chol
(
Mat<typename T1::elem_type>& out,
const Base<typename T1::elem_type,T1>& X,
const char* layout = "upper",
const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
try
{
out = chol(X, layout);
}
catch(std::runtime_error&)
{
return false;
}
return true;
}
//! @}
| 20.015385 | 102 | 0.626441 | jshahbazi |
7a86da3dfbdcfcb9422bed08230b16c861a22c7e | 3,154 | hpp | C++ | headers/fun/instances/eq.hpp | BlackMATov/fun.hpp | 11b208996c3c3784d31afb6463b34d5b68b47bd4 | [
"MIT"
] | 12 | 2019-01-07T05:55:35.000Z | 2020-04-21T08:37:25.000Z | headers/fun/instances/eq.hpp | BlackMATov/fun.hpp | 11b208996c3c3784d31afb6463b34d5b68b47bd4 | [
"MIT"
] | 1 | 2019-01-07T08:53:56.000Z | 2019-01-07T08:53:56.000Z | headers/fun/instances/eq.hpp | BlackMATov/fun.hpp | 11b208996c3c3784d31afb6463b34d5b68b47bd4 | [
"MIT"
] | 1 | 2019-01-08T07:51:30.000Z | 2019-01-08T07:51:30.000Z | /*******************************************************************************
* This file is part of the "https://github.com/blackmatov/fun.hpp"
* For conditions of distribution and use, see copyright notice in LICENSE.md
* Copyright (C) 2019-2020, by Matvey Cherevko ([email protected])
******************************************************************************/
#pragma once
#include "_instances.hpp"
#include "../types/all.hpp"
#include "../types/any.hpp"
#include "../types/sum.hpp"
#include "../types/product.hpp"
#include "../types/box.hpp"
#include "../types/maybe.hpp"
#include "../classes/eq.hpp"
namespace fun
{
//
// arithmetic types
//
template < typename A >
struct eq_inst_t<A,
std::enable_if_t<
std::is_arithmetic<A>::value, A>
> : eq_inst_t<A>
{
static constexpr bool instance = true;
static bool equals(A l, A r) {
return l == r;
}
};
//
// all_t
//
template <>
struct eq_inst_t<all_t, all_t> : eq_inst_t<all_t> {
static constexpr bool instance = true;
static bool equals(const all_t& l, const all_t& r) {
return l.get_all() == r.get_all();
}
};
//
// any_t
//
template <>
struct eq_inst_t<any_t, any_t> : eq_inst_t<any_t> {
static constexpr bool instance = true;
static bool equals(const any_t& l, const any_t& r) {
return l.get_any() == r.get_any();
}
};
//
// sum_t
//
template < typename A >
struct eq_inst_t<sum_t<A>,
std::enable_if_t<
eq_t::instance<A>, sum_t<A>>
> : eq_inst_t<sum_t<A>>
{
static constexpr bool instance = true;
static bool equals(const sum_t<A>& l, const sum_t<A>& r) {
return eq_f::equals(l.get_sum(), r.get_sum());
}
};
//
// product_t
//
template < typename A >
struct eq_inst_t<product_t<A>,
std::enable_if_t<
eq_t::instance<A>, product_t<A>>
> : eq_inst_t<product_t<A>>
{
static constexpr bool instance = true;
static bool equals(const product_t<A>& l, const product_t<A>& r) {
return eq_f::equals(l.get_product(), r.get_product());
}
};
//
// box_t
//
template < typename A >
struct eq_inst_t<box_t<A>,
std::enable_if_t<
eq_t::instance<A>, box_t<A>>
> : eq_inst_t<box_t<A>>
{
static constexpr bool instance = true;
static bool equals(const box_t<A>& l, const box_t<A>& r) {
return eq_f::equals(*l, *r);
}
};
//
// maybe_t
//
template < typename A >
struct eq_inst_t<maybe_t<A>,
std::enable_if_t<
eq_t::instance<A>, maybe_t<A>>
> : eq_inst_t<maybe_t<A>>
{
static constexpr bool instance = true;
static bool equals(const maybe_t<A>& l, const maybe_t<A>& r) {
return
(l.is_nothing() && r.is_nothing()) ||
(l.is_just() && r.is_just() && eq_f::equals(*l, *r));
}
};
}
| 24.640625 | 80 | 0.509829 | BlackMATov |
7a8ed42e228158fb6a61f9bbf487114a4167aad2 | 1,201 | cpp | C++ | coast/modules/CacheHandler/Test/CallLdapCacheAction.cpp | zer0infinity/CuteForCoast | 37d933c5fe2e0ce9a801f51b2aa27c7a18098511 | [
"BSD-3-Clause"
] | null | null | null | coast/modules/CacheHandler/Test/CallLdapCacheAction.cpp | zer0infinity/CuteForCoast | 37d933c5fe2e0ce9a801f51b2aa27c7a18098511 | [
"BSD-3-Clause"
] | null | null | null | coast/modules/CacheHandler/Test/CallLdapCacheAction.cpp | zer0infinity/CuteForCoast | 37d933c5fe2e0ce9a801f51b2aa27c7a18098511 | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 2005, Peter Sommerlad and IFS Institute for Software at HSR Rapperswil, Switzerland
* All rights reserved.
*
* This library/application is free software; you can redistribute and/or modify it under the terms of
* the license that is included with this library/application in the file license.txt.
*/
#include "CallLdapCacheAction.h"
#include "Tracer.h"
#include "Context.h"
#include "LDAPCachePolicyModule.h"
//---- CallLdapCacheAction ---------------------------------------------------------------
RegisterAction(CallLdapCacheAction);
bool CallLdapCacheAction::DoExecAction(String &action, Context &ctx, const ROAnything &config) {
// this is the new method that also gets a config ( similar to Renderer::RenderAll )
// write the action code here - you don't have to override DoAction anymore
StartTrace(CallLdapCacheAction.DoExecAction);
TraceAny(config, "config");
ROAnything result;
String key(config["Key"].AsString());
String daName(config["Da"].AsString());
bool ret = true;
if (key == "*") {
result = LdapCacheGetter::GetAll(daName);
} else {
ret = LdapCacheGetter::Get(result, daName, key);
}
ctx.GetTmpStore() = result.DeepClone();
return ret;
}
| 36.393939 | 102 | 0.701082 | zer0infinity |
7a93f7d3ed34d0333accea20df6d917d3a67ccb9 | 918 | hpp | C++ | src/Game.hpp | ingmarinho/wappie-jump | b869825222997c4ff068e03fe02e2b94ecd5e450 | [
"BSL-1.0"
] | null | null | null | src/Game.hpp | ingmarinho/wappie-jump | b869825222997c4ff068e03fe02e2b94ecd5e450 | [
"BSL-1.0"
] | null | null | null | src/Game.hpp | ingmarinho/wappie-jump | b869825222997c4ff068e03fe02e2b94ecd5e450 | [
"BSL-1.0"
] | null | null | null | #pragma once
#include <memory>
#include <string>
#include <SFML/Graphics.hpp>
#include "StateMachine.hpp"
#include "AssetManager.hpp"
#include "InputManager.hpp"
/// @file
namespace WappieJump
{
/// saves all the data about the game's current state,
/// and contains important information for the game to be able to run
struct GameData
{
StateMachine machine;
sf::RenderWindow window;
AssetManager assets;
InputManager input;
bool isRunning = true;
long long int score = 0;
long long int highScore = 0;
sf::Sprite characterSprite;
int difficultyLevel = 100;
int soundVolume = 50;
};
typedef std::shared_ptr<GameData> GameDataRef;
class Game
{
public:
/// Declares the window (width/height) and sets the window title
Game(int width, int height, std::string title);
private:
GameDataRef _data = std::make_shared<GameData>();
/// Start the main game loop
void Run();
};
} | 20.863636 | 70 | 0.712418 | ingmarinho |
7aa351f30a9379d173bb62c5ceef359d6f042d73 | 1,053 | cpp | C++ | src/MCMC.cpp | Chrom3D/Chrom3D | e6b78e679d788d9822a3258c7a9c06ca4edcafc6 | [
"MIT"
] | 25 | 2018-02-13T03:55:06.000Z | 2021-12-13T06:47:53.000Z | src/MCMC.cpp | Chrom3D/Chrom3D | e6b78e679d788d9822a3258c7a9c06ca4edcafc6 | [
"MIT"
] | 31 | 2017-11-27T14:40:17.000Z | 2022-03-28T10:38:38.000Z | src/MCMC.cpp | Chrom3D/Chrom3D | e6b78e679d788d9822a3258c7a9c06ca4edcafc6 | [
"MIT"
] | 11 | 2018-04-19T14:43:40.000Z | 2022-03-29T08:37:44.000Z | #include "MCMC.h"
MCMC::MCMC(Model& mod): model(mod) { }
bool MCMC::doMetropolisHastingsStep(double T /*=1*/, uint maxAttempts /*=10000*/) {
uint i=0;
bool success = false;
while(i < maxAttempts and !success) {
try {
Move proposedMove = model.proposeMove(); // Idea: if this fails (no move proposed), we could set the proposed Move to the same (identity) move.
double before = model.getPartialLossScore(proposedMove.chr, proposedMove.start, proposedMove.stop); // score before move
Move oldCoords = model.accept(proposedMove); //, true);
double after = model.getPartialLossScore(proposedMove.chr, proposedMove.start, proposedMove.stop); // score after move
if(after > before) {
double pAccept = exp((before-after)/T);
bool accept = util::unif_real(0,1, model.randEngine) < pAccept;
if(not accept) {
Move tmp = model.accept(oldCoords); //, true); // roll back to previous coordinates.
}
}
success = true;
}
catch(util::MoveException& e){
i++;
}
}
return success;
}
| 33.967742 | 149 | 0.662868 | Chrom3D |
7aa39c5b08b4cd2ad8ed6d56af327167a3f4f511 | 2,499 | hpp | C++ | include/hfn/fnv1a.hpp | obhi-d/hfn | 692203a25a13214ba8a0e2feddb8d6e78275c860 | [
"MIT"
] | null | null | null | include/hfn/fnv1a.hpp | obhi-d/hfn | 692203a25a13214ba8a0e2feddb8d6e78275c860 | [
"MIT"
] | null | null | null | include/hfn/fnv1a.hpp | obhi-d/hfn | 692203a25a13214ba8a0e2feddb8d6e78275c860 | [
"MIT"
] | null | null | null | #pragma once
#include "config.hpp"
#include "detail/fnv1a.hpp"
#include <type_traits>
namespace hfn::fnv1a
{
template <typename fnvt>
inline auto seed(fnvt initial = 0) noexcept
{
using type = std::remove_cv_t<std::remove_reference_t<fnvt>>;
return (initial) ? (detail::fnv1a<sizeof(type)>::offset ^ initial) * detail::fnv1a<sizeof(type)>::prime
: detail::fnv1a<sizeof(type)>::offset;
}
template <typename fnvt>
inline auto update(fnvt& last, void const* source, std::size_t len)
{
const std::uint8_t* values = reinterpret_cast<const std::uint8_t*>(source);
for (std::size_t i = 0; i < len; ++i)
{
last ^= values[i];
last *= detail::fnv1a<sizeof(fnvt)>::prime;
}
return last;
}
template <typename fnvt, typename T>
inline auto update(fnvt& last, T const& mem)
{
return update(last, &mem, sizeof(mem));
}
template <typename fnvt>
inline fnvt compute(void const* source, std::size_t len)
{
constexpr fnvt initial = 0;
auto result = seed(initial);
return update(result, source, len);
}
template <typename fnvt, typename T>
inline auto compute(T const& mem)
{
return compute<fnvt>(&mem, sizeof(T));
}
inline std::uint64_t compute64(void const* source, std::size_t len)
{
constexpr std::uint64_t initial = 0;
auto result = seed(initial);
return update(result, source, len);
}
template <typename T>
inline auto compute64(T const& mem)
{
return compute<std::uint64_t>(&mem, sizeof(T));
}
inline std::uint32_t compute32(void const* source, std::size_t len)
{
constexpr std::uint32_t initial = 0;
auto result = seed(initial);
return update(result, source, len);
}
template <typename T>
inline auto compute32(T const& mem)
{
return compute<std::uint32_t>(&mem, sizeof(T));
}
template <typename base>
class hash
{
public:
HFN_FORCE_INLINE hash() noexcept : value(seed<base>()) {}
HFN_FORCE_INLINE hash(base initial) noexcept : value(seed(initial)) {}
HFN_FORCE_INLINE base operator()() const noexcept
{
return value;
}
HFN_FORCE_INLINE auto operator()(void const* key, std::size_t len) noexcept
{
return update(value, key, len);
}
template <typename T>
HFN_FORCE_INLINE auto operator()(T const& key) noexcept
{
return update(value, &key, sizeof(T));
}
private:
base value;
};
} // namespace hfn::fnv1a
namespace hfn
{
using fnv1a_32 = hfn::fnv1a::hash<std::uint32_t>;
using fnv1a_64 = hfn::fnv1a::hash<std::uint64_t>;
} // namespace hfn
| 22.926606 | 105 | 0.67547 | obhi-d |
7aa7479d9938d0220c832e76c78fbb5b43de539e | 7,268 | cpp | C++ | filters/ffmpeg/ffmpegSwScale.cpp | InfiniteInteractive/LimitlessSDK | cb71dde14d8c59cbf8a1ece765989c5787fffefa | [
"MIT"
] | 3 | 2017-05-13T20:36:03.000Z | 2021-07-16T17:23:01.000Z | filters/ffmpeg/ffmpegSwScale.cpp | InfiniteInteractive/LimitlessSDK | cb71dde14d8c59cbf8a1ece765989c5787fffefa | [
"MIT"
] | null | null | null | filters/ffmpeg/ffmpegSwScale.cpp | InfiniteInteractive/LimitlessSDK | cb71dde14d8c59cbf8a1ece765989c5787fffefa | [
"MIT"
] | 2 | 2016-08-04T00:16:50.000Z | 2017-09-07T14:50:03.000Z | #include "FfmpegSwScale.h"
#include "QtComponents/QtPluginView.h"
#include "Media/MediaPad.h"
#include "Media/MediaSampleFactory.h"
#include "Media/ImageSample.h"
#include "ffmpegResources.h"
#include "ffmpegControls.h"
#include "ffmpegPacketSample.h"
#include <boost/foreach.hpp>
#include <boost/tokenizer.hpp>
extern "C"
{
#include <libavutil/avutil.h>
#include <libavutil/opt.h>
#include <libavutil/imgutils.h>
}
//#include "Utilities\utilitiesImage.h"
using namespace Limitless;
FfmpegSwScale::FfmpegSwScale(std::string name, SharedMediaFilter parent):
MediaAutoRegister(name, parent),
m_swsContext(NULL),
m_widthChanged(false),
m_heightChanged(false),
m_formatChanged(false)
{
addAttribute("width", 0);
addAttribute("height", 0);
addAttribute("format", "RGB24");
}
FfmpegSwScale::~FfmpegSwScale()
{
}
bool FfmpegSwScale::initialize(const Attributes &attributes)
{
FfmpegResources::instance().registerAll();
m_ffmpegFrameSampleId=MediaSampleFactory::getTypeId("FfmpegFrameSample");
m_imageInterfaceSampleId=MediaSampleFactory::getTypeId("IImageSample");
m_imageSampleId=MediaSampleFactory::getTypeId("ImageSample");
addSinkPad("Sink", "{\"mime\":\"video/raw\"}");
return true;
}
SharedPluginView FfmpegSwScale::getView()
{
return SharedPluginView();
// if(m_view == SharedPluginView())
// {
// }
// return m_view;
}
bool FfmpegSwScale::processSample(SharedMediaPad sinkPad, SharedMediaSample sample)
{
if(m_convert)
{
if(sample->isType(m_ffmpegFrameSampleId))
{
SharedFfmpegFrameSample frameSample=boost::dynamic_pointer_cast<FfmpegFrameSample>(sample);
if(frameSample == SharedFfmpegFrameSample())
return false;
AVFrame *avFrame=frameSample->getFrame();
SharedMediaSample mediaSample=newSample(m_imageSampleId);
SharedImageSample imageSample=boost::dynamic_pointer_cast<ImageSample>(mediaSample);
FfmpegFormat format=FfmpegResources::getFormat(m_outputInfo.format);
imageSample->resize(m_outputInfo.width, m_outputInfo.height, format.channels);
uint8_t *rgbaPlane[]={imageSample->buffer()};
int rgbaPitch[]={imageSample->width()*format.channels};
// Limitless::savePGM("swScaleInputImage.pgm", Limitless::GREY, avFrame->data[0], avFrame->linesize[0], avFrame->height);
// Log::write((boost::format("SwScale %08x,%08x: %08x -> %08x")%GetCurrentThreadId()%this%(void *)avFrame->data[0]%(void *)imageSample->buffer()).str());
sws_scale(m_swsContext, avFrame->data, avFrame->linesize, 0, avFrame->height, rgbaPlane, rgbaPitch);
imageSample->copyHeader(sample, instance());
pushSample(imageSample);
}
else if(sample->isType(m_imageInterfaceSampleId))
{
SharedIImageSample imageSample=boost::dynamic_pointer_cast<IImageSample>(sample);
if(!imageSample)
return false;
SharedImageSample mediaSample=newSampleType<ImageSample>(m_imageSampleId);
FfmpegFormat format=FfmpegResources::getFormat(m_outputInfo.format);
mediaSample->resize(m_outputInfo.width, m_outputInfo.height, format.channels);
uint8_t *srcPlane[]={imageSample->buffer()};
int srcPitch[]={imageSample->width()*format.channels};
uint8_t *dstPlane[]={mediaSample->buffer()};
int dstPitch[]={mediaSample->width()*format.channels};
sws_scale(m_swsContext, srcPlane, srcPitch, 0, m_outputInfo.height, dstPlane, dstPitch);
imageSample->copyHeader(sample, instance());
pushSample(imageSample);
}
else
pushSample(sample);
}
else
pushSample(sample);
return true;
}
IMediaFilter::StateChange FfmpegSwScale::onReady()
{
SharedMediaPads sinkMediaPads=getSinkPads();
if(sinkMediaPads.size() <= 0)
return FAILED;
return SUCCESS;
}
IMediaFilter::StateChange FfmpegSwScale::onPaused()
{
return SUCCESS;
}
IMediaFilter::StateChange FfmpegSwScale::onPlaying()
{
return SUCCESS;
}
bool FfmpegSwScale::onAcceptMediaFormat(SharedMediaPad pad, SharedMediaFormat format)
{
if(pad->type() == MediaPad::SINK)
{
if(!format->exists("mime"))
return false;
MimeDetail mimeDetail=parseMimeDetail(format->attribute("mime")->toString());
if((mimeDetail.type != "video") && (mimeDetail.type != "image"))
return false;
if((mimeDetail.codec != "raw") && (mimeDetail.codec != ""))
return false;
return true;
}
else if(pad->type() == MediaPad::SOURCE)
return true;
return false;
}
void FfmpegSwScale::onLinkFormatChanged(SharedMediaPad pad, SharedMediaFormat format)
{
if(pad->type() == MediaPad::SINK)
{
if(!format->exists("mime"))
return;
std::string mime=format->attribute("mime")->toString();
MimeDetail mimeDetail=parseMimeDetail(format->attribute("mime")->toString());
if((mimeDetail.type != "video") && (mimeDetail.type != "image"))
return;
if((mimeDetail.codec != "raw") && (mimeDetail.codec != ""))
return;
if(format->exists("width"))
m_inputInfo.width=format->attribute("width")->toInt();
if(format->exists("height"))
m_inputInfo.height=format->attribute("height")->toInt();
if(format->exists("format"))
m_inputInfo.format=format->attribute("format")->toString();
//set output values if not set by user
if(!m_widthChanged)
setAttribute("width", (int)m_inputInfo.width);
// m_outputInfo.width=m_inputInfo.width;
if(!m_heightChanged)
setAttribute("height", (int)m_inputInfo.height);
// m_outputInfo.height=m_inputInfo.height;
if(!m_formatChanged)
setAttribute("format", m_inputInfo.format);
// m_outputInfo.format=m_inputInfo.format;
updateScaler(false);
}
}
void FfmpegSwScale::onAttributeChanged(std::string name, SharedAttribute attribute)
{
bool update=false;
if(name == "width")
{
m_outputInfo.width=attribute->toInt();
if(m_outputInfo.width > 0)
m_widthChanged=true;
update=true;
}
if(name == "height")
{
m_outputInfo.height=attribute->toInt();
if(m_outputInfo.height > 0)
m_heightChanged=true;
update=true;
}
if(name == "format")
{
m_outputInfo.format=attribute->toString();
m_formatChanged=true;
update=true;
}
if(update)
updateScaler();
}
void FfmpegSwScale::updateScaler(bool checkLink)
{
m_convert=false;
SharedMediaPads sourcePads=getSourcePads();
if(checkLink)
{
if(sourcePads.empty())
return;
bool linked=false;
for(SharedMediaPad &sourcePad:sourcePads)
{
if(sourcePad->linked())
{
linked=true;
break;
}
}
if(!linked)
return;
}
bool update=false;
if(m_outputInfo != m_inputInfo)
{
AVPixelFormat inputFormat=FfmpegResources::getAvPixelFormat(m_inputInfo.format);
AVPixelFormat outputFormat=FfmpegResources::getAvPixelFormat(m_outputInfo.format);
m_swsContext=sws_getCachedContext(m_swsContext, m_inputInfo.width, m_inputInfo.height, inputFormat,
m_outputInfo.width, m_outputInfo.height, outputFormat, SWS_LANCZOS|SWS_ACCURATE_RND, NULL, NULL, NULL);
m_convert=true;
}
SharedMediaFormat sourceFormat(new MediaFormat());
sourceFormat->addAttribute("mime", "video/raw");
sourceFormat->addAttribute("width", m_outputInfo.width);
sourceFormat->addAttribute("height", m_outputInfo.height);
sourceFormat->addAttribute("format", m_outputInfo.format);
if(sourcePads.empty())
addSourcePad("Source", sourceFormat);
else
{
for(SharedMediaPad &sourcePad:sourcePads)
{
sourcePad->setFormat(*sourceFormat.get());
}
}
}
| 25.324042 | 155 | 0.7306 | InfiniteInteractive |
7aa7e44a7449c151f76a354bcbdd4b68d6780cf8 | 1,663 | hh | C++ | src/search.hh | grencez/protocon | 0ca25d832f7222f4154507d974bf9213e0cf26d3 | [
"0BSD"
] | 7 | 2015-10-16T18:56:01.000Z | 2022-01-17T21:19:08.000Z | src/search.hh | czlynn/protocon | aa520f9edf3be7ff458f96e88cd2dab1eec4c505 | [
"0BSD"
] | 19 | 2015-09-27T17:37:21.000Z | 2021-07-26T06:50:12.000Z | src/search.hh | czlynn/protocon | aa520f9edf3be7ff458f96e88cd2dab1eec4c505 | [
"0BSD"
] | 1 | 2020-09-02T22:29:01.000Z | 2020-09-02T22:29:01.000Z |
#ifndef SEARCH_HH_
#define SEARCH_HH_
#include "cx/synhax.hh"
#include "cx/alphatab.hh"
#include "cx/table.hh"
#include "namespace.hh"
class AddConvergenceOpt;
class ConflictFamily;
class PartialSynthesis;
class ProtoconFileOpt;
class ProtoconOpt;
class SynthesisCtx;
bool
AddStabilization(vector<uint>& ret_actions,
PartialSynthesis& base_inst,
const AddConvergenceOpt& opt);
bool
AddStabilization(Xn::Sys& sys, const AddConvergenceOpt& opt);
bool
try_order_synthesis(vector<uint>& ret_actions,
PartialSynthesis& tape);
bool
rank_actions (Table< Table<uint> >& act_layers,
const Xn::Net& topo,
const vector<uint>& candidates,
const X::Fmla& xn,
const P::Fmla& legit);
void
oput_conflicts (const ConflictFamily& conflicts, const String& ofilename);
void
oput_conflicts (const ConflictFamily& conflicts, String ofilename, uint pcidx);
bool
initialize_conflicts(ConflictFamily& conflicts,
Table< FlatSet<uint> >& flat_conflicts,
const ProtoconOpt& exec_opt,
const AddConvergenceOpt& global_opt,
bool do_output);
void
multi_verify_stabilization
(uint i,
SynthesisCtx& synctx,
vector<uint>& ret_actions,
bool& solution_found,
const ProtoconFileOpt& infile_opt,
const ProtoconOpt& exec_opt,
AddConvergenceOpt& opt);
bool
stabilization_search(vector<uint>& ret_actions,
const ProtoconFileOpt& infile_opt,
const ProtoconOpt& exec_opt,
const AddConvergenceOpt& global_opt);
END_NAMESPACE
#endif
| 27.716667 | 79 | 0.678292 | grencez |
7aa89788f5fe20d8ab4751443f22855dbe48aab7 | 130 | cpp | C++ | src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp | Diksha-agg/Firmware_val | 1efc1ba06997d19df3ed9bd927cfb24401b0fe03 | [
"BSD-3-Clause"
] | null | null | null | src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp | Diksha-agg/Firmware_val | 1efc1ba06997d19df3ed9bd927cfb24401b0fe03 | [
"BSD-3-Clause"
] | null | null | null | src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp | Diksha-agg/Firmware_val | 1efc1ba06997d19df3ed9bd927cfb24401b0fe03 | [
"BSD-3-Clause"
] | null | null | null | version https://git-lfs.github.com/spec/v1
oid sha256:d962303659f52f13ea58ddbae625bd8a310a0dc6ef83cc5dfa45ca99a34ed6d4
size 13664
| 32.5 | 75 | 0.884615 | Diksha-agg |
7aaa233b81c179178b199f72c83c2d66ef249e8a | 13,009 | cpp | C++ | src/core/vl53l1_wait.cpp | rneurink/VL53L1X_FULL_API | ee8097ce27937bdf3b8f08d28fdee7658b4d9039 | [
"BSD-3-Clause"
] | 2 | 2020-07-25T20:56:23.000Z | 2020-08-25T23:54:21.000Z | src/core/vl53l1_wait.cpp | rneurink/VL53L1X_FULL_API | ee8097ce27937bdf3b8f08d28fdee7658b4d9039 | [
"BSD-3-Clause"
] | null | null | null | src/core/vl53l1_wait.cpp | rneurink/VL53L1X_FULL_API | ee8097ce27937bdf3b8f08d28fdee7658b4d9039 | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0081
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones mentioned above :
*
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
********************************************************************************
*
*/
/**
* @file vl53l1_wait.c
*
* @brief EwokPlus25 low level Driver wait function definition
*/
#include "vl53l1_ll_def.h"
#include "vl53l1_ll_device.h"
#include "../platform/vl53l1_platform.h"
#include "vl53l1_core.h"
#include "vl53l1_silicon_core.h"
#include "vl53l1_wait.h"
#include "vl53l1_register_settings.h"
#define LOG_FUNCTION_START(fmt, ...) \
_LOG_FUNCTION_START(VL53L1_TRACE_MODULE_CORE, fmt, ##__VA_ARGS__)
#define LOG_FUNCTION_END(status, ...) \
_LOG_FUNCTION_END(VL53L1_TRACE_MODULE_CORE, status, ##__VA_ARGS__)
#define LOG_FUNCTION_END_FMT(status, fmt, ...) \
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_CORE, status, \
fmt, ##__VA_ARGS__)
VL53L1_Error VL53L1_wait_for_boot_completion(
VL53L1_DEV Dev)
{
/* Waits for firmware boot to finish
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
uint8_t fw_ready = 0;
LOG_FUNCTION_START("");
if (pdev->wait_method == VL53L1_WAIT_METHOD_BLOCKING) {
/* blocking version */
status =
VL53L1_poll_for_boot_completion(
Dev,
VL53L1_BOOT_COMPLETION_POLLING_TIMEOUT_MS);
} else {
/* implement non blocking version below */
fw_ready = 0;
while (fw_ready == 0x00 && status == VL53L1_ERROR_NONE) {
status = VL53L1_is_boot_complete(
Dev,
&fw_ready);
if (status == VL53L1_ERROR_NONE) {
status = VL53L1_WaitMs(
Dev,
VL53L1_POLLING_DELAY_MS);
}
}
}
LOG_FUNCTION_END(status);
return status;
}
VL53L1_Error VL53L1_wait_for_firmware_ready(
VL53L1_DEV Dev)
{
/* If in timed mode or single shot then check firmware is ready
* before sending handshake
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
uint8_t fw_ready = 0;
uint8_t mode_start = 0;
LOG_FUNCTION_START("");
/* Filter out tje measure mode part of the mode
* start register
*/
mode_start =
pdev->sys_ctrl.system__mode_start &
VL53L1_DEVICEMEASUREMENTMODE_MODE_MASK;
/*
* conditional wait for firmware ready
* only waits for timed and single shot modes
*/
if ((mode_start == VL53L1_DEVICEMEASUREMENTMODE_TIMED) ||
(mode_start == VL53L1_DEVICEMEASUREMENTMODE_SINGLESHOT)) {
if (pdev->wait_method == VL53L1_WAIT_METHOD_BLOCKING) {
/* blocking version */
status =
VL53L1_poll_for_firmware_ready(
Dev,
VL53L1_RANGE_COMPLETION_POLLING_TIMEOUT_MS);
} else {
/* implement non blocking version below */
fw_ready = 0;
while (fw_ready == 0x00 && status == VL53L1_ERROR_NONE) {
status = VL53L1_is_firmware_ready(
Dev,
&fw_ready);
if (status == VL53L1_ERROR_NONE) {
status = VL53L1_WaitMs(
Dev,
VL53L1_POLLING_DELAY_MS);
}
}
}
}
LOG_FUNCTION_END(status);
return status;
}
VL53L1_Error VL53L1_wait_for_range_completion(
VL53L1_DEV Dev)
{
/* Wrapper function for waiting for range completion
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
uint8_t data_ready = 0;
LOG_FUNCTION_START("");
if (pdev->wait_method == VL53L1_WAIT_METHOD_BLOCKING) {
/* blocking version */
status =
VL53L1_poll_for_range_completion(
Dev,
VL53L1_RANGE_COMPLETION_POLLING_TIMEOUT_MS);
} else {
/* implement non blocking version below */
data_ready = 0;
while (data_ready == 0x00 && status == VL53L1_ERROR_NONE) {
status = VL53L1_is_new_data_ready(
Dev,
&data_ready);
if (status == VL53L1_ERROR_NONE) {
status = VL53L1_WaitMs(
Dev,
VL53L1_POLLING_DELAY_MS);
}
}
}
LOG_FUNCTION_END(status);
return status;
}
VL53L1_Error VL53L1_wait_for_test_completion(
VL53L1_DEV Dev)
{
/* Wrapper function for waiting for test mode completion
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
uint8_t data_ready = 0;
LOG_FUNCTION_START("");
if (pdev->wait_method == VL53L1_WAIT_METHOD_BLOCKING) {
/* blocking version */
status =
VL53L1_poll_for_range_completion(
Dev,
VL53L1_TEST_COMPLETION_POLLING_TIMEOUT_MS);
} else {
/* implement non blocking version below */
data_ready = 0;
while (data_ready == 0x00 && status == VL53L1_ERROR_NONE) {
status = VL53L1_is_new_data_ready(
Dev,
&data_ready);
if (status == VL53L1_ERROR_NONE) {
status = VL53L1_WaitMs(
Dev,
VL53L1_POLLING_DELAY_MS);
}
}
}
LOG_FUNCTION_END(status);
return status;
}
VL53L1_Error VL53L1_is_boot_complete(
VL53L1_DEV Dev,
uint8_t *pready)
{
/**
* Determines if the firmware finished booting by reading
* bit 0 of firmware__system_status register
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
uint8_t firmware__system_status = 0;
LOG_FUNCTION_START("");
/* read current range interrupt state */
status =
VL53L1_RdByte(
Dev,
VL53L1_FIRMWARE__SYSTEM_STATUS,
&firmware__system_status);
/* set *pready = 1 if new range data ready complete
* zero otherwise
*/
if ((firmware__system_status & 0x01) == 0x01) {
*pready = 0x01;
VL53L1_init_ll_driver_state(
Dev,
VL53L1_DEVICESTATE_SW_STANDBY);
} else {
*pready = 0x00;
VL53L1_init_ll_driver_state(
Dev,
VL53L1_DEVICESTATE_FW_COLDBOOT);
}
LOG_FUNCTION_END(status);
return status;
}
VL53L1_Error VL53L1_is_firmware_ready(
VL53L1_DEV Dev,
uint8_t *pready)
{
/**
* Determines if the firmware is ready to range
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
LOG_FUNCTION_START("");
status = VL53L1_is_firmware_ready_silicon(
Dev,
pready);
pdev->fw_ready = *pready;
LOG_FUNCTION_END(status);
return status;
}
VL53L1_Error VL53L1_is_new_data_ready(
VL53L1_DEV Dev,
uint8_t *pready)
{
/**
* Determines if new range data is ready by reading bit 0 of
* VL53L1_GPIO__TIO_HV_STATUS to determine the current state
* of output interrupt pin
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
uint8_t gpio__mux_active_high_hv = 0;
uint8_t gpio__tio_hv_status = 0;
uint8_t interrupt_ready = 0;
LOG_FUNCTION_START("");
gpio__mux_active_high_hv =
pdev->stat_cfg.gpio_hv_mux__ctrl &
VL53L1_DEVICEINTERRUPTLEVEL_ACTIVE_MASK;
if (gpio__mux_active_high_hv == VL53L1_DEVICEINTERRUPTLEVEL_ACTIVE_HIGH)
interrupt_ready = 0x01;
else
interrupt_ready = 0x00;
/* read current range interrupt state */
status = VL53L1_RdByte(
Dev,
VL53L1_GPIO__TIO_HV_STATUS,
&gpio__tio_hv_status);
/* set *pready = 1 if new range data ready complete zero otherwise */
if ((gpio__tio_hv_status & 0x01) == interrupt_ready)
*pready = 0x01;
else
*pready = 0x00;
LOG_FUNCTION_END(status);
return status;
}
VL53L1_Error VL53L1_poll_for_boot_completion(
VL53L1_DEV Dev,
uint32_t timeout_ms)
{
/**
* Polls the bit 0 of the FIRMWARE__SYSTEM_STATUS register to see if
* the firmware is ready.
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
LOG_FUNCTION_START("");
/* after reset for the firmware blocks I2C access while
* it copies the NVM data into the G02 host register banks
* The host must wait the required time to allow the copy
* to complete before attempting to read the firmware status
*/
status = VL53L1_WaitUs(
Dev,
VL53L1_FIRMWARE_BOOT_TIME_US);
if (status == VL53L1_ERROR_NONE)
status =
VL53L1_WaitValueMaskEx(
Dev,
timeout_ms,
VL53L1_FIRMWARE__SYSTEM_STATUS,
0x01,
0x01,
VL53L1_POLLING_DELAY_MS);
if (status == VL53L1_ERROR_NONE)
VL53L1_init_ll_driver_state(Dev, VL53L1_DEVICESTATE_SW_STANDBY);
LOG_FUNCTION_END(status);
return status;
}
VL53L1_Error VL53L1_poll_for_firmware_ready(
VL53L1_DEV Dev,
uint32_t timeout_ms)
{
/**
* Polls the bit 0 of the FIRMWARE__SYSTEM_STATUS register to see if
* the firmware is ready.
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
uint32_t start_time_ms = 0;
uint32_t current_time_ms = 0;
int32_t poll_delay_ms = VL53L1_POLLING_DELAY_MS;
uint8_t fw_ready = 0;
/* calculate time limit in absolute time */
VL53L1_GetTickCount(&start_time_ms); /*lint !e534 ignoring return*/
pdev->fw_ready_poll_duration_ms = 0;
/* wait until firmware is ready, timeout reached on error occurred */
while ((status == VL53L1_ERROR_NONE) &&
(pdev->fw_ready_poll_duration_ms < timeout_ms) &&
(fw_ready == 0)) {
status = VL53L1_is_firmware_ready(
Dev,
&fw_ready);
if (status == VL53L1_ERROR_NONE &&
fw_ready == 0 &&
poll_delay_ms > 0) {
status = VL53L1_WaitMs(
Dev,
poll_delay_ms);
}
/*
* Update polling time (Compare difference rather than
* absolute to negate 32bit wrap around issue)
*/
VL53L1_GetTickCount(¤t_time_ms); /*lint !e534 ignoring return*/
pdev->fw_ready_poll_duration_ms =
current_time_ms - start_time_ms;
}
if (fw_ready == 0 && status == VL53L1_ERROR_NONE)
status = VL53L1_ERROR_TIME_OUT;
LOG_FUNCTION_END(status);
return status;
}
VL53L1_Error VL53L1_poll_for_range_completion(
VL53L1_DEV Dev,
uint32_t timeout_ms)
{
/**
* Polls bit 0 of VL53L1_GPIO__TIO_HV_STATUS to determine
* the state of output interrupt pin
*
* Interrupt may be either active high or active low. Use active_high to
* select the required level check
*/
VL53L1_Error status = VL53L1_ERROR_NONE;
VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
uint8_t gpio__mux_active_high_hv = 0;
uint8_t interrupt_ready = 0;
LOG_FUNCTION_START("");
gpio__mux_active_high_hv =
pdev->stat_cfg.gpio_hv_mux__ctrl &
VL53L1_DEVICEINTERRUPTLEVEL_ACTIVE_MASK;
if (gpio__mux_active_high_hv == VL53L1_DEVICEINTERRUPTLEVEL_ACTIVE_HIGH)
interrupt_ready = 0x01;
else
interrupt_ready = 0x00;
status =
VL53L1_WaitValueMaskEx(
Dev,
timeout_ms,
VL53L1_GPIO__TIO_HV_STATUS,
interrupt_ready,
0x01,
VL53L1_POLLING_DELAY_MS);
LOG_FUNCTION_END(status);
return status;
}
| 23.271914 | 80 | 0.707433 | rneurink |
7abbbfc26107ee06e39ebdfdbf50df1d2c5338e6 | 10,495 | cpp | C++ | src/server.cpp | xiangp126/p2p_communication | 8ec3eb546fa4ba36876ba1e3158d98ffb9b1891f | [
"MIT"
] | null | null | null | src/server.cpp | xiangp126/p2p_communication | 8ec3eb546fa4ba36876ba1e3158d98ffb9b1891f | [
"MIT"
] | null | null | null | src/server.cpp | xiangp126/p2p_communication | 8ec3eb546fa4ba36876ba1e3158d98ffb9b1891f | [
"MIT"
] | null | null | null | #include <iostream>
#include "common.h"
#include "server.h"
pthread_mutex_t ticksLock;
pthread_mutexattr_t tickLockAttr;
using namespace std;
static ofstream logFile(LOGNAME, ofstream::app);
ostream & operator<<(ostream &out, PEERTICKTYPE &clientMap) {
out << "----------->>> List" << endl;
auto iter = clientMap.begin();
for (; iter != clientMap.end(); ++iter) {
out << " " << iter->first.ip << ":" << iter->first.port;
out << endl;
}
out << "<<< ---------------" << endl;
return out;
}
ostream & operator<<(ostream &out, PEERPUNCHEDTYPE &hashMap) {
out << "----------->>> List" << endl;
auto iter = hashMap.begin();
for (; iter != hashMap.end(); ++iter) {
}
out << "<<< ---------------" << endl;
return out;
}
/* unordered_map remove duplicate items */
void addClient(PEERTICKTYPE &clientMap, const PeerInfo &peer) {
pthread_mutex_lock(&ticksLock);
clientMap[peer].tick = TICKS_INI;
pthread_mutex_unlock(&ticksLock);
return;
}
void delClient(PEERTICKTYPE &clientMap, const PeerInfo &peer) {
pthread_mutex_lock(&ticksLock);
auto iterFind = clientMap.find(peer);
if (iterFind != clientMap.end()) {
clientMap.erase(iterFind);
} else {
write2Log(logFile, "delete peer error: did not found.");
}
pthread_mutex_unlock(&ticksLock);
return;
}
/* till now, did not use this function. */
void setReentrant(pthread_mutex_t &lock, pthread_mutexattr_t &attr) {
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&lock, &attr);
return;
}
void listInfo2Str(PEERTICKTYPE &clientMap, PEERPUNCHEDTYPE &punchMap,
char *msg) {
ostringstream oss;
ostringstream pOss;
string ip, port;
oss << "\n-------------------------- *** Login Info\n"
<< std::left << std::setfill(' ')
<< " " << setw(21) << "PEERINFO-IP-PORT"
<< " " << setw(3) << "TTL"
<< " " << setw(8) << "HOSTNAME\n";
pthread_mutex_lock(&ticksLock);
auto iter1 = clientMap.begin();
for (; iter1 != clientMap.end(); ++iter1) {
/* reformat port ip layout: 127.0.0.1 13000. */
ip = iter1->first.ip;
ip.push_back(' ');
/* clear str of pOss, notice that function pOss.clear()
* only reset the iostat. */
pOss.str("");
pOss.clear();
pOss << iter1->first.port;
port = pOss.str();
ip += port;
oss << " " << setw(21) << ip
<< " " << setw(3) << iter1->second.tick
<< " " << iter1->second.hostname << "\n";
}
oss << "*** --------------------------------------" << "\n";
oss << "\n-------------------------- *** Punch Info\n";
auto iter2 = punchMap.begin();
for (; iter2 != punchMap.end(); ++iter2) {
oss << " " << iter2->first.ip << " " << iter2->first.port
<< " " << " ===>> "
<< " " << iter2->second.ip << " " << iter2->second.port
<< "\n";
}
pthread_mutex_unlock(&ticksLock);
oss << "*** --------------------------------------" << endl;
memset(msg, 0, IBUFSIZ);
strcpy(msg, oss.str().c_str());
return;
}
void *handleTicks(void *arg) {
PEERTICKTYPE *hashMap = (PEERTICKTYPE *)arg;
while (1) {
pthread_mutex_lock(&ticksLock);
/* Erasing an element of a map invalidates iterators pointing
* to that element (after all that element has been deleted).
* You shouldn't reuse that iterator, instead, advance the
* iterator to the next element before the deletion takes place.
*/
auto iter = hashMap->begin();
#if 0
cout << "########## Enter --iter->second" << endl;
#endif
while (iter != hashMap->end()) {
--(iter->second).tick;
if ((iter->second).tick < 0) {
PeerInfo peer = iter->first;
hashMap->erase(iter++);
#if 1
/* check if punchMap still has this timeout info. */
cout << "############################### Delete It" << endl;
auto iterFind = punchMap.find(peer);
if (iterFind != punchMap.end()) {
cout << "Found Timeout Peer: " << peer << endl;
cout << "#######################################" << endl;
punchMap.erase(iterFind);
}
#endif
} else {
++iter;
}
}
pthread_mutex_unlock(&ticksLock);
/* sleep 1 s before next lock action. sleep some time is must.*/
sleep(1);
}
return NULL;
}
void onCalled(int sockFd, PEERTICKTYPE &clientMap,
PktInfo &packet, PeerInfo &peer) {
char message[IBUFSIZ];
memset(message, 0, IBUFSIZ);
ssize_t recvSize = udpRecvPkt(sockFd, peer, packet);
PKTTYPE type = packet.getHead().type;
switch (type) {
case PKTTYPE::MESSAGE:
{
/* check if peer has punched pair. */
cout << "Message From " << peer << ". " << endl;
pthread_mutex_lock(&ticksLock);
auto iterFind = punchMap.find(peer);
if (iterFind != punchMap.end()) {
/* TYPE SYN inform peer to fetch getHead().peer info
* from NET packet in addition with peer info. */
packet.getHead().type = PKTTYPE::SYN;
packet.getHead().peer = peer;
udpSendPkt(sockFd, punchMap[peer], packet);
}
pthread_mutex_unlock(&ticksLock);
break;
}
case PKTTYPE::HEARTBEAT:
{
pthread_mutex_lock(&ticksLock);
clientMap[peer].tick = TICKS_INI;
/* fix bug: under some uncertein circumstance handleTicks()
* will stop minus 'tick', so use upper code replacing below,
* seems work good.
*/
#if 0
auto iterFind = clientMap.find(peer);
if (iterFind != clientMap.end()) {
(iterFind->second).tick = TICKS_INI;
} else {
/* reentrant lock. */
addClient(clientMap, peer);
}
#endif
pthread_mutex_unlock(&ticksLock);
cout << "Heart Beat Received From " << peer << endl;
break;
}
case PKTTYPE::LOGIN:
{
addClient(clientMap, peer);
cout << peer << " login." << endl;
break;
}
case PKTTYPE::LOGOUT:
{
delClient(clientMap, peer);
#if 1
/* check if punchMap still has this timeout info. */
pthread_mutex_lock(&ticksLock);
cout << "############################### Delete It" << endl;
auto iterFind = punchMap.find(peer);
if (iterFind != punchMap.end()) {
cout << "Found To Delete Peer: " << peer << endl;
cout << "#######################################" << endl;
punchMap.erase(iterFind);
}
pthread_mutex_unlock(&ticksLock);
#endif
cout << peer << " logout." << endl;
break;
}
case PKTTYPE::LIST:
{
listInfo2Str(clientMap, punchMap, message);
makePacket(message, packet, PKTTYPE::MESSAGE);
udpSendPkt(sockFd, peer, packet);
break;
}
case PKTTYPE::PUNCH:
{
PeerInfo tPeer = packet.getHead().peer;
cout << "From " << peer << " To " << tPeer << endl;
/* check if both peer and tPeer has logined. */
pthread_mutex_lock(&ticksLock);
auto iterFind = clientMap.find(peer);
auto pFind = clientMap.find(tPeer);
if ((iterFind == clientMap.end())
|| (pFind == clientMap.end())) {
strcpy(message, "First, You Two Must All Be Logined.\
\nJust Type 'list' to See Info.");
makePacket(message, packet, PKTTYPE::ERROR);
udpSendPkt(sockFd, peer, packet);
break;
}
packet.getHead().peer = peer;
/* add to punchMap */
punchMap[peer] = tPeer;
punchMap[tPeer] = peer;
cout << punchMap << endl;
pthread_mutex_unlock(&ticksLock);
/* notice the punched peer. */
udpSendPkt(sockFd, tPeer, packet);
break;
}
case PKTTYPE::SYN:
{
cout << "From " << peer << endl;
break;
}
case PKTTYPE::ACK:
{
break;
}
case PKTTYPE::WHOAMI:
{
makePacket(message, packet, PKTTYPE::WHOAMI);
packet.getHead().peer = peer;
udpSendPkt(sockFd, peer, packet);
break;
}
case PKTTYPE::SETNAME:
{
/* get hostname sent by client and set it to TickInfo. */
getSetHostName(clientMap, peer, packet.getPayload());
break;
}
default:
break;
}
#if 1
cout << packet << "\n" << endl;
#endif
return;
}
void getSetHostName(PEERTICKTYPE &clientMap, PeerInfo &peer, char *payload) {
char fWord[MAXHOSTLEN];
#if 0
cout << "####### payload ****" << payload << endl;
#endif
int cnt = 0;
char *pTmp = payload;
char *pSet = fWord;
/* skip first command word till encountere a blank space. */
while ((*pTmp != ' ') && (cnt < MAXHOSTLEN - 1)) {
++pTmp;
++cnt;
}
/* while (*pTmp++ == ' ');
* will omit the first character of hostname. BUG
* */
while (*pTmp == ' ') {
++pTmp;
}
cnt = 0;
while ((*pTmp != '\0') && (cnt < MAXHOSTLEN - 1)) {
*pSet = *pTmp;
++pSet;
++pTmp;
++cnt;
}
fWord[cnt] = '\0';
strncpy(clientMap[peer].hostname, fWord, MAXHOSTLEN - 1);
return;
}
| 32.391975 | 78 | 0.471558 | xiangp126 |
7ac37c027b3b35973dbda5db8a45838a67b61889 | 876 | cc | C++ | Functions/reading-ifstream.cc | ULL-ESIT-IB-2021-2022/IB-class-code-examples | c17bad34c66bdc4f73862fc92ee929de9a207486 | [
"MIT"
] | 6 | 2021-11-01T19:35:17.000Z | 2022-01-14T18:13:53.000Z | Functions/reading-ifstream.cc | ULL-ESIT-IB-2021-2022/IB-class-code-examples | c17bad34c66bdc4f73862fc92ee929de9a207486 | [
"MIT"
] | null | null | null | Functions/reading-ifstream.cc | ULL-ESIT-IB-2021-2022/IB-class-code-examples | c17bad34c66bdc4f73862fc92ee929de9a207486 | [
"MIT"
] | 6 | 2021-10-30T19:04:31.000Z | 2022-03-11T19:29:32.000Z | /**
* Universidad de La Laguna
* Escuela Superior de Ingeniería y Tecnología
* Grado en Ingeniería Informática
* Informática Básica
*
* @author F. de Sande
* @date 23 Jun 2020
* @brief I/O Reading from ifstream
*
* @see https://en.cppreference.com/w/cpp/io/manip
*/
#include <fstream> // For the file streams
#include <iostream>
#include <string>
using namespace std; // Saving space
int main() {
int my_var1;
double my_var2, my_var3;
string my_string;
// Create an input file stream
ifstream input_file{"test_cols.txt", ios_base::in};
// Read data, until it is there
while (input_file >> my_var1 >> my_var2 >> my_string >> my_var3) {
cout << my_var1 << ", " << my_var2 << ", " << my_string << ", " << my_var3 << endl;
}
return (0);
}
// Content of the test_cols.txt file
// 1 2.34 One 0.21
// 2 2.004 two 0.23
// 3 -2.34 string 0.22
| 22.461538 | 87 | 0.649543 | ULL-ESIT-IB-2021-2022 |
7ac6262f1b39ea358b994bff0c1cea9c74a13af9 | 3,472 | cpp | C++ | Convert/src/M2/file_loader.cpp | blackdragonx61/M2-JSON-CONVERTER | 9e125586b698daaf32ad1e96c0bc38b6bdd2aca3 | [
"MIT"
] | 4 | 2021-09-22T21:34:04.000Z | 2022-03-04T15:47:37.000Z | Convert/src/M2/file_loader.cpp | blackdragonx61/M2-JSON-CONVERTER | 9e125586b698daaf32ad1e96c0bc38b6bdd2aca3 | [
"MIT"
] | null | null | null | Convert/src/M2/file_loader.cpp | blackdragonx61/M2-JSON-CONVERTER | 9e125586b698daaf32ad1e96c0bc38b6bdd2aca3 | [
"MIT"
] | null | null | null | #include "file_loader.h"
#include <assert.h>
CMemoryTextFileLoader::CMemoryTextFileLoader()
{
}
CMemoryTextFileLoader::~CMemoryTextFileLoader()
{
}
bool CMemoryTextFileLoader::SplitLineByTab(DWORD dwLine, TTokenVector* pstTokenVector)
{
pstTokenVector->reserve(10);
pstTokenVector->clear();
const std::string& c_rstLine = GetLineString(dwLine);
const int c_iLineLength = c_rstLine.length();
if (0 == c_iLineLength)
return false;
int basePos = 0;
do
{
int beginPos = c_rstLine.find_first_of("\t", basePos);
pstTokenVector->push_back(c_rstLine.substr(basePos, beginPos - basePos));
basePos = beginPos + 1;
} while (basePos < c_iLineLength && basePos > 0);
return true;
}
bool CMemoryTextFileLoader::SplitLine(DWORD dwLine, std::vector<std::string>* pstTokenVector, const char * c_szDelimeter)
{
pstTokenVector->clear();
std::string stToken;
const std::string & c_rstLine = GetLineString(dwLine);
DWORD basePos = 0;
do
{
int beginPos = c_rstLine.find_first_not_of(c_szDelimeter, basePos);
if (beginPos < 0)
return false;
int endPos;
if (c_rstLine[beginPos] == '#' && c_rstLine.compare(beginPos, 4, "#--#") != 0)
{
return false;
}
else if (c_rstLine[beginPos] == '"')
{
++beginPos;
endPos = c_rstLine.find_first_of("\"", beginPos);
if (endPos < 0)
return false;
basePos = endPos + 1;
}
else
{
endPos = c_rstLine.find_first_of(c_szDelimeter, beginPos);
basePos = endPos;
}
pstTokenVector->push_back(c_rstLine.substr(beginPos, endPos - beginPos));
if (int(c_rstLine.find_first_not_of(c_szDelimeter, basePos)) < 0)
break;
} while (basePos < c_rstLine.length());
return true;
}
int CMemoryTextFileLoader::SplitLine2(DWORD dwLine, TTokenVector* pstTokenVector, const char* c_szDelimeter)
{
pstTokenVector->reserve(10);
pstTokenVector->clear();
std::string stToken;
const std::string& c_rstLine = GetLineString(dwLine);
DWORD basePos = 0;
do
{
int beginPos = c_rstLine.find_first_not_of(c_szDelimeter, basePos);
if (beginPos < 0)
return -1;
int endPos;
if (c_rstLine[beginPos] == '"')
{
++beginPos;
endPos = c_rstLine.find_first_of("\"", beginPos);
if (endPos < 0)
return -2;
basePos = endPos + 1;
}
else
{
endPos = c_rstLine.find_first_of(c_szDelimeter, beginPos);
basePos = endPos;
}
pstTokenVector->push_back(c_rstLine.substr(beginPos, endPos - beginPos));
if (int(c_rstLine.find_first_not_of(c_szDelimeter, basePos)) < 0)
break;
} while (basePos < c_rstLine.length());
return 0;
}
DWORD CMemoryTextFileLoader::GetLineCount()
{
return m_stLineVector.size();
}
bool CMemoryTextFileLoader::CheckLineIndex(DWORD dwLine)
{
if (dwLine >= m_stLineVector.size())
return false;
return true;
}
const std::string & CMemoryTextFileLoader::GetLineString(DWORD dwLine)
{
assert(CheckLineIndex(dwLine));
return m_stLineVector[dwLine];
}
void CMemoryTextFileLoader::Bind(int bufSize, const void* c_pvBuf)
{
m_stLineVector.clear();
const char * c_pcBuf = (const char *)c_pvBuf;
std::string stLine;
int pos = 0;
while (pos < bufSize)
{
const char c = c_pcBuf[pos++];
if ('\n' == c || '\r' == c)
{
if (pos < bufSize)
if ('\n' == c_pcBuf[pos] || '\r' == c_pcBuf[pos])
++pos;
m_stLineVector.push_back(stLine);
stLine = "";
}
else if (c < 0)
{
stLine.append(c_pcBuf + (pos-1), 2);
++pos;
}
else
{
stLine += c;
}
}
m_stLineVector.push_back(stLine);
}
| 19.18232 | 121 | 0.679435 | blackdragonx61 |
7acd9e946c6ca74c7a80aca9542ff51c5e30f033 | 2,706 | cpp | C++ | examples/SplineDev.cpp | bmharper/xo | 575429591c166cc70db60385d2a6563d0f9bc9ed | [
"Unlicense"
] | 7 | 2015-12-18T04:17:29.000Z | 2020-03-13T15:38:54.000Z | examples/SplineDev.cpp | benharper123/xo | 575429591c166cc70db60385d2a6563d0f9bc9ed | [
"Unlicense"
] | null | null | null | examples/SplineDev.cpp | benharper123/xo | 575429591c166cc70db60385d2a6563d0f9bc9ed | [
"Unlicense"
] | 4 | 2016-09-18T13:16:02.000Z | 2022-03-23T11:33:53.000Z | #include "../xo/xo.h"
#include <omp.h>
// This was used when developing the spline rendering code
void Render(xo::Canvas2D* canvas, int cx, int cy, float scale);
void xoMain(xo::SysWnd* wnd)
{
int left = 550;
int width = 1000;
int top = 60;
int height = 1000;
wnd->SetPosition(xo::Box(left, top, left + width, top + height), xo::SysWnd::SetPosition_Move | xo::SysWnd::SetPosition_Size);
//auto magic = xo::Color::RGBA(0xff, 0xf0, 0xf0, 0xff);
xo::DomCanvas* canvas = wnd->Doc()->Root.AddCanvas();
canvas->StyleParsef("width: %dep; height: %dep;", width, height);
canvas->SetImageSizeOnly(width, height);
canvas->OnMouseMove([width, height](xo::Event& ev) {
xo::DomCanvas* canvas = (xo::DomCanvas*) ev.Target;
xo::Canvas2D* cx = canvas->GetCanvas2D();
//Render(cx, (int) ev.Points[0].x, (int) ev.Points[0].y);
Render(cx, width / 2, height / 2, FLT_EPSILON + ev.PointsRel[0].x * 0.0001f);
canvas->ReleaseCanvas(cx);
});
}
float Eval(float x, float y)
{
//return 0.0005f * (x - sqrt(y));
return 0.0005f * (y - x*x);
//return 0.0005f * (x * x + y * 10.0f);
}
float Eval2(float x, float y)
{
float eps = 0.1f;
float g = Eval(x, y);
float dx = (Eval(x + eps, y) - Eval(x - eps, y)) / eps;
float dy = (Eval(x, y + eps) - Eval(x, y - eps)) / eps;
return g / sqrt(dx * dx + dy * dy);
//return sqrt(dx * dx + dy * dy);
}
void Render(xo::Canvas2D* canvas, int cx, int cy, float scale)
{
//canvas->Fill(xoColor::White());
//xoBox box(0, 0, 7, 7);
//box.Offset(cx - box.Width() / 2.0f, cy - box.Height() / 2.0f);
//canvas->FillRect(box, xoColor::RGBA(200, 50, 50, 255));
double start = xo::TimeAccurateSeconds();
uint8_t lut[256];
for (int i = 0; i < 256; i++)
{
lut[i] = i;
//lut[i] = 2 * abs(127 - i);
//lut[i] = xoLinear2SRGB(i / 255.0f);
}
const float iscale = 255.0f / scale;
int height = canvas->Height();
int width = canvas->Width();
// This omp directive gives close to an 8x speedup on VS 2015, quad core skylake.
#pragma omp parallel for
for (int y = 0; y < height; y++)
{
float yf = scale * (float) (cy - y); // we invert Y, so that up is positive
xo::RGBA* line = (xo::RGBA*) canvas->RowPtr(y);
for (int x = 0; x < width; x++)
{
float xf = scale * (float) (x - cx);
float v = iscale * Eval2(xf, yf);
// This is useful for illustration - having a gradient either side of the zero line
//float v = 127.0f + iscale * Eval(xf, yf));
int ilut = xo::Clamp((int) v, 0, 255);
uint8_t lum = lut[ilut];
line[x] = xo::RGBA::Make(lum, lum, lum, 255);
}
}
canvas->Invalidate(xo::Box(0, 0, canvas->Width(), canvas->Height()));
xo::Trace("canvas render: %.3f ms\n", 1000.0f * (xo::TimeAccurateSeconds() - start));
} | 29.736264 | 127 | 0.608647 | bmharper |
7ad071cb5777505968fc4620b5d2ebad0926b154 | 464 | cpp | C++ | 08. classes-and-objects/homework/02. distance.cpp | ihristova11/cpp-fundamentals | a72a0fb9e302921760a81f0a3436039b34b0981f | [
"MIT"
] | null | null | null | 08. classes-and-objects/homework/02. distance.cpp | ihristova11/cpp-fundamentals | a72a0fb9e302921760a81f0a3436039b34b0981f | [
"MIT"
] | null | null | null | 08. classes-and-objects/homework/02. distance.cpp | ihristova11/cpp-fundamentals | a72a0fb9e302921760a81f0a3436039b34b0981f | [
"MIT"
] | null | null | null | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
struct Point
{
Point(double xp, double yp)
{
x = xp;
y = yp;
}
public:
double x;
double y;
double distanceToPoint(Point a)
{
return sqrt(pow(abs(a.x - this->x), 2.0) + (pow(abs(a.y - this->y), 2.0)));
}
};
int main()
{
int x, y;
cin >> x >> y;
Point a(x, y);
cin >> x >> y;
Point b(x, y);
cout << fixed << setprecision(3) << b.distanceToPoint(a);
return 0;
} | 12.540541 | 77 | 0.575431 | ihristova11 |
7ad487f6292732c62c147417a586cf00245677d9 | 59 | cpp | C++ | test_lib/test_lib.cpp | antonte/coddle | 906c0262c1f7ce251d40879f2377e77c2ff1db9f | [
"MIT"
] | null | null | null | test_lib/test_lib.cpp | antonte/coddle | 906c0262c1f7ce251d40879f2377e77c2ff1db9f | [
"MIT"
] | 2 | 2015-04-09T23:55:06.000Z | 2017-04-15T01:37:36.000Z | test_lib/test_lib.cpp | antonte/coddle | 906c0262c1f7ce251d40879f2377e77c2ff1db9f | [
"MIT"
] | null | null | null | #include "test_lib.hpp"
int test_lib()
{
return 1000;
}
| 8.428571 | 23 | 0.661017 | antonte |
7ad7066d9fe6444678b3f5cd01d67b925e152743 | 51,314 | cc | C++ | src/half_edge_mesh.cc | paulmiller/glFun | 39df2c7f92b41c09d618b81e2016f1c530fb2108 | [
"Unlicense"
] | null | null | null | src/half_edge_mesh.cc | paulmiller/glFun | 39df2c7f92b41c09d618b81e2016f1c530fb2108 | [
"Unlicense"
] | null | null | null | src/half_edge_mesh.cc | paulmiller/glFun | 39df2c7f92b41c09d618b81e2016f1c530fb2108 | [
"Unlicense"
] | null | null | null | #include "half_edge_mesh.h"
#include "scoped_timer.h"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <limits>
#include <memory>
#include <stack>
#include <unordered_map>
HalfEdgeMesh::VertexIndex HalfEdgeMesh::AddVertex() {
auto [index, realloc_offset] = vertices_.Append({});
if(realloc_offset) {
for(HalfEdge &edge: half_edges_) {
if(edge.vertex)
edge.vertex = (Vertex*)(uintptr_t(edge.vertex) + realloc_offset);
}
}
return index;
}
HalfEdgeMesh::VertexPositionIndex
HalfEdgeMesh::AddVertexPosition(const Vector3d &position) {
auto [index, realloc_offset] = vertex_positions_.Append(position);
if(realloc_offset) {
for(Vertex &vertex: vertices_) {
if(vertex.position)
vertex.position =
(Vector3d*)(uintptr_t(vertex.position) + realloc_offset);
}
}
return index;
}
HalfEdgeMesh::VertexNormalIndex
HalfEdgeMesh::AddVertexNormal(const Vector3d &normal) {
auto [index, realloc_offset] = vertex_normals_.Append(normal);
if(realloc_offset) {
for(HalfEdge &edge: half_edges_) {
if(edge.normal)
edge.normal = (Vector3d*)(uintptr_t(edge.normal) + realloc_offset);
}
}
return index;
}
HalfEdgeMesh::HalfEdgeIndex HalfEdgeMesh::AddHalfEdge() {
auto [index, realloc_offset] = half_edges_.Append({});
if(realloc_offset) {
for(Vertex &vertex: vertices_) {
if(vertex.edge)
vertex.edge = (HalfEdge*)(uintptr_t(vertex.edge) + realloc_offset);
}
for(HalfEdge &other_edge: half_edges_) {
if(other_edge.twin_edge)
other_edge.twin_edge =
(HalfEdge*)(uintptr_t(other_edge.twin_edge) + realloc_offset);
if(other_edge.next_edge)
other_edge.next_edge =
(HalfEdge*)(uintptr_t(other_edge.next_edge) + realloc_offset);
}
for(Face &face: faces_) {
if(face.edge)
face.edge = (HalfEdge*)(uintptr_t(face.edge) + realloc_offset);
}
}
return index;
}
HalfEdgeMesh::FaceIndex HalfEdgeMesh::AddFace() {
auto [index, realloc_offset] = faces_.Append({});
if(realloc_offset) {
for(HalfEdge &edge: half_edges_) {
if(edge.face)
edge.face = (Face*)(uintptr_t(edge.face) + realloc_offset);
}
}
return index;
}
HalfEdgeMesh::ObjectIndex HalfEdgeMesh::AddObject(std::string name) {
auto [index, realloc_offset] = objects_.Append({std::move(name)});
if(realloc_offset) {
for(Face &face: faces_) {
if(face.object)
face.object = (Object*)(uintptr_t(face.object) + realloc_offset);
}
}
return index;
}
#ifndef NDEBUG
void HalfEdgeMesh::CheckPtrs() const {
for(const Vertex &vertex: vertices_) {
vertex_positions_.CheckPtr(vertex.position);
half_edges_.CheckPtr(vertex.edge);
}
for(const HalfEdge &edge: half_edges_) {
vertices_.CheckPtr(edge.vertex);
vertex_normals_.CheckPtr(edge.normal);
half_edges_.CheckPtr(edge.twin_edge);
half_edges_.CheckPtr(edge.next_edge);
faces_.CheckPtr(edge.face);
}
for(const Face &face: faces_) {
half_edges_.CheckPtr(face.edge);
objects_.CheckPtr(face.object);
}
}
void HalfEdgeMesh::CheckAll() const {
PrintingScopedTimer timer("HalfEdgeMesh::CheckAll");
CheckPtrs();
// Every time a mesh component with index = X is referenced by some other
// component, mark vector[X] = true in the corresponding vector. They should
// become all true; there should be no unused elements.
std::vector<bool> vertices_used(vertices_.size());
std::vector<bool> vertex_positions_used(vertex_positions_.size());
std::vector<bool> vertex_normals_used(vertex_normals_.size());
std::vector<bool> faces_used(faces_.size());
std::vector<bool> objects_used(objects_.size());
for(const HalfEdge &edge: half_edges_) {
{
auto &vp = vertex_positions_;
auto &vn = vertex_normals_;
vertices_used [ IndexOf(edge.vertex ).value ] = true;
faces_used [ IndexOf(edge.face ).value ] = true;
objects_used [ IndexOf(edge.face->object ).value ] = true;
vertex_positions_used [ vp.IndexOf(edge.vertex->position).value ] = true;
vertex_normals_used [ vn.IndexOf(edge.normal ).value ] = true;
}
assert(edge.vertex->position->isfinite());
assert(edge.normal->isfinite());
assert(&edge != edge.twin_edge);
assert(&edge == edge.twin_edge->twin_edge);
assert(edge.next_edge != edge.twin_edge);
assert(edge.twin_edge->next_edge != &edge);
assert(edge.face != edge.twin_edge->face);
assert(edge.vertex != edge.twin_edge->vertex);
assert(edge.face->object == edge.twin_edge->face->object);
// square of the minimum allowable distance between Vertices
// (v.len2() < 0.0001) == (v.len() < 0.01)
constexpr double min2 = 0.0001;
const Vector3d *start = edge.twin_edge->vertex->position;
const Vector3d *end = edge.vertex->position;
// TODO threshold?
assert((*end - *start).len2() >= min2);
// compare to every other edge on the same object and ensure they're
// different (slow)
for(const HalfEdge &other_edge: half_edges_) {
if(&other_edge == &edge) continue;
if(&other_edge == edge.twin_edge) continue;
if(other_edge.face->object != edge.face->object) continue;
const Vector3d *other_start = other_edge.twin_edge->vertex->position;
const Vector3d *other_end = other_edge.vertex->position;
// TODO threshold?
assert((*start - *other_start).len2() >= min2 ||
(*end - *other_end).len2() >= min2);
assert((*start - *other_end).len2() >= min2 ||
(*end - *other_start).len2() >= min2);
}
// walk the HalfEdges surrounding edge.face
int edge_num = 0;
bool found_face_edge = false;
const HalfEdge *previous_edge = nullptr;
const HalfEdge *current_edge = &edge;
do {
assert(current_edge->face == edge.face);
if(current_edge == edge.face->edge)
found_face_edge = true;
previous_edge = current_edge;
current_edge = current_edge->next_edge;
edge_num++;
} while(current_edge != &edge);
assert(edge_num >= 3);
assert(found_face_edge);
assert(previous_edge != nullptr);
// check normals
/*
switch(edge.type) {
case NormalType::Constant:
assert( *(edge.normal) == *(previous_edge->normal) );
break;
case NormalType::Spherical:
assert(start->len2() == end->len2());
break;
case NormalType::X_Cylindrical:
assert(start->y * start->y + start->z * start->z ==
end->y * end->y + end->z * end->z);
break;
case NormalType::Y_Cylindrical:
assert(start->z * start->z + start->z * start->z ==
end->z * end->z + end->z * end->z);
break;
case NormalType::Z_Cylindrical:
assert(start->x * start->x + start->y * start->y ==
end->x * end->x + end->y * end->y);
break;
default:
assert(0);
}
*/
// walk the HalfEdges surrounding edge.vertex
bool found_this_edge = false;
const HalfEdge *first_outgoing_edge = edge.vertex->edge;
const HalfEdge *outgoing_edge = first_outgoing_edge;
do {
const HalfEdge *incoming_edge = outgoing_edge->twin_edge;
assert(incoming_edge->vertex == edge.vertex);
if(incoming_edge == &edge)
found_this_edge = true;
outgoing_edge = incoming_edge->next_edge;
} while(outgoing_edge != first_outgoing_edge);
assert(found_this_edge);
}
// no unused elements
auto end = vertices_used.end();
assert(end == std::find(vertices_used.begin(), end, false));
end = vertex_positions_used.end();
assert(end == std::find(vertex_positions_used.begin(), end, false));
end = vertex_normals_used.end();
assert(end == std::find(vertex_normals_used.begin(), end, false));
end = faces_used.end();
assert(end == std::find(faces_used.begin(), end, false));
end = objects_used.end();
assert(end == std::find(objects_used.begin(), end, false));
}
#endif // #ifndef NDEBUG
std::unordered_set<HalfEdgeMesh::Face*>
HalfEdgeMesh::FindConnectedFaces(Face *start_face) {
std::unordered_set<Face*> visited;
std::stack<Face*> stack;
stack.push(start_face);
while(!stack.empty()) {
Face *current_face = stack.top();
stack.pop();
visited.insert(current_face);
HalfEdge *start_edge = current_face->edge;
HalfEdge *current_edge = start_edge;
do {
Face *next_face = current_edge->twin_edge->face;
if(!visited.count(next_face))
stack.push(next_face);
current_edge = current_edge->next_edge;
} while(current_edge != start_edge);
}
return visited;
}
WavFrObj HalfEdgeMesh::MakeWavFrObj() const {
PrintingScopedTimer timer("HalfEdgeMesh::MakeWavFrObj");
size_t num_vertex_positions = vertex_positions_.size();
std::vector<Vector3f> wavfr_vertices;
wavfr_vertices.reserve(num_vertex_positions);
for(const Vector3d &pos: vertex_positions_)
wavfr_vertices.push_back(
Vector3f{float(pos.x), float(pos.y), float(pos.z)});
size_t num_vertex_normals = vertex_normals_.size();
std::vector<Vector3f> wavfr_normals;
wavfr_normals.reserve(num_vertex_normals);
for(const Vector3d &normal: vertex_normals_)
wavfr_normals.push_back(
Vector3f{float(normal.x), float(normal.y), float(normal.z)});
size_t num_objects = objects_.size();
std::vector<WavFrObj::ObjObject> wavfr_objects;
wavfr_objects.reserve(num_objects);
for(const Object &object: objects_)
wavfr_objects.push_back(WavFrObj::ObjObject(object.name));
for(const Face &face: faces_) {
std::vector<WavFrObj::ObjVert> wavfr_face_verts;
const HalfEdge *first_edge = face.edge;
const HalfEdge *edge = first_edge;
do {
size_t position_index =
vertex_positions_.IndexOf(edge->vertex->position).value;
size_t normal_index = vertex_normals_.IndexOf(edge->normal).value;
wavfr_face_verts.push_back(
WavFrObj::ObjVert{int(position_index), -1, int(normal_index)});
edge = edge->next_edge;
} while(edge != first_edge);
size_t object_index = IndexOf(face.object).value;
wavfr_objects[object_index].addFace(
std::move(wavfr_face_verts));
}
return WavFrObj(std::move(wavfr_vertices), std::vector<UvCoord>(),
std::move(wavfr_normals), std::move(wavfr_objects));
}
Vector3d HalfEdgeMesh::CenterOfBoundingBox(FaceIndex face_index) const {
constexpr double inf = std::numeric_limits<double>::infinity();
double x_min = inf, x_max = -inf,
y_min = inf, y_max = -inf,
z_min = inf, z_max = -inf;
HalfEdge *first_edge = get(face_index).edge;
HalfEdge *edge = first_edge;
do {
Vector3d position = *(edge->vertex->position);
x_min = std::min(x_min, position.x); x_max = std::max(x_max, position.x);
y_min = std::min(y_min, position.y); y_max = std::max(y_max, position.y);
z_min = std::min(z_min, position.z); z_max = std::max(z_max, position.z);
edge = edge->next_edge;
} while(edge != first_edge);
assert(std::isfinite(x_min)); assert(std::isfinite(x_max));
assert(std::isfinite(y_min)); assert(std::isfinite(y_max));
assert(std::isfinite(z_min)); assert(std::isfinite(z_max));
return Vector3d{ (x_min+x_max)/2, (y_min+y_max)/2, (z_min+z_max)/2 };
}
HalfEdgeMesh::VertexIndex
HalfEdgeMesh::CutEdge(HalfEdgeIndex edge_index, double t) {
VertexIndex new_vertex_index = AddVertex();
HalfEdgeIndex new_edge_a_index = AddHalfEdge();
HalfEdgeIndex new_edge_b_index = AddHalfEdge();
// reallocs may invalidate pointers, so add all components before getting
// pointers
HalfEdge *edge = &get(edge_index);
HalfEdge *twin_edge = edge->twin_edge;
HalfEdge *new_edge_a = &get(new_edge_a_index);
HalfEdge *new_edge_b = &get(new_edge_b_index);
Vertex *start = edge->twin_edge->vertex;
Vertex *end = edge->vertex;
Vertex *new_vertex = &get(new_vertex_index);
// the edges now look like this:
// _ _ _ _ _ _
// 🡕 edge 🡖
// start * * end
// 🡔 _ _ _ _ _ _ 🡗
// edge.twin_edge
// TODO deduplicate positions
Vector3d start_position = *(start->position);
Vector3d end_position = *(end->position);
Vector3d new_vertex_position =
start_position + t * (end_position - start_position);
new_vertex->position = &get(AddVertexPosition(new_vertex_position));
edge->vertex = new_vertex;
edge->twin_edge->vertex = new_vertex;
// the edges now look like this:
// _ _ _
// 🡕 edge 🡖
// * * new *
// 🡔 _ _ _ 🡗
// twin_edge
new_edge_a->twin_edge = edge->twin_edge;
new_edge_a->next_edge = edge->next_edge;
new_edge_a->face = edge->face;
new_edge_a->vertex = end;
new_edge_a->normal = edge->normal;
new_edge_b->twin_edge = edge;
new_edge_b->next_edge = twin_edge->next_edge;
new_edge_b->face = twin_edge->face;
new_edge_b->vertex = start;
new_edge_b->normal = twin_edge->normal;
edge->twin_edge->twin_edge = new_edge_a;
edge->twin_edge->next_edge = new_edge_b;
edge->twin_edge = new_edge_b;
edge->next_edge = new_edge_a;
new_vertex->edge = new_edge_a;
// the edges now look like this:
// _ _ _ _ _ _
// 🡕 edge 🡖 🡕 new a 🡖
// * * *
// 🡔 _ _ _ 🡗 🡔 _ _ _ 🡗
// new b twin_edge
/*
#ifndef NDEBUG
CheckAll();
#endif
*/
return new_vertex_index;
}
HalfEdgeMesh::HalfEdgeIndex HalfEdgeMesh::CutFace(
FaceIndex face_idx, VertexIndex vertex_a_idx, VertexIndex vertex_b_idx
) {
assert(vertex_a_idx != vertex_b_idx);
Vertex *vertex_a = &get(vertex_a_idx);
Vertex *vertex_b = &get(vertex_b_idx);
HalfEdgeIndex edge_a_in_index, edge_a_out_index;
HalfEdgeIndex edge_b_in_index, edge_b_out_index;
{
// reallocs may invalidate these pointers, so confine them to this block
Face *face = &get(face_idx);
HalfEdge *edge_a_in = nullptr, *edge_a_out = nullptr;
HalfEdge *edge_b_in = nullptr, *edge_b_out = nullptr;
HalfEdge *first_edge = face->edge;
HalfEdge *current_edge = first_edge;
do {
if(current_edge->vertex == vertex_a) {
edge_a_in = current_edge;
edge_a_out = current_edge->next_edge;
}
if(current_edge->vertex == vertex_b) {
edge_b_in = current_edge;
edge_b_out = current_edge->next_edge;
}
current_edge = current_edge->next_edge;
} while(current_edge != first_edge);
assert(edge_a_in); assert(edge_a_out);
assert(edge_b_in); assert(edge_b_out);
if(edge_a_in == edge_b_out || edge_a_out == edge_b_in)
return HalfEdgeIndex();
edge_a_in_index = IndexOf(edge_a_in);
edge_a_out_index = IndexOf(edge_a_out);
edge_b_in_index = IndexOf(edge_b_in);
edge_b_out_index = IndexOf(edge_b_out);
}
// invalidates Face, HalfEdge pointers
FaceIndex new_face_idx = AddFace();
// TODO support other edge types
HalfEdgeIndex new_edge_idx = AddHalfEdge();
HalfEdgeIndex new_edge_twin_idx = AddHalfEdge();
HalfEdge *new_edge = &get(new_edge_idx);
HalfEdge *new_edge_twin = &get(new_edge_twin_idx);
Face *face = &get(face_idx);
Face *new_face = &get(new_face_idx);
HalfEdge *edge_a_in = &get(edge_a_in_index);
HalfEdge *edge_a_out = &get(edge_a_out_index);
HalfEdge *edge_b_in = &get(edge_b_in_index);
HalfEdge *edge_b_out = &get(edge_b_out_index);
// the face now looks like this:
//
// / \
// edge_a_in / \ edge_b_out
// / \
// vertex_a * face * vertex_b
// \ /
// edge_a_out \ / edge_b_in
// \ /
new_face->object = face->object;
face->edge = new_edge;
new_face->edge = new_edge_twin;
new_edge->twin_edge = new_edge_twin;
new_edge->next_edge = edge_b_out;
new_edge->face = face;
new_edge->vertex = vertex_b;
new_edge->normal = edge_b_in->normal;
new_edge_twin->twin_edge = new_edge;
new_edge_twin->next_edge = edge_a_out;
new_edge_twin->face = new_face;
new_edge_twin->vertex = vertex_a;
new_edge_twin->normal = edge_a_in->normal;
edge_a_in->next_edge = new_edge;
edge_b_in->next_edge = new_edge_twin;
HalfEdge *current_edge = edge_a_out;
do {
current_edge->face = new_face;
current_edge = current_edge->next_edge;
} while(current_edge != new_edge_twin);
// the faces now look like this:
//
// / face \
// edge_a_in / \ edge_b_out
// / new_edge \
// vertex_a * - - - - - - - - - * vertex_b
// \ new_edge_twin /
// edge_a_out \ / edge_b_in
// \ new_face /
/*
#ifndef NDEBUG
CheckAll();
#endif
*/
return new_edge_twin_idx;
}
void HalfEdgeMesh::LoopCut(std::unordered_set<HalfEdgeIndex> edge_idxs) {
PrintingScopedTimer timer("HalfEdgeMesh::LoopCut");
#ifndef NDEBUG
// "edge_idxs" must contain only matched pairs of HalfEdges
for(HalfEdgeIndex edge_idx: edge_idxs) {
HalfEdgeIndex twin_idx = IndexOf(get(edge_idx).twin_edge);
assert(edge_idxs.count(twin_idx));
}
// ensure every Vertex has 0 or 2 incoming and outgoing edges in "edge_idxs"
// i.e. there is at most 1 cutting path through each Vertex
for(Vertex &vertex: vertices_) {
int outgoing_cut_edges = 0, incoming_cut_edges = 0;
HalfEdge *first_outgoing_edge = vertex.edge;
HalfEdge *outgoing_edge = first_outgoing_edge;
do {
HalfEdge *incoming_edge = outgoing_edge->twin_edge;
if(edge_idxs.count(IndexOf(outgoing_edge)))
outgoing_cut_edges++;
if(edge_idxs.count(IndexOf(incoming_edge)))
incoming_cut_edges++;
outgoing_edge = incoming_edge->next_edge;
} while(outgoing_edge != first_outgoing_edge);
assert(outgoing_cut_edges == incoming_cut_edges);
assert(outgoing_cut_edges == 0 || outgoing_cut_edges == 2);
}
#endif
// a map from each Index in "edge_idxs" to the Index of the next HalfEdge in
// the loop
std::unordered_map<HalfEdgeIndex, HalfEdgeIndex> next_loop_edge_idxs;
// populate "next_loop_edge_idxs"
for(HalfEdgeIndex edge_idx: edge_idxs) {
assert(!next_loop_edge_idxs.count(edge_idx));
HalfEdge *edge = &get(edge_idx);
// find the HalfEdge following "edge" in the loop: this is the HalfEdge
// exiting the Vertex "edge->vertex", which is not the twin of "edge", and
// is in the set of loop edges "edge_idxs"
HalfEdge *first_outgoing_edge = edge->vertex->edge;
HalfEdge *outgoing_edge = first_outgoing_edge;
while(outgoing_edge == edge->twin_edge ||
!edge_idxs.count(IndexOf(outgoing_edge))) {
outgoing_edge = outgoing_edge->twin_edge->next_edge;
// the loop should terminate before getting back to
// "first_outgoing_edge_id"
if(outgoing_edge == first_outgoing_edge) {
std::cout << "HalfEdgeMesh::LoopCut failed: couldn't follow loop "
"through vertex at " << *(edge->vertex->position) << '\n';
return;
}
}
next_loop_edge_idxs[edge_idx] = IndexOf(outgoing_edge);
}
// when splitting a Vertex, one side gets the original Vertex and marks it as
// "claimed" here, and subsequent visits must create new Vertices
std::unordered_set<VertexIndex> claimed_vertex_indices;
// Splitting an Object is the same, except it's possible for a single Object
// to be cut by multiple, unconnected loops. We don't know how many new
// Objects are needed until all loops are cut. So when making a cut, add the
// new Face to "new_face_indices". These Faces, and all the Faces connected to
// them, will get Objects assigned at the end.
std::unordered_set<FaceIndex> new_face_indices;
// make the cuts
while(!edge_idxs.empty()) {
// take an arbitrary HalfEdge and cut its associated loop
HalfEdgeIndex first_edge_idx = *(edge_idxs.begin());
FaceIndex new_face_index = AddFace();
new_face_indices.insert(new_face_index);
Face *new_face = &get(new_face_index); // invalidates Face pointers
// may be reassigned to a new Object later
new_face->object = get(first_edge_idx).face->object;
// remember the 1st 3 vertices along the loop to get a normal vector later
Vector3d sample_vertex_positions[3];
int sample_vertices = 0;
VertexIndex saved_split_vertex_index;
HalfEdgeIndex prev_edge_idx;
HalfEdgeIndex edge_idx = first_edge_idx;
do {
// TODO pick these to avoid NaN normals
if(sample_vertices < 3) {
Vector3d *position = get(edge_idx).vertex->position;
sample_vertex_positions[sample_vertices] = *position;
sample_vertices++;
}
// invalidates HalfEdge pointers
HalfEdge *new_twin_edge = &get(AddHalfEdge());
HalfEdge *edge = &get(edge_idx);
HalfEdge *old_twin_edge = edge->twin_edge;
new_twin_edge->twin_edge = edge;
new_twin_edge->face = new_face;
VertexIndex old_start_vertex_index = IndexOf(old_twin_edge->vertex);
if(claimed_vertex_indices.count(old_start_vertex_index)) {
// invalidates Vertex pointers
VertexIndex new_start_vertex_index = AddVertex();
Vertex *new_start_vertex = &get(new_start_vertex_index);
new_start_vertex->position = get(old_start_vertex_index).position;
new_start_vertex->edge = edge;
new_twin_edge->vertex = new_start_vertex;
// Update all the HalfEdges on this side of the cut, that used to point
// to the claimed Vertex, to point to the new Vertex, starting with the
// "previous" HalfEdge. Or if we can't, because this is the first
// iteration, and "prev_edge_idx" is null, then save the new Vertex so
// we can update it later.
if(prev_edge_idx.IsNull()) {
saved_split_vertex_index = new_start_vertex_index;
} else {
HalfEdge *first_incoming_edge = &get(prev_edge_idx);
HalfEdge *incoming_edge = first_incoming_edge;
for(;;) {
assert(incoming_edge->vertex == old_twin_edge->vertex);
incoming_edge->vertex = new_start_vertex;
if(edge_idxs.count(IndexOf(incoming_edge->next_edge)))
break;
incoming_edge = incoming_edge->next_edge->twin_edge;
// we should end the fan before going all the way around the Vertex
assert(incoming_edge != first_incoming_edge);
}
}
} else {
claimed_vertex_indices.insert(old_start_vertex_index);
old_twin_edge->vertex->edge = edge;
new_twin_edge->vertex = old_twin_edge->vertex;
}
// "edge" points at "new_twin_edge", but "old_twin_edge" may still
// point at "edge". This will be fixed when "old_twin_edge"'s loop comes
// up for cutting.
edge->twin_edge = new_twin_edge;
new_face->edge = new_twin_edge;
edge_idxs.erase(edge_idx);
prev_edge_idx = edge_idx;
edge_idx = next_loop_edge_idxs[edge_idx];
} while(edge_idx != first_edge_idx);
assert(new_face->edge != nullptr);
if(!saved_split_vertex_index.IsNull()) {
// Update the HalfEdges on this side of the cut for the saved Vertex. The
// difference is that we can't check "edge_idxs" to see when we've
// reached the end of the fan, because all the HalfEdges on this side of
// the loop cut have been removed from "edge_idxs". But since the
// "previous" HalfEdge is now the one right behind "loop_start_edge" in
// the loop, we can use "loop_start_edge" to mark the end of the fan.
assert(!prev_edge_idx.IsNull());
Vertex *new_start_vertex = &get(saved_split_vertex_index);
HalfEdge *first_incoming_edge = &get(prev_edge_idx);
HalfEdge *incoming_edge = first_incoming_edge;
HalfEdge *loop_start_edge = &get(edge_idx);
for(;;) {
assert(incoming_edge->vertex != new_start_vertex);
incoming_edge->vertex = new_start_vertex;
if(incoming_edge->next_edge == loop_start_edge)
break;
incoming_edge = incoming_edge->next_edge->twin_edge;
// we should end the fan before going all the way around the Vertex
assert(incoming_edge != first_incoming_edge);
}
}
assert(sample_vertices == 3);
Vector3d &a = sample_vertex_positions[0];
Vector3d &b = sample_vertex_positions[1];
Vector3d &c = sample_vertex_positions[2];
Vector3d face_normal = cross(c - a, b - a).unit();
assert(face_normal.isfinite());
// invalidates previous normal pointers
Vector3d *new_normal = &get(AddVertexNormal(face_normal));
edge_idx = first_edge_idx;
do {
HalfEdge *edge = &get(edge_idx);
HalfEdge *new_twin_edge = edge->twin_edge;
new_twin_edge->next_edge = get(prev_edge_idx).twin_edge;
new_twin_edge->normal = new_normal;
prev_edge_idx = edge_idx;
edge_idx = next_loop_edge_idxs[edge_idx];
} while(edge_idx != first_edge_idx);
}
std::unordered_set<ObjectIndex> claimed_object_indices;
while(!new_face_indices.empty()) {
FaceIndex new_face_index = *(new_face_indices.begin());
new_face_indices.erase(new_face_index);
Face *new_face = &get(new_face_index);
ObjectIndex old_object_index = IndexOf(new_face->object);
Object *new_object = nullptr;
if(claimed_object_indices.count(old_object_index)) {
std::string name = get(old_object_index).name + "-cut";
// invalidates Object pointers
new_object = &get(AddObject(std::move(name)));
} else {
claimed_object_indices.insert(old_object_index);
}
std::unordered_set<Face*> faces = FindConnectedFaces(new_face);
for(Face *face: faces) {
new_face_indices.erase(IndexOf(face));
if(new_object)
face->object = new_object;
}
}
/*
#ifndef NDEBUG
CheckAll();
#endif
*/
}
std::unordered_set<HalfEdgeMesh::HalfEdgeIndex>
HalfEdgeMesh::Bisect(const Vector3d &normal) {
PrintingScopedTimer timer("HalfEdgeMesh::Bisect");
// Objects which should be ignored, because they don't pass through the
// bisecting plane (though they may have components inside the plane)
std::unordered_set<ObjectIndex> ignored_objects;
// populate "ignored_objects"
// TODO edged HalfEdges may pass through plane despite all Vertices being on
// one side
{
// an Object's location relative to the bisecting plane
enum Location : char {
Unknown = 0,
InFront, // all Vertices are on or in front of the plane
Behind, // all Vertices are on or behind the plane
Through // Object has Vertices both in front and behind
};
// Find each Object's location by checking all its Vertices. Objects
// contained entirely inside the plane will remain "Unknown".
size_t objects_size = objects_.size();
std::vector<Location> object_locations(objects_size);
for(const Vertex &vertex: vertices_) {
size_t object_index = IndexOf(vertex.edge->face->object).value;
Location object_location = object_locations[object_index];
// if we've already found this Object's Vertices on both sides, don't
// check the remaining Vertices
if(object_location == Through) continue;
double d = dot(normal, *(vertex.position));
if(d == 0 || std::isnan(d)) continue;
Location vertex_location = (d < 0 ? Behind : InFront);
if(object_location != vertex_location) {
if(object_location == Unknown) {
// this Vertex is on the same side as the previous Vertices
object_locations[object_index] = vertex_location;
} else {
// this Vertex is on a different side as the previous Vertices
object_locations[object_index] = Through;
}
}
}
// ignore Objects which don't pass through the plane
for(size_t i = 0; i < objects_size; i++) {
if(object_locations[i] != Through)
ignored_objects.insert(ObjectIndex(i));
}
}
// all vertices lying on the plane: both new vertices created to bisect
// edges, and existing vertices that happened to be on the plane already
std::unordered_set<VertexIndex> planar_vertex_indices;
// all edges (and their twins) lying on the plane: new edges bisecting
// faces, and existing edges
std::unordered_set<HalfEdgeIndex> planar_edge_indices;
// a set of HalfEdge IDs to skip, because we already checked their twin
std::unordered_set<HalfEdge*> checked_twin_edges;
// TODO support other edge types
size_t edge_num = half_edges_.size();
for(HalfEdgeIndex edge_index(0); edge_index < edge_num; ++edge_index) {
HalfEdge *edge = &get(edge_index);
if(ignored_objects.count(IndexOf(edge->face->object))) continue;
if(checked_twin_edges.count(edge)) continue;
checked_twin_edges.insert(edge->twin_edge);
// line equation: S + t⋅D
Vector3d S = *(edge->twin_edge->vertex->position);
Vector3d D = *(edge->vertex->position) - S;
// plane equation: 0 = a⋅x + b⋅y + c⋅z
// (where abc are the xyz componets of normal)
//
// solve for t:
// 0 = a⋅(Sx + t⋅Dx) + b⋅(Sy + t⋅Dy) + c⋅(Sz + t⋅Dz)
// 0 = a⋅Sx + a⋅t⋅Dx + b⋅Sy + b⋅t⋅Dy + c⋅Sz + c⋅t⋅Dz
// 0 = t⋅(a⋅Dx + b⋅Dy + c⋅Dz) + a⋅Sx + b⋅Sy + c⋅Sz
// a⋅Sx + b⋅Sy + c⋅Sz dot(normal, S)
// t = - -------------------- = - ----------------
// a⋅Dx + b⋅Dy + c⋅Dz dot(normal, D)
// if the line parallel to the plane, then "normal" and D are at right
// angles, and dot_D == 0
double dot_D = dot(normal, D);
// if the dot_D == 0 && dot_S == 0, then the line is inside the plane
double dot_S = dot(normal, S);
if(dot_D == 0) {
if(dot_S == 0) {
planar_edge_indices.insert(edge_index);
planar_edge_indices.insert(IndexOf(edge->twin_edge));
}
} else {
double t = - dot_S / dot_D;
// TODO threshold?
constexpr double epsilon = 0.0001;
// does the intersection lie within the line segment?
if(epsilon < t && t < 1-epsilon) {
// Invalidates HalfEdge pointers. We got "edge_num" before the for
// loop, so we won't iterate over any new HalfEdges appended by
// CutEdge.
planar_vertex_indices.insert(CutEdge(edge_index, t));
}
// does the intersection lie at one end of the segment?
if(-epsilon < t && t < epsilon) {
VertexIndex start_vertex = IndexOf(get(edge_index).twin_edge->vertex);
planar_vertex_indices.insert(start_vertex);
} else if(1-epsilon < t && t < 1+epsilon) {
VertexIndex end_vertex = IndexOf(get(edge_index).vertex);
planar_vertex_indices.insert(end_vertex);
}
}
}
#ifndef NDEBUG
CheckAll();
#endif
std::vector<VertexIndex> planar_vertex_indices_on_this_face;
size_t face_num = faces_.size();
for(FaceIndex face_index(0); face_index < face_num; ++face_index) {
int num_vertices = 0;
HalfEdge *first_edge = get(face_index).edge;
HalfEdge *current_edge = first_edge;
do {
VertexIndex vertex_index = IndexOf(current_edge->vertex);
if(planar_vertex_indices.count(vertex_index))
planar_vertex_indices_on_this_face.push_back(vertex_index);
num_vertices++;
current_edge = current_edge->next_edge;
} while(current_edge != first_edge);
// does this face have enough vertices for CutFace to work?
if(num_vertices >= 4) {
size_t num_vertices_on_plane = planar_vertex_indices_on_this_face.size();
if(num_vertices_on_plane == 2) {
// invalidates Face and HalfEdge pointers
HalfEdgeIndex new_edge_index = CutFace(
face_index,
planar_vertex_indices_on_this_face[0],
planar_vertex_indices_on_this_face[1]
);
if(!new_edge_index.IsNull()) {
planar_edge_indices.insert(new_edge_index);
planar_edge_indices.insert(IndexOf(get(new_edge_index).twin_edge));
}
} else if(num_vertices_on_plane > 2) {
// TODO support concave faces
std::cout << "HalfEdgeMesh::Bisect skipping face at "
<< CenterOfBoundingBox(face_index) << " with "
<< num_vertices_on_plane << " of " << num_vertices
<< " on the plane\n";
}
}
planar_vertex_indices_on_this_face.clear();
}
#ifndef NDEBUG
CheckAll();
#endif
return planar_edge_indices;
}
template<typename T>
std::tuple<HalfEdgeMesh::ComponentIndex<T>, uintptr_t>
HalfEdgeMesh::ComponentList<T>::Append(T e) {
uintptr_t realloc_offset = 0; // unsigned so overflow is defined
if(size_ == capacity_) {
if(capacity_ == 0)
capacity_ = 8;
else
capacity_ *= 2;
T *new_list;
if(std::is_pod<T>::value) {
new_list = reinterpret_cast<T*>(
std::realloc(list_, capacity_ * sizeof(T)));
} else {
new_list = new T[capacity_];
for(size_t i = 0; i < size_; i++)
new_list[i] = std::move(list_[i]);
delete[] list_;
}
if(list_) {
// Cast to uintptr_t before subtraction. Subtracting pointers directly
// gives a result in units of sizeof(T) bytes, suitable for offsetting
// an index into an array of T[]. However, "list_" and "new_list" may
// not be divisible by sizeof(T) (if alignof(T) < sizeof(T)), and more
// importantly may have different remainders divided by sizeof(T), so
// pointer subtraction may give an inexact result.
realloc_offset = uintptr_t(new_list) - uintptr_t(list_);
}
list_ = new_list;
}
list_[size_] = std::move(e);
ComponentIndex<T> index(size_);
size_++;
return {index, realloc_offset};
}
namespace {
// RXDY = sqrt(X)/Y
constexpr double R2D2 = 0.7071067811865475244008443621048490392848; // beep boop
constexpr double R3D2 = 0.8660254037844386467637231707529361834714;
constexpr double R6D4 = 0.6123724356957945245493210186764728479915;
constexpr double R10D4 = 0.7905694150420948329997233861081796334299;
const double AlignedPlaneOffsets[] = {
-1, -R3D2, -R2D2, -R6D4, -0.5, 0, 0.5, R6D4, R2D2, R3D2, 1 };
const double CylinderRadii[] = { R2D2, R10D4, R3D2, 1 };
} // namespace
/*
create an icosohedron with a unit circumsphere
an icosohedron's vertices make 3 golden rectangles:
* - - - - - - - - *
| |
| |
| |
| |
* - - -| / |- - - - - - *
/ | / | /
/ | / | /
/ / /
/ * /
* - - - - - - - -| - - - - - - - - - *
| | |
| | / |
| | / |
| | / |
* - -|/ - - - - - *
*
number the vertices like so:
* 0
/| 8 * - - - * 9
/ | | |
/ | 4 * - - - - - - - * 7 | |
/ * 1 / / | |
3 * / / / | |
| / 5 * - - - - - - - * 6 | |
| / | |
|/ 11 * - - - * 10
2 * Z
| X
|/
Y - *
for a 2 x 2⋅φ rectangle, vertex 0 is at coordinates:
( φ, 0, 1 )
with distance from the origin:
________
√ 1² + φ²
to scale vertices down onto a unit sphere, divide everything by that distance,
and call the resulting values L and S:
________ ________
( L, 0, S ) = ( φ ÷ √ 1² + φ², 0, 1 ÷ √ 1² + φ² )
*/
HalfEdgeMesh MakeIcosohedron() {
PrintingScopedTimer timer("MakeIcosohedron");
constexpr double L = 0.8506508083520399321815404970630110722404;
constexpr double S = 0.5257311121191336060256690848478766072855;
Vector3d icosohedron_vertices[12] = {
Vector3d{ L, 0, S },
Vector3d{ L, 0, -S },
Vector3d{ -L, 0, -S },
Vector3d{ -L, 0, S },
Vector3d{ S, L, 0 },
Vector3d{ -S, L, 0 },
Vector3d{ -S, -L, 0 },
Vector3d{ S, -L, 0 },
Vector3d{ 0, S, L },
Vector3d{ 0, -S, L },
Vector3d{ 0, -S, -L },
Vector3d{ 0, S, -L },
};
int icosohedron_faces[20][3] = {
{ 0, 1, 4},
{ 0, 7, 1},
{ 2, 3, 5},
{ 2, 6, 3},
{ 4, 5, 8},
{ 4,11, 5},
{ 6, 7, 9},
{ 6,10, 7},
{ 0, 4, 8},
{ 0, 9, 7},
{ 0, 8, 9},
{ 3, 9, 8},
{ 3, 8, 5},
{ 3, 6, 9},
{ 1,11, 4},
{ 1, 7,10},
{ 1,10,11},
{ 2,11,10},
{ 2, 5,11},
{ 2,10, 6},
};
using VertexIndex = HalfEdgeMesh::VertexIndex;
using VertexNormalIndex = HalfEdgeMesh::VertexNormalIndex;
using VertexPositionIndex = HalfEdgeMesh::VertexPositionIndex;
using HalfEdgeIndex = HalfEdgeMesh::HalfEdgeIndex;
using FaceIndex = HalfEdgeMesh::FaceIndex;
using ObjectIndex = HalfEdgeMesh::ObjectIndex;
using Vertex = HalfEdgeMesh::Vertex;
using HalfEdge = HalfEdgeMesh::HalfEdge;
using Face = HalfEdgeMesh::Face;
using Object = HalfEdgeMesh::Object;
using NormalType = HalfEdgeMesh::NormalType;
HalfEdgeMesh mesh;
ObjectIndex object = mesh.AddObject("sphere");
Object *object_ptr = &mesh[object];
VertexPositionIndex positions[12];
VertexNormalIndex normals[12];
VertexIndex vertices[12];
for(int i = 0; i < 12; i++) {
// on a unit sphere, position and normal vectors are identical
positions[i] = mesh.AddVertexPosition(icosohedron_vertices[i]);
normals[i] = mesh.AddVertexNormal(icosohedron_vertices[i]);
vertices[i] = mesh.AddVertex();
mesh[vertices[i]].position = &mesh[positions[i]];
}
std::unordered_map<std::pair<VertexIndex,VertexIndex>, HalfEdgeIndex> edges;
for(int i = 0; i < 20; i++) {
int a_number = icosohedron_faces[i][0];
int b_number = icosohedron_faces[i][1];
int c_number = icosohedron_faces[i][2];
VertexIndex a = vertices[a_number];
VertexIndex b = vertices[b_number];
VertexIndex c = vertices[c_number];
Vertex *a_ptr = &mesh[a];
Vertex *b_ptr = &mesh[b];
Vertex *c_ptr = &mesh[c];
HalfEdgeIndex ab = mesh.AddHalfEdge();
HalfEdgeIndex bc = mesh.AddHalfEdge();
HalfEdgeIndex ca = mesh.AddHalfEdge();
HalfEdge *ab_ptr = &mesh[ab];
HalfEdge *bc_ptr = &mesh[bc];
HalfEdge *ca_ptr = &mesh[ca];
edges.insert(std::make_pair(std::make_pair(a,b), ab));
edges.insert(std::make_pair(std::make_pair(b,c), bc));
edges.insert(std::make_pair(std::make_pair(c,a), ca));
if(a_ptr->edge == nullptr) a_ptr->edge = ab_ptr;
if(b_ptr->edge == nullptr) b_ptr->edge = bc_ptr;
if(c_ptr->edge == nullptr) c_ptr->edge = ca_ptr;
auto ba_iter = edges.find(std::make_pair(b,a));
if(ba_iter != edges.end()) {
HalfEdge *ba_ptr = &mesh[ba_iter->second];
ab_ptr->twin_edge = ba_ptr;
ba_ptr->twin_edge = ab_ptr;
}
auto cb_iter = edges.find(std::make_pair(c,b));
if(cb_iter != edges.end()) {
HalfEdge *cb_ptr = &mesh[cb_iter->second];
bc_ptr->twin_edge = cb_ptr;
cb_ptr->twin_edge = bc_ptr;
}
auto ac_iter = edges.find(std::make_pair(a,c));
if(ac_iter != edges.end()) {
HalfEdge *ac_ptr = &mesh[ac_iter->second];
ca_ptr->twin_edge = ac_ptr;
ac_ptr->twin_edge = ca_ptr;
}
ab_ptr->next_edge = bc_ptr;
bc_ptr->next_edge = ca_ptr;
ca_ptr->next_edge = ab_ptr;
ab_ptr->vertex = b_ptr;
bc_ptr->vertex = c_ptr;
ca_ptr->vertex = a_ptr;
ab_ptr->normal = &mesh[normals[b_number]];
bc_ptr->normal = &mesh[normals[c_number]];
ca_ptr->normal = &mesh[normals[a_number]];
ab_ptr->type = NormalType::Spherical;
bc_ptr->type = NormalType::Spherical;
ca_ptr->type = NormalType::Spherical;
FaceIndex abc = mesh.AddFace();
Face *abc_ptr = &mesh[abc];
abc_ptr->edge = ab_ptr;
abc_ptr->object = object_ptr;
ab_ptr->face = abc_ptr;
bc_ptr->face = abc_ptr;
ca_ptr->face = abc_ptr;
}
#ifndef NDEBUG
mesh.CheckAll();
#endif
return mesh;
}
void SubdivideGeosphere(HalfEdgeMesh &mesh) {
PrintingScopedTimer timer("SubdivideGeosphere");
using VertexIndex = HalfEdgeMesh::VertexIndex;
using VertexNormalIndex = HalfEdgeMesh::VertexNormalIndex;
using VertexPositionIndex = HalfEdgeMesh::VertexPositionIndex;
using HalfEdgeIndex = HalfEdgeMesh::HalfEdgeIndex;
using FaceIndex = HalfEdgeMesh::FaceIndex;
using Vertex = HalfEdgeMesh::Vertex;
using HalfEdge = HalfEdgeMesh::HalfEdge;
using NormalType = HalfEdgeMesh::NormalType;
#ifndef NDEBUG
{
// all Faces must be triangles
size_t face_count = mesh.FaceCount();
for(FaceIndex f(0); f < face_count; ++f) {
HalfEdge *start = mesh[f].edge;
assert(start->next_edge->next_edge->next_edge == start);
}
// all Vertices must be on the surface of a unit sphere
size_t position_count = mesh.VertexPositionCount();
for(VertexPositionIndex p; p < position_count; ++p) {
double len2 = mesh[p].len2();
assert(0.9999 < len2 && len2 < 1.0001); // TODO threshold?
}
}
#endif
// after cutting an edge, put its twin here so we don't cut the twin again
std::unordered_set<HalfEdgeIndex> cut_twins;
std::unordered_set<VertexIndex> new_vertices;
size_t edge_count = mesh.HalfEdgeCount();
for(HalfEdgeIndex e(0); e < edge_count; ++e) {
if(cut_twins.count(e)) continue;
cut_twins.insert(mesh.IndexOf(mesh[e].twin_edge));
VertexIndex v = mesh.CutEdge(e, 0.5);
new_vertices.insert(v);
Vertex *v_ptr = &mesh[v];
Vector3d *p_ptr = v_ptr->position;
*p_ptr = p_ptr->unit();
VertexNormalIndex n = mesh.AddVertexNormal(*p_ptr);
Vector3d *n_ptr = &mesh[n];
HalfEdge *incoming_edge_1 = v_ptr->edge->twin_edge;
HalfEdge *incoming_edge_2 = incoming_edge_1->next_edge->twin_edge;
incoming_edge_1->normal = n_ptr;
incoming_edge_1->type = NormalType::Spherical;
incoming_edge_2->normal = n_ptr;
incoming_edge_2->type = NormalType::Spherical;
}
size_t face_count = mesh.FaceCount();
for(FaceIndex f(0); f < face_count; ++f) {
// find the 3 vertices to be joined
VertexIndex new_vertices_on_this_face[3];
int new_vertices_found = 0;
HalfEdge *start_edge = mesh[f].edge;
HalfEdge *current_edge = start_edge;
for(;;) {
VertexIndex v = mesh.IndexOf(current_edge->vertex);
if(new_vertices.count(v)) {
new_vertices_on_this_face[new_vertices_found] = v;
new_vertices_found++;
if(new_vertices_found == 3)
break;
}
current_edge = current_edge->next_edge;
assert(current_edge != start_edge);
}
mesh.CutFace(f, new_vertices_on_this_face[0], new_vertices_on_this_face[1]);
mesh.CutFace(f, new_vertices_on_this_face[1], new_vertices_on_this_face[2]);
mesh.CutFace(f, new_vertices_on_this_face[2], new_vertices_on_this_face[0]);
}
#ifndef NDEBUG
mesh.CheckAll();
#endif
}
/*
each cell's components are indexed like so:
vertices: faces: * - - - - - - *
/ /
/ 5 /
7 - - - - - 5 * / /- * *
/| /| /| * - - - - - - * | /|
/ | / | / | | | / |
6 - - - - - 4 | / | | 1 | / |
| | | | * | * - - - - - - * | * |
| 3 - - - -|- 1 Z | 3 | | | | | 2 |
| / | / | X | * | | - * | *
|/ |/ |/ | / | 0 | | /
2 - - - - - 0 Y - * | / | | | /
|/ | | - * |/
* * - - - - - - * / *
14 / 4 /
half-edges: * - - - - - - * / /
/ / * - - - - - - *
10 / / 8
/ /
* - - - - - - *
12
15
* * - - - - - - * *
11 /| | | 9 /|
/ | | | / |
/ | 22 23 | 13 | 19 / | 18
* | * - - - - - - * | * |
| | | | | | | |
| * | * - - - - | - * | *
20 | / 21 | 7 | 17 16 | /
| / | | | /
|/ 3 | | |/ 1
* * - - - - - - * *
5
6
* - - - - - - *
/ /
2 / / 0
/ /
* - - - - - - *
4
*/
HalfEdgeMesh MakeAlignedCells() {
PrintingScopedTimer timer("MakeAlignedCells");
HalfEdgeMesh mesh;
using VertexIndex = HalfEdgeMesh::VertexIndex;
using VertexNormalIndex = HalfEdgeMesh::VertexNormalIndex;
using VertexPositionIndex = HalfEdgeMesh::VertexPositionIndex;
using HalfEdgeIndex = HalfEdgeMesh::HalfEdgeIndex;
using FaceIndex = HalfEdgeMesh::FaceIndex;
using ObjectIndex = HalfEdgeMesh::ObjectIndex;
// create the 6 axis-aligned normal vectors
VertexNormalIndex x_pos = mesh.AddVertexNormal( UnitX_Vector3d);
VertexNormalIndex x_neg = mesh.AddVertexNormal(-UnitX_Vector3d);
VertexNormalIndex y_pos = mesh.AddVertexNormal( UnitY_Vector3d);
VertexNormalIndex y_neg = mesh.AddVertexNormal(-UnitY_Vector3d);
VertexNormalIndex z_pos = mesh.AddVertexNormal( UnitZ_Vector3d);
VertexNormalIndex z_neg = mesh.AddVertexNormal(-UnitZ_Vector3d);
constexpr size_t size = std::size(AlignedPlaneOffsets);
// a unique_ptr to a size x size x size 3D array of VertexPositionIndex
auto positions = std::make_unique<VertexPositionIndex[][size][size]>(size);
// populate vertex positions at every intersection of 3 axis-aligned planes
for(size_t zi = 0; zi < size; zi++) {
double z = AlignedPlaneOffsets[zi];
for(size_t yi = 0; yi < size; yi++) {
double y = AlignedPlaneOffsets[yi];
for(size_t xi = 0; xi < size; xi++) {
double x = AlignedPlaneOffsets[xi];
positions.get()[zi][yi][xi] =
mesh.AddVertexPosition(Vector3d{x,y,z});
}
}
}
for(size_t zi = 0; zi < size-1; zi++) {
for(size_t yi = 0; yi < size-1; yi++) {
for(size_t xi = 0; xi < size-1; xi++) {
std::string object_name = std::to_string(zi) + '-' +
std::to_string(yi) + '-' + std::to_string(xi);
ObjectIndex object = mesh.AddObject(std::move(object_name));
FaceIndex faces[6];
for(int i = 0; i < 6; i++) {
faces[i] = mesh.AddFace();
mesh[faces[i]].object = &mesh[object];
}
VertexIndex vertices[8];
vertices[0] = mesh.AddVertex();
vertices[1] = mesh.AddVertex();
vertices[2] = mesh.AddVertex();
vertices[3] = mesh.AddVertex();
vertices[4] = mesh.AddVertex();
vertices[5] = mesh.AddVertex();
vertices[6] = mesh.AddVertex();
vertices[7] = mesh.AddVertex();
mesh[vertices[0]].position = &mesh[positions.get()[zi ][yi ][xi ]];
mesh[vertices[1]].position = &mesh[positions.get()[zi ][yi ][xi+1]];
mesh[vertices[2]].position = &mesh[positions.get()[zi ][yi+1][xi ]];
mesh[vertices[3]].position = &mesh[positions.get()[zi ][yi+1][xi+1]];
mesh[vertices[4]].position = &mesh[positions.get()[zi+1][yi ][xi ]];
mesh[vertices[5]].position = &mesh[positions.get()[zi+1][yi ][xi+1]];
mesh[vertices[6]].position = &mesh[positions.get()[zi+1][yi+1][xi ]];
mesh[vertices[7]].position = &mesh[positions.get()[zi+1][yi+1][xi+1]];
// create the 12 edges (2 half-edges each) of the cell
HalfEdgeIndex edges[24];
for(int i = 0; i < 24; i++)
edges[i] = mesh.AddHalfEdge();
// a macro to help fill in the edge data
#define hcm_set_linear_edge(this, twin, next, face_, vert, norm) { \
HalfEdgeMesh::HalfEdge &edge = mesh[edges[this]]; \
edge.twin_edge = &mesh[edges[twin]]; \
edge.next_edge = &mesh[edges[next]]; \
edge.face = &mesh[faces[face_]]; \
edge.vertex = &mesh[vertices[vert]]; \
edge.normal = &mesh[norm]; \
}
// this twin next face vert norm
hcm_set_linear_edge( 0, 1, 4, 4, 0, z_neg)
hcm_set_linear_edge( 1, 0, 18, 2, 1, y_neg)
hcm_set_linear_edge( 2, 3, 6, 4, 3, z_neg)
hcm_set_linear_edge( 3, 2, 20, 3, 2, y_pos)
hcm_set_linear_edge( 4, 5, 2, 4, 2, z_neg)
hcm_set_linear_edge( 5, 4, 17, 0, 0, x_neg)
hcm_set_linear_edge( 6, 7, 0, 4, 1, z_neg)
hcm_set_linear_edge( 7, 6, 23, 1, 3, x_pos)
hcm_set_linear_edge( 8, 9, 14, 5, 5, z_pos)
hcm_set_linear_edge( 9, 8, 16, 2, 4, y_neg)
hcm_set_linear_edge( 10, 11, 12, 5, 6, z_pos)
hcm_set_linear_edge( 11, 10, 22, 3, 7, y_pos)
hcm_set_linear_edge( 12, 13, 8, 5, 4, z_pos)
hcm_set_linear_edge( 13, 12, 21, 0, 6, x_neg)
hcm_set_linear_edge( 14, 15, 10, 5, 7, z_pos)
hcm_set_linear_edge( 15, 14, 19, 1, 5, x_pos)
hcm_set_linear_edge( 16, 17, 1, 2, 0, y_neg)
hcm_set_linear_edge( 17, 16, 13, 0, 4, x_neg)
hcm_set_linear_edge( 18, 19, 9, 2, 5, y_neg)
hcm_set_linear_edge( 19, 18, 7, 1, 1, x_pos)
hcm_set_linear_edge( 20, 21, 11, 3, 6, y_pos)
hcm_set_linear_edge( 21, 20, 5, 0, 2, x_neg)
hcm_set_linear_edge( 22, 23, 3, 3, 3, y_pos)
hcm_set_linear_edge( 23, 22, 15, 1, 7, x_pos)
#undef hcm_set_linear_edge
mesh[faces[0]].edge = &mesh[edges[5]];
mesh[faces[1]].edge = &mesh[edges[7]];
mesh[faces[2]].edge = &mesh[edges[1]];
mesh[faces[3]].edge = &mesh[edges[3]];
mesh[faces[4]].edge = &mesh[edges[2]];
mesh[faces[5]].edge = &mesh[edges[8]];
mesh[vertices[0]].edge = &mesh[edges[1]];
mesh[vertices[1]].edge = &mesh[edges[0]];
mesh[vertices[2]].edge = &mesh[edges[2]];
mesh[vertices[3]].edge = &mesh[edges[3]];
mesh[vertices[4]].edge = &mesh[edges[8]];
mesh[vertices[5]].edge = &mesh[edges[9]];
mesh[vertices[6]].edge = &mesh[edges[11]];
mesh[vertices[7]].edge = &mesh[edges[10]];
}
}
}
#ifndef NDEBUG
mesh.CheckAll();
#endif
return mesh;
}
| 34.978868 | 80 | 0.608762 | paulmiller |
7adc771d4ad2194a9a2a255551fb24ac549e72b7 | 1,136 | cpp | C++ | dll/src/EngineAPI/Color.cpp | Dingf/GDCommunityLauncher | 43ca2d6fa8024dffad1e0919c609b0d48a3427b7 | [
"MIT"
] | null | null | null | dll/src/EngineAPI/Color.cpp | Dingf/GDCommunityLauncher | 43ca2d6fa8024dffad1e0919c609b0d48a3427b7 | [
"MIT"
] | null | null | null | dll/src/EngineAPI/Color.cpp | Dingf/GDCommunityLauncher | 43ca2d6fa8024dffad1e0919c609b0d48a3427b7 | [
"MIT"
] | null | null | null | #include "EngineAPI/Color.h"
namespace EngineAPI
{
const Color Color::BLUE(0.224f, 0.667f, 0.808f, 1.0f);
const Color Color::GREEN(0.063f, 0.918f, 0.365f, 1.0f);
const Color Color::RED(1.000f, 0.258f, 0.000f, 1.0f);
const Color Color::WHITE(1.000f, 1.000f, 1.000f, 1.0f);
const Color Color::YELLOW(1.000f, 0.960f, 0.170f, 1.0f);
const Color Color::PURPLE(0.738f, 0.579f, 0.776f, 1.0f);
const Color Color::ORANGE(0.950f, 0.640f, 0.300f, 1.0f);
const Color Color::SILVER(0.600f, 0.600f, 0.600f, 1.0f);
const Color Color::FUSHIA(1.000f, 0.411f, 0.705f, 1.0f);
const Color Color::CYAN(0.000f, 1.000f, 1.000f, 1.0f);
const Color Color::INDIGO(0.350f, 0.010f, 0.600f, 1.0f);
const Color Color::AQUA(0.500f, 1.000f, 0.831f, 1.0f);
const Color Color::MAROON(0.500f, 0.000f, 0.000f, 1.0f);
const Color Color::KHAKI(0.941f, 0.901f, 0.549f, 1.0f);
const Color Color::DARK_GRAY(0.100f, 0.100f, 0.100f, 1.0f);
const Color Color::TEAL(0.000f, 1.000f, 0.820f, 1.0f);
const Color Color::OLIVE(0.570f, 0.797f, 0.000f, 1.0f);
const Color Color::TAN(0.898f, 0.847f, 0.698f, 1.0f);
} | 49.391304 | 63 | 0.639965 | Dingf |
7ade4fcf23be7aa9cadc6ffe27b203ec1247194d | 10,363 | cpp | C++ | src/apps/mplayerc/PlayerVolumeCtrl.cpp | chinajeffery/MPC-BE--1.2.3 | 2229fde5535f565ba4a496a7f73267bd2c1ad338 | [
"MIT"
] | null | null | null | src/apps/mplayerc/PlayerVolumeCtrl.cpp | chinajeffery/MPC-BE--1.2.3 | 2229fde5535f565ba4a496a7f73267bd2c1ad338 | [
"MIT"
] | 1 | 2019-11-14T04:18:32.000Z | 2019-11-14T04:18:32.000Z | src/apps/mplayerc/PlayerVolumeCtrl.cpp | chinajeffery/MPC-BE--1.2.3 | 2229fde5535f565ba4a496a7f73267bd2c1ad338 | [
"MIT"
] | null | null | null | /*
* $Id: VolumeCtrl.cpp 527 2012-06-10 13:47:31Z exodus8 $
*
* (C) 2003-2006 Gabest
* (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-BE.
*
* MPC-BE 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 3 of the License, or
* (at your option) any later version.
*
* MPC-BE 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 program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"
#include "MainFrm.h"
#include "PlayerVolumeCtrl.h"
// CVolumeCtrl
IMPLEMENT_DYNAMIC(CVolumeCtrl, CSliderCtrl)
CVolumeCtrl::CVolumeCtrl(bool fSelfDrawn) : m_fSelfDrawn(fSelfDrawn)
{
}
CVolumeCtrl::~CVolumeCtrl()
{
}
bool CVolumeCtrl::Create(CWnd* pParentWnd)
{
VERIFY(CSliderCtrl::Create(WS_CHILD|WS_VISIBLE|TBS_NOTICKS|TBS_HORZ|TBS_TOOLTIPS, CRect(0,0,0,0), pParentWnd, IDC_SLIDER1));
AppSettings& s = AfxGetAppSettings();
EnableToolTips(TRUE);
SetRange(0, 100);
SetPos(s.nVolume);
SetPageSize(s.nVolumeStep);
SetLineSize(0);
iDisableXPToolbars = s.fDisableXPToolbars + 1;
iThemeBrightness = s.nThemeBrightness;
iThemeRed = s.nThemeRed;
iThemeGreen = s.nThemeGreen;
iThemeBlue = s.nThemeBlue;
return TRUE;
}
void CVolumeCtrl::SetPosInternal(int pos)
{
SetPos(pos);
GetParent()->PostMessage(WM_HSCROLL, MAKEWPARAM((short)pos, SB_THUMBPOSITION), (LPARAM)m_hWnd);
}
void CVolumeCtrl::IncreaseVolume()
{
// align volume up to step. recommend using steps 1, 2, 5 and 10
SetPosInternal(GetPos() + GetPageSize() - GetPos() % GetPageSize());
}
void CVolumeCtrl::DecreaseVolume()
{
// align volume down to step. recommend using steps 1, 2, 5 and 10
int m = GetPos() % GetPageSize();
SetPosInternal(GetPos() - (m ? m : GetPageSize()));
}
BEGIN_MESSAGE_MAP(CVolumeCtrl, CSliderCtrl)
ON_WM_ERASEBKGND()
ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnNMCustomdraw)
ON_WM_LBUTTONDOWN()
ON_WM_SETFOCUS()
ON_WM_HSCROLL_REFLECT()
ON_WM_SETCURSOR()
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify)
END_MESSAGE_MAP()
// CVolumeCtrl message handlers
BOOL CVolumeCtrl::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
void CVolumeCtrl::OnNMCustomdraw(NMHDR* pNMHDR, LRESULT* pResult)
{
LPNMCUSTOMDRAW pNMCD = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR);
LRESULT lr = CDRF_DODEFAULT;
AppSettings& s = AfxGetAppSettings();
int R, G, B, R2, G2, B2;
GRADIENT_RECT gr[1] = {{0, 1}};
if (m_fSelfDrawn) {
switch (pNMCD->dwDrawStage) {
case CDDS_PREPAINT:
if (s.fDisableXPToolbars && (m_bmUnderCtrl.GetSafeHandle() == NULL
|| iDisableXPToolbars == 1
|| iThemeBrightness != s.nThemeBrightness
|| iThemeRed != s.nThemeRed
|| iThemeGreen != s.nThemeGreen
|| iThemeBlue != s.nThemeBlue)) {
CDC dc;
dc.Attach(pNMCD->hdc);
CRect r;
GetClientRect(&r);
InvalidateRect(&r);
CDC memdc;
int m_nHeight = ((CMainFrame*)AfxGetMainWnd())->m_wndToolBar.m_nButtonHeight;
int m_nBMedian = m_nHeight - 3 - 0.5 * m_nHeight - 8;
int height = r.Height() + m_nBMedian + 4;
int fp = m_logobm.FileExists(CString(_T("background")));
if (NULL != fp) {
ThemeRGB(s.nThemeRed, s.nThemeGreen, s.nThemeBlue, R, G, B);
m_logobm.LoadExternalGradient("background", &dc, r, 22, s.nThemeBrightness, R, G, B);
} else {
ThemeRGB(50, 55, 60, R, G, B);
ThemeRGB(20, 25, 30, R2, G2, B2);
TRIVERTEX tv[2] = {
{r.left, r.top - m_nBMedian, R*256, G*256, B*256, 255*256},
{r.Width(), height, R2*256, G2*256, B2*256, 255*256},
};
dc.GradientFill(tv, 2, gr, 1, GRADIENT_FILL_RECT_V);
}
memdc.CreateCompatibleDC(&dc);
if (m_bmUnderCtrl.GetSafeHandle() != NULL) {
m_bmUnderCtrl.DeleteObject();
}
m_bmUnderCtrl.CreateCompatibleBitmap(&dc, r.Width(), r.Height());
CBitmap *bmOld = memdc.SelectObject(&m_bmUnderCtrl);
if (iDisableXPToolbars == 1) {
iDisableXPToolbars++;
}
memdc.BitBlt(r.left, r.top, r.Width(), r.Height(), &dc, r.left, r.top, SRCCOPY);
dc.Detach();
DeleteObject(memdc.SelectObject(bmOld));
memdc.DeleteDC();
}
lr = CDRF_NOTIFYITEMDRAW;
if (m_fSetRedraw) {
lr |= CDRF_NOTIFYPOSTPAINT;
}
break;
case CDDS_ITEMPREPAINT:
case CDDS_POSTPAINT:
if (s.fDisableXPToolbars && m_bmUnderCtrl.GetSafeHandle() != NULL) {
CDC dc;
dc.Attach(pNMCD->hdc);
CRect r;
GetClientRect(&r);
InvalidateRect(&r);
CDC memdc;
memdc.CreateCompatibleDC(&dc);
CBitmap *bmOld = memdc.SelectObject(&m_bmUnderCtrl);
if (iDisableXPToolbars == 0) {
iDisableXPToolbars++;
}
iThemeBrightness = s.nThemeBrightness;
iThemeRed = s.nThemeRed;
iThemeGreen = s.nThemeGreen;
iThemeBlue = s.nThemeBlue;
int pa = 255 * 256;
unsigned p1 = s.clrOutlineABGR, p2 = s.clrFaceABGR;
int nVolume = GetPos();
if (nVolume <= GetPageSize()) {
nVolume = 0;
}
int m_nVolPos = r.left + (nVolume * 0.43) + 4;
int fp = m_logobm.FileExists(CString(_T("volume")));
if (NULL != fp) {
m_logobm.LoadExternalGradient("volume", &dc, r, 0, -1, -1, -1, -1);
} else {
int ir1 = p1 * 256;
int ig1 = (p1 >> 8) * 256;
int ib1 = (p1 >> 16) * 256;
int ir2 = p2 * 256;
int ig2 = (p2 >> 8) * 256;
int ib2 = (p2 >> 16) * 256;
TRIVERTEX tv[2] = {
{0, 0, ir1, ig1, ib1, pa},
{50, 1, ir2, ig2, ib2, pa},
};
dc.GradientFill(tv, 2, gr, 1, GRADIENT_FILL_RECT_H);
}
unsigned p3 = m_nVolPos > 30 ? dc.GetPixel(m_nVolPos, 0) : dc.GetPixel(30, 0);
CPen penLeft(p2 == 0x00ff00ff ? PS_NULL : PS_SOLID, 0, p3);
dc.BitBlt(0, 0, r.Width(), r.Height(), &memdc, 0, 0, SRCCOPY);
DeleteObject(memdc.SelectObject(bmOld));
memdc.DeleteDC();
r.DeflateRect(4, 2, 9, 6);
CopyRect(&pNMCD->rc, &r);
CPen penRight(p1 == 0x00ff00ff ? PS_NULL : PS_SOLID, 0, p1);
CPen *penOld = dc.SelectObject(&penRight);
int nposx, nposy;
for (int i = 4; i <= 44; i += 4) {
nposx = r.left + i;
nposy = r.bottom - (r.Height() * i) / (r.Width() + 6);
i < m_nVolPos ? dc.SelectObject(penLeft) : dc.SelectObject(penRight);
dc.MoveTo(nposx, nposy); //top_left
dc.LineTo(nposx + 2, nposy); //top_right
dc.LineTo(nposx + 2, r.bottom); //bottom_right
dc.LineTo(nposx, r.bottom); //bottom_left
dc.LineTo(nposx, nposy); //top_left
if (!s.fMute) {
dc.MoveTo(nposx + 1, nposy - 1); //top_middle
dc.LineTo(nposx + 1, r.bottom + 2); //bottom_middle
}
}
dc.SelectObject(penOld);
dc.Detach();
lr = CDRF_SKIPDEFAULT;
m_fSetRedraw = false;
} else if (!s.fDisableXPToolbars && pNMCD->dwItemSpec == TBCD_CHANNEL) {
if (m_bmUnderCtrl.GetSafeHandle() != NULL) {
m_bmUnderCtrl.DeleteObject();
}
CDC dc;
dc.Attach(pNMCD->hdc);
CRect r;
GetClientRect(r);
r.DeflateRect(8, 4, 10, 6);
CopyRect(&pNMCD->rc, &r);
CPen shadow(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
CPen light(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
CPen* old = dc.SelectObject(&light);
dc.MoveTo(pNMCD->rc.right, pNMCD->rc.top);
dc.LineTo(pNMCD->rc.right, pNMCD->rc.bottom);
dc.LineTo(pNMCD->rc.left, pNMCD->rc.bottom);
dc.SelectObject(&shadow);
dc.LineTo(pNMCD->rc.right, pNMCD->rc.top);
dc.SelectObject(old);
dc.Detach();
lr = CDRF_SKIPDEFAULT;
} else if (!s.fDisableXPToolbars && pNMCD->dwItemSpec == TBCD_THUMB) {
CDC dc;
dc.Attach(pNMCD->hdc);
pNMCD->rc.bottom--;
CRect r(pNMCD->rc);
r.DeflateRect(0, 0, 1, 0);
COLORREF shadow = GetSysColor(COLOR_3DSHADOW);
COLORREF light = GetSysColor(COLOR_3DHILIGHT);
dc.Draw3dRect(&r, light, 0);
r.DeflateRect(0, 0, 1, 1);
dc.Draw3dRect(&r, light, shadow);
r.DeflateRect(1, 1, 1, 1);
dc.FillSolidRect(&r, GetSysColor(COLOR_BTNFACE));
dc.SetPixel(r.left + 7, r.top - 1, GetSysColor(COLOR_BTNFACE));
dc.Detach();
lr = CDRF_SKIPDEFAULT;
}
if (!s.fDisableXPToolbars) {
iDisableXPToolbars = 0;
}
break;
default:
break;
}
}
pNMCD->uItemState &= ~CDIS_FOCUS;
*pResult = lr;
}
void CVolumeCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
CRect r;
GetChannelRect(&r);
if (r.left >= r.right) {
return;
}
int start, stop;
GetRange(start, stop);
r.left += 3;
r.right -= 4;
if (point.x < r.left) {
SetPos(start);
} else if (point.x >= r.right) {
SetPos(stop);
} else if (start < stop) {
int w = r.right - r.left - 4;
SetPosInternal(start + ((stop - start) * (point.x - r.left) + (w / 2)) / w);
}
CSliderCtrl::OnLButtonDown(nFlags, point);
}
void CVolumeCtrl::OnSetFocus(CWnd* pOldWnd)
{
CSliderCtrl::OnSetFocus(pOldWnd);
AfxGetMainWnd()->SetFocus();
}
void CVolumeCtrl::HScroll(UINT nSBCode, UINT nPos)
{
int nVolMin, nVolMax;
GetRange(nVolMin, nVolMax);
if ((UINT)nVolMin <= nSBCode && nSBCode <= (UINT)nVolMax) {
CRect r;
GetClientRect(&r);
InvalidateRect(&r);
UpdateWindow();
AfxGetAppSettings().nVolume = GetPos();
CFrameWnd* pFrame = GetParentFrame();
if (pFrame && pFrame != GetParent()) {
pFrame->PostMessage(WM_HSCROLL, MAKEWPARAM((short)nPos, nSBCode), (LPARAM)m_hWnd);
}
}
}
BOOL CVolumeCtrl::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND));
return TRUE;
}
BOOL CVolumeCtrl::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult)
{
TOOLTIPTEXT *pTTT = reinterpret_cast<LPTOOLTIPTEXT>(pNMHDR);
CString str;
str.AppendFormat(_T("%d%%"), GetPos());
if (AfxGetAppSettings().fMute) { // TODO: remove i
CString no_sound_str = ResStr(ID_VOLUME_MUTE_DISABLED);
int i = no_sound_str.Find('\n');
if (i > 0) {
no_sound_str = no_sound_str.Left(i);
}
str.AppendFormat(_T(" [%ws]"), no_sound_str);
}
_tcscpy_s(pTTT->szText, str);
pTTT->hinst = NULL;
*pResult = 0;
return TRUE;
}
| 25.842893 | 125 | 0.639583 | chinajeffery |
7ae204501b18372062674f5087090a50acaa0b7d | 8,018 | cpp | C++ | CRAB/journal.cpp | arvindrajayadav/unrest | d89f20e95fbcdef37a47ab1454b2479522a0e43f | [
"MIT"
] | 11 | 2020-08-04T08:37:46.000Z | 2022-03-31T22:35:15.000Z | CRAB/journal.cpp | arvindrajayadav/unrest | d89f20e95fbcdef37a47ab1454b2479522a0e43f | [
"MIT"
] | 1 | 2020-12-16T16:51:52.000Z | 2020-12-18T06:35:38.000Z | Unrest-iOS/journal.cpp | arvindrajayadav/unrest | d89f20e95fbcdef37a47ab1454b2479522a0e43f | [
"MIT"
] | 7 | 2020-08-04T09:34:20.000Z | 2021-09-11T03:00:16.000Z | #include "stdafx.h"
#include "journal.h"
using namespace pyrodactyl::image;
using namespace pyrodactyl::ui;
//------------------------------------------------------------------------
// Purpose: Load game
//------------------------------------------------------------------------
void Journal::Load(const std::string &filename)
{
XMLDoc conf(filename);
if (conf.ready())
{
rapidxml::xml_node<char> *node = conf.Doc()->first_node("objectives");
if (NodeValid(node))
{
if (NodeValid("bg", node))
bg.Load(node->first_node("bg"));
if (NodeValid("map", node))
bu_map.Load(node->first_node("map"));
if (NodeValid("category", node))
category.Load(node->first_node("category"));
if (NodeValid("quest_list", node))
ref.Load(node->first_node("quest_list"));
category.UseKeyboard(true);
}
}
}
//------------------------------------------------------------------------
// Purpose: Prepare a new character's journal
//------------------------------------------------------------------------
void Journal::Init(const std::string &id)
{
int found = false;
for (auto &i : journal)
if (i.id == id)
{
found = true;
break;
}
if (!found)
{
Group g;
g.id = id;
for (int i = 0; i < JE_TOTAL; ++i)
{
g.menu[i] = ref;
g.menu[i].UseKeyboard(true);
g.menu[i].AssignPaths();
}
journal.push_back(g);
}
}
//------------------------------------------------------------------------
// Purpose: Select a category
//------------------------------------------------------------------------
void Journal::Select(const std::string &id, const int &choice)
{
for (unsigned int i = 0; i < category.element.size(); ++i)
category.element.at(i).State(false);
category.element.at(choice).State(true);
select = choice;
//Always find valid journal group first
for (auto &jo : journal)
if (jo.id == id)
{
jo.menu[choice].unread = false;
break;
}
}
//------------------------------------------------------------------------
// Purpose: Draw stuff
//------------------------------------------------------------------------
void Journal::Draw(const std::string &id)
{
bg.Draw();
category.Draw();
//Always find valid journal group first
for (auto &jo : journal)
if (jo.id == id)
{
int count = 0;
for (auto i = category.element.begin(); i != category.element.end() && count < JE_TOTAL; ++i, ++count)
if (jo.menu[count].unread)
gImageManager.NotifyDraw(i->x + i->w, i->y);
if (select >= 0 && select < JE_TOTAL)
jo.menu[select].Draw(bu_map);
break;
}
}
//------------------------------------------------------------------------
// Purpose: Handle user input
//------------------------------------------------------------------------
bool Journal::HandleEvents(const std::string &id, const SDL_Event &Event)
{
int choice = category.HandleEvents(Event);
if (choice >= 0 && choice < category.element.size())
Select(id, choice);
//Check if select is valid
if (select >= 0 && select < JE_TOTAL)
{
//Always find valid journal group first
for (auto &jo : journal)
if (jo.id == id)
return jo.menu[select].HandleEvents(bu_map, marker_title, Event);
}
return false;
}
//------------------------------------------------------------------------
// Purpose: Add an entry to journal
//------------------------------------------------------------------------
void Journal::Add(const std::string &id, const std::string &Category, const std::string &Title, const std::string &Text)
{
//Always find valid journal group first
for (auto &jo : journal)
if (jo.id == id)
{
if (Category == JE_CUR_NAME) { jo.menu[JE_CUR].Add(Title, Text); }
else if (Category == JE_DONE_NAME) { jo.menu[JE_DONE].Add(Title, Text); }
else if (Category == JE_PEOPLE_NAME) { jo.menu[JE_PEOPLE].Add(Title, Text); }
else if (Category == JE_LOCATION_NAME){ jo.menu[JE_LOCATION].Add(Title, Text); }
else if (Category == JE_HISTORY_NAME) { jo.menu[JE_HISTORY].Add(Title, Text); }
break;
}
}
//------------------------------------------------------------------------
// Purpose: Set the marker of a quest
//------------------------------------------------------------------------
void Journal::Marker(const std::string &id, const std::string &Title, const bool &val)
{
//Always find valid journal group first
for (auto &jo : journal)
if (jo.id == id)
{
jo.menu[JE_CUR].Marker(Title, val);
break;
}
}
//------------------------------------------------------------------------
// Purpose: Move an entry from one category to another
//------------------------------------------------------------------------
void Journal::Move(const std::string &id, const std::string &Title, const bool &completed)
{
JournalCategory source, destination;
if (completed)
{
source = JE_CUR;
destination = JE_DONE;
}
else
{
source = JE_DONE;
destination = JE_CUR;
}
//Always find valid journal group first
for (auto &jo : journal)
if (jo.id == id)
{
//Find the quest chain in the source menu
unsigned int index = 0;
for (auto i = jo.menu[source].quest.begin(); i != jo.menu[source].quest.end(); ++i, ++index)
if (i->title == Title)
break;
if (index < jo.menu[source].quest.size())
{
jo.menu[destination].Add(jo.menu[source].quest.at(index));
jo.menu[source].Erase(index);
}
break;
}
}
//------------------------------------------------------------------------
// Purpose: Open a specific entry in the journal
//------------------------------------------------------------------------
void Journal::Open(const std::string &id, const JournalCategory &Category, const std::string &Title)
{
//Always find valid journal group first
for (auto &jo : journal)
if (jo.id == id)
{
if (Category >= 0 && Category < category.element.size())
{
//If category passes the valid check, select it
Select(id, Category);
//Perform validity check on select, just in case
if (select > 0 && select < JE_TOTAL)
{
//Search for the title with same name
for (unsigned int num = 0; num < jo.menu[select].quest.size(); ++num)
if (jo.menu[select].quest[num].title == Title)
{
//Found it, switch to this
jo.menu[select].Select(num);
break;
}
}
}
break;
}
}
//------------------------------------------------------------------------
// Purpose: Load save game stuff
//------------------------------------------------------------------------
void Journal::SaveState(rapidxml::xml_document<> &doc, rapidxml::xml_node<char> *root)
{
for (auto &m : journal)
{
rapidxml::xml_node<char> *child = doc.allocate_node(rapidxml::node_element, "journal");
child->append_attribute(doc.allocate_attribute("id", m.id.c_str()));
m.menu[JE_CUR].SaveState(doc, child, JE_CUR_NAME);
m.menu[JE_DONE].SaveState(doc, child, JE_DONE_NAME);
m.menu[JE_PEOPLE].SaveState(doc, child, JE_PEOPLE_NAME);
m.menu[JE_LOCATION].SaveState(doc, child, JE_LOCATION_NAME);
m.menu[JE_HISTORY].SaveState(doc, child, JE_HISTORY_NAME);
root->append_node(child);
}
}
void Journal::LoadState(rapidxml::xml_node<char> *node)
{
for (rapidxml::xml_node<char> *n = node->first_node("journal"); n != NULL; n = n->next_sibling("journal"))
{
std::string id;
LoadStr(id, "id", n);
Init(id);
for (auto &i : journal)
if (i.id == id)
{
i.menu[JE_CUR].LoadState(n->first_node(JE_CUR_NAME));
i.menu[JE_DONE].LoadState(n->first_node(JE_DONE_NAME));
i.menu[JE_PEOPLE].LoadState(n->first_node(JE_PEOPLE_NAME));
i.menu[JE_LOCATION].LoadState(n->first_node(JE_LOCATION_NAME));
i.menu[JE_HISTORY].LoadState(n->first_node(JE_HISTORY_NAME));
}
}
}
//------------------------------------------------------------------------
// Purpose: Adjust UI elements
//------------------------------------------------------------------------
void Journal::SetUI()
{
bg.SetUI();
category.SetUI();
ref.SetUI();
for (auto &m : journal)
for (auto i = 0; i < JE_TOTAL; ++i)
m.menu[i].SetUI();
} | 28.432624 | 120 | 0.514343 | arvindrajayadav |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.