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 108 | 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 67k ⌀ | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6c735b5cb0eae44b95032cc897c039a77ac1fa01 | 12,875 | cpp | C++ | Doom/src/Doom/Components/Render3D.cpp | Shturm0weak/OpenGL_Engine | 6e6570f8dd9000724274942fff5a100f0998b780 | [
"MIT"
] | 126 | 2020-10-20T21:39:53.000Z | 2022-01-25T14:43:44.000Z | Doom/src/Doom/Components/Render3D.cpp | Shturm0weak/2D_OpenGL_Engine | 6e6570f8dd9000724274942fff5a100f0998b780 | [
"MIT"
] | 2 | 2021-01-07T17:29:19.000Z | 2021-08-14T14:04:28.000Z | Doom/src/Doom/Components/Render3D.cpp | Shturm0weak/2D_OpenGL_Engine | 6e6570f8dd9000724274942fff5a100f0998b780 | [
"MIT"
] | 16 | 2021-01-09T09:08:40.000Z | 2022-01-25T14:43:46.000Z | #include "../pch.h"
#include "Render3D.h"
#include "../Core/Editor.h"
#include "../Render/Instancing.h"
#include "../Components/PointLight.h"
using namespace Doom;
void Renderer3D::ChangeRenderTechnic(RenderTechnic rt)
{
if (m_IsTransparent) return;
if (rt == RenderTechnic::Instancing)
{
for (auto i = Instancing::GetInstance()->m_InstancedObjects.begin(); i != Instancing::GetInstance()->m_InstancedObjects.end(); i++)
{
if (i->first == m_Mesh)
{
auto iterFind = std::find(i->second.begin(), i->second.end(), this);
if (iterFind == i->second.end())
{
i->second.push_back(this);
auto iter = std::find(Renderer::s_Objects3d.begin(), Renderer::s_Objects3d.end(), this);
if (iter != Renderer::s_Objects3d.end())
Renderer::s_Objects3d.erase(iter);
}
}
}
}
else if (rt == RenderTechnic::Forward)
{
EraseFromInstancing();
auto iter = std::find(Renderer::s_Objects3d.begin(), Renderer::s_Objects3d.end(), this);
if (iter == Renderer::s_Objects3d.end())
{
m_Shader = Shader::Get("Default3D");
Renderer::s_Objects3d.push_back(this);
}
}
m_RenderTechnic = rt;
}
void Renderer3D::LoadMesh(Mesh* mesh)
{
EraseFromInstancing();
m_Mesh = mesh;
ChangeRenderTechnic(m_RenderTechnic);
if (m_Mesh != nullptr && !m_IsSkyBox)
{
CubeCollider3D* cc = m_OwnerOfCom->m_ComponentManager.GetComponent<CubeCollider3D>();
if (cc == nullptr)
{
cc = m_OwnerOfCom->m_ComponentManager.AddComponent<CubeCollider3D>();
cc->m_IsBoundingBox = true;
}
cc->m_MinP = m_Mesh->m_TheLowestPoint;
cc->m_MaxP = m_Mesh->m_TheHighestPoint;
cc->m_Offset = ((cc->m_MaxP - cc->m_MinP) * 0.5f) + cc->m_MinP;
}
m_Tr = m_OwnerOfCom->m_ComponentManager.GetComponent<Transform>();
//std::cout << "offset " << cc->offset.x << " " << cc->offset.y << " " << cc->offset.z << "\n";
//std::cout << "the highest " << mesh->theHighestPoint.x << " " << mesh->theHighestPoint.y << " " << mesh->theHighestPoint.z << "\n";
//std::cout << "the lowest " << mesh->theLowestPoint.x << " " << mesh->theLowestPoint.y << " " << mesh->theLowestPoint.z << "\n";
}
void Renderer3D::operator=(const Renderer3D& rhs)
{
Copy(rhs);
}
void Renderer3D::EraseFromInstancing()
{
if (m_RenderTechnic == RenderTechnic::Instancing)
{
for (auto i = Instancing::GetInstance()->m_InstancedObjects.begin(); i != Instancing::GetInstance()->m_InstancedObjects.end(); i++)
{
if (m_Mesh != nullptr)
{
auto iter = std::find(i->second.begin(), i->second.end(), this);
if (iter != i->second.end())
{
i->second.erase(iter);
m_IsInitializedInInstancing = false;
//m_Mesh = nullptr;
}
}
}
}
}
Renderer3D::Renderer3D(const Renderer3D& rhs)
{
Copy(rhs);
}
Renderer3D::Renderer3D()
{
m_RenderType = RenderType::TYPE_3D;
//SetType(ComponentType::RENDER3D);
m_Shader = Shader::Get("Default3D");
m_DiffuseTexture = Texture::s_WhiteTexture;
m_NormalMapTexture = Texture::Get("InvalidTexture");
}
Renderer3D::~Renderer3D()
{
}
void Renderer3D::Delete()
{
s_FreeMemory.push_back(m_MemoryPoolPtr);
if (m_OwnerOfCom == nullptr) return;
CubeCollider3D* cc = m_OwnerOfCom->m_ComponentManager.GetComponent<CubeCollider3D>();
if (cc != nullptr && cc->m_IsBoundingBox)
m_OwnerOfCom->m_ComponentManager.RemoveComponent(cc); //Fix: could be dangerous if there is more than 1 CubeCollider
if (m_IsTransparent)
{
auto iter = std::find(Renderer::s_Objects3dTransparent.begin(), Renderer::s_Objects3dTransparent.end(), this);
if (iter != Renderer::s_Objects3dTransparent.end())
Renderer::s_Objects3dTransparent.erase(iter);
}
else
{
ChangeRenderTechnic(RenderTechnic::Forward);
auto iter = std::find(Renderer::s_Objects3d.begin(), Renderer::s_Objects3d.end(), this);
if (iter != Renderer::s_Objects3d.end())
Renderer::s_Objects3d.erase(iter);
}
this->Copy(Renderer3D());
}
Component* Renderer3D::Create()
{
char* ptr = Utils::PreAllocateMemory<Renderer3D>(s_MemoryPool, s_FreeMemory);
Renderer3D* component = (Renderer3D*)((void*)ptr);
component->m_MemoryPoolPtr = ptr;
if (component->m_IsTransparent) Renderer::s_Objects3dTransparent.push_back(component);
else Renderer::s_Objects3d.push_back(component);
component->m_Mesh = nullptr;
return component;
}
#include "../Core/Timer.h"
#include "DirectionalLight.h"
void Renderer3D::BakeShadows()
{
if (m_IsCastingShadows && m_Mesh != nullptr && m_Mesh->m_IsInitialized)
{
if (!m_IsSkyBox)
{
Shader* bakeShader = Shader::Get("BakeShadows");
bakeShader->Bind();
glBindTextureUnit(0, m_DiffuseTexture->m_RendererID);
bakeShader->SetUniformMat4f("u_Model", m_Tr->m_PosMat4);
bakeShader->SetUniformMat4f("lightSpaceMatrix", DirectionalLight::GetLightSpaceMatrix());
bakeShader->SetUniformMat4f("u_Scale", m_Tr->m_ScaleMat4);
bakeShader->SetUniformMat4f("u_View", m_Tr->m_ViewMat4);
bakeShader->Bind();
m_Mesh->m_Va.Bind();
m_Mesh->m_Ib.Bind();
m_Mesh->m_Vb.Bind();
Renderer::s_Stats.m_Vertices += m_Mesh->m_IndicesSize;
Renderer::s_Stats.m_DrawCalls++;
glDrawElements(GL_TRIANGLES, m_Mesh->m_Ib.m_count, GL_UNSIGNED_INT, nullptr);
bakeShader->UnBind();
m_Mesh->m_Ib.UnBind();
glBindTextureUnit(0, Texture::s_WhiteTexture->m_RendererID);
}
}
}
void Renderer3D::MakeTransparent()
{
auto iter = std::find(Renderer::s_Objects3d.begin(), Renderer::s_Objects3d.end(), this);
if(iter != Renderer::s_Objects3d.end())
{
EraseFromInstancing();
ChangeRenderTechnic(RenderTechnic::Forward);
Renderer::s_Objects3d.erase(iter);
Renderer::s_Objects3dTransparent.push_back(this);
m_IsTransparent = true;
}
}
void Renderer3D::MakeSolid()
{
auto iter = std::find(Renderer::s_Objects3dTransparent.begin(), Renderer::s_Objects3dTransparent.end(), this);
if (iter != Renderer::s_Objects3dTransparent.end())
{
Renderer::s_Objects3dTransparent.erase(iter);
Renderer::s_Objects3d.push_back(this);
ChangeRenderTechnic(RenderTechnic::Forward);
m_IsTransparent = false;
}
}
void Renderer3D::Render()
{
if (m_RenderTechnic == RenderTechnic::Forward)
{
m_Tr = &(m_OwnerOfCom->m_Transform);
if (m_IsWireMesh)
{
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
ForwardRender(m_Tr->m_PosMat4, m_Tr->m_ViewMat4, m_Tr->m_ScaleMat4, m_Color);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
else
{
ForwardRender(m_Tr->m_PosMat4, m_Tr->m_ViewMat4, m_Tr->m_ScaleMat4, m_Color);
}
}
}
void Renderer3D::Copy(const Renderer3D& rhs)
{
m_FloatUniforms = rhs.m_FloatUniforms;
m_Material = rhs.m_Material;
m_DiffuseTexture = rhs.m_DiffuseTexture;
m_NormalMapTexture = rhs.m_NormalMapTexture;
LoadMesh(rhs.m_Mesh);
m_IsCastingShadows = rhs.m_IsCastingShadows;
m_IsWireMesh = rhs.m_IsWireMesh;
m_IsUsingNormalMap = rhs.m_IsUsingNormalMap;
if (rhs.m_IsTransparent)
MakeTransparent();
m_IsSkyBox = rhs.m_IsSkyBox;
ChangeRenderTechnic(rhs.m_RenderTechnic);
m_Color = rhs.m_Color;
m_Shader = rhs.m_Shader;
m_RenderType = rhs.m_RenderType;
m_Emissive = rhs.m_Emissive;
}
void Renderer3D::ForwardRender(glm::mat4& pos, glm::mat4& view, glm::mat4& scale, glm::vec4& color)
{
if (m_Mesh != nullptr && m_Mesh->m_IsInitialized)
{
if (m_IsSkyBox) {
RenderSkyBox();
return;
}
m_Shader->Bind();
glBindTextureUnit(0, m_DiffuseTexture->m_RendererID);
m_Shader->SetUniformMat4f("u_ViewProjection", Window::GetInstance().GetCamera().GetViewProjectionMatrix());
m_Shader->SetUniformMat4f("u_Model", pos);
m_Shader->SetUniformMat4f("u_View", view);
m_Shader->SetUniformMat4f("u_Scale", scale);
m_Shader->SetUniform4f("u_Color", color[0], color[1], color[2], color[3]);
AdditionalUniformsLoad();
int dlightSize = DirectionalLight::s_DirLights.size();
m_Shader->SetUniform1i("dLightSize", dlightSize);
char buffer[64];
for (int i = 0; i < dlightSize; i++)
{
DirectionalLight* dl = DirectionalLight::s_DirLights[i];
dl->m_Dir = dl->m_OwnerOfCom->m_Transform.m_ViewMat4 * glm::vec4(0, 0, -1, 1);
sprintf(buffer, "dirLights[%i].dir", i);
m_Shader->SetUniform3fv(buffer, dl->m_Dir);
sprintf(buffer, "dirLights[%i].color", i);
m_Shader->SetUniform3fv(buffer, dl->m_Color);
sprintf(buffer, "dirLights[%i].intensity", i);
m_Shader->SetUniform1f(buffer, dl->m_Intensity);
}
int plightSize = PointLight::s_PointLights.size();
m_Shader->SetUniform1i("pLightSize", plightSize);
for (int i = 0; i < plightSize; i++)
{
PointLight* pl = PointLight::s_PointLights[i];
sprintf(buffer, "pointLights[%i].position", i);
m_Shader->SetUniform3fv(buffer, pl->m_OwnerOfCom->GetPosition());
sprintf(buffer, "pointLights[%i].color", i);
m_Shader->SetUniform3fv(buffer, pl->m_Color);
sprintf(buffer, "pointLights[%i].constant", i);
m_Shader->SetUniform1f(buffer, pl->m_Constant);
sprintf(buffer, "pointLights[%i]._linear", i);
m_Shader->SetUniform1f(buffer, pl->m_Linear);
sprintf(buffer, "pointLights[%i].quadratic", i);
m_Shader->SetUniform1f(buffer, pl->m_Quadratic);
}
int slightSize = SpotLight::s_SpotLights.size();
m_Shader->SetUniform1i("sLightSize", slightSize);
for (int i = 0; i < slightSize; i++)
{
SpotLight* sl = SpotLight::s_SpotLights[i];
sprintf(buffer, "spotLights[%i].position", i);
m_Shader->SetUniform3fv(buffer, sl->m_OwnerOfCom->GetPosition());
sprintf(buffer, "spotLights[%i].dir", i);
m_Shader->SetUniform3fv(buffer, sl->m_OwnerOfCom->m_Transform.m_ViewMat4 * glm::vec4(0, 0, -1, 1));
sprintf(buffer, "spotLights[%i].color", i);
m_Shader->SetUniform3fv(buffer, sl->m_Color);
sprintf(buffer, "spotLights[%i].constant", i);
m_Shader->SetUniform1f(buffer, sl->m_Constant);
sprintf(buffer, "spotLights[%i]._linear", i);
m_Shader->SetUniform1f(buffer, sl->m_Linear);
sprintf(buffer, "spotLights[%i].quadratic", i);
m_Shader->SetUniform1f(buffer, sl->m_Quadratic);
sprintf(buffer, "spotLights[%i].innerCutOff", i);
m_Shader->SetUniform1f(buffer, sl->m_InnerCutOff);
sprintf(buffer, "spotLights[%i].outerCutOff", i);
m_Shader->SetUniform1f(buffer, sl->m_OuterCutOff);
}
m_Shader->SetUniform3fv("u_CameraPos", Window::GetInstance().GetCamera().GetPosition());
m_Shader->SetUniform1f("u_Ambient", m_Material.m_Ambient);
m_Shader->SetUniform1f("u_Specular", m_Material.m_Specular);
m_Shader->SetUniformMat4f("u_LightSpaceMatrix", DirectionalLight::GetLightSpaceMatrix());
m_Shader->SetUniform1i("u_DiffuseTexture", 0);
glBindTextureUnit(2, Window::GetInstance().m_FrameBufferShadowMap->m_Textures[0]);
m_Shader->SetUniform1i("u_ShadowTexture", 2);
m_Shader->SetUniform1i("u_PcfRange", Renderer::s_ShadowMap.m_PcfRange);
m_Shader->SetUniform1f("u_ShadowBias", Renderer::s_ShadowMap.m_Bias);
m_Shader->SetUniform1f("u_ScalarTexelSize", Renderer::s_ShadowMap.m_ScalarTexelSize);
m_Shader->SetUniform1f("u_DrawShadows", Renderer::s_ShadowMap.m_DrawShadows);
if (m_IsUsingNormalMap)
{
glBindTextureUnit(1, m_NormalMapTexture->m_RendererID);
m_Shader->SetUniform1i("u_NormalMapTexture", 1);
}
m_Shader->SetUniform1i("u_IsNormalMapping", m_IsUsingNormalMap);
m_Shader->SetUniform1f("u_Brightness", Renderer::s_Bloom.m_Brightness);
m_Shader->SetUniform1i("u_Emissive", m_Emissive);
m_Mesh->m_Va.Bind();
m_Mesh->m_Ib.Bind();
Renderer::s_Stats.m_Vertices += m_Mesh->m_Ib.m_count;
Renderer::s_Stats.m_DrawCalls++;
if (!m_IsCullingFace)
glDisable(GL_CULL_FACE);
glDrawElements(GL_TRIANGLES, m_Mesh->m_Ib.m_count, GL_UNSIGNED_INT, nullptr);
glEnable(GL_CULL_FACE);
m_Shader->UnBind();
m_Mesh->m_Ib.UnBind();
glBindTextureUnit(0, Texture::s_WhiteTexture->m_RendererID);
}
}
void Renderer3D::RenderSkyBox()
{
m_Shader = Shader::Get("SkyBox");
glDepthFunc(GL_LEQUAL);
glActiveTexture(GL_TEXTURE0);
glDisable(GL_CULL_FACE);
glBindTexture(GL_TEXTURE_CUBE_MAP, m_DiffuseTexture->m_RendererID);
m_Shader->Bind();
Window::GetInstance().GetCamera().RecalculateViewMatrix();
m_Shader->SetUniformMat4f("u_ViewProjection", Window::GetInstance().GetCamera().GetProjectionMatrix());
m_Shader->SetUniformMat4f("u_Model", m_Tr->m_PosMat4);
m_Shader->SetUniformMat4f("u_View", glm::mat4(glm::mat3(Window::GetInstance().GetCamera().GetViewMatrix())));
m_Shader->SetUniformMat4f("u_Scale", m_Tr->m_ScaleMat4);
m_Shader->SetUniform1i("u_DiffuseTexture", 0);
m_Shader->SetUniform1f("u_Brightness", Renderer::s_Bloom.m_Brightness);
m_Shader->Bind();
m_Mesh->m_Va.Bind();
m_Mesh->m_Ib.Bind();
m_Mesh->m_Vb.Bind();
Renderer::s_Stats.m_Vertices += m_Mesh->m_Ib.m_count;
Renderer::s_Stats.m_DrawCalls++;
glDrawArrays(GL_TRIANGLES, 0, 36);
glBindVertexArray(0);
m_Shader->UnBind();
m_Mesh->m_Ib.UnBind();
m_DiffuseTexture->UnBind();
glDepthFunc(GL_LESS);
glEnable(GL_CULL_FACE);
}
void Renderer3D::AdditionalUniformsLoad()
{
for (auto i = m_FloatUniforms.begin(); i != m_FloatUniforms.end(); i++)
{
m_Shader->SetUniform1f(i->first, i->second);
}
}
| 33.881579 | 134 | 0.71666 | Shturm0weak |
6c739e683ffe3061b2d448fc2a33a103f268d058 | 59,679 | cpp | C++ | source/TheoremProver/ProverExpression.cpp | ubavic/gclc | bf28e4317d4c7a73d39ce3bbdb6f73ea4c6f0c44 | [
"MIT"
] | null | null | null | source/TheoremProver/ProverExpression.cpp | ubavic/gclc | bf28e4317d4c7a73d39ce3bbdb6f73ea4c6f0c44 | [
"MIT"
] | null | null | null | source/TheoremProver/ProverExpression.cpp | ubavic/gclc | bf28e4317d4c7a73d39ce3bbdb6f73ea4c6f0c44 | [
"MIT"
] | null | null | null | #include "ProverExpression.h"
#include "TheoremProver.h"
#include <assert.h>
#include <cmath>
#define EPSILON 0.00001
static unsigned idCounter=0;
Rules CGCLCProverExpression::mRules;
unsigned arity(enum GCLCexperssion_type type) {
switch (type) {
case ep_number:
case ep_point:
case ep_constant:
case ep_unknown:
return 0;
case ep_identical:
case ep_segment:
case ep_equality:
case ep_sum:
case ep_ratio:
case ep_mult:
case ep_diffx:
case ep_diffy:
return 2;
case ep_s3:
case ep_p3:
case ep_collinear:
case ep_midpoint:
case ep_tangens_num:
case ep_tangens_den:
return 3;
case ep_segment_ratio:
case ep_s4:
case ep_p4:
case ep_parallel:
case ep_perpendicular:
case ep_harmonic:
case ep_same_length:
return 4;
default:
return 0;
}
return 0;
}
// --------------------------------------------------------------------------
CGCLCProverExpression::CGCLCProverExpression() {
for (unsigned i = 0; i < ExpressionArgCount; i++)
arg[i] = NULL;
sName = "";
nNumber = 0;
type = ep_unknown;
id = idCounter++;
}
// --------------------------------------------------------------------------
CGCLCProverExpression::~CGCLCProverExpression() { CleanUp(); }
// --------------------------------------------------------------------------
CGCLCProverExpression::CGCLCProverExpression(const CGCLCProverExpression &r) {
type = r.type;
sName = r.sName;
nNumber = r.nNumber;
for (unsigned i = 0; i < arity(type); i++)
arg[i] = new CGCLCProverExpression(r.GetArg(i));
for (unsigned i = arity(type); i < ExpressionArgCount; i++)
arg[i] = NULL;
id = idCounter++;
}
// --------------------------------------------------------------------------
CGCLCProverExpression &CGCLCProverExpression::
operator=(const CGCLCProverExpression &r) {
if (this == &r)
return *this;
CleanUp();
type = r.type;
sName = r.sName;
nNumber = r.nNumber;
for (unsigned i = 0; i < ExpressionArgCount; i++)
if (arg[i])
delete arg[i];
for (unsigned i = 0; i < arity(type); i++)
arg[i] = new CGCLCProverExpression(r.GetArg(i));
for (unsigned i = arity(type); i < ExpressionArgCount; i++)
arg[i] = NULL;
return *this;
}
// --------------------------------------------------------------------------
CGCLCProverExpression &CGCLCProverExpression::operator=(const double n) {
CleanUp();
sName = "";
nNumber = n;
type = ep_number;
for (unsigned i = 0; i < ExpressionArgCount; i++) {
delete arg[i];
arg[i] = NULL;
}
return *this;
}
// --------------------------------------------------------------------------
CGCLCProverExpression::CGCLCProverExpression(GCLCexperssion_type t,
const string &a) {
assert(t == ep_point || t == ep_constant);
type = t;
sName = a;
nNumber = 0;
for (unsigned i = 0; i < ExpressionArgCount; i++)
arg[i] = NULL;
id = idCounter++;
}
// --------------------------------------------------------------------------
CGCLCProverExpression::CGCLCProverExpression(GCLCexperssion_type t,
const string &a0,
const string &a1) {
assert(t == ep_segment || t == ep_diffx || t == ep_diffy);
type = t;
nNumber = 0;
arg[0] = new CGCLCProverExpression(ep_point, a0);
arg[1] = new CGCLCProverExpression(ep_point, a1);
arg[2] = NULL;
arg[3] = NULL;
id = idCounter++;
}
// --------------------------------------------------------------------------
CGCLCProverExpression::CGCLCProverExpression(GCLCexperssion_type t,
const string &a0, const string &a1,
const string &a2) {
assert(t == ep_s3 || t == ep_p3);
type = t;
nNumber = 0;
arg[0] = new CGCLCProverExpression(ep_point, a0);
arg[1] = new CGCLCProverExpression(ep_point, a1);
arg[2] = new CGCLCProverExpression(ep_point, a2);
arg[3] = NULL;
id = idCounter++;
}
// --------------------------------------------------------------------------
CGCLCProverExpression::CGCLCProverExpression(GCLCexperssion_type t,
const string &a0, const string &a1,
const string &a2,
const string &a3) {
assert(t == ep_s4 || t == ep_p4 || t == ep_segment_ratio || t == ep_parallel);
type = t;
nNumber = 0;
arg[0] = new CGCLCProverExpression(ep_point, a0);
arg[1] = new CGCLCProverExpression(ep_point, a1);
arg[2] = new CGCLCProverExpression(ep_point, a2);
arg[3] = new CGCLCProverExpression(ep_point, a3);
id = idCounter++;
}
// --------------------------------------------------------------------------
CGCLCProverExpression::CGCLCProverExpression(const double n) {
type = ep_number;
nNumber = n;
for (unsigned i = 0; i < ExpressionArgCount; i++)
arg[i] = NULL;
id = idCounter++;
}
// --------------------------------------------------------------------------
CGCLCProverExpression::CGCLCProverExpression(
GCLCexperssion_type t, const CGCLCProverExpression &arg0,
const CGCLCProverExpression &arg1) {
assert(arity(t) == 2);
type = t;
nNumber = 0;
arg[0] = new CGCLCProverExpression(arg0);
arg[1] = new CGCLCProverExpression(arg1);
for (unsigned i = 2; i < ExpressionArgCount; i++)
arg[i] = NULL;
id = idCounter++;
}
// --------------------------------------------------------------------------
CGCLCProverExpression CGCLCProverExpression::s3(const string &a0,
const string &a1,
const string &a2) {
CGCLCProverExpression n(ep_s3, a0, a1, a2);
return n;
}
// --------------------------------------------------------------------------
CGCLCProverExpression CGCLCProverExpression::p3(const string &a0,
const string &a1,
const string &a2) {
CGCLCProverExpression n(ep_p3, a0, a1, a2);
return n;
}
// --------------------------------------------------------------------------
CGCLCProverExpression CGCLCProverExpression::s4(const string &a0,
const string &a1,
const string &a2,
const string &a3) {
CGCLCProverExpression n(ep_s4, a0, a1, a2, a3);
return n;
}
// --------------------------------------------------------------------------
CGCLCProverExpression CGCLCProverExpression::p4(const string &a0,
const string &a1,
const string &a2,
const string &a3) {
CGCLCProverExpression n(ep_p4, a0, a1, a2, a3);
return n;
}
// --------------------------------------------------------------------------
CGCLCProverExpression CGCLCProverExpression::sratio(const string &a0,
const string &a1,
const string &a2,
const string &a3) {
CGCLCProverExpression n(ep_segment_ratio, a0, a1, a2, a3);
return n;
}
// --------------------------------------------------------------------------
CGCLCProverExpression CGCLCProverExpression::segment(const string &a0,
const string &a1) {
CGCLCProverExpression n(ep_segment, a0, a1);
return n;
}
// --------------------------------------------------------------------------
CGCLCProverExpression CGCLCProverExpression::
operator*(const CGCLCProverExpression &a) {
CGCLCProverExpression n(ep_mult, *this, a);
return n;
}
// --------------------------------------------------------------------------
CGCLCProverExpression CGCLCProverExpression::
operator+(const CGCLCProverExpression &a) {
CGCLCProverExpression e(ep_sum, *this, a);
return e;
}
// --------------------------------------------------------------------------
CGCLCProverExpression CGCLCProverExpression::
operator/(const CGCLCProverExpression &a) {
CGCLCProverExpression e(ep_ratio, *this, a);
return e;
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::CleanUp() {
// this->PrettyPrint();
// cout << "-------------" << endl;
for (unsigned i = 0; i < ExpressionArgCount; i++) {
if (arg[i])
delete arg[i];
arg[i] = NULL;
}
sName = "";
nNumber = 0;
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::Push(CGCLCProverExpression &left,
CGCLCProverExpression &right,
const CGCLCProverExpression &a) {
assert(type == ep_equality);
left = GetArg(0);
right = GetArg(1);
for (unsigned i = 0; i < 2; i++) {
if (arg[i])
delete arg[i];
arg[i] = new CGCLCProverExpression(a.GetArg(i));
}
SetType(ep_equality);
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::Pop(CGCLCProverExpression &left,
CGCLCProverExpression &right) {
assert(type == ep_equality);
if (arg[0])
delete arg[0];
if (arg[1])
delete arg[1];
arg[0] = new CGCLCProverExpression(left);
arg[1] = new CGCLCProverExpression(right);
SetType(ep_equality);
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::Set(GCLCexperssion_type t,
const CGCLCProverExpression &arg0,
const CGCLCProverExpression &arg1) {
assert(arity(t) == 2);
CleanUp();
type = t;
nNumber = 0;
SetArg(0, CGCLCProverExpression(arg0));
SetArg(1, CGCLCProverExpression(arg1));
for (unsigned i = 2; i < ExpressionArgCount; i++)
arg[i] = NULL;
// id = idCounter++;
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::SetArg(unsigned i, CGCLCProverExpression *a) {
if (arg[i])
delete arg[i];
arg[i] = a;
// arg[i] = new CGCLCProverExpression(*a);
// id = idCounter++;
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::SetArg(unsigned i, const CGCLCProverExpression &a) {
if (arg[i])
delete arg[i];
arg[i] = new CGCLCProverExpression(a);
// id = idCounter++;
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::SetArgName(unsigned i, const string &s) {
assert(type == ep_s3 || type == ep_p3 || type == ep_s4 || type == ep_p4 ||
type == ep_segment_ratio || type == ep_segment ||
type == ep_parallel || type == ep_collinear ||
type == ep_perpendicular || type == ep_midpoint ||
type == ep_harmonic || type == ep_same_length ||
type == ep_tangens_num || type == ep_tangens_den || type == ep_diffx ||
type == ep_diffy || type == ep_identical);
assert(i < arity(type));
arg[i]->SetName(s);
// id = idCounter++;
}
// --------------------------------------------------------------------------
string CGCLCProverExpression::GetArgName(unsigned i) const {
assert(type == ep_s3 || type == ep_p3 || type == ep_s4 || type == ep_p4 ||
type == ep_segment_ratio || type == ep_segment ||
type == ep_parallel || type == ep_collinear ||
type == ep_perpendicular || type == ep_midpoint ||
type == ep_harmonic || type == ep_same_length ||
type == ep_tangens_num || type == ep_tangens_den || type == ep_diffx ||
type == ep_diffy || type == ep_identical);
assert(i < arity(type));
return arg[i]->GetName();
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::operator==(const CGCLCProverExpression &r) const {
return Equal(r);
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::Equal(const CGCLCProverExpression &r) const {
// return (*this) == *r;
if (type != r.type)
return false;
if (type == ep_point)
return (sName == r.sName);
if (type == ep_constant)
return (sName == r.sName);
if (type == ep_number)
return (nNumber == r.nNumber);
for (unsigned i = 0; i < arity(type); i++)
if (!(arg[i]->Equal(*r.arg[i])))
return false;
return true;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::ExistsAtomicExpression(
const CGCLCProverExpression &subexp) const {
switch (GetType()) {
case ep_number:
case ep_point:
case ep_s3:
case ep_segment:
case ep_segment_ratio:
case ep_p3:
case ep_p4:
case ep_s4:
if (*this == subexp)
return true;
break;
case ep_equality:
case ep_sum:
case ep_ratio:
case ep_mult:
if (GetArg(0).ExistsAtomicExpression(subexp))
return true;
if (GetArg(1).ExistsAtomicExpression(subexp))
return true;
break;
default:
break;
}
return false;
}
bool CGCLCProverExpression::GetParentIndex(CGCLCProverExpression &outer,
CGCLCProverExpression *&parent,
int &index) const {
if (*this == outer)
return false;
for (unsigned i = 0; i < arity(outer.GetType()); i++) {
if (*this == outer.GetArg(i)) {
parent = &outer;
index = i;
return true;
}
if (GetParentIndex(outer.GetArg(i), parent, index))
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::Replace(const CGCLCProverExpression &LHS,
const CGCLCProverExpression &RHS) {
/*if (old_expression->Equal(new_expression)) {
delete old_expression;
old_expression = new CGCLCProverExpression(*new_expression);
if (old_expression == NULL)
return false;
else
return true;
}*/
for (unsigned i = 0; i < arity(type); i++)
if (*arg[i] == LHS) {
delete arg[i];
arg[i] = new CGCLCProverExpression(RHS);
if (arg[i] == NULL)
return false;
} else if (!arg[i]->Replace(LHS, RHS))
return false;
return true;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::ApplyAllAlgebraicRules(string &sRuleApplied,
int iExceptLast) {
for (unsigned i = 0; i < mRules.m_nNumberOfRules - iExceptLast; i++)
if (ApplyOneAlgebraicRule(mRules.m_aiRule[i])) {
sRuleApplied = mRules.m_asRuleName[mRules.m_aiRule[i]];
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::ApplyAllSimpleAlgebraicRules(string &sRuleApplied,
int iExceptLast) {
for (unsigned i = 0; i < 14 && i < mRules.m_nNumberOfRules - iExceptLast; i++) {
if (ApplyOneAlgebraicRule(mRules.m_aiRule[i])) {
sRuleApplied = mRules.m_asRuleName[mRules.m_aiRule[i]];
return true;
}
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::ApplyAllComplexAlgebraicRules(string &sRuleApplied,
int iExceptLast) {
for (unsigned i = 14; i < mRules.m_nNumberOfRules - iExceptLast; i++) {
if (ApplyOneAlgebraicRule(mRules.m_aiRule[i])) {
sRuleApplied = mRules.m_asRuleName[mRules.m_aiRule[i]];
return true;
}
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::ApplyOneAlgebraicRule(GCLCalgebraic_rule rule) {
switch (rule) {
case er_RatioCancellation:
if (RatioCancellation())
return true;
break;
case er_MultiplicationOfConstants:
if (MultiplicationOfConstants())
return true;
break;
case er_AdditionWithZero:
if (AdditionWithZero())
return true;
break;
case er_MultiplicationWithOne:
if (MultiplicationWithOne())
return true;
break;
case er_CommutativityWithNumber:
if (CommutativityWithNumber())
return true;
break;
case er_AssociativityAndCommutativity:
if (AssociativityAndCommutativity())
return true;
break;
case er_RightAssoc:
if (RightAssoc())
return true;
break;
case er_MultiplicationOfFractions:
if (MultiplicationOfFractions())
return true;
break;
case er_DistrMultOverAdd:
if (DistrMultOverAdd())
return true;
break;
case er_MultiplicationWithZero:
if (MultiplicationWithZero())
return true;
break;
case er_MultipleFraction:
if (MultipleFraction())
return true;
break;
case er_SumOfFractions:
if (SumOfFractions())
return true;
break;
case er_SimilarSummands:
if (SimilarSummands())
return true;
break;
case er_SimilarSummandsOnTwoSides:
if (SimilarSummandsOnTwoSides())
return true;
break;
case er_ZeroFractionUp:
if (ZeroFractionUp())
return true;
break;
case er_FractionEqualZero:
if (FractionEqualZero())
return true;
break;
case er_FractionWithNumberDenominator:
if (FractionWithNumberDenominator())
return true;
break;
case er_OneSide:
if (OneSide())
return true;
break;
case er_FractionsOnTwoSides:
if (FractionsOnTwoSides())
return true;
break;
case er_EliminateFraction:
if (EliminateFraction())
return true;
break;
default:
break;
}
for (unsigned i = 0; i < ExpressionArgCount; i++)
if (arg[i] != NULL)
if (arg[i]->ApplyOneAlgebraicRule(rule))
return true;
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::MultiplicationOfFractions() {
// (a/b)*(c/d) = (a*c)/(b*d)
if (type == ep_mult && GetArg(0).type == ep_ratio &&
GetArg(1).type == ep_ratio) {
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1).GetArg(0));
CGCLCProverExpression d(GetArg(1).GetArg(1));
*this = ((a * c) / (b * d));
return true;
}
// a*(c/d) = (a*c)/d
if (type == ep_mult && GetArg(1).type == ep_ratio &&
GetArg(0).type != ep_ratio) {
CGCLCProverExpression a(GetArg(0));
CGCLCProverExpression c(GetArg(1).GetArg(0));
CGCLCProverExpression d(GetArg(1).GetArg(1));
*this = ((a * c) / d);
return true;
}
// (a/b)*c = (a*c)/b
if (type == ep_mult && GetArg(0).type == ep_ratio &&
GetArg(1).type != ep_ratio) {
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1));
type = ep_ratio;
*this = ((a * c) / b);
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::MultiplicationWithZero() {
// 0*x -> 0
if (type == ep_mult && GetArg(0).type == ep_number &&
GetArg(0).nNumber == 0.0) {
*this = 0.0;
return true;
}
// x*0 -> 0
if (type == ep_mult && GetArg(1).type == ep_number &&
GetArg(1).nNumber == 0.0) {
*this = 0.0;
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::ZeroFractionUp() {
// 0/x -> 0
if (type == ep_ratio && GetArg(0).type == ep_number &&
GetArg(0).nNumber == 0.0) {
*this = 0.0;
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::FractionEqualZero() {
// a/b = 0 -> a = 0
if (type == ep_equality && GetArg(0).type == ep_ratio &&
(GetArg(1).type == ep_number) && (GetArg(1).nNumber == 0.0)) {
CGCLCProverExpression a(GetArg(0).GetArg(0));
SetArg(0, a);
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::FractionWithNumberDenominator() {
// a/n -> 1/n * a
if (type == ep_ratio)
if (GetArg(0).type != ep_number && GetArg(1).type == ep_number) {
CGCLCProverExpression a(GetArg(0));
if (GetArg(1).nNumber == 1.0) {
*this = a;
return true;
} else {
CGCLCProverExpression m(1 / GetArg(1).nNumber);
*this = (m * a);
return true;
}
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::MultiplicationWithOne() {
// 1*a -> a
if (type == ep_mult && GetArg(0).type == ep_number &&
GetArg(0).nNumber == 1.0) {
CGCLCProverExpression a(GetArg(1));
*this = a;
return true;
}
// a*1 -> a
if (type == ep_mult && GetArg(1).type == ep_number &&
GetArg(1).nNumber == 1.0) {
CGCLCProverExpression a(GetArg(0));
*this = a;
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::AdditionWithZero() {
// a + 0 -> a
if (type == ep_sum && GetArg(1).type == ep_number &&
GetArg(1).nNumber == 0.0) {
CGCLCProverExpression a(GetArg(0));
*this = a;
return true;
}
// 0+a -> a
if (type == ep_sum && GetArg(0).type == ep_number &&
GetArg(0).nNumber == 0.0) {
CGCLCProverExpression a(GetArg(1));
*this = a;
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::MultiplicationOfConstants() {
// n1 * n1 -> m (m is the product)
if (type == ep_mult)
if (GetArg(0).type == ep_number && GetArg(1).type == ep_number) {
double m = GetArg(0).nNumber * GetArg(1).nNumber;
*this = m;
return true;
}
// n1 * (n2 * a) -> m * a (m is the product)
if (type == ep_mult)
if (GetArg(0).type == ep_number && GetArg(1).type == ep_mult &&
(GetArg(1).GetArg(0).type == ep_number)) {
CGCLCProverExpression a(GetArg(1).GetArg(1));
CGCLCProverExpression m(GetArg(0).nNumber * GetArg(1).GetArg(0).nNumber);
*this = (m * a);
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::CommutativityWithNumber() {
if (type == ep_mult)
if (GetArg(0).type != ep_number && GetArg(1).type == ep_number) {
// a*n -> n*a
CGCLCProverExpression a(GetArg(0));
CGCLCProverExpression n(GetArg(1));
*this = (n * a);
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::AssociativityAndCommutativity() {
if (type == ep_mult && GetArg(1).type == ep_mult &&
GetArg(0).type != ep_number && GetArg(1).GetArg(0).type == ep_number) {
// a*(n*b) -> n*(a*b)
CGCLCProverExpression a(GetArg(0));
CGCLCProverExpression n(GetArg(1).GetArg(0));
CGCLCProverExpression b(GetArg(1).GetArg(1));
*this = (n * (a * b));
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::RatioCancellation() {
if (type == ep_segment_ratio) {
// AB/AB -> 1
if (GetArg(0) == GetArg(2) && GetArg(1) == GetArg(3)) {
*this = 1.0;
return true;
}
// AB/BA -> -1
if (GetArg(0) == GetArg(3) && GetArg(1) == GetArg(2)) {
*this = -1.0;
return true;
}
}
if (type == ep_ratio) {
// x/x -> 1
if (GetArg(0) == GetArg(1)) {
*this = 1.0;
return true;
}
if (GetArg(0).CancelPairFirst(GetArg(1)))
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::CancelPairFirst(CGCLCProverExpression &exp2) {
if (type == ep_number)
if (nNumber == 1)
return false;
switch (type) {
case ep_mult:
if (CancelPairSecond(exp2))
return true;
if (GetArg(0).CancelPairFirst(exp2))
return true;
if (GetArg(1).CancelPairFirst(exp2))
return true;
break;
default:
if (CancelPairSecond(exp2))
return true;
break;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::CancelPairSecond(CGCLCProverExpression &exp2) {
switch (exp2.GetType()) {
case ep_mult:
if (CancelPair(exp2))
return true;
if (CancelPairSecond(exp2.GetArg(0)))
return true;
if (CancelPairSecond(exp2.GetArg(1)))
return true;
break;
default:
if (CancelPair(exp2))
return true;
break;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::CancelPair(CGCLCProverExpression &exp2) {
if (*this == exp2) {
*this = 1.0;
exp2 = 1.0;
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::RightAssoc() {
if (type == ep_mult && GetArg(0).type == ep_mult) {
// (a*b)*c -> a*(b*c)
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1));
*this = (a * (b * c));
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::DistrMultOverAdd() {
// n*(a+b) -> n*a+n*b
if (type == ep_mult && GetArg(1).type == ep_sum) {
CGCLCProverExpression n(GetArg(0));
CGCLCProverExpression a(GetArg(1).GetArg(0));
CGCLCProverExpression b(GetArg(1).GetArg(1));
*this = ((n * a) + (n * b));
return true;
}
// (a+b)*n -> n*a+n*b
if (type == ep_mult && GetArg(0).type == ep_sum) {
CGCLCProverExpression n(GetArg(1));
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
*this = ((n * a) + (n * b));
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::MultipleFraction() {
// (a/b)/(c/d) = (a*d)/(b*c)
if (type == ep_ratio && GetArg(0).type == ep_ratio &&
GetArg(1).type == ep_ratio) {
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1).GetArg(0));
CGCLCProverExpression d(GetArg(1).GetArg(1));
*this = ((a * d) / (b * c));
return true;
}
// (a/b)/c -> a/(b*c)
if (type == ep_ratio && GetArg(0).type == ep_ratio &&
GetArg(1).type != ep_ratio) {
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1));
*this = (a / (b * c));
return true;
}
// a/(c/d) = (a*d)/c
if (type == ep_ratio && GetArg(0).type != ep_ratio &&
GetArg(1).type == ep_ratio) {
CGCLCProverExpression a(GetArg(0));
CGCLCProverExpression c(GetArg(1).GetArg(0));
CGCLCProverExpression d(GetArg(1).GetArg(1));
*this = ((a * d) / c);
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::FractionsOnTwoSides() {
// a/b = c/b -> a/1 = c/1
if (type == ep_equality && GetArg(0).type == ep_ratio &&
GetArg(1).type == ep_ratio && GetArg(0).GetArg(1) == GetArg(1).GetArg(1))
if ((GetArg(0).GetArg(1).type != ep_number) ||
(GetArg(0).GetArg(1).nNumber != 1)) {
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(1.0);
CGCLCProverExpression c(GetArg(1).GetArg(0));
Set(ep_equality, a / b, c / b);
return true;
}
// a/b = c/d -> a*d = c*b
if (type == ep_equality && GetArg(0).type == ep_ratio &&
GetArg(1).type == ep_ratio) {
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1).GetArg(0));
CGCLCProverExpression d(GetArg(1).GetArg(1));
Set(ep_equality, a * d, c * b);
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::EliminateFraction() {
// a/b = c -> a = b*c
if (type == ep_equality && GetArg(0).type == ep_ratio) {
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1));
Set(ep_equality, a, b * c);
return true;
}
// a = c/d -> a*d = c
if (type == ep_equality && GetArg(1).type == ep_ratio) {
CGCLCProverExpression a(GetArg(0));
CGCLCProverExpression c(GetArg(1).GetArg(0));
CGCLCProverExpression d(GetArg(1).GetArg(1));
Set(ep_equality, a * d, c);
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::SumOfFractions() {
if (type != ep_sum)
return false;
if (GetArg(0).type == ep_ratio) {
if (GetArg(1).type == ep_ratio) {
if (GetArg(0).GetArg(1) == GetArg(1).GetArg(1)) {
// a/b + c/b = (a+c)/b
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1).GetArg(0));
*this = ((a + c) / b);
return true;
} else { // a/b + c/d = (ad+bc)/bd
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1).GetArg(0));
CGCLCProverExpression d(GetArg(1).GetArg(1));
*this = (((a * d) + (b * c)) / (b * d));
return true;
}
} else { // GetArg(1).type != ep_ratio
// a/b + c = (a+cb)/b
CGCLCProverExpression a(GetArg(0).GetArg(0));
CGCLCProverExpression b(GetArg(0).GetArg(1));
CGCLCProverExpression c(GetArg(1));
*this = ((a + (c * b)) / b);
return true;
}
} else { // GetArg(0).type != ep_ratio
if (GetArg(1).type == ep_ratio) {
// c + a/b = (cb+a)/b
CGCLCProverExpression a(GetArg(1).GetArg(0));
CGCLCProverExpression b(GetArg(1).GetArg(1));
CGCLCProverExpression c(GetArg(0));
*this = (((c * b) + a) / b);
return true;
}
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::CancelationMult(
const CGCLCProverExpression &Factor) {
CGCLCProverExpression **aSummands, **aMultiplicants;
int iMaxIndex = CountTopLevelOperands(ep_sum);
aSummands = new CGCLCProverExpression *[iMaxIndex];
iMaxIndex = 0;
FillTopLevelOperands(ep_sum, aSummands, iMaxIndex);
int j, k;
for (j = 0; j < iMaxIndex; j++) {
aMultiplicants = new CGCLCProverExpression
*[aSummands[j]->CountTopLevelOperands(ep_mult)];
if (aMultiplicants == NULL) {
delete[] aSummands;
return false;
}
int iMaxIndex2 = 0;
aSummands[j]->FillTopLevelOperands(ep_mult, aMultiplicants, iMaxIndex2);
bool bExists = false;
for (k = 0; k < iMaxIndex2 && !bExists; k++) {
if (Factor == *(aMultiplicants[k])) {
*aMultiplicants[k] = 1.0;
bExists = true;
} else {
if (aMultiplicants[k]->GetType() == ep_number)
if (aMultiplicants[k]->GetNumber() == 0)
bExists = true;
}
}
delete[] aMultiplicants;
}
delete[] aSummands;
return true;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::AllSummandsHaveFactor(
const CGCLCProverExpression &Factor) {
CGCLCProverExpression **aSummands;
CGCLCProverExpression **aMultiplicants;
int iMaxIndex = CountTopLevelOperands(ep_sum);
aSummands = new CGCLCProverExpression *[iMaxIndex];
iMaxIndex = 0;
FillTopLevelOperands(ep_sum, aSummands, iMaxIndex);
bool bEverywhere, bExists;
int j, k;
bEverywhere = true;
for (j = 0; j < iMaxIndex && bEverywhere; j++) {
if (aSummands[j]->GetType() != ep_number ||
aSummands[j]->GetNumber() != 0) {
aMultiplicants = new CGCLCProverExpression
*[aSummands[j]->CountTopLevelOperands(ep_mult)];
if (aMultiplicants == NULL) {
delete[] aSummands;
return false;
}
int iMaxIndex2 = 0;
aSummands[j]->FillTopLevelOperands(ep_mult, aMultiplicants, iMaxIndex2);
bExists = false;
for (k = 0; k < iMaxIndex2 && !bExists; k++) {
if (Factor == *(aMultiplicants[k]))
bExists = true;
}
if (!bExists)
bEverywhere = false;
delete[] aMultiplicants;
}
}
delete[] aSummands;
return bEverywhere;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::SimilarSummandsOnTwoSides() {
if (type != ep_equality)
return false;
if (GetArg(0).type == ep_number)
return false;
if (GetArg(1).type == ep_number)
return false;
CGCLCProverExpression **aSummands1, **aSummands2;
int iMaxIndex1 = GetArg(0).CountTopLevelOperands(ep_sum);
int iMaxIndex2 = GetArg(1).CountTopLevelOperands(ep_sum);
aSummands1 = new CGCLCProverExpression *[iMaxIndex1];
iMaxIndex1 = 0;
GetArg(0).FillTopLevelOperands(ep_sum, aSummands1, iMaxIndex1);
aSummands2 = new CGCLCProverExpression *[iMaxIndex2];
iMaxIndex2 = 0;
GetArg(1).FillTopLevelOperands(ep_sum, aSummands2, iMaxIndex2);
int i, j, k, l;
for (i = 0; i < iMaxIndex1; i++) {
CGCLCProverExpression **aMultiplicants1, **aMultiplicants2;
aMultiplicants1 = new CGCLCProverExpression
*[aSummands1[i]->CountTopLevelOperands(ep_mult)];
if (aMultiplicants1 == NULL) {
delete[] aSummands1;
delete[] aSummands2;
return false;
}
int iMaxIndex3 = 0;
aSummands1[i]->FillTopLevelOperands(ep_mult, aMultiplicants1, iMaxIndex3);
for (j = 0; j < iMaxIndex2; j++) {
aMultiplicants2 = new CGCLCProverExpression
*[aSummands2[j]->CountTopLevelOperands(ep_mult)];
if (aMultiplicants2 == NULL) {
delete[] aMultiplicants1;
delete[] aSummands1;
delete[] aSummands2;
return false;
}
int iMaxIndex4 = 0;
aSummands2[j]->FillTopLevelOperands(ep_mult, aMultiplicants2, iMaxIndex4);
int k0 = (aMultiplicants1[0]->type == ep_number ? 1 : 0);
int l0 = (aMultiplicants2[0]->type == ep_number ? 1 : 0);
if ((iMaxIndex3 - k0) != (iMaxIndex4 - l0)) {
delete[] aMultiplicants2;
continue;
}
bool bAllFound = true;
for (k = k0; k < iMaxIndex3 && bAllFound; k++) {
bool bFoundMatching = false;
for (l = l0; l < iMaxIndex4 && !bFoundMatching; l++)
if (aMultiplicants2[l] != NULL)
if (*(aMultiplicants1[k]) == *(aMultiplicants2[l])) {
bFoundMatching = true;
aMultiplicants2[l] = NULL;
}
if (!bFoundMatching)
bAllFound = false;
}
if (bAllFound) {
if (k0 == 1) {
if (l0 == 0)
aMultiplicants1[0]->nNumber -= 1;
else
aMultiplicants1[0]->nNumber -= aMultiplicants2[0]->nNumber;
if (fabs(aMultiplicants1[0]->nNumber) < EPSILON)
aMultiplicants1[0]->nNumber = 0; // changed 22.02.2006.
} else {
double n;
if (l0 == 0)
n = 0;
else
n = 1 - aMultiplicants2[0]->nNumber;
CGCLCProverExpression a(*(aSummands1[i]));
CGCLCProverExpression b(n);
*aSummands1[i] = (b * a);
}
*aSummands2[j] = 0.0;
delete[] aMultiplicants1;
delete[] aMultiplicants2;
delete[] aSummands1;
delete[] aSummands2;
return true;
} else
delete[] aMultiplicants2;
}
delete[] aMultiplicants1;
}
delete[] aSummands1;
delete[] aSummands2;
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::SimilarSummands() {
if (type != ep_sum)
return false;
CGCLCProverExpression **aSummands;
int iMaxIndex = CountTopLevelOperands(ep_sum);
if (iMaxIndex == 1)
return false;
aSummands = new CGCLCProverExpression *[iMaxIndex];
if (aSummands == NULL)
return false;
iMaxIndex = 0;
FillTopLevelOperands(ep_sum, aSummands, iMaxIndex);
int i, j, k, l;
for (i = 0; i < iMaxIndex; i++) {
CGCLCProverExpression **aMultiplicants1, **aMultiplicants2;
aMultiplicants1 = new CGCLCProverExpression
*[aSummands[i]->CountTopLevelOperands(ep_mult)];
if (aMultiplicants1 == NULL) {
delete[] aSummands;
return false;
}
int iMaxIndex1 = 0;
aSummands[i]->FillTopLevelOperands(ep_mult, aMultiplicants1, iMaxIndex1);
for (j = i + 1; j < iMaxIndex; j++) {
aMultiplicants2 = new CGCLCProverExpression
*[aSummands[j]->CountTopLevelOperands(ep_mult)];
if (aMultiplicants2 == NULL) {
delete[] aMultiplicants1;
delete[] aSummands;
return false;
}
int iMaxIndex2 = 0;
aSummands[j]->FillTopLevelOperands(ep_mult, aMultiplicants2, iMaxIndex2);
int k0 = (aMultiplicants1[0]->type == ep_number ? 1 : 0);
int l0 = (aMultiplicants2[0]->type == ep_number ? 1 : 0);
if ((iMaxIndex1 - k0) != (iMaxIndex2 - l0)) {
delete[] aMultiplicants2;
continue;
}
bool bAllFound = true;
for (k = k0; k < iMaxIndex1 && bAllFound; k++) {
bool bFoundMatching = false;
for (l = l0; l < iMaxIndex2 && !bFoundMatching; l++)
if (aMultiplicants2[l] != NULL)
if (*(aMultiplicants1[k]) == *(aMultiplicants2[l])) {
bFoundMatching = true;
aMultiplicants2[l] = NULL;
}
if (!bFoundMatching)
bAllFound = false;
}
if (bAllFound) {
if (k0 == 1) {
if (l0 == 0)
aMultiplicants1[0]->nNumber += 1;
else {
aMultiplicants1[0]->nNumber += aMultiplicants2[0]->nNumber;
if (fabs(aMultiplicants1[0]->nNumber) < EPSILON)
aMultiplicants1[0]->nNumber = 0; // changed 22.02.2006.
}
} else {
double n;
if (l0 == 0)
n = 2;
else
n = 1 + aMultiplicants2[0]->nNumber;
CGCLCProverExpression a(*(aSummands[i]));
CGCLCProverExpression b(n);
*aSummands[i] = (b * a);
}
*aSummands[j] = 0.0;
delete[] aMultiplicants1;
delete[] aMultiplicants2;
delete[] aSummands;
return true;
} else
delete[] aMultiplicants2;
}
delete[] aMultiplicants1;
}
delete[] aSummands;
return false;
}
// --------------------------------------------------------------------------
int CGCLCProverExpression::CountTopLevelOperands(GCLCexperssion_type t) {
if (type != t)
return 1;
else
return GetArg(0).CountTopLevelOperands(t) +
GetArg(1).CountTopLevelOperands(t);
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::FillTopLevelOperands(GCLCexperssion_type t,
CGCLCProverExpression **a,
int &iIndex) {
if (type != t)
a[iIndex++] = this;
else {
GetArg(0).FillTopLevelOperands(t, a, iIndex);
GetArg(1).FillTopLevelOperands(t, a, iIndex);
}
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::OneSide() {
// a = b -> a + -b
// except for b=0 and numbers a,b such that a=b
if (type == ep_equality) {
if (GetArg(1).type == ep_number && GetArg(1).nNumber == 0)
return false;
if (GetArg(0).type == ep_number && GetArg(1).type == ep_number &&
GetArg(0).nNumber == GetArg(1).nNumber)
return false;
CGCLCProverExpression a(GetArg(0));
CGCLCProverExpression b(GetArg(1));
CGCLCProverExpression negOne(-1);
Set(ep_equality, a + (negOne * b), 0.0);
return true;
}
return false;
}
// --------------------------------------------------------------------------
bool CGCLCProverExpression::ToGeometricQuantities() {
CGCLCProverExpression m1, m2;
switch (type) {
case ep_identical:
m1 = p3(GetArgName(0), GetArgName(1), GetArgName(0));
m2 = 0.0;
break;
case ep_collinear:
m1 = s3(GetArgName(0), GetArgName(1), GetArgName(2));
m2 = 0.0;
break;
case ep_midpoint:
m1 = sratio(GetArgName(1), GetArgName(0), GetArgName(0), GetArgName(2));
m2 = 1.0;
break;
case ep_parallel:
m1 = s3(GetArgName(0), GetArgName(2), GetArgName(3));
m2 = s3(GetArgName(1), GetArgName(2), GetArgName(3));
break;
case ep_perpendicular:
m1 = p3(GetArgName(0), GetArgName(2), GetArgName(3));
m2 = p3(GetArgName(1), GetArgName(2), GetArgName(3));
break;
case ep_same_length:
m1 = p3(GetArgName(0), GetArgName(1), GetArgName(0));
m2 = p3(GetArgName(2), GetArgName(3), GetArgName(2));
break;
case ep_harmonic:
m1 = sratio(GetArgName(0), GetArgName(2), GetArgName(2), GetArgName(1));
m2 = sratio(GetArgName(3), GetArgName(0), GetArgName(3), GetArgName(1));
break;
default:
return false;
}
Set(ep_equality, m1, m2);
return true;
}
// --------------------------------------------------------------------------
bool CTheoremProver::GetPointCoordinates(const string &sPoint, double &x,
double &y) const {
for (list<CGCLCProverCommand>::const_iterator it = m_ProverCommands.begin();
it != m_ProverCommands.end(); it++) {
if ((it->type == p_point) || (it->type == p_inter) ||
(it->type == p_pratio) || (it->type == p_tratio) ||
(it->type == p_foot)) {
if (it->arg[0] == sPoint) {
x = it->x;
y = it->y;
return true;
}
}
}
return false;
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::SetType(GCLCexperssion_type t) { type = t; }
// --------------------------------------------------------------------------
int CGCLCProverExpression::Size() {
switch (type) {
case ep_number:
case ep_point:
case ep_constant:
case ep_segment:
case ep_segment_ratio:
case ep_s3:
case ep_s4:
case ep_p3:
case ep_p4:
return 1;
case ep_equality:
case ep_sum:
case ep_ratio:
case ep_mult:
return GetArg(0).Size() + GetArg(1).Size();
default:
return 0;
}
return 0;
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::PrettyPrint() const {
switch (type) {
case ep_number:
if ((double)((int)nNumber) == nNumber)
Print(cout, " " + i2s((int)nNumber) + " ");
else
Print(cout, " " + d2s(nNumber, 2) + " ");
break;
case ep_constant:
Print(cout, sName);
break;
case ep_point:
Print(cout, " " + sName);
break;
case ep_equality:
Print(cout, "(equal ");
break;
case ep_diffx:
Print(cout, "(diffx ");
break;
case ep_diffy:
Print(cout, "(diffy ");
break;
case ep_sum:
Print(cout, "(sum ");
break;
case ep_ratio:
Print(cout, "(ratio ");
break;
case ep_segment:
Print(cout, "(segment ");
break;
case ep_segment_ratio:
Print(cout, "(sratio ");
break;
case ep_mult:
Print(cout, "(ep_mult ");
break;
case ep_s3:
Print(cout, "(signed_area3 ");
break;
case ep_s4:
Print(cout, "(signed_area4 ");
break;
case ep_p3:
Print(cout, "(pythagoras_difference3 ");
break;
case ep_p4:
Print(cout, "(pythagoras_difference4 ");
break;
default:
break;
}
switch (type) {
case ep_point:
break;
case ep_equality:
case ep_sum:
case ep_mult:
case ep_ratio:
case ep_segment:
case ep_diffx:
case ep_diffy:
GetArg(0).PrettyPrint();
GetArg(1).PrettyPrint();
Print(cout, ")");
break;
case ep_s3:
case ep_p3:
GetArg(0).PrettyPrint();
GetArg(1).PrettyPrint();
GetArg(2).PrettyPrint();
Print(cout, ")");
break;
case ep_segment_ratio:
case ep_s4:
case ep_p4:
GetArg(0).PrettyPrint();
GetArg(1).PrettyPrint();
GetArg(2).PrettyPrint();
GetArg(3).PrettyPrint();
Print(cout, ")");
break;
case ep_unknown:
Print(cout, "unkown");
break;
default:
break;
}
cout << flush;
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::PrintLaTeX(ofstream &h) const {
Print(h, sPrintLaTeX(true));
}
// --------------------------------------------------------------------------
string CGCLCProverExpression::sPrintLaTeX(bool hasFractions) const {
string s;
switch (type) {
case ep_point:
s = sName;
break;
case ep_constant:
s = sName;
break;
case ep_number:
if ((double)((int)nNumber) == nNumber)
s = " " + i2s((int)nNumber) + " ";
else {
if (nNumber == 0.5)
s = "\\frac{1}{2} ";
else if (nNumber == -0.5)
s = "-\\frac{1}{2} ";
else if (nNumber == 0.25)
s = "\\frac{1}{4} ";
else if (nNumber == -0.25)
s = "-\\frac{1}{4} ";
else if (nNumber == 0.75)
s = "\\frac{3}{4} ";
else if (nNumber == -0.75)
s = "-\\frac{3}{4} ";
else if (nNumber == 0.125)
s = "\\frac{1}{8} ";
else if (nNumber == -0.125)
s = "-\\frac{1}{8} ";
else
s = d2s(nNumber, -1);
}
break;
case ep_inequality:
s = GetArg(0).sPrintLaTeX(hasFractions) + " \\neq " +
GetArg(1).sPrintLaTeX(hasFractions);
break;
case ep_equality:
s = GetArg(0).sPrintLaTeX(hasFractions) + " = " +
GetArg(1).sPrintLaTeX(hasFractions);
break;
case ep_sum:
s = (hasFractions ? " \\left(" : " (") +
GetArg(0).sPrintLaTeX(hasFractions) + " + " +
GetArg(1).sPrintLaTeX(hasFractions) + (hasFractions ? "\\right)" : ")");
break;
case ep_mult:
s = (hasFractions ? " \\left(" : " (") +
GetArg(0).sPrintLaTeX(hasFractions) + " \\cdot " +
GetArg(1).sPrintLaTeX(hasFractions) + (hasFractions ? "\\right)" : ")");
break;
case ep_ratio:
s = " \\frac{" + GetArg(0).sPrintLaTeX(hasFractions) + "}{" +
GetArg(1).sPrintLaTeX(hasFractions) + "}";
break;
case ep_s3:
s = " S_{" + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) +
GetArg(2).sPrintLaTeX(hasFractions) + "}";
break;
case ep_p3:
s = " P_{" + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) +
GetArg(2).sPrintLaTeX(hasFractions) + "}";
break;
case ep_segment:
s = " {" + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) + "}";
break;
case ep_segment_ratio:
s = " \\frac{\\overrightarrow{" + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) + "}}{\\overrightarrow{" +
GetArg(2).sPrintLaTeX(hasFractions) +
GetArg(3).sPrintLaTeX(hasFractions) + "}}";
break;
case ep_harmonic:
s = " \\frac{\\overrightarrow{" + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(2).sPrintLaTeX(hasFractions) + "}}{\\overrightarrow{" +
GetArg(2).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) + "}} \\cdot " +
" \\frac{\\overrightarrow{" + GetArg(3).sPrintLaTeX(hasFractions) +
GetArg(0).sPrintLaTeX(hasFractions) + "}}{\\overrightarrow{" +
GetArg(3).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) + "}} = 1";
break;
case ep_s4:
s = " S_{" + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) +
GetArg(2).sPrintLaTeX(hasFractions) +
GetArg(3).sPrintLaTeX(hasFractions) + "}";
break;
case ep_p4:
s = " P_{" + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) +
GetArg(2).sPrintLaTeX(hasFractions) +
GetArg(3).sPrintLaTeX(hasFractions) + "}";
break;
case ep_diffy:
case ep_diffx:
s = (string)(hasFractions ? "\\left(" : " (") +
(type == ep_diffy ? "y" : "x") + (hasFractions ? "\\left(" : "(") +
GetArg(0).sPrintLaTeX(hasFractions) +
(hasFractions ? "\\right) - " : ") - ") +
(type == ep_diffy ? "y" : "x") + (hasFractions ? "\\left(" : "(") +
GetArg(1).sPrintLaTeX(hasFractions) +
(hasFractions ? "\\right)" : ")") + (hasFractions ? "\\right)" : ")");
break;
case ep_algsumzero3:
s = GetArg(0).sPrintLaTeX(hasFractions) + "+" +
GetArg(1).sPrintLaTeX(hasFractions) + "+" +
GetArg(2).sPrintLaTeX(hasFractions) + "=0 ";
break;
case ep_angle:
s = "tan(\\angle " + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) +
GetArg(2).sPrintLaTeX(hasFractions) + ") ";
break;
case ep_tangens_num:
s = "\\angle " + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) +
GetArg(2).sPrintLaTeX(hasFractions) + " ";
break;
case ep_tangens_den:
s = "\\frac{1}{\\angle " + GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) +
GetArg(2).sPrintLaTeX(hasFractions) + "} ";
break;
case ep_parallel:
s = GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) + "\\parallel " +
GetArg(2).sPrintLaTeX(hasFractions) +
GetArg(3).sPrintLaTeX(hasFractions) + " ";
break;
case ep_perpendicular:
s = GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) + "\\perp " +
GetArg(2).sPrintLaTeX(hasFractions) +
GetArg(3).sPrintLaTeX(hasFractions) + " ";
break;
case ep_collinear:
s = "collinear( " + GetArg(0).sPrintLaTeX(hasFractions) + ", " +
GetArg(1).sPrintLaTeX(hasFractions) + ", " +
GetArg(2).sPrintLaTeX(hasFractions) + ") ";
break;
case ep_same_length:
s = GetArg(0).sPrintLaTeX(hasFractions) +
GetArg(1).sPrintLaTeX(hasFractions) + "\\cong " +
GetArg(2).sPrintLaTeX(hasFractions) +
GetArg(3).sPrintLaTeX(hasFractions) + " ";
break;
case ep_identical:
s = GetArg(0).sPrintLaTeX(hasFractions) + "\\equiv " +
GetArg(1).sPrintLaTeX(hasFractions) + " ";
break;
default:
Print(cerr, "Output for command " + GetName() + " not implemented!\n");
throw 0;
break;
}
return s;
}
// --------------------------------------------------------------------------
void CGCLCProverExpression::PrintXML(ofstream &h, int indent) const {
Print(h, sPrintXML(indent));
}
// --------------------------------------------------------------------------
string CGCLCProverExpression::sPrintXML(int indent) const {
string s;
switch (type) {
case ep_point:
s = "<point>" + sName + "</point>";
break;
case ep_constant:
s = make_indent(indent) + "<constant>" + sName + "</constant>\n";
break;
case ep_number:
s = make_indent(indent) + "<number>" + d2s(nNumber, -1) + "</number>\n";
break;
case ep_equality:
case ep_identical: // added 25.04.2008
s += make_indent(indent) + "<equality>\n" + make_indent(indent + 1) +
"<expression>\n" + GetArg(0).sPrintXML(indent + 2) +
make_indent(indent + 1) + "</expression>\n" + make_indent(indent + 1) +
"<expression>\n" + GetArg(1).sPrintXML(indent + 2) +
make_indent(indent + 1) + "</expression>\n" + make_indent(indent) +
"</equality>\n";
break;
case ep_sum:
s += make_indent(indent) + "<sum>\n" + make_indent(indent + 1) +
"<expression>\n" + GetArg(0).sPrintXML(indent + 2) +
make_indent(indent + 1) + "</expression>\n" + make_indent(indent + 1) +
"<expression>\n" + GetArg(1).sPrintXML(indent + 2) +
make_indent(indent + 1) + "</expression>\n" + make_indent(indent) +
"</sum>\n";
break;
case ep_mult:
s += make_indent(indent) + "<mult>\n" + make_indent(indent + 1) +
"<expression>\n" + GetArg(0).sPrintXML(indent + 2) +
make_indent(indent + 1) + "</expression>\n" + make_indent(indent + 1) +
"<expression>\n" + GetArg(1).sPrintXML(indent + 2) +
make_indent(indent + 1) + "</expression>\n" + make_indent(indent) +
"</mult>\n";
break;
case ep_ratio:
s += make_indent(indent) + "<fraction>\n" + make_indent(indent + 1) +
"<expression>\n" + GetArg(0).sPrintXML(indent + 2) +
make_indent(indent + 1) + "</expression>\n" + make_indent(indent + 1) +
"<expression>\n" + GetArg(1).sPrintXML(indent + 2) +
make_indent(indent + 1) + "</expression>\n" + make_indent(indent) +
"</fraction>\n";
break;
case ep_s3:
s += make_indent(indent) + "<signed_area3>" +
GetArg(0).sPrintXML(indent + 1) + GetArg(1).sPrintXML(indent + 1) +
GetArg(2).sPrintXML(indent + 1) + "</signed_area3>\n";
break;
case ep_p3:
s += make_indent(indent) + "<pythagoras_difference3>" +
GetArg(0).sPrintXML(indent + 1) + GetArg(1).sPrintXML(indent + 1) +
GetArg(2).sPrintXML(indent + 1) + "</pythagoras_difference3>\n";
break;
case ep_segment:
s += make_indent(indent) + "<segment>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + "</segment>\n";
break;
case ep_segment_ratio:
s += make_indent(indent) + "<segment_ratio><segment>" +
GetArg(0).sPrintXML(indent + 1) + GetArg(1).sPrintXML(indent + 1) +
"</segment>" + "<segment>" + GetArg(2).sPrintXML(indent + 1) +
GetArg(3).sPrintXML(indent + 1) + "</segment></segment_ratio>\n";
break;
case ep_s4:
s += make_indent(indent) + "<signed_area4>" +
GetArg(0).sPrintXML(indent + 1) + GetArg(1).sPrintXML(indent + 1) +
GetArg(2).sPrintXML(indent + 1) + GetArg(3).sPrintXML(indent + 1) +
"</signed_area4>\n";
break;
case ep_p4:
s += make_indent(indent) + "<pythagoras_difference4>" +
GetArg(0).sPrintXML(indent + 1) + GetArg(1).sPrintXML(indent + 1) +
GetArg(2).sPrintXML(indent + 1) + GetArg(3).sPrintXML(indent + 1) +
"</pythagoras_difference4>\n";
break;
case ep_angle:
s += "<angle_tangens>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + GetArg(2).sPrintXML(indent + 1) +
"</angle_tangens>\n";
break;
case ep_algsumzero3:
s += "<algebraic_sum_is_zero>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + GetArg(2).sPrintXML(indent + 1) +
"</algebraic_sum_is_zero>\n";
break;
case ep_collinear:
s += "<collinear>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + GetArg(2).sPrintXML(indent + 1) +
"</collinear>\n";
break;
case ep_diffx:
s += "<x_projection_difference>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + "</x_projection_difference>\n";
break;
case ep_diffy:
s += "<y_projection_difference>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + "</y_projection_difference>\n";
break;
case ep_harmonic:
s += "<harmonic>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + GetArg(2).sPrintXML(indent + 1) +
GetArg(3).sPrintXML(indent + 1) + "</harmonic>\n";
break;
case ep_parallel:
s += "<parallel>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + GetArg(2).sPrintXML(indent + 1) +
GetArg(3).sPrintXML(indent + 1) + "</parallel>\n";
break;
case ep_perpendicular:
s += "<perpendicular>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + GetArg(2).sPrintXML(indent + 1) +
GetArg(3).sPrintXML(indent + 1) + "</perpendicular>\n";
break;
case ep_tangens_den:
s += "<angle_tangens_denominator>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + GetArg(2).sPrintXML(indent + 1) +
"</angle_tangens_denominator>\n";
break;
case ep_tangens_num:
s += "<angle_tangens_numerator>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + GetArg(2).sPrintXML(indent + 1) +
"</angle_tangens_numerator>\n";
break;
case ep_same_length:
s += "<equal_segments> <segment>" + GetArg(0).sPrintXML(indent + 1) +
GetArg(1).sPrintXML(indent + 1) + "</segment>\n<segment>" +
GetArg(2).sPrintXML(indent + 1) + GetArg(3).sPrintXML(indent + 1) +
"</segment>\n</equal_segments>\n";
break;
default:
Print(cerr, "Command " + GetName() + " is not supported for XML output!\n");
throw - 1;
break;
}
return s;
}
| 29.67628 | 83 | 0.516027 | ubavic |
6c787509fbfdfcd384bddbed541c91b54ab5f40a | 342 | cpp | C++ | messagebus/src/vespa/messagebus/systemtimer.cpp | yehzu/vespa | a439476f948f52a57485f5e7700b17bf9aa73417 | [
"Apache-2.0"
] | 1 | 2018-12-30T05:42:18.000Z | 2018-12-30T05:42:18.000Z | messagebus/src/vespa/messagebus/systemtimer.cpp | yehzu/vespa | a439476f948f52a57485f5e7700b17bf9aa73417 | [
"Apache-2.0"
] | 1 | 2021-03-31T22:27:25.000Z | 2021-03-31T22:27:25.000Z | messagebus/src/vespa/messagebus/systemtimer.cpp | yehzu/vespa | a439476f948f52a57485f5e7700b17bf9aa73417 | [
"Apache-2.0"
] | 1 | 2020-02-01T07:21:28.000Z | 2020-02-01T07:21:28.000Z | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "systemtimer.h"
#include <vespa/fastos/time.h>
namespace mbus {
uint64_t
SystemTimer::getMilliTime() const
{
FastOS_Time time;
time.SetNow();
return (uint64_t)time.MilliSecs();
}
} // namespace mbus
| 21.375 | 118 | 0.72807 | yehzu |
6c787aec2dc1230e4601300a1359407f33d1a329 | 711 | cxx | C++ | reflex/test/implementation/members/GetTest.cxx | paulwratt/cin-5.34.00 | 036a8202f11a4a0e29ccb10d3c02f304584cda95 | [
"MIT"
] | 10 | 2018-03-26T07:41:44.000Z | 2021-11-06T08:33:24.000Z | reflex/test/implementation/members/GetTest.cxx | paulwratt/cin-5.34.00 | 036a8202f11a4a0e29ccb10d3c02f304584cda95 | [
"MIT"
] | null | null | null | reflex/test/implementation/members/GetTest.cxx | paulwratt/cin-5.34.00 | 036a8202f11a4a0e29ccb10d3c02f304584cda95 | [
"MIT"
] | 1 | 2020-11-17T03:17:00.000Z | 2020-11-17T03:17:00.000Z | // Check getting of members
#include "util/HelperMacros.hpp"
#include "Reflex/Type.h"
#include "Reflex/Member.h"
#include "Get.hpp"
using namespace Reflex;
REFLEX_TEST(test001)
{
// See e.g. https://savannah.cern.ch/bugs/?65759
Type tT = Type::ByName("St<int>::T");
CPPUNIT_ASSERT(tT);
St<int>::A::s = 43;
St<int>::T o;
o.a = 42;
Member mA = tT.DataMemberByName("a");
CPPUNIT_ASSERT(mA);
Object objA = mA.Get(Object::Create(o));
CPPUNIT_ASSERT(objA);
CPPUNIT_ASSERT_EQUAL(42, *(int*)objA.Address());
Member mS = tT.DataMemberByName("s");
CPPUNIT_ASSERT(mS);
Object objS = mS.Get();
CPPUNIT_ASSERT(objS);
CPPUNIT_ASSERT_EQUAL(43, *(int*)objS.Address());
}
| 20.911765 | 51 | 0.652602 | paulwratt |
6c7b4c7e3d4e289295807145a6830bde246f7f86 | 4,130 | cpp | C++ | Map/LRUCache.cpp | UltraProton/Placement-Prepration | cc70f174c4410c254ce0469737a884fffdc81164 | [
"MIT"
] | null | null | null | Map/LRUCache.cpp | UltraProton/Placement-Prepration | cc70f174c4410c254ce0469737a884fffdc81164 | [
"MIT"
] | 3 | 2020-05-08T18:02:51.000Z | 2020-05-09T08:37:35.000Z | Map/LRUCache.cpp | UltraProton/PlacementPrep | cc70f174c4410c254ce0469737a884fffdc81164 | [
"MIT"
] | null | null | null | #include<bits/stdc++.h>
using namespace std;
typedef struct node{
int key;
int val;
node *left;
node *right;
node(int k,int v): key(k), val(v),left(NULL), right(NULL) {};
} Node;
class LRU_Cache{
public:
Node *dummy_head;
Node *dummy_tail;
int size;
int curr_size;
unordered_map<int,Node *> mp;
LRU_Cache(int size){
this->size=size;
curr_size=0;
dummy_head= new Node(-1,-1);
dummy_tail= new Node(-1,-1);
dummy_head->left=NULL;
dummy_tail->right=NULL;
dummy_head->right=dummy_tail;
dummy_tail->left=dummy_head;
}
void set(int key,int val);
int get(int key);
void push_front(Node *x);
void remove(Node *x);
void pop_last();
};
void LRU_Cache:: set(int key,int val){
if(mp.find(key)==mp.end()){
Node *temp= new Node(key,val);
//if cache is full remove the last element
if(curr_size==size){
pop_last();
curr_size--;
}
push_front(temp);
mp.insert(make_pair(key,temp));
curr_size++;
}
else{
mp[key]->val=val;
remove(mp[key]);
push_front(mp[key]);
}
}
int LRU_Cache:: get(int key){
if(mp.find(key)==mp.end()){
return -1;
}
else{
remove(mp[key]);
push_front(mp[key]);
return mp[key]->val;
}
}
void LRU_Cache :: push_front(Node *x){
x->right= dummy_head->right;
x->left=dummy_head;
dummy_head->right=x;
x->right->left= x;
}
void LRU_Cache :: remove(Node *x){
x->left->right=x->right;
x->right->left= x->left;
x->left=NULL;
x->right=NULL;
}
void LRU_Cache :: pop_last(){
//assert(dummy_tail->left);
Node *temp= dummy_tail->left;
temp->left->right=dummy_tail;
dummy_tail->left= temp->left;
//cout<<'x'<<" ";
mp.erase(temp->key);
free(temp);
}
int main(int argc, char const *argv[])
{
LRU_Cache obj(2);
/*
obj.set(1,2);
//cout<<obj.get(1)<<" "<<obj.curr_size<<endl;
obj.set(2,3);
//cout<<obj.get(2)<<" "<<obj.curr_size<<endl;
obj.set(7,5);
//cout<<obj.get(1)<<" "<<obj.curr_size<<endl;
Node *l= obj.dummy_head;
//cout<<l->key<<endl;
//cout<<l->right->key<<endl;
while(l->right!=NULL){
cout<<l->key<<" ";
l=l->right;
}
cout<<endl;
obj.set(9,10);
obj.set(11,12);
obj.set(13,14);
cout<<obj.get(7)<<" "<<obj.curr_size<<endl;
cout<<obj.get(2)<<" "<<obj.curr_size<<endl;
l= obj.dummy_head;
//cout<<l->key<<endl;
//cout<<l->right->key<<endl;
while(l->right!=NULL){
cout<<l->key<<" ";
l=l->right;
}
cout<<endl;
/*
Node *l= obj.dummy_head;
cout<<l->key<<endl;
//cout<<l->right->key<<endl;
while(l->right!=NULL){
cout<<l->key<<" ";
l=l->right;
}
obj.set(7,9);
cout<<obj.get(7)<<" "<<obj.curr_size<<endl;
*/
/*
obj.set(1,5);
obj.set(4,5);
obj.set(6,7);
cout<<obj.get(4)<<endl;
cout<<obj.get(1)<<endl;
*/
//SET 1 2 SET 2 3 SET 1 5 SET 4 5 SET 6 7 GET 4 GET 1
//SET 1 2 SET 2 3 SET 1 5 SET 4 5 SET 6 7 GET 4 GET 1
/*
obj.set(1,2);
obj.set(2,3);
obj.set(1,5);
obj.set(4,5);
obj.set(6,7);
cout<<obj.get(4)<<endl;
cout<<obj.get(1)<<endl;
Node *l= obj.dummy_head;
//cout<<l->key<<endl;
//cout<<l->right->key<<endl;
while(l->right!=NULL){
cout<<l->key<<" ";
l=l->right;
}
*/
//1
//GET 100 GET 26 GET 91 SET 55 40 GET 70 GET 43 GET 98 SET 5 56 GET 12
/*
LRU_Cache obj1(1);
cout<<obj1.get(100)<<endl;
cout<< obj1.get(26)<<endl;
cout<<obj1.get(91)<<endl;
obj1.set(55,40);
cout<<obj1.get(70)<<endl;
cout<<obj1.get(43)<<endl;
cout<<obj1.get(98)<<endl;
obj1.set(5,56);
cout<<obj1.get(12)<<endl;
cout<<obj1.get(29)<<endl;
cout<<obj1.dummy_head->right->key<<endl;
*/
LRU_Cache obj2(2);
//S 2 1 S 1 1 S 2 3 S 4 1 G 1 G 2
obj2.set(2,1);
obj2.set(1,1);
obj2.set(2,3);
obj2.set(4,1);
cout<<obj2.get(1)<<endl;
cout<<obj2.get(2)<<endl;
return 0;
}
| 19.389671 | 71 | 0.528814 | UltraProton |
6c7f11e1db06a72eec821eeca89e1c3dd935ec91 | 1,392 | cpp | C++ | Tools/MultiThreading/code1/Semaphore.cpp | liangjisheng/C-Cpp | 8b33ba1f43580a7bdded8bb4ce3d92983ccedb81 | [
"MIT"
] | 5 | 2019-09-17T09:12:15.000Z | 2021-05-29T10:54:39.000Z | Tools/MultiThreading/code1/Semaphore.cpp | liangjisheng/C-Cpp | 8b33ba1f43580a7bdded8bb4ce3d92983ccedb81 | [
"MIT"
] | null | null | null | Tools/MultiThreading/code1/Semaphore.cpp | liangjisheng/C-Cpp | 8b33ba1f43580a7bdded8bb4ce3d92983ccedb81 | [
"MIT"
] | 2 | 2021-07-26T06:36:12.000Z | 2022-01-23T15:20:30.000Z |
// 多线程资源访问冲突,创建两个线程,按照计数递增的顺序输出计数
#include "windows.h"
#include "stdio.h"
int number = 1;
HANDLE hSemaphore;
unsigned long __stdcall ThreadProc1(void* lpParameter)
{
long count = 0;
while(number < 100)
{
WaitForSingleObject(hSemaphore,INFINITE); // 等待信号量为有信号状态
printf("线程1当前计数:%d\n",number);
number++;
Sleep(100); // 为了演示数字是输出效果,加上延时
// ReleaseSemaphore(HANDLE hSemaphore,LONG lReleaseCount,LPLONG lpPreviousCount);
// lReleaseCount : 信号量的递增数量
// lpPreviousCount : 返回之前的信号量的使用计数
ReleaseSemaphore(hSemaphore,1,&count); // 使信号量有信号
}
return 0;
}
unsigned long __stdcall ThreadProc2(void* lpParameter)
{
long count = 0;
while(number < 100)
{
WaitForSingleObject(hSemaphore,INFINITE);
printf("线程2当前计数:%d\n",number);
number++;
Sleep(100);
ReleaseSemaphore(hSemaphore,1,&count);
}
return 0;
}
int main(int argc,char* argv[])
{
HANDLE hThread1 = CreateThread(NULL,0,ThreadProc1,NULL,0,NULL);
HANDLE hThread2 = CreateThread(NULL,0,ThreadProc2,NULL,0,NULL);
// HANDLE CreateSemaphore(LPSECURITY_ATTRIBUTES lpSemaphoreAttribute,LONG lInitialCount,
// LONG lMaximumCount,LPCTSTR lpName);
// lInitialCount : 信号量的初始计数
// lMaximumCount : 信号量的最大计数
// lpName : 信号量的名称
hSemaphore = CreateSemaphore(NULL,1,100,"Sem"); // 创建信号量对象
CloseHandle(hThread1); // 关闭线程句柄
CloseHandle(hThread2);
// while(true) // 定义一个循环,防止程序退出
// {;}
getchar();
return 0;
} | 23.59322 | 89 | 0.72342 | liangjisheng |
6c8191b0eec8f18392afd35018c53e2ce8d266ef | 1,082 | cpp | C++ | problemsets/UVA/UVA442.cpp | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | problemsets/UVA/UVA442.cpp | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | problemsets/UVA/UVA442.cpp | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | /**
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
*/
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <string>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <queue>
using namespace std;
char S[1000];
int p;
pair<int,int> M[30];
bool error;
int tot;
pair<int,int> expr();
pair<int,int> expr() {
pair<int,int> A, B, ret;
if (S[p]>='A' && S[p]<='Z') {
p++;
return M[S[p-1]-'A'];
}
p++;
A = expr();
B = expr();
if (A.second != B.first) error = true;
ret = make_pair(A.first, B.second);
tot += A.first * B.first * B.second;
p++;
return ret;
}
int N;
int main() {
scanf("%d", &N);
for (int i = 0; i < N; i++) {
int r, c;
scanf("%s %d %d", S, &r, &c);
M[*S-'A'] = make_pair(r,c);
}
while (scanf("%s", S)!=EOF) {
error = false;
tot = p = 0;
expr();
if (error) puts("error");
else printf("%d\n", tot);
}
return 0;
}
| 16.646154 | 42 | 0.499076 | juarezpaulino |
6c85f34a59ccc5b47f8e3940a37ea27fd4ea8d6b | 274 | cpp | C++ | tests/test_lib.cpp | nachovizzo/cpp_starter_project | f77769c903527f75adc9861376038c4bed1e1f2a | [
"MIT"
] | 13 | 2020-10-30T16:05:47.000Z | 2022-02-25T21:31:33.000Z | tests/test_lib.cpp | nachovizzo/cpp_starter_project | f77769c903527f75adc9861376038c4bed1e1f2a | [
"MIT"
] | null | null | null | tests/test_lib.cpp | nachovizzo/cpp_starter_project | f77769c903527f75adc9861376038c4bed1e1f2a | [
"MIT"
] | 14 | 2020-08-26T02:46:23.000Z | 2022-02-25T22:08:49.000Z | // @file test_lib.cpp
// @author Ignacio Vizzo [ivizzo@uni-bonn.de]
//
// Copyright (c) 2020 Ignacio Vizzo, all rights reserved
#include <gtest/gtest.h>
#include "lib/example_lib.hpp"
TEST(Testlib, RemoveThisFile) { EXPECT_NO_THROW(delete_this_file::foo()); }
| 27.4 | 75 | 0.70073 | nachovizzo |
6c868f01888df62407a66e1492ca2df9ca24907b | 176 | cc | C++ | proc/display-env.cc | DavidCai1993/APUE-exercises | 5c5b74d8042176cc07a73380149c831d20da407e | [
"MIT"
] | null | null | null | proc/display-env.cc | DavidCai1993/APUE-exercises | 5c5b74d8042176cc07a73380149c831d20da407e | [
"MIT"
] | null | null | null | proc/display-env.cc | DavidCai1993/APUE-exercises | 5c5b74d8042176cc07a73380149c831d20da407e | [
"MIT"
] | null | null | null | #include <iostream>
#include "../common.h"
int main (int argc, char** argv, char** envp) {
for (char** env = envp; *env != NULL; env++) {
PRINT(*env)
}
return 0;
}
| 16 | 48 | 0.556818 | DavidCai1993 |
6c89545aac41622e2766c1afe06c61c43012ea11 | 6,396 | cpp | C++ | isaac_variant_caller/src/lib/blt_common/blt_arg_parse_util.cpp | sequencing/isaac_variant_caller | ed24e20b097ee04629f61014d3b81a6ea902c66b | [
"BSL-1.0"
] | 21 | 2015-01-09T01:11:28.000Z | 2019-09-04T03:48:21.000Z | isaac_variant_caller/src/lib/blt_common/blt_arg_parse_util.cpp | sequencing/isaac_variant_caller | ed24e20b097ee04629f61014d3b81a6ea902c66b | [
"BSL-1.0"
] | 4 | 2015-07-23T09:38:39.000Z | 2018-02-01T05:37:26.000Z | isaac_variant_caller/src/lib/blt_common/blt_arg_parse_util.cpp | sequencing/isaac_variant_caller | ed24e20b097ee04629f61014d3b81a6ea902c66b | [
"BSL-1.0"
] | 13 | 2015-01-29T16:41:26.000Z | 2021-06-25T02:42:32.000Z | // -*- mode: c++; indent-tabs-mode: nil; -*-
//
// Copyright (c) 2009-2013 Illumina, Inc.
//
// This software is provided under the terms and conditions of the
// Illumina Open Source Software License 1.
//
// You should have received a copy of the Illumina Open Source
// Software License 1 along with this program. If not, see
// <https://github.com/sequencing/licenses/>
//
/// \file
///
/// \author Chris Saunders
///
#include "blt_common/blt_arg_parse_util.hh"
arg_data::
arg_data(int init_argc,
char* init_argv[],
const prog_info& init_pinfo)
: argmark(init_argc,false)
, argstr(init_argc)
, pinfo(init_pinfo) {
for (int i(0); i<init_argc; ++i) argstr[i]=init_argv[i];
if (argmark.size()) argmark[0]=true;
for (unsigned i(0); i<argstr.size(); ++i) {
if (i) cmdline += ' ';
cmdline += argstr[i];
}
}
arg_data::
arg_data(const std::vector<std::string>& arg,
const prog_info& init_pinfo,
const std::string& init_cmdline)
: argmark(arg.size(),false)
, argstr(arg)
, cmdline(init_cmdline)
, pinfo(init_pinfo) {}
void
arg_data::
finalize_args() {
const unsigned as(size());
for (unsigned i(0); i<as; ++i) {
if (! argmark[i]) pinfo.usage((std::string("Invalid argument: ")+argstr[i]).c_str());
}
}
static
bool
is_valid_xrange(const double val,
bool is_allow_zero,
bool is_no_max_check) {
return (((val > 0.) || (is_allow_zero && (val >= 0.))) && (is_no_max_check || (val <= 1.)));
}
static
void
set_xrange_val(const prog_info& pinfo,
const char* arg_label,
const char* arg,
double& val,
bool is_allow_zero,
bool is_no_max_check) {
bool is_val_invalid(false);
try {
val=boost::lexical_cast<double>(arg);
} catch (boost::bad_lexical_cast&) {
is_val_invalid=true;
}
is_val_invalid = (is_val_invalid || (! is_valid_xrange(val,is_allow_zero,is_no_max_check)));
if (is_val_invalid) {
std::ostringstream oss;
oss << "argument after flag " << arg_label << " (" << arg << ") is not valid";
pinfo.usage(oss.str().c_str());
}
}
void
set_xrange_arg(unsigned& argi,
arg_data& ad,
bool& is_val_set,
double& val,
bool is_allow_zero,
bool is_no_max_check) {
const char* arg_label(ad.argstr[argi].c_str());
ad.argmark[argi] = true;
if (++argi>=ad.argstr.size()) {
ad.pinfo.usage((std::string("no value following ")+arg_label).c_str());
}
if (is_val_set) { ad.pinfo.usage((std::string("multiple ")+arg_label+" arguments").c_str()); }
set_xrange_val(ad.pinfo,arg_label,ad.argstr[argi].c_str(),val,is_allow_zero,is_no_max_check);
is_val_set=true;
}
void
set_filename_arg(unsigned& argi,
arg_data& ad,
bool& is_val_set,
std::string& file) {
const char* arg_label(ad.argstr[argi].c_str());
ad.argmark[argi] = true;
if (++argi>=ad.argstr.size()) {
ad.pinfo.usage((std::string("no value following: ")+arg_label).c_str());
}
if (is_val_set) { ad.pinfo.usage((std::string("multiple ")+arg_label+" arguments").c_str()); }
file=ad.argstr[argi];
if (file.empty()) { ad.pinfo.usage((std::string("empty filename following: ")+arg_label).c_str()); }
is_val_set=true;
}
void
set_win_arg(unsigned& argi,
arg_data& ad,
bool& is_val_set,
int& val1,
unsigned& val2) {
const char* arg_label(ad.argstr[argi].c_str());
ad.argmark[argi] = true;
if (++argi>=ad.argstr.size()) {
ad.pinfo.usage((std::string("two arguments must follow ")+arg_label).c_str());
}
if (is_val_set) { ad.pinfo.usage((std::string("multiple ")+arg_label+" arguments").c_str()); }
set_val(ad.pinfo,arg_label,ad.argstr[argi].c_str(),val1);
ad.argmark[argi] = true;
if (++argi>=ad.argstr.size()) {
ad.pinfo.usage((std::string("two arguments must follow ")+arg_label).c_str());
}
int val2_tmp;
set_val(ad.pinfo,arg_label,ad.argstr[argi].c_str(),val2_tmp);
if (val2_tmp<0) {
ad.pinfo.usage((std::string("second argument following: ")+arg_label+" must be non-negative\n").c_str());
}
val2=val2_tmp;
is_val_set=true;
}
void
set_nploid_arg(unsigned& argi,
arg_data& ad,
bool& is_val_set,
int& val1,
double& val2) {
const char* arg_label(ad.argstr[argi].c_str());
ad.argmark[argi] = true;
if (++argi>=ad.argstr.size()) {
ad.pinfo.usage((std::string("two arguments must follow ")+arg_label).c_str());
}
if (is_val_set) { ad.pinfo.usage((std::string("multiple ")+arg_label+" arguments").c_str()); }
set_val(ad.pinfo,arg_label,ad.argstr[argi].c_str(),val1);
ad.argmark[argi] = true;
if (++argi>=ad.argstr.size()) {
ad.pinfo.usage((std::string("two arguments must follow ")+arg_label).c_str());
}
const bool is_allow_zero(false);
const bool is_no_max_check(false);
set_xrange_val(ad.pinfo,arg_label,ad.argstr[argi].c_str(),val2,is_allow_zero,is_no_max_check);
is_val_set=true;
}
void
set_xrange_win_arg(unsigned& argi,
arg_data& ad,
bool& is_val_set,
double& val1,
unsigned& val2) {
const char* arg_label(ad.argstr[argi].c_str());
ad.argmark[argi] = true;
if (++argi>=ad.argstr.size()) {
ad.pinfo.usage((std::string("two arguments must follow ")+arg_label).c_str());
}
if (is_val_set) { ad.pinfo.usage((std::string("multiple ")+arg_label+" arguments").c_str()); }
const bool is_allow_zero(false);
const bool is_no_max_check(false);
set_xrange_val(ad.pinfo,arg_label,ad.argstr[argi].c_str(),val1,is_allow_zero,is_no_max_check);
ad.argmark[argi] = true;
if (++argi>=ad.argstr.size()) {
ad.pinfo.usage((std::string("two arguments must follow ")+arg_label).c_str());
}
int val2_tmp;
set_val(ad.pinfo,arg_label,ad.argstr[argi].c_str(),val2_tmp);
if (val2_tmp<0) {
ad.pinfo.usage((std::string("second argument following: ")+arg_label+" must be non-negative\n").c_str());
}
val2=val2_tmp;
is_val_set=true;
}
| 27.568966 | 113 | 0.601001 | sequencing |
6c8a68c9f007871f961fe495aae755678e3fbf09 | 6,198 | cpp | C++ | melodic/src/ros_comm/xmlrpcpp/test/test_base64.cpp | disorn-inc/ROS-melodic-python3-Opencv-4.1.1-CUDA | 3d265bb64712e3cd7dfa0ad56d78fcdebafdb4b0 | [
"BSD-3-Clause"
] | 2 | 2021-07-14T12:33:55.000Z | 2021-11-21T07:14:13.000Z | melodic/src/ros_comm/xmlrpcpp/test/test_base64.cpp | disorn-inc/ROS-melodic-python3-Opencv-4.1.1-CUDA | 3d265bb64712e3cd7dfa0ad56d78fcdebafdb4b0 | [
"BSD-3-Clause"
] | null | null | null | melodic/src/ros_comm/xmlrpcpp/test/test_base64.cpp | disorn-inc/ROS-melodic-python3-Opencv-4.1.1-CUDA | 3d265bb64712e3cd7dfa0ad56d78fcdebafdb4b0 | [
"BSD-3-Clause"
] | null | null | null | /*
* Unit tests for XmlRpc++
*
* Copyright (C) 2017, Zoox Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Austin Hendrix <austin@zoox.com>
*
*/
#include <b64/encode.h>
#include <b64/decode.h>
#include <gtest/gtest.h>
// Test Data for a Base64 encode/decode test
class Base64TestData {
public:
Base64TestData(std::vector<char> raw, std::string encoded)
: raw(raw), encoded(encoded) {}
std::vector<char> raw;
std::string encoded;
};
class Base64Test : public ::testing::TestWithParam<Base64TestData> {};
TEST_P(Base64Test, Encode) {
const std::vector<char> & data = GetParam().raw;
std::stringstream is;
is.write(&data[0], data.size());
std::stringstream os;
base64::encoder encoder;
encoder.encode(is, os);
std::string expected = GetParam().encoded;
EXPECT_EQ(expected, os.str());
}
TEST_P(Base64Test, Decode) {
const std::string& in = GetParam().encoded;
const int encoded_size = in.length();
// oversize our output vector (same method used by XmlRpcValue)
std::vector<char> out;
out.resize(encoded_size);
base64::decoder decoder;
const int size = decoder.decode(in.c_str(), encoded_size, out.data());
ASSERT_LE(0, size);
out.resize(size);
const std::vector<char> & expected = GetParam().raw;
EXPECT_EQ(expected, out);
}
INSTANTIATE_TEST_CASE_P(
Multiline,
Base64Test,
::testing::Values(
Base64TestData({0}, "AA==\n"),
Base64TestData({1, 2}, "AQI=\n"),
Base64TestData({1, 2, 3}, "AQID\n"),
Base64TestData(
// clang-format off
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
125, 126, 127, -128, -127, -126, -125, -124, -123, -122, -121,
-120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110,
-109, -108, -107, -106, -105, -104, -103, -102, -101, -100, -99,
-98, -97, -96, -95, -94, -93, -92, -91, -90, -89, -88, -87, -86,
-85, -84, -83, -82, -81, -80, -79, -78, -77, -76, -75, -74, -73,
-72, -71, -70, -69, -68, -67, -66, -65, -64, -63, -62, -61, -60,
-59, -58, -57, -56, -55, -54, -53, -52, -51, -50, -49, -48, -47,
-46, -45, -44, -43, -42, -41, -40, -39, -38, -37, -36, -35, -34,
-33, -32, -31, -30, -29, -28, -27, -26, -25, -24, -23, -22, -21,
-20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7,
-6, -5, -4, -3, -2, -1},
// clang-format on
"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMD"
"EyMzQ1\nNjc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYG"
"FiY2RlZmdoaWpr\nbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJ"
"GSk5SVlpeYmZqbnJ2en6Ch\noqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wM"
"HCw8TFxsfIycrLzM3Oz9DR0tPU1dbX\n2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8P"
"Hy8/T19vf4+fr7/P3+/w==\n")));
class Base64ErrorData {
public:
// TODO(future work): add error code representation here and check that error
// codes are reported correctly.
Base64ErrorData(std::string encoded)
: encoded(encoded) {}
std::string encoded;
};
class Base64ErrorTest : public ::testing::TestWithParam<Base64ErrorData> {};
TEST_P(Base64ErrorTest, DecodeErrors) {
const std::string& in = GetParam().encoded;
const int encoded_size = in.length();
// oversize our output vector (same method used by XmlRpcValue)
std::vector<char> out;
out.resize(encoded_size);
base64::decoder decoder;
const int size = decoder.decode(in.c_str(), encoded_size, out.data());
// Assert that size is greater or equal to 0, to make sure that the follow-up
// resize will always succeed.
ASSERT_LE(0, size);
out.resize(size);
// FIXME(future work): decode does not report error on garbage input
}
INSTANTIATE_TEST_CASE_P(
Multiline,
Base64ErrorTest,
::testing::Values(// Tests on incomplete data.
Base64ErrorData("="),
Base64ErrorData("A="),
Base64ErrorData("A"),
Base64ErrorData("AA"),
Base64ErrorData("AAA"),
Base64ErrorData("AA="),
// Tests with 4 bytes of good data but which does not
// terminate on the correct boundary.
Base64ErrorData("BBBBA="),
Base64ErrorData("BBBBA"),
Base64ErrorData("BBBBAA"),
Base64ErrorData("BBBBAAA"),
Base64ErrorData("BBBBAA="),
// Decode should succeed and do nothing on empty string.
Base64ErrorData(""),
// Character out of bounds for base64 encoding.
Base64ErrorData("<")));
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
| 37.337349 | 80 | 0.586641 | disorn-inc |
6c8aa1b3180a2b61d132ea2cf5ffd4c304c7be91 | 480 | cpp | C++ | oops/objectAsArgument.cpp | misrapk/C-Basic-Codes | 4d959576a15b3846f3c1fd5c870c6821d8a90ecc | [
"MIT"
] | null | null | null | oops/objectAsArgument.cpp | misrapk/C-Basic-Codes | 4d959576a15b3846f3c1fd5c870c6821d8a90ecc | [
"MIT"
] | null | null | null | oops/objectAsArgument.cpp | misrapk/C-Basic-Codes | 4d959576a15b3846f3c1fd5c870c6821d8a90ecc | [
"MIT"
] | null | null | null | // pass object as argument
#include<iostream>
using namespace std;
class test{
int var;
public:
test(int i){
var = i;
cout<<"CONSTRUCTING "<<var<<"\n";
}
~test(){
cout<<"Destructing "<<var<<"\n";
}
int get(){
return var;
}
};
void f(test t);
int main(){
test ob1(10);
cout<<"In LOCAL MAIN: "<< ob1.get()<<"\n";
f(ob1);
cout<<"THis is main()\n";
return 0;
}
void f(test t){
cout<<"THis is function test : "<<t.get();
cout<<endl;
}
| 12.307692 | 43 | 0.54375 | misrapk |
6c991a9eb542b7004cce5341ba54b95256aa5e2d | 48 | cpp | C++ | Dechetterie-Librairie/ControlIPBox.cpp | Norskel/Dechetterie | 343c4b97b7ea5f0dbb3394168e2a75d2a6b538e6 | [
"Apache-2.0"
] | 2 | 2018-04-05T11:02:00.000Z | 2019-01-26T17:55:20.000Z | Dechetterie-Librairie/ControlIPBox.cpp | Norskel/Dechetterie | 343c4b97b7ea5f0dbb3394168e2a75d2a6b538e6 | [
"Apache-2.0"
] | null | null | null | Dechetterie-Librairie/ControlIPBox.cpp | Norskel/Dechetterie | 343c4b97b7ea5f0dbb3394168e2a75d2a6b538e6 | [
"Apache-2.0"
] | null | null | null | #include "stdafx.h"
#include "ControlIPBox.h"
| 16 | 26 | 0.708333 | Norskel |
6c9d79ab3ba2a98cbf2dcb57dcf62896e9e7db5e | 1,239 | cpp | C++ | src/IContentProcessor.cpp | RudiBik/flexgrep | d7bb07350693f129481572f41639df95f8a03261 | [
"BSD-3-Clause"
] | 4 | 2022-02-11T18:43:55.000Z | 2022-02-19T09:50:09.000Z | src/IContentProcessor.cpp | RudiBik/flexgrep | d7bb07350693f129481572f41639df95f8a03261 | [
"BSD-3-Clause"
] | null | null | null | src/IContentProcessor.cpp | RudiBik/flexgrep | d7bb07350693f129481572f41639df95f8a03261 | [
"BSD-3-Clause"
] | null | null | null | // Copyright (c) 2022, Rudi Bikschentajew
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#include <ContentProcessors/IContentProcessor.hpp>
// filters
#include <PathFilter/ContentRegexFilter.hpp>
// processors
#include <ContentProcessors/ParallelContentProcessor/ParallelContentProcessor.hpp>
#include <ContentProcessors/SequentialContentProcessor.hpp>
namespace lg {
template<typename OutputIterator>
std::unique_ptr<IContentProcessor>
IContentProcessor::create(OutputIterator oiter,
std::shared_ptr<const Configuration> opt)
{
// Create the content filter
// if regex filter
auto contentFilter =
std::make_shared<ContentRegexFilter>(opt->mRegexContent);
if (!contentFilter) {
// TODO: Throw exception
}
// Create the processor (single- or multi-threaded)
if (opt->mParallelContentFiltering) {
return std::make_unique<ParallelContentProcessor<OutputIterator>>(
oiter, contentFilter);
} else {
return std::make_unique<SequentialContentProcessor<OutputIterator>>(
oiter, contentFilter);
}
}
} // namespace lg
| 29.5 | 82 | 0.722357 | RudiBik |
6c9d90ca07975645563dbbc418b295bc10d653bb | 3,357 | hpp | C++ | ocs2_thirdparty/include/cppad/cg/math_other.hpp | grizzi/ocs2 | 4b78c4825deb8b2efc992fdbeef6fdb1fcca2345 | [
"BSD-3-Clause"
] | 126 | 2021-07-13T13:59:12.000Z | 2022-03-31T02:52:18.000Z | ct_core/include/external/cppad/cg/math_other.hpp | ADVRHumanoids/ct | 774ad978c032fda0ef3c2eed0dc3f25f829df7f8 | [
"Apache-2.0"
] | 27 | 2021-07-14T12:14:04.000Z | 2022-03-30T16:27:52.000Z | ct_core/include/external/cppad/cg/math_other.hpp | ADVRHumanoids/ct | 774ad978c032fda0ef3c2eed0dc3f25f829df7f8 | [
"Apache-2.0"
] | 55 | 2021-07-14T07:08:47.000Z | 2022-03-31T15:54:30.000Z | #ifndef CPPAD_CG_MATH_OTHER_INCLUDED
#define CPPAD_CG_MATH_OTHER_INCLUDED
/* --------------------------------------------------------------------------
* CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
* Copyright (C) 2012 Ciengis
*
* CppADCodeGen is distributed under multiple licenses:
*
* - Eclipse Public License Version 1.0 (EPL1), and
* - GNU General Public License Version 3 (GPL3).
*
* EPL1 terms and conditions can be found in the file "epl-v10.txt", while
* terms and conditions for the GPL3 can be found in the file "gpl3.txt".
* ----------------------------------------------------------------------------
* Author: Joao Leal
*/
namespace CppAD {
template <class Base>
inline CppAD::cg::CG<Base> pow(const CppAD::cg::CG<Base>& x,
const CppAD::cg::CG<Base>& y) {
using namespace CppAD::cg;
if (x.isParameter() && y.isParameter()) {
return CG<Base> (pow(x.getValue(), y.getValue()));
}
CodeHandler<Base>* handler;
if (y.isParameter()) {
if (y.isIdenticalZero()) {
return CG<Base> (Base(1.0)); // does not consider that x could be infinity
} else if (y.isIdenticalOne()) {
return CG<Base> (x);
}
handler = x.getCodeHandler();
} else {
handler = y.getCodeHandler();
}
CG<Base> result(*handler->makeNode(CGOpCode::Pow,{x.argument(), y.argument()}));
if (x.isValueDefined() && y.isValueDefined()) {
result.setValue(pow(x.getValue(), y.getValue()));
}
return result;
}
/*******************************************************************************
* pow() with other types
******************************************************************************/
template <class Base>
inline CppAD::cg::CG<Base> pow(const Base& x,
const CppAD::cg::CG<Base>& y) {
return CppAD::pow<Base>(CppAD::cg::CG<Base>(x), y);
}
template <class Base>
inline CppAD::cg::CG<Base> pow(const CppAD::cg::CG<Base>& x,
const Base& y) {
return CppAD::pow<Base>(x, CppAD::cg::CG<Base>(y));
}
template <class Base>
CppAD::cg::CG<Base> pow(const int& x,
const CppAD::cg::CG<Base>& y) {
return pow(CppAD::cg::CG<Base>(x), y);
}
/*******************************************************************************
*
******************************************************************************/
template <class Base>
inline CppAD::cg::CG<Base> sign(const CppAD::cg::CG<Base>& x) {
using namespace CppAD::cg;
if (x.isParameter()) {
if (x.getValue() > Base(0.0)) {
return CG<Base> (Base(1.0));
} else if (x.getValue() == Base(0.0)) {
return CG<Base> (Base(0.0));
} else {
return CG<Base> (Base(-1.0));
}
}
CodeHandler<Base>& h = *x.getOperationNode()->getCodeHandler();
CG<Base> result(*h.makeNode(CGOpCode::Sign, x.argument()));
if (x.isValueDefined()) {
if (x.getValue() > Base(0.0)) {
result.setValue(Base(1.0));
} else if (x.getValue() == Base(0.0)) {
result.setValue(Base(0.0));
} else {
result.setValue(Base(-1.0));
}
}
return result;
}
} // END CppAD namespace
#endif | 32.592233 | 86 | 0.483467 | grizzi |
6c9e5c1b0893a9b1645b1c62b4dde6594351c532 | 25,694 | cpp | C++ | src/compile/BrainfuckCompiler.cpp | nbozidarevic/freud | d16f1930abef0360a8cd0f863a6c003f080b11c3 | [
"MIT"
] | null | null | null | src/compile/BrainfuckCompiler.cpp | nbozidarevic/freud | d16f1930abef0360a8cd0f863a6c003f080b11c3 | [
"MIT"
] | null | null | null | src/compile/BrainfuckCompiler.cpp | nbozidarevic/freud | d16f1930abef0360a8cd0f863a6c003f080b11c3 | [
"MIT"
] | null | null | null | #include "BrainfuckCompiler.h"
using namespace antlr4;
BrainfuckCompiler::BrainfuckCompiler(
istream& input,
ostream& output
):input(input), output(output) {
pointer = 0;
}
void BrainfuckCompiler::run() {
ANTLRInputStream antlrInput(input);
SimpleCLexer lexer(&antlrInput);
CommonTokenStream tokens(&lexer);
SimpleCParser parser(&tokens);
SimpleCParser::CompilationUnitContext* tree = parser.compilationUnit();
// output << endl;
visitCompilationUnit(tree);
output << endl;
// output << endl << tree->toStringTree(&parser) << endl;
return;
}
int BrainfuckCompiler::copyValue(int source, int destination) {
if (source == destination) {
return destination;
}
int helperPointer = memory.getTemporaryCell();
movePointer(helperPointer);
output << "[-]";
movePointer(destination);
output << "[-]";
movePointer(source);
output << "[-";
movePointer(destination);
output << "+";
movePointer(helperPointer);
output << "+";
movePointer(source);
output << "]";
movePointer(helperPointer);
output << "[-";
movePointer(source);
output << "+";
movePointer(helperPointer);
output << "]";
return destination;
}
int BrainfuckCompiler::moveValue(int source, int destination) {
if (source == destination) {
return destination;
}
movePointer(destination);
output << "[-]";
movePointer(source);
output << "[-";
movePointer(destination);
output << "+";
movePointer(source);
output << "]";
return destination;
}
int BrainfuckCompiler::duplicateValue(int source) {
int destination = memory.getTemporaryCell();
copyValue(source, destination);
return destination;
}
int BrainfuckCompiler::setValue(int destination, int value) {
movePointer(destination);
output << "[-]";
for (int i = 0; i < value; ++i) {
output << "+";
}
return destination;
}
void BrainfuckCompiler::movePointer(int destination) {
if (pointer == destination) {
return;
}
unsigned char c = '>';
if (pointer > destination) {
c = '<';
}
for (int i = 0; i < abs(pointer - destination); ++i) {
output << c;
}
pointer = destination;
}
int BrainfuckCompiler::getPointerForConstValue(unsigned char value) {
int pointer = memory.getTemporaryCell();
return setValue(pointer, value);
}
int BrainfuckCompiler::addValues(int a, int b) {
int aCopy = duplicateValue(a);
int bCopy = duplicateValue(b);
int result = memory.getTemporaryCell();
movePointer(result);
output << "[-]";
movePointer(aCopy);
output << "[-";
movePointer(result);
output << "+";
movePointer(aCopy);
output << "]";
movePointer(bCopy);
output << "[-";
movePointer(result);
output << "+";
movePointer(bCopy);
output << "]";
return result;
}
int BrainfuckCompiler::subtractValues(int a, int b) {
int aCopy = duplicateValue(a);
int bCopy = duplicateValue(b);
int result = memory.getTemporaryCell();
movePointer(result);
output << "[-]";
movePointer(aCopy);
output << "[-";
movePointer(result);
output << "+";
movePointer(aCopy);
output << "]";
movePointer(bCopy);
output << "[-";
movePointer(result);
output << "-";
movePointer(bCopy);
output << "]";
return result;
}
int BrainfuckCompiler::multiplyValues(int a, int b) {
int aCopy = duplicateValue(a);
int result = getPointerForConstValue(0);
movePointer(aCopy);
output << "[-";
int newResult = addValues(b, result);
moveValue(newResult, result);
movePointer(aCopy);
output << "]";
return result;
}
int BrainfuckCompiler::divideValues(int a, int b) {
int aCopy = duplicateValue(a);
int result = getPointerForConstValue(0);
performWhile(
[&]() -> int {
return this->greaterThanOrEqual(aCopy, b);
},
[&]() -> void {
this->movePointer(result);
this->output << "+";
this->moveValue(this->subtractValues(aCopy, b), aCopy);
}
);
return result;
}
int BrainfuckCompiler::modValues(int a, int b) {
int result = getPointerForConstValue(0);
moveValue(
subtractValues(
a,
multiplyValues(
divideValues(a, b),
b
)
),
result
);
return result;
}
int BrainfuckCompiler::negate(int a) {
int result = memory.getTemporaryCell();
performIfElse(
a,
[&]() -> void {
this->setValue(result, 0);
},
[&]() -> void {
this->setValue(result, 1);
}
);
return result;
}
int BrainfuckCompiler::isEqual(int a, int b) {
int aCopy = duplicateValue(a);
int bCopy = duplicateValue(b);
int result = getPointerForConstValue(0);
movePointer(aCopy);
output << "[-";
movePointer(bCopy);
output << "-";
movePointer(aCopy);
output << "]";
performIfElse(
negate(aCopy),
[&]() -> void {
this->performIfElse(
this->negate(bCopy),
[&]() -> void {
setValue(result, 1);
},
[]() -> void {}
);
},
[]() -> void {}
);
return result;
}
int BrainfuckCompiler::logicalAnd(int a, int b) {
int result = getPointerForConstValue(0);
performIfElse(
a,
[&]() -> void {
this->performIfElse(
b,
[&]() -> void {
setValue(result, 1);
},
[]() -> void {}
);
},
[]() -> void {}
);
return result;
}
int BrainfuckCompiler::logicalOr(int a, int b) {
int result = getPointerForConstValue(0);
this->performIfElse(
a,
[&]() -> void {
setValue(result, 1);
},
[]() -> void {}
);
this->performIfElse(
b,
[&]() -> void {
setValue(result, 1);
},
[]() -> void {}
);
return result;
}
int BrainfuckCompiler::lessThan(int a, int b) {
int aCopy = duplicateValue(a);
int bCopy = duplicateValue(b);
int result = memory.getTemporaryCell();
movePointer(result);
output << "[-]";
performWhile(
[&]() -> int {
return logicalAnd(aCopy, bCopy);
},
[&]() -> void {
this->movePointer(aCopy);
output << "-";
this->movePointer(bCopy);
output << "-";
}
);
performIfElse(
logicalAnd(negate(aCopy), bCopy),
[&]() -> void {
this->setValue(result, 1);
},
[]() -> void {}
);
return result;
}
int BrainfuckCompiler::lessThanOrEqual(int a, int b) {
return logicalOr(
lessThan(a, b),
isEqual(a, b)
);
}
int BrainfuckCompiler::greaterThan(int a, int b) {
return negate(lessThanOrEqual(a, b));
}
int BrainfuckCompiler::greaterThanOrEqual(int a, int b) {
return negate(lessThan(a, b));
}
void BrainfuckCompiler::performIfElse(int expression, function<void ()> ifFn, function<void ()> elseFn) {
int ifValue = duplicateValue(expression);
int elseValue = getPointerForConstValue(1);
movePointer(ifValue);
output << "[";
setValue(ifValue, 0);
setValue(elseValue, 0);
ifFn();
movePointer(ifValue);
output << "]";
movePointer(elseValue);
output << "[";
setValue(elseValue, 0);
elseFn();
movePointer(elseValue);
output << "]";
}
void BrainfuckCompiler::performWhile(function<int ()> expressionFn, function<void ()> loopFn) {
int expression = expressionFn();
movePointer(expression);
output << "[";
movePointer(expression);
loopFn();
int newExpression = expressionFn();
moveValue(newExpression, expression);
movePointer(expression);
output << "]";
}
void BrainfuckCompiler::performFor(
function<void ()> initFn,
function<int ()> expressionFn,
function<void ()> updateFn,
function<void ()> loopFn
) {
initFn();
performWhile(
expressionFn,
[&]() -> void {
loopFn();
updateFn();
}
);
}
void BrainfuckCompiler::printAsChar(int a) {
movePointer(a);
output << ".";
}
void BrainfuckCompiler::printAsNumber(int a) {
int aCopy = duplicateValue(a);
int digit = duplicateValue(a);
int helperPointer = getPointerForConstValue(0);
int zeroChar = getPointerForConstValue('0');
int nine = getPointerForConstValue(9);
int ten = getPointerForConstValue(10);
int newlyBuilt = getPointerForConstValue(0);
performIfElse(
a,
[&]() -> void {
performWhile(
[&]() -> int {
return this->lessThan(newlyBuilt, a);
},
[&]() -> void {
this->setValue(helperPointer, 1);
this->copyValue(aCopy, digit);
performWhile(
[&]() -> int {
return greaterThan(digit, nine);
},
[&]() -> void {
this->moveValue(this->divideValues(digit, ten), digit);
this->moveValue(this->multiplyValues(helperPointer, ten), helperPointer);
}
);
this->moveValue(
this->addValues(
this->multiplyValues(newlyBuilt, ten),
digit
),
newlyBuilt
);
this->printAsChar(this->addValues(digit, zeroChar));
this->moveValue(
this->subtractValues(aCopy, this->multiplyValues(digit, helperPointer)),
aCopy
);
}
);
},
[&]() -> void {
this->printAsChar(zeroChar);
}
);
}
void BrainfuckCompiler::readAsChar(int a) {
movePointer(a);
output << ",";
}
void BrainfuckCompiler::readAsNumber(int a) {
int reader = getPointerForConstValue(0);
int result = getPointerForConstValue(0);
int zero = getPointerForConstValue('0');
int nine = getPointerForConstValue('9');
int ten = getPointerForConstValue(10);
movePointer(reader);
output << ",";
performWhile(
[&]() -> int {
return this->logicalOr(
this->lessThan(reader, zero),
this->greaterThan(reader, nine)
);
},
[&]() -> void {
this->movePointer(reader);
output << ",";
}
);
performWhile(
[&]() -> int {
return this->logicalAnd(
this->greaterThanOrEqual(reader, zero),
this->lessThanOrEqual(reader, nine)
);
},
[&]() -> void {
this->moveValue(
this->addValues(
this->subtractValues(reader, zero),
this->multiplyValues(
result,
ten
)
),
result
);
this->movePointer(reader);
output << ",";
}
);
moveValue(result, a);
}
void BrainfuckCompiler::printChar(unsigned char c) {
int a = getPointerForConstValue(c);
movePointer(a);
output << ".";
}
antlrcpp::Any BrainfuckCompiler::visitAdditiveExpression(SimpleCParser::AdditiveExpressionContext *ctx) {
if (ctx->children.size() == 1) {
SimpleCParser::MultiplicativeExpressionContext *multiplicativeExpression = dynamic_cast<SimpleCParser::MultiplicativeExpressionContext*>(ctx->children[0]);
if (multiplicativeExpression) {
return visitMultiplicativeExpression(multiplicativeExpression);
}
} else if (ctx->children.size() == 3) {
SimpleCParser::AdditiveExpressionContext *additiveExpression = dynamic_cast<SimpleCParser::AdditiveExpressionContext*>(ctx->children[0]);
SimpleCParser::MultiplicativeExpressionContext *multiplicativeExpression = dynamic_cast<SimpleCParser::MultiplicativeExpressionContext*>(ctx->children[2]);
if (additiveExpression && multiplicativeExpression) {
int firstOperandPointer = visitAdditiveExpression(additiveExpression);
int secondOperandPointer = visitMultiplicativeExpression(multiplicativeExpression);
if (ctx->children[1]->getText() == "+") {
return addValues(firstOperandPointer, secondOperandPointer);
} else if (ctx->children[1]->getText() == "-") {
return subtractValues(firstOperandPointer, secondOperandPointer);
}
}
}
throw "Unsupported additive expression";
}
antlrcpp::Any BrainfuckCompiler::visitArgumentExpressionList(SimpleCParser::ArgumentExpressionListContext *ctx) {
vector<antlrcpp::Any> list;
if (ctx->argumentExpressionList()) {
vector<antlrcpp::Any> preList = ctx->argumentExpressionList()->accept(this);
list.insert(list.end(), preList.begin(), preList.end());
}
list.push_back(ctx->assignmentExpression()->accept(this));
return list;
}
antlrcpp::Any BrainfuckCompiler::visitAssignmentExpression(SimpleCParser::AssignmentExpressionContext *ctx) {
// output << endl << "\"" << ctx->getText() << "\"" << endl;
if (ctx->children.size() == 1) {
SimpleCParser::LogicalOrExpressionContext *logicalOrExpression = dynamic_cast<SimpleCParser::LogicalOrExpressionContext*>(ctx->children[0]);
if (logicalOrExpression) {
return visitLogicalOrExpression(logicalOrExpression);
}
} else if (ctx->children.size() == 3) {
if (ctx->assignmentOperator()->getText() == "=") {
return copyValue(
ctx->assignmentExpression()->accept(this),
ctx->unaryExpression()->accept(this)
);
}
}
// return NULL;
throw "Unsupported assignment expression";
}
antlrcpp::Any BrainfuckCompiler::visitDeclarator(SimpleCParser::DeclaratorContext *ctx) {
return visitDirectDeclarator(ctx->directDeclarator());
}
antlrcpp::Any BrainfuckCompiler::visitDirectDeclarator(SimpleCParser::DirectDeclaratorContext *ctx) {
if (ctx->Identifier()) {
return memory.getVariableCell(ctx->Identifier()->getText());
}
SimpleCParser::DirectDeclaratorContext *directDeclarator = dynamic_cast<SimpleCParser::DirectDeclaratorContext*>(ctx->children[0]);
if (directDeclarator) {
if (ctx->children[1]->getText() == "(" && ctx->children[2]->getText() == ")") {
if (directDeclarator->getText() == "main") {
return true;
}
}
}
throw "Unsupported direct declarator";
}
antlrcpp::Any BrainfuckCompiler::visitEqualityExpression(SimpleCParser::EqualityExpressionContext *ctx) {
if (ctx->children.size() == 1) {
SimpleCParser::RelationalExpressionContext *relationalExpression = dynamic_cast<SimpleCParser::RelationalExpressionContext*>(ctx->children[0]);
if (relationalExpression) {
return visitRelationalExpression(relationalExpression);
}
}
if (ctx->children[1]->getText() == "==") {
return isEqual(
ctx->equalityExpression()->accept(this),
ctx->relationalExpression()->accept(this)
);
}
if (ctx->children[1]->getText() == "!=") {
return negate(isEqual(
ctx->equalityExpression()->accept(this),
ctx->relationalExpression()->accept(this)
));
}
throw "Unsupported equality expression";
}
antlrcpp::Any BrainfuckCompiler::visitFunctionDefinition(SimpleCParser::FunctionDefinitionContext *ctx) {
if (ctx->declarator()->directDeclarator()->directDeclarator()->getText() == "main") {
return ctx->compoundStatement()->accept(this);
}
throw "Unsupported function definition";
}
antlrcpp::Any BrainfuckCompiler::visitInitializer(SimpleCParser::InitializerContext *ctx) {
if (ctx->children.size() == 1) {
SimpleCParser::AssignmentExpressionContext *assignmentExpression = dynamic_cast<SimpleCParser::AssignmentExpressionContext*>(ctx->children[0]);
if (assignmentExpression) {
return visitAssignmentExpression(assignmentExpression);
}
}
throw "Unsupported initializer";
}
antlrcpp::Any BrainfuckCompiler::visitInitDeclarator(SimpleCParser::InitDeclaratorContext *ctx) {
if (ctx->children.size() == 3) {
SimpleCParser::DeclaratorContext *declarator = dynamic_cast<SimpleCParser::DeclaratorContext*>(ctx->children[0]);
SimpleCParser::InitializerContext *initializer = dynamic_cast<SimpleCParser::InitializerContext*>(ctx->children[2]);
if (declarator && ctx->children[1]->getText() == "=" && initializer) {
int dest = visitDeclarator(declarator);
int src = visitInitializer(initializer);
copyValue(src, dest);
return src;
}
}
throw "Unsupported init declarator";
}
antlrcpp::Any BrainfuckCompiler::visitIterationStatement(SimpleCParser::IterationStatementContext *ctx) {
if (ctx->While()) {
performWhile(
[&]() -> int {
return ctx->expression()->accept(this);
},
[&]() -> void {
ctx->statement()->accept(this);
}
);
return NULL;
}
if (ctx->For()) {
SimpleCParser::ForConditionContext *forCondition = dynamic_cast<SimpleCParser::ForConditionContext*>(ctx->forCondition());
function<void ()> initFn = [&]() -> void {};
function<int ()> expressionFn = [&]() -> int {
return 0;
};
function<void ()> updateFn = [&]() -> void {};
int firstPos = 0;
int secondPos = 1;
int thirdPos = 2;
if (forCondition->children[firstPos]->getText() != ";") {
initFn = [&]() -> void {
forCondition->children[firstPos]->accept(this);
};
secondPos = firstPos + 2;
thirdPos = firstPos + 3;
}
if (forCondition->children[secondPos]->getText() != ";") {
expressionFn = [&]() -> int {
return forCondition->children[secondPos]->accept(this);
};
thirdPos = secondPos + 2;
}
if (thirdPos < forCondition->children.size()) {
updateFn = [&]() -> void {
forCondition->children[thirdPos]->accept(this);
};
}
performFor(
initFn,
expressionFn,
updateFn,
[&]() -> void {
ctx->statement()->accept(this);
}
);
return NULL;
}
output << endl << ctx->getText() << endl;
throw "Unsupported iteration statement";
}
antlrcpp::Any BrainfuckCompiler::visitLogicalAndExpression(SimpleCParser::LogicalAndExpressionContext *ctx) {
if (ctx->children.size() == 1) {
SimpleCParser::EqualityExpressionContext *equalityExpression = dynamic_cast<SimpleCParser::EqualityExpressionContext*>(ctx->children[0]);
if (equalityExpression) {
return visitEqualityExpression(equalityExpression);
}
}
return logicalAnd(
ctx->logicalAndExpression()->accept(this),
ctx->equalityExpression()->accept(this)
);
throw "Unsupported logical AND expression";
}
antlrcpp::Any BrainfuckCompiler::visitLogicalOrExpression(SimpleCParser::LogicalOrExpressionContext *ctx) {
if (ctx->children.size() == 1) {
SimpleCParser::LogicalAndExpressionContext *logicalAndExpression = dynamic_cast<SimpleCParser::LogicalAndExpressionContext*>(ctx->children[0]);
if (logicalAndExpression) {
return visitLogicalAndExpression(logicalAndExpression);
}
}
return logicalOr(
ctx->logicalOrExpression()->accept(this),
ctx->logicalAndExpression()->accept(this)
);
throw "Unsupported logical OR expression";
}
antlrcpp::Any BrainfuckCompiler::visitMultiplicativeExpression(SimpleCParser::MultiplicativeExpressionContext *ctx) {
if (ctx->children.size() == 1) {
SimpleCParser::SimpleExpressionContext *simpleExpression = dynamic_cast<SimpleCParser::SimpleExpressionContext*>(ctx->children[0]);
if (simpleExpression) {
return visitSimpleExpression(simpleExpression);
}
} else if (ctx->children.size() == 3) {
SimpleCParser::MultiplicativeExpressionContext *multiplicativeExpression = dynamic_cast<SimpleCParser::MultiplicativeExpressionContext*>(ctx->children[0]);
SimpleCParser::SimpleExpressionContext *simpleExpression = dynamic_cast<SimpleCParser::SimpleExpressionContext*>(ctx->children[2]);
if (multiplicativeExpression && simpleExpression) {
int firstOperandPointer = visitMultiplicativeExpression(multiplicativeExpression);
int secondOperandPointer = visitSimpleExpression(simpleExpression);
if (ctx->children[1]->getText() == "*") {
return multiplyValues(firstOperandPointer, secondOperandPointer);
}
if (ctx->children[1]->getText() == "/") {
return divideValues(firstOperandPointer, secondOperandPointer);
}
if (ctx->children[1]->getText() == "%") {
return modValues(firstOperandPointer, secondOperandPointer);
}
}
}
throw "Unsupported multiplicative expression";
}
antlrcpp::Any BrainfuckCompiler::visitPostfixExpression(SimpleCParser::PostfixExpressionContext *ctx) {
if (ctx->primaryExpression()) {
return visitPrimaryExpression(ctx->primaryExpression());
}
if (ctx->children[1]->getText() == "(") {
if (
ctx->postfixExpression()->getText() == "printf" ||
ctx->postfixExpression()->getText() == "scanf"
) {
vector<antlrcpp::Any> allParams;
if (ctx->argumentExpressionList()) {
vector<antlrcpp::Any> params = ctx->argumentExpressionList()->accept(this);
allParams.insert(allParams.end(), params.begin(), params.end());
}
if (allParams.size() > 0) {
string formatString = allParams[0];
int nextVariable = 1;
int pointer;
for (int i = 1; i < formatString.length() - 1; ++i) {
if (ctx->postfixExpression()->getText() == "printf") {
switch (formatString[i]) {
case '\\':
switch (formatString[i+1]) {
case 'n':
printChar('\n');
break;
case 't':
printChar('\t');
break;
default:
throw "Incorrect backslash in printf";
}
++i;
break;
case '%':
pointer = allParams[nextVariable++];
switch (formatString[i+1]) {
case 'c':
printAsChar(pointer);
break;
case 'd':
printAsNumber(pointer);
break;
default:
throw "Unexpected printf format";
}
++i;
break;
default:
printChar(formatString[i]);
}
} else {
switch (formatString[i]) {
case '%':
pointer = allParams[nextVariable++];
switch (formatString[i+1]) {
case 'c':
readAsChar(pointer);
break;
case 'd':
readAsNumber(pointer);
break;
default:
throw "Unexpected scanf format";
}
++i;
break;
case ' ':
break;
default:
throw "Unexpected scanf format";
}
}
}
}
return NULL;
}
}
throw "Unsupported postfix expression";
}
antlrcpp::Any BrainfuckCompiler::visitPrimaryExpression(SimpleCParser::PrimaryExpressionContext *ctx) {
if (ctx->Constant()) {
// If it is a constant, store it in a temporary memory cell and return its address
string value = ctx->Constant()->getText();
if (value[0] == '\'') {
return getPointerForConstValue(value[1]);
} else {
return getPointerForConstValue(atoi(value.c_str()));
}
} else if (ctx->Identifier()) {
// If it is an identifier, return its mmoery address
string name = ctx->Identifier()->getText();
return memory.getVariableCell(name);
} else if (ctx->StringLiteral()[0]) {
return ctx->StringLiteral()[0]->getText();
}
throw "Unsupported primary expression";
}
antlrcpp::Any BrainfuckCompiler::visitRelationalExpression(SimpleCParser::RelationalExpressionContext *ctx) {
if (ctx->children.size() == 1) {
SimpleCParser::AdditiveExpressionContext *additiveExpression = dynamic_cast<SimpleCParser::AdditiveExpressionContext*>(ctx->children[0]);
if (additiveExpression) {
return visitAdditiveExpression(additiveExpression);
}
}
if (ctx->children[1]->getText() == "<") {
return lessThan(
ctx->relationalExpression()->accept(this),
ctx->additiveExpression()->accept(this)
);
}
if (ctx->children[1]->getText() == "<=") {
return lessThanOrEqual(
ctx->relationalExpression()->accept(this),
ctx->additiveExpression()->accept(this)
);
}
if (ctx->children[1]->getText() == ">") {
return greaterThan(
ctx->relationalExpression()->accept(this),
ctx->additiveExpression()->accept(this)
);
}
if (ctx->children[1]->getText() == ">=") {
return greaterThanOrEqual(
ctx->relationalExpression()->accept(this),
ctx->additiveExpression()->accept(this)
);
}
throw "Unsupported relational expression";
}
antlrcpp::Any BrainfuckCompiler::visitSimpleExpression(SimpleCParser::SimpleExpressionContext *ctx) {
if (ctx->unaryExpression()) {
return visitUnaryExpression(ctx->unaryExpression());
} else if (ctx->DigitSequence()) {
return getPointerForConstValue(atoi(ctx->DigitSequence()->getText().c_str()));
}
throw "Unsupported simple expression";
}
antlrcpp::Any BrainfuckCompiler::visitSelectionStatement(SimpleCParser::SelectionStatementContext *ctx) {
if (ctx->children[0]->getText() == "if") {
SimpleCParser::StatementContext *ifStatement = dynamic_cast<SimpleCParser::StatementContext*>(ctx->children[4]);
SimpleCParser::StatementContext *elseStatement = NULL;
if (ctx->children.size() == 7) {
elseStatement = dynamic_cast<SimpleCParser::StatementContext*>(ctx->children[6]);
}
performIfElse(
ctx->expression()->accept(this),
[&]() -> void {
ifStatement->accept(this);
},
[&]() -> void {
if (elseStatement) {
elseStatement->accept(this);
}
}
);
return NULL;
}
throw "Unsupported selection statement";
}
antlrcpp::Any BrainfuckCompiler::visitUnaryExpression(SimpleCParser::UnaryExpressionContext *ctx) {
if (ctx->postfixExpression()) {
return visitPostfixExpression(ctx->postfixExpression());
}
if (ctx->children[0]->getText() == "!") {
return negate(ctx->unaryExpression()->accept(this));
}
if (ctx->children[0]->getText() == "&") {
return ctx->unaryExpression()->accept(this);
}
throw "Unsupported unary expression";
} | 29.533333 | 159 | 0.625866 | nbozidarevic |
6c9fc41e386bca87f22fcff5268fa39d7a5403ec | 67,288 | cpp | C++ | RenderCore/LightingEngine/SunSourceConfiguration.cpp | djewsbury/XLE | 7806e4b5c9de5631c94c2020f6adcd4bd8e3d91e | [
"MIT"
] | 3 | 2015-12-04T09:16:53.000Z | 2021-05-28T23:22:49.000Z | RenderCore/LightingEngine/SunSourceConfiguration.cpp | djewsbury/XLE | 7806e4b5c9de5631c94c2020f6adcd4bd8e3d91e | [
"MIT"
] | null | null | null | RenderCore/LightingEngine/SunSourceConfiguration.cpp | djewsbury/XLE | 7806e4b5c9de5631c94c2020f6adcd4bd8e3d91e | [
"MIT"
] | 2 | 2015-03-03T05:32:39.000Z | 2015-12-04T09:16:54.000Z | // Distributed under the MIT License (See
// accompanying file "LICENSE" or the website
// http://www.opensource.org/licenses/mit-license.php)
#include "SunSourceConfiguration.h"
#include "ShadowPreparer.h"
#include "ShadowUniforms.h" // for the attach driver infrastructure
#include "../Techniques/TechniqueUtils.h"
#include "../Techniques/ParsingContext.h"
#include "../Format.h"
#include "../StateDesc.h"
#include "../../ConsoleRig/Console.h"
#include "../../Math/Vector.h"
#include "../../Math/Matrix.h"
#include "../../Math/Transformations.h"
#include "../../Math/ProjectionMath.h"
#include "../../Math/MathSerialization.h"
#include "../../OSServices/Log.h"
#include "../../Utility/BitUtils.h"
#include <sstream>
namespace RenderCore { namespace LightingEngine
{
static Float4x4 MakeWorldToLight(
const Float3& negativeLightDirection,
const Float3& position)
{
return InvertOrthonormalTransform(
MakeCameraToWorld(-negativeLightDirection, Float3(1.f, 0.f, 0.f), position));
}
static const unsigned s_staticMaxSubProjections = 6;
struct OrthoProjections
{
Float4x4 _worldToView;
unsigned _normalProjCount = 0;
IOrthoShadowProjections::OrthoSubProjection _orthSubProjections[s_staticMaxSubProjections];
Float4x4 _limitedMainCameraToProjection;
};
struct ArbitraryProjections
{
unsigned _normalProjCount = 0;
Float4x4 _worldToCamera[s_staticMaxSubProjections];
Float4x4 _cameraToProjection[s_staticMaxSubProjections];
};
static ArbitraryProjections BuildBasicShadowProjections(
const Float3& negativeLightDirection,
const RenderCore::Techniques::ProjectionDesc& mainSceneProjectionDesc,
const SunSourceFrustumSettings& settings)
{
using namespace RenderCore::LightingEngine;
ArbitraryProjections result;
const float shadowNearPlane = 1.f;
const float shadowFarPlane = settings._maxDistanceFromCamera;
static float shadowWidthScale = 3.f;
static float projectionSizePower = 3.75f;
float shadowProjectionDist = shadowFarPlane - shadowNearPlane;
auto cameraPos = ExtractTranslation(mainSceneProjectionDesc._cameraToWorld);
auto cameraForward = ExtractForward_Cam(mainSceneProjectionDesc._cameraToWorld);
// Calculate a simple set of shadow frustums.
// This method is non-ideal, but it's just a place holder for now
result._normalProjCount = 5;
for (unsigned c=0; c<result._normalProjCount; ++c) {
const float projectionWidth = shadowWidthScale * std::pow(projectionSizePower, float(c));
Float3 shiftDirection = cameraForward - negativeLightDirection * Dot(cameraForward, negativeLightDirection);
Float3 focusPoint = cameraPos + (projectionWidth * 0.45f) * shiftDirection;
auto lightViewMatrix = MakeWorldToLight(
negativeLightDirection, focusPoint + (.5f * shadowProjectionDist) * negativeLightDirection);
result._cameraToProjection[c] = OrthogonalProjection(
-.5f * projectionWidth, -.5f * projectionWidth,
.5f * projectionWidth, .5f * projectionWidth,
shadowNearPlane, shadowFarPlane,
GeometricCoordinateSpace::RightHanded,
RenderCore::Techniques::GetDefaultClipSpaceType());
result._worldToCamera[c] = lightViewMatrix;
}
return result;
}
static void CalculateCameraFrustumCornersDirection(
Float3 result[4],
const RenderCore::Techniques::ProjectionDesc& projDesc,
ClipSpaceType clipSpaceType)
{
// For the given camera, calculate 4 vectors that represent the
// the direction from the camera position to the frustum corners
// (there are 8 frustum corners, but the directions to the far plane corners
// are the same as the near plane corners)
Float4x4 projection = projDesc._cameraToProjection;
Float4x4 noTransCameraToWorld = projDesc._cameraToWorld;
SetTranslation(noTransCameraToWorld, Float3(0.f, 0.f, 0.f));
auto trans = Combine(InvertOrthonormalTransform(noTransCameraToWorld), projection);
Float3 corners[8];
CalculateAbsFrustumCorners(corners, trans, clipSpaceType);
for (unsigned c=0; c<4; ++c) {
result[c] = Normalize(corners[4+c]); // use the more distance corners, on the far clip plane
}
}
static std::pair<Float4x4, Float4> BuildCameraAlignedOrthogonalShadowProjection(
const Float3& negativeLightDirection,
const RenderCore::Techniques::ProjectionDesc& mainSceneProjectionDesc,
float depth, float maxDistanceFromCamera)
{
// Build a special "camera aligned" shadow projection.
// This can be used to for especially high resolution shadows very close to the
// near clip plane.
// First, we build a rough projection-to-world based on the camera right direction...
auto projRight = ExtractRight_Cam(mainSceneProjectionDesc._cameraToWorld);
auto projForward = -negativeLightDirection;
auto projUp = Cross(projRight, projForward);
auto adjRight = Cross(projForward, projUp);
auto camPos = ExtractTranslation(mainSceneProjectionDesc._cameraToWorld);
auto projToWorld = MakeCameraToWorld(projForward, Normalize(projUp), Normalize(adjRight), camPos);
auto worldToLightProj = InvertOrthonormalTransform(projToWorld);
// Now we just have to fit the finsl projection around the frustum corners
auto clipSpaceType = RenderCore::Techniques::GetDefaultClipSpaceType();
auto reducedDepthProjection = PerspectiveProjection(
mainSceneProjectionDesc._verticalFov, mainSceneProjectionDesc._aspectRatio,
mainSceneProjectionDesc._nearClip, depth,
GeometricCoordinateSpace::RightHanded, clipSpaceType);
auto worldToReducedDepthProj = Combine(
InvertOrthonormalTransform(mainSceneProjectionDesc._cameraToWorld), reducedDepthProjection);
Float3 frustumCorners[8];
CalculateAbsFrustumCorners(frustumCorners, worldToReducedDepthProj, clipSpaceType);
Float3 shadowViewSpace[8];
Float3 shadowViewMins( std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
Float3 shadowViewMaxs(-std::numeric_limits<float>::max(), -std::numeric_limits<float>::max(), -std::numeric_limits<float>::max());
for (unsigned c = 0; c < 8; c++) {
shadowViewSpace[c] = TransformPoint(worldToLightProj, frustumCorners[c]);
// In our right handed coordinate space, the z coordinate in view space should
// be negative. But we always specify near & far in positive values. So
// we have to swap the sign of z here
shadowViewSpace[c][2] = -shadowViewSpace[c][2];
shadowViewMins[0] = std::min(shadowViewMins[0], shadowViewSpace[c][0]);
shadowViewMins[1] = std::min(shadowViewMins[1], shadowViewSpace[c][1]);
shadowViewMins[2] = std::min(shadowViewMins[2], shadowViewSpace[c][2]);
shadowViewMaxs[0] = std::max(shadowViewMaxs[0], shadowViewSpace[c][0]);
shadowViewMaxs[1] = std::max(shadowViewMaxs[1], shadowViewSpace[c][1]);
shadowViewMaxs[2] = std::max(shadowViewMaxs[2], shadowViewSpace[c][2]);
}
const float shadowNearPlane = -maxDistanceFromCamera;
const float shadowFarPlane = maxDistanceFromCamera;
Float4x4 projMatrix = OrthogonalProjection(
shadowViewMins[0], shadowViewMaxs[1], shadowViewMaxs[0], shadowViewMins[1],
shadowNearPlane, shadowFarPlane,
GeometricCoordinateSpace::RightHanded, clipSpaceType);
auto result = Combine(worldToLightProj, projMatrix);
return std::make_pair(result, ExtractMinimalProjection(projMatrix));
}
static OrthoProjections BuildSimpleOrthogonalShadowProjections(
const Float3& negativeLightDirection,
const RenderCore::Techniques::ProjectionDesc& mainSceneProjectionDesc,
const SunSourceFrustumSettings& settings)
{
// We're going to build some basic adaptive shadow frustums. These frustums
// all fit within the same "definition" orthogonal space. This means that
// cascades can't be rotated or skewed relative to each other. Usually this
// should be fine, (and perhaps might reduce some flickering around the
// cascade edges) but it means that the cascades might not be as tightly
// bound as they might be.
using namespace RenderCore::LightingEngine;
using namespace RenderCore;
OrthoProjections result;
result._normalProjCount = settings._maxFrustumCount;
const float shadowNearPlane = -settings._maxDistanceFromCamera;
const float shadowFarPlane = settings._maxDistanceFromCamera;
auto clipSpaceType = Techniques::GetDefaultClipSpaceType();
float t = 0;
for (unsigned c=0; c<result._normalProjCount; ++c) { t += std::pow(settings._frustumSizeFactor, float(c)); }
Float3 cameraPos = ExtractTranslation(mainSceneProjectionDesc._cameraToWorld);
Float3 focusPoint = cameraPos + settings._focusDistance * ExtractForward_Cam(mainSceneProjectionDesc._cameraToWorld);
auto lightToWorld = MakeCameraToWorld(-negativeLightDirection, ExtractRight_Cam(mainSceneProjectionDesc._cameraToWorld), focusPoint);
Float4x4 worldToView = InvertOrthonormalTransform(lightToWorld);
assert(std::isfinite(worldToView(0,3)) && !std::isnan(worldToView(0,3)));
result._worldToView = worldToView;
// Calculate 4 vectors for the directions of the frustum corners,
// relative to the camera position.
Float3 frustumCornerDir[4];
CalculateCameraFrustumCornersDirection(frustumCornerDir, mainSceneProjectionDesc, clipSpaceType);
// Float3 allCascadesMins( std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
// Float3 allCascadesMaxs(-std::numeric_limits<float>::max(), -std::numeric_limits<float>::max(), -std::numeric_limits<float>::max());
float distanceFromCamera = 0.f;
for (unsigned f=0; f<result._normalProjCount; ++f) {
float camNearPlane = distanceFromCamera;
distanceFromCamera += std::pow(settings._frustumSizeFactor, float(f)) * settings._maxDistanceFromCamera / t;
float camFarPlane = distanceFromCamera;
// Find the frustum corners for this part of the camera frustum,
// and then build a shadow frustum that will contain those corners.
// Potentially not all of the camera frustum is full of geometry --
// if we knew which parts were full, and which were empty, we could
// optimise the shadow frustum further.
Float3 absFrustumCorners[8];
for (unsigned c = 0; c < 4; ++c) {
absFrustumCorners[c] = cameraPos + camNearPlane * frustumCornerDir[c];
absFrustumCorners[4 + c] = cameraPos + camFarPlane * frustumCornerDir[c];
}
// Let's assume that we're not going to rotate the shadow frustum
// during this fitting. Then, this is easy... The shadow projection
// is orthogonal, so we just need to find the AABB in shadow-view space
// for these corners, and the projection parameters will match those very
// closely.
//
// Note that we could potentially get a better result if we rotate the
// shadow frustum projection to better fit around the projected camera.
// It might make shadow texels creep and flicker as the projection changes,
// but perhaps a better implementation of this function could try that out.
Float3 shadowViewSpace[8];
Float3 shadowViewMins( std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
Float3 shadowViewMaxs(-std::numeric_limits<float>::max(), -std::numeric_limits<float>::max(), -std::numeric_limits<float>::max());
for (unsigned c = 0; c < 8; c++) {
shadowViewSpace[c] = TransformPoint(worldToView, absFrustumCorners[c]);
// In our right handed coordinate space, the z coordinate in view space should
// be negative. But we always specify near & far in positive values. So
// we have to swap the sign of z here
shadowViewSpace[c][2] = -shadowViewSpace[c][2];
shadowViewMins[0] = std::min(shadowViewMins[0], shadowViewSpace[c][0]);
shadowViewMins[1] = std::min(shadowViewMins[1], shadowViewSpace[c][1]);
shadowViewMins[2] = std::min(shadowViewMins[2], shadowViewSpace[c][2]);
shadowViewMaxs[0] = std::max(shadowViewMaxs[0], shadowViewSpace[c][0]);
shadowViewMaxs[1] = std::max(shadowViewMaxs[1], shadowViewSpace[c][1]);
shadowViewMaxs[2] = std::max(shadowViewMaxs[2], shadowViewSpace[c][2]);
}
// We have to pull the min depth distance back towards the light
// This is so we can capture geometry that is between the light
// and the frustum
shadowViewMins[2] = shadowNearPlane;
// shadowViewMaxs[2] = shadowFarPlane;
result._orthSubProjections[f]._leftTopFront = shadowViewMins;
result._orthSubProjections[f]._rightBottomBack = shadowViewMaxs;
// allCascadesMins[0] = std::min(allCascadesMins[0], shadowViewMins[0]);
// allCascadesMins[1] = std::min(allCascadesMins[1], shadowViewMins[1]);
// allCascadesMins[2] = std::min(allCascadesMins[2], shadowViewMins[2]);
// allCascadesMaxs[0] = std::max(allCascadesMaxs[0], shadowViewMaxs[0]);
// allCascadesMaxs[1] = std::max(allCascadesMaxs[1], shadowViewMaxs[1]);
// allCascadesMaxs[2] = std::max(allCascadesMaxs[2], shadowViewMaxs[2]);
}
// When building the world to clip matrix, we want some to use some projection
// that projection that will contain all of the shadow frustums.
// We can use allCascadesMins and allCascadesMaxs to find the area of the
// orthogonal space that is actually used. We just have to incorporate these
// mins and maxs into the projection matrix
/*
Float4x4 clippingProjMatrix = OrthogonalProjection(
allCascadesMins[0], allCascadesMaxs[1], allCascadesMaxs[0], allCascadesMins[1],
shadowNearPlane, shadowFarPlane,
GeometricCoordinateSpace::RightHanded, clipSpaceType);
Float4x4 worldToClip = Combine(definitionViewMatrix, clippingProjMatrix);
std::tie(result._specialNearProjection, result._specialNearMinimalProjection) =
BuildCameraAlignedOrthogonalShadowProjection(lightDesc, mainSceneProjectionDesc, 2.5, 30.f);
result._useNearProj = true;
*/
return result;
}
// We can use either Z or W for tests related to depth in the view frustu,
// Z can work for either projection or orthogonal, but W is a lot simplier for perspective
// projections. Using W also isolates us from the inpact of the ReverseZ modes
#define USE_W_FOR_DEPTH_RANGE_COVERED
static bool ClipSpaceFurther(const Float4& lhs, float rhs, ClipSpaceType clipSpaceType)
{
#if !defined(USE_W_FOR_DEPTH_RANGE_COVERED)
// In non-reverseZ modes, lhs is further than rhs if it larger
// In reverseZ mods, lhs is further than rhs if it is smaller
return (clipSpaceType == ClipSpaceType::PositiveRightHanded_ReverseZ || clipSpaceType == ClipSpaceType::Positive_ReverseZ) ^ (lhs[2] > rhs);
#else
return lhs[3] > rhs;
#endif
}
static std::pair<std::vector<Float3>, float> NearestPointNotInsideOrthoProjection(
const Float4x4& cameraWorldToClip,
const Float3* absFrustumCorners,
const Float4x4& orthoViewToWorld,
const IOrthoShadowProjections::OrthoSubProjection& projection,
float depthRangeCovered,
ClipSpaceType clipSpaceType)
{
// We need to test the edges of ortho box against the camera frustum
// and the edges of the ortho box against the frustum
//
// Note that the points in "absFrustumCorners" are actually arranged so first 4 and last 4
// make Z-patterns
const unsigned edges_zpattern[] = {
0, 1,
1, 3,
3, 2,
2, 0,
4, 6,
6, 7,
7, 5,
5, 4,
0, 4,
1, 5,
3, 7,
2, 6
};
auto orthoToClip = Combine(orthoViewToWorld, cameraWorldToClip);
auto orthoWorldToView = InvertOrthonormalTransform(orthoViewToWorld);
std::vector<Float4> intersectionPts;
{
const Float4 clipSpaceCorners[] = {
orthoToClip * Expand(Float3{projection._leftTopFront[0], projection._leftTopFront[1], projection._leftTopFront[2]}, 1.0f),
orthoToClip * Expand(Float3{projection._leftTopFront[0], projection._rightBottomBack[1], projection._leftTopFront[2]}, 1.0f),
orthoToClip * Expand(Float3{projection._rightBottomBack[0], projection._leftTopFront[1], projection._leftTopFront[2]}, 1.0f),
orthoToClip * Expand(Float3{projection._rightBottomBack[0], projection._rightBottomBack[1], projection._leftTopFront[2]}, 1.0f),
orthoToClip * Expand(Float3{projection._leftTopFront[0], projection._leftTopFront[1], projection._rightBottomBack[2]}, 1.0f),
orthoToClip * Expand(Float3{projection._leftTopFront[0], projection._rightBottomBack[1], projection._rightBottomBack[2]}, 1.0f),
orthoToClip * Expand(Float3{projection._rightBottomBack[0], projection._leftTopFront[1], projection._rightBottomBack[2]}, 1.0f),
orthoToClip * Expand(Float3{projection._rightBottomBack[0], projection._rightBottomBack[1], projection._rightBottomBack[2]}, 1.0f)
};
for (unsigned e=0; e<dimof(edges_zpattern); e+=2) {
auto start = clipSpaceCorners[edges_zpattern[e+0]];
auto end = clipSpaceCorners[edges_zpattern[e+1]];
for (unsigned ele=0; ele<2; ++ele) {
if ((start[ele] < -start[3]) != (end[ele] < -end[3])) {
// clip to the [ele] == -w plane
// start[ele] + alpha * (end[ele] - start[ele]) = -start[3] + alpha * (start[3] - end[3])
// alpha * (end[ele] - start[ele]) - alpha * (start[3] - end[3]) = -start[3] - start[ele]
// alpha * ((end[ele] - start[ele]) - (start[3] - end[3])) = -start[3] - start[ele]
// alpha = (-start[3] - start[ele]) / ((end[ele] - start[ele]) - (start[3] - end[3]))
// alpha = (start[3] + start[ele]) / (start[ele] + start[3] - end[ele] - end[3])
auto alpha = (start[3] + start[ele]) / (start[ele] + start[3] - end[ele] - end[3]);
assert(alpha >= 0.f && alpha <= 1.0f);
Float4 intersection = start + (end-start)*alpha;
assert(Equivalent(intersection[ele], -intersection[3], 1e-1f));
if (std::abs(intersection[ele^1]) <= intersection[3] && std::abs(intersection[2]) <= intersection[3] && intersection[2] >= 0) {
if (ClipSpaceFurther(intersection, depthRangeCovered, clipSpaceType)) {
intersectionPts.push_back(intersection);
}
}
}
if ((start[ele] > start[3]) != (end[ele] > end[3])) {
// clip to the [ele] == w plane
// start[ele] + alpha * (end[ele] - start[ele]) = start[3] + alpha * (end[3] - start[3])
// alpha * (end[ele] - start[ele]) - alpha * (end[3] - start[3]) = start[3] - start[ele]
// alpha = (start[3] - start[ele]) / (end[ele] - end[3] - start[ele] + start[3])
auto alpha = (start[3] - start[ele]) / (end[ele] - end[3] - start[ele] + start[3]);
assert(alpha >= 0.f && alpha <= 1.0f);
Float4 intersection = start + (end-start)*alpha;
assert(Equivalent(intersection[ele], intersection[3], 1e-1f));
if (std::abs(intersection[ele^1]) <= intersection[3] && std::abs(intersection[2]) <= intersection[3] && intersection[2] >= 0) {
if (ClipSpaceFurther(intersection, depthRangeCovered, clipSpaceType)) {
intersectionPts.push_back(intersection);
}
}
}
}
}
}
{
assert(projection._leftTopFront[0] < projection._rightBottomBack[0]);
assert(projection._leftTopFront[1] < projection._rightBottomBack[1]);
assert(projection._leftTopFront[2] < projection._rightBottomBack[2]);
for (unsigned e=0; e<dimof(edges_zpattern); e+=2) {
auto start = TransformPoint(orthoWorldToView, absFrustumCorners[edges_zpattern[e+0]]);
auto end = TransformPoint(orthoWorldToView, absFrustumCorners[edges_zpattern[e+1]]);
for (unsigned ele=0; ele<3; ++ele) {
if ((start[ele] < projection._leftTopFront[ele]) != (end[ele] < projection._leftTopFront[ele])) {
float alpha = (projection._leftTopFront[ele] - start[ele]) / (end[ele] - start[ele]);
Float3 intersection = start + (end-start)*alpha;
if (intersection[(ele+1)%3] >= projection._leftTopFront[(ele+1)%3] && intersection[(ele+1)%3] <= projection._rightBottomBack[(ele+1)%3]
&& intersection[(ele+2)%3] >= projection._leftTopFront[(ele+2)%3] && intersection[(ele+2)%3] <= projection._rightBottomBack[(ele+2)%3]) {
Float4 clipSpace = orthoToClip * Expand(intersection, 1.0f);
if (ClipSpaceFurther(clipSpace, depthRangeCovered, clipSpaceType)) {
intersectionPts.push_back(clipSpace);
}
}
}
if ((start[ele] > projection._rightBottomBack[ele]) != (end[ele] > projection._rightBottomBack[ele])) {
float alpha = (projection._rightBottomBack[ele] - start[ele]) / (end[ele] - start[ele]);
Float3 intersection = start + (end-start)*alpha;
if (intersection[(ele+1)%3] >= projection._leftTopFront[(ele+1)%3] && intersection[(ele+1)%3] <= projection._rightBottomBack[(ele+1)%3]
&& intersection[(ele+2)%3] >= projection._leftTopFront[(ele+2)%3] && intersection[(ele+2)%3] <= projection._rightBottomBack[(ele+2)%3]) {
Float4 clipSpace = orthoToClip * Expand(intersection, 1.0f);
if (ClipSpaceFurther(clipSpace, depthRangeCovered, clipSpaceType)) {
intersectionPts.push_back(clipSpace);
}
}
}
}
}
}
if (!intersectionPts.empty()) {
auto clipToWorld = Inverse(cameraWorldToClip);
std::vector<Float3> result;
// sort closest to camera first
#if !defined(USE_W_FOR_DEPTH_RANGE_COVERED)
if (clipSpaceType == ClipSpaceType::PositiveRightHanded_ReverseZ || clipSpaceType == ClipSpaceType::Positive_ReverseZ) {
std::sort(intersectionPts.begin(), intersectionPts.end(), [](const auto& lhs, const auto& rhs) { return lhs[2] > rhs[2]; });
} else
std::sort(intersectionPts.begin(), intersectionPts.end(), [](const auto& lhs, const auto& rhs) { return lhs[2] < rhs[2]; });
const unsigned depthRangeConveredEle = 2;
#else
std::sort(intersectionPts.begin(), intersectionPts.end(), [](const auto& lhs, const auto& rhs) { return lhs[3] < rhs[3]; });
const unsigned depthRangeConveredEle = 3;
#endif
result.reserve(intersectionPts.size());
for (auto& pt:intersectionPts)
result.push_back(Truncate(clipToWorld * pt));
return {std::move(result), intersectionPts[0][depthRangeConveredEle]};
}
return {{}, depthRangeCovered};
}
static Float2 MinAndMaxOrthoSpaceZ(
const Float4x4& cameraWorldToClip,
const Float3* absFrustumCorners,
const Float4x4& orthoViewToWorld,
const Float2& leftTop2D, const Float2& rightBottom2D,
const Float4& cameraMiniProj,
float depthRangeCovered,
ClipSpaceType clipSpaceType)
{
const unsigned edges_zpattern[] = {
0, 1,
1, 3,
3, 2,
2, 0,
4, 6,
6, 7,
7, 5,
5, 4,
0, 4,
1, 5,
3, 7,
2, 6
};
auto orthoToClip = Combine(orthoViewToWorld, cameraWorldToClip);
auto orthoWorldToView = InvertOrthonormalTransform(orthoViewToWorld);
auto clipToWorld = Inverse(cameraWorldToClip);
auto clipToOrthoView = Combine(clipToWorld, orthoWorldToView);
Float2 orthZMinAndMax { FLT_MAX, -FLT_MAX };
for (unsigned c=0; c<8; ++c) {
float z = (orthoWorldToView * Float4{absFrustumCorners[c], 1.0f})[2];
orthZMinAndMax[0] = std::min(orthZMinAndMax[0], z);
orthZMinAndMax[1] = std::max(orthZMinAndMax[1], z);
}
Float2 result { FLT_MAX, -FLT_MAX };
Float3 leftTopFront{leftTop2D[0], leftTop2D[1], orthZMinAndMax[0] - 0.1f};
Float3 rightBottomBack{rightBottom2D[0], rightBottom2D[1], orthZMinAndMax[1] + 0.1f};
{
const Float4 clipSpaceCorners[] = {
orthoToClip * Expand(Float3{leftTopFront[0], leftTopFront[1], leftTopFront[2]}, 1.0f),
orthoToClip * Expand(Float3{leftTopFront[0], rightBottomBack[1], leftTopFront[2]}, 1.0f),
orthoToClip * Expand(Float3{rightBottomBack[0], leftTopFront[1], leftTopFront[2]}, 1.0f),
orthoToClip * Expand(Float3{rightBottomBack[0], rightBottomBack[1], leftTopFront[2]}, 1.0f),
orthoToClip * Expand(Float3{leftTopFront[0], leftTopFront[1], rightBottomBack[2]}, 1.0f),
orthoToClip * Expand(Float3{leftTopFront[0], rightBottomBack[1], rightBottomBack[2]}, 1.0f),
orthoToClip * Expand(Float3{rightBottomBack[0], leftTopFront[1], rightBottomBack[2]}, 1.0f),
orthoToClip * Expand(Float3{rightBottomBack[0], rightBottomBack[1], rightBottomBack[2]}, 1.0f)
};
for (unsigned e=0; e<dimof(edges_zpattern); e+=2) {
auto start = clipSpaceCorners[edges_zpattern[e+0]];
auto end = clipSpaceCorners[edges_zpattern[e+1]];
for (unsigned ele=0; ele<3; ++ele) {
if ((start[ele] < -start[3]) != (end[ele] < -end[3])) {
auto alpha = (start[3] + start[ele]) / (start[ele] + start[3] - end[ele] - end[3]);
assert(alpha >= 0.f && alpha <= 1.0f);
Float4 intersection = start + (end-start)*alpha;
assert(Equivalent(intersection[ele], -intersection[3], 1e-1f));
if (std::abs(intersection[(ele+1)%3]) <= intersection[3] && std::abs(intersection[(ele+2)%3]) <= intersection[3]) {
auto orthoView = clipToOrthoView * intersection;
float z = orthoView[2];
result[0] = std::min(result[0], z);
result[1] = std::max(result[1], z);
}
}
if ((start[ele] > start[3]) != (end[ele] > end[3])) {
auto alpha = (start[3] - start[ele]) / (end[ele] - end[3] - start[ele] + start[3]);
assert(alpha >= 0.f && alpha <= 1.0f);
Float4 intersection = start + (end-start)*alpha;
assert(Equivalent(intersection[ele], intersection[3], 1e-1f));
if (std::abs(intersection[(ele+1)%3]) <= intersection[3] && std::abs(intersection[(ele+2)%3]) <= intersection[3]) {
auto orthoView = clipToOrthoView * intersection;
float z = orthoView[2];
result[0] = std::min(result[0], z);
result[1] = std::max(result[1], z);
}
}
}
// also check against the Z=0 plane (we've already done Z=W above)
if (((start[2] < 0) != (end[2] < 0))) {
auto alpha = (start[2]) / (start[2] - end[2]);
assert(alpha >= 0.f && alpha <= 1.0f);
Float4 intersection = start + (end-start)*alpha;
assert(Equivalent(intersection[2], 0.f, 1e-1f));
if (std::abs(intersection[0]) <= intersection[3] && std::abs(intersection[1]) <= intersection[3]) {
auto orthoView = clipToOrthoView * intersection;
float z = orthoView[2];
result[0] = std::min(result[0], z);
result[1] = std::max(result[1], z);
}
} else {
assert((start[2]<0) == (end[2]<0));
}
}
}
{
assert(leftTopFront[0] < rightBottomBack[0]);
assert(leftTopFront[1] < rightBottomBack[1]);
float f, n;
std::tie(n,f) = CalculateNearAndFarPlane(cameraMiniProj, clipSpaceType);
#if !defined(USE_W_FOR_DEPTH_RANGE_COVERED)
float depthAlphaValue = (depthRangeCovered - cameraMiniProj[3]) / cameraMiniProj[2];
depthAlphaValue = (-depthAlphaValue - n) / f;
#else
float depthAlphaValue = (depthRangeCovered - n) / f;
#endif
for (unsigned e=0; e<dimof(edges_zpattern); e+=2) {
unsigned startPt = edges_zpattern[e+0], endPt = edges_zpattern[e+1];
Float3 start, end;
if (startPt < 4) start = TransformPoint(orthoWorldToView, LinearInterpolate(absFrustumCorners[startPt], absFrustumCorners[startPt+4], depthAlphaValue));
else start = TransformPoint(orthoWorldToView, absFrustumCorners[startPt]);
if (endPt < 4) end = TransformPoint(orthoWorldToView, LinearInterpolate(absFrustumCorners[endPt], absFrustumCorners[endPt+4], depthAlphaValue));
else end = TransformPoint(orthoWorldToView, absFrustumCorners[endPt]);
// points inside of the projection area count
if (start[0] >= leftTopFront[0] && start[1] >= leftTopFront[1] && start[0] <= rightBottomBack[0] && start[1] <= rightBottomBack[1]) {
result[0] = std::min(result[0], start[2]);
result[1] = std::max(result[1], start[2]);
}
if (end[0] >= leftTopFront[0] && end[1] >= leftTopFront[1] && end[0] <= rightBottomBack[0] && end[1] <= rightBottomBack[1]) {
result[0] = std::min(result[0], end[2]);
result[1] = std::max(result[1], end[2]);
}
for (unsigned ele=0; ele<3; ++ele) {
if ((start[ele] < leftTopFront[ele]) != (end[ele] < leftTopFront[ele])) {
float alpha = (leftTopFront[ele] - start[ele]) / (end[ele] - start[ele]);
Float3 intersection = start + (end-start)*alpha;
if ( intersection[(ele+1)%3] >= leftTopFront[(ele+1)%3] && intersection[(ele+1)%3] <= rightBottomBack[(ele+1)%3]
&& intersection[(ele+2)%3] >= leftTopFront[(ele+2)%3] && intersection[(ele+2)%3] <= rightBottomBack[(ele+2)%3]) {
float z = intersection[2];
result[0] = std::min(result[0], z);
result[1] = std::max(result[1], z);
}
}
if ((start[ele] > rightBottomBack[ele]) != (end[ele] > rightBottomBack[ele])) {
float alpha = (rightBottomBack[ele] - start[ele]) / (end[ele] - start[ele]);
Float3 intersection = start + (end-start)*alpha;
if ( intersection[(ele+1)%3] >= leftTopFront[(ele+1)%3] && intersection[(ele+1)%3] <= rightBottomBack[(ele+1)%3]
&& intersection[(ele+2)%3] >= leftTopFront[(ele+2)%3] && intersection[(ele+2)%3] <= rightBottomBack[(ele+2)%3]) {
float z = intersection[2];
result[0] = std::min(result[0], z);
result[1] = std::max(result[1], z);
}
}
}
}
}
if (result[0] < result[1]) {
const float precisionGraceDistance = 1e-3f;
result[0] -= std::abs(result[0]) * precisionGraceDistance;
result[1] += std::abs(result[1]) * precisionGraceDistance;
}
return result;
}
static Float4x4 MakeOrientedShadowViewToWorld(const Float3& lightDirection, const Float3& positiveX, const Float3& focusPoint)
{
Float3 up = Normalize(Cross(positiveX, lightDirection));
Float3 adjustedRight = Normalize(cross(lightDirection, up));
return MakeCameraToWorld(lightDirection, up, adjustedRight, focusPoint);
}
static std::pair<std::optional<IOrthoShadowProjections::OrthoSubProjection>, float> CalculateNextFrustum_UnfilledSpace(
const RenderCore::Techniques::ProjectionDesc& mainSceneProjectionDesc,
const Float3* absFrustumCorners,
const Float4x4& lightViewToWorld,
const IOrthoShadowProjections::OrthoSubProjection& prev,
const Float4& cameraMiniProj,
const float maxProjectionDimsZ,
float depthRangeCovered,
ClipSpaceType clipSpaceType)
{
// Calculate the next frustum for a set of cascades, based on unfilled space
// Find the nearest part of the view frustum that is not included in the previous ortho projection
// & use that to position the new projection starting from that point
auto closestUncoveredPart = NearestPointNotInsideOrthoProjection(
mainSceneProjectionDesc._worldToProjection, absFrustumCorners,
lightViewToWorld,
prev, depthRangeCovered, clipSpaceType);
if (!closestUncoveredPart.first.empty()) {
// We want to position the new projection so that the center point is exactly on the camera forward
// ray, and so that "closestUncoveredPart" is (most likely) exactly on one of the planes of the
// ortho box
//
// This will mean that the new projection begins exactly where the old projection ended. However,
// floating point creep here can add up to more than a pixel in screen space, so we need a little
// bit of tolerance added.
//
// So while the first projection can be configured to be off the center ray of the camera, subsequent
// projections always will be.
//
// We have some flexibility over the size of this new frustum -- in theory we could calculate size
// that would attempt to maintain the same screen space pixel to shadowmap texel ratio -- however,
// for more distant parts of the view frustum, visual importance also drops off; so we
//
// let's do this in ortho space, where it's going to be a lot easier
auto newProjectionDimsXY = 3.f * (prev._rightBottomBack[0] - prev._leftTopFront[0]);
auto newProjectionDimsZ = 3.f * (prev._rightBottomBack[2] - prev._leftTopFront[2]);
newProjectionDimsZ = std::min(newProjectionDimsZ, maxProjectionDimsZ);
auto worldToLightView = InvertOrthonormalTransform(lightViewToWorld);
auto camForwardInOrtho = TransformDirectionVector(worldToLightView, ExtractForward_Cam(mainSceneProjectionDesc._cameraToWorld));
auto camPositionInOrtho = TransformPoint(worldToLightView, ExtractTranslation(mainSceneProjectionDesc._cameraToWorld));
Float3 closestUncoveredPartInOrtho = TransformPoint(worldToLightView, closestUncoveredPart.first[0]);
// Allow for a tiny bit of overlap, both to cover for floating point creep errors, and allow the shader
// to cross-fade. 2% of the distance to the start of the projection, up to quarter unit max
float overlap = std::min(Dot(closestUncoveredPartInOrtho, camForwardInOrtho) * 0.02f, 0.25f);
Float3 focusPositionInOrtho = camPositionInOrtho + (Dot(closestUncoveredPartInOrtho, camForwardInOrtho) - overlap + 0.5f * newProjectionDimsXY) * camForwardInOrtho;
IOrthoShadowProjections::OrthoSubProjection result;
result._leftTopFront = Float3 { focusPositionInOrtho[0] - 0.5f * newProjectionDimsXY, focusPositionInOrtho[1] - 0.5f * newProjectionDimsXY, focusPositionInOrtho[2] - 0.5f * newProjectionDimsZ };
result._rightBottomBack = Float3 { focusPositionInOrtho[0] + 0.5f * newProjectionDimsXY, focusPositionInOrtho[1] + 0.5f * newProjectionDimsXY, focusPositionInOrtho[2] + 0.5f * newProjectionDimsZ };
auto minAndMaxDepth = MinAndMaxOrthoSpaceZ(mainSceneProjectionDesc._worldToProjection, absFrustumCorners, lightViewToWorld, Truncate(result._leftTopFront), Truncate(result._rightBottomBack), cameraMiniProj, closestUncoveredPart.second, clipSpaceType);
if (minAndMaxDepth[0] > minAndMaxDepth[1])
return {{}, closestUncoveredPart.second};
bool entireViewFrustumCovered = (minAndMaxDepth[1] - newProjectionDimsZ) < minAndMaxDepth[0];
if (!entireViewFrustumCovered) {
if (TransformDirectionVector(worldToLightView, ExtractForward_Cam(mainSceneProjectionDesc._cameraToWorld))[2] > 0) {
// This is a little awkward because of the way -Z in camera space is forward; we have to be very careful of polarity in all these equations
result._leftTopFront[2] = minAndMaxDepth[0];
result._rightBottomBack[2] = minAndMaxDepth[0] + newProjectionDimsZ;
} else {
result._leftTopFront[2] = minAndMaxDepth[1] - newProjectionDimsZ;
result._rightBottomBack[2] = minAndMaxDepth[1];
}
} else {
result._leftTopFront[2] = minAndMaxDepth[1] - newProjectionDimsZ;
result._rightBottomBack[2] = minAndMaxDepth[1];
}
assert(result._leftTopFront[2] < result._rightBottomBack[2]);
return {result, closestUncoveredPart.second};
}
return {{}, depthRangeCovered};
}
static Float2 s_normalizedScreenResolution(1920, 1080);
static unsigned ShadowMapDepthResolution(SunSourceFrustumSettings::Flags::BitField flags)
{
if (flags & SunSourceFrustumSettings::Flags::HighPrecisionDepths) {
return (1 << 23) - 1; // high precision depths are a little awkward because it's floating point. But let's just use the size of the mantissa as an underestimate here
} else
return (1 << 16) - 1;
}
static OrthoProjections BuildResolutionNormalizedOrthogonalShadowProjections(
const Float3& negativeLightDirection,
const RenderCore::Techniques::ProjectionDesc& mainSceneProjectionDescInit,
const SunSourceFrustumSettings& settings,
ClipSpaceType clipSpaceType)
{
// settings._resolutionScale is approximately the number of on-screen pixels per shadow map pixel
// in each dimension (ie 2 means a shadow map pixel should cover about a 2x2 on screen pixel area)
// However, we don't adjust the base resolution with the viewport to avoid moving the shadow
// distance back and forth with render resolution changes
const Float2 normalizedScreenResolution = s_normalizedScreenResolution / settings._resolutionScale;
const unsigned shadowMapResolution = settings._textureSize;
auto shadowMapDepthResolution = ShadowMapDepthResolution(settings._flags);
// We remove the camera position from the projection desc, because it's not actually important for
// the calculations, and would just add floating point precision problems. Instead, let's do the
// calculations as if the camera is at the origin, and then translate the results back to the
// camera position at the end
auto mainSceneProjectionDesc = mainSceneProjectionDescInit;
Float3 extractedCameraPos = ExtractTranslation(mainSceneProjectionDesc._cameraToWorld);
SetTranslation(mainSceneProjectionDesc._cameraToWorld, Float3{0.f, 0.f, 0.f});
// Also limit the far clip plane by the _maxDistanceFromCamera setting -- this allows us to set
// a limit on how far in the distance the shadows go
{
auto mainSceneNearAndFar = CalculateNearAndFarPlane(ExtractMinimalProjection(mainSceneProjectionDesc._cameraToProjection), clipSpaceType);
if (mainSceneNearAndFar.second > settings._maxDistanceFromCamera)
ChangeFarClipPlane(mainSceneProjectionDesc._cameraToProjection, settings._maxDistanceFromCamera, clipSpaceType);
}
mainSceneProjectionDesc._worldToProjection =
Combine(InvertOrthonormalTransform(mainSceneProjectionDesc._cameraToWorld), mainSceneProjectionDesc._cameraToProjection);
Float3 cameraForward = ExtractForward_Cam(mainSceneProjectionDesc._cameraToWorld);
Float3 focusPoint = settings._focusDistance * ExtractForward_Cam(mainSceneProjectionDesc._cameraToWorld);
assert(!IsOrthogonalProjection(mainSceneProjectionDesc._cameraToProjection));
auto cameraMiniProj = ExtractMinimalProjection(mainSceneProjectionDesc._cameraToProjection);
// Limit the depth of the shadow projection to some reasonable fixed value. If we allow it to
// get too large, we will get end up with a lot of floating point precision issues when building
// the frustum
// This will have an impact on the correct shadow bias values, etc, though
const float maxProjectionDimsZ = 1.5f * CalculateNearAndFarPlane(cameraMiniProj, clipSpaceType).second;
// find the dimensions in view space for the focus point
auto worldToMainCamera = InvertOrthonormalTransform(mainSceneProjectionDesc._cameraToWorld);
auto viewSpaceFocusPoint = TransformPoint(worldToMainCamera, focusPoint);
auto clipSpaceFocus = mainSceneProjectionDesc._cameraToProjection * Expand(viewSpaceFocusPoint, 1.0f);
float w = clipSpaceFocus[3];
float viewSpaceDimsX = 1.0f / float(normalizedScreenResolution[0]) * 2.0f * w / mainSceneProjectionDesc._cameraToProjection(0,0);
float viewSpaceDimsY = 1.0f / float(normalizedScreenResolution[1]) * 2.0f * w / mainSceneProjectionDesc._cameraToProjection(1,1);
// choose the minimum absolute value so ultra widescreen isn't disadvantaged
float viewSpacePixelDims = std::min(std::abs(viewSpaceDimsX), std::abs(viewSpaceDimsY));
// We want to project the first frustum so that one shadow map texel maps roughly onto one screen pixel
// (also, we want to keep the depth precision roughly inline with X & Y precision, so this will also impact
// the depth range for the shadow projection)
float projectionDimsXY = viewSpacePixelDims * shadowMapResolution;
float projectionDimsZ = viewSpacePixelDims * shadowMapDepthResolution;
projectionDimsZ = std::min(maxProjectionDimsZ, projectionDimsZ);
Float3 shadowAcross = ExtractForward_Cam(mainSceneProjectionDesc._cameraToWorld);
auto lightViewToWorld = MakeOrientedShadowViewToWorld(-negativeLightDirection, shadowAcross, Float3{0.f, 0.f, 0.f});
auto worldToLightView = InvertOrthonormalTransform(lightViewToWorld);
// The first projection must include the near plane of the camera, as well as the focus point
Float3 nearPlaneLightViewMins { FLT_MAX, FLT_MAX, FLT_MAX }, nearPlaneLightViewMaxs { -FLT_MAX, -FLT_MAX, -FLT_MAX };
Float3 focusLightView = TransformPoint(worldToLightView, focusPoint);
Float3 absFrustumCorners[8];
CalculateAbsFrustumCorners(absFrustumCorners, mainSceneProjectionDesc._worldToProjection, clipSpaceType);
for (unsigned c=0; c<4; ++c) {
auto lightView = TransformPoint(worldToLightView, absFrustumCorners[c]);
nearPlaneLightViewMins[0] = std::min(nearPlaneLightViewMins[0], lightView[0]);
nearPlaneLightViewMins[1] = std::min(nearPlaneLightViewMins[1], lightView[1]);
nearPlaneLightViewMins[2] = std::min(nearPlaneLightViewMins[2], lightView[2]);
nearPlaneLightViewMaxs[0] = std::max(nearPlaneLightViewMaxs[0], lightView[0]);
nearPlaneLightViewMaxs[1] = std::max(nearPlaneLightViewMaxs[1], lightView[1]);
nearPlaneLightViewMaxs[2] = std::max(nearPlaneLightViewMaxs[2], lightView[2]);
}
IOrthoShadowProjections::OrthoSubProjection firstSubProjection;
auto camForwardInOrtho = TransformDirectionVector(worldToLightView, ExtractForward_Cam(mainSceneProjectionDesc._cameraToWorld));
Float3 centerProjectOrtho = 0.5f * projectionDimsXY * camForwardInOrtho;
firstSubProjection._leftTopFront[0] = centerProjectOrtho[0] - 0.5f * projectionDimsXY;
firstSubProjection._rightBottomBack[0] = centerProjectOrtho[0] + 0.5f * projectionDimsXY;
firstSubProjection._leftTopFront[1] = centerProjectOrtho[1] - 0.5f * projectionDimsXY;
firstSubProjection._rightBottomBack[1] = centerProjectOrtho[1] + 0.5f * projectionDimsXY;
float depthRangeClosest;
#if !defined(USE_W_FOR_DEPTH_RANGE_COVERED)
if (clipSpaceType == ClipSpaceType::Positive_ReverseZ || clipSpaceType == ClipSpaceType::PositiveRightHanded_ReverseZ) {
float n, f;
std::tie(n,f) = CalculateNearAndFarPlane(cameraMiniProj, clipSpaceType);
depthRangeClosest = (n*n-(n*f)) / (n-f);
} else {
depthRangeClosest = 0.f;
}
#else
depthRangeClosest = 0.f;
#endif
// We're assuming that geometry closer to the light than the view frustum will be clamped
// to zero depth here -- so the shadow projection doesn't need to extend all the way to
// the light
// Most of the time we want the largest Z value to be sitting right on the edge of the view frustum
// and then extend the frustum as far negative as the precision depth allows (recalling that -Z is
// forward in view space). However, if the camera is facing directly into the light (ie, they are in
// opposite directions), that will pin the shadow projection to the far clip and it's possible that
// the shadow frustum won't reach all of the way to the camera. In that case, we pin the positive side
// of the shadow frustum to the view and extend backwards
auto minAndMaxDepth = MinAndMaxOrthoSpaceZ(mainSceneProjectionDesc._worldToProjection, absFrustumCorners, lightViewToWorld, Truncate(firstSubProjection._leftTopFront), Truncate(firstSubProjection._rightBottomBack), cameraMiniProj, depthRangeClosest, clipSpaceType);
assert(projectionDimsZ > 0);
bool entireViewFrustumCovered = (minAndMaxDepth[1] - projectionDimsZ) < minAndMaxDepth[0];
if (!entireViewFrustumCovered) {
if (TransformDirectionVector(worldToLightView, cameraForward)[2] > 0) {
// This is a little awkward because of the way -Z in camera space is forward; we have to be very careful of polarity in all these equations
firstSubProjection._leftTopFront[2] = minAndMaxDepth[0];
firstSubProjection._rightBottomBack[2] = minAndMaxDepth[0] + projectionDimsZ;
} else {
firstSubProjection._leftTopFront[2] = minAndMaxDepth[1] - projectionDimsZ;
firstSubProjection._rightBottomBack[2] = minAndMaxDepth[1];
}
} else {
firstSubProjection._leftTopFront[2] = minAndMaxDepth[1] - projectionDimsZ;
firstSubProjection._rightBottomBack[2] = minAndMaxDepth[1];
}
assert(firstSubProjection._leftTopFront[2] < firstSubProjection._rightBottomBack[2]);
OrthoProjections result;
result._worldToView = worldToLightView;
Combine_IntoRHS(-extractedCameraPos, result._worldToView); // note -- camera position added back here
result._normalProjCount = 1;
result._orthSubProjections[0] = firstSubProjection;
float depthRangeCovered = depthRangeClosest;
while (result._normalProjCount < settings._maxFrustumCount) {
auto next = CalculateNextFrustum_UnfilledSpace(mainSceneProjectionDesc, absFrustumCorners, lightViewToWorld, result._orthSubProjections[result._normalProjCount-1], cameraMiniProj, maxProjectionDimsZ, depthRangeCovered, clipSpaceType);
if (!next.first.has_value()) break;
// Log(Debug) << "DepthRangeCovered: " << depthRangeCovered << std::endl;
result._orthSubProjections[result._normalProjCount] = next.first.value();
++result._normalProjCount;
depthRangeCovered = next.second;
}
for (unsigned c=0; c<result._normalProjCount; ++c) {
std::swap(result._orthSubProjections[c]._leftTopFront[1], result._orthSubProjections[c]._rightBottomBack[1]);
result._orthSubProjections[c]._leftTopFront[2] = -result._orthSubProjections[c]._leftTopFront[2];
result._orthSubProjections[c]._rightBottomBack[2] = -result._orthSubProjections[c]._rightBottomBack[2];
std::swap(result._orthSubProjections[c]._leftTopFront[2], result._orthSubProjections[c]._rightBottomBack[2]);
}
/*
We can calculate how much of the view frustum has been filled, by calling:
auto nearest = NearestPointNotInsideOrthoProjection(
mainSceneProjectionDesc._worldToProjection, absFrustumCorners,
lightViewToWorld, result._orthSubProjections[result._normalProjCount-1],
depthRangeCovered);
if nearest.first.empty(), then the entire view frustum is filled. Otherwise
nearest.second is the deepest Z in clip space for which the entire XY plane
is filled (though shadows may actually go deaper in some parts of the plane)
*/
result._limitedMainCameraToProjection = mainSceneProjectionDesc._cameraToProjection;
return result;
}
namespace Internal
{
std::pair<std::vector<IOrthoShadowProjections::OrthoSubProjection>, Float4x4> TestResolutionNormalizedOrthogonalShadowProjections(
const Float3& negativeLightDirection,
const RenderCore::Techniques::ProjectionDesc& mainSceneProjectionDesc,
const SunSourceFrustumSettings& settings,
ClipSpaceType clipSpaceType)
{
auto midway = BuildResolutionNormalizedOrthogonalShadowProjections(negativeLightDirection, mainSceneProjectionDesc, settings, clipSpaceType);
return {
{midway._orthSubProjections, &midway._orthSubProjections[midway._normalProjCount]},
midway._worldToView};
}
}
ShadowOperatorDesc CalculateShadowOperatorDesc(const SunSourceFrustumSettings& settings)
{
ShadowOperatorDesc result;
result._dominantLight = true;
result._width = settings._textureSize;
result._height = settings._textureSize;
if (settings._flags & SunSourceFrustumSettings::Flags::HighPrecisionDepths) {
// note -- currently having problems in Vulkan with reading from the D24_UNORM_XX format
// might be better to move to 32 bit format now, anyway
result._format = RenderCore::Format::D32_FLOAT;
} else {
result._format = RenderCore::Format::D16_UNORM;
}
if (settings._flags & SunSourceFrustumSettings::Flags::ArbitraryCascades) {
result._normalProjCount = 5;
result._enableNearCascade = false;
result._projectionMode = ShadowProjectionMode::Arbitrary;
} else {
result._normalProjCount = settings._maxFrustumCount;
// result._enableNearCascade = true;
result._projectionMode = ShadowProjectionMode::Ortho;
}
if (settings._flags & SunSourceFrustumSettings::Flags::RayTraced) {
result._resolveType = ShadowResolveType::RayTraced;
} else {
result._resolveType = ShadowResolveType::DepthTexture;
}
if (settings._flags & SunSourceFrustumSettings::Flags::CullFrontFaces) {
result._cullMode = RenderCore::CullMode::Front;
} else {
result._cullMode = RenderCore::CullMode::Back;
}
// We need to know the approximate height in world space units for the first
// projection. This is an approximation of projectionDimsXY in BuildResolutionNormalizedOrthogonalShadowProjections
// Imagine we're looking straight on at a plane in front of the camera, and the is behind and pointing in the
// same direction as the camera.
const Float2 normalizedScreenResolution = s_normalizedScreenResolution / settings._resolutionScale;
const unsigned shadowMapResolution = settings._textureSize;
const float h = XlTan(.5f * settings._expectedVerticalFOV);
float wsFrustumHeight = settings._focusDistance * h * settings._textureSize / s_normalizedScreenResolution[1];
auto shadowMapDepthResolution = ShadowMapDepthResolution(settings._flags);
float projectionDimsXY = wsFrustumHeight;
float projectionDimsZ = wsFrustumHeight * shadowMapDepthResolution / settings._textureSize; // this has an upper range, maxProjectionDimsZ, above -- but it's harder to estimate
// We calculate the radius in world space of the blurring kernel, and compare this to the difference
// in world space between 2 adjacent depth values possible in the depth buffer. Since we're using
// an orthogonal projection, the depth values are equally spaced throughout the entire range.
// From this, we can estimate how much bias we'll need to avoid acne with the given blur range
// A base sloped scaled bias value of 0.5 is often enough to handle cases where there is no blur kernel
// Generally we should have an excess of depth resolution, even without HighPrecisionDepths, when using
// cascades -- since the first cascade tends to end up pretty tightly arranged just in front of the camera
const float wsDepthResolution = projectionDimsZ / float(shadowMapDepthResolution);
const float wsXYRange = settings._maxBlurSearch * wsFrustumHeight / settings._textureSize;
const float ratio0 = wsXYRange / wsDepthResolution;
const float ratio1 = std::sqrt(wsXYRange*wsXYRange + wsXYRange*wsXYRange) / wsDepthResolution;
result._singleSidedBias._depthBias = result._doubleSidedBias._depthBias = (int)-settings._baseBias * std::ceil(ratio1); // note -- negative for ReverseZ modes
result._singleSidedBias._depthBiasClamp = result._doubleSidedBias._depthBiasClamp = 0.f;
result._singleSidedBias._slopeScaledBias = result._doubleSidedBias._slopeScaledBias = settings._slopeScaledBias;
result._filterModel = settings._filterModel;
result._enableContactHardening = settings._enableContactHardening;
result._cullMode = settings._cullMode;
return result;
}
class SunSourceFrustumDriver : public Internal::IShadowProjectionDriver, public ISunSourceShadows, public Internal::ILightBase
{
public:
virtual std::shared_ptr<XLEMath::ArbitraryConvexVolumeTester> UpdateProjections(
const Techniques::ParsingContext& parsingContext,
IPositionalLightSource& lightSource,
IOrthoShadowProjections& destination) override
{
auto mainSceneProjectionDesc = parsingContext.GetProjectionDesc();
if (_fixedCamera)
mainSceneProjectionDesc = _fixedCamera.value();
auto negativeLightDirection = Normalize(ExtractTranslation(lightSource.GetLocalToWorld()));
assert(!(_settings._flags & SunSourceFrustumSettings::Flags::ArbitraryCascades));
auto clipSpaceType = RenderCore::Techniques::GetDefaultClipSpaceType();
auto t = BuildResolutionNormalizedOrthogonalShadowProjections(negativeLightDirection, mainSceneProjectionDesc, _settings, clipSpaceType);
assert(t._normalProjCount);
destination.SetOrthoSubProjections(MakeIteratorRange(t._orthSubProjections, &t._orthSubProjections[t._normalProjCount]));
destination.SetWorldToOrthoView(t._worldToView);
// Generate a clipping volume by extruding the camera frustum along the light direction
// Here, we're assuming that the cascades will fill t._limitedMainCameraToProjection entirely
// Which means the correct culling is to look for objects that can cast a shadow into
// that frustum.
auto eyePosition = ExtractTranslation(mainSceneProjectionDesc._cameraToWorld);
auto cameraToWorldNoTranslation = mainSceneProjectionDesc._cameraToWorld;
SetTranslation(cameraToWorldNoTranslation, Float3(0,0,0));
auto worldToLimitedProj = Combine(InvertOrthonormalTransform(cameraToWorldNoTranslation), t._limitedMainCameraToProjection);
auto extrudedFrustum = ExtrudeFrustumOrthogonally(worldToLimitedProj, eyePosition, negativeLightDirection, _settings._maxDistanceFromCamera, clipSpaceType);
return std::make_shared<XLEMath::ArbitraryConvexVolumeTester>(std::move(extrudedFrustum));
}
SunSourceFrustumSettings GetSettings() const override
{
return _settings;
}
void SetSettings(const SunSourceFrustumSettings&) override
{
assert(0); // not yet implemennted
}
void FixMainSceneCamera(const Techniques::ProjectionDesc& projDesc) override
{
_fixedCamera = projDesc;
}
void UnfixMainSceneCamera() override
{
_fixedCamera = {};
}
virtual void* QueryInterface(uint64_t interfaceTypeCode) override
{
if (interfaceTypeCode == typeid(Internal::IShadowProjectionDriver).hash_code()) {
return (Internal::IShadowProjectionDriver*)this;
} else if (interfaceTypeCode == typeid(ISunSourceShadows).hash_code()) {
return (ISunSourceShadows*)this;
}
return nullptr;
}
SunSourceFrustumDriver(const SunSourceFrustumSettings& settings) : _settings(settings) {}
private:
SunSourceFrustumSettings _settings;
std::optional<Techniques::ProjectionDesc> _fixedCamera;
};
static void ApplyNonFrustumSettings(
ILightScene& lightScene,
ILightScene::ShadowProjectionId shadowProjectionId,
const SunSourceFrustumSettings& settings)
{
auto* preparer = lightScene.TryGetShadowProjectionInterface<IDepthTextureResolve>(shadowProjectionId);
if (preparer) {
IDepthTextureResolve::Desc desc;
desc._worldSpaceResolveBias = settings._worldSpaceResolveBias;
desc._tanBlurAngle = settings._tanBlurAngle;
desc._minBlurSearch = settings._minBlurSearch;
desc._maxBlurSearch = settings._maxBlurSearch;
desc._casterDistanceExtraBias = settings._casterDistanceExtraBias;
preparer->SetDesc(desc);
}
}
ILightScene::ShadowProjectionId CreateSunSourceShadows(
ILightScene& lightScene,
ILightScene::ShadowOperatorId shadowOperatorId,
ILightScene::LightSourceId associatedLightId,
const SunSourceFrustumSettings& settings)
{
auto shadowProjectionId = lightScene.CreateShadowProjection(shadowOperatorId, associatedLightId);
ApplyNonFrustumSettings(lightScene, shadowProjectionId, settings);
auto* attachDriver = lightScene.TryGetShadowProjectionInterface<Internal::IAttachDriver>(shadowProjectionId);
if (attachDriver) {
attachDriver->AttachDriver(
std::make_shared<SunSourceFrustumDriver>(settings));
} else {
assert(0);
}
/*result._shadowGeneratorDesc = CalculateShadowGeneratorDesc(settings);
assert(result._shadowGeneratorDesc._enableNearCascade == result._projections._useNearProj);
assert(result._shadowGeneratorDesc._arrayCount == result._projections.Count());
assert(result._shadowGeneratorDesc._projectionMode == result._projections._mode);
return result;*/
return shadowProjectionId;
}
void ConfigureShadowProjectionImmediately(
ILightScene& lightScene,
ILightScene::ShadowProjectionId shadowProjectionId,
ILightScene::LightSourceId associatedLightId,
const SunSourceFrustumSettings& settings,
const Techniques::ProjectionDesc& mainSceneProjectionDesc)
{
auto* positionalLightSource = lightScene.TryGetLightSourceInterface<IPositionalLightSource>(associatedLightId);
if (!positionalLightSource)
Throw(std::runtime_error("Could not find positional light source information in CreateShadowCascades for a sun light source"));
auto negativeLightDirection = Normalize(ExtractTranslation(positionalLightSource->GetLocalToWorld()));
assert(!(settings._flags & SunSourceFrustumSettings::Flags::ArbitraryCascades));
auto t = BuildResolutionNormalizedOrthogonalShadowProjections(negativeLightDirection, mainSceneProjectionDesc, settings, RenderCore::Techniques::GetDefaultClipSpaceType());
assert(t._normalProjCount);
auto* cascades = lightScene.TryGetShadowProjectionInterface<IOrthoShadowProjections>(shadowProjectionId);
if (cascades) {
cascades->SetOrthoSubProjections(
MakeIteratorRange(t._orthSubProjections, &t._orthSubProjections[t._normalProjCount]));
cascades->SetWorldToOrthoView(t._worldToView);
}
ApplyNonFrustumSettings(lightScene, shadowProjectionId, settings);
}
SunSourceFrustumSettings::SunSourceFrustumSettings()
{
_maxFrustumCount = 5;
_maxDistanceFromCamera = 500.f;
_frustumSizeFactor = 3.8f;
_focusDistance = 3.f;
_resolutionScale = 1.f;
_flags = Flags::HighPrecisionDepths;
_textureSize = 2048;
_expectedVerticalFOV = Deg2Rad(34.8246f);
_worldSpaceResolveBias = 0.025f; // this is world space, so always positive, ReverseZ doesn't matter
_casterDistanceExtraBias = -0.001f; // note that this should be negative for ReverseZ modes, but positive for non-ReverseZ modes
_slopeScaledBias = -0.5f; // also should be native for ReverseZ modes
_baseBias = 1.f; // this multiples the calculated base bias values, so should be positive
_tanBlurAngle = 0.00436f;
_minBlurSearch = 0.5f;
_maxBlurSearch = 25.f;
_filterModel = ShadowFilterModel::PoissonDisc;
_enableContactHardening = false;
_cullMode = CullMode::Back;
}
}}
#include "../Utility/Meta/ClassAccessors.h"
#include "../Utility/Meta/ClassAccessorsImpl.h"
template<> const ClassAccessors& Legacy_GetAccessors<RenderCore::LightingEngine::SunSourceFrustumSettings>()
{
using Obj = RenderCore::LightingEngine::SunSourceFrustumSettings;
static ClassAccessors props(typeid(Obj).hash_code());
static bool init = false;
if (!init) {
props.Add("MaxCascadeCount",
[](const Obj& obj) { return obj._maxFrustumCount; },
[](Obj& obj, unsigned value) { obj._maxFrustumCount = Clamp(value, 1u, RenderCore::LightingEngine::s_staticMaxSubProjections); });
props.Add("MaxDistanceFromCamera", &Obj:: _maxDistanceFromCamera);
props.Add("FrustumSizeFactor", &Obj::_frustumSizeFactor);
props.Add("FocusDistance", &Obj::_focusDistance);
props.Add("ResolutionScale", &Obj::_resolutionScale);
props.Add("Flags", &Obj::_flags);
props.Add("TextureSize",
[](const Obj& obj) { return obj._textureSize; },
[](Obj& obj, unsigned value) { obj._textureSize = 1<<(IntegerLog2(value-1)+1); }); // ceil to a power of two
props.Add("BlurAngleDegrees",
[](const Obj& obj) { return Rad2Deg(XlATan(obj._tanBlurAngle)); },
[](Obj& obj, float value) { obj._tanBlurAngle = XlTan(Deg2Rad(value)); } );
props.Add("MinBlurSearch", &Obj::_minBlurSearch);
props.Add("MaxBlurSearch", &Obj::_maxBlurSearch);
props.Add("HighPrecisionDepths",
[](const Obj& obj) { return !!(obj._flags & Obj::Flags::HighPrecisionDepths); },
[](Obj& obj, bool value) {
if (value) obj._flags |= Obj::Flags::HighPrecisionDepths;
else obj._flags &= ~Obj::Flags::HighPrecisionDepths;
});
props.Add("CasterDistanceExtraBias", &Obj::_casterDistanceExtraBias);
props.Add("WorldSpaceResolveBias", &Obj::_worldSpaceResolveBias);
props.Add("SlopeScaledBias", &Obj::_slopeScaledBias);
props.Add("BaseBias", &Obj::_baseBias);
props.Add("EnableContactHardening", &Obj::_enableContactHardening);
AddStringToEnum<RenderCore::LightingEngine::ShadowFilterModel, RenderCore::LightingEngine::AsString, RenderCore::LightingEngine::AsShadowFilterModel>(props, "FilterModel", &Obj::_filterModel);
AddStringToEnum<RenderCore::CullMode, RenderCore::AsString, RenderCore::AsCullMode>(props, "CullMode", &Obj::_cullMode);
init = true;
}
return props;
}
| 55.518152 | 273 | 0.64918 | djewsbury |
6ca0c40ea75d9eb9f0aa57c35c1debc98de28fc0 | 236 | cpp | C++ | hexmap_qt/hexmap_widgets/layers_widget.cpp | mflagel/asdf_multiplat | 9ef5a87b9ea9e38a7c6d409a60a1b8c5dce4b015 | [
"MIT"
] | null | null | null | hexmap_qt/hexmap_widgets/layers_widget.cpp | mflagel/asdf_multiplat | 9ef5a87b9ea9e38a7c6d409a60a1b8c5dce4b015 | [
"MIT"
] | null | null | null | hexmap_qt/hexmap_widgets/layers_widget.cpp | mflagel/asdf_multiplat | 9ef5a87b9ea9e38a7c6d409a60a1b8c5dce4b015 | [
"MIT"
] | null | null | null | #include "layers_widget.h"
#include "ui_layers_widget.h"
layers_widget::layers_widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::layers_widget)
{
ui->setupUi(this);
}
layers_widget::~layers_widget()
{
delete ui;
}
| 15.733333 | 47 | 0.694915 | mflagel |
6ca0f22618c23c604f397957a568e303ea6debd9 | 1,313 | cc | C++ | examples/cube/shader.cc | cristiandonosoc/rothko | 0d488e10cc3b4150f638da9cf6711e66ba19b1c5 | [
"MIT",
"BSL-1.0",
"BSD-4-Clause",
"Unlicense"
] | 5 | 2019-05-26T00:04:06.000Z | 2020-12-28T19:20:12.000Z | examples/cube/shader.cc | cristiandonosoc/rothko | 0d488e10cc3b4150f638da9cf6711e66ba19b1c5 | [
"MIT",
"BSL-1.0",
"BSD-4-Clause",
"Unlicense"
] | null | null | null | examples/cube/shader.cc | cristiandonosoc/rothko | 0d488e10cc3b4150f638da9cf6711e66ba19b1c5 | [
"MIT",
"BSL-1.0",
"BSD-4-Clause",
"Unlicense"
] | 1 | 2019-06-02T19:35:59.000Z | 2019-06-02T19:35:59.000Z | // Copyright 2019, Cristián Donoso.
// This code has a BSD license. See LICENSE.
#include "shader.h"
#include <rothko/graphics/renderer.h>
#include <rothko/graphics/shader.h>
using namespace rothko;
namespace {
constexpr char kVertexShader[] = R"(
layout (location = 0) in vec3 in_pos;
layout (location = 1) in vec2 in_uv;
layout (location = 2) in vec4 in_color;
out vec2 f_uv;
out vec4 f_color;
layout (std140) uniform Uniforms {
mat4 model;
};
void main() {
gl_Position = camera_proj * camera_view * model * vec4(in_pos, 1.0);
f_uv = in_uv;
f_color = in_color;
}
)";
constexpr char kFragmentShader[] = R"(
in vec2 f_uv;
in vec4 f_color;
layout (location = 0) out vec4 out_color;
uniform sampler2D tex0;
uniform sampler2D tex1;
void main() {
out_color = mix(texture(tex0, f_uv), texture(tex1, f_uv), 0.5f) * f_color;
}
)";
} // namespace
std::unique_ptr<Shader> CreateShader(Renderer* renderer) {
ShaderConfig config = {};
config.name = "cube-shader";
config.vertex_type = VertexType::k3dUVColor;
config.ubos[0].name = "Uniforms";
config.ubos[0].size = sizeof(UBO);
config.texture_count = 2;
auto vert_src = CreateVertexSource(kVertexShader);
auto frag_src = CreateFragmentSource(kFragmentShader);
return RendererStageShader(renderer, config, vert_src, frag_src);
}
| 21.177419 | 76 | 0.714395 | cristiandonosoc |
6ca180b6b8021c8ae97a451a9e5e3b0b9c7135cf | 3,132 | cpp | C++ | aws-cpp-sdk-discovery/source/model/ConfigurationItemType.cpp | ploki/aws-sdk-cpp | 17074e3e48c7411f81294e2ee9b1550c4dde842c | [
"Apache-2.0"
] | 1 | 2020-07-16T19:03:13.000Z | 2020-07-16T19:03:13.000Z | aws-cpp-sdk-discovery/source/model/ConfigurationItemType.cpp | ploki/aws-sdk-cpp | 17074e3e48c7411f81294e2ee9b1550c4dde842c | [
"Apache-2.0"
] | 18 | 2018-05-15T16:41:07.000Z | 2018-05-21T00:46:30.000Z | aws-cpp-sdk-discovery/source/model/ConfigurationItemType.cpp | ploki/aws-sdk-cpp | 17074e3e48c7411f81294e2ee9b1550c4dde842c | [
"Apache-2.0"
] | 1 | 2021-10-01T15:29:44.000Z | 2021-10-01T15:29:44.000Z | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#include <aws/discovery/model/ConfigurationItemType.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace ApplicationDiscoveryService
{
namespace Model
{
namespace ConfigurationItemTypeMapper
{
static const int SERVER_HASH = HashingUtils::HashString("SERVER");
static const int PROCESS_HASH = HashingUtils::HashString("PROCESS");
static const int CONNECTION_HASH = HashingUtils::HashString("CONNECTION");
static const int APPLICATION_HASH = HashingUtils::HashString("APPLICATION");
ConfigurationItemType GetConfigurationItemTypeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == SERVER_HASH)
{
return ConfigurationItemType::SERVER;
}
else if (hashCode == PROCESS_HASH)
{
return ConfigurationItemType::PROCESS;
}
else if (hashCode == CONNECTION_HASH)
{
return ConfigurationItemType::CONNECTION;
}
else if (hashCode == APPLICATION_HASH)
{
return ConfigurationItemType::APPLICATION;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ConfigurationItemType>(hashCode);
}
return ConfigurationItemType::NOT_SET;
}
Aws::String GetNameForConfigurationItemType(ConfigurationItemType enumValue)
{
switch(enumValue)
{
case ConfigurationItemType::SERVER:
return "SERVER";
case ConfigurationItemType::PROCESS:
return "PROCESS";
case ConfigurationItemType::CONNECTION:
return "CONNECTION";
case ConfigurationItemType::APPLICATION:
return "APPLICATION";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return "";
}
}
} // namespace ConfigurationItemTypeMapper
} // namespace Model
} // namespace ApplicationDiscoveryService
} // namespace Aws
| 32.968421 | 92 | 0.650383 | ploki |
6ca1cbca5195b189848190e63ff5b7e93c5e443a | 3,044 | hxx | C++ | admin/select/src/lookindlg.hxx | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | admin/select/src/lookindlg.hxx | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | admin/select/src/lookindlg.hxx | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | //+--------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1994 - 1998.
//
// File: LookInDlg.hxx
//
// Contents: Definition of class to display a dialog representing the
// scope hierarchy contained in an instance of the
// CScopeManager class.
//
// Classes: CLookInDlg
//
// History: 01-31-2000 davidmun Created
//
//---------------------------------------------------------------------------
#ifndef __LOOK_IN_DLG_HXX_
#define __LOOK_IN_DLG_HXX_
//+--------------------------------------------------------------------------
//
// Class: CLookInDlg
//
// Purpose: Drive the dialog which allows the user to pick where to
// query for objects.
//
// History: 06-22-2000 DavidMun Created
//
//---------------------------------------------------------------------------
class CLookInDlg: public CDlg
{
public:
CLookInDlg(
const CObjectPicker &rop):
m_rop(rop),
m_hImageList(NULL),
m_htiStartingScope(NULL),
m_cxMin(0),
m_cyMin(0),
m_cxSeparation(0),
m_cySeparation(0),
m_cxFrameLast(0),
m_cyFrameLast(0)
{
TRACE_CONSTRUCTOR(CLookInDlg);
}
~CLookInDlg()
{
TRACE_DESTRUCTOR(CLookInDlg);
if (m_hImageList)
{
ImageList_Destroy(m_hImageList);
m_hImageList = NULL;
}
m_htiStartingScope = NULL;
}
void
DoModal(
HWND hwndParent,
CScope *pCurScope) const;
CScope *
GetSelectedScope() const
{
return m_rpSelectedScope.get();
}
protected:
virtual HRESULT
_OnInit(
BOOL *pfSetFocus);
virtual BOOL
_OnCommand(
WPARAM wParam,
LPARAM lParam);
virtual BOOL
_OnNotify(
WPARAM wParam,
LPARAM lParam);
virtual void
_OnHelp(
UINT message,
WPARAM wParam,
LPARAM lParam);
virtual void
_OnSysColorChange();
void
_AddScopes(
HTREEITEM hRoot,
vector<RpScope>::const_iterator itBegin,
vector<RpScope>::const_iterator itEnd);
virtual BOOL
_OnSize(
WPARAM wParam,
LPARAM lParam);
virtual BOOL
_OnMinMaxInfo(
LPMINMAXINFO lpmmi);
private:
const CObjectPicker &m_rop;
HIMAGELIST m_hImageList;
HTREEITEM m_htiStartingScope;
mutable RpScope m_rpSelectedScope;
//
// These are used for resizing
//
LONG m_cxMin;
LONG m_cyMin;
LONG m_cxSeparation;
LONG m_cySeparation;
LONG m_cxFrameLast;
LONG m_cyFrameLast;
};
#endif // __LOOK_IN_DLG_HXX_
| 22.382353 | 78 | 0.477661 | npocmaka |
6ca44e702932fe6856b48abbf58f0668a4ede6f5 | 1,445 | cpp | C++ | willow/src/popx/op/castx.cpp | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 61 | 2020-07-06T17:11:46.000Z | 2022-03-12T14:42:51.000Z | willow/src/popx/op/castx.cpp | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 1 | 2021-02-25T01:30:29.000Z | 2021-11-09T11:13:14.000Z | willow/src/popx/op/castx.cpp | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 6 | 2020-07-15T12:33:13.000Z | 2021-11-07T06:55:00.000Z | // Copyright (c) 2019 Graphcore Ltd. All rights reserved.
#include <popops/Cast.hpp>
#include <popart/error.hpp>
#include <popart/op/cast.hpp>
#include <popart/popx/devicex.hpp>
#include <popart/popx/op/castx.hpp>
#include <popart/popx/opxmanager.hpp>
namespace popart {
namespace popx {
CastOpx::CastOpx(Op *op, Devicex *devicex) : PopOpx(op, devicex) {
verifyOp<CastOp>(op);
}
void CastOpx::grow(snap::program::Sequence &prog) const {
auto out = popops::cast(graph().getPoplarGraph(),
getInTensor(CastOp::getInIndex()).getPoplarTensor(),
popType(op_p->outInfo(CastOp::getOutIndex())),
prog.getPoplarSequence(),
debugContext());
if (hasInViewChangers(CastOp::getInIndex())) {
setOutViewChangers(CastOp::getOutIndex(),
getInViewChangers(CastOp::getInIndex()));
}
setOutTensor(CastOp::getOutIndex(), snap::Tensor{out, graph()});
}
CastGradOpx::CastGradOpx(Op *op, Devicex *devicex) : CastOpx(op, devicex) {
verifyOp<CastGradOp>(op, Onnx::GradOperators::CastGrad);
}
namespace {
OpxCreator<CastOpx> castOpxCreator({Onnx::Operators::Cast_1,
Onnx::Operators::Cast_6,
Onnx::Operators::Cast_9});
OpxCreator<CastGradOpx> castGradOpxCreator(Onnx::GradOperators::CastGrad);
} // namespace
} // namespace popx
} // namespace popart
| 32.840909 | 78 | 0.635986 | gglin001 |
6ca55b8172df1983bf31dab2fb2ed597fb9e16f7 | 3,015 | cpp | C++ | src/sigevent.cpp | drcforbin/rwte | e1527369fa46c8ae92cd92269d3820c631771a8b | [
"MIT"
] | 9 | 2017-06-25T03:01:04.000Z | 2022-01-01T19:03:26.000Z | src/sigevent.cpp | drcforbin/rwte | e1527369fa46c8ae92cd92269d3820c631771a8b | [
"MIT"
] | null | null | null | src/sigevent.cpp | drcforbin/rwte | e1527369fa46c8ae92cd92269d3820c631771a8b | [
"MIT"
] | 2 | 2019-03-07T21:18:44.000Z | 2019-08-27T08:44:14.000Z | #include "rw/logging.h"
#include "rwte/sigevent.h"
#include <array>
#include <atomic>
#include <cassert>
#include <cstddef>
#include <errno.h>
#include <signal.h>
#include <sys/eventfd.h>
#include <unistd.h>
#define LOGGER() (rw::logging::get("sigevent"))
// todo: clean up all these exposed errors
static std::atomic_uint64_t SIGS_PENDING = 0;
static std::atomic_int SIGNAL_FD = -1;
extern "C" void sig_handler(int sig)
{
SIGS_PENDING.fetch_or(1 << uint64_t(sig), std::memory_order_relaxed);
int fd = SIGNAL_FD.load(std::memory_order_relaxed);
std::array<unsigned char, 8> buf = {1, 0, 0, 0, 0, 0, 0, 0};
// ignoring write result. there's nothing we
// can do here but panic anyway
write(fd, &buf, buf.size());
}
// todo: de-genericify this or move it to librw...we dont need general purpose
void connect_handler(int sig)
{
// we only have space for 64 signals...
if (sig > 64) {
throw SigEventError(fmt::format("requested sig {}, only 64 signals are supported", sig));
}
sigset_t mask;
sigfillset(&mask);
// todo: do we want SA_NOCLDSTOP / SA_NOCLDWAIT when SIGCHLD,
// we're checking on whether it indicates an exit in the tty
struct sigaction sa;
sa.sa_handler = sig_handler;
sa.sa_mask = mask;
if (sigaction(sig, &sa, nullptr) == -1) {
throw SigEventError(fmt::format("unable to register signal {}, ({}): {}",
sig, errno, strerror(errno)));
}
}
SigEventError::SigEventError(const std::string& arg) :
std::runtime_error(arg)
{}
SigEventError::SigEventError(const char* arg) :
std::runtime_error(arg)
{}
SigEventError::~SigEventError()
{}
SigEvent::SigEvent()
{
// todo: ensure singleton by checking on SIGNAL_FD value
int fd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
if (fd != -1) {
LOGGER()->trace("signal fd: {}", fd);
SIGNAL_FD.store(fd, std::memory_order_relaxed);
m_evfd = fd;
} else {
throw SigEventError(fmt::format("unable to create signal fd ({}): {}",
errno, strerror(errno)));
}
}
SigEvent::~SigEvent()
{
if (m_evfd != -1) {
close(m_evfd);
}
}
uint64_t SigEvent::read()
{
// read the eventfd blob. interrupted or wouldblock result
// can be ignored (and we go around again), other errors should
// result in a stop.
std::array<unsigned char, 8> buf;
ssize_t res = ::read(m_evfd, &buf, 8);
if (res == -1) {
if (errno != EINTR && errno != EWOULDBLOCK) {
LOGGER()->fatal("unable to read signal fd {}, ({}): {}",
m_evfd, errno, strerror(errno));
return 0;
}
}
uint64_t current = 0;
for (;;) {
// strong to avoid spurious signals
if (SIGS_PENDING.compare_exchange_strong(
current,
0,
std::memory_order_relaxed,
std::memory_order_relaxed)) {
break;
}
}
return current;
}
| 25.991379 | 97 | 0.6 | drcforbin |
6ca7a614a69203b0a2b9898b8243b576ad16ad4e | 726 | cpp | C++ | Dynamic Programming/integer-knapsack.cpp | chaitanyarahalkar/Algorithms | 27c7f952645afccab12d89c025d69a427c36550f | [
"MIT"
] | 3 | 2021-07-22T12:43:59.000Z | 2021-07-23T16:34:54.000Z | Dynamic Programming/integer-knapsack.cpp | chaitanyarahalkar/Algorithms | 27c7f952645afccab12d89c025d69a427c36550f | [
"MIT"
] | null | null | null | Dynamic Programming/integer-knapsack.cpp | chaitanyarahalkar/Algorithms | 27c7f952645afccab12d89c025d69a427c36550f | [
"MIT"
] | 1 | 2020-05-03T13:56:55.000Z | 2020-05-03T13:56:55.000Z | #include <iostream>
using std::cout;
using std::max;
int integer_knapsack(int capacity,int weights[],int values[],int n){
int table[n+1][capacity+1];
for(int i = 0; i <= n;i++){
for(int w = 0; w <= capacity; w++){
if(i == 0 || w == 0)
table[i][w] = 0;
else if(weights[i-1] <= w)
table[i][w] = max(values[i-1] + table[i-1][w - weights[i-1]],table[i-1][w]);
else
table[i][w] = table[i-1][w];
}
}
return table[n][capacity];
}
int main(void){
int values[] = {60,100,120};
int weights[] = {10,20,30};
int capacity = 50;
int n = sizeof(values)/sizeof(int);
int result = integer_knapsack(capacity,weights,values,n);
cout << "Maximum profit possible is " << result << "\n";
return 0;
} | 19.105263 | 80 | 0.57989 | chaitanyarahalkar |
6ca9045f3755a0df5d5a0703cf04eb202eb500a9 | 11,222 | cc | C++ | src/formats/bddbinary.cc | nerdling/SBSAT | 6328c6aa105b75693d06bf0dae4a3b5ca220318b | [
"Unlicense"
] | 4 | 2015-03-08T07:56:29.000Z | 2017-10-12T04:19:27.000Z | src/formats/bddbinary.cc | nerdling/SBSAT | 6328c6aa105b75693d06bf0dae4a3b5ca220318b | [
"Unlicense"
] | null | null | null | src/formats/bddbinary.cc | nerdling/SBSAT | 6328c6aa105b75693d06bf0dae4a3b5ca220318b | [
"Unlicense"
] | null | null | null |
/* =========FOR INTERNAL USE ONLY. NO DISTRIBUTION PLEASE ========== */
/*********************************************************************
Copyright 1999-2007, University of Cincinnati. All rights reserved.
By using this software the USER indicates that he or she has read,
understood and will comply with the following:
--- University of Cincinnati hereby grants USER nonexclusive permission
to use, copy and/or modify this software for internal, noncommercial,
research purposes only. Any distribution, including commercial sale
or license, of this software, copies of the software, its associated
documentation and/or modifications of either is strictly prohibited
without the prior consent of University of Cincinnati. Title to copyright
to this software and its associated documentation shall at all times
remain with University of Cincinnati. Appropriate copyright notice shall
be placed on all software copies, and a complete copy of this notice
shall be included in all copies of the associated documentation.
No right is granted to use in advertising, publicity or otherwise
any trademark, service mark, or the name of University of Cincinnati.
--- This software and any associated documentation is provided "as is"
UNIVERSITY OF CINCINNATI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS
OR IMPLIED, INCLUDING THOSE OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE, OR THAT USE OF THE SOFTWARE, MODIFICATIONS, OR
ASSOCIATED DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS,
TRADEMARKS OR OTHER INTELLECTUAL PROPERTY RIGHTS OF A THIRD PARTY.
University of Cincinnati shall not be liable under any circumstances for
any direct, indirect, special, incidental, or consequential damages
with respect to any claim by USER or any third party on account of
or arising from the use, or inability to use, this software or its
associated documentation, even if University of Cincinnati has been advised
of the possibility of those damages.
*********************************************************************/
#include "sbsat.h"
#include "sbsat_formats.h"
typedef struct {
void *bddtable_start;
int bddtable_pos;
int num_variables;
int num_functions;
} t_sbsat_env;
void
Binary_to_BDD()
{
FILE *fin = NULL;
t_sbsat_env sbsat_env;
void *_bddtable = NULL;
void *_bddtable_start = NULL;
int _bddtable_len = 0;
void *_equalityvble = NULL;
void *_functions = NULL;
void *_functiontype = NULL;
void *_length = NULL;
void *_variablelist = NULL;
void *_independantVars = NULL;
int _numinp = 0;
int _numout = 0;
char tmp_str[32];
strcpy(tmp_str, "sbsatenv.bin");
cerr << "Reading " << tmp_str << endl;
assert(ite_filesize(tmp_str) == sizeof(t_sbsat_env));
fin = fopen(tmp_str, "rb");
if (!fin) return;
fread(&sbsat_env, sizeof(t_sbsat_env), 1, fin);
fclose(fin);
_numinp = sbsat_env.num_variables;
_numout = sbsat_env.num_functions;
_bddtable_len = sbsat_env.bddtable_pos;
_bddtable_start = sbsat_env.bddtable_start;
strcpy(tmp_str, "bddtable.bin");
cerr << "Reading " << tmp_str << endl;
assert(_bddtable_len == (int)(ite_filesize(tmp_str)/sizeof(BDDNode)));
fin = ite_fopen(tmp_str, "rb");
if (!fin) return;
_bddtable = calloc(_bddtable_len, sizeof(BDDNode));
if (fread(_bddtable, sizeof(BDDNode), _bddtable_len, fin) != (size_t)_bddtable_len)
fprintf(stderr, "fread on bddtable failed\n");
fclose(fin);
strcpy(tmp_str, "functions.bin");
cerr << "Reading " << tmp_str << endl;
assert(_numout == (int)(ite_filesize(tmp_str)/sizeof(BDDNode*)));
fin = ite_fopen(tmp_str, "rb");
if (!fin) return;
_functions = calloc(_numout, sizeof(BDDNode*));
if (fread(_functions, sizeof(BDDNode*), _numout , fin) != (size_t)_numout)
fprintf(stderr, "fread on functions failed\n");
fclose(fin);
strcpy(tmp_str, "functiontype.bin");
cerr << "Reading " << tmp_str << endl;
assert(_numout == (int)(ite_filesize(tmp_str)/sizeof(int)));
fin = ite_fopen(tmp_str, "rb");
if (!fin) return;
_functiontype = calloc(_numout, sizeof(int));
if (fread(_functiontype, sizeof(int), _numout , fin) != (size_t)_numout)
fprintf(stderr, "fread on functiontype failed\n");
fclose(fin);
strcpy(tmp_str, "equalityvble.bin");
cerr << "Reading " << tmp_str << endl;
assert(_numout == (int)(ite_filesize(tmp_str)/sizeof(int)));
fin = ite_fopen(tmp_str, "rb");
if (!fin) return;
_equalityvble = calloc(_numout, sizeof(int));
if (fread(_equalityvble, sizeof(int), _numout , fin) != (size_t)_numout)
fprintf(stderr, "fread on equalityvble failed\n");
fclose(fin);
strcpy(tmp_str, "length.bin");
cerr << "Reading " << tmp_str << endl;
assert(_numout == (int)(ite_filesize(tmp_str)/sizeof(int)));
fin = ite_fopen(tmp_str, "rb");
if (!fin) return;
_length = calloc(_numout, sizeof(int));
if (fread(_length, sizeof(int), _numout , fin) != (size_t)_numout)
fprintf(stderr, "fread on length failed\n");
fclose(fin);
strcpy(tmp_str, "variablelist.bin");
cerr << "Reading " << tmp_str << endl;
assert(_numinp+1 == (int)(ite_filesize(tmp_str)/sizeof(varinfo)));
fin = ite_fopen(tmp_str, "rb");
_variablelist = calloc(_numinp+1, sizeof(varinfo));
if (!fin) return;
if (fread(_variablelist, sizeof(varinfo), _numinp+1 , fin) != (size_t)_numinp+1)
fprintf(stderr, "fread on variablelist failed\n");
fclose(fin);
strcpy(tmp_str, "independantVars.bin");
cerr << "Reading " << tmp_str << endl;
assert(_numinp+1 == (int)(ite_filesize(tmp_str)/sizeof(int)));
fin = ite_fopen(tmp_str, "rb");
_independantVars = calloc(_numinp+1, sizeof(int));
if (!fin) return;
if (fread(_independantVars, sizeof(int), _numinp+1 , fin) != (size_t)_numinp+1)
fprintf(stderr, "fread on independantVars failed\n");
fclose(fin);
reload_bdd_circuit(_numinp, _numout,
_bddtable, _bddtable_len,
_bddtable_start,
_equalityvble, _functions,
_functiontype, _length,
_variablelist, _independantVars);
ite_free(&_bddtable);
ite_free(&_equalityvble);
ite_free(&_functions);
ite_free(&_functiontype);
ite_free(&_length);
ite_free(&_variablelist);
ite_free(&_independantVars);
}
void
reload_bdd_circuit(int _numinp, int _numout,
void *_bddtable, int _bddtable_len,
void *_bddtable_start,
void *_equalityvble,
void *_functions,
void *_functiontype,
void *_length,
void *_variablelist,
void *_independantVars)
{
bdd_init();
d2_printf3("Have %d variables and %d functions .. \n",
_numinp, _numout);
d2_printf1("BDD and Circuit Init..\n");
numinp = _numinp;
numout = _numout;
vars_alloc(numinp+1);
functions_alloc(numout);
nmbrFunctions = numout;
ite_free((void**)&length);
length = (int *)ite_calloc(numout+1, sizeof(int), 9, "length");
if (variablelist) delete [] variablelist;
variablelist = new varinfo[numinp + 1];
int shift=0;
bddtable_load(_bddtable, _bddtable_len, _bddtable_start, &shift);
memmove(functions, _functions, sizeof(BDDNode*)*numout);
memmove(functionType, _functiontype, sizeof(int)*numout);
memmove(equalityVble, _equalityvble, sizeof(int)*numout);
memmove(length, _length, sizeof(int)*numout);
memmove(variablelist, _variablelist, sizeof(varinfo)*(numinp+1));
memmove(independantVars, _independantVars, sizeof(int)*(numinp+1));
/* fix functions */
d2_printf1("Fixing functions .. \n");
int i;
for (i=0;i<numout;i++) {
if (functions[i]) functions[i] = (BDDNode*)((char*)(functions[i])+shift);
}
create_all_syms(_numinp);
}
void
get_bdd_circuit(int *_numinp, int *_numout,
void **_bddtable, int *_bddtable_len, int *_bddtable_msize,
void **_equalityvble,
void **_functions, int *_functions_msize,
void **_functiontype,
void **_length,
void **_variablelist, int *_variablelist_msize,
void **_independantVars)
{
*_numinp = numinp;
*_numout = numout;
bddtable_get(_bddtable, _bddtable_len, _bddtable_msize);
*_equalityvble = equalityVble;
*_functions = functions;
*_functions_msize = sizeof(BDDNode*);
*_functiontype = functionType;
*_length = length;
*_variablelist = variablelist;
*_variablelist_msize = sizeof(varinfo);
*_independantVars = independantVars;
}
void
BDD_to_Binary()
{
void *_bddtable;
int _bddtable_len;
int _bddtable_msize;
cerr << "dump_bdd_table ---------------------------------" << endl;
FILE *fout = NULL;
char tmp_str[32];
strcpy(tmp_str, "bddtable.bin");
fout = ite_fopen(tmp_str, "wb");
if (!fout) return;
bddtable_get(&_bddtable, &_bddtable_len, &_bddtable_msize);
fwrite(_bddtable, _bddtable_msize, _bddtable_len, fout);
fclose(fout);
strcpy(tmp_str, "functions.bin");
fout = ite_fopen(tmp_str, "wb");
if (!fout) return;
fwrite(functions, sizeof(BDDNode*), numout , fout);
fclose(fout);
strcpy(tmp_str, "functiontype.bin");
fout = ite_fopen(tmp_str, "wb");
if (!fout) return;
fwrite(functionType, sizeof(int), numout , fout);
fclose(fout);
strcpy(tmp_str, "equalityvble.bin");
fout = ite_fopen(tmp_str, "wb");
if (!fout) return;
fwrite(equalityVble, sizeof(int), numout , fout);
fclose(fout);
strcpy(tmp_str, "length.bin");
fout = ite_fopen(tmp_str, "wb");
if (!fout) return;
fwrite(length, sizeof(int), numout , fout);
fclose(fout);
strcpy(tmp_str, "variablelist.bin");
fout = ite_fopen(tmp_str, "wb");
if (!fout) return;
fwrite(variablelist, sizeof(varinfo), numinp+1 , fout);
fclose(fout);
strcpy(tmp_str, "independantVars.bin");
fout = ite_fopen(tmp_str, "wb");
if (!fout) return;
fwrite(independantVars, sizeof(int), numinp+1 , fout);
fclose(fout);
t_sbsat_env sbsat_env;
sbsat_env.bddtable_start = _bddtable;
sbsat_env.bddtable_pos = _bddtable_len;
sbsat_env.num_variables = numinp;
sbsat_env.num_functions = numout;
fout = fopen("sbsatenv.bin", "wb");
if (!fout) return;
fwrite(&sbsat_env, sizeof(t_sbsat_env), 1, fout);
fclose(fout);
/*
for (char* i=bddmemory_vsb[0].memory;i<bddmemory_vsb[i].memory+curBDDPos;i++)
cout << "Pool is starting at " << bddmemory_vsb[0].memory << endl;
for (int i=0;i<curBDDPos;i++) {
BDDNode *bdd = (bddmemory_vsb[0].memory + i);
cout << "var: " << bdd->variable << endl;
cout << "then: " << bdd->thenCase << " idx: " << bdd->thenCase-bddmemory_vsb[0].memory << endl;
cout << "else: " << bdd->elseCase << " idx: " << bdd->elseCase-bddmemory_vsb[0].memory << endl;
// have to fix next anyway
// cout << "next: " << next << endl;
// must be 0 (NULL)
//int t_var;
//void *var_ptr;
//infer *inferences;
//SmurfFactoryAddons *addons;
}
*/
}
| 35.178683 | 101 | 0.652825 | nerdling |
6caba64a04f07f235d33c3225a050f1cc5819285 | 2,206 | cpp | C++ | LLVMPasses/UsedInAsm.cpp | MuhammadAbuBakar95/kernel-specialization | 1b802e64d37b0aa629197cec72760a0a445a9e33 | [
"BSD-3-Clause"
] | 2 | 2020-08-25T12:01:56.000Z | 2021-09-24T04:18:08.000Z | LLVMPasses/UsedInAsm.cpp | MuhammadAbuBakar95/kernel-specialization | 1b802e64d37b0aa629197cec72760a0a445a9e33 | [
"BSD-3-Clause"
] | 2 | 2018-10-08T23:27:57.000Z | 2018-10-12T16:42:48.000Z | LLVMPasses/UsedInAsm.cpp | MuhammadAbuBakar95/kernel-specialization | 1b802e64d37b0aa629197cec72760a0a445a9e33 | [
"BSD-3-Clause"
] | 4 | 2019-04-18T13:14:06.000Z | 2020-12-16T10:16:21.000Z |
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/Support/CommandLine.h"
#include <llvm/Analysis/LoopInfo.h>
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InlineAsm.h"
#include <string>
#include <unistd.h>
#include <set>
#include <iostream>
#include <fstream>
using namespace llvm;
using namespace std;
namespace {
struct UsedInAsm : public ModulePass {
static char ID;
UsedInAsm() : ModulePass(ID) {}
bool isDelim(char c) {
return (c == '_' || (c >= 48 && c <= 57) || (c >= 65 && c <= 90) || (c >= 97 && c <= 122));
}
vector<string> getTokens(string asmString) {
string currString;
vector<string> tokens;
for(unsigned i = 0; i < asmString.size(); i++) {
char c = asmString[i];
if(isDelim(c))
currString += c;
else {
tokens.push_back(currString);
currString = "";
}
}
return tokens;
}
bool runOnModule(Module& M) {
set<int> sysIds;
for(Module::iterator mit = M.getFunctionList().begin(); mit != M.getFunctionList().end(); ++mit) {
Function * func = &*mit;
for(Function::iterator b = func->begin(), e = func->end(); b != e; ++b) {
BasicBlock *BB = &*b;
for(BasicBlock::iterator it = BB->begin(), it2 = BB->end(); it != it2; it++) {
if(CallInst * callInst = dyn_cast<CallInst>(&*it)) {
if(callInst->isInlineAsm()) {
const InlineAsm * IA = cast<InlineAsm>(callInst->getCalledValue());
if(IA->getAsmString() != "syscall") {
vector<string> tokens = getTokens(IA->getAsmString());
for(unsigned i = 0; i < tokens.size(); i++)
errs() << tokens[i] << "\n";
}
}
}
}
}
}
return true;
}
};
}
char UsedInAsm::ID = 0;
static RegisterPass<UsedInAsm> X("used-in-asm", "Simplifying library calls", false, false);
| 30.219178 | 104 | 0.547597 | MuhammadAbuBakar95 |
6cade4592b030523b3609b142c7310e57176860c | 4,057 | cpp | C++ | EpLibrary2.0/EpLibrary/Sources/epSemaphore.cpp | juhgiyo/EpLibrary | 130c3ec3fdd4af829c63f0f8b142d0cc3349100e | [
"Unlicense",
"MIT"
] | 34 | 2015-01-01T12:08:15.000Z | 2022-03-19T15:34:41.000Z | EpLibrary2.0/EpLibrary/Sources/epSemaphore.cpp | darongE/EpLibrary | a637612ceff19e4106c7972ce1bca3ccfe666087 | [
"Unlicense",
"MIT"
] | 1 | 2021-01-26T05:07:27.000Z | 2021-01-26T05:19:45.000Z | EpLibrary2.0/EpLibrary/Sources/epSemaphore.cpp | darongE/EpLibrary | a637612ceff19e4106c7972ce1bca3ccfe666087 | [
"Unlicense",
"MIT"
] | 25 | 2015-01-17T19:27:57.000Z | 2021-11-17T06:26:20.000Z | /*!
Semaphore for the EpLibrary
The MIT License (MIT)
Copyright (c) 2008-2013 Woong Gyu La <juhgiyo@gmail.com>
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 "epSemaphore.h"
#include "epSystem.h"
#include "epException.h"
#if defined(_DEBUG) && defined(EP_ENABLE_CRTDBG)
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif // defined(_DEBUG) && defined(EP_ENABLE_CRTDBG)
using namespace epl;
Semaphore::Semaphore(long count,const TCHAR *semName, LPSECURITY_ATTRIBUTES lpsaAttributes) :BaseLock()
{
m_lpsaAttributes=NULL;
if(lpsaAttributes)
{
m_lpsaAttributes=EP_NEW SECURITY_ATTRIBUTES();
*m_lpsaAttributes=*lpsaAttributes;
}
m_count=count;
m_initialiCount=count;
if(semName)
m_name=semName;
else
m_name=_T("");
m_sem=CreateSemaphore(m_lpsaAttributes,m_initialiCount,count,semName);
}
Semaphore::Semaphore(long count, long initialCount,const TCHAR *semName, LPSECURITY_ATTRIBUTES lpsaAttributes) :BaseLock()
{
m_lpsaAttributes=NULL;
if(lpsaAttributes)
{
m_lpsaAttributes=EP_NEW SECURITY_ATTRIBUTES();
*m_lpsaAttributes=*lpsaAttributes;
}
m_count=count;
m_initialiCount=initialCount;
if(semName)
m_name=semName;
else
m_name=_T("");
m_sem=CreateSemaphore(m_lpsaAttributes,initialCount,count,semName);
}
Semaphore::Semaphore(const Semaphore& b) :BaseLock()
{
m_lpsaAttributes=NULL;
if(b.m_lpsaAttributes)
{
m_lpsaAttributes=EP_NEW SECURITY_ATTRIBUTES();
*m_lpsaAttributes=*b.m_lpsaAttributes;
}
m_initialiCount=b.m_initialiCount;
m_count=b.m_count;
m_name=b.m_name;
if(m_name.size())
m_sem=CreateSemaphore(m_lpsaAttributes,m_initialiCount,m_count,m_name.c_str());
else
m_sem=CreateSemaphore(m_lpsaAttributes,m_initialiCount,m_count,NULL);
}
Semaphore & Semaphore::operator=(const Semaphore&b)
{
if(this!=&b)
{
CloseHandle(m_sem);
m_sem=NULL;
if(m_lpsaAttributes)
{
EP_DELETE m_lpsaAttributes;
}
m_lpsaAttributes=NULL;
if(b.m_lpsaAttributes)
{
m_lpsaAttributes=EP_NEW SECURITY_ATTRIBUTES();
*m_lpsaAttributes=*b.m_lpsaAttributes;
}
m_initialiCount=b.m_initialiCount;
m_count=b.m_count;
m_name=b.m_name;
if(m_name.size())
m_sem=CreateSemaphore(m_lpsaAttributes,m_initialiCount,m_count,m_name.c_str());
else
m_sem=CreateSemaphore(m_lpsaAttributes,m_initialiCount,m_count,NULL);
}
return *this;
}
Semaphore::~Semaphore()
{
CloseHandle(m_sem);
m_sem=NULL;
if(m_lpsaAttributes)
{
EP_DELETE m_lpsaAttributes;
}
m_lpsaAttributes=NULL;
}
bool Semaphore::Lock()
{
System::WaitForSingleObject(m_sem,WAITTIME_INIFINITE);
return true;
}
long Semaphore::TryLock()
{
long ret=0;
if(System::WaitForSingleObject(m_sem,WAITTIME_IGNORE) == WAIT_OBJECT_0 )
ret=1;
return ret;
}
long Semaphore::TryLockFor(const unsigned int dwMilliSecond)
{
long ret=0;
if( System::WaitForSingleObject(m_sem,dwMilliSecond) == WAIT_OBJECT_0)
ret=1;
return ret;
}
void Semaphore::Unlock()
{
ReleaseSemaphore(m_sem,1,NULL);
}
long Semaphore::Release(long count, long * retPreviousCount)
{
return ReleaseSemaphore(m_sem,count,retPreviousCount);
}
| 25.515723 | 122 | 0.774957 | juhgiyo |
6cb7a89676cdb366136c5de68f80b8c22182930a | 14,646 | cpp | C++ | camserver/src/main.cpp | dhm-org/dhm_suite | 19f803fbe973bebf9bd63994e58ea94f475ba3f6 | [
"Apache-2.0"
] | 4 | 2019-10-08T22:23:45.000Z | 2021-03-08T08:14:11.000Z | camserver/src/main.cpp | dhm-org/dhm_suite | 19f803fbe973bebf9bd63994e58ea94f475ba3f6 | [
"Apache-2.0"
] | 24 | 2019-06-18T21:57:32.000Z | 2020-10-13T21:39:53.000Z | camserver/src/main.cpp | dhm-org/dhm_suite | 19f803fbe973bebf9bd63994e58ea94f475ba3f6 | [
"Apache-2.0"
] | null | null | null | /**
******************************************************************************
Copyright 2019, by the California Institute of Technology. ALL RIGHTS RESERVED.
United States Government Sponsorship acknowledged. Any commercial use must be
negotiated with the Office of Technology Transfer at the
California Institute of Technology.
This software may be subject to U.S. export control laws. By accepting this software,
the user agrees to comply with all applicable U.S. export laws and regulations.
User has the responsibility to obtain export licenses, or other export authority
as may be required before exporting such information to foreign countries or providing
access to foreign persons.
@file main.cpp
@author: S. Felipe Fregoso
@par Description: Main for the camera server.
******************************************************************************
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#if defined(_WIN32)
#else
#include <tiffio.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <strings.h>
#include <pthread.h>
#endif
#include "CamApi.h"
#define MAX_RECORD_TIME_SECONDS 2147483647
#define SERVER_BASE_PORT 2000
#define PATHLEN 256
struct IntParam {
int val;
bool cmdline;
};
struct FloatParam {
float val;
bool cmdline;
};
struct DoubleParam {
double val;
bool cmdline;
};
struct BoolParam {
float val;
bool cmdline;
};
struct StringParam {
char val[PATHLEN];
bool cmdline;
};
struct UserParams {
struct IntParam numcameras;
struct IntParam duration;
struct IntParam frame_port;
struct IntParam command_port;
struct IntParam telem_port;
struct BoolParam logging_enabled;
struct BoolParam verbose;
struct IntParam width;
struct IntParam height;
struct DoubleParam rate;
struct StringParam configfile;
struct StringParam rootdir;
struct StringParam datadir;
struct StringParam sessiondir;
struct StringParam camserialnum;
struct StringParam trigger_source;
};
static CamApi *g_cam_api = NULL;
static bool exitflag = false;
void sighandler(int s)
{
fprintf(stderr, "Caught Ctrl-C...\n");
exitflag=true;
}
void CaptureSigint()
{
struct sigaction sigIntHandler;
sigIntHandler.sa_handler = sighandler;
sigemptyset(&sigIntHandler.sa_mask);
sigIntHandler.sa_flags = 0;
sigaction(SIGINT, &sigIntHandler, NULL);
}
void banner()
{
printf("\n");
printf("///////////////////////////////////////////\n");
printf("/// Camera Server Software ///\n");
printf("///////////////////////////////////////////\n\n");
}
void usage(char *name)
{
printf("\n");
printf("Usage: %s [options]\n\n", name);
printf( "\n");
printf( "Where:\n");
printf( "\t-h show help usage\n");
printf( "\t-fp port# Frame Port used by server to stream the frames to connected clients. Port# ranges between"
"2000(default) and 65535 inclusive\n");
printf( "\t-cp port# Command Port used by server to receive commands from clients. Port# ranges between"
"2000(2001 is default) and 65535 inclusive\n");
//printf( "\t-tp port# Telemetry Port number to use for server, where port# is between 2000(2002 is default) and 65535 inclusive\n");
printf( "\t-d Start camserver with logging frames to disk disabled. Default is to ask user to enable/disable logging.\n");
printf( "\t-e Start camserver with logging frames to disk enabled. Default is to ask user to enable/disable logging.\n");
printf( "\t-r rate Hz Camera frame rate in Hz, default is 15Hz. Ignored if option -x used\n");
printf( "\t-w width Camera image width in pixels. Default value is 2048 or highest value from camera if max is less than 2048\n");
printf( "\t-ht height Camera image height in pixels. Default value is 2048 or highest value from camera if max is less than 2048\n");
printf( "\t-t time_duration Execution duration in seconds. Camserver ends after duration expires. Default is run forever.\n");
printf( "\t-c config_file Camera config file containing camera parameters to set. XML file generated by VimbaViewer vendor software.\n");
printf( "\t-l log_dir Log directory to where to place recorded frames. Default is current directory.\n");
printf( "\t-v verbose Display frame timestamp. Default is no verbose.\n");
printf( "\t-s serial_number Camera serial number. Default is to ask user to select camera (if more than one is found).\n");
printf( "\t-x trigger_source Set camera's FrameStart Trigger Source. Default is Freerun. -r option has not effect.\n");
printf( "\t Valid values [Freerun|Line1|Line2|FixedRate|Software|Action0|Action1].\n");
}
void parse_commandline(int argc, char* argv[], struct UserParams *params)
{
for (int i = 1; i < argc; i++) {
std::string arg = argv[i];
std::string::size_type sz;
if ((arg == "-h") || (arg == "--help")) {
usage(argv[0]);
exit(0);
}
else if ((arg == "-fp") || (arg == "--frame_port")) {
if (i + 1 < argc) {
params->frame_port.val = std::stoi(argv[++i], &sz);
params->frame_port.cmdline = true;
printf("Frame Port = %d\n", params->frame_port.val);
}
else {
}
}
else if ((arg == "-cp") || (arg == "--command_port")) {
if (i + 1 < argc) {
params->command_port.val = std::stoi(argv[++i], &sz);
params->command_port.cmdline = true;
printf("Command Port = %d\n", params->command_port.val);
}
else {
}
}
else if ((arg == "-tp") || (arg == "--telemetry_port")) {
if (i + 1 < argc) {
params->telem_port.val = std::stoi(argv[++i], &sz);
params->telem_port.cmdline = true;
printf("Telemetry Port = %d\n", params->telem_port.val);
}
else {
}
}
else if ((arg == "-d") || (arg == "--disable_logging")) {
//askToLog = false;
params->logging_enabled.val = false;
params->logging_enabled.cmdline = true;
}
else if ((arg == "-e") || (arg == "--enable_logging")) {
//askToLog = false;
params->logging_enabled.val = true;
params->logging_enabled.cmdline = true;
}
else if ((arg == "-r") || (arg == "--rate")) {
params->rate.val = std::stod(argv[++i], &sz);
params->rate.cmdline = true;
}
else if ((arg == "-w") || (arg == "--width")) {
params->width.val = std::stoi(argv[++i], &sz);
params->width.cmdline = true;
}
else if ((arg == "-ht") || (arg == "--height")) {
params->height.val = std::stoi(argv[++i], &sz);
params->height.cmdline = true;
}
else if ((arg == "-t") || (arg == "--time_duration")) {
params->duration.val = std::stoi(argv[++i], &sz);
params->duration.cmdline = true;
}
else if ((arg == "-c") || (arg == "--config_file")) {
strncpy(params->configfile.val, argv[++i], sizeof(params->configfile.val));
params->configfile.cmdline = true;
}
else if ((arg == "-l") || (arg == "--log_dir")) {
strncpy(params->rootdir.val, argv[++i], sizeof(params->rootdir.val));
params->rootdir.cmdline = true;
}
else if ((arg == "-v") || (arg == "--verbose")) {
params->verbose.val = true;
params->verbose.cmdline = true;
}
else if ((arg == "-s") || (arg == "--serial_num")) {
strncpy(params->camserialnum.val, argv[++i], sizeof(params->camserialnum.val));
params->camserialnum.cmdline = true;
}
else if ((arg == "-x") || (arg == "--trigger_source")) {
strncpy(params->trigger_source.val, argv[++i], sizeof(params->trigger_source.val));
params->trigger_source.cmdline = true;
}
else {
printf("Error. Unrecognized parameter: %s\n", arg.c_str());
usage(argv[0]);
exit(-1);
}
}
}
void set_default(struct UserParams *params)
{
char rootdir[PATHLEN];
// Get current working directory
if (getcwd(rootdir, sizeof(rootdir)) == NULL) {
perror("getcwd() error");
exit(-1);
}
params->numcameras.val = 1;
params->numcameras.cmdline = false;
params->duration.val = MAX_RECORD_TIME_SECONDS;
params->duration.cmdline = false;
params->frame_port.val = SERVER_BASE_PORT;
params->frame_port.cmdline = false;
params->command_port.val = SERVER_BASE_PORT + 1;
params->command_port.cmdline = false;
params->telem_port.val = SERVER_BASE_PORT + 2;
params->telem_port.cmdline = false;
params->logging_enabled.val = false;
params->logging_enabled.cmdline = false;
params->verbose.val = false;
params->verbose.cmdline = false;
params->width.val = 2048;
params->width.cmdline = false;
params->height.val = 2048;
params->height.cmdline = false;
params->rate.val = 15;
params->rate.cmdline = false;
params->configfile.val[0] = {'\0'};
params->configfile.cmdline = false;
strncpy(params->rootdir.val, rootdir, PATHLEN);
params->rootdir.cmdline = false;
memset(params->sessiondir.val, '\0', PATHLEN);
params->sessiondir.cmdline = false;
memset(params->datadir.val, '\0', PATHLEN);
params->datadir.cmdline = false;
params->camserialnum.val[0] = {'\0'};
params->camserialnum.cmdline = false;
strncpy(params->trigger_source.val, "Freerun", PATHLEN);
params->trigger_source.cmdline = false;
}
void prompt_user(int cameraidx, struct UserParams *params)
{
if (!params->logging_enabled.cmdline) {
char userinput;
bool inputok = false;
do {
printf("\nRecord frames to disk for CAMERA %d? [Y or n]: ", cameraidx + 1);
std::cin >> userinput;
if (userinput == 'Y' || userinput == 'y') {
inputok = true;
params->logging_enabled.val = true;
}
else if (userinput == 'N' || userinput == 'n') {
inputok = true;
params->logging_enabled.val = false;
}
} while(!inputok);
printf("\nLogging has been [%s] for CAMERA %d\n", (params->logging_enabled.val)?"ENABLED":"DISABLED", cameraidx + 1);
}
}
int stop_camera_server(CamApi *cam_api)
{
cam_api->StopAsyncContinuousImageAcquisition();
cam_api->Shutdown();
return 0;
}
int start_camera_server(CamApi *cam_api, int cameraidx, struct UserParams *userparams)
{
cam_api->SetVerbose(userparams->verbose.val);
if(cam_api->OpenAndConfigCamera(cameraidx, userparams->width.val, userparams->height.val, userparams->rate.val, userparams->configfile.val, userparams->trigger_source.val) < 0) {
fprintf(stderr, "Error. Open and Configure Camera failed. Aborting.\n");
cam_api->Shutdown();
exit(-1);
}
cam_api->StartCameraServer(userparams->frame_port.val, userparams->command_port.val, userparams->telem_port.val);
if(cam_api->StartAsyncContinuousImageAcquisition(cameraidx, userparams->logging_enabled.val, userparams->rootdir.val, userparams->datadir.val, userparams->sessiondir.val) < 0) {
fprintf(stderr, "Error. Start of acqusition failed. Aborting.\n");
cam_api->Shutdown();
exit(-1);
}
return 0;
}
int list_cameras(CamApi *cam_api)
{
int numcameras;
fprintf(stderr, "Starting up the Vimba driver...\n");
cam_api->Startup();
if((numcameras = cam_api->QueryConnectedCameras()) <= 0) {
cam_api->Shutdown();
}
return numcameras;
}
void prompt_user_select_camera(CamApi *cam_api, int numcameras, int *cameraidx, struct UserParams *params)
{
int userinput = 0;
bool inputok = false;
if (numcameras > 1) {
// If serial number supplied by user then look for that first. If failed then ask user
// to select camera
if(params->camserialnum.cmdline) {
int ret;
if ((ret = cam_api->FindCameraWithSerialNum(params->camserialnum.val)) >= 0) {
*cameraidx = ret;
return;
}
}
do {
if (exitflag) break;
printf("\nSelect which camera to acquire frame from [Enter number and press return]: ");
std::cin >> userinput;
if (userinput > 0 && userinput <= numcameras) {
inputok = true;
}
} while(!inputok);
*cameraidx = userinput-1;
}
else {
*cameraidx = numcameras - 1;
}
}
int main( int argc, char* argv[] )
{
struct UserParams userparams;
int cameraidx;
int numcameras;
int count;
g_cam_api = new CamApi();
CaptureSigint();
// *** Print banner **
banner();
// *** Set default values for parameters
//fprintf(stderr, "Setting default user input values...\n");
set_default(&userparams);
// *** Process Command Line Arguments **
//fprintf(stderr, "Processing command line arguments...\n");
parse_commandline(argc, argv, &userparams);
// *** List cameras in the computer
if((numcameras = list_cameras(g_cam_api)) <= 0) {
return -1;
}
fprintf(stderr, "Found %d cameras\n", numcameras);
// *** Prompt user to select a camera
prompt_user_select_camera(g_cam_api, numcameras, &cameraidx, &userparams);
if (exitflag)
goto ExitCamserver;
// *** Prompt user for addition information
prompt_user(cameraidx, &userparams);
// *** Start Acquiring
fprintf(stderr, "Start Camera Server...\n");
start_camera_server(g_cam_api, cameraidx, &userparams);
count = 0;
while(count++ < userparams.duration.val) {
usleep(1e6);
fprintf(stderr, "Sec %d\n", count);
if(exitflag) break;
}
ExitCamserver:
// *** Stop camera server
stop_camera_server(g_cam_api);
return 0;
}
| 34.13986 | 182 | 0.586645 | dhm-org |
6cb9dd7de20db5165a1d2b1005291090897e7a38 | 1,683 | cpp | C++ | Tree/Childsumparent.cpp | Anirban166/GeeksforGeeks | 3b0f4a5a5c9476477e5920692258c097b20b64a0 | [
"MIT"
] | 19 | 2019-07-22T06:23:36.000Z | 2021-09-12T13:01:41.000Z | Tree/Childsumparent.cpp | Anirban166/GeeksforGeeks | 3b0f4a5a5c9476477e5920692258c097b20b64a0 | [
"MIT"
] | null | null | null | Tree/Childsumparent.cpp | Anirban166/GeeksforGeeks | 3b0f4a5a5c9476477e5920692258c097b20b64a0 | [
"MIT"
] | 3 | 2019-10-10T03:41:06.000Z | 2020-05-05T08:27:46.000Z | #include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* left;
struct Node* right;
Node(int x){
data = x;
left = right = NULL;
}
};
void insert(Node *root,int a1,int a2,char lr){
if(root==NULL){
return;
}
if(root->data==a1){
switch(lr){
case 'L':root->left=new Node(a2);
break;
case 'R':root->right=new Node(a2);
break;
}
}
else{
insert(root->left,a1,a2,lr);
insert(root->right,a1,a2,lr);
}
}
void inorder(Node *root){
if(root==NULL)
return;
inorder(root->left);
cout<<root->data<<" ";
inorder(root->right);
}
int isSumProperty(Node *node);
int main()
{
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
int t;
cin>>t;
while(t-->0)
{
int n;
cin>>n;
int m=n;
Node *root1=NULL;
while(n-->0){
int a1,a2;
cin>>a1>>a2;
char lr;
scanf(" %c",&lr);
if(root1==NULL){
root1=new Node(a1);
switch(lr){
case 'L':root1->left=new Node(a2);
break;
case 'R':root1->right=new Node(a2);
break;
}
}
else{
insert(root1,a1,a2,lr);
}
}
cout<<isSumProperty(root1)<<endl;
}
}
}
/*This is a function problem.You only need to complete the function given below*/
/*Complete the function below
struct Node
{
int data;
struct Node* left;
struct Node* right;
Node(int x){
data = x;
left = right = NULL;
}
};
*/
int isSumProperty(Node *node)
{
if(!node || !node->left && !node->right)
return 1;
int ls=(node->left)?(node->left->data):0;
int rs=(node->right)?(node->right->data):0;
return ((node->data==(ls+rs))&& isSumProperty(node->left)&&isSumProperty(node->right));
}
| 17.53125 | 87 | 0.576352 | Anirban166 |
6cbcef723672032c7692adc6bfce02f9b30c4a79 | 2,116 | cpp | C++ | Solutions/jumpGame.II.cpp | VenkataAnilKumar/LeetCode | df6d9e4b7172266bef4bc1f771fce3abb2216298 | [
"Fair"
] | 1 | 2020-10-30T07:10:23.000Z | 2020-10-30T07:10:23.000Z | Solutions/jumpGame.II.cpp | VenkataAnilKumar/LeetCode | df6d9e4b7172266bef4bc1f771fce3abb2216298 | [
"Fair"
] | null | null | null | Solutions/jumpGame.II.cpp | VenkataAnilKumar/LeetCode | df6d9e4b7172266bef4bc1f771fce3abb2216298 | [
"Fair"
] | null | null | null | // Source : https://oj.leetcode.com/problems/jump-game-ii/
// Author : Venkata Anil Kumar
/**********************************************************************************
*
* Given an array of non-negative integers, you are initially positioned at the first index of the array.
*
* Each element in the array represents your maximum jump length at that position.
*
* Your goal is to reach the last index in the minimum number of jumps.
*
* For example:
* Given array A = [2,3,1,1,4]
*
* The minimum number of jumps to reach the last index is 2.
* (Jump 1 step from index 0 to 1, then 3 steps to the last index.)
*
*
**********************************************************************************/
#include <iostream>
using namespace std;
//Acutally, using the Greedy algorithm can have the answer
int jump(int A[], int n) {
if (n<=1) return 0;
int steps = 0;
int coverPos = 0;
for (int i=0; i<=coverPos&& i<n; ){
if (A[i]==0) return -1;
if(coverPos < A[i]+i){
coverPos = A[i]+i;
steps++;
}
if (coverPos >= n-1){
return steps;
}
//Greedy: find the next place which can have biggest distance
int nextPos=0;
int maxDistance=0;
for(int j=i+1; j<=coverPos; j++){
if ( A[j]+j > maxDistance ) {
maxDistance = A[j]+j;
nextPos = j;
}
}
i = nextPos;
}
return steps;
}
void printArray(int a[], int n){
cout << "{ ";
for(int i=0; i<n; i++){
if(i) cout << ", ";
cout << a[i];
}
cout << " } ";
}
int main()
{
#define TEST(a) printArray(a, sizeof(a)/sizeof(a[0])); cout<<jump(a, sizeof(a)/sizeof(a[0]))<<endl;
int a1[]={0};
TEST(a1);
int a2[]={1};
TEST(a2);
int a3[]={3,2,1,0,4};
TEST(a3);
int a4[]={2,3,1,1,4};
TEST(a4);
int a5[]={1,2,3};
TEST(a5);
// 0 -> 1 -> 4 -> end
int a6[]={2,3,1,1,4,0,1};
TEST(a6);
// 0 -> 1 -> 3 -> end
int a7[]={2,3,1,2,0,1};
TEST(a7);
return 0;
}
| 23.511111 | 104 | 0.469754 | VenkataAnilKumar |
6cbd9aff77171b28f395acf889c57e13e4cc803c | 18,513 | hpp | C++ | TestFile.hpp | tyson3822/IdentifyCardNumberRecognition | ce7885e0de1529d9360427380119b6df49d4cfb9 | [
"Apache-2.0"
] | null | null | null | TestFile.hpp | tyson3822/IdentifyCardNumberRecognition | ce7885e0de1529d9360427380119b6df49d4cfb9 | [
"Apache-2.0"
] | null | null | null | TestFile.hpp | tyson3822/IdentifyCardNumberRecognition | ce7885e0de1529d9360427380119b6df49d4cfb9 | [
"Apache-2.0"
] | null | null | null | #include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include <iomanip>
using namespace std;
#define PRINT_COUNT 0
#define PRINT_RESULT 1
#include "opencv2/core/utility.hpp"
#include "opencv2/core/ocl.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
using namespace cv;
class TestFile
{
private:
char * pch;
ifstream _inputFile;
ofstream _outputFile;
ofstream _resultFile;
vector<string> imgBuffer;
vector<string> testBuffer;
vector<string> outputBuffer;
vector<string> resultBuffer;
public:
//初始化文件檔
void InitTestFile(const char* testPath)
{
char inputFileName[100];
char outputFileName[100];
char resultFileName[100];
strcpy(inputFileName, testPath);
strcat(inputFileName, "inputTest.txt");
strcpy(outputFileName, testPath);
strcat(outputFileName, "outputTest.txt");
strcpy(resultFileName, testPath);
strcat(resultFileName, "testResult.txt");
_inputFile.open(inputFileName, std::ifstream::in);
_outputFile.open(outputFileName , ofstream::out | std::ios::trunc);
_resultFile.open(resultFileName, ofstream::out | std::ios::trunc);
InitTestData();
}
//初始化檔案資料&讀取input檔
void InitTestData()
{
const char *delim = ",";
string buffer;
string img;
string test;
char *charBuffer;
while(_inputFile >> buffer)
{
//string to char*
charBuffer = new char[buffer.length() + 1];
strcpy(charBuffer, buffer.c_str());
//strtok and push to vector
pch = strtok(charBuffer, delim);
img = string(pch); //char* to string
imgBuffer.push_back(img);
//cout << "push " << img << " to img vector" << endl;
//strtok and push to vector
pch = strtok(NULL, delim);
test = string(pch); //char* to string
testBuffer.push_back(test);
//cout << "push " << test << " to test vector" << endl;
outputBuffer.resize(imgBuffer.size());
resultBuffer.resize(imgBuffer.size());
}
}
//取得指定index圖片名稱
string GetImgByIndex(int index)
{
return imgBuffer[index];
}
//顯示vector內容//debug用
void ViewVector(char c)
{
switch (c)
{
case 'i':
{
cout << "-list image name vector-" << endl;
for(int i = 0; i < imgBuffer.size(); i++)
{
cout << "image vector " << i << " = " << imgBuffer[i] << endl;
}
break;
}
case 't':
{
cout << "-list test vector-" << endl;
for(int i = 0; i < testBuffer.size(); i++)
{
cout << "test vector " << i << " = " << testBuffer[i] << endl;
}
break;
}
case 'o':
{
cout << "-list output vector-" << endl;
for(int i = 0; i < outputBuffer.size(); i++)
{
if(outputBuffer[i].size() < 1)continue;
cout << "output vector " << i << " = " << outputBuffer[i] << endl;
}
break;
}
case 'r':
{
cout << "-list result vector-" << endl;
for(int i = 0; i < resultBuffer.size(); i++)
{
if(outputBuffer[i].size() < 1)continue;
cout << "result vector " << i << " = " << resultBuffer[i] << endl;
}
break;
}
default:
cout << "default" << endl;
break;
}
}
//把資料寫進output vector中
void WriteToOutput(string str)
{
outputBuffer.push_back(str);
}
//把資料寫進output vector指定Index中
void WriteToOutputByIndex(string str, int index)
{
outputBuffer[index] = str;
}
//把資料寫進文件檔中
void WriteDownOutput()
{
for(int index = 0; index < outputBuffer.size(); index++)
{
if(outputBuffer[index].size() < 1)continue;
_outputFile << outputBuffer[index] << endl;
}
}
//測試結果output
void MatchResult()
{
ViewVector('o');
//ViewVector('t');
char outputCharArr[100];
char testCharArr[100];
for(int index = 0; index < outputBuffer.size(); index++)
{
//String To Char[] 轉型
strcpy(outputCharArr, outputBuffer[index].c_str());
strcpy(testCharArr, testBuffer[index].c_str());
char ignoreChar[10] = "ignore";
int ignoreResultTest = MatchNChar(outputCharArr, ignoreChar, 6);
if(ignoreResultTest == 1)
{
resultBuffer[index] = "ignore";
continue;
}
if(outputBuffer[index].size() < 1)
{
//resultBuffer.push_back("none");
continue;
}
//比對測資與output是否一樣
int result = MatchChar(outputCharArr, testCharArr);
//將結果丟進resultBuffer中
if(result == 1)resultBuffer[index] = "true";
if(result == -1)resultBuffer[index] = "false";
}
//ViewVector('r');
//所有測試結果寫進文件中
for(int index = 0; index < resultBuffer.size(); index++)
{
if(resultBuffer[index].size() < 1)continue;
_resultFile << resultBuffer[index] << endl;
}
}
//列出成功的test
int ListSuccessTest(int mode)
{
int successCount = 0;
vector<int> successListIndex;
vector<string> successListString;
char trueChar[10];
char resultCharArr[100];
strcpy(trueChar, "true");
for(int i = 0; i < resultBuffer.size(); i++)
{
if(resultBuffer[i].size() < 1)continue;//忽略掉沒有輸出的
strcpy(resultCharArr, resultBuffer[i].c_str());
if(MatchChar(resultCharArr, trueChar) != 1)continue;//忽略掉不是true的
successListIndex.push_back(i);
successListString.push_back(outputBuffer[i]);
successCount++;
}
if(mode == PRINT_COUNT)
{
return successCount;
}
if(mode == PRINT_RESULT)
{
if(successCount > 0)
{
cout << endl << "-list the success test-" << endl;
_resultFile << endl << "-list the success test-" << endl;
for(int i = 0; i < successCount; i++)
{
cout << "the result vector index by " << successListIndex[i] << " = " << successListString[i] << " is success." << endl;
_resultFile << "the result vector index by " << successListIndex[i] << " = " << successListString[i] << " is success." << endl;
}
}
}
return 0;
}
//列出失敗的test
int ListFailureTest(int mode)
{
int failureCount = 0;
vector<int> failureListIndex;
vector<string> failureListString;
char falseChar[10];
char ignoreChar[10];
char resultCharArr[100];
char outputCharArr[100];
strcpy(falseChar, "false");
strcpy(ignoreChar, "ignore");
for(int i = 0; i < resultBuffer.size(); i++)
{
if(resultBuffer[i].size() < 1)continue;//忽略掉沒有輸出的
strcpy(resultCharArr, resultBuffer[i].c_str());
if(MatchChar(resultCharArr, falseChar) != 1)continue;//忽略掉不是false的
strncpy(outputCharArr, resultBuffer[i].c_str(), 6);
outputCharArr[6] = '\0';
if(MatchChar(outputCharArr, ignoreChar) == 1)continue;//忽略掉是ignore的
failureListIndex.push_back(i);
failureListString.push_back(outputBuffer[i]);
failureCount++;
}
if(mode == PRINT_COUNT)
{
return failureCount;
}
if(mode ==PRINT_RESULT)
{
if(failureCount > 0)
{
cout << endl << "-list the failure test-" << endl;
_resultFile << endl << "-list the failure test-" << endl;
for(int i = 0; i < failureCount; i++)
{
cout << "the result vector index by " << failureListIndex[i] << " = " << failureListString[i] << " is failure." << endl;
_resultFile << "the result vector index by " << failureListIndex[i] << " = " << failureListString[i] << " is failure." << endl;
}
}
}
return 0;
}
//列出忽略清單
int ListIgnoreTest(int mode)
{
int ignoreCount = 0;
vector<int> ignoreListIndex;
vector<string> ignoreListString;
char ignoreChar[10];
char outputCharArr[100];
strcpy(ignoreChar, "ignore");
for(int i = 0; i < resultBuffer.size(); i++)
{
if(resultBuffer[i].size() < 1)continue;//忽略掉沒有輸出的
strncpy(outputCharArr, resultBuffer[i].c_str(), 6);
outputCharArr[6] = '\0';
// cout << "outputCharArr = " << outputCharArr << endl;
// cout << "ignoreChar = " << ignoreChar << endl;
if(MatchChar(outputCharArr, ignoreChar) != 1)continue;//忽略掉不是ignore的
ignoreListIndex.push_back(i);
ignoreListString.push_back(resultBuffer[i]);
ignoreCount++;
}
if(mode ==PRINT_COUNT)
{
return ignoreCount;
}
if(mode == PRINT_RESULT)
{
if(ignoreCount > 0)
{
cout << endl << "-list the ignore test-" << endl;
_resultFile << endl << "-list the ignore test-" << endl;
for(int i = 0; i < ignoreCount; i++)
{
cout << "the result vector index by " << ignoreListIndex[i] << " is " << ignoreListString[i] << endl;
_resultFile << "the result vector index by " << ignoreListIndex[i] << " is " << ignoreListString[i] << endl;
}
}
}
return 0;
}
//對比文字(Char) 回傳1一樣,回傳-1不一樣
int MatchChar(char *str1, char *str2)//output,test
{
int result = 1;
int charIndex = 0;
char p1 = str1[charIndex];
char p2 = str2[charIndex];
if(p1 == '\0')return -1;
while(p1 != '\0')
{
//cout << "p1 = " << p1 << endl;
//cout << "p2 = " << p2 << endl;
if(p1 != p2)return -1;
if(p2 == '\0')return -1;
charIndex++;
p1 = str1[charIndex];
p2 = str2[charIndex];
}
return result;
}
//對比文字(Char) 回傳1一樣,回傳-1不一樣,用n個字元
int MatchNChar(char *str1, char *str2, int n)//output,test
{
int result = 1;
int charIndex = 0;
char p1 = str1[charIndex];
char p2 = str2[charIndex];
if(p1 == '\0')return -1;
while(p1 != '\0' && charIndex < n)
{
//cout << "p1 = " << p1 << endl;
//cout << "p2 = " << p2 << endl;
if(p1 != p2)return -1;
if(p2 == '\0')return -1;
charIndex++;
p1 = str1[charIndex];
p2 = str2[charIndex];
}
return result;
}
//關閉文字檔
void Close()
{
_inputFile.close();
_outputFile.close();
_resultFile.close();
}
//輸入檔名,取直到'.'前的字做output
char* FileNameWithoutType(char* input)
{
int charIndex = 0;
char p1 = input[charIndex];
char *output;
while(p1 != '.')
{
output[charIndex] = input[charIndex];
cout << "test charIndex = " << charIndex << endl;
cout << "output = " << output << endl;
charIndex++;
p1 = input[charIndex];
}
return output;
}
//修改字串eg. 1-1000修改成0001-1000
char *FillDigit(char *input)
{
int digitalShift = 0;
int zeroShift = 0;
while(input[digitalShift] != '\0')
digitalShift++;
zeroShift = 4 - digitalShift;
char* output;
output = new char[5];
int index = 0;
for(index = 0; index < zeroShift; index++)
output[index] = '0';
for(int digit = 0; digit < digitalShift; digit++)
{
output[index] = input[digit];
index++;
}
output[4] = '\0';
return output;
}
//儲存圖片
void SaveOutputImage(const char* fileName, char* folderPath, Mat& saveMat)
{
char savePath[100];
strcpy(savePath, folderPath);
strcat(savePath, fileName);
imwrite(savePath, saveMat);
}
//顯示數據
void PrintResultData()
{
int successCount = ListSuccessTest(PRINT_COUNT);
int failureCount = ListFailureTest(PRINT_COUNT);
int ignoreCount = ListIgnoreTest(PRINT_COUNT);
int testCount = failureCount + successCount;
int totalCount = failureCount + successCount + ignoreCount;
double successRate = (double)successCount / (double)(testCount);
double failureRate = (double)failureCount / (double)(testCount);
cout << "--print the result data--" << endl;
cout << "the success count = " << successCount << "." << endl;
cout << "the failure count = " << failureCount << "." << endl;
cout << "the test count = " << testCount << "(success+failure)." << endl;
cout << endl;
cout << "the ignore count = " << ignoreCount << "." << endl;
cout << "the total count = " << totalCount << "(success+failure+ignore)." <<endl;
cout << endl;
cout << "the success rate = " << fixed << setprecision(2) << successRate << "(success/success+failure)." << endl;
cout << "the failure rate = " << fixed << setprecision(2) << failureRate << "(failure/success+failure)." << endl;
}
//寫入數據資料
void WriteResultData()
{
int successCount = ListSuccessTest(PRINT_COUNT);
int failureCount = ListFailureTest(PRINT_COUNT);
int ignoreCount = ListIgnoreTest(PRINT_COUNT);
int testCount = failureCount + successCount;
int totalCount = failureCount + successCount + ignoreCount;
double successRate = (double)successCount / (double)(testCount);
double failureRate = (double)failureCount / (double)(testCount);
_resultFile << endl << "--print the result data--" << endl;
_resultFile << "the success count = " << successCount << "." << endl;
_resultFile << "the failure count = " << failureCount << "." << endl;
_resultFile << "the test count = " << testCount << "(success+failure)." << endl;
_resultFile << endl;
_resultFile << "the ignore count = " << ignoreCount << "." << endl;
_resultFile << "the total count = " << totalCount << "(success+failure+ignore)." <<endl;
_resultFile << endl;
_resultFile << "the success rate = " << fixed << setprecision(2) << successRate << "(success/success+failure)." << endl;
_resultFile << "the failure rate = " << fixed << setprecision(2) << failureRate << "(failure/success+failure)." << endl;
}
//複製檔案
void CopyFile(const char* inputPath, const char* outputPath)
{
ifstream _inputFileCopy;
ofstream _outputFileCopy;
_inputFileCopy.open(inputPath, std::ifstream::in);
_outputFileCopy.open(outputPath , ofstream::out | std::ios::trunc);
_outputFileCopy << _inputFileCopy.rdbuf();
_inputFileCopy.close();
_outputFileCopy.close();
}
//儲存input command line
void SaveCommandLine(char* cammandLineChar)
{
_resultFile << endl<< "--the input command line is--";
_resultFile << endl << cammandLineChar << endl;
}
};
//////////////////////////////////////////////////////
//以下是沒使用但日後可以參考或擴增的功能//
//////////////////////////////////////////////////////
// void CopyFile(const char* inputPath, const char* outputPath)
// {
// ifstream _inputFileCopy;
// ofstream _outputFileCopy;
//
// _inputFileCopy.open(inputPath, std::ifstream::in);
// _outputFileCopy.open(outputPath , ofstream::out | std::ios::trunc);
//
// string buffer;
// char *charBuffer;
// while(_inputFileCopy >> buffer)
// {
// charBuffer = new char[buffer.length() + 1];
// strcpy(charBuffer, buffer.c_str());
//
// _outputFileCopy << charBuffer << endl;
// }
//
// _inputFileCopy.close();
// _outputFileCopy.close();
// }
//輸出路徑整歸
// char* ImageOutputPath(char* basePath, char* folderPath, char* fileName)
// {
// char* output;
// output = new char[50];
// strcpy(output, basePath);
// strcat(output, folderPath);
// strcat(output, fileName);
// return output;
// }
//新增以圖片名稱為資料夾名稱的路徑
// char* AddImageFolderPath(char* oldPath, char* imgName)
// {
// char *newPath;
// newPath = new char[50];
// strcpy(newPath, oldPath);
// strcat(newPath, imgName);
// strcat(newPath, "/");
// return newPath;
// }
//字串比對
// int MatchString(string str1, string str2)//output,test
// {
// int result = 1;
// int charIndex = 0;
// char p1 = str1[charIndex];
// char p2 = str2[charIndex];
// if(p1 == '\0')return -1;
// while(p1 != '\0')
// {
// //cout << "p1 = " << p1 << endl;
// //cout << "p2 = " << p2 << endl;
// if(p1 != p2)return -1;
// if(p2 == '\0')return -1;
// charIndex++;
// p1 = str1[charIndex];
// p2 = str2[charIndex];
// }
// return result;
// }
//取得指定index test名稱
// string GetTestByIndex(int index)
// {
// return testBuffer[index];
// }
//取得圖片vector大小
// int GetImgVectorSize()
// {
// return imgBuffer.size();
// }
//
// //取得test vector大小
// int GetTestVectorSize()
// {
// return testBuffer.size();
// }
| 30.499176 | 147 | 0.50975 | tyson3822 |
6cc1223883c6cd22235d00a96d89560f945cb7d4 | 1,952 | hpp | C++ | MartrixGoC++/include/BoardEncode.hpp | MartrixG/GraduationProject | 3f82a48ba27159ae0a1c67b3c441d4d1378543e5 | [
"MIT"
] | null | null | null | MartrixGoC++/include/BoardEncode.hpp | MartrixG/GraduationProject | 3f82a48ba27159ae0a1c67b3c441d4d1378543e5 | [
"MIT"
] | null | null | null | MartrixGoC++/include/BoardEncode.hpp | MartrixG/GraduationProject | 3f82a48ba27159ae0a1c67b3c441d4d1378543e5 | [
"MIT"
] | null | null | null | //
// Created by 11409 on 2021/4/23.
//
#ifndef MARTRIXGOC_BOARDENCODE_HPP
#define MARTRIXGOC_BOARDENCODE_HPP
#include <cstring>
#include <iostream>
#include <fstream>
#include "Game.hpp"
static std::string boardEncode(Game* game)
{
static std::stringstream ss;
ss.clear();
ss.str("");
int state[5][BOARD_SIZE * BOARD_SIZE];
memset(state, 0, sizeof(state));
//color
//layer:0 0:empty 1:black 2:white
for (int i = 0; i < BOARD_SIZE * BOARD_SIZE; i++)
{
state[0][i] = game->board[i];
}
//turn
//layer:1 state[x][y] = k, (x, y) is last k step
std::vector<Step*>* steps = &game->steps;
int length = int(steps->size()), epoch = std::min(7, length);
for (int i = 0; i < epoch; i++)
{
state[1][(*steps)[length - i - 1]->pos] = i + 1;
}
for (int i = 0; i < BOARD_SIZE * BOARD_SIZE; i++)
{
if (game->historyBoard[game->historyBoard.size() - epoch][i] != 0)
{
state[1][i] = 8;
}
}
//qi
//layer:2 state[x][y] = k, (x, y) has k liberties
for (int i = 0; i < BOARD_SIZE * BOARD_SIZE; i++)
{
if (game->board[i] != 0)
{
int qi = game->pointBlockMap[i]->getQi();
qi = qi > 8 ? 8 : qi;
state[2][i] = qi;
}
}
// legal
// layer:3 1:legal 0:illegal (fill own eyes is illegal)
// qi after move
// layer:4 state[x][y] = k move to (x, y) would have k liberties
int legalMove[BOARD_SIZE * BOARD_SIZE];
int qiAfterMove[BOARD_SIZE * BOARD_SIZE];
size_t len = 0;
game->legalMove(legalMove, qiAfterMove, len);
for(size_t i = 0; i < len; i++)
{
state[3][legalMove[i]] = 1;
state[4][legalMove[i]] = qiAfterMove[i] > 8 ? 8 : qiAfterMove[i];
}
for(auto & i : state)
{
for(auto & j : i)
{
ss << j;
}
}
return ss.str();
}
#endif //MARTRIXGOC_BOARDENCODE_HPP
| 25.684211 | 74 | 0.527664 | MartrixG |
6cc325f6c9e6a7d552dc0e5498b82c313c0c38fd | 75 | cpp | C++ | render/RenderTest/Main.cpp | don-reba/colors-visualization | fe3937087be79715307127591a06f38b4647254f | [
"BSD-3-Clause"
] | null | null | null | render/RenderTest/Main.cpp | don-reba/colors-visualization | fe3937087be79715307127591a06f38b4647254f | [
"BSD-3-Clause"
] | null | null | null | render/RenderTest/Main.cpp | don-reba/colors-visualization | fe3937087be79715307127591a06f38b4647254f | [
"BSD-3-Clause"
] | null | null | null | #define BOOST_TEST_MODULE Offline Test
#include <boost/test/unit_test.hpp> | 37.5 | 39 | 0.826667 | don-reba |
6cc4ecc5555f7d2798d120ec5260f5544e4061b6 | 1,967 | cpp | C++ | salmap_rv/src/exec_graph.cpp | flyingfalling/salmap_rv | 61827a42f456afcd9c930646de33bc3f9533e3e2 | [
"MIT"
] | 1 | 2022-02-17T03:05:40.000Z | 2022-02-17T03:05:40.000Z | salmap_rv/src/exec_graph.cpp | flyingfalling/salmap_rv | 61827a42f456afcd9c930646de33bc3f9533e3e2 | [
"MIT"
] | null | null | null | salmap_rv/src/exec_graph.cpp | flyingfalling/salmap_rv | 61827a42f456afcd9c930646de33bc3f9533e3e2 | [
"MIT"
] | null | null | null | #include <salmap_rv/include/exec_graph.hpp>
#include <salmap_rv/include/featfilterimpl.hpp>
using namespace salmap_rv;
void salmap_rv::exec_graph::fill_atomic_filters()
{
atomic_filters = deps.atomic_filters();
}
void salmap_rv::exec_graph::clear()
{
deps.clear();
atomic_filters.clear();
avail_filters.clear();
curr_processing.clear();
}
const int64_t salmap_rv::exec_graph::get_max_tdelta() const
{
return deps.get_max_tdelta();
}
salmap_rv::exec_graph::exec_graph()
{
}
void salmap_rv::exec_graph::reset_avail_filters()
{
avail_filters = atomic_filters;
}
void salmap_rv::exec_graph::init( std::map<std::string, FeatFilter>& mymap )
{
deps.init( mymap );
fill_atomic_filters();
reset();
}
void salmap_rv::exec_graph::reset_updated()
{
deps.reset_updated();
}
void salmap_rv::exec_graph::reset_empty()
{
reset();
avail_filters.clear();
}
void salmap_rv::exec_graph::reset()
{
curr_processing.clear();
reset_avail_filters();
reset_updated();
}
size_t salmap_rv::exec_graph::currproc()
{
return curr_processing.size();
}
std::vector<std::string> salmap_rv::exec_graph::get_curr_proc()
{
std::vector<std::string> ret;
for( auto& a : curr_processing )
{
ret.push_back(a->name.c_str());
}
return ret;
}
void salmap_rv::exec_graph::mark_finished( FeatFilterImpl* iter )
{
deps.mark_updated( iter );
curr_processing.remove( iter );
std::list<FeatFilterImpl*> nexts = deps.get_nexts( iter );
avail_filters.splice( avail_filters.end(), nexts );
}
bool salmap_rv::exec_graph::nextfilter( FeatFilterImpl*& iter )
{
if( avail_filters.size() > 0 )
{
iter = avail_filters.front();
avail_filters.pop_front();
curr_processing.push_back( iter );
return true;
}
else
{
return false;
}
}
bool salmap_rv::exec_graph::done()
{
if( avail_filters.empty() && curr_processing.empty() )
{
return true;
}
return false;
}
| 17.5625 | 77 | 0.683274 | flyingfalling |
6cc8ff9a7f7b11f987c8e7bcaf228de007838138 | 1,188 | cpp | C++ | min_steps.cpp | Nik404/Dynamic-Prograamming | e6ba4901107332189d78fb8c426ee6f82bfc99c8 | [
"MIT"
] | 1 | 2020-09-11T05:22:37.000Z | 2020-09-11T05:22:37.000Z | min_steps.cpp | Nik404/Dynamic-Prograamming | e6ba4901107332189d78fb8c426ee6f82bfc99c8 | [
"MIT"
] | null | null | null | min_steps.cpp | Nik404/Dynamic-Prograamming | e6ba4901107332189d78fb8c426ee6f82bfc99c8 | [
"MIT"
] | null | null | null | #include <iostream>
#include <climits>
using namespace std;
int minSteps2(int n,int *arr){
if(n == 1){
return 0;
}
if(arr[n] > 0){
return arr[n];
}
int ans = 1 + minSteps2(n-1,arr);
if(n % 2 == 0){
ans = min(ans,1 + minSteps2(n/2,arr));
}
if(n %3 == 0){
ans = min(ans,1 + minSteps2(n/3,arr));
}
arr[n] = ans;
return ans;
}
int minSteps3(int n){
int *arr = new int[n+1];
arr[1] = 0;
for(int i=2;i<=n;i++){
int ans = 1 + arr[i-1];
if(i%2 == 0){
ans = min(ans,1 + arr[i/2]);
}
if(i%3 == 0){
ans = min(ans,1 + arr[i/3]);
}
arr[i] = ans;
}
int output = arr[n];
delete [] arr;
return output;
}
int minSteps(int n){
if(n == 1){
return 0;
}
int ans = 1 + minSteps(n-1);
if(n % 2 == 0){
ans = min(ans,1 + minSteps(n/2));
}
if(n %3 == 0){
ans = min(ans,1 + minSteps(n/3));
}
return ans;
}
int main(){
int n;
cin >> n;
int *arr = new int[n+1];
for(int i =0;i<=n;i++){
arr[i] = 0;
}
cout<<minSteps(n)<<endl;//not optimized
cout<<minSteps2(n,arr)<<endl;//optimized with extra work i.e. top down
cout<<minSteps3(n)<<endl;//optimized with bottom up
return 0;
} | 17.470588 | 73 | 0.508418 | Nik404 |
6cc95afda298bbab2913be6eaf98c9ebd24cb322 | 5,559 | cc | C++ | google-tv-pairing-protocol/cpp/tests/polo/pairing/polochallengeresponsetest.cc | Keneral/ae1 | e5bbf05e3a01b449f33cca14c5ce8048df45624b | [
"Unlicense"
] | null | null | null | google-tv-pairing-protocol/cpp/tests/polo/pairing/polochallengeresponsetest.cc | Keneral/ae1 | e5bbf05e3a01b449f33cca14c5ce8048df45624b | [
"Unlicense"
] | null | null | null | google-tv-pairing-protocol/cpp/tests/polo/pairing/polochallengeresponsetest.cc | Keneral/ae1 | e5bbf05e3a01b449f33cca14c5ce8048df45624b | [
"Unlicense"
] | null | null | null | // Copyright 2012 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <gtest/gtest.h>
#include <openssl/err.h>
#include <polo/pairing/polochallengeresponse.h>
#include <polo/util/poloutil.h>
namespace polo {
namespace pairing {
class PoloChallengeResponseTest : public ::testing::Test {
protected:
PoloChallengeResponseTest() : nonce(4) { }
virtual void SetUp() {
// Test certificates generated using:
// openssl req -x509 -nodes -days 365 -newkey rsa:1024 -out cert.pem
char client_pem[] = "-----BEGIN CERTIFICATE-----\n"
"MIICsDCCAhmgAwIBAgIJAI1seGT4bQoOMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNV\n"
"BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\n"
"aWRnaXRzIFB0eSBMdGQwHhcNMTAxMjEyMTYwMzI3WhcNMTExMjEyMTYwMzI3WjBF\n"
"MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\n"
"ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n"
"gQDa7AitkkzqAZjsoJ3Y5eeq2LZtkF8xMWKuZMOaKDzOaTOBpfiFXbIsrOrHJvh0\n"
"WIUI7MEu4KTknpqyTEhwqyYozeOoJnhVVaKE03TQTMKgLhc4PwO35NJXHkFxJts1\n"
"OSCFZ7SQm8OMIr6eEMLh6v7UQQ/GryNY+v5SYiVsbfgW3QIDAQABo4GnMIGkMB0G\n"
"A1UdDgQWBBRBiLSqlUt+9ZXMBLBp141te487bTB1BgNVHSMEbjBsgBRBiLSqlUt+\n"
"9ZXMBLBp141te487baFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUt\n"
"U3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAI1seGT4\n"
"bQoOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAchrbHb8S0WCGRupi\n"
"lxwnD6aVVmVsnNiOaLSI1I6RCKeS0SG/fseThd9nh92WZh6Rbx3U3rAMD08wDfSt\n"
"S9h7bukJ0X9Rs/BTirzT7Cl09PUjoawP8MeLEDFRUzcBsSYr/k/IPAWOrazWQ2tu\n"
"XO5L5nPKzpxd3tF4Aj4/3kBm4nw=\n"
"-----END CERTIFICATE-----\n";
char server_pem[] = "-----BEGIN CERTIFICATE-----\n"
"MIICsDCCAhmgAwIBAgIJAPa14A4WCQpNMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNV\n"
"BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\n"
"aWRnaXRzIFB0eSBMdGQwHhcNMTAxMjEyMTYwNzMzWhcNMTExMjEyMTYwNzMzWjBF\n"
"MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\n"
"ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n"
"gQDBkfualV4+vxIEBg1TWXy2T1nf0Dch8XoQG824o3EAzuIRHdBGHvzRNfmQOlje\n"
"XVU/Cds376EYOblxoZNVNQYMf1fkwTUnDWXNl3wR5A4m4Govi2y61b7NA8/AMxO9\n"
"wtuIAI+Yty2UAjacvt3yqG2J1r55kIOsYeDoy1E5Hpo8gwIDAQABo4GnMIGkMB0G\n"
"A1UdDgQWBBRgMM6zsFJ2DGv7B1URsUmx1BBAPzB1BgNVHSMEbjBsgBRgMM6zsFJ2\n"
"DGv7B1URsUmx1BBAP6FJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUt\n"
"U3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAPa14A4W\n"
"CQpNMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAoU/4pb2QTEgCwhzG\n"
"k6BPIz2WhOeIAAZ9fQmVxL5pbcgIUC4SnoJ3MtwB02Abbk5pIeSgtgJ50R4SmluM\n"
"T+0G1p772RqN+tLWihJqWgmODhfppUm9pp07UfL6yn4wAnyvzevadVXl6GCPocL9\n"
"cvcuBiBPlRU/giP3n15OtJ6KL9U=\n"
"-----END CERTIFICATE-----\n";
SSL_load_error_strings();
client_bio = BIO_new_mem_buf(client_pem, -1);
client_cert = PEM_read_bio_X509(client_bio, NULL, NULL, NULL);
server_bio = BIO_new_mem_buf(server_pem, -1);
server_cert = PEM_read_bio_X509(server_bio, NULL, NULL, NULL);
nonce[0] = 0x1;
nonce[1] = 0x2;
nonce[2] = 0x3;
nonce[3] = 0x4;
response = new PoloChallengeResponse(client_cert, server_cert);
}
virtual void TearDown() {
X509_free(client_cert);
BIO_free(client_bio);
X509_free(server_cert);
BIO_free(server_bio);
delete response;
}
BIO* client_bio;
X509* client_cert;
BIO* server_bio;
X509* server_cert;
Nonce nonce;
PoloChallengeResponse* response;
};
TEST_F(PoloChallengeResponseTest, GetAlpha) {
const Alpha* alpha = response->GetAlpha(nonce);
ASSERT_TRUE(alpha);
ASSERT_EQ("E4DA87E4A544B30C98FC8A4731C10828506A97BA143950D7C68D9BF58ED4C397",
util::PoloUtil::BytesToHexString(&(*alpha)[0], alpha->size()));
delete alpha;
}
TEST_F(PoloChallengeResponseTest, TestGetGamma) {
const Gamma* gamma = response->GetGamma(nonce);
ASSERT_TRUE(gamma);
ASSERT_EQ("E4DA87E401020304",
util::PoloUtil::BytesToHexString(&(*gamma)[0], gamma->size()));
delete gamma;
}
TEST_F(PoloChallengeResponseTest, TestExtractNonce) {
const Gamma* gamma = response->GetGamma(nonce);
ASSERT_TRUE(gamma);
ASSERT_EQ("E4DA87E401020304",
util::PoloUtil::BytesToHexString(&(*gamma)[0], gamma->size()));
const Nonce* extracted = response->ExtractNonce(*gamma);
ASSERT_TRUE(extracted);
ASSERT_EQ("01020304",
util::PoloUtil::BytesToHexString(&(*extracted)[0],
extracted->size()));
delete gamma;
delete extracted;
}
TEST_F(PoloChallengeResponseTest, TestCheckGamma) {
Gamma gamma(8);
gamma[0] = 0xE4;
gamma[1] = 0xDA;
gamma[2] = 0x87;
gamma[3] = 0xE4;
gamma[4] = 0x01;
gamma[5] = 0x02;
gamma[6] = 0x03;
gamma[7] = 0x04;
ASSERT_TRUE(response->CheckGamma(gamma));
}
} // namespace pairing
} // namespace polo
| 36.572368 | 79 | 0.74132 | Keneral |
6cdc844b334237b22d179c429c79289be2e528d5 | 26,327 | hpp | C++ | Examples/Injection/Calculation_component/Bindings/CppDynamic/calculation_dynamic.hpp | anpilog/AutomaticComponentToolkit | d0c0260908f1d9191789c1ed812e982194427a04 | [
"BSD-2-Clause"
] | 22 | 2018-12-12T14:55:48.000Z | 2022-02-17T11:59:28.000Z | Examples/Injection/Calculation_component/Bindings/CppDynamic/calculation_dynamic.hpp | anpilog/AutomaticComponentToolkit | d0c0260908f1d9191789c1ed812e982194427a04 | [
"BSD-2-Clause"
] | 77 | 2018-12-14T15:05:57.000Z | 2021-12-16T15:29:17.000Z | Examples/Injection/Calculation_component/Bindings/CppDynamic/calculation_dynamic.hpp | anpilog/AutomaticComponentToolkit | d0c0260908f1d9191789c1ed812e982194427a04 | [
"BSD-2-Clause"
] | 20 | 2018-12-14T14:22:19.000Z | 2021-09-08T02:17:33.000Z | /*++
Copyright (C) 2019 Calculation developers
All rights reserved.
This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0.
Abstract: This is an autogenerated C++-Header file in order to allow an easy
use of Calculation library
Interface version: 1.0.0
*/
#ifndef __CALCULATION_CPPHEADER_DYNAMIC_CPP
#define __CALCULATION_CPPHEADER_DYNAMIC_CPP
#include "calculation_types.hpp"
#include "calculation_dynamic.h"
#include "numbers_dynamic.hpp"
#ifdef _WIN32
#include <windows.h>
#else // _WIN32
#include <dlfcn.h>
#endif // _WIN32
#include <string>
#include <memory>
#include <vector>
#include <exception>
namespace Calculation {
/*************************************************************************************************************************
Forward Declaration of all classes
**************************************************************************************************************************/
class CWrapper;
class CBase;
class CCalculator;
/*************************************************************************************************************************
Declaration of deprecated class types
**************************************************************************************************************************/
typedef CWrapper CCalculationWrapper;
typedef CBase CCalculationBase;
typedef CCalculator CCalculationCalculator;
/*************************************************************************************************************************
Declaration of shared pointer types
**************************************************************************************************************************/
typedef std::shared_ptr<CWrapper> PWrapper;
typedef std::shared_ptr<CBase> PBase;
typedef std::shared_ptr<CCalculator> PCalculator;
/*************************************************************************************************************************
Declaration of deprecated shared pointer types
**************************************************************************************************************************/
typedef PWrapper PCalculationWrapper;
typedef PBase PCalculationBase;
typedef PCalculator PCalculationCalculator;
/*************************************************************************************************************************
Class ECalculationException
**************************************************************************************************************************/
class ECalculationException : public std::exception {
protected:
/**
* Error code for the Exception.
*/
CalculationResult m_errorCode;
/**
* Error message for the Exception.
*/
std::string m_errorMessage;
public:
/**
* Exception Constructor.
*/
ECalculationException(CalculationResult errorCode, const std::string & sErrorMessage)
: m_errorMessage("Calculation Error " + std::to_string(errorCode) + " (" + sErrorMessage + ")")
{
m_errorCode = errorCode;
}
/**
* Returns error code
*/
CalculationResult getErrorCode() const noexcept
{
return m_errorCode;
}
/**
* Returns error message
*/
const char* what() const noexcept
{
return m_errorMessage.c_str();
}
};
/*************************************************************************************************************************
Class CInputVector
**************************************************************************************************************************/
template <typename T>
class CInputVector {
private:
const T* m_data;
size_t m_size;
public:
CInputVector( const std::vector<T>& vec)
: m_data( vec.data() ), m_size( vec.size() )
{
}
CInputVector( const T* in_data, size_t in_size)
: m_data( in_data ), m_size(in_size )
{
}
const T* data() const
{
return m_data;
}
size_t size() const
{
return m_size;
}
};
// declare deprecated class name
template<typename T>
using CCalculationInputVector = CInputVector<T>;
/*************************************************************************************************************************
Class CWrapper
**************************************************************************************************************************/
class CWrapper {
public:
CWrapper(void* pSymbolLookupMethod)
{
CheckError(nullptr, initWrapperTable(&m_WrapperTable));
CheckError(nullptr, loadWrapperTableFromSymbolLookupMethod(&m_WrapperTable, pSymbolLookupMethod));
CheckError(nullptr, checkBinaryVersion());
}
CWrapper(const std::string &sFileName)
{
CheckError(nullptr, initWrapperTable(&m_WrapperTable));
CheckError(nullptr, loadWrapperTable(&m_WrapperTable, sFileName.c_str()));
CheckError(nullptr, checkBinaryVersion());
}
static PWrapper loadLibrary(const std::string &sFileName)
{
return std::make_shared<CWrapper>(sFileName);
}
static PWrapper loadLibraryFromSymbolLookupMethod(void* pSymbolLookupMethod)
{
return std::make_shared<CWrapper>(pSymbolLookupMethod);
}
~CWrapper()
{
releaseWrapperTable(&m_WrapperTable);
}
inline void CheckError(CBase * pBaseClass, CalculationResult nResult);
inline PCalculator CreateCalculator();
inline void GetVersion(Calculation_uint32 & nMajor, Calculation_uint32 & nMinor, Calculation_uint32 & nMicro);
inline bool GetLastError(CBase * pInstance, std::string & sErrorMessage);
inline void ReleaseInstance(CBase * pInstance);
inline void AcquireInstance(CBase * pInstance);
inline void InjectComponent(const std::string & sNameSpace, const Calculation_pvoid pSymbolAddressMethod);
inline Calculation_pvoid GetSymbolLookupMethod();
private:
sCalculationDynamicWrapperTable m_WrapperTable;
// Injected Components
Numbers::PWrapper m_pNumbersWrapper;
CalculationResult checkBinaryVersion()
{
Calculation_uint32 nMajor, nMinor, nMicro;
GetVersion(nMajor, nMinor, nMicro);
if ( (nMajor != CALCULATION_VERSION_MAJOR) || (nMinor < CALCULATION_VERSION_MINOR) ) {
return CALCULATION_ERROR_INCOMPATIBLEBINARYVERSION;
}
return CALCULATION_SUCCESS;
}
CalculationResult initWrapperTable(sCalculationDynamicWrapperTable * pWrapperTable);
CalculationResult releaseWrapperTable(sCalculationDynamicWrapperTable * pWrapperTable);
CalculationResult loadWrapperTable(sCalculationDynamicWrapperTable * pWrapperTable, const char * pLibraryFileName);
CalculationResult loadWrapperTableFromSymbolLookupMethod(sCalculationDynamicWrapperTable * pWrapperTable, void* pSymbolLookupMethod);
friend class CBase;
friend class CCalculator;
};
/*************************************************************************************************************************
Class CBase
**************************************************************************************************************************/
class CBase {
public:
protected:
/* Wrapper Object that created the class. */
CWrapper * m_pWrapper;
/* Handle to Instance in library*/
CalculationHandle m_pHandle;
/* Checks for an Error code and raises Exceptions */
void CheckError(CalculationResult nResult)
{
if (m_pWrapper != nullptr)
m_pWrapper->CheckError(this, nResult);
}
public:
/**
* CBase::CBase - Constructor for Base class.
*/
CBase(CWrapper * pWrapper, CalculationHandle pHandle)
: m_pWrapper(pWrapper), m_pHandle(pHandle)
{
}
/**
* CBase::~CBase - Destructor for Base class.
*/
virtual ~CBase()
{
if (m_pWrapper != nullptr)
m_pWrapper->ReleaseInstance(this);
m_pWrapper = nullptr;
}
/**
* CBase::GetHandle - Returns handle to instance.
*/
CalculationHandle GetHandle()
{
return m_pHandle;
}
friend class CWrapper;
};
/*************************************************************************************************************************
Class CCalculator
**************************************************************************************************************************/
class CCalculator : public CBase {
public:
/**
* CCalculator::CCalculator - Constructor for Calculator class.
*/
CCalculator(CWrapper* pWrapper, CalculationHandle pHandle)
: CBase(pWrapper, pHandle)
{
}
inline void EnlistVariable(Numbers::CVariable * pVariable);
inline Numbers::PVariable GetEnlistedVariable(const Calculation_uint32 nIndex);
inline void ClearVariables();
inline Numbers::PVariable Multiply();
inline Numbers::PVariable Add();
};
/**
* CWrapper::CreateCalculator - Creates a new Calculator instance
* @return New Calculator instance
*/
inline PCalculator CWrapper::CreateCalculator()
{
CalculationHandle hInstance = nullptr;
CheckError(nullptr,m_WrapperTable.m_CreateCalculator(&hInstance));
if (!hInstance) {
CheckError(nullptr,CALCULATION_ERROR_INVALIDPARAM);
}
return std::make_shared<CCalculator>(this, hInstance);
}
/**
* CWrapper::GetVersion - retrieves the binary version of this library.
* @param[out] nMajor - returns the major version of this library
* @param[out] nMinor - returns the minor version of this library
* @param[out] nMicro - returns the micro version of this library
*/
inline void CWrapper::GetVersion(Calculation_uint32 & nMajor, Calculation_uint32 & nMinor, Calculation_uint32 & nMicro)
{
CheckError(nullptr,m_WrapperTable.m_GetVersion(&nMajor, &nMinor, &nMicro));
}
/**
* CWrapper::GetLastError - Returns the last error recorded on this object
* @param[in] pInstance - Instance Handle
* @param[out] sErrorMessage - Message of the last error
* @return Is there a last error to query
*/
inline bool CWrapper::GetLastError(CBase * pInstance, std::string & sErrorMessage)
{
CalculationHandle hInstance = nullptr;
if (pInstance != nullptr) {
hInstance = pInstance->GetHandle();
};
Calculation_uint32 bytesNeededErrorMessage = 0;
Calculation_uint32 bytesWrittenErrorMessage = 0;
bool resultHasError = 0;
CheckError(nullptr,m_WrapperTable.m_GetLastError(hInstance, 0, &bytesNeededErrorMessage, nullptr, &resultHasError));
std::vector<char> bufferErrorMessage(bytesNeededErrorMessage);
CheckError(nullptr,m_WrapperTable.m_GetLastError(hInstance, bytesNeededErrorMessage, &bytesWrittenErrorMessage, &bufferErrorMessage[0], &resultHasError));
sErrorMessage = std::string(&bufferErrorMessage[0]);
return resultHasError;
}
/**
* CWrapper::ReleaseInstance - Releases shared ownership of an Instance
* @param[in] pInstance - Instance Handle
*/
inline void CWrapper::ReleaseInstance(CBase * pInstance)
{
CalculationHandle hInstance = nullptr;
if (pInstance != nullptr) {
hInstance = pInstance->GetHandle();
};
CheckError(nullptr,m_WrapperTable.m_ReleaseInstance(hInstance));
}
/**
* CWrapper::AcquireInstance - Acquires shared ownership of an Instance
* @param[in] pInstance - Instance Handle
*/
inline void CWrapper::AcquireInstance(CBase * pInstance)
{
CalculationHandle hInstance = nullptr;
if (pInstance != nullptr) {
hInstance = pInstance->GetHandle();
};
CheckError(nullptr,m_WrapperTable.m_AcquireInstance(hInstance));
}
/**
* CWrapper::InjectComponent - Injects an imported component for usage within this component
* @param[in] sNameSpace - NameSpace of the injected component
* @param[in] pSymbolAddressMethod - Address of the SymbolAddressMethod of the injected component
*/
inline void CWrapper::InjectComponent(const std::string & sNameSpace, const Calculation_pvoid pSymbolAddressMethod)
{
CheckError(nullptr,m_WrapperTable.m_InjectComponent(sNameSpace.c_str(), pSymbolAddressMethod));
bool bNameSpaceFound = false;
if (sNameSpace == "Numbers") {
if (m_pNumbersWrapper != nullptr) {
throw ECalculationException(CALCULATION_ERROR_COULDNOTLOADLIBRARY, "Library with namespace " + sNameSpace + " is already registered.");
}
m_pNumbersWrapper = Numbers::CWrapper::loadLibraryFromSymbolLookupMethod(pSymbolAddressMethod);
bNameSpaceFound = true;
}
if (!bNameSpaceFound)
throw ECalculationException(CALCULATION_ERROR_COULDNOTLOADLIBRARY, "Unknown namespace " + sNameSpace);
}
/**
* CWrapper::GetSymbolLookupMethod - Returns the address of the SymbolLookupMethod
* @return Address of the SymbolAddressMethod
*/
inline Calculation_pvoid CWrapper::GetSymbolLookupMethod()
{
Calculation_pvoid resultSymbolLookupMethod = 0;
CheckError(nullptr,m_WrapperTable.m_GetSymbolLookupMethod(&resultSymbolLookupMethod));
return resultSymbolLookupMethod;
}
inline void CWrapper::CheckError(CBase * pBaseClass, CalculationResult nResult)
{
if (nResult != 0) {
std::string sErrorMessage;
if (pBaseClass != nullptr) {
GetLastError(pBaseClass, sErrorMessage);
}
throw ECalculationException(nResult, sErrorMessage);
}
}
inline CalculationResult CWrapper::initWrapperTable(sCalculationDynamicWrapperTable * pWrapperTable)
{
if (pWrapperTable == nullptr)
return CALCULATION_ERROR_INVALIDPARAM;
pWrapperTable->m_LibraryHandle = nullptr;
pWrapperTable->m_Calculator_EnlistVariable = nullptr;
pWrapperTable->m_Calculator_GetEnlistedVariable = nullptr;
pWrapperTable->m_Calculator_ClearVariables = nullptr;
pWrapperTable->m_Calculator_Multiply = nullptr;
pWrapperTable->m_Calculator_Add = nullptr;
pWrapperTable->m_CreateCalculator = nullptr;
pWrapperTable->m_GetVersion = nullptr;
pWrapperTable->m_GetLastError = nullptr;
pWrapperTable->m_ReleaseInstance = nullptr;
pWrapperTable->m_AcquireInstance = nullptr;
pWrapperTable->m_InjectComponent = nullptr;
pWrapperTable->m_GetSymbolLookupMethod = nullptr;
return CALCULATION_SUCCESS;
}
inline CalculationResult CWrapper::releaseWrapperTable(sCalculationDynamicWrapperTable * pWrapperTable)
{
if (pWrapperTable == nullptr)
return CALCULATION_ERROR_INVALIDPARAM;
if (pWrapperTable->m_LibraryHandle != nullptr) {
#ifdef _WIN32
HMODULE hModule = (HMODULE) pWrapperTable->m_LibraryHandle;
FreeLibrary(hModule);
#else // _WIN32
dlclose(pWrapperTable->m_LibraryHandle);
#endif // _WIN32
return initWrapperTable(pWrapperTable);
}
return CALCULATION_SUCCESS;
}
inline CalculationResult CWrapper::loadWrapperTable(sCalculationDynamicWrapperTable * pWrapperTable, const char * pLibraryFileName)
{
if (pWrapperTable == nullptr)
return CALCULATION_ERROR_INVALIDPARAM;
if (pLibraryFileName == nullptr)
return CALCULATION_ERROR_INVALIDPARAM;
#ifdef _WIN32
// Convert filename to UTF16-string
int nLength = (int)strlen(pLibraryFileName);
int nBufferSize = nLength * 2 + 2;
std::vector<wchar_t> wsLibraryFileName(nBufferSize);
int nResult = MultiByteToWideChar(CP_UTF8, 0, pLibraryFileName, nLength, &wsLibraryFileName[0], nBufferSize);
if (nResult == 0)
return CALCULATION_ERROR_COULDNOTLOADLIBRARY;
HMODULE hLibrary = LoadLibraryW(wsLibraryFileName.data());
if (hLibrary == 0)
return CALCULATION_ERROR_COULDNOTLOADLIBRARY;
#else // _WIN32
void* hLibrary = dlopen(pLibraryFileName, RTLD_LAZY);
if (hLibrary == 0)
return CALCULATION_ERROR_COULDNOTLOADLIBRARY;
dlerror();
#endif // _WIN32
#ifdef _WIN32
pWrapperTable->m_Calculator_EnlistVariable = (PCalculationCalculator_EnlistVariablePtr) GetProcAddress(hLibrary, "calculation_calculator_enlistvariable");
#else // _WIN32
pWrapperTable->m_Calculator_EnlistVariable = (PCalculationCalculator_EnlistVariablePtr) dlsym(hLibrary, "calculation_calculator_enlistvariable");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_Calculator_EnlistVariable == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_Calculator_GetEnlistedVariable = (PCalculationCalculator_GetEnlistedVariablePtr) GetProcAddress(hLibrary, "calculation_calculator_getenlistedvariable");
#else // _WIN32
pWrapperTable->m_Calculator_GetEnlistedVariable = (PCalculationCalculator_GetEnlistedVariablePtr) dlsym(hLibrary, "calculation_calculator_getenlistedvariable");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_Calculator_GetEnlistedVariable == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_Calculator_ClearVariables = (PCalculationCalculator_ClearVariablesPtr) GetProcAddress(hLibrary, "calculation_calculator_clearvariables");
#else // _WIN32
pWrapperTable->m_Calculator_ClearVariables = (PCalculationCalculator_ClearVariablesPtr) dlsym(hLibrary, "calculation_calculator_clearvariables");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_Calculator_ClearVariables == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_Calculator_Multiply = (PCalculationCalculator_MultiplyPtr) GetProcAddress(hLibrary, "calculation_calculator_multiply");
#else // _WIN32
pWrapperTable->m_Calculator_Multiply = (PCalculationCalculator_MultiplyPtr) dlsym(hLibrary, "calculation_calculator_multiply");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_Calculator_Multiply == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_Calculator_Add = (PCalculationCalculator_AddPtr) GetProcAddress(hLibrary, "calculation_calculator_add");
#else // _WIN32
pWrapperTable->m_Calculator_Add = (PCalculationCalculator_AddPtr) dlsym(hLibrary, "calculation_calculator_add");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_Calculator_Add == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_CreateCalculator = (PCalculationCreateCalculatorPtr) GetProcAddress(hLibrary, "calculation_createcalculator");
#else // _WIN32
pWrapperTable->m_CreateCalculator = (PCalculationCreateCalculatorPtr) dlsym(hLibrary, "calculation_createcalculator");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_CreateCalculator == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_GetVersion = (PCalculationGetVersionPtr) GetProcAddress(hLibrary, "calculation_getversion");
#else // _WIN32
pWrapperTable->m_GetVersion = (PCalculationGetVersionPtr) dlsym(hLibrary, "calculation_getversion");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_GetVersion == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_GetLastError = (PCalculationGetLastErrorPtr) GetProcAddress(hLibrary, "calculation_getlasterror");
#else // _WIN32
pWrapperTable->m_GetLastError = (PCalculationGetLastErrorPtr) dlsym(hLibrary, "calculation_getlasterror");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_GetLastError == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_ReleaseInstance = (PCalculationReleaseInstancePtr) GetProcAddress(hLibrary, "calculation_releaseinstance");
#else // _WIN32
pWrapperTable->m_ReleaseInstance = (PCalculationReleaseInstancePtr) dlsym(hLibrary, "calculation_releaseinstance");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_ReleaseInstance == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_AcquireInstance = (PCalculationAcquireInstancePtr) GetProcAddress(hLibrary, "calculation_acquireinstance");
#else // _WIN32
pWrapperTable->m_AcquireInstance = (PCalculationAcquireInstancePtr) dlsym(hLibrary, "calculation_acquireinstance");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_AcquireInstance == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_InjectComponent = (PCalculationInjectComponentPtr) GetProcAddress(hLibrary, "calculation_injectcomponent");
#else // _WIN32
pWrapperTable->m_InjectComponent = (PCalculationInjectComponentPtr) dlsym(hLibrary, "calculation_injectcomponent");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_InjectComponent == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
#ifdef _WIN32
pWrapperTable->m_GetSymbolLookupMethod = (PCalculationGetSymbolLookupMethodPtr) GetProcAddress(hLibrary, "calculation_getsymbollookupmethod");
#else // _WIN32
pWrapperTable->m_GetSymbolLookupMethod = (PCalculationGetSymbolLookupMethodPtr) dlsym(hLibrary, "calculation_getsymbollookupmethod");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_GetSymbolLookupMethod == nullptr)
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
pWrapperTable->m_LibraryHandle = hLibrary;
return CALCULATION_SUCCESS;
}
inline CalculationResult CWrapper::loadWrapperTableFromSymbolLookupMethod(sCalculationDynamicWrapperTable * pWrapperTable, void* pSymbolLookupMethod)
{
if (pWrapperTable == nullptr)
return CALCULATION_ERROR_INVALIDPARAM;
if (pSymbolLookupMethod == nullptr)
return CALCULATION_ERROR_INVALIDPARAM;
typedef CalculationResult(*SymbolLookupType)(const char*, void**);
SymbolLookupType pLookup = (SymbolLookupType)pSymbolLookupMethod;
CalculationResult eLookupError = CALCULATION_SUCCESS;
eLookupError = (*pLookup)("calculation_calculator_enlistvariable", (void**)&(pWrapperTable->m_Calculator_EnlistVariable));
if ( (eLookupError != 0) || (pWrapperTable->m_Calculator_EnlistVariable == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_calculator_getenlistedvariable", (void**)&(pWrapperTable->m_Calculator_GetEnlistedVariable));
if ( (eLookupError != 0) || (pWrapperTable->m_Calculator_GetEnlistedVariable == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_calculator_clearvariables", (void**)&(pWrapperTable->m_Calculator_ClearVariables));
if ( (eLookupError != 0) || (pWrapperTable->m_Calculator_ClearVariables == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_calculator_multiply", (void**)&(pWrapperTable->m_Calculator_Multiply));
if ( (eLookupError != 0) || (pWrapperTable->m_Calculator_Multiply == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_calculator_add", (void**)&(pWrapperTable->m_Calculator_Add));
if ( (eLookupError != 0) || (pWrapperTable->m_Calculator_Add == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_createcalculator", (void**)&(pWrapperTable->m_CreateCalculator));
if ( (eLookupError != 0) || (pWrapperTable->m_CreateCalculator == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_getversion", (void**)&(pWrapperTable->m_GetVersion));
if ( (eLookupError != 0) || (pWrapperTable->m_GetVersion == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_getlasterror", (void**)&(pWrapperTable->m_GetLastError));
if ( (eLookupError != 0) || (pWrapperTable->m_GetLastError == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_releaseinstance", (void**)&(pWrapperTable->m_ReleaseInstance));
if ( (eLookupError != 0) || (pWrapperTable->m_ReleaseInstance == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_acquireinstance", (void**)&(pWrapperTable->m_AcquireInstance));
if ( (eLookupError != 0) || (pWrapperTable->m_AcquireInstance == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_injectcomponent", (void**)&(pWrapperTable->m_InjectComponent));
if ( (eLookupError != 0) || (pWrapperTable->m_InjectComponent == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
eLookupError = (*pLookup)("calculation_getsymbollookupmethod", (void**)&(pWrapperTable->m_GetSymbolLookupMethod));
if ( (eLookupError != 0) || (pWrapperTable->m_GetSymbolLookupMethod == nullptr) )
return CALCULATION_ERROR_COULDNOTFINDLIBRARYEXPORT;
return CALCULATION_SUCCESS;
}
/**
* Method definitions for class CBase
*/
/**
* Method definitions for class CCalculator
*/
/**
* CCalculator::EnlistVariable - Adds a Variable to the list of Variables this calculator works on
* @param[in] pVariable - The new variable in this calculator
*/
void CCalculator::EnlistVariable(Numbers::CVariable * pVariable)
{
NumbersHandle hVariable = nullptr;
if (pVariable != nullptr) {
hVariable = pVariable->GetHandle();
};
CheckError(m_pWrapper->m_WrapperTable.m_Calculator_EnlistVariable(m_pHandle, hVariable));
}
/**
* CCalculator::GetEnlistedVariable - Returns an instance of a enlisted variable
* @param[in] nIndex - The index of the variable to query
* @return The Index-th variable in this calculator
*/
Numbers::PVariable CCalculator::GetEnlistedVariable(const Calculation_uint32 nIndex)
{
CalculationHandle hVariable = nullptr;
CheckError(m_pWrapper->m_WrapperTable.m_Calculator_GetEnlistedVariable(m_pHandle, nIndex, &hVariable));
if (!hVariable) {
CheckError(CALCULATION_ERROR_INVALIDPARAM);
}
return std::make_shared<Numbers::CVariable>(m_pWrapper->m_pNumbersWrapper.get(), hVariable);
}
/**
* CCalculator::ClearVariables - Clears all variables in enlisted in this calculator
*/
void CCalculator::ClearVariables()
{
CheckError(m_pWrapper->m_WrapperTable.m_Calculator_ClearVariables(m_pHandle));
}
/**
* CCalculator::Multiply - Multiplies all enlisted variables
* @return Variable that holds the product of all enlisted Variables
*/
Numbers::PVariable CCalculator::Multiply()
{
CalculationHandle hInstance = nullptr;
CheckError(m_pWrapper->m_WrapperTable.m_Calculator_Multiply(m_pHandle, &hInstance));
if (!hInstance) {
CheckError(CALCULATION_ERROR_INVALIDPARAM);
}
return std::make_shared<Numbers::CVariable>(m_pWrapper->m_pNumbersWrapper.get(), hInstance);
}
/**
* CCalculator::Add - Sums all enlisted variables
* @return Variable that holds the sum of all enlisted Variables
*/
Numbers::PVariable CCalculator::Add()
{
CalculationHandle hInstance = nullptr;
CheckError(m_pWrapper->m_WrapperTable.m_Calculator_Add(m_pHandle, &hInstance));
if (!hInstance) {
CheckError(CALCULATION_ERROR_INVALIDPARAM);
}
return std::make_shared<Numbers::CVariable>(m_pWrapper->m_pNumbersWrapper.get(), hInstance);
}
} // namespace Calculation
#endif // __CALCULATION_CPPHEADER_DYNAMIC_CPP
| 36.113855 | 171 | 0.708246 | anpilog |
6cdd0700835acce3b9f0a7eecc334691a0caa36b | 1,418 | cpp | C++ | master/master_thread.cpp | RickAi/csci5570 | 2814c0a6bf608c73bf81d015d13e63443470e457 | [
"Apache-2.0"
] | 7 | 2019-04-09T16:25:49.000Z | 2021-12-07T10:29:52.000Z | master/master_thread.cpp | RickAi/csci5570 | 2814c0a6bf608c73bf81d015d13e63443470e457 | [
"Apache-2.0"
] | null | null | null | master/master_thread.cpp | RickAi/csci5570 | 2814c0a6bf608c73bf81d015d13e63443470e457 | [
"Apache-2.0"
] | 4 | 2019-08-07T07:43:27.000Z | 2021-05-21T07:54:14.000Z |
//
// Created by aiyongbiao on 2018/11/10.
//
#include <base/node.hpp>
#include "master_thread.hpp"
#include "glog/logging.h"
namespace minips {
void MasterThread::Main() {
Init();
while (serving_) {
Message msg;
work_queue_.WaitAndPop(&msg);
if (msg.meta.flag == Flag::kQuitHeartBeat) {
quit_count_++;
// LOG(INFO) << "MasterThread heartbeat quit serving on process:" << quit_count_;
if (quit_count_ >= heartbeats_.size()) {
serving_ = false;
LOG(INFO) << "[Master] master process quit.";
exit(0);
// return;
}
}
if (msg.meta.flag == Flag::kHeartBeat) {
heartbeats_[msg.meta.sender] = time(NULL);
if (msg.meta.sender == recovering_node_id_) {
LOG(INFO) << "[Master] send rollback message to other nodes.";
SetRecoveringNodeId(-1);
RollBack(msg.meta.sender);
}
LOG(INFO) << "[Master] heartbeat updated on node:" << msg.meta.sender;
}
if (msg.meta.flag == Flag::kScale) {
LOG(INFO) << "[Master] send rollback message to other nodes for scale.";
ScaleRollBack(msg.meta.sender);
}
}
}
} | 30.170213 | 96 | 0.483075 | RickAi |
6cdd5dc76cd908597ac166ac042fbb769a0e0e65 | 3,338 | cpp | C++ | debugger/cinder/blocks/PretzelGui/src/modules/PretzelTextField.cpp | VincentPT/xscript | cea6ee9e8c5af87af75188695ffa89080dce49b8 | [
"MIT"
] | 2 | 2019-03-05T09:57:54.000Z | 2022-02-14T12:42:01.000Z | src/cinder/blocks/PretzelGui/src/modules/PretzelTextField.cpp | VincentPT/buzz | edaaf4b60e8ef94eda63471ddfb1afd285b6ab38 | [
"MIT"
] | null | null | null | src/cinder/blocks/PretzelGui/src/modules/PretzelTextField.cpp | VincentPT/buzz | edaaf4b60e8ef94eda63471ddfb1afd285b6ab38 | [
"MIT"
] | 1 | 2019-12-24T22:24:01.000Z | 2019-12-24T22:24:01.000Z | #include "PretzelTextField.h"
#include "cinder/app/App.h"
#include "cinder/app/Window.h"
#include "cinder/Utilities.h"
//#include "NSCursor.h"
using namespace ci;
using namespace ci::app;
using namespace std;
namespace pretzel{
PretzelTextField::PretzelTextField(BasePretzel *parent, std::string labelText, std::string *variable, bool editable) : BasePretzel() {
mBounds.set(0, 0, 200, 26);
bEditable = editable;
bHover = false;
bEditing = false;
mLabelText = labelText;
mVariable = variable;
mLabelSize = mGlobal->guiFont->measureString(mLabelText);
mInputSize = mGlobal->guiFont->measureString(*variable);
type = WidgetType::TEXTFIELD;
if(bEditable) mGlobal->addSaveParam(labelText, variable);
parent->registerPretzel(this);
}
void PretzelTextField::updateBounds(const ci::vec2 &offset, const ci::Rectf &parentBounds) {
BasePretzel::updateBounds(offset, parentBounds);
// this could be cleaner
mTextFieldBounds = Rectf(mLabelSize.x + 25, mBounds.y1 + 5, mBounds.x2 - 10, mBounds.y2 - 5);
}
void PretzelTextField::mouseDown(const ci::vec2 &pos){
if (bEditable && mTextFieldBounds.contains(pos - mOffset)){
bEditing = true;
}
else{
bEditing = false;
}
}
void PretzelTextField::mouseMoved(const ci::vec2 &pos){
if (bEditable && mTextFieldBounds.contains(pos - mOffset)){
bHover = true;
mGlobal->setCursor( CursorType::IBEAM );
}
else{
if( bHover ){
mGlobal->setCursor( CursorType::ARROW );
}
bHover = false;
}
}
// Mayus and character combinations not working yet
void PretzelTextField::keyDown(const char &key, const int &keyCode){
if (bEditing){
if (keyCode == KeyEvent::KEY_ESCAPE || keyCode == KeyEvent::KEY_RETURN){
bEditing = false;
}
else if (keyCode == KeyEvent::KEY_BACKSPACE && !mVariable->empty()){
mVariable->pop_back();
}
else if (keyCode > 31 && keyCode < 127){ //printable characters
mVariable->push_back(key);
}
mInputSize = mGlobal->guiFont->measureString(*mVariable);
}
}
void PretzelTextField::draw(){
gl::pushMatrices(); {
gl::translate(mOffset);
if(bEditing){
gl::color(mGlobal->P_HOVER_COLOR);
}
else if (bHover){
gl::color(mGlobal->P_TAB_COLOR);
}
else{
gl::color(mGlobal->P_BG_COLOR);
}
PWindow()->drawSolidRect(mTextFieldBounds);
gl::color(mGlobal->P_HIGHLIGHT_COLOR);
PWindow()->drawLine(mTextFieldBounds.getLowerLeft() + vec2(0, 1), mTextFieldBounds.getLowerRight() + vec2(0, 1));
gl::color(mGlobal->P_OUTLINE_COLOR);
PWindow()->drawStrokedRect(mTextFieldBounds);
mGlobal->renderText(mLabelText, mBounds.getUpperLeft() + vec2(12, 5));
mGlobal->renderText(*mVariable, mTextFieldBounds.getUpperLeft() + vec2(2, 0));
// cursor line
if (bEditing && (app::getElapsedSeconds() - (long)app::getElapsedSeconds()) < 0.5 ){
float x = mTextFieldBounds.getUpperLeft().x + mInputSize.x + 4;
gl::color(mGlobal->P_TEXT_COLOR);
PWindow()->drawLine(vec2(x, mTextFieldBounds.y1 + 2), vec2(x, mTextFieldBounds.y2 - 2));
}
}gl::popMatrices();
}
}
| 31.490566 | 135 | 0.632415 | VincentPT |
6cdf627a815fdfcb3290bbf8b3724d31c7686ac2 | 4,345 | cpp | C++ | engine/foundation/osal/thread/task.cpp | openharmony-gitee-mirror/multimedia_histreamer | 4ef8cea6605de39f058f158a03d8f57a51b338ff | [
"Apache-2.0"
] | 1 | 2021-12-03T13:55:09.000Z | 2021-12-03T13:55:09.000Z | engine/foundation/osal/thread/task.cpp | openharmony-gitee-mirror/multimedia_histreamer | 4ef8cea6605de39f058f158a03d8f57a51b338ff | [
"Apache-2.0"
] | null | null | null | engine/foundation/osal/thread/task.cpp | openharmony-gitee-mirror/multimedia_histreamer | 4ef8cea6605de39f058f158a03d8f57a51b338ff | [
"Apache-2.0"
] | 1 | 2021-09-13T11:18:18.000Z | 2021-09-13T11:18:18.000Z | /*
* Copyright (c) 2021-2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define HST_LOG_TAG "Task"
#include "task.h"
#include "foundation/log.h"
namespace OHOS {
namespace Media {
namespace OSAL {
Task::Task(std::string name, ThreadPriority priority)
: name_(std::move(name)), runningState_(RunningState::PAUSED), loop_(priority)
{
MEDIA_LOG_D("task %s ctor called", name_.c_str());
loop_.SetName(name_);
}
Task::Task(std::string name, std::function<void()> handler, ThreadPriority priority) : Task(std::move(name), priority)
{
MEDIA_LOG_D("task %s ctor called", name_.c_str());
handler_ = std::move(handler);
}
Task::~Task()
{
MEDIA_LOG_D("task %s dtor called", name_.c_str());
runningState_ = RunningState::STOPPED;
syncCond_.NotifyAll();
}
void Task::Start()
{
#ifndef START_FAKE_TASK
OSAL::ScopedLock lock(stateMutex_);
runningState_ = RunningState::STARTED;
if (!loop_ && !loop_.CreateThread([this] { Run(); })) {
MEDIA_LOG_E("task %s create failed", name_.c_str());
} else {
syncCond_.NotifyAll();
}
MEDIA_LOG_D("task %s start called", name_.c_str());
#endif
}
void Task::Stop()
{
MEDIA_LOG_W("task %s stop entered, current state: %d", name_.c_str(), runningState_.load());
OSAL::ScopedLock lock(stateMutex_);
if (runningState_.load() != RunningState::STOPPED) {
runningState_ = RunningState::STOPPING;
syncCond_.NotifyAll();
syncCond_.Wait(lock, [this] { return runningState_.load() == RunningState::STOPPED; });
}
MEDIA_LOG_W("task %s stop exited", name_.c_str());
}
void Task::Pause()
{
MEDIA_LOG_D("task %s Pause called", name_.c_str());
OSAL::ScopedLock lock(stateMutex_);
switch (runningState_.load()) {
case RunningState::STARTED: {
runningState_ = RunningState::PAUSING;
syncCond_.Wait(lock, [this] {
return runningState_.load() == RunningState::PAUSED || runningState_.load() == RunningState::STOPPED;
});
break;
}
case RunningState::STOPPING: {
syncCond_.Wait(lock, [this] { return runningState_.load() == RunningState::STOPPED; });
break;
}
case RunningState::PAUSING: {
syncCond_.Wait(lock, [this] { return runningState_.load() == RunningState::PAUSED; });
break;
}
default:
break;
}
MEDIA_LOG_D("task %s Pause done.", name_.c_str());
}
void Task::PauseAsync()
{
MEDIA_LOG_D("task %s PauseAsync called", name_.c_str());
OSAL::ScopedLock lock(stateMutex_);
if (runningState_.load() == RunningState::STARTED) {
runningState_ = RunningState::PAUSING;
}
}
void Task::RegisterHandler(std::function<void()> handler)
{
MEDIA_LOG_D("task %s RegisterHandler called", name_.c_str());
handler_ = std::move(handler);
}
void Task::DoTask()
{
MEDIA_LOG_D("task %s not override DoTask...", name_.c_str());
}
void Task::Run()
{
for (;;) {
if (runningState_.load() == RunningState::STARTED) {
handler_();
}
OSAL::ScopedLock lock(stateMutex_);
if (runningState_.load() == RunningState::PAUSING || runningState_.load() == RunningState::PAUSED) {
runningState_ = RunningState::PAUSED;
syncCond_.NotifyAll();
constexpr int timeoutMs = 500;
syncCond_.WaitFor(lock, timeoutMs, [this] { return runningState_.load() != RunningState::PAUSED; });
}
if (runningState_.load() == RunningState::STOPPING || runningState_.load() == RunningState::STOPPED) {
runningState_ = RunningState::STOPPED;
syncCond_.NotifyAll();
break;
}
}
}
} // namespace OSAL
} // namespace Media
} // namespace OHOS
| 31.035714 | 118 | 0.635903 | openharmony-gitee-mirror |
6ce05210fa239fcfafda723fa83f2ebdb5b58742 | 2,130 | cc | C++ | chrome/browser/sync/sessions/browser_list_router_helper.cc | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | chrome/browser/sync/sessions/browser_list_router_helper.cc | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | chrome/browser/sync/sessions/browser_list_router_helper.cc | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/sync/sessions/browser_list_router_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
namespace sync_sessions {
BrowserListRouterHelper::BrowserListRouterHelper(
SyncSessionsWebContentsRouter* router,
Profile* profile)
: router_(router), profile_(profile) {
BrowserList* browser_list = BrowserList::GetInstance();
for (Browser* browser : *browser_list) {
if (browser->profile() == profile_) {
browser->tab_strip_model()->AddObserver(this);
}
}
browser_list->AddObserver(this);
}
BrowserListRouterHelper::~BrowserListRouterHelper() {
BrowserList::GetInstance()->RemoveObserver(this);
}
void BrowserListRouterHelper::OnBrowserAdded(Browser* browser) {
if (browser->profile() == profile_) {
browser->tab_strip_model()->AddObserver(this);
}
}
void BrowserListRouterHelper::OnBrowserRemoved(Browser* browser) {
if (browser->profile() == profile_) {
browser->tab_strip_model()->RemoveObserver(this);
}
}
void BrowserListRouterHelper::OnTabStripModelChanged(
TabStripModel* tab_strip_model,
const TabStripModelChange& change,
const TabStripSelectionChange& selection) {
std::vector<content::WebContents*> web_contents;
if (change.type() == TabStripModelChange::kInserted) {
for (const auto& contents : change.GetInsert()->contents)
web_contents.push_back(contents.contents);
} else if (change.type() == TabStripModelChange::kReplaced) {
web_contents.push_back(change.GetReplace()->new_contents);
} else {
return;
}
for (auto* contents : web_contents) {
if (Profile::FromBrowserContext(contents->GetBrowserContext()) ==
profile_) {
router_->NotifyTabModified(contents, false);
}
}
}
} // namespace sync_sessions
| 31.791045 | 73 | 0.73615 | zealoussnow |
6ce4129fd2d4dae8e467330a9ca1f2a9e7b5370b | 667 | cpp | C++ | LeetCode/Solutions/LC0494.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 54 | 2019-05-13T12:13:09.000Z | 2022-02-27T02:59:00.000Z | LeetCode/Solutions/LC0494.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 2 | 2020-10-02T07:16:43.000Z | 2020-10-19T04:36:19.000Z | LeetCode/Solutions/LC0494.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 20 | 2020-05-26T09:48:13.000Z | 2022-03-18T15:18:27.000Z | /*
Problem Statement: https://leetcode.com/problems/target-sum/
Time: O(n • k)
Space: O(n • k)
Author: Mohammed Shoaib, github.com/Mohammed-Shoaib
*/
class Solution {
public:
int findTargetSumWays(vector<int>& nums, int S) {
int n, k, sum;
n = nums.size();
sum = accumulate(nums.begin(), nums.end(), 0);
k = 2 * sum + 1;
// base cases
if (S < -sum || S > sum)
return 0;
vector<int> prev, dp(k);
dp[sum] = 1;
// dynamic programming
for (int& x: nums) {
prev = exchange(dp, vector<int>(k));
for (int i = 0; i < k; i++)
if (prev[i]) {
dp[i + x] += prev[i];
dp[i - x] += prev[i];
}
}
return dp[sum + S];
}
}; | 19.617647 | 60 | 0.547226 | Mohammed-Shoaib |
6ce8248920b7bd8fbccc61129ee19c620424980a | 27,192 | cxx | C++ | dune/xt/data/spherical_quadratures/octant_quadrature/data/order_12.cxx | dune-community/dune-xt-data | 32593bbcd52ed69b0a11963400a9173740089a75 | [
"BSD-2-Clause"
] | 1 | 2020-02-08T04:09:11.000Z | 2020-02-08T04:09:11.000Z | dune/xt/data/spherical_quadratures/octant_quadrature/data/order_12.cxx | dune-community/dune-xt-data | 32593bbcd52ed69b0a11963400a9173740089a75 | [
"BSD-2-Clause"
] | 40 | 2018-08-26T08:34:34.000Z | 2021-09-28T13:01:55.000Z | dune/xt/data/spherical_quadratures/octant_quadrature/data/order_12.cxx | dune-community/dune-xt-data | 32593bbcd52ed69b0a11963400a9173740089a75 | [
"BSD-2-Clause"
] | 1 | 2020-02-08T04:10:14.000Z | 2020-02-08T04:10:14.000Z | // This file is part of the dune-xt-data project:
// https://github.com/dune-community/dune-xt-data
// Copyright 2009-2018 dune-xt-data developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
// with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
// René Fritze (2018)
// Tobias Leibner (2018 - 2019)
#include "../octant_quadrature_data.hh"
namespace Dune::XT::Data {
template <>
std::vector<std::vector<std::vector<double>>> OctantQuadratureData<12>::get()
{
return {
{{0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525},
{0.013008, 0.013008, 0.013008, 0.013008, 0.013008, 0.013008, 0.013008, 0.013008, 0.067445, 0.067445, 0.067445,
0.067445, 0.067445, 0.067445, 0.067445, 0.067445, 0.16116, 0.16116, 0.16116, 0.16116, 0.16116, 0.16116,
0.16116, 0.16116, 0.28781, 0.28781, 0.28781, 0.28781, 0.28781, 0.28781, 0.28781, 0.28781, 0.43963,
0.43963, 0.43963, 0.43963, 0.43963, 0.43963, 0.43963, 0.43963, 0.60831, 0.60831, 0.60831, 0.60831,
0.60831, 0.60831, 0.60831, 0.60831, 0.7854, 0.7854, 0.7854, 0.7854, 0.7854, 0.7854, 0.7854,
0.7854, 0.96249, 0.96249, 0.96249, 0.96249, 0.96249, 0.96249, 0.96249, 0.96249, 1.1312, 1.1312,
1.1312, 1.1312, 1.1312, 1.1312, 1.1312, 1.1312, 1.283, 1.283, 1.283, 1.283, 1.283,
1.283, 1.283, 1.283, 1.4096, 1.4096, 1.4096, 1.4096, 1.4096, 1.4096, 1.4096, 1.4096,
1.5034, 1.5034, 1.5034, 1.5034, 1.5034, 1.5034, 1.5034, 1.5034, 1.5578, 1.5578, 1.5578,
1.5578, 1.5578, 1.5578, 1.5578, 1.5578},
{3.593e-05, 0.00040765, 0.0013799, 0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262, 8.0995e-05,
0.00091893, 0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 0.00012035, 0.0013654,
0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 0.0001519, 0.0017234, 0.0058336,
0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00017466, 0.0019816, 0.0067075, 0.014239,
0.023359, 0.03234, 0.039464, 0.04339, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185,
0.034868, 0.042548, 0.046781, 0.00019284, 0.0021879, 0.007406, 0.015722, 0.025792, 0.035708,
0.043574, 0.047908, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185, 0.034868, 0.042548,
0.046781, 0.00017466, 0.0019816, 0.0067075, 0.014239, 0.023359, 0.03234, 0.039464, 0.04339,
0.0001519, 0.0017234, 0.0058336, 0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00012035,
0.0013654, 0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 8.0995e-05, 0.00091893,
0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 3.593e-05, 0.00040765, 0.0013799,
0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262}},
{{0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525},
{1.5838, 1.5838, 1.5838, 1.5838, 1.5838, 1.5838, 1.5838, 1.5838, 1.6382, 1.6382, 1.6382, 1.6382, 1.6382,
1.6382, 1.6382, 1.6382, 1.732, 1.732, 1.732, 1.732, 1.732, 1.732, 1.732, 1.732, 1.8586, 1.8586,
1.8586, 1.8586, 1.8586, 1.8586, 1.8586, 1.8586, 2.0104, 2.0104, 2.0104, 2.0104, 2.0104, 2.0104, 2.0104,
2.0104, 2.1791, 2.1791, 2.1791, 2.1791, 2.1791, 2.1791, 2.1791, 2.1791, 2.3562, 2.3562, 2.3562, 2.3562,
2.3562, 2.3562, 2.3562, 2.3562, 2.5333, 2.5333, 2.5333, 2.5333, 2.5333, 2.5333, 2.5333, 2.5333, 2.702,
2.702, 2.702, 2.702, 2.702, 2.702, 2.702, 2.702, 2.8538, 2.8538, 2.8538, 2.8538, 2.8538, 2.8538,
2.8538, 2.8538, 2.9804, 2.9804, 2.9804, 2.9804, 2.9804, 2.9804, 2.9804, 2.9804, 3.0741, 3.0741, 3.0741,
3.0741, 3.0741, 3.0741, 3.0741, 3.0741, 3.1286, 3.1286, 3.1286, 3.1286, 3.1286, 3.1286, 3.1286, 3.1286},
{3.593e-05, 0.00040765, 0.0013799, 0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262, 8.0995e-05,
0.00091893, 0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 0.00012035, 0.0013654,
0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 0.0001519, 0.0017234, 0.0058336,
0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00017466, 0.0019816, 0.0067075, 0.014239,
0.023359, 0.03234, 0.039464, 0.04339, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185,
0.034868, 0.042548, 0.046781, 0.00019284, 0.0021879, 0.007406, 0.015722, 0.025792, 0.035708,
0.043574, 0.047908, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185, 0.034868, 0.042548,
0.046781, 0.00017466, 0.0019816, 0.0067075, 0.014239, 0.023359, 0.03234, 0.039464, 0.04339,
0.0001519, 0.0017234, 0.0058336, 0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00012035,
0.0013654, 0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 8.0995e-05, 0.00091893,
0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 3.593e-05, 0.00040765, 0.0013799,
0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262}},
{{0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525},
{3.1546, 3.1546, 3.1546, 3.1546, 3.1546, 3.1546, 3.1546, 3.1546, 3.209, 3.209, 3.209, 3.209, 3.209,
3.209, 3.209, 3.209, 3.3028, 3.3028, 3.3028, 3.3028, 3.3028, 3.3028, 3.3028, 3.3028, 3.4294, 3.4294,
3.4294, 3.4294, 3.4294, 3.4294, 3.4294, 3.4294, 3.5812, 3.5812, 3.5812, 3.5812, 3.5812, 3.5812, 3.5812,
3.5812, 3.7499, 3.7499, 3.7499, 3.7499, 3.7499, 3.7499, 3.7499, 3.7499, 3.927, 3.927, 3.927, 3.927,
3.927, 3.927, 3.927, 3.927, 4.1041, 4.1041, 4.1041, 4.1041, 4.1041, 4.1041, 4.1041, 4.1041, 4.2728,
4.2728, 4.2728, 4.2728, 4.2728, 4.2728, 4.2728, 4.2728, 4.4246, 4.4246, 4.4246, 4.4246, 4.4246, 4.4246,
4.4246, 4.4246, 4.5512, 4.5512, 4.5512, 4.5512, 4.5512, 4.5512, 4.5512, 4.5512, 4.6449, 4.6449, 4.6449,
4.6449, 4.6449, 4.6449, 4.6449, 4.6449, 4.6994, 4.6994, 4.6994, 4.6994, 4.6994, 4.6994, 4.6994, 4.6994},
{3.593e-05, 0.00040765, 0.0013799, 0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262, 8.0995e-05,
0.00091893, 0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 0.00012035, 0.0013654,
0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 0.0001519, 0.0017234, 0.0058336,
0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00017466, 0.0019816, 0.0067075, 0.014239,
0.023359, 0.03234, 0.039464, 0.04339, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185,
0.034868, 0.042548, 0.046781, 0.00019284, 0.0021879, 0.007406, 0.015722, 0.025792, 0.035708,
0.043574, 0.047908, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185, 0.034868, 0.042548,
0.046781, 0.00017466, 0.0019816, 0.0067075, 0.014239, 0.023359, 0.03234, 0.039464, 0.04339,
0.0001519, 0.0017234, 0.0058336, 0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00012035,
0.0013654, 0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 8.0995e-05, 0.00091893,
0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 3.593e-05, 0.00040765, 0.0013799,
0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262}},
{{0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557,
0.78967, 0.61686, 0.39342, 0.13525, 0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525,
0.99979, 0.99442, 0.96915, 0.90557, 0.78967, 0.61686, 0.39342, 0.13525},
{4.7254, 4.7254, 4.7254, 4.7254, 4.7254, 4.7254, 4.7254, 4.7254, 4.7798, 4.7798, 4.7798, 4.7798, 4.7798,
4.7798, 4.7798, 4.7798, 4.8736, 4.8736, 4.8736, 4.8736, 4.8736, 4.8736, 4.8736, 4.8736, 5.0002, 5.0002,
5.0002, 5.0002, 5.0002, 5.0002, 5.0002, 5.0002, 5.152, 5.152, 5.152, 5.152, 5.152, 5.152, 5.152,
5.152, 5.3207, 5.3207, 5.3207, 5.3207, 5.3207, 5.3207, 5.3207, 5.3207, 5.4978, 5.4978, 5.4978, 5.4978,
5.4978, 5.4978, 5.4978, 5.4978, 5.6749, 5.6749, 5.6749, 5.6749, 5.6749, 5.6749, 5.6749, 5.6749, 5.8436,
5.8436, 5.8436, 5.8436, 5.8436, 5.8436, 5.8436, 5.8436, 5.9954, 5.9954, 5.9954, 5.9954, 5.9954, 5.9954,
5.9954, 5.9954, 6.122, 6.122, 6.122, 6.122, 6.122, 6.122, 6.122, 6.122, 6.2157, 6.2157, 6.2157,
6.2157, 6.2157, 6.2157, 6.2157, 6.2157, 6.2702, 6.2702, 6.2702, 6.2702, 6.2702, 6.2702, 6.2702, 6.2702},
{3.593e-05, 0.00040765, 0.0013799, 0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262, 8.0995e-05,
0.00091893, 0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 0.00012035, 0.0013654,
0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 0.0001519, 0.0017234, 0.0058336,
0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00017466, 0.0019816, 0.0067075, 0.014239,
0.023359, 0.03234, 0.039464, 0.04339, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185,
0.034868, 0.042548, 0.046781, 0.00019284, 0.0021879, 0.007406, 0.015722, 0.025792, 0.035708,
0.043574, 0.047908, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185, 0.034868, 0.042548,
0.046781, 0.00017466, 0.0019816, 0.0067075, 0.014239, 0.023359, 0.03234, 0.039464, 0.04339,
0.0001519, 0.0017234, 0.0058336, 0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00012035,
0.0013654, 0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 8.0995e-05, 0.00091893,
0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 3.593e-05, 0.00040765, 0.0013799,
0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262}},
{{-0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915,
-0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686,
-0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979,
-0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557,
-0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342,
-0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442,
-0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967,
-0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525,
-0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915,
-0.90557, -0.78967, -0.61686, -0.39342, -0.13525},
{0.013008, 0.013008, 0.013008, 0.013008, 0.013008, 0.013008, 0.013008, 0.013008, 0.067445, 0.067445, 0.067445,
0.067445, 0.067445, 0.067445, 0.067445, 0.067445, 0.16116, 0.16116, 0.16116, 0.16116, 0.16116, 0.16116,
0.16116, 0.16116, 0.28781, 0.28781, 0.28781, 0.28781, 0.28781, 0.28781, 0.28781, 0.28781, 0.43963,
0.43963, 0.43963, 0.43963, 0.43963, 0.43963, 0.43963, 0.43963, 0.60831, 0.60831, 0.60831, 0.60831,
0.60831, 0.60831, 0.60831, 0.60831, 0.7854, 0.7854, 0.7854, 0.7854, 0.7854, 0.7854, 0.7854,
0.7854, 0.96249, 0.96249, 0.96249, 0.96249, 0.96249, 0.96249, 0.96249, 0.96249, 1.1312, 1.1312,
1.1312, 1.1312, 1.1312, 1.1312, 1.1312, 1.1312, 1.283, 1.283, 1.283, 1.283, 1.283,
1.283, 1.283, 1.283, 1.4096, 1.4096, 1.4096, 1.4096, 1.4096, 1.4096, 1.4096, 1.4096,
1.5034, 1.5034, 1.5034, 1.5034, 1.5034, 1.5034, 1.5034, 1.5034, 1.5578, 1.5578, 1.5578,
1.5578, 1.5578, 1.5578, 1.5578, 1.5578},
{3.593e-05, 0.00040765, 0.0013799, 0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262, 8.0995e-05,
0.00091893, 0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 0.00012035, 0.0013654,
0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 0.0001519, 0.0017234, 0.0058336,
0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00017466, 0.0019816, 0.0067075, 0.014239,
0.023359, 0.03234, 0.039464, 0.04339, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185,
0.034868, 0.042548, 0.046781, 0.00019284, 0.0021879, 0.007406, 0.015722, 0.025792, 0.035708,
0.043574, 0.047908, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185, 0.034868, 0.042548,
0.046781, 0.00017466, 0.0019816, 0.0067075, 0.014239, 0.023359, 0.03234, 0.039464, 0.04339,
0.0001519, 0.0017234, 0.0058336, 0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00012035,
0.0013654, 0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 8.0995e-05, 0.00091893,
0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 3.593e-05, 0.00040765, 0.0013799,
0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262}},
{{-0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915,
-0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686,
-0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979,
-0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557,
-0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342,
-0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442,
-0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967,
-0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525,
-0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915,
-0.90557, -0.78967, -0.61686, -0.39342, -0.13525},
{1.5838, 1.5838, 1.5838, 1.5838, 1.5838, 1.5838, 1.5838, 1.5838, 1.6382, 1.6382, 1.6382, 1.6382, 1.6382,
1.6382, 1.6382, 1.6382, 1.732, 1.732, 1.732, 1.732, 1.732, 1.732, 1.732, 1.732, 1.8586, 1.8586,
1.8586, 1.8586, 1.8586, 1.8586, 1.8586, 1.8586, 2.0104, 2.0104, 2.0104, 2.0104, 2.0104, 2.0104, 2.0104,
2.0104, 2.1791, 2.1791, 2.1791, 2.1791, 2.1791, 2.1791, 2.1791, 2.1791, 2.3562, 2.3562, 2.3562, 2.3562,
2.3562, 2.3562, 2.3562, 2.3562, 2.5333, 2.5333, 2.5333, 2.5333, 2.5333, 2.5333, 2.5333, 2.5333, 2.702,
2.702, 2.702, 2.702, 2.702, 2.702, 2.702, 2.702, 2.8538, 2.8538, 2.8538, 2.8538, 2.8538, 2.8538,
2.8538, 2.8538, 2.9804, 2.9804, 2.9804, 2.9804, 2.9804, 2.9804, 2.9804, 2.9804, 3.0741, 3.0741, 3.0741,
3.0741, 3.0741, 3.0741, 3.0741, 3.0741, 3.1286, 3.1286, 3.1286, 3.1286, 3.1286, 3.1286, 3.1286, 3.1286},
{3.593e-05, 0.00040765, 0.0013799, 0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262, 8.0995e-05,
0.00091893, 0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 0.00012035, 0.0013654,
0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 0.0001519, 0.0017234, 0.0058336,
0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00017466, 0.0019816, 0.0067075, 0.014239,
0.023359, 0.03234, 0.039464, 0.04339, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185,
0.034868, 0.042548, 0.046781, 0.00019284, 0.0021879, 0.007406, 0.015722, 0.025792, 0.035708,
0.043574, 0.047908, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185, 0.034868, 0.042548,
0.046781, 0.00017466, 0.0019816, 0.0067075, 0.014239, 0.023359, 0.03234, 0.039464, 0.04339,
0.0001519, 0.0017234, 0.0058336, 0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00012035,
0.0013654, 0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 8.0995e-05, 0.00091893,
0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 3.593e-05, 0.00040765, 0.0013799,
0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262}},
{{-0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915,
-0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686,
-0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979,
-0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557,
-0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342,
-0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442,
-0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967,
-0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525,
-0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915,
-0.90557, -0.78967, -0.61686, -0.39342, -0.13525},
{3.1546, 3.1546, 3.1546, 3.1546, 3.1546, 3.1546, 3.1546, 3.1546, 3.209, 3.209, 3.209, 3.209, 3.209,
3.209, 3.209, 3.209, 3.3028, 3.3028, 3.3028, 3.3028, 3.3028, 3.3028, 3.3028, 3.3028, 3.4294, 3.4294,
3.4294, 3.4294, 3.4294, 3.4294, 3.4294, 3.4294, 3.5812, 3.5812, 3.5812, 3.5812, 3.5812, 3.5812, 3.5812,
3.5812, 3.7499, 3.7499, 3.7499, 3.7499, 3.7499, 3.7499, 3.7499, 3.7499, 3.927, 3.927, 3.927, 3.927,
3.927, 3.927, 3.927, 3.927, 4.1041, 4.1041, 4.1041, 4.1041, 4.1041, 4.1041, 4.1041, 4.1041, 4.2728,
4.2728, 4.2728, 4.2728, 4.2728, 4.2728, 4.2728, 4.2728, 4.4246, 4.4246, 4.4246, 4.4246, 4.4246, 4.4246,
4.4246, 4.4246, 4.5512, 4.5512, 4.5512, 4.5512, 4.5512, 4.5512, 4.5512, 4.5512, 4.6449, 4.6449, 4.6449,
4.6449, 4.6449, 4.6449, 4.6449, 4.6449, 4.6994, 4.6994, 4.6994, 4.6994, 4.6994, 4.6994, 4.6994, 4.6994},
{3.593e-05, 0.00040765, 0.0013799, 0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262, 8.0995e-05,
0.00091893, 0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 0.00012035, 0.0013654,
0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 0.0001519, 0.0017234, 0.0058336,
0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00017466, 0.0019816, 0.0067075, 0.014239,
0.023359, 0.03234, 0.039464, 0.04339, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185,
0.034868, 0.042548, 0.046781, 0.00019284, 0.0021879, 0.007406, 0.015722, 0.025792, 0.035708,
0.043574, 0.047908, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185, 0.034868, 0.042548,
0.046781, 0.00017466, 0.0019816, 0.0067075, 0.014239, 0.023359, 0.03234, 0.039464, 0.04339,
0.0001519, 0.0017234, 0.0058336, 0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00012035,
0.0013654, 0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 8.0995e-05, 0.00091893,
0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 3.593e-05, 0.00040765, 0.0013799,
0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262}},
{{-0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915,
-0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686,
-0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979,
-0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557,
-0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342,
-0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442,
-0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967,
-0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525,
-0.99979, -0.99442, -0.96915, -0.90557, -0.78967, -0.61686, -0.39342, -0.13525, -0.99979, -0.99442, -0.96915,
-0.90557, -0.78967, -0.61686, -0.39342, -0.13525},
{4.7254, 4.7254, 4.7254, 4.7254, 4.7254, 4.7254, 4.7254, 4.7254, 4.7798, 4.7798, 4.7798, 4.7798, 4.7798,
4.7798, 4.7798, 4.7798, 4.8736, 4.8736, 4.8736, 4.8736, 4.8736, 4.8736, 4.8736, 4.8736, 5.0002, 5.0002,
5.0002, 5.0002, 5.0002, 5.0002, 5.0002, 5.0002, 5.152, 5.152, 5.152, 5.152, 5.152, 5.152, 5.152,
5.152, 5.3207, 5.3207, 5.3207, 5.3207, 5.3207, 5.3207, 5.3207, 5.3207, 5.4978, 5.4978, 5.4978, 5.4978,
5.4978, 5.4978, 5.4978, 5.4978, 5.6749, 5.6749, 5.6749, 5.6749, 5.6749, 5.6749, 5.6749, 5.6749, 5.8436,
5.8436, 5.8436, 5.8436, 5.8436, 5.8436, 5.8436, 5.8436, 5.9954, 5.9954, 5.9954, 5.9954, 5.9954, 5.9954,
5.9954, 5.9954, 6.122, 6.122, 6.122, 6.122, 6.122, 6.122, 6.122, 6.122, 6.2157, 6.2157, 6.2157,
6.2157, 6.2157, 6.2157, 6.2157, 6.2157, 6.2702, 6.2702, 6.2702, 6.2702, 6.2702, 6.2702, 6.2702, 6.2702},
{3.593e-05, 0.00040765, 0.0013799, 0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262, 8.0995e-05,
0.00091893, 0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 0.00012035, 0.0013654,
0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 0.0001519, 0.0017234, 0.0058336,
0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00017466, 0.0019816, 0.0067075, 0.014239,
0.023359, 0.03234, 0.039464, 0.04339, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185,
0.034868, 0.042548, 0.046781, 0.00019284, 0.0021879, 0.007406, 0.015722, 0.025792, 0.035708,
0.043574, 0.047908, 0.0001883, 0.0021364, 0.0072316, 0.015352, 0.025185, 0.034868, 0.042548,
0.046781, 0.00017466, 0.0019816, 0.0067075, 0.014239, 0.023359, 0.03234, 0.039464, 0.04339,
0.0001519, 0.0017234, 0.0058336, 0.012384, 0.020316, 0.028127, 0.034322, 0.037737, 0.00012035,
0.0013654, 0.0046218, 0.0098116, 0.016096, 0.022284, 0.027193, 0.029898, 8.0995e-05, 0.00091893,
0.0031105, 0.0066033, 0.010833, 0.014997, 0.018301, 0.020122, 3.593e-05, 0.00040765, 0.0013799,
0.0029293, 0.0048055, 0.006653, 0.0081185, 0.0089262}}};
}
} // namespace Dune::XT::Data
| 103 | 117 | 0.585613 | dune-community |
6cf04dc582180cbf87dc84748ac7563cf09ebbf6 | 1,028 | cxx | C++ | examples/c++/eldriver.cxx | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 619 | 2015-01-14T23:50:18.000Z | 2019-11-08T14:04:33.000Z | examples/c++/eldriver.cxx | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 576 | 2015-01-02T09:55:14.000Z | 2019-11-12T15:31:10.000Z | examples/c++/eldriver.cxx | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 494 | 2015-01-14T18:33:56.000Z | 2019-11-07T10:08:15.000Z | /*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* This program and the accompanying materials are made available under the
* terms of the The MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
*/
#include <iostream>
#include <signal.h>
#include "eldriver.hpp"
#include "upm_utilities.h"
using namespace std;
int shouldRun = true;
void
sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int
main(int argc, char** argv)
{
signal(SIGINT, sig_handler);
//! [Interesting]
// This was tested with the El Driver Module
// Instantiate an El Driver on digital pin D2
upm::ElDriver eldriver(2);
bool lightState = true;
while (shouldRun) {
if (lightState)
eldriver.on();
else
eldriver.off();
lightState = !lightState;
upm_delay(1);
}
//! [Interesting]
eldriver.off();
cout << "Exiting" << endl;
return 0;
}
| 18.690909 | 74 | 0.634241 | moredu |
6cf7eecdcba0df7320019d9942f81fbee6a79ab5 | 1,112 | cpp | C++ | website/archive/binaries/mac/src/clustalw/src/tree/RandomGenerator.cpp | homiak/jabaws | f9c48c1311a07bffd99866f3d70a82e889f10493 | [
"Apache-2.0"
] | null | null | null | website/archive/binaries/mac/src/clustalw/src/tree/RandomGenerator.cpp | homiak/jabaws | f9c48c1311a07bffd99866f3d70a82e889f10493 | [
"Apache-2.0"
] | null | null | null | website/archive/binaries/mac/src/clustalw/src/tree/RandomGenerator.cpp | homiak/jabaws | f9c48c1311a07bffd99866f3d70a82e889f10493 | [
"Apache-2.0"
] | null | null | null | /**
* Author: Mark Larkin
*
* Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "RandomGenerator.h"
namespace clustalw
{
/**
* The contructor initialises the random algorithm.
* @param s
* @return
*/
RandomGenerator::RandomGenerator(unsigned long s)
: m(100000000), m1(10000)
{
a[0] = s;
j = 0;
do
{
++j;
a[j] = (mult(31, a[j - 1]) + 1) % m;
}
while (j < 54);
}
/**
* additive congruential method.
* @param r
* @return unsigned long random number in the range 0 to r-1
*/
unsigned long RandomGenerator::addRand(unsigned long r)
{
int x, y;
j = (j + 1) % 55;
x = (j + 23) % 55;
y = (j + 54) % 55;
a[j] = (a[x] + a[y]) % m;
return (((a[j] / m1) *r) / m1);
}
/**
*
* @param p
* @param q
* @return
*/
unsigned long RandomGenerator::mult(unsigned long p, unsigned long q)
{
unsigned long p1, p0, q1, q0;
p1 = p / m1;
p0 = p % m1;
q1 = q / m1;
q0 = q % m1;
return ((((p0 *q1 + p1 * q0) % m1) *m1 + p0 * q0) % m);
}
}
| 16.848485 | 69 | 0.530576 | homiak |
6cf8cefd2d510fe6e1c474dec747ec11b2703926 | 2,006 | cpp | C++ | DeepSpace/src/main/cpp/commands/LineTrackerFollowLine.cpp | NorthernForce/DeepSpace | b8446f0fb732e7df030970332574e13d94e79df9 | [
"MIT"
] | 3 | 2019-01-08T00:09:56.000Z | 2020-03-12T03:05:20.000Z | DeepSpace/src/main/cpp/commands/LineTrackerFollowLine.cpp | NorthernForce/DeepSpace | b8446f0fb732e7df030970332574e13d94e79df9 | [
"MIT"
] | 12 | 2019-01-17T00:33:54.000Z | 2019-06-27T01:56:18.000Z | DeepSpace/src/main/cpp/commands/LineTrackerFollowLine.cpp | NorthernForce/DeepSpace | b8446f0fb732e7df030970332574e13d94e79df9 | [
"MIT"
] | null | null | null | /*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#include "commands/LineTrackerFollowLine.h"
#include "Robot.h"
#include "RobotMap.h"
const double LineTrackerFollowLine::k_turnSpeed = 0.2;
LineTrackerFollowLine::LineTrackerFollowLine() : Command("LineTrackerFollowLine") {
Requires(Robot::m_lineTracker.get());
Requires(Robot::m_driveTrain.get());
}
// Called just before this Command runs the first time
void LineTrackerFollowLine::Initialize() {}
// Called repeatedly when this Command is scheduled to run
void LineTrackerFollowLine::Execute() {
double rotation = 0;
switch(Robot::m_lineTracker->getLineSensors()) {
case 0b001: // Right Sensor Detected Line; Turn right
rotation = k_turnSpeed;
break;
case 0b011: // Right & Center Sensor Detected Line; Turn right
rotation = k_turnSpeed;
break;
case 0b100: // Left Sensor Detected Line; Turn Left
rotation = k_turnSpeed * -1;
break;
case 0b110: // Left & Center Sensor Detected Line; Turn left
rotation = k_turnSpeed * -1;
break;
}
Robot::m_driveTrain->arcDrive(Robot::m_oi->getSteeringControls().first, rotation);
}
// Make this return true when this Command no longer needs to run execute()
bool LineTrackerFollowLine::IsFinished() { return false; }
// Called once after isFinished returns true
void LineTrackerFollowLine::End() {
Robot::m_driveTrain->arcDrive(0, 0);
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void LineTrackerFollowLine::Interrupted() { End(); } | 36.472727 | 84 | 0.631605 | NorthernForce |
6cfa2729a6fedef36192edd39ecd2ceebf9fb4b9 | 22,521 | cpp | C++ | Game/ShipElectricSparks.cpp | sjohal21/Floating-Sandbox | 0170e3696ed4f012f5f17fdbbdaef1af4117f495 | [
"CC-BY-4.0"
] | 44 | 2018-07-08T16:44:53.000Z | 2022-02-06T14:07:30.000Z | Game/ShipElectricSparks.cpp | sjohal21/Floating-Sandbox | 0170e3696ed4f012f5f17fdbbdaef1af4117f495 | [
"CC-BY-4.0"
] | 31 | 2019-03-24T16:00:38.000Z | 2022-02-24T20:23:18.000Z | Game/ShipElectricSparks.cpp | sjohal21/Floating-Sandbox | 0170e3696ed4f012f5f17fdbbdaef1af4117f495 | [
"CC-BY-4.0"
] | 24 | 2018-11-08T21:58:53.000Z | 2022-01-12T12:04:42.000Z | /***************************************************************************************
* Original Author: Gabriele Giuseppini
* Created: 2021-05-29
* Copyright: Gabriele Giuseppini (https://github.com/GabrieleGiuseppini)
***************************************************************************************/
#include "Physics.h"
#include <GameCore/GameRandomEngine.h>
#include <algorithm>
#include <cassert>
namespace Physics {
ShipElectricSparks::ShipElectricSparks(
IShipPhysicsHandler & shipPhysicsHandler,
Points const & points,
Springs const & springs)
: mShipPhysicsHandler(shipPhysicsHandler)
, mIsSpringElectrifiedOld(springs.GetElementCount(), 0, false)
, mIsSpringElectrifiedNew(springs.GetElementCount(), 0, false)
, mPointElectrificationCounter(points.GetElementCount(), 0, std::numeric_limits<std::uint64_t>::max())
, mAreSparksPopulatedBeforeNextUpdate(false)
, mSparksToRender()
{
}
bool ShipElectricSparks::ApplySparkAt(
vec2f const & targetPos,
std::uint64_t counter,
float lengthMultiplier,
float currentSimulationTime,
Points const & points,
Springs const & springs,
GameParameters const & gameParameters)
{
//
// Find closest point, and check whether there _is_ actually a closest point
//
float nearestDistance = 2.0f;
ElementIndex nearestPointIndex = NoneElementIndex;
for (auto pointIndex : points.RawShipPoints()) // No point in visiting ephemeral points
{
vec2f const pointRadius = points.GetPosition(pointIndex) - targetPos;
float const squarePointDistance = pointRadius.squareLength();
if (squarePointDistance < nearestDistance)
{
nearestDistance = squarePointDistance;
nearestPointIndex = pointIndex;
}
}
if (nearestPointIndex != NoneElementIndex)
{
PropagateSparks(
nearestPointIndex,
counter,
lengthMultiplier,
currentSimulationTime,
points,
springs,
gameParameters);
return true;
}
else
{
// No luck
return false;
}
}
void ShipElectricSparks::Update()
{
if (!mAreSparksPopulatedBeforeNextUpdate)
{
mSparksToRender.clear();
}
mAreSparksPopulatedBeforeNextUpdate = false;
}
void ShipElectricSparks::Upload(
Points const & points,
ShipId shipId,
Render::RenderContext & renderContext) const
{
auto & shipRenderContext = renderContext.GetShipRenderContext(shipId);
shipRenderContext.UploadElectricSparksStart(mSparksToRender.size());
for (auto const & electricSpark : mSparksToRender)
{
shipRenderContext.UploadElectricSpark(
points.GetPlaneId(electricSpark.StartPointIndex),
electricSpark.StartPointPosition,
electricSpark.StartSize,
electricSpark.EndPointPosition,
electricSpark.EndSize,
electricSpark.Direction,
electricSpark.PreviousSparkIndex.has_value()
? mSparksToRender[*electricSpark.PreviousSparkIndex].Direction
: electricSpark.Direction,
electricSpark.NextSparkIndex.has_value()
? mSparksToRender[*electricSpark.NextSparkIndex].Direction
: electricSpark.Direction);
}
shipRenderContext.UploadElectricSparksEnd();
}
/// //////////////////////////////////////////////////////////////
void ShipElectricSparks::PropagateSparks(
ElementIndex const initialPointIndex,
std::uint64_t counter,
float lengthMultiplier,
float currentSimulationTime,
Points const & points,
Springs const & springs,
GameParameters const & gameParameters)
{
//
// This algorithm works by running a number of "expansions" at each iteration,
// with each expansion propagating sparks outwardly along springs
//
//
// Constants
//
size_t constexpr InitialArcsMin = 4;
size_t constexpr InitialArcsMax = 6;
float constexpr ForkSpacingMin = 5.0f;
float constexpr ForkSpacingMax = 10.0f;
float const maxEquivalentPathLength =
17.0f // Magic number: max length of arc without tool modifier and default settings
* lengthMultiplier
* (gameParameters.IsUltraViolentMode ? 2.0f : 1.0f);
// The information associated with a point that the next expansion will start from
struct SparkPointToVisit
{
ElementIndex PointIndex;
vec2f PreferredDirection; // Normalized direction that this arc started with
float EquivalentPathLength; // Cumulative equivalent length of path so far, up to the point that the spark starts at
ElementIndex IncomingSpringIndex; // The index of the spring that we traveled to reach this point
size_t IncomingRenderableSparkIndex; // The index of the spark we traveled through to reach this point
float EquivalentPathLengthToNextFork; // We'll fork when the equivalent path length is longer than this
SparkPointToVisit(
ElementIndex pointIndex,
vec2f const & preferredDirection,
float equivalentPathLength,
ElementIndex incomingSpringIndex,
size_t incomingRenderableSparkIndex,
float equivalentPathLengthToNextFork)
: PointIndex(pointIndex)
, PreferredDirection(preferredDirection)
, EquivalentPathLength(equivalentPathLength)
, IncomingSpringIndex(incomingSpringIndex)
, IncomingRenderableSparkIndex(incomingRenderableSparkIndex)
, EquivalentPathLengthToNextFork(equivalentPathLengthToNextFork)
{}
};
//
// Initialize
//
// Prepare IsSpringElectrified buffer
mIsSpringElectrifiedNew.fill(false);
bool * const wasSpringElectrifiedInPreviousInteraction = mIsSpringElectrifiedOld.data();
bool * const isSpringElectrifiedInThisInteraction = mIsSpringElectrifiedNew.data();
// Prepare point electrification flag
if (counter == 0)
{
mPointElectrificationCounter.fill(std::numeric_limits<std::uint64_t>::max());
}
// Clear the sparks that have to be rendered after this step
mSparksToRender.clear();
// Calculate max equivalent path length (total of single-step costs) for this interaction:
// we won't create arcs longer than this at this interaction
float const maxEquivalentPathLengthForThisInteraction = std::min(
static_cast<float>(counter + 1),
maxEquivalentPathLength);
// Functor that calculates size of a spark, given its current path length and the distance of that path
// length from the maximum for this interaction:
// - When we're at the end of the path for this interaction: small size
// - When we're at the beginning of the path for this interaction: large size
auto const calculateSparkSize = [maxEquivalentPathLengthForThisInteraction](float equivalentPathLength)
{
return 0.05f + (1.0f - 0.05f) * (maxEquivalentPathLengthForThisInteraction - equivalentPathLength) / maxEquivalentPathLengthForThisInteraction;
};
//
// 1. Electrify initial point
//
float const initialPointSize = calculateSparkSize(0.0f);
mShipPhysicsHandler.HandleElectricSpark(
initialPointIndex,
initialPointSize, // strength
currentSimulationTime,
gameParameters);
mPointElectrificationCounter[initialPointIndex] = counter;
//
// 2. Jump-start: find the initial springs outgoing from the initial point
//
std::vector<ElementIndex> initialSprings;
{
// Decide number of initial springs for this interaction
size_t const initialArcsCount = GameRandomEngine::GetInstance().GenerateUniformInteger(InitialArcsMin, InitialArcsMax);
//
// 1. Fetch all springs that were electrified in the previous iteration
//
std::vector<std::tuple<ElementIndex, float>> otherSprings;
for (auto const & cs : points.GetConnectedSprings(initialPointIndex).ConnectedSprings)
{
assert(mPointElectrificationCounter[cs.OtherEndpointIndex] != counter);
if (wasSpringElectrifiedInPreviousInteraction[cs.SpringIndex]
&& initialSprings.size() < initialArcsCount)
{
initialSprings.emplace_back(cs.SpringIndex);
}
else
{
otherSprings.emplace_back(
cs.SpringIndex,
points.GetRandomNormalizedUniformPersonalitySeed(cs.OtherEndpointIndex));
}
}
//
// 2. Remaining springs
//
// Sort remaining by random seed
std::sort(
otherSprings.begin(),
otherSprings.end(),
[](auto const & s1, auto const & s2)
{
return std::get<1>(s1) < std::get<1>(s2);
});
// Pick winners
for (size_t s = 0; s < otherSprings.size() && initialSprings.size() < initialArcsCount; ++s)
{
initialSprings.emplace_back(std::get<0>(otherSprings[s]));
}
}
//
// 3. Electrify the initial springs and initialize expansions
//
std::vector<SparkPointToVisit> currentPointsToVisit;
{
auto const initialPointPosition = points.GetPosition(initialPointIndex);
for (ElementIndex const s : initialSprings)
{
ElementIndex const targetEndpointIndex = springs.GetOtherEndpointIndex(s, initialPointIndex);
vec2f const targetEndpointPosition = points.GetPosition(targetEndpointIndex);
vec2f const direction = (targetEndpointPosition - initialPointPosition).normalise();
float const equivalentPathLength = 1.0f; // TODO: material-based
float const endSize = calculateSparkSize(0.0f + equivalentPathLength);
// Note: we don't flag the initial springs as electrified, as they are the only ones who share
// a point in common and thus if they're scooped up at the next interaction, they'll add
// an N-way fork, which could even get compounded by being picked up at the next, and so on...
// Electrify target point
mShipPhysicsHandler.HandleElectricSpark(
targetEndpointIndex,
endSize, // strength
currentSimulationTime,
gameParameters);
// Remember the point is electrified now
assert(mPointElectrificationCounter[targetEndpointIndex] != counter);
mPointElectrificationCounter[targetEndpointIndex] = counter;
// Queue for next expansion
if (equivalentPathLength < maxEquivalentPathLengthForThisInteraction)
{
currentPointsToVisit.emplace_back(
targetEndpointIndex,
direction,
0.0f + equivalentPathLength,
s,
mSparksToRender.size(), // The arc we'll be pushing right now is the predecessor of this point we're pushing now
GameRandomEngine::GetInstance().GenerateUniformReal(ForkSpacingMin, ForkSpacingMax));
}
// Render
mSparksToRender.emplace_back(
initialPointIndex,
initialPointPosition,
initialPointSize,
targetEndpointPosition,
endSize,
direction,
std::nullopt); // No previous spark
}
}
//
// 3. Expand now
//
std::vector<SparkPointToVisit> nextPointsToVisit;
std::vector<ElementIndex> nextSprings; // Allocated once for perf
while (!currentPointsToVisit.empty())
{
assert(nextPointsToVisit.empty());
// Visit all points awaiting expansion
for (auto const & pv : currentPointsToVisit)
{
ElementIndex const startingPointIndex = pv.PointIndex;
vec2f const startingPointPosition = points.GetPosition(startingPointIndex);
// Initialize path length until next fork - we'll eventually reset it if we fork
float equivalentPathLengthToNextFork = pv.EquivalentPathLengthToNextFork;
// Calculate distance to the end of this path in this interaction
float const distanceToInteractionMaxPathLength = (maxEquivalentPathLengthForThisInteraction - pv.EquivalentPathLength) / maxEquivalentPathLengthForThisInteraction;
//
// Of all the outgoing springs that are *not* the incoming spring:
// - Collect the first one that wa electrified in the previous interaction, does not
// lead to a point already electrified in this interaction (so to avoid forks),
// and agrees with alignment
// - Keep the others, ranking them on their alignment
// - We don't check beforehand if these will lead to an already-electrified
// point, so to allow for closing loops (which we won't electrify anyway)
//
nextSprings.clear();
ElementIndex bestCandidateNewSpring1 = NoneElementIndex;
float bestCandidateNewSpringAlignment1 = -1.0f;
ElementIndex bestCandidateNewSpring2 = NoneElementIndex;
float bestCandidateNewSpringAlignment2 = -1.0f;
ElementIndex bestCandidateNewSpring3 = NoneElementIndex;
float bestCandidateNewSpringAlignment3 = -1.0f;
for (auto const & cs : points.GetConnectedSprings(pv.PointIndex).ConnectedSprings)
{
if (cs.SpringIndex != pv.IncomingSpringIndex)
{
vec2f const springDirection = (points.GetPosition(cs.OtherEndpointIndex) - startingPointPosition).normalise();
float const springAlignment = springDirection.dot(pv.PreferredDirection);
if (nextSprings.empty() && wasSpringElectrifiedInPreviousInteraction[cs.SpringIndex])
{
if (mPointElectrificationCounter[cs.OtherEndpointIndex] != counter
&& springAlignment > 0.0f)
{
// We take this one for sure
nextSprings.emplace_back(cs.SpringIndex);
}
}
else
{
// Rank based on alignment
if (springAlignment > bestCandidateNewSpringAlignment1)
{
bestCandidateNewSpring3 = bestCandidateNewSpring2;
bestCandidateNewSpringAlignment3 = bestCandidateNewSpringAlignment2;
bestCandidateNewSpring2 = bestCandidateNewSpring1;
bestCandidateNewSpringAlignment2 = bestCandidateNewSpringAlignment1;
bestCandidateNewSpring1 = cs.SpringIndex;
bestCandidateNewSpringAlignment1 = springAlignment;
}
else if (springAlignment > bestCandidateNewSpringAlignment2)
{
bestCandidateNewSpring3 = bestCandidateNewSpring2;
bestCandidateNewSpringAlignment3 = bestCandidateNewSpringAlignment2;
bestCandidateNewSpring2 = cs.SpringIndex;
bestCandidateNewSpringAlignment2 = springAlignment;
}
else if (springAlignment > bestCandidateNewSpringAlignment3)
{
bestCandidateNewSpring3 = cs.SpringIndex;
bestCandidateNewSpringAlignment3 = springAlignment;
}
}
}
}
if (bestCandidateNewSpring1 != NoneElementIndex)
{
if (nextSprings.empty())
{
//
// Choose one spring out of the best three, with probabilities enforcing a nice zig-zag pattern
//
// Ignore sign of alignment, if we're forced we'll even recoil back
//
float const r = GameRandomEngine::GetInstance().GenerateNormalizedUniformReal();
if (r < 0.25f || bestCandidateNewSpring2 == NoneElementIndex)
{
nextSprings.emplace_back(bestCandidateNewSpring1);
}
else if (r < 0.85f || bestCandidateNewSpring3 == NoneElementIndex)
{
nextSprings.emplace_back(bestCandidateNewSpring2);
}
else
{
nextSprings.emplace_back(bestCandidateNewSpring3);
}
}
else if (nextSprings.size() == 1 && bestCandidateNewSpringAlignment1 >= 0.0f)
{
//
// Decide whether we want to fork or re-route, but always with a positive
// alignment
//
if (pv.EquivalentPathLength >= equivalentPathLengthToNextFork)
{
// Fork
if (bestCandidateNewSpringAlignment3 >= 0.0f)
{
// We have 3, choose second and third then
nextSprings[0] = bestCandidateNewSpring2;
nextSprings.emplace_back(bestCandidateNewSpring3);
}
else if (bestCandidateNewSpringAlignment2 >= 0.0f)
{
nextSprings.emplace_back(bestCandidateNewSpring2);
}
else
{
nextSprings.emplace_back(bestCandidateNewSpring1);
}
equivalentPathLengthToNextFork = pv.EquivalentPathLength + GameRandomEngine::GetInstance().GenerateUniformReal(ForkSpacingMin, ForkSpacingMax);
}
else if (
// Reroute when we're closer to interaction end
GameRandomEngine::GetInstance().GenerateUniformBoolean(0.15f * std::pow(1.0f - distanceToInteractionMaxPathLength, 0.5f)))
{
// Reroute
if (bestCandidateNewSpringAlignment2 >= 0.0f
&& GameRandomEngine::GetInstance().GenerateUniformBoolean(0.5f))
{
nextSprings[0] = bestCandidateNewSpring2;
}
else
{
nextSprings[0] = bestCandidateNewSpring1;
}
}
}
}
//
// Follow all of the new springs
//
for (auto const s : nextSprings)
{
ElementIndex const targetEndpointIndex = springs.GetOtherEndpointIndex(s, pv.PointIndex);
vec2f const targetEndpointPosition = points.GetPosition(targetEndpointIndex);
vec2f const springDirection = (targetEndpointPosition - startingPointPosition).normalise();
float const startEquivalentPathLength = pv.EquivalentPathLength;
float const equivalentStepLength = 1.0f; // TODO: material-based
float const endEquivalentPathLength = startEquivalentPathLength + equivalentStepLength;
float const startSize = calculateSparkSize(startEquivalentPathLength);
size_t const springSparkToRenderIndex = mSparksToRender.size(); // The arc we'll be pushing right now is the arc for this spring
// Render
mSparksToRender.emplace_back(
startingPointIndex,
startingPointPosition,
startSize,
targetEndpointPosition,
calculateSparkSize(endEquivalentPathLength),
springDirection,
pv.IncomingRenderableSparkIndex);
// Connect this renderable spark to its predecessor, if this is the first one
if (!mSparksToRender[pv.IncomingRenderableSparkIndex].NextSparkIndex.has_value())
{
mSparksToRender[pv.IncomingRenderableSparkIndex].NextSparkIndex = springSparkToRenderIndex;
}
// Propagate visit
if (mPointElectrificationCounter[targetEndpointIndex] != counter)
{
// Electrify spring
isSpringElectrifiedInThisInteraction[s] = true;
// Electrify point
mShipPhysicsHandler.HandleElectricSpark(
targetEndpointIndex,
startSize, // strength
currentSimulationTime,
gameParameters);
// Remember this point is not electrified
mPointElectrificationCounter[targetEndpointIndex] = counter;
// Next expansion
if (endEquivalentPathLength < maxEquivalentPathLengthForThisInteraction)
{
nextPointsToVisit.emplace_back(
targetEndpointIndex,
pv.PreferredDirection,
endEquivalentPathLength,
s,
springSparkToRenderIndex, // Predecessor
equivalentPathLengthToNextFork);
}
}
}
}
// Advance expansion
std::swap(currentPointsToVisit, nextPointsToVisit);
nextPointsToVisit.clear();
}
//
// Finalize
//
// Swap IsElectrified buffers
mIsSpringElectrifiedNew.swap(mIsSpringElectrifiedOld);
// Remember that we have populated electric sparks
mAreSparksPopulatedBeforeNextUpdate = true;
}
} | 39.719577 | 175 | 0.588828 | sjohal21 |
6cfe6905c1e4bad62314e1e2b671e04c14fa71fa | 1,009 | hpp | C++ | code/source/game/devlogic.hpp | crafn/clover | 586acdbcdb34c3550858af125e9bb4a6300343fe | [
"MIT"
] | 12 | 2015-01-12T00:19:20.000Z | 2021-08-05T10:47:20.000Z | code/source/game/devlogic.hpp | crafn/clover | 586acdbcdb34c3550858af125e9bb4a6300343fe | [
"MIT"
] | null | null | null | code/source/game/devlogic.hpp | crafn/clover | 586acdbcdb34c3550858af125e9bb4a6300343fe | [
"MIT"
] | null | null | null | #ifndef CLOVER_DEVLOGIC_HPP
#define CLOVER_DEVLOGIC_HPP
#include "build.hpp"
#include "game/editor/editor.hpp"
#include "ui/hid/actionlistener.hpp"
#include "util/dyn_array.hpp"
#include "util/profiler.hpp"
#include "util/string.hpp"
namespace clover {
namespace game {
/// Handles developer-only logic which can be cut out for release
class DevLogic {
public:
struct PerformanceTimerResult {
/// Name of timer
util::Str8 name;
/// In seconds
real32 averageTime;
/// Scale 0-1
real32 percentage;
};
DevLogic();
void update();
const util::DynArray<PerformanceTimerResult>& getLastPerformanceTimerResults() const { return performanceTimerResults; }
editor::Editor& getEditor(){ return editor; }
private:
util::Profiler profiler;
int32 fpsFrameCount;
real32 fpsTimer;
int32 fpsPrintFilter;
util::DynArray<PerformanceTimerResult> performanceTimerResults;
editor::Editor editor;
ui::hid::ActionListener<> profileListener;
};
} // game
} // clover
#endif // CLOVER_DEVLOGIC_HPP
| 20.18 | 121 | 0.751239 | crafn |
9f0272e6668050b1476c55d8a0cb7c94d1fb978c | 1,073 | hpp | C++ | src/DBConnection2.hpp | malirod/DoubleDispatch | 8bca9765d2c21f8c3fa3fbabea6593b820d2ea53 | [
"MIT"
] | null | null | null | src/DBConnection2.hpp | malirod/DoubleDispatch | 8bca9765d2c21f8c3fa3fbabea6593b820d2ea53 | [
"MIT"
] | null | null | null | src/DBConnection2.hpp | malirod/DoubleDispatch | 8bca9765d2c21f8c3fa3fbabea6593b820d2ea53 | [
"MIT"
] | null | null | null | /* Copyright (c) 2018 Yaroslav Stanislavyk <stl.ros@outlook.com> */
#pragma once
#include "DBConnection.hpp"
class IConnectionDispatcher;
class IDBConnection2 {
public:
virtual ~IDBConnection2();
virtual void Dispatch(IConnectionDispatcher& connection_dispatcher) = 0;
virtual int Query() const = 0;
};
class MySqlDBConnection2 : public IDBConnection2 {
public:
MySqlDBConnection2() = default;
explicit MySqlDBConnection2(std::string server_version, int protocol_version)
: m_info{std::move(server_version), protocol_version} {}
void Dispatch(IConnectionDispatcher& connection_dispatcher) override;
int Query() const override;
Info AdvancedQuery() const;
private:
Info m_info;
};
class SqLiteDBConnection2 : public IDBConnection2 {
public:
SqLiteDBConnection2() : m_protocol_version(0) {}
explicit SqLiteDBConnection2(int protocol_version)
: m_protocol_version(protocol_version) {}
void Dispatch(IConnectionDispatcher& connection_dispatcher) override;
int Query() const override;
private:
int m_protocol_version;
};
| 24.386364 | 79 | 0.766076 | malirod |
9f072564830d0c41c8991fbd4e0106f0aa6bf766 | 430 | cpp | C++ | FullBright.cpp | Apflmus/Rust-Cheat | 7b4a1212cc1b0f46ff8cf510e83ca358b58aeb72 | [
"Apache-2.0"
] | 36 | 2017-10-31T21:52:47.000Z | 2020-01-19T02:32:27.000Z | FullBright.cpp | J0hnDark/Rust-Cheat | 7b4a1212cc1b0f46ff8cf510e83ca358b58aeb72 | [
"Apache-2.0"
] | 2 | 2018-01-03T17:22:53.000Z | 2019-09-25T19:25:29.000Z | FullBright.cpp | J0hnDark/Rust-Cheat | 7b4a1212cc1b0f46ff8cf510e83ca358b58aeb72 | [
"Apache-2.0"
] | 19 | 2020-02-22T02:25:22.000Z | 2022-03-31T15:08:50.000Z | #include "Globals.h"
#include "Utils.h"
float origvalue1;
float origvalue2;
DWORD64 lightColorOrig;
void setToDay()
{
ULONG_PTR objectClass = read<ULONG_PTR>(entity[1].gameObject + 0x30);
ULONG_PTR entityPtr = read<ULONG_PTR>(objectClass + 0x18);
ULONG_PTR skyDome = read<ULONG_PTR>(entityPtr + 0x28);
ULONG_PTR todCycle = read<ULONG_PTR>(skyDome + 0x18);
write<float>(todCycle + 0x10, 12);
}
//(c) Apflmus | 25.294118 | 71 | 0.711628 | Apflmus |
9f079944d0af5b6fee82b73ec3940bde0ff085d1 | 536 | cpp | C++ | HaloTAS/TASDLL/halo_map_data.cpp | s3anyboy/HaloTAS | 9584786f19e1475399298fda2d5783d47623cccd | [
"MIT"
] | 6 | 2019-09-10T19:47:04.000Z | 2020-11-26T08:32:36.000Z | HaloTAS/TASDLL/halo_map_data.cpp | s3anyboy/HaloTAS | 9584786f19e1475399298fda2d5783d47623cccd | [
"MIT"
] | 13 | 2018-11-24T09:37:49.000Z | 2021-10-22T02:29:11.000Z | HaloTAS/TASDLL/halo_map_data.cpp | s3anyboy/HaloTAS | 9584786f19e1475399298fda2d5783d47623cccd | [
"MIT"
] | 3 | 2020-07-28T09:19:14.000Z | 2020-09-02T04:48:49.000Z | #include "halo_map_data.h"
std::string halo::mapdata::tag_entry::tag_class_to_str(uint32_t tag_class)
{
char c[4];
memcpy(&c, &tag_class, 4);
std::reverse(c, c + 4);
std::string str(c, 4);
return str;
}
std::string halo::mapdata::tag_entry::tag_class_str()
{
return tag_class_to_str(tag_class);
}
std::string halo::mapdata::tag_entry::tag_class_secondary_str()
{
return tag_class_to_str(tag_class_secondary);
}
std::string halo::mapdata::tag_entry::tag_class_tertiary_str()
{
return tag_class_to_str(tag_class_tertiary);
}
| 20.615385 | 74 | 0.744403 | s3anyboy |
9f0e1a3c89311ca1a68579fabbe0185299ead107 | 320 | cpp | C++ | Programmers/src/12906/solution.cpp | lstar2397/algorithms | 686ea882079e26111f86b5bd5a7ab1b14ccf0fa2 | [
"MIT"
] | null | null | null | Programmers/src/12906/solution.cpp | lstar2397/algorithms | 686ea882079e26111f86b5bd5a7ab1b14ccf0fa2 | [
"MIT"
] | null | null | null | Programmers/src/12906/solution.cpp | lstar2397/algorithms | 686ea882079e26111f86b5bd5a7ab1b14ccf0fa2 | [
"MIT"
] | null | null | null | #include <vector>
using namespace std;
vector<int> solution(vector<int> arr) {
int prevElement = -1;
vector<int> answer;
for (size_t i = 0; i < arr.size(); i++)
{
int curElement = arr.at(i);
if (prevElement != curElement)
{
answer.push_back(arr.at(i));
prevElement = curElement;
}
}
return answer;
} | 18.823529 | 40 | 0.640625 | lstar2397 |
9f0ffd9712abd9144dc8796567667d9dc8e64b22 | 613 | hpp | C++ | src/atmosphere/Generator.hpp | dat14jpe/mulen | 33beeb8a38e5556ddd44efba909e18aab9a3d401 | [
"MIT"
] | 5 | 2020-01-15T12:49:45.000Z | 2021-11-24T05:15:59.000Z | src/atmosphere/Generator.hpp | dat14jpe/mulen | 33beeb8a38e5556ddd44efba909e18aab9a3d401 | [
"MIT"
] | null | null | null | src/atmosphere/Generator.hpp | dat14jpe/mulen | 33beeb8a38e5556ddd44efba909e18aab9a3d401 | [
"MIT"
] | null | null | null | #pragma once
#include "Common.hpp"
#include "util/Shader.hpp"
namespace Mulen::Atmosphere {
// Atmosphere generator.
class Generator
{
const std::string shaderName;
Util::Shader shader; // brick generation shader
public:
const std::string& GetShaderName() { return shaderName; }
Util::Shader& GetShader() { return shader; }
Generator(const std::string& shaderName)
: shaderName{ shaderName }
{}
// Generate data for a new generation pass (likely in a worker thread).
virtual void Generate(UpdateIteration&);
};
}
| 26.652174 | 79 | 0.628059 | dat14jpe |
9f10972fa8ea326ad5479dd176c28e5e637b17e2 | 1,755 | cpp | C++ | projects/solutions/03/driveController.cpp | RoboJackets-Software-Training-Test/test-project-1-oswinso | 45b8f82477106bae739069f594ff8711cfc47981 | [
"MIT"
] | null | null | null | projects/solutions/03/driveController.cpp | RoboJackets-Software-Training-Test/test-project-1-oswinso | 45b8f82477106bae739069f594ff8711cfc47981 | [
"MIT"
] | null | null | null | projects/solutions/03/driveController.cpp | RoboJackets-Software-Training-Test/test-project-1-oswinso | 45b8f82477106bae739069f594ff8711cfc47981 | [
"MIT"
] | null | null | null | #include <STSL/RJRobot.h>
#include "pid.h"
#include <ctime>
#include <unistd.h>
#include <cstdlib>
int main()
{
PID controller_left(10.0, 0.1, 0, .01, 0.5, 0.25);
PID controller_right(10.0, 0.1, 0, .01, 0.5, 0.25);
float target = 0.5;
float current = 0;
float controller_effort_left, controller_effort_right;
int dt = 10;
RJRobot robot;
RJRobot::EncoderSpeeds speeds;
std::cout << "Starting Loop" << std::endl;
while(std::abs(target - current) > 0.001)
{
std::cout << "In loop" << std::endl;
auto start_time = std::chrono::system_clock::now();
speeds = robot.getEncoderSpeeds(); // Get the encoder speeds
controller_effort_left = controller_left.update(target, speeds.left); // PID on left wheel
controller_effort_right = controller_right.update(target, speeds.right); // PID on right wheel
robot.setDriveMotors(controller_effort_left, -1*controller_effort_right); // Set drive motors
auto end_time = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds = end_time-start_time; // Can use elapsed time for more accurate dt
robot.wait(std::chrono::duration_cast<std::chrono::microseconds>(operator""ms(dt)));
std::cout << "Left Speed: " << speeds.left << std::endl;
std::cout << " Right Speed: " << speeds.right << std::endl;
current = (speeds.left + speeds.right)/2; // Average the two speeds to get the current velocity
}
/*robot.setDriveMotors(0.375, -0.375);
robot.wait(std::chrono::duration_cast<std::chrono::microseconds>(operator""ms(10000)));*/
robot.stopMotors();
return 0;
} | 35.816327 | 121 | 0.622792 | RoboJackets-Software-Training-Test |
2f57ada990ace2990d12d4e8e9443c6c78a2c7ee | 1,978 | cpp | C++ | cpp/visual studio/CalculatorServer/RerollBotConsole/debug_main.cpp | NiHoel/Anno1800UXEnhancer | b430fdb428696b5218ca65a5e9b977d659cfca01 | [
"Apache-2.0"
] | 27 | 2020-03-29T16:02:09.000Z | 2021-12-18T20:08:51.000Z | cpp/visual studio/CalculatorServer/RerollBotConsole/debug_main.cpp | NiHoel/Anno1800UXEnhancer | b430fdb428696b5218ca65a5e9b977d659cfca01 | [
"Apache-2.0"
] | 22 | 2020-04-03T03:40:59.000Z | 2022-03-29T15:55:28.000Z | cpp/visual studio/CalculatorServer/RerollBotConsole/debug_main.cpp | NiHoel/Anno1800UXEnhancer | b430fdb428696b5218ca65a5e9b977d659cfca01 | [
"Apache-2.0"
] | 2 | 2021-10-17T16:15:46.000Z | 2022-01-10T18:56:49.000Z | #pragma once
#include "reader_trading.hpp"
using namespace reader;
template<typename T>
void print(const std::map<unsigned int, T>& map,
const std::map<unsigned int, std::string>& dictionary = std::map<unsigned int, std::string>())
{
for (const auto& entry : map)
{
if (dictionary.find(entry.first) != dictionary.cend())
std::cout << dictionary.find(entry.first)->second << "\t=\t" << entry.second << std::endl;
else
std::cout << entry.first << "\t=\t" << entry.second << std::endl;
}
}
int main() {
image_recognition recog;
trading_menu reader(recog);
// cv::Mat src = image_recognition::load_image("C:/Users/Nico/Documents/Anno 1800/screenshot/screenshot_2019-12-31-13-03-20.jpg");
// cv::Mat src = image_recognition::load_image("C:/Users/Nico/Pictures/Uplay/Anno 1800/Anno 18002020-1-6-0-32-3.png");
// cv::Mat src = image_recognition::load_image("C:/Users/Nico/Documents/Dokumente/Computer/Softwareentwicklung/AnnoCalculatorServer/calculator-recognition-issues/population_number_slash_issue/screenshot6.png");
// cv::Mat src = image_recognition::load_image("J:/Pictures/Uplay/Anno 1800/Anno 18002020-1-6-0-32-3.png");
cv::Mat src = image_recognition::load_image("test_screenshots/trade_eli_1.png");
reader.update("english", src);
//image_recog.update("german", image_recognition::load_image("C:/Users/Nico/Documents/Dokumente/Computer/Softwareentwicklung/AnnoCalculatorServer/calculator-recognition-issues/island_name_mua/screenshot.png"));
try {
std::cout << "Trader: " << recog.get_dictionary().ui_texts.at(reader.get_open_trader()) << std::endl;
std::cout << "Rerollable: " << reader.has_reroll() << std::endl;
std::cout << "Buyable: " << reader.can_buy() << std::endl;
const auto offerings = reader.get_offerings();
std::cout << "Offerings:" << std::endl;
for (const auto& offering : offerings)
std::cout << offering.index << ": " << offering.price << std::endl;
}
catch (const std::exception & e)
{ }
return 0;
} | 39.56 | 211 | 0.708291 | NiHoel |
2f58f8aec3cf2d351f8cdbc2b76cc4c3a3130f4b | 1,736 | cpp | C++ | source/Library.Shared/DirectXHelper.cpp | ssshammi/real-time-3d-rendering-with-directx-and-hlsl | 05a05c5c26784dafa9a89747276f385252951f2f | [
"MIT"
] | null | null | null | source/Library.Shared/DirectXHelper.cpp | ssshammi/real-time-3d-rendering-with-directx-and-hlsl | 05a05c5c26784dafa9a89747276f385252951f2f | [
"MIT"
] | null | null | null | source/Library.Shared/DirectXHelper.cpp | ssshammi/real-time-3d-rendering-with-directx-and-hlsl | 05a05c5c26784dafa9a89747276f385252951f2f | [
"MIT"
] | null | null | null | #include "pch.h"
#include "DirectXHelper.h"
#include "GameException.h"
using namespace std;
using namespace gsl;
namespace Library
{
void CreateIndexBuffer(not_null<ID3D11Device*> device, const span<const uint16_t>& indices, not_null<ID3D11Buffer**> indexBuffer)
{
D3D11_BUFFER_DESC indexBufferDesc{ 0 };
indexBufferDesc.ByteWidth = narrow<uint32_t>(indices.size_bytes());
indexBufferDesc.Usage = D3D11_USAGE_IMMUTABLE;
indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
D3D11_SUBRESOURCE_DATA indexSubResourceData{ 0 };
indexSubResourceData.pSysMem = &indices[0];
ThrowIfFailed(device->CreateBuffer(&indexBufferDesc, &indexSubResourceData, indexBuffer), "ID3D11Device::CreateBuffer() failed.");
}
void CreateIndexBuffer(not_null<ID3D11Device*> device, const span<const uint32_t>& indices, not_null<ID3D11Buffer**> indexBuffer)
{
D3D11_BUFFER_DESC indexBufferDesc{ 0 };
indexBufferDesc.ByteWidth = narrow<uint32_t>(indices.size_bytes());
indexBufferDesc.Usage = D3D11_USAGE_IMMUTABLE;
indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
D3D11_SUBRESOURCE_DATA indexSubResourceData{ 0 };
indexSubResourceData.pSysMem = &indices[0];
ThrowIfFailed(device->CreateBuffer(&indexBufferDesc, &indexSubResourceData, indexBuffer), "ID3D11Device::CreateBuffer() failed.");
}
void CreateConstantBuffer(not_null<ID3D11Device*> device, std::size_t byteWidth, not_null<ID3D11Buffer**> constantBuffer)
{
D3D11_BUFFER_DESC constantBufferDesc{ 0 };
constantBufferDesc.ByteWidth = narrow_cast<uint32_t>(byteWidth);
constantBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
ThrowIfFailed(device->CreateBuffer(&constantBufferDesc, nullptr, constantBuffer), "ID3D11Device::CreateBuffer() failed.");
}
} | 41.333333 | 132 | 0.797811 | ssshammi |
2f5ce6543dedfe6f7ef6e254a019fd9ad388216b | 9,417 | cpp | C++ | Sources/Elastos/LibCore/src/org/apache/harmony/security/x509/CAuthorityKeyIdentifier.cpp | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | 7 | 2017-07-13T10:34:54.000Z | 2021-04-16T05:40:35.000Z | Sources/Elastos/LibCore/src/org/apache/harmony/security/x509/CAuthorityKeyIdentifier.cpp | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | null | null | null | Sources/Elastos/LibCore/src/org/apache/harmony/security/x509/CAuthorityKeyIdentifier.cpp | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | 9 | 2017-07-13T12:33:20.000Z | 2021-06-19T02:46:48.000Z | //=========================================================================
// Copyright (C) 2012 The Elastos Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//=========================================================================
#include "org/apache/harmony/security/x509/CAuthorityKeyIdentifier.h"
#include "org/apache/harmony/security/x509/CGeneralNames.h"
#include "org/apache/harmony/security/x509/CGeneralNames.h"
#include "org/apache/harmony/security/asn1/ASN1Type.h"
#include "org/apache/harmony/security/asn1/CObjectIdentifier.h"
#include "org/apache/harmony/security/asn1/CASN1Implicit.h"
#include "org/apache/harmony/security/asn1/ASN1OctetString.h"
#include "org/apache/harmony/security/asn1/CASN1Integer.h"
#include <elastos/core/CoreUtils.h>
#include <elastos/core/StringBuilder.h>
#include "elastos/math/CBigInteger.h"
#include <elastos/utility/Arrays.h>
#include "core/CArrayOf.h"
#include "core/CByte.h"
using Org::Apache::Harmony::Security::Asn1::ASN1Type;
using Org::Apache::Harmony::Security::Asn1::IASN1Type;
using Org::Apache::Harmony::Security::Asn1::IASN1Implicit;
using Org::Apache::Harmony::Security::Asn1::CASN1Implicit;
using Org::Apache::Harmony::Security::Asn1::IASN1OctetString;
using Org::Apache::Harmony::Security::Asn1::CObjectIdentifier;
using Org::Apache::Harmony::Security::Asn1::IASN1Integer;
using Org::Apache::Harmony::Security::Asn1::CASN1Integer;
using Org::Apache::Harmony::Security::Asn1::ASN1OctetString;
using Elastos::Core::IArrayOf;
using Elastos::Core::CArrayOf;
using Elastos::Core::IByte;
using Elastos::Core::CByte;
using Elastos::Core::CoreUtils;
using Elastos::Core::StringBuilder;
using Elastos::Math::CBigInteger;
namespace Org {
namespace Apache {
namespace Harmony {
namespace Security {
namespace X509 {
ECode CAuthorityKeyIdentifier::MyASN1Sequence::GetDecodedObject(
/* [in] */ IBerInputStream* bis,
/* [out] */ IInterface** object)
{
VALIDATE_NOT_NULL(object);
AutoPtr<IInterface> con;
bis->GetContent((IInterface**)&con);
AutoPtr<IArrayOf> values = IArrayOf::Probe(con);
AutoPtr<IInterface> obj2;
values->Get(2, (IInterface**)&obj2);
AutoPtr<IArrayOf> arrayof2 = IArrayOf::Probe(obj2);
Int32 length2;
arrayof2->GetLength(&length2);
AutoPtr<ArrayOf<Byte> > array2 = ArrayOf<Byte>::Alloc(length2);
for (Int32 i = 0; i < length2; i++) {
AutoPtr<IInterface> value;
arrayof2->Get(i, (IInterface**)&value);
AutoPtr<IByte> bvalue = IByte::Probe(value);
Byte b;
bvalue->GetValue(&b);
(*array2)[i] = b;
}
AutoPtr<IBigInteger> authorityCertSerialNumber;
if (arrayof2 != NULL) {
CBigInteger::New(*array2, (IBigInteger**)&authorityCertSerialNumber);
}
AutoPtr<IInterface> obj0;
values->Get(0, (IInterface**)&obj0);
AutoPtr<IArrayOf> arrayof0 = IArrayOf::Probe(obj0);
Int32 length0;
arrayof0->GetLength(&length0);
AutoPtr<ArrayOf<Byte> > array0 = ArrayOf<Byte>::Alloc(length0);
for (Int32 i = 0; i < length0; i++) {
AutoPtr<IInterface> value;
arrayof0->Get(i, (IInterface**)&value);
AutoPtr<IByte> b = IByte::Probe(value);
Byte num;
b->GetValue(&num);
(*array0)[i] = num;
}
AutoPtr<IInterface> obj1;
values->Get(1, (IInterface**)&obj1);
AutoPtr<IAuthorityKeyIdentifier> identifier;
CAuthorityKeyIdentifier::New(array0, IGeneralNames::Probe(obj1),
authorityCertSerialNumber, (IAuthorityKeyIdentifier**)&identifier);
*object = TO_IINTERFACE(identifier);
REFCOUNT_ADD(*object);
return NOERROR;
}
ECode CAuthorityKeyIdentifier::MyASN1Sequence::GetValues(
/* [in] */ IInterface* object,
/* [in] */ ArrayOf<IInterface*>* values)
{
CAuthorityKeyIdentifier* akid = (CAuthorityKeyIdentifier*)IAuthorityKeyIdentifier::Probe(object);
AutoPtr<IArrayOf> array = CoreUtils::ConvertByteArray(akid->mKeyIdentifier);
values->Set(0, TO_IINTERFACE(array));
values->Set(1, TO_IINTERFACE(akid->mAuthorityCertIssuer));
if (akid->mAuthorityCertSerialNumber != NULL) {
AutoPtr<ArrayOf<Byte> > parameters;
akid->mAuthorityCertSerialNumber->ToByteArray((ArrayOf<Byte>**)¶meters);
AutoPtr<IArrayOf> array2 = CoreUtils::ConvertByteArray(parameters);
values->Set(2, TO_IINTERFACE(array2));
}
return NOERROR;
}
AutoPtr<IASN1Type> CAuthorityKeyIdentifier::initASN1()
{
AutoPtr<IASN1OctetString> instance1;
ASN1OctetString::GetInstance((IASN1OctetString**)&instance1);
AutoPtr<IASN1Implicit> implicit1;
CASN1Implicit::New(0, IASN1Type::Probe(instance1), (IASN1Implicit**)&implicit1);
AutoPtr<IASN1Implicit> implicit2;
CASN1Implicit::New(1, CGeneralNames::ASN1, (IASN1Implicit**)&implicit2);
AutoPtr<IASN1Integer> instance2;
CASN1Integer::GetInstance((IASN1Integer**)&instance2);
AutoPtr<IASN1Implicit> implicit3;
CASN1Implicit::New(2, IASN1Type::Probe(instance2), (IASN1Implicit**)&implicit3);
AutoPtr<ArrayOf<IASN1Type*> > array = ArrayOf<IASN1Type*>::Alloc(3);
array->Set(0, IASN1Type::Probe(implicit1));
array->Set(1, IASN1Type::Probe(implicit2));
array->Set(2, IASN1Type::Probe(implicit3));
AutoPtr<ASN1Sequence> tmp = new MyASN1Sequence();
tmp->constructor(array);
tmp->SetOptional(0);
tmp->SetOptional(1);
tmp->SetOptional(2);
return IASN1Type::Probe(tmp);
}
AutoPtr<IASN1Type> CAuthorityKeyIdentifier::ASN1 = initASN1();
CAR_OBJECT_IMPL(CAuthorityKeyIdentifier)
CAR_INTERFACE_IMPL(CAuthorityKeyIdentifier, ExtensionValue, IAuthorityKeyIdentifier)
ECode CAuthorityKeyIdentifier::GetEncoded(
/* [out, callee] */ ArrayOf<Byte>** ppEncode)
{
VALIDATE_NOT_NULL(ppEncode);
if (mEncoding == NULL) {
IASN1Type::Probe(ASN1)->Encode(TO_IINTERFACE(this), (ArrayOf<Byte>**)&mEncoding);
}
*ppEncode = mEncoding;
REFCOUNT_ADD(*ppEncode);
return NOERROR;
}
ECode CAuthorityKeyIdentifier::DumpValue(
/* [in] */ IStringBuilder* sb,
/* [in] */ const String& prefix)
{
sb->Append(prefix);
sb->Append(String("AuthorityKeyIdentifier [\n"));
if (mKeyIdentifier != NULL) {
sb->Append(prefix);
sb->Append(String(" keyIdentifier:\n"));
assert(0);
//sb->Append(Array::toString(keyIdentifier, prefix + " "));
}
if (mAuthorityCertIssuer != NULL) {
sb->Append(prefix);
sb->Append(String(" authorityCertIssuer: [\n"));
mAuthorityCertIssuer->DumpValue(sb, prefix + String(" "));
sb->Append(prefix);
sb->Append(String(" ]\n"));
}
if (mAuthorityCertSerialNumber != NULL) {
sb->Append(prefix);
sb->Append(String(" authorityCertSerialNumber: "));
sb->Append(String(TO_CSTR(mAuthorityCertSerialNumber)));
sb->Append('\n');
}
sb->Append(prefix);
sb->Append(String("]\n"));
return NOERROR;
}
ECode CAuthorityKeyIdentifier::GetKeyIdentifier(
/* [out, callee] */ ArrayOf<Byte>** ppKeyIdentifier)
{
VALIDATE_NOT_NULL(ppKeyIdentifier);
*ppKeyIdentifier = mKeyIdentifier;
REFCOUNT_ADD(*ppKeyIdentifier);
return NOERROR;
}
ECode CAuthorityKeyIdentifier::GetAuthorityCertIssuer(
/* [out] */ IGeneralNames** ppIssuer)
{
VALIDATE_NOT_NULL(ppIssuer);
*ppIssuer = mAuthorityCertIssuer;
REFCOUNT_ADD(*ppIssuer);
return NOERROR;
}
ECode CAuthorityKeyIdentifier::GetAuthorityCertSerialNumber(
/* [out] */ IBigInteger** ppNumber)
{
VALIDATE_NOT_NULL(ppNumber);
*ppNumber = mAuthorityCertSerialNumber;
REFCOUNT_ADD(*ppNumber);
return NOERROR;
}
ECode CAuthorityKeyIdentifier::constructor(
/* [in] */ ArrayOf<Byte>* keyIdentifier,
/* [in] */ IGeneralNames* authorityCertIssuer,
/* [in] */ IBigInteger* authorityCertSerialNumber)
{
mKeyIdentifier = keyIdentifier;
mAuthorityCertIssuer = authorityCertIssuer;
mAuthorityCertSerialNumber = authorityCertSerialNumber;
return NOERROR;
}
ECode CAuthorityKeyIdentifier::Decode(
/* [in] */ ArrayOf<Byte>* encoding,
/* [out] */ IAuthorityKeyIdentifier** ppKeyIdentifier)
{
VALIDATE_NOT_NULL(ppKeyIdentifier);
AutoPtr<IInterface> obj;
IASN1Type::Probe(ASN1)->Decode(encoding, (IInterface**)&obj);
AutoPtr<IAuthorityKeyIdentifier> aki = IAuthorityKeyIdentifier::Probe(obj);
((CAuthorityKeyIdentifier*)(aki.Get()))->mEncoding = encoding;
*ppKeyIdentifier = aki;
REFCOUNT_ADD(*ppKeyIdentifier);
return NOERROR;
}
ECode CAuthorityKeyIdentifier::GetASN1(
/* [out] */ IASN1Type** ppAsn1)
{
VALIDATE_NOT_NULL(ppAsn1);
*ppAsn1 = ASN1;
REFCOUNT_ADD(*ppAsn1);
return NOERROR;
}
ECode CAuthorityKeyIdentifier::SetASN1(
/* [in] */ IASN1Type* pAsn1)
{
ASN1 = pAsn1;
return NOERROR;
}
} // namespace X509
} // namespace Security
} // namespace Harmony
} // namespace Apache
} // namespace Org | 33.158451 | 101 | 0.686206 | jingcao80 |
2f61464da250ce475ed64ec7eb26d779456189f3 | 4,610 | cc | C++ | pcraster/pcraster-4.2.0/pcraster-4.2.0/source/pcraster_aguila/com_util.cc | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | pcraster/pcraster-4.2.0/pcraster-4.2.0/source/pcraster_aguila/com_util.cc | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | pcraster/pcraster-4.2.0/pcraster-4.2.0/source/pcraster_aguila/com_util.cc | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | #include "com_util.h"
#include <cassert>
#include <cmath>
#include <iterator>
#include <vector>
#include "com_const.h"
/*!
\param x
\return The smallest value.
*/
double com_Util::ceil125(double x)
{
double lx, rv;
double p10, fr;
double sign = ( x > 0) ? 1.0 : -1.0;
if (x == 0.0) return 0.0;
lx = std::log10(std::fabs(x));
p10 = std::floor(lx);
fr = std::pow(10.0, lx - p10);
if (fr <= 1.0) fr = 1.0;
else if (fr <= 2.0) fr = 2.0;
else if (fr <= 5.0) fr = 5.0;
else fr = 10.0;
rv = fr * std::pow(10.0, p10);
return sign * rv;
}
void com_Util::linSpace(std::vector<double>::iterator begin,
std::vector<double>::iterator end,
double min, double max)
{
assert(end > begin);
assert(max >= min);
size_t imax(0); // Number of steps minus 1.
double step; // Size of a step.
std::vector<double>::iterator v; // Iterator to a value.
#ifdef BORLANDC
// Borland only supports the old, deprecated, interface which will be removed
// from the standard.
std::distance(begin, end, imax);
imax -= 1;
#else
imax = std::distance(begin, end) - 1;
#endif
if(imax > 0) // More than one value to fill: step is important.
step = (max - min) / static_cast<double>(imax);
else
step = 0; // Only one value to fill (the first): step is not important.
/*
cout << "distance : " << imax << endl;
cout << "step : " << step << endl;
*/
size_t i;
for(v = begin, i = 0; v != end; v++, i++)
{
*v = min + static_cast<double>(i) * step;
}
}
void com_Util::logSpace(std::vector<double>::iterator begin,
std::vector<double>::iterator end,
double min, double max)
{
size_t imax(0); // Number of steps minus 1.
double lmin;
double lmax;
double lstep;
std::vector<double>::iterator v; // Iterator to a value.
#ifdef BORLANDC
// Borland only supports the old, deprecated, interface which will be removed
// from the standard.
std::distance(begin, end, imax);
imax -= 1;
#else
imax = std::distance(begin, end) - 1;
#endif
if((min <= 0.0) || (max <= 0.0) || (imax <= 0)) return;
*begin = min;
*(end - 1) = max;
lmin = std::log(min);
lmax = std::log(max);
lstep = (lmax - lmin) / static_cast<double>(imax);
size_t i;
for(v = begin + 1, i = 1; v != end - 1; v++, i++)
{
*v = std::exp(lmin + static_cast<double>(i) * lstep);
}
}
// /*!
// \param array Double array.
// \param size Size of \a array.
// \return 0 if the sequence is not strictly monotonic, 1 if the sequence
// is strictly monotonically increasing, -1 if the sequence is
// strictly monotonically decreasing.
// */
// int com_Util::monotonic(double *array, int size)
// {
// int rv, i;
// if(size < 2) return 0;
//
// rv = com::sign(array[1] - array[0]);
//
// for (i = 1; i < size - 1; i++)
// {
// if(com::sign(array[i+1] - array[i]) != rv )
// {
// rv = 0;
// break;
// }
// }
//
// return rv;
// }
/*!
\param value Value to be scaled.
\param percentage Percentage!
\return Value scaled by \a percentage percent.
\a percentage can be both negative and positive. A negative \a percentage will
shrink \a value and vice versa. If \a percentage is 0 than \a percentage will
be returned.
*/
double com_Util::scale(double value, double percentage)
{
return (100.0 + percentage) * value / 100.0;
}
//! Returns the smallest number with which \a number can be int divided.
/*!
\param number Number to divide.
\param start Start number to divide with.
\return Smallest divisor.
The result is undefined if \a number == 0 or if \a start > \a number or if
\a start == 0.
*/
size_t com::smallestDivisor(size_t number, size_t start)
{
assert(number > 0);
assert(start <= number);
assert(start > 0);
for(size_t n = start; n < number; ++n) {
if(number % n == 0) {
return n;
}
}
return number;
}
//! Returns the largest number with which \a number can be int divided.
/*!
\param number Number to divide.
\param start Start number to divide with.
\return Largest divisor.
The result is undefined if \a number == 0 or if \a start > \a number or if
\a start == 0.
*/
size_t com::largestDivisor(size_t number, size_t start)
{
assert(number > 0);
assert(start <= number);
assert(start > 0);
for(size_t n = start; n > 1; --n) {
if(number % n == 0) {
return n;
}
}
return 1;
}
| 22.598039 | 80 | 0.574187 | quanpands |
2f6d66246269188a6ee76958fbda89c343bee662 | 9,206 | cc | C++ | compiler/verify/access_test.cc | asoffer/icarus | 5c9af79d1a39e14d95da1adacbdd7392908eedc5 | [
"Apache-2.0"
] | null | null | null | compiler/verify/access_test.cc | asoffer/icarus | 5c9af79d1a39e14d95da1adacbdd7392908eedc5 | [
"Apache-2.0"
] | null | null | null | compiler/verify/access_test.cc | asoffer/icarus | 5c9af79d1a39e14d95da1adacbdd7392908eedc5 | [
"Apache-2.0"
] | null | null | null | #include "compiler/compiler.h"
#include "compiler/module.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "test/module.h"
namespace compiler {
namespace {
using ::testing::ElementsAre;
using ::testing::Eq;
using ::testing::IsEmpty;
using ::testing::Pair;
using ::testing::SizeIs;
using ::testing::UnorderedElementsAre;
TEST(Access, EnumSuccess) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
E ::= enum { A \\ B \\ C }
E.A
)");
auto const *enumerator = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(enumerator);
ASSERT_THAT(qts, SizeIs(1));
EXPECT_TRUE(qts[0].type().is<type::Enum>());
EXPECT_EQ(qts[0].quals(), type::Quals::Const());
EXPECT_THAT(infra.diagnostics(), IsEmpty());
}
TEST(Access, EnumMisnamed) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
E ::= enum { A \\ B \\ C }
E.D
)");
auto const *enumerator = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(enumerator);
EXPECT_TRUE(qts[0].type().is<type::Enum>());
EXPECT_EQ(qts[0].quals(), type::Quals::Const());
EXPECT_THAT(
infra.diagnostics(),
UnorderedElementsAre(Pair("type-error", "missing-constant-member")));
}
TEST(Access, FlagsSuccess) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
F ::= flags { A \\ B \\ C }
F.A
)");
auto const *flag = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(flag);
EXPECT_TRUE(qts[0].type().is<type::Flags>());
EXPECT_EQ(qts[0].quals(), type::Quals::Const());
EXPECT_THAT(infra.diagnostics(), IsEmpty());
}
TEST(Access, FlagsMisnamed) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
F ::= flags { A \\ B \\ C }
F.D
)");
auto const *flag = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(flag);
EXPECT_TRUE(qts[0].type().is<type::Flags>());
EXPECT_EQ(qts[0].quals(), type::Quals::Const());
EXPECT_THAT(
infra.diagnostics(),
UnorderedElementsAre(Pair("type-error", "missing-constant-member")));
}
TEST(Access, NonConstantType) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
T := i64
T.something)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts, ElementsAre(type::QualType::Error()));
EXPECT_THAT(infra.diagnostics(),
UnorderedElementsAre(
Pair("type-error", "non-constant-type-member-access")));
}
// TODO: Test covering an evaluation error when accessing a type member.
TEST(Access, TypeHasNoMembers) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
T ::= i64
T.something)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts, ElementsAre(type::QualType::Error()));
EXPECT_THAT(infra.diagnostics(),
UnorderedElementsAre(Pair("type-error", "type-has-no-members")));
}
TEST(Access, AccessStructField) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
S ::= struct {
n: i64
b: bool
}
non_constant: S
constant :: S
non_constant.n
constant.n
)");
auto stmts = mod.module().stmts();
auto const *non_constant = &stmts[stmts.size() - 2]->as<ast::Expression>();
auto const *constant = &stmts[stmts.size() - 1]->as<ast::Expression>();
auto non_constant_qts = mod.context().qual_types(non_constant);
auto constant_qts = mod.context().qual_types(constant);
EXPECT_THAT(infra.diagnostics(), IsEmpty());
EXPECT_THAT(non_constant_qts,
ElementsAre(type::QualType(type::I64, type::Quals::Ref())));
EXPECT_THAT(constant_qts,
UnorderedElementsAre(type::QualType(
type::I64, type::Quals::Ref() | type::Quals::Const())));
}
TEST(Access, NoFieldInStruct) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
S ::= struct {
n: i64
b: bool
}
s: S
s.x
)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts, ElementsAre(type::QualType::Error()));
EXPECT_THAT(infra.diagnostics(),
UnorderedElementsAre(Pair("type-error", "missing-member")));
}
TEST(Access, ConstantSliceLength) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"("abc".length)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts, ElementsAre(type::QualType(
type::U64, type::Quals::Ref() | type::Quals::Const())));
EXPECT_THAT(infra.diagnostics(), IsEmpty());
}
TEST(Access, NonConstantSliceLength) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
s := "abc"
s.length)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts, ElementsAre(type::QualType(type::U64, type::Quals::Ref())));
EXPECT_THAT(infra.diagnostics(), IsEmpty());
}
TEST(Access, NonConstantSliceData) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
s := "abc"
s.data)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts, ElementsAre(type::QualType(type::BufPtr(type::Char),
type::Quals::Ref())));
EXPECT_THAT(infra.diagnostics(), IsEmpty());
}
TEST(Access, SliceInvalidMember) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
s := "abc"
s.size)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts, ElementsAre(type::QualType::Error()));
EXPECT_THAT(infra.diagnostics(),
UnorderedElementsAre(Pair("type-error", "missing-member")));
}
TEST(Access, ArrayLength) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"([3; i64].length)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts,
ElementsAre(type::QualType::Constant(type::Array::LengthType())));
EXPECT_THAT(infra.diagnostics(), IsEmpty());
}
TEST(Access, MultidimensionalArrayLength) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"([3, 2; i64].length)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts,
ElementsAre(type::QualType::Constant(type::Array::LengthType())));
EXPECT_THAT(infra.diagnostics(), IsEmpty());
}
TEST(Access, ArrayElementType) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"([3, 2; i64].element_type)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts, ElementsAre(type::QualType::Constant(type::Type_)));
EXPECT_THAT(infra.diagnostics(), IsEmpty());
}
TEST(Access, ArrayInvalidMember) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"([3; i64].size)");
auto const *expr = mod.get<ast::Expression>();
auto qts = mod.context().qual_types(expr);
EXPECT_THAT(qts, ElementsAre(type::QualType::Error()));
EXPECT_THAT(
infra.diagnostics(),
UnorderedElementsAre(Pair("type-error", "missing-constant-member")));
}
TEST(Access, CrossModuleStructFieldAccess) {
test::CompilerInfrastructure infra;
infra.add_module("imported", R"(
#{export} S ::= struct {
#{export} n: i64
}
)");
auto &mod = infra.add_module(R"(
mod ::= import "imported"
s: mod.S
s.n
)");
EXPECT_THAT(infra.diagnostics(), IsEmpty());
}
TEST(Access, CrossModuleStructFieldError) {
test::CompilerInfrastructure infra;
infra.add_module("imported", R"(
#{export} S ::= struct {
#{export} n: i64
}
)");
auto &mod = infra.add_module(R"(
mod ::= import "imported"
s: mod.S
s.m
)");
EXPECT_THAT(infra.diagnostics(),
UnorderedElementsAre(Pair("type-error", "missing-member")));
}
TEST(Access, Pattern) {
test::CompilerInfrastructure infra;
auto &mod = infra.add_module(R"(
S ::= struct {
n: i64
}
3 ~ (`s).n
)");
EXPECT_THAT(infra.diagnostics(),
UnorderedElementsAre(Pair("pattern-error", "deducing-access")));
}
// TODO: Field not exported from another module.
// TODO: Non-constant module
// TODO: Module evaluation failure
// TODO: Undeclared identifier across module boundaries
// TODO: Type error across module boundaries (other module already generated
// error)
// TODO: Valid access across module boundaries
// TODO: Valid overload set across module boundary
// TODO: Valid scope set across module boundary
// TODO: Valid mix of overloads and scopes across module boundary
// TODO: Invalid overload set across module boundaries
// TODO: Error on accessing incomplete member.
} // namespace
} // namespace compiler
| 30.084967 | 80 | 0.645449 | asoffer |
2f71342ed59b3d5ff423a16576635f4b488dde86 | 2,591 | hpp | C++ | pass/lgraph_to_lnast/pass_lgraph_to_lnast.hpp | maximiliantiao/livehd | 88215f0d6fc395db96e6ed058f00b9205454bd0c | [
"BSD-3-Clause"
] | null | null | null | pass/lgraph_to_lnast/pass_lgraph_to_lnast.hpp | maximiliantiao/livehd | 88215f0d6fc395db96e6ed058f00b9205454bd0c | [
"BSD-3-Clause"
] | null | null | null | pass/lgraph_to_lnast/pass_lgraph_to_lnast.hpp | maximiliantiao/livehd | 88215f0d6fc395db96e6ed058f00b9205454bd0c | [
"BSD-3-Clause"
] | null | null | null | // This file is distributed under the BSD 3-Clause License. See LICENSE for details.
#pragma once
#include "pass.hpp"
#include "lnast.hpp"
#include "lgraph.hpp"
class Pass_lgraph_to_lnast : public Pass {
protected:
uint64_t temp_var_count = 0;
uint64_t seq_count = 0;
void do_trans(LGraph *g, Eprp_var &var, std::string_view module_name);
void initial_tree_coloring(LGraph *g);
void begin_transformation(LGraph *g, Lnast& lnast, Lnast_nid& ln_node);
void handle_output_node(LGraph *lg, Node_pin& pin, Lnast& lnast, Lnast_nid& ln_node);
void handle_source_node(LGraph *lg, Node_pin& pin, Lnast& lnast, Lnast_nid& ln_node);
void attach_to_lnast(Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_output_to_lnast(Lnast& lnast, Lnast_nid& parent_node, const Node_pin &opin);
void attach_sum_node (Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_binaryop_node (Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_not_node (Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_join_node (Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_pick_node (Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_comparison_node(Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_simple_node (Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_mux_node (Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_flop_node (Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_subgraph_node (Lnast& lnast, Lnast_nid& parent_node, const Node_pin &pin);
void attach_children_to_node(Lnast& lnast, Lnast_nid& op_node, const Node_pin &pin);
void attach_child(Lnast& lnast, Lnast_nid& op_node, const Node_pin &dpin);
//void attach_child(Lnast& lnast, Lnast_nid& op_node, const Node_pin &dpin, std::string prefix);
void attach_cond_child(Lnast& lnast, Lnast_nid& op_node, const Node_pin &dpin);
void handle_io(LGraph *g, Lnast_nid& parent_lnast_node, Lnast& lnast);
std::string_view get_driver_of_output(const Node_pin dpin);
std::string_view dpin_get_name(const Node_pin dpin);
std::string_view get_new_seq_name(Lnast& lnast);
public:
static void trans(Eprp_var &var);
Pass_lgraph_to_lnast(const Eprp_var &var);
static void setup();
};
| 49.826923 | 105 | 0.708221 | maximiliantiao |
2f726f13dfbfcaa829a1d4fd3067f2c66e0e51ae | 15,367 | cpp | C++ | OpenMMPlugin/OpenMMPlugin.cpp | MadCatX/molmodel | 5abde979e1780dcc61a4b05affcba6e116250585 | [
"MIT"
] | null | null | null | OpenMMPlugin/OpenMMPlugin.cpp | MadCatX/molmodel | 5abde979e1780dcc61a4b05affcba6e116250585 | [
"MIT"
] | null | null | null | OpenMMPlugin/OpenMMPlugin.cpp | MadCatX/molmodel | 5abde979e1780dcc61a4b05affcba6e116250585 | [
"MIT"
] | null | null | null | /* -------------------------------------------------------------------------- *
* SimTK Molmodel(tm): OpenMM Plugin *
* -------------------------------------------------------------------------- *
* This is part of the SimTK Core biosimulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2009-11 Stanford University and the Authors. *
* Authors: Michael Sherman *
* Contributors: *
* *
* 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, CONTRIBUTORS 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. *
* -------------------------------------------------------------------------- */
// Suppress irrelevant warnings from Microsoft's compiler.
#ifdef _MSC_VER
#pragma warning(disable:4996) // sprintf is unsafe
#pragma warning(disable:4251) // no dll interface for some classes
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#include "SimTKcommon.h"
#include "OpenMMPlugin.h"
#include "DuMMForceFieldSubsystemRep.h"
#include "OpenMM.h"
#include <string>
#include <vector>
#include <exception>
#include <cassert>
using namespace SimTK;
#define STRINGIZE(var) #var
#define MAKE_VERSION_STRING(maj,min,build) STRINGIZE(maj.min.build)
/**
* This is a concrete implementation of the OpenMMPluginInterface class defined
* by Molmodel.
*/
class OpenMMInterface : public OpenMMPluginInterface {
public:
OpenMMInterface(const DuMMForceFieldSubsystemRep& dumm)
: dumm(dumm), openMMSystem(0), openMMContext(0), openMMIntegrator(0) {}
~OpenMMInterface() {deleteOpenMM();}
// This reports the version of Molmodel which was current at the time
// this plugin was compiled.
std::string getMolmodelVersion() const {
return MAKE_VERSION_STRING(SimTK_MOLMODEL_MAJOR_VERSION,
SimTK_MOLMODEL_MINOR_VERSION,
SimTK_MOLMODEL_PATCH_VERSION);
}
// Call this during Molmodel's realizeTopology() method. Return value
// is the selected OpenMM Platform name.
std::string initializeOpenMM(bool allowReferencePlatform,
std::vector<std::string>& logMessages) throw();
// Calculates forces and/or energy and *adds* them into the output
// parameters.
void calcOpenMMNonbondedAndGBSAForces
(const Vector_<Vec3>& includedAtomStation_G,
const Vector_<Vec3>& includedAtomPos_G,
bool wantForces,
bool wantEnergy,
Vector_<SpatialVec>& includedBodyForce_G,
Real& energy) const;
private:
// Put this object back into its just-constructed condition.
void deleteOpenMM() {
delete openMMIntegrator; openMMIntegrator=0;
delete openMMContext; openMMContext=0;
delete openMMSystem; openMMSystem=0;
}
private:
const DuMMForceFieldSubsystemRep& dumm;
OpenMM::System* openMMSystem;
OpenMM::Context* openMMContext;
OpenMM::Integrator* openMMIntegrator; // dummy
};
//-----------------------------------------------------------------------------
// SimTK_createOpenMMPluginInterface
//-----------------------------------------------------------------------------
// This is the exported, non-name-mangled symbol that is called from the loading
// process to get access to this plugin's implementation of the OpenMM plugin
// interface defined by DuMM.
extern "C" EXPORT OpenMMPluginInterface*
SimTK_createOpenMMPluginInterface(const DuMMForceFieldSubsystemRep& dumm) {
return new OpenMMInterface(dumm);
}
//-----------------------------------------------------------------------------
// initializeOpenMM
//-----------------------------------------------------------------------------
std::string OpenMMInterface::
initializeOpenMM(bool allowReferencePlatform,
std::vector<std::string>& logMessages) throw()
{
logMessages.clear();
// Determine whether OpenMM supports all the features we've asked for.
// OpenMM does not support 1-2, 1-3, or 1-5 scaling.
if ( dumm.vdwScale12!=0 || dumm.coulombScale12!=0
|| dumm.vdwScale13!=0 || dumm.coulombScale13!=0
|| dumm.vdwScale15!=1 || dumm.coulombScale15!=1)
{
logMessages.push_back(
"WARNING: Can't use OpenMM: unsupported vdW or Coulomb scaling required.\n");
return "";
}
// Currently OpenMM supports only the Lorentz-Berthelot L-J combining rule
// as used by AMBER and CHARMM.
if ( dumm.vdwGlobalScaleFactor != 0
&& dumm.vdwMixingRule != DuMMForceFieldSubsystem::LorentzBerthelot)
{
logMessages.push_back(
"WARNING: Can't use OpenMM: only the Lorentz-Berthelot"
" (AMBER) Lennard Jones mixing rule is supported.\n");
return "";
}
try {
// OpenMM SYSTEM //
openMMSystem = new OpenMM::System();
for (DuMM::NonbondAtomIndex nax(0); nax < dumm.getNumNonbondAtoms(); ++nax) {
const Element& e = Element::getByAtomicNumber
(dumm.getAtomElementNum(dumm.getAtomIndexOfNonbondAtom(nax)));
openMMSystem->addParticle(e.getMass());
}
// NONBONDED FORCES //
if (dumm.coulombGlobalScaleFactor!=0 || dumm.vdwGlobalScaleFactor!=0) {
OpenMM::NonbondedForce* nonbondedForce = new OpenMM::NonbondedForce();
// Scale charges by sqrt of scale factor so that products of charges
// scale linearly.
const Real sqrtCoulombScale = std::sqrt(dumm.coulombGlobalScaleFactor);
// Here we'll define all the OpenMM particles, one per DuMM nonbond
// atom. We'll also build up the list of all 1-2 bonds between nonbond
// atoms which will be used by OpenMM as an exceptions list, with
// nonbond interactions excluded for 1-2 and 1-3 connections, and
// scaled down for 1-4 connections. Since OpenMM doesn't know about
// bodies, we can't used the stripped-down cross-body bond lists here.
// We will look at all the 1-2 bonds for each nonbond atom and keep
// those that connect to another nonbond atom.
std::vector< std::pair<int, int> > ommBonds;
for (DuMM::NonbondAtomIndex nax(0); nax < dumm.getNumNonbondAtoms();
++nax)
{ const DuMMAtom& a = dumm.getAtom(dumm.getAtomIndexOfNonbondAtom(nax));
const ChargedAtomType& atype = dumm.chargedAtomTypes[a.chargedAtomTypeIndex];
const AtomClass& aclass = dumm.atomClasses[atype.atomClassIx];
const Real charge = atype.partialCharge;
const Real sigma = 2*aclass.vdwRadius*DuMM::Radius2Sigma;
const Real wellDepth = aclass.vdwWellDepth;
// Define particle; particle number will be the same as our
// nonbond index number.
nonbondedForce->addParticle(sqrtCoulombScale*charge, sigma,
dumm.vdwGlobalScaleFactor*wellDepth);
// Collect 1-2 bonds to other nonbond atoms. Note that we
// don't care about bodies here -- every atom is considered
// independent.
for (unsigned short i=0; i < a.bond12.size(); ++i) {
const DuMMAtom& b = dumm.getAtom(a.bond12[i]);
if (!b.nonbondAtomIndex.isValid()) continue;
ommBonds.push_back(std::pair<int,int>(nax,b.nonbondAtomIndex));
}
}
// Register all the 1-2 bonds between nonbond atoms for scaling.
nonbondedForce->createExceptionsFromBonds
(ommBonds, dumm.coulombScale14, dumm.vdwScale14);
// System takes over heap ownership of the force.
openMMSystem->addForce(nonbondedForce);
}
// GBSA //
if (dumm.gbsaGlobalScaleFactor != 0) {
OpenMM::GBSAOBCForce* GBSAOBCForce = new OpenMM::GBSAOBCForce();
GBSAOBCForce->setSolventDielectric(dumm.gbsaSolventDielectric);
GBSAOBCForce->setSoluteDielectric(dumm.gbsaSoluteDielectric);
// Watch the units here. OpenMM works exclusively in MD (nm, kJ/mol).
// CPU GBSA uses Angstrom, kCal/mol.
for (DuMM::NonbondAtomIndex nax(0); nax < dumm.getNumNonbondAtoms();
++nax)
{ GBSAOBCForce->addParticle(dumm.gbsaAtomicPartialCharges[nax],
dumm.gbsaRadii[nax]*OpenMM::NmPerAngstrom,
dumm.gbsaObcScaleFactors[nax]);
}
// System takes over heap ownership of the force.
openMMSystem->addForce(GBSAOBCForce);
}
// OpenMM CONTEXT //
const std::vector<std::string> pluginsLoaded =
OpenMM::Platform::loadPluginsFromDirectory(OpenMM::Platform::getDefaultPluginsDirectory());
logMessages.push_back("NOTE: Loaded " + String(pluginsLoaded.size()) + " OpenMM plugins:");
for (unsigned i=0; i < pluginsLoaded.size(); ++i)
logMessages.back() += " " + pluginsLoaded[i];
const int nPlatforms = OpenMM::Platform::getNumPlatforms();
logMessages.push_back("NOTE: OpenMM has " + String(nPlatforms) + " Platforms registered: ");
for (int i = 0; i < nPlatforms; ++i) {
const OpenMM::Platform& platform = OpenMM::Platform::getPlatform(i);
logMessages.back() += " " + platform.getName();
}
// This is just a dummy to keep OpenMM happy; we're not using it for anything
// so it doesn't matter what kind of integrator we pick.
openMMIntegrator = new OpenMM::VerletIntegrator(0.1);
openMMContext = new OpenMM::Context(*openMMSystem, *openMMIntegrator);
const std::string pname = openMMContext->getPlatform().getName();
const double speed = openMMContext->getPlatform().getSpeed();
if (speed <= 1 && !allowReferencePlatform) {
logMessages.push_back(
"WARNING: DuMM: OpenMM not used: best available platform was "
+ pname + " with relative speed=" + String(speed)
+ ".\nCall setAllowOpenMMReference() if you want to use this anyway.\n");
deleteOpenMM();
return "";
}
return openMMContext->getPlatform().getName();
}
catch (const std::exception& e) {
logMessages.push_back(std::string("ERROR: OpenMM error during initialization: ") + e.what());
deleteOpenMM();
return "";
}
catch (...) {
logMessages.push_back("ERROR: Unknown exception during OpenMM initialization.");
deleteOpenMM();
return "";
}
}
//-----------------------------------------------------------------------------
// calcOpenMMNonbondedAndGBSAForces
//-----------------------------------------------------------------------------
void OpenMMInterface::calcOpenMMNonbondedAndGBSAForces
(const Vector_<Vec3>& includedAtomStation_G,
const Vector_<Vec3>& includedAtomPos_G,
bool wantForces,
bool wantEnergy,
Vector_<SpatialVec>& includedBodyForces_G,
Real& energy) const
{
assert(includedAtomStation_G.size() == dumm.getNumIncludedAtoms());
assert(includedAtomPos_G.size() == dumm.getNumIncludedAtoms());
assert(includedBodyForces_G.size() == dumm.getNumIncludedBodies());
if (!(wantForces || wantEnergy))
return;
if (!openMMContext)
throw std::runtime_error("ERROR: calcOpenMMNonbondedAndGBSAForces(): OpenMM has not been initialized.");
// Positions arrive in an array of all included atoms. Compress that down
// to just nonbond atoms and convert to OpenMM Vec3 type.
std::vector<OpenMM::Vec3> positions(dumm.getNumNonbondAtoms());
for (DuMM::NonbondAtomIndex nax(0); nax < dumm.getNumNonbondAtoms(); ++nax)
{ const Vec3& pos =
includedAtomPos_G[dumm.getIncludedAtomIndexOfNonbondAtom(nax)];
positions[nax] = OpenMM::Vec3(pos[0], pos[1], pos[2]); }
openMMContext->setPositions(positions);
// Ask for energy, forces, or both.
const OpenMM::State openMMState =
openMMContext->getState( (wantForces?OpenMM::State::Forces:0)
| (wantEnergy?OpenMM::State::Energy:0));
if (wantForces) {
const std::vector<OpenMM::Vec3>& openMMForces = openMMState.getForces();
for (DuMM::NonbondAtomIndex nax(0); nax < dumm.getNumNonbondAtoms();
++nax)
{ const DuMM::IncludedAtomIndex iax =
dumm.getIncludedAtomIndexOfNonbondAtom(nax);
const IncludedAtom& a = dumm.getIncludedAtom(iax);
const DuMMIncludedBodyIndex ibx = a.inclBodyIndex;
const OpenMM::Vec3& ommForce = openMMForces[nax];
const Vec3 f(ommForce[0], ommForce[1], ommForce[2]);
includedBodyForces_G[ibx] +=
SpatialVec(includedAtomStation_G[iax] % f, f);
}
}
if (wantEnergy)
energy += openMMState.getPotentialEnergy();
}
| 45.599407 | 113 | 0.573437 | MadCatX |
2f736a6ce93bac0581e2d3fe130792a513fccd8e | 277 | cpp | C++ | 5.14/5_14.cpp | dengxianglong/cplusplusprimerplusstudy | eefc5d7bf5ab31186c04171fadade3552838f4b2 | [
"MIT"
] | null | null | null | 5.14/5_14.cpp | dengxianglong/cplusplusprimerplusstudy | eefc5d7bf5ab31186c04171fadade3552838f4b2 | [
"MIT"
] | null | null | null | 5.14/5_14.cpp | dengxianglong/cplusplusprimerplusstudy | eefc5d7bf5ab31186c04171fadade3552838f4b2 | [
"MIT"
] | 1 | 2018-08-29T07:40:20.000Z | 2018-08-29T07:40:20.000Z | #include<iostream>
#include<ctime>
int main()
{
using namespace std;
cout<<"Enter the time of seconds";
float secs;
cin>>secs;
clock_t delay=secs*CLOCKS_PER_SEC;
cout<<"starting\a\n";
clock_t start=clock();
while(clock()-start<delay)
;
cout<<"done\a\n";
return 0;
} | 17.3125 | 35 | 0.685921 | dengxianglong |
2f73c76c39570c855639304268358b31a016875c | 6,115 | cpp | C++ | source/response/NetcdfResponse.cpp | fmidev/smartmet-plugin-wcs | 60aee4d3ef9d2bba5de44b4a871f669fc1b47d08 | [
"MIT"
] | null | null | null | source/response/NetcdfResponse.cpp | fmidev/smartmet-plugin-wcs | 60aee4d3ef9d2bba5de44b4a871f669fc1b47d08 | [
"MIT"
] | 8 | 2017-04-07T13:14:46.000Z | 2018-04-25T08:04:22.000Z | source/response/NetcdfResponse.cpp | fmidev/smartmet-plugin-wcs | 60aee4d3ef9d2bba5de44b4a871f669fc1b47d08 | [
"MIT"
] | 1 | 2017-06-03T19:07:22.000Z | 2017-06-03T19:07:22.000Z | #include "NetcdfResponse.h"
#include "Options.h"
#include "WcsConvenience.h"
#include "WcsException.h"
#include <exception>
#include <fstream>
namespace SmartMet
{
namespace Plugin
{
namespace WCS
{
void NetcdfResponse::get(std::ostream& output) {}
void NetcdfResponse::setEngine(const Spine::SmartMetEngine* engine)
{
if (engine == nullptr)
throw std::runtime_error("No Engine available");
if (const Engine::Querydata::Engine* e = dynamic_cast<const Engine::Querydata::Engine*>(engine))
{
mEngine = e;
}
else
{
std::ostringstream msg;
msg << "Unsupported class object '" << typeid(engine).name()
<< "' passed into 'NetcdfResponse::setEngine'";
throw std::runtime_error(msg.str());
}
}
void NetcdfResponse::setParamConfig(const ParamConfig::Shared paramConfig)
{
mParamConfig = std::dynamic_pointer_cast<NetcdfParamConfig>(paramConfig);
if (not mParamConfig)
{
std::ostringstream msg;
msg << "Dynamic pointer cast from ParamConfig to NetcdfParamConfig failed";
throw std::runtime_error(msg.str());
}
}
NetcdfResponse::IdValueZPair NetcdfResponse::solveNearestLevel(QdataShared q,
const ValueZ& levelValue)
{
q->firstLevel();
Id nearestLevelIndex = q->levelIndex();
ValueZ nearestLevelValue = q->levelValue();
ValueZ distanceToNearestLevel = std::fabs(nearestLevelValue - levelValue);
q->resetLevel();
while (q->nextLevel())
{
ValueZ distanceCandidate = std::fabs(q->levelValue() - levelValue);
if (distanceCandidate < distanceToNearestLevel)
{
distanceToNearestLevel = distanceCandidate;
nearestLevelIndex = q->levelIndex();
nearestLevelValue = q->levelValue();
}
if (distanceToNearestLevel == 0.0)
break;
}
return std::make_pair(nearestLevelIndex, nearestLevelValue);
}
NetcdfResponse::IdValueTPair NetcdfResponse::solveNearestTime(QdataShared q,
const ValueT& timeValue)
{
q->firstTime();
Id nearestTimeIndex = q->timeIndex();
ValueT nearestTimeValue = q->validTime();
ValueT t = q->validTime();
unsigned long distanceToNearestTime =
std::abs(boost::posix_time::time_duration(t - timeValue).total_seconds());
q->resetTime();
while (q->nextTime())
{
t = q->validTime();
unsigned long distanceCandidate =
std::abs(boost::posix_time::time_duration(t - timeValue).total_seconds());
if (distanceCandidate < distanceToNearestTime)
{
distanceToNearestTime = distanceCandidate;
nearestTimeIndex = q->timeIndex();
nearestTimeValue = q->validTime();
}
if (distanceToNearestTime == 0)
break;
}
return std::make_pair(nearestTimeIndex, nearestTimeValue);
}
NetcdfResponse::IdValueXPair NetcdfResponse::solveNearestX(QdataShared q, const ValueX& xValue)
{
if (not q->isGrid())
throw WcsException(WcsException::NO_APPLICABLE_CODE, "Missing Grid.");
Options::Shared opt = std::dynamic_pointer_cast<Options>(ResponseBase::getOptions());
if (not opt)
throw std::runtime_error("Cannot cast query options object from OptionsBase to Options.");
auto transformation = opt->getTransformation();
if (not transformation)
throw std::runtime_error("Transformation missing!");
q->firstTime();
q->firstLevel();
auto xNumber = q->grid().XNumber();
auto yNumber = q->grid().YNumber();
// Choose a line in the midle of grid (y-direction).
Id startId = yNumber / 2 * xNumber;
Id id = startId;
auto nearestLocIndex = startId;
auto nearestLocValue = q->latLon(startId);
NFmiPoint tLoc = nearestLocValue;
ValueX distanceToNearestLoc = std::abs(tLoc.X() - xValue);
while (id < startId + xNumber)
{
tLoc = q->latLon(id);
ValueX distanceCandidate = std::abs(tLoc.X() - xValue);
if (distanceCandidate < distanceToNearestLoc)
{
distanceToNearestLoc = distanceCandidate;
nearestLocIndex = id;
nearestLocValue = tLoc;
}
if (distanceToNearestLoc < 0.000001)
break;
id++;
}
return std::make_pair(nearestLocIndex - startId, nearestLocValue.X());
}
NetcdfResponse::IdValueYPair NetcdfResponse::solveNearestY(QdataShared q, const ValueY& yValue)
{
if (not q->isGrid())
throw WcsException(WcsException::NO_APPLICABLE_CODE, "Missing Grid.");
Options::Shared opt = std::dynamic_pointer_cast<Options>(ResponseBase::getOptions());
if (not opt)
throw std::runtime_error("Cannot cast query options object from OptionsBase to Options.");
auto transformation = opt->getTransformation();
if (not transformation)
throw std::runtime_error("Transformation missing!");
q->firstTime();
q->firstLevel();
Id xNumber = q->grid().XNumber();
Id yNumber = q->grid().YNumber();
Id maxNumber = xNumber * yNumber;
Id startId = xNumber / 2;
Id id = startId;
Id nearestLocIndex = startId;
NFmiPoint nearestLocValue = q->latLon(startId);
NFmiPoint tLoc = nearestLocValue;
ValueY distanceToNearestLoc = std::abs(tLoc.Y() - yValue);
while (id < maxNumber)
{
tLoc = q->latLon(id);
ValueY distanceCandidate = std::abs(tLoc.Y() - yValue);
if (distanceCandidate < distanceToNearestLoc)
{
distanceToNearestLoc = distanceCandidate;
nearestLocIndex = id;
nearestLocValue = tLoc;
}
if (distanceToNearestLoc < 0.000001)
break;
id += xNumber;
}
return std::make_pair((nearestLocIndex / xNumber), nearestLocValue.Y());
}
NetcdfResponse::RangeZ NetcdfResponse::solveRangeZ(QdataShared q)
{
q->firstLevel();
ValueZ low = q->levelValue();
ValueZ high = low;
while (q->nextLevel())
high = q->levelValue();
if (low > high)
std::swap(low, high);
return std::make_pair(low, high);
}
NetcdfResponse::RangeT NetcdfResponse::solveRangeT(QdataShared q)
{
q->firstTime();
ValueT low = q->validTime();
ValueT high = q->validTime();
q->resetTime();
while (q->nextTime())
{
high = q->validTime();
}
return std::make_pair(low, high);
}
} // namespace WCS
} // namespace Plugin
} // namespace SmartMet
| 27.545045 | 98 | 0.677514 | fmidev |
2f74f7047801223f3c2f19e655a7f430ae9e28f9 | 6,947 | cpp | C++ | source/tm/pokemon/substitute.cpp | davidstone/technical-machine | fea3306e58cd026846b8f6c71d51ffe7bab05034 | [
"BSL-1.0"
] | 7 | 2021-03-05T16:50:19.000Z | 2022-02-02T04:30:07.000Z | source/tm/pokemon/substitute.cpp | davidstone/technical-machine | fea3306e58cd026846b8f6c71d51ffe7bab05034 | [
"BSL-1.0"
] | 47 | 2021-02-01T18:54:23.000Z | 2022-03-06T19:06:16.000Z | source/tm/pokemon/substitute.cpp | davidstone/technical-machine | fea3306e58cd026846b8f6c71d51ffe7bab05034 | [
"BSL-1.0"
] | 1 | 2021-01-28T13:10:41.000Z | 2021-01-28T13:10:41.000Z | // Copyright David Stone 2020.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <tm/pokemon/substitute.hpp>
#include <tm/move/moves.hpp>
#include <tm/move/target.hpp>
#include <tm/generation.hpp>
namespace technicalmachine {
namespace {
auto target_based(Generation const generation, Moves const move) {
switch (move_target(generation, move)) {
case Target::user:
case Target::all_allies:
case Target::adjacent_ally:
case Target::user_team:
case Target::user_field:
case Target::foe_field:
case Target::all:
case Target::field:
return Substitute::bypassed;
case Target::adjacent_foe:
case Target::all_adjacent_foes:
case Target::adjacent:
case Target::any:
case Target::all_adjacent:
return Substitute::absorbs;
case Target::user_or_adjacent_ally:
// TODO: Generation 5 allows it only when used on itself
return generation <= Generation::four ?
Substitute::causes_failure :
Substitute::bypassed;
}
}
constexpr auto gen1_substitute_interaction(Moves const move) {
switch (move) {
case Moves::Disable:
case Moves::Leech_Seed:
case Moves::Super_Fang:
case Moves::Transform:
case Moves::Bind:
case Moves::Clamp:
case Moves::Fire_Spin:
case Moves::Wrap:
return Substitute::bypassed;
default:
return target_based(Generation::one, move);
}
}
constexpr auto gen2_substitute_interaction(Moves const move) {
// Fails if user has Substitute
#if 0
case Moves::Counter:
case Moves::Mirror_Coat:
case Moves::Protect:
case Moves::Detect:
case Moves::Endure:
}
#endif
// Partially blocked
#if 0
switch (move) {
case Moves::Curse: (Ghost, effect only)
case Moves::Swagger: (confusion only)
}
#endif
// Cancel partial trap
// Boost Rage even if Substitute hit
switch (move) {
case Moves::Attract:
case Moves::Disable:
case Moves::Encore:
case Moves::Foresight:
case Moves::Mean_Look:
case Moves::Mimic:
case Moves::Psych_Up:
case Moves::Roar:
case Moves::Spider_Web:
case Moves::Spite:
case Moves::Transform:
case Moves::Whirlwind:
return Substitute::bypassed;
case Moves::Absorb:
case Moves::Dream_Eater:
case Moves::Giga_Drain:
case Moves::Leech_Life:
case Moves::Mega_Drain:
return Substitute::causes_failure;
default:
return target_based(Generation::two, move);
}
}
constexpr auto gen3_substitute_interaction(Moves const move) {
// Fails
#if 0
switch (move) {
case Moves::Curse: (Ghost, effect only)
}
#endif
// Block Intimidate
// Absorb Uproar
switch (move) {
case Moves::Attract:
case Moves::Disable:
case Moves::Encore:
case Moves::Foresight:
case Moves::Odor_Sleuth:
case Moves::Psych_Up:
case Moves::Roar:
case Moves::Role_Play:
case Moves::Skill_Swap:
case Moves::Spite:
case Moves::Taunt:
case Moves::Tickle:
case Moves::Torment:
case Moves::Transform:
case Moves::Whirlwind:
return Substitute::bypassed;
case Moves::Dream_Eater:
return Substitute::causes_failure;
default:
return target_based(Generation::three, move);
}
}
constexpr auto gen4_substitute_interaction(Moves const move) {
// Fails
#if 0
switch (move) {
case Moves::Curse: (Ghost, effect only)
}
#endif
// Block Intimidate
// Block confusion from berries
// Blocks Intimidate even if U-turn breaks the Substitute
// Blocks Toxic Spikes poisoning
// Defog doesn't lower evasiveness
// Absorb Uproar
switch (move) {
case Moves::Attract:
case Moves::Disable:
case Moves::Encore:
case Moves::Foresight:
case Moves::Guard_Swap:
case Moves::Heart_Swap:
case Moves::Miracle_Eye:
case Moves::Odor_Sleuth:
case Moves::Power_Swap:
case Moves::Psych_Up:
case Moves::Roar:
case Moves::Role_Play:
case Moves::Skill_Swap:
case Moves::Spite:
case Moves::Taunt:
case Moves::Torment:
case Moves::Transform:
case Moves::Whirlwind:
return Substitute::bypassed;
case Moves::Dream_Eater:
return Substitute::causes_failure;
default:
return target_based(Generation::four, move);
}
}
constexpr auto gen5_substitute_interaction(Moves const move) {
// Block Intimidate
// Block Imposter
// Absorb Uproar
switch (move) {
case Moves::After_You:
case Moves::Attract:
case Moves::Conversion_2:
case Moves::Disable:
case Moves::Encore:
case Moves::Foresight:
case Moves::Guard_Swap:
case Moves::Heart_Swap:
case Moves::Miracle_Eye:
case Moves::Odor_Sleuth:
case Moves::Power_Swap:
case Moves::Psych_Up:
case Moves::Reflect_Type:
case Moves::Roar:
case Moves::Role_Play:
case Moves::Skill_Swap:
case Moves::Spite:
case Moves::Taunt:
case Moves::Torment:
case Moves::Whirlwind:
return Substitute::bypassed;
default:
return target_based(Generation::five, move);
}
}
constexpr auto latest_substitute_interaction(Generation const generation, Moves const move) {
// Block Intimidate
// Block Imposter
// Absorb Uproar
switch (move) {
case Moves::After_You:
case Moves::Attract:
case Moves::Bestow:
case Moves::Boomburst:
case Moves::Bug_Buzz:
case Moves::Chatter:
case Moves::Clanging_Scales:
case Moves::Clangorous_Soulblaze:
case Moves::Confide:
case Moves::Conversion_2:
case Moves::Disable:
case Moves::Disarming_Voice:
case Moves::Echoed_Voice:
case Moves::Encore:
case Moves::Foresight:
case Moves::Grass_Whistle:
case Moves::Growl:
case Moves::Guard_Swap:
case Moves::Heart_Swap:
case Moves::Hyperspace_Fury:
case Moves::Hyperspace_Hole:
case Moves::Hyper_Voice:
case Moves::Instruct:
case Moves::Metal_Sound:
case Moves::Miracle_Eye:
case Moves::Noble_Roar:
case Moves::Odor_Sleuth:
case Moves::Parting_Shot:
case Moves::Play_Nice:
case Moves::Powder:
case Moves::Power_Swap:
case Moves::Psych_Up:
case Moves::Reflect_Type:
case Moves::Relic_Song:
case Moves::Roar:
case Moves::Role_Play:
case Moves::Round:
case Moves::Screech:
case Moves::Sing:
case Moves::Skill_Swap:
case Moves::Snarl:
case Moves::Snore:
case Moves::Sparkling_Aria:
case Moves::Spectral_Thief:
case Moves::Speed_Swap:
case Moves::Spite:
case Moves::Supersonic:
case Moves::Taunt:
case Moves::Torment:
case Moves::Whirlwind:
return Substitute::bypassed;
default:
return target_based(generation, move);
}
}
} // namespace
auto substitute_interaction(Generation const generation, Moves const move) -> Substitute::Interaction {
switch (generation) {
case Generation::one: return gen1_substitute_interaction(move);
case Generation::two: return gen2_substitute_interaction(move);
case Generation::three: return gen3_substitute_interaction(move);
case Generation::four: return gen4_substitute_interaction(move);
case Generation::five: return gen5_substitute_interaction(move);
default: return latest_substitute_interaction(generation, move);
}
}
} // namespace technicalmachine
| 24.810714 | 103 | 0.727508 | davidstone |
2f788e33af522aa9557545464bbcff4bb798e174 | 629 | cc | C++ | caffe2/contrib/script/lexer.cc | shigengtian/caffe2 | e19489d6acd17fea8ca98cd8e4b5b680e23a93c5 | [
"Apache-2.0"
] | 585 | 2015-08-10T02:48:52.000Z | 2021-12-01T08:46:59.000Z | caffe2/contrib/script/lexer.cc | mingzhe09088/caffe2 | 8f41717c46d214aaf62b53e5b3b9b308b5b8db91 | [
"Apache-2.0"
] | 27 | 2018-04-14T06:44:22.000Z | 2018-08-01T18:02:39.000Z | caffe2/contrib/script/lexer.cc | mingzhe09088/caffe2 | 8f41717c46d214aaf62b53e5b3b9b308b5b8db91 | [
"Apache-2.0"
] | 183 | 2015-08-10T02:49:04.000Z | 2021-12-01T08:47:13.000Z | #include "caffe2/contrib/script/lexer.h"
#include "caffe2/core/common.h"
namespace caffe2 {
namespace script {
std::string kindToString(int kind) {
if (kind < 256)
return std::string(1, kind);
switch (kind) {
#define DEFINE_CASE(tok, str, _) \
case tok: \
return str;
TC_FORALL_TOKEN_KINDS(DEFINE_CASE)
#undef DEFINE_CASE
default:
throw std::runtime_error("unknown kind: " + caffe2::to_string(kind));
}
}
SharedParserData& sharedParserData() {
static SharedParserData data; // safely handles multi-threaded init
return data;
}
} // namespace script
} // namespace caffe2
| 23.296296 | 75 | 0.678855 | shigengtian |
2f7beda12553d4f4497978504718c5f2d671ed2e | 1,462 | hpp | C++ | input/InputHandler.hpp | CaDS-Studentprojects/PixelGames | a1d7b57bdd9699fc36a64f8a86b92fbd61a3c3df | [
"MIT"
] | null | null | null | input/InputHandler.hpp | CaDS-Studentprojects/PixelGames | a1d7b57bdd9699fc36a64f8a86b92fbd61a3c3df | [
"MIT"
] | null | null | null | input/InputHandler.hpp | CaDS-Studentprojects/PixelGames | a1d7b57bdd9699fc36a64f8a86b92fbd61a3c3df | [
"MIT"
] | null | null | null | /*
* InputHandler.hpp
*
* Created on: Mar 5, 2018
* Author: daniel
*/
#ifndef INPUTHANDLER_HPP_
#define INPUTHANDLER_HPP_
#include <iostream>
#include <thread>
#include <memory>
//#include <ncurses.h>
#include "Input.hpp"
using namespace std;
namespace pixelgames {
namespace input {
class InputHandler {
public:
InputHandler(atomic<Input> & player_input)
: player_input_ { player_input }, the_thread_() {
}
~InputHandler() {
isRunning_ = false;
if (the_thread_.joinable()) the_thread_.join();
}
void start() {
isRunning_ = true;
the_thread_ = std::thread(&InputHandler::ThreadMain, this);
}
private:
atomic<Input>& player_input_;
thread the_thread_;
bool isRunning_ = false;
void ThreadMain() {
// initscr();
// printw("Hi!\n");
// refresh();
while (isRunning_) {
char c; // = getchar();
cin >> c;
Input action = c == 'w' ? Input::UP : c == 's' ? Input::DOWN : c == 'a' ? Input::LEFT :
c == 'd' ? Input::RIGHT : Input::COUNT;
if(action == Input::COUNT){
isRunning_ = false;
}
player_input_.store(action);
// Do something useful, e.g:
//std::this_thread::sleep_for( std::chrono::seconds(1) );
}
cout << "Bye!" << endl;
}
};
} /* namespace input */
} /* namespace pixelgames */
#endif /* INPUTHANDLER_HPP_ */
| 19.756757 | 95 | 0.559508 | CaDS-Studentprojects |
2f7cc82989ef7d05398699e3de5904c6d30beaa0 | 7,505 | cpp | C++ | wpb_mani_bringup/src/wpb_mani_dummy.cpp | 6-robot/wpb_mani | 6aa6e2d8713c8d018a422e4665ff8fcd7e299ad0 | [
"BSD-3-Clause"
] | 4 | 2021-02-08T03:55:26.000Z | 2021-12-13T12:06:34.000Z | wpb_mani_bringup/src/wpb_mani_dummy.cpp | 6-robot/wpb_mani | 6aa6e2d8713c8d018a422e4665ff8fcd7e299ad0 | [
"BSD-3-Clause"
] | null | null | null | wpb_mani_bringup/src/wpb_mani_dummy.cpp | 6-robot/wpb_mani | 6aa6e2d8713c8d018a422e4665ff8fcd7e299ad0 | [
"BSD-3-Clause"
] | 1 | 2021-06-08T01:17:54.000Z | 2021-06-08T01:17:54.000Z | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2017-2020, Waterplus http://www.6-robot.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the WaterPlus 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 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* FOOTPRINTAL, 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.
*********************************************************************/
/*!******************************************************************
@author ZhangWanjie
********************************************************************/
#include <ros/ros.h>
#include <tf/transform_broadcaster.h>
#include <nav_msgs/Odometry.h>
#include <sensor_msgs/Imu.h>
#include <geometry_msgs/Pose2D.h>
#include <geometry_msgs/Twist.h>
#include <sensor_msgs/JointState.h>
#include <std_msgs/String.h>
#include <std_msgs/Float64.h>
#include <actionlib/server/simple_action_server.h>
#include <control_msgs/FollowJointTrajectoryAction.h>
#include <control_msgs/GripperCommandAction.h>
#include <math.h>
static int arManiPos[5];
static int arManiSpeed[5];
static float arFakeJointPos[10];
static float arTargetJointPos[10];
static double kAngleToDegree = 18000/3.1415926;
void JointCtrlCallback(const sensor_msgs::JointState::ConstPtr& msg)
{
std_msgs::Float64 joint_pos_msg;
int nNumJoint = msg->position.size();
for(int i=0;i<nNumJoint;i++)
{
if(msg->name[i] == "joint1")
{
arTargetJointPos[6] = msg->position[i];
}
if(msg->name[i] == "joint2")
{
arTargetJointPos[7] = msg->position[i];
}
if(msg->name[i] == "joint3")
{
arTargetJointPos[8] = msg->position[i];
}
if(msg->name[i] == "joint4")
{
arTargetJointPos[9] = msg->position[i];
}
if(msg->name[i] == "gripper")
{
//arTargetJointPos[10] = msg->position[i];
}
}
ROS_INFO("------------------------------");
for(int i=0;i<nNumJoint;i++)
{
ROS_INFO("[wpb_mani] %d - %s = %.2f vel= %.2f ctlr= %d", i, msg->name[i].c_str(),msg->position[i],msg->velocity[i],arManiPos[i]);
}
ROS_INFO("------------------------------");
}
typedef actionlib::SimpleActionServer<control_msgs::FollowJointTrajectoryAction> TrajectoryServer;
// 响应 Move_Group 的轨迹执行
void executeTrajectory(const control_msgs::FollowJointTrajectoryGoalConstPtr& goal, TrajectoryServer* as)
{
int nrOfPoints = goal->trajectory.points.size();
ROS_WARN("Trajectory with %d positions received ", nrOfPoints);
int nExecIndex = nrOfPoints - 1;
int nPos = goal->trajectory.points[nExecIndex].positions.size();
ROS_WARN("Num of Joints = %d ", nPos);
if(nPos > 5) nPos = 5;
for(int i=0;i<nPos;i++)
{
arTargetJointPos[i+6] = goal->trajectory.points[nExecIndex].positions[i];
}
as->setSucceeded();
}
typedef actionlib::SimpleActionServer<control_msgs::GripperCommandAction> GripperServer;
// 响应 GripperCommand 回调函数
void executeGripper(const control_msgs::GripperCommandGoalConstPtr & goal, GripperServer* as)
{
float gapSize = goal->command.position;
float maxEffort = goal->command.max_effort;
// 执行指令
as->setSucceeded();
}
int main(int argc, char** argv)
{
ros::init(argc,argv,"wpb_mani_dummy");
ros::NodeHandle n;
ros::Subscriber mani_ctrl_sub = n.subscribe("/wpb_mani/joint_ctrl",30,&JointCtrlCallback);
TrajectoryServer tserver(n, "wpb_mani_controller/follow_joint_trajectory", boost::bind(&executeTrajectory, _1, &tserver), false);
ROS_INFO("TrajectoryActionServer: Starting");
tserver.start();
GripperServer gserver(n, "wpb_mani_gripper_controller/gripper_command", boost::bind(&executeGripper, _1, &gserver), false);
ROS_INFO("GripperActionServer: Starting");
gserver.start();
ros::Time current_time, last_time;
current_time = ros::Time::now();
last_time = ros::Time::now();
ros::Rate r(30.0);
ros::Publisher joint_state_pub = n.advertise<sensor_msgs::JointState>("/joint_states",100);
sensor_msgs::JointState joint_msg;
std::vector<std::string> joint_name(11);
std::vector<double> joint_pos(11);
for(int i=0;i<5;i++)
{
arManiPos[i] = 0;
arManiSpeed[i] = 2000;
}
for(int i=0;i<11;i++)
{
arFakeJointPos[i] = 0;
arTargetJointPos[i] = 0;
}
ros::NodeHandle n_param("~");
joint_name[0] = "front_left_wheel_joint";
joint_name[1] = "front_right_wheel_joint";
joint_name[2] = "back_right_wheel_joint";
joint_name[3] = "back_left_wheel_joint";
joint_name[4] = "kinect_height";
joint_name[5] = "kinect_pitch";
joint_name[6] = "joint1";
joint_name[7] = "joint2";
joint_name[8] = "joint3";
joint_name[9] = "joint4";
joint_name[10] = "gripper";
joint_pos[0] = 0.0f;
joint_pos[1] = 0.0f;
joint_pos[2] = 0.0f;
joint_pos[3] = 0.0f;
joint_pos[4] = 0.0f;
joint_pos[5] = -0.3f;
joint_pos[6] = 0.0f;
joint_pos[7] = 0.0f;
joint_pos[8] = 0.0f;
joint_pos[9] = 0.0f;
joint_pos[10] = 0.0f;
n_param.getParam("zeros/kinect_height", joint_pos[4]);
n_param.getParam("zeros/kinect_pitch", joint_pos[5]);
while(n.ok())
{
float step = 0.01;
for(int i=0;i<11;i++)
{
if(arFakeJointPos[i] < arTargetJointPos[i])
{
arFakeJointPos[i] += step;
}
if(arFakeJointPos[i] > arTargetJointPos[i])
{
arFakeJointPos[i] -= step;
}
}
joint_msg.header.stamp = ros::Time::now();
joint_msg.header.seq ++;
// wheels tf
for(int i=0;i<4;i++)
{
joint_pos[i] = arFakeJointPos[i];
}
// mani tf
for(int i=0;i<5;i++)
{
joint_pos[i+6] = arFakeJointPos[i+6];
}
joint_msg.name = joint_name;
joint_msg.position = joint_pos;
joint_state_pub.publish(joint_msg);
// ROS_WARN("mani pos pub");
ros::spinOnce();
r.sleep();
}
}
| 33.959276 | 139 | 0.619853 | 6-robot |
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 |
2f879e759547b05f157356802ea09d507b3c4104 | 664 | cc | C++ | test/src/TosRequestTest.cc | volcengine/ve-tos-cpp-sdk | 3f18be2d924f69bf6271b4cc3bdd1b7a023e795f | [
"Apache-2.0"
] | null | null | null | test/src/TosRequestTest.cc | volcengine/ve-tos-cpp-sdk | 3f18be2d924f69bf6271b4cc3bdd1b7a023e795f | [
"Apache-2.0"
] | null | null | null | test/src/TosRequestTest.cc | volcengine/ve-tos-cpp-sdk | 3f18be2d924f69bf6271b4cc3bdd1b7a023e795f | [
"Apache-2.0"
] | null | null | null | #include <gtest/gtest.h>
#include "../../sdk/include/utils/BaseUtils.h"
using namespace VolcengineTos;
TEST(TosRequestTest, RequestURLTest) {
// /abc/😊?/😭#~!.txt
// const char16_t* path = u"/abc/\u16D83D\u16DE0A?/\u16D83D\u16DE2D#~!.txt";
// std::wstring_convert<std::codecvt<char16_t, char, mbstate_t>, char16_t> conv;
//
// TosRequest req("http", "GET", "localhost", conv.to_bytes(path));
// auto query = std::map<std::string, std::string>();
// query.emplace("versionId", "abc123");
// req.setQueries(query);
// auto u = req.toUrl().toString();
// EXPECT_EQ(u, "https://localhost/abc/%F0%9F%98%8A%3F/%F0%9F%98%AD%23~!.txt?versionId=abc123");
} | 41.5 | 97 | 0.658133 | volcengine |
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 |
2f8cbfc8d174a89016fc601a8a3ee247a61b6378 | 3,765 | cc | C++ | third_party/GsTL/include/GsTL/kriging/OK_constraints.cc | hiteshbedre/movetk | 8d261f19538e28ff36cac98a89ef067f8c26f978 | [
"Apache-2.0"
] | 70 | 2015-01-21T12:24:50.000Z | 2022-03-16T02:10:45.000Z | third_party/GsTL/include/GsTL/kriging/OK_constraints.cc | bacusters/movetk | acbc9c5acb69dd3eb23aa7d2156ede02ed468eae | [
"Apache-2.0"
] | 44 | 2020-09-11T17:40:30.000Z | 2021-04-08T23:56:19.000Z | third_party/GsTL/include/GsTL/kriging/OK_constraints.cc | aniketmitra001/movetk | cdf0c98121da6df4cadbd715fba02b05be724218 | [
"Apache-2.0"
] | 18 | 2015-02-15T18:04:31.000Z | 2021-01-16T08:54:32.000Z | /* GsTL: the Geostatistics Template Library
*
* Author: Nicolas Remy
* Copyright (c) 2000 The Board of Trustees of the Leland Stanford Junior University
*
* 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.
* 3.The name of the author may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
*/
template <
class InputIterator,
class Location,
class SymmetricMatrix,
class Vector
>
unsigned int
OK_constraints::operator() (
SymmetricMatrix& A,
Vector& b,
const Location&,
InputIterator first_neigh, InputIterator last_neigh
) const {
// in ordinary cokriging we must have some data on the primary
// variable, otherwise the equation corresponding to the
// unbiasedness condition: \sum \lambda_i = 1 (\lambda_i are
// the weights on the primary variable) can not be verified
// (there is no \lambda_i if there is no primary variable)
if( first_neigh->size() == 0 ) return 0;
// compute the size of the system
std::vector<int> size_vector; //stores the size of each neighborhood
int total_nb_of_neighbors=0;
int nb_of_neighborhoods = 0; //more precisely: nb of non-empty neighborhoods
for ( ; first_neigh != last_neigh ; ++first_neigh)
{
int neighborhood_size = first_neigh->size();
total_nb_of_neighbors += neighborhood_size;
size_vector.push_back(neighborhood_size);
if( !first_neigh->is_empty() )
nb_of_neighborhoods ++;
}
int syst_size = nb_of_neighborhoods + total_nb_of_neighbors;
A.resize(syst_size,syst_size);
b.resize(syst_size);
std::vector<int>::iterator first_size = size_vector.begin();
// Set up the OK specific part of the matrix
// Only the upper-half of the system is computed, the lower half
// is left unchanged.
for(int col=total_nb_of_neighbors+1; col<= syst_size; col++)
for(int row=1; row <=col; row++)
{
if(row > std::accumulate(first_size, first_size+(col-total_nb_of_neighbors)-1, 0)
&& row <= std::accumulate(first_size, first_size+(col-total_nb_of_neighbors), 0))
A(row,col)=1;
else
A(row,col)=0;
}
// Set up the ordinary kriging specific part of the second member
b(total_nb_of_neighbors+1)=1;
for(int b_row=total_nb_of_neighbors+2; b_row<=syst_size; b_row++)
b(b_row)=0;
return total_nb_of_neighbors;
}
#ifdef __GNUC__
#pragma implementation
#endif
#include <GsTL/kriging/OK_constraints.h>
| 34.861111 | 88 | 0.714475 | hiteshbedre |
2f914c28300e3779f99ebca7ba23f72dc7fe7316 | 916 | cpp | C++ | trunk/preflet/PCardView.cpp | louisdem/IMKit | 9734cd67c04af047c37a0e17119dc19429855990 | [
"BSD-3-Clause"
] | null | null | null | trunk/preflet/PCardView.cpp | louisdem/IMKit | 9734cd67c04af047c37a0e17119dc19429855990 | [
"BSD-3-Clause"
] | null | null | null | trunk/preflet/PCardView.cpp | louisdem/IMKit | 9734cd67c04af047c37a0e17119dc19429855990 | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright 2003-2009, IM Kit Team.
* Distributed under the terms of the MIT License.
*
* Authors:
* Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
*/
#ifdef __HAIKU__
# include <interface/CardLayout.h>
#endif
#include "PCardView.h"
//#pragma mark Constructors
PCardView::PCardView(BRect bounds)
: AbstractView(bounds, "box", B_FOLLOW_ALL_SIDES, B_WILL_DRAW),
fCurrentView(NULL)
{
#ifdef __HAIKU__
SetLayout(new BCardLayout());
#endif
}
void PCardView::Add(BView *view) {
#ifdef __HAIKU__
BCardLayout* layout
= dynamic_cast<BCardLayout*>(GetLayout());
layout->AddView(view);
#else
AddChild(view);
#endif
}
void PCardView::Select(BView *view) {
#ifdef __HAIKU__
BCardLayout* layout
= dynamic_cast<BCardLayout*>(GetLayout());
layout->SetVisibleItem(layout->IndexOfView(view));
#else
if (fCurrentView != NULL)
fCurrentView->Hide();
fCurrentView = view;
fCurrentView->Show();
#endif
}
| 19.083333 | 64 | 0.728166 | louisdem |
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 richarddeloge@gmail.com so we can send you a copy immediately.
*
*
* @copyright Copyright (c) Richard Déloge (richarddeloge@gmail.com)
*
* @license http://teknoo.software/license/mit MIT License
*
* @author Andy O'Neil <https://github.com/aoneill01>
* @author Richard Déloge <richarddeloge@gmail.com>
*/
#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 |
2fafbe421ade27cbeb1603ada68d2148948a02b0 | 4,000 | cpp | C++ | enduser/zone_internetgames/src/client/shell/winfrx/dibsec.cpp | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | enduser/zone_internetgames/src/client/shell/winfrx/dibsec.cpp | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | enduser/zone_internetgames/src/client/shell/winfrx/dibsec.cpp | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | #include "dibfrx.h"
#ifndef LAYOUT_RTL
#define LAYOUT_LTR 0x00000000
#define LAYOUT_RTL 0x00000001
#define NOMIRRORBITMAP 0x80000000
#endif
CDibSection::CDibSection()
{
m_RefCnt = 1;
m_hBmp = NULL;
m_pBits = NULL;
m_hDC = NULL;
m_hOldBmp = NULL;
m_hOldPalette = NULL;
m_lPitch = 0;
m_fTransIdx = false;
}
CDibSection::~CDibSection()
{
DeleteBitmap();
}
HRESULT CDibSection::Load( HINSTANCE hInstance, int nResourceId )
{
// Get rid of previous bitmap
DeleteBitmap();
// Pull bitmap from resource file
m_hBmp = LoadImage( hInstance, MAKEINTRESOURCE(nResourceId), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION );
if ( !m_hBmp )
return E_FAIL;
if ( !GetObject( m_hBmp, sizeof(DIBSECTION), &m_DS ) )
{
DeleteBitmap();
return E_FAIL;
}
m_lPitch = WidthBytes( m_DS.dsBmih.biBitCount * m_DS.dsBmih.biWidth );
// Create device context
m_hDC = CreateCompatibleDC( NULL );
if ( !m_hDC )
{
DeleteBitmap();
return E_FAIL;
}
m_hOldBmp = SelectObject( m_hDC, m_hBmp );
return NOERROR;
}
HRESULT CDibSection::Create( long width, long height, CPalette& palette, long depth /* = 8 */)
{
WORD* pIdx;
FULLBITMAPINFO bmi;
// Get rid of previous bitmap
DeleteBitmap();
// Create device context
m_hDC = CreateCompatibleDC( NULL );
if ( !m_hDC )
return E_FAIL;
m_hOldPalette = SelectPalette( m_hDC, palette, FALSE );
// fill in bitmapinfoheader
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = width;
bmi.bmiHeader.biHeight = height;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = (WORD) depth;
bmi.bmiHeader.biCompression = 0;
bmi.bmiHeader.biSizeImage = WidthBytes( width * bmi.bmiHeader.biBitCount ) * height;
bmi.bmiHeader.biClrUsed = 0;
bmi.bmiHeader.biClrImportant = 0;
bmi.bmiHeader.biXPelsPerMeter = 0;
bmi.bmiHeader.biYPelsPerMeter = 0;
// fill in palette
if(bmi.bmiHeader.biBitCount == 8)
{
pIdx = (WORD*) bmi.bmiColors;
for ( int i = 0; i < 256; i++ )
{
*pIdx++ = (WORD) i;
}
// create section
m_hBmp = CreateDIBSection( m_hDC, (BITMAPINFO*) &bmi, DIB_PAL_COLORS, (void**) &m_pBits, NULL, 0 );
}
else
m_hBmp = CreateDIBSection( m_hDC, (BITMAPINFO*) &bmi, DIB_RGB_COLORS, (void**) &m_pBits, NULL, 0 );
if ( !m_hBmp )
{
DeleteBitmap();
return E_FAIL;
}
if ( !GetObject( m_hBmp, sizeof(DIBSECTION), &m_DS ) )
{
DeleteBitmap();
return E_FAIL;
}
m_lPitch = WidthBytes( m_DS.dsBmih.biBitCount * m_DS.dsBmih.biWidth );
m_hOldBmp = SelectObject( m_hDC, m_hBmp );
return NOERROR;
}
HRESULT CDibSection::SetColorTable( CPalette& palette )
{
PALETTEENTRY* palColors;
RGBQUAD dibColors[256], *pDibColors;
int i;
if(GetDepth() != 8)
return S_FALSE;
// Convert palette entries to dib color table
palColors = palette.GetLogPalette()->palPalEntry;
pDibColors = dibColors;
for ( i = 0; i < 256; i++ )
{
pDibColors->rgbRed = palColors->peRed;
pDibColors->rgbGreen = palColors->peGreen;
pDibColors->rgbBlue = palColors->peBlue;
pDibColors->rgbReserved = 0;
pDibColors++;
palColors++;
}
// Attach color table to dib section
if ( m_hOldPalette )
SelectPalette( m_hDC, m_hOldPalette, FALSE );
m_hOldPalette = SelectPalette( m_hDC, palette, FALSE );
if (SetDIBColorTable( m_hDC, 0, 256, dibColors ) != 256)
return E_FAIL;
return NOERROR;
}
void CDibSection::DeleteBitmap()
{
m_lPitch = 0;
m_fTransIdx = false;
if ( m_hBmp )
{
DeleteObject( m_hBmp );
m_hBmp = NULL;
}
if ( m_hDC )
{
if ( m_hOldBmp )
{
SelectObject( m_hDC, m_hOldBmp );
m_hOldBmp = NULL;
}
if ( m_hOldPalette )
{
SelectPalette( m_hDC, m_hOldPalette, FALSE );
m_hOldPalette = NULL;
}
DeleteDC( m_hDC );
m_hDC = NULL;
}
}
| 22.857143 | 105 | 0.63375 | npocmaka |
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 |
2fbc1a52c062fb6e4a7cda4b643af5518a52e54d | 2,482 | cpp | C++ | grante/TreeCoverDecomposition.cpp | pantonante/grante-bazel | e3f22ec111463a7ae0686494422ab09f86b4d39a | [
"DOC"
] | null | null | null | grante/TreeCoverDecomposition.cpp | pantonante/grante-bazel | e3f22ec111463a7ae0686494422ab09f86b4d39a | [
"DOC"
] | null | null | null | grante/TreeCoverDecomposition.cpp | pantonante/grante-bazel | e3f22ec111463a7ae0686494422ab09f86b4d39a | [
"DOC"
] | null | null | null |
#include <algorithm>
#include "DisjointSet.h"
#include "TreeCoverDecomposition.h"
namespace Grante {
TreeCoverDecomposition::TreeCoverDecomposition(const FactorGraph* fg)
: fg(fg) {
}
void TreeCoverDecomposition::ComputeDecompositionGreedy(
std::vector<std::vector<unsigned int> >& tree_factor_indices,
std::vector<unsigned int>& factor_cover_count) const {
const std::vector<Factor*>& factors = fg->Factors();
size_t factor_count = factors.size();
factor_cover_count.resize(factor_count);
std::fill(factor_cover_count.begin(), factor_cover_count.end(), 0);
// Keep adding trees until all factors are covered
while (std::find(factor_cover_count.begin(), factor_cover_count.end(), 0)
!= factor_cover_count.end()) {
// Find a single new tree to add
std::vector<unsigned int> tree_fidx;
AddTree(factor_cover_count, tree_fidx);
tree_factor_indices.push_back(tree_fidx);
// Update factor cover counts
for (std::vector<unsigned int>::const_iterator ti = tree_fidx.begin();
ti != tree_fidx.end(); ++ti) {
factor_cover_count[*ti] += 1;
}
}
}
void TreeCoverDecomposition::AddTree(
const std::vector<unsigned int>& factor_cover_count,
std::vector<unsigned int>& tree_fidx) const {
// 1. Order factors ascendingly by cover count
const std::vector<Factor*>& factors = fg->Factors();
std::vector<unsigned int> facs_order(factors.size());
for (unsigned int fi = 0; fi < facs_order.size(); ++fi)
facs_order[fi] = fi;
std::sort(facs_order.begin(), facs_order.end(),
CountOrdering(factor_cover_count));
DisjointSet dset(fg->Cardinalities().size());
// For all factor nodes
for (unsigned int fi = 0; fi < facs_order.size(); ++fi) {
// Factor to be considered for addition
const Factor* fac = factors[facs_order[fi]];
// For all variables adjacent to the factor node
const std::vector<unsigned int>& vars = fac->Variables();
unsigned int v0_set = dset.FindSet(vars[0]);
bool can_be_added = true;
for (unsigned int vi = 1; vi < vars.size(); ++vi) {
unsigned int vi_set = dset.FindSet(vars[vi]);
if (v0_set == vi_set) {
can_be_added = false;
break;
}
}
// Unaries can always be added, pairwise only if no cycle
if (can_be_added == false)
continue;
// Add factor: merge all variables in the two disjoint sets
for (unsigned int vi = 1; vi < vars.size(); ++vi) {
unsigned int vi_set = dset.FindSet(vars[vi]);
v0_set = dset.Link(v0_set, vi_set);
}
tree_fidx.push_back(facs_order[fi]);
}
}
}
| 30.268293 | 74 | 0.705479 | pantonante |
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 |
2fc606b44d3b6f3f76836b0145aa24216edc2aab | 4,276 | hpp | C++ | src/libraries/core/primitives/SymmTensor/SymmTensor_.hpp | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | src/libraries/core/primitives/SymmTensor/SymmTensor_.hpp | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | src/libraries/core/primitives/SymmTensor/SymmTensor_.hpp | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | /*---------------------------------------------------------------------------*\
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of CAELUS.
CAELUS 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.
CAELUS 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 CAELUS. If not, see <http://www.gnu.org/licenses/>.
Class
CML::SymmTensor
Description
Templated 3D symmetric tensor derived from VectorSpace adding construction
from 6 components, element access using xx(), xy() etc. member functions
and the inner-product (dot-product) and outer-product of two Vectors
(tensor-product) operators.
SourceFiles
SymmTensorI.hpp
\*---------------------------------------------------------------------------*/
#ifndef SymmTensor__H
#define SymmTensor__H
#include "VectorSpace.hpp"
#include "SphericalTensor_.hpp"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace CML
{
/*---------------------------------------------------------------------------*\
Class SymmTensor Declaration
\*---------------------------------------------------------------------------*/
template<class Cmpt>
class SymmTensor
:
public VectorSpace<SymmTensor<Cmpt>, Cmpt, 6>
{
public:
//- Equivalent type of labels used for valid component indexing
typedef SymmTensor<label> labelType;
// Member constants
//- Rank of SymmTensor is 2
static const direction rank = 2;
// Static data members
static const SymmTensor I;
//- Component labeling enumeration
enum components { XX, XY, XZ, YY, YZ, ZZ };
// Constructors
//- Construct null
inline SymmTensor();
//- Construct initialized to zero
inline SymmTensor(const CML::zero);
//- Construct given VectorSpace of the same rank
template<class Cmpt2>
inline SymmTensor(const VectorSpace<SymmTensor<Cmpt2>, Cmpt2, 6>&);
//- Construct given SphericalTensor
inline SymmTensor(const SphericalTensor<Cmpt>&);
//- Construct given the six components
inline SymmTensor
(
const Cmpt txx, const Cmpt txy, const Cmpt txz,
const Cmpt tyy, const Cmpt tyz,
const Cmpt tzz
);
//- Construct from Istream
SymmTensor(Istream&);
// Member Functions
// Access
inline const Cmpt& xx() const;
inline const Cmpt& xy() const;
inline const Cmpt& xz() const;
inline const Cmpt& yy() const;
inline const Cmpt& yz() const;
inline const Cmpt& zz() const;
inline Cmpt& xx();
inline Cmpt& xy();
inline Cmpt& xz();
inline Cmpt& yy();
inline Cmpt& yz();
inline Cmpt& zz();
//- Transpose
inline const SymmTensor<Cmpt>& T() const;
// Member Operators
//- Inherit VectorSpace assignment operators
using SymmTensor::vsType::operator=;
//- Assign to given SphericalTensor
inline void operator=(const SphericalTensor<Cmpt>&);
};
template<class Cmpt>
class symmTypeOfRank<Cmpt, 2>
{
public:
typedef SymmTensor<Cmpt> type;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace CML
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include inline implementations
#include "SymmTensorI.hpp"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
| 27.063291 | 79 | 0.515435 | MrAwesomeRocks |
2fd006daa4002fb6c9e2a17d007d63966ab2b8d4 | 2,530 | hpp | C++ | tools/tests/common/test_sources.hpp | intel/qpl | cdc8442f7a5e7a6ff6eea39c69665e0c5034d85d | [
"MIT"
] | 11 | 2022-02-25T08:20:23.000Z | 2022-03-25T08:36:19.000Z | tools/tests/common/test_sources.hpp | intel/qpl | cdc8442f7a5e7a6ff6eea39c69665e0c5034d85d | [
"MIT"
] | null | null | null | tools/tests/common/test_sources.hpp | intel/qpl | cdc8442f7a5e7a6ff6eea39c69665e0c5034d85d | [
"MIT"
] | null | null | null | /*******************************************************************************
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
******************************************************************************/
/*
* Intel® Query Processing Library (Intel® QPL)
* Tests
*/
#ifndef QPL_TESTS_COMMON_TEST_SOURCES_HPP_
#define QPL_TESTS_COMMON_TEST_SOURCES_HPP_
#include "stdexcept"
#include "qpl/qpl.h"
#include "vector"
#include "format_generator.hpp"
namespace qpl::test {
namespace util {
template<class stream_t>
auto compress_stream(stream_t stream) -> std::vector<uint8_t>;
}
class AnalyticStream{
public:
AnalyticStream() = delete;
AnalyticStream(size_t element_count, uint8_t bit_width, qpl_parser parser);
auto data() noexcept -> uint8_t *;
auto size() noexcept -> size_t;
virtual auto bit_width() noexcept -> uint8_t = 0;
virtual auto parser() -> qpl_parser = 0;
protected:
qpl_parser parser_;
uint8_t bit_width_;
size_t element_count_;
std::vector<uint8_t> data_;
};
class AnalyticInputStream : public AnalyticStream{
public:
AnalyticInputStream() = delete;
AnalyticInputStream(size_t element_count,
uint8_t element_bit_width,
qpl_parser parser = qpl_p_le_packed_array,
uint16_t prologue = 0u);
auto elements_count() noexcept -> size_t;
auto bit_width() noexcept -> uint8_t override;
auto parser() -> qpl_parser override;
private:
uint16_t prologue_ = 0;
};
class AnalyticMaskStream : public AnalyticStream {
public:
AnalyticMaskStream() = delete;
AnalyticMaskStream(size_t element_count, qpl_parser parser = qpl_p_le_packed_array);
auto bit_width() noexcept -> uint8_t override;
auto parser() -> qpl_parser override;
private:
static constexpr uint8_t BIT_WIDTH_ = 1u;
};
class AnalyticCountersStream : public AnalyticStream {
public:
AnalyticCountersStream(size_t counters_count,
uint8_t counter_width,
qpl_parser parser = qpl_p_le_packed_array,
uint16_t prologue = 0u);
auto elements_count() noexcept -> size_t;
auto packed_elements_count() noexcept -> size_t;
auto bit_width() noexcept -> uint8_t override;
auto parser() -> qpl_parser override;
private:
uint16_t prologue_ = 0;
size_t packed_elements_count_ = 0;
};
}
#endif //QPL_TESTS_COMMON_TEST_SOURCES_HPP_
| 24.326923 | 88 | 0.635573 | intel |
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 |
7c7fb883483e6dc49c613dc0d6441203b52f38f6 | 116,105 | hpp | C++ | third_party/omr/compiler/aarch64/codegen/OMRTreeEvaluatorTable.hpp | xiacijie/omr-wala-linkage | a1aff7aef9ed131a45555451abde4615a04412c1 | [
"Apache-2.0"
] | null | null | null | third_party/omr/compiler/aarch64/codegen/OMRTreeEvaluatorTable.hpp | xiacijie/omr-wala-linkage | a1aff7aef9ed131a45555451abde4615a04412c1 | [
"Apache-2.0"
] | null | null | null | third_party/omr/compiler/aarch64/codegen/OMRTreeEvaluatorTable.hpp | xiacijie/omr-wala-linkage | a1aff7aef9ed131a45555451abde4615a04412c1 | [
"Apache-2.0"
] | null | null | null | /*******************************************************************************
* Copyright (c) 2018, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at http://eclipse.org/legal/epl-2.0
* or the Apache License, Version 2.0 which accompanies this distribution
* and is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License, v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception [1] and GNU General Public
* License, version 2 with the OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/
/*
* This table is #included in a static table.
* Only Function Pointers are allowed.
*/
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::badILOpEvaluator , // TR::badILOp // illegal op hopefully help with uninitialized nodes
TR::TreeEvaluator::aconstEvaluator, // TR::aconst // load address constant (zero value means NULL)
TR::TreeEvaluator::iconstEvaluator, // TR::iconst // load integer constant (32-bit signed 2's complement)
TR::TreeEvaluator::lconstEvaluator, // TR::lconst // load long integer constant (64-bit signed 2's complement)
TR::TreeEvaluator::fconstEvaluator, // TR::fconst // load float constant (32-bit ieee fp)
TR::TreeEvaluator::dconstEvaluator, // TR::dconst // load double constant (64-bit ieee fp)
TR::TreeEvaluator::bconstEvaluator, // TR::bconst // load byte integer constant (8-bit signed 2's complement)
TR::TreeEvaluator::sconstEvaluator, // TR::sconst // load short integer constant (16-bit signed 2's complement)
TR::TreeEvaluator::iloadEvaluator, // TR::iload // load integer
TR::TreeEvaluator::floadEvaluator, // TR::fload // load float
TR::TreeEvaluator::dloadEvaluator, // TR::dload // load double
TR::TreeEvaluator::aloadEvaluator, // TR::aload // load address
TR::TreeEvaluator::bloadEvaluator, // TR::bload // load byte
TR::TreeEvaluator::sloadEvaluator, // TR::sload // load short integer
TR::TreeEvaluator::lloadEvaluator, // TR::lload // load long integer
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::irdbarEvaluator , // TR::irdbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::frdbarEvaluator , // TR::frdbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::drdbarEvaluator , // TR::drdbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ardbarEvaluator , // TR::ardbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::brdbarEvaluator , // TR::brdbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::srdbarEvaluator , // TR::srdbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lrdbarEvaluator , // TR::lrdbar
TR::TreeEvaluator::iloadEvaluator, // TR::iloadi // load indirect integer
TR::TreeEvaluator::floadEvaluator, // TR::floadi // load indirect float
TR::TreeEvaluator::dloadEvaluator, // TR::dloadi // load indirect double
TR::TreeEvaluator::aloadEvaluator, // TR::aloadi // load indirect address
TR::TreeEvaluator::bloadEvaluator, // TR::bloadi // load indirect byte
TR::TreeEvaluator::sloadEvaluator, // TR::sloadi // load indirect short integer
TR::TreeEvaluator::lloadEvaluator, // TR::lloadi // load indirect long integer
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::irdbariEvaluator , // TR::irdbari
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::frdbariEvaluator , // TR::frdbari
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::drdbariEvaluator , // TR::drdbari
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ardbariEvaluator , // TR::ardbari
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::brdbariEvaluator , // TR::brdbari
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::srdbariEvaluator , // TR::srdbari
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lrdbariEvaluator , // TR::lrdbari
TR::TreeEvaluator::istoreEvaluator, // TR::istore // store integer
TR::TreeEvaluator::lstoreEvaluator, // TR::lstore // store long integer
TR::TreeEvaluator::fstoreEvaluator, // TR::fstore // store float
TR::TreeEvaluator::dstoreEvaluator, // TR::dstore // store double
TR::TreeEvaluator::lstoreEvaluator, // TR::astore // store address
TR::TreeEvaluator::bstoreEvaluator, // TR::bstore // store byte
TR::TreeEvaluator::sstoreEvaluator, // TR::sstore // store short integer
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iwrtbarEvaluator , //TR::iwrtbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lwrtbarEvaluator , //TR::lwrtbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fwrtbarEvaluator , //TR::fwrtbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dwrtbarEvaluator , //TR::dwrtbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::awrtbarEvaluator , //TR::awrtbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bwrtbarEvaluator , //TR::bwrtbar
TR::TreeEvaluator::unImpOpEvaluator, // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::swrtbarEvaluator , //TR::swrtbar
TR::TreeEvaluator::lstoreEvaluator, // TR::lstorei // store indirect long integer (child1 a; child2 l)
TR::TreeEvaluator::fstoreEvaluator, // TR::fstorei // store indirect float (child1 a; child2 f)
TR::TreeEvaluator::dstoreEvaluator, // TR::dstorei // store indirect double (child1 a; child2 d)
TR::TreeEvaluator::lstoreEvaluator, // TR::astorei // store indirect address (child1 a dest; child2 a value)
TR::TreeEvaluator::bstoreEvaluator, // TR::bstorei // store indirect byte (child1 a; child2 b)
TR::TreeEvaluator::sstoreEvaluator, // TR::sstorei // store indirect short integer (child1 a; child2 s)
TR::TreeEvaluator::istoreEvaluator, // TR::istorei // store indirect integer (child1 a; child2 i)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lwrtbariEvaluator , // TR::lwrtbari
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fwrtbariEvaluator , // TR::fwrtbari
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dwrtbariEvaluator , // TR::dwrtbari
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::awrtbariEvaluator , // TR::awrtbari
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bwrtbariEvaluator , // TR::bwrtbari
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::swrtbariEvaluator , // TR::swrtbari
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iwrtbariEvaluator , // TR::iwrtbari
TR::TreeEvaluator::gotoEvaluator, // TR::goto // goto label address
TR::TreeEvaluator::ireturnEvaluator, // TR::ireturn // return an integer
TR::TreeEvaluator::lreturnEvaluator, // TR::lreturn // return a long integer
TR::TreeEvaluator::freturnEvaluator, // TR::freturn // return a float
TR::TreeEvaluator::dreturnEvaluator, // TR::dreturn // return a double
TR::TreeEvaluator::lreturnEvaluator, // TR::areturn // return an address
TR::TreeEvaluator::returnEvaluator, // TR::return // void return
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::asynccheckEvaluator , // TR::asynccheck // GC point
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::athrowEvaluator , // TR::athrow // throw an exception
TR::TreeEvaluator::directCallEvaluator, // TR::icall // direct call returning integer
TR::TreeEvaluator::directCallEvaluator, // TR::lcall // direct call returning long integer
TR::TreeEvaluator::directCallEvaluator, // TR::fcall // direct call returning float
TR::TreeEvaluator::directCallEvaluator, // TR::dcall // direct call returning double
TR::TreeEvaluator::directCallEvaluator, // TR::acall // direct call returning reference
TR::TreeEvaluator::directCallEvaluator, // TR::call // direct call returning void
TR::TreeEvaluator::iaddEvaluator, // TR::iadd // add 2 integers
TR::TreeEvaluator::laddEvaluator , // TR::ladd // add 2 long integers
TR::TreeEvaluator::faddEvaluator, // TR::fadd // add 2 floats
TR::TreeEvaluator::daddEvaluator, // TR::dadd // add 2 doubles
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::baddEvaluator , // TR::badd // add 2 bytes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::saddEvaluator , // TR::sadd // add 2 short integers
TR::TreeEvaluator::isubEvaluator, // TR::isub // subtract 2 integers (child1 - child2)
TR::TreeEvaluator::lsubEvaluator , // TR::lsub // subtract 2 long integers (child1 - child2)
TR::TreeEvaluator::fsubEvaluator, // TR::fsub // subtract 2 floats (child1 - child2)
TR::TreeEvaluator::dsubEvaluator, // TR::dsub // subtract 2 doubles (child1 - child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bsubEvaluator , // TR::bsub // subtract 2 bytes (child1 - child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ssubEvaluator , // TR::ssub // subtract 2 short integers (child1 - child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::asubEvaluator , // TR::asub // subtract 2 addresses (child1 - child2)
TR::TreeEvaluator::imulEvaluator, // TR::imul // multiply 2 integers
TR::TreeEvaluator::lmulEvaluator , // TR::lmul // multiply 2 signed or unsigned long integers
TR::TreeEvaluator::fmulEvaluator, // TR::fmul // multiply 2 floats
TR::TreeEvaluator::dmulEvaluator, // TR::dmul // multiply 2 doubles
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bmulEvaluator , // TR::bmul // multiply 2 bytes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::smulEvaluator , // TR::smul // multiply 2 short integers
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iumulEvaluator , // TR::iumul // multiply 2 unsigned integers
TR::TreeEvaluator::idivEvaluator, // TR::idiv // divide 2 integers (child1 / child2)
TR::TreeEvaluator::ldivEvaluator, // TR::ldiv // divide 2 long integers (child1 / child2)
TR::TreeEvaluator::fdivEvaluator, // TR::fdiv // divide 2 floats (child1 / child2)
TR::TreeEvaluator::ddivEvaluator, // TR::ddiv // divide 2 doubles (child1 / child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bdivEvaluator , // TR::bdiv // divide 2 bytes (child1 / child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sdivEvaluator , // TR::sdiv // divide 2 short integers (child1 / child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iudivEvaluator , // TR::iudiv // divide 2 unsigned integers (child1 / child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ludivEvaluator , // TR::ludiv // divide 2 unsigned long integers (child1 / child2)
TR::TreeEvaluator::iremEvaluator, // TR::irem // remainder of 2 integers (child1 % child2)
TR::TreeEvaluator::lremEvaluator, // TR::lrem // remainder of 2 long integers (child1 % child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fremEvaluator , // TR::frem // remainder of 2 floats (child1 % child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dremEvaluator , // TR::drem // remainder of 2 doubles (child1 % child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bremEvaluator , // TR::brem // remainder of 2 bytes (child1 % child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sremEvaluator , // TR::srem // remainder of 2 short integers (child1 % child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuremEvaluator , // TR::iurem // remainder of 2 unsigned integers (child1 % child2)
TR::TreeEvaluator::inegEvaluator, // TR::ineg // negate an integer
TR::TreeEvaluator::lnegEvaluator, // TR::lneg // negate a long integer
TR::TreeEvaluator::fnegEvaluator, // TR::fneg // negate a float
TR::TreeEvaluator::dnegEvaluator, // TR::dneg // negate a double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bnegEvaluator , // TR::bneg // negate a bytes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::snegEvaluator , // TR::sneg // negate a short integer
TR::TreeEvaluator::iabsEvaluator, // TR::iabs // absolute value of integer
TR::TreeEvaluator::labsEvaluator, // TR::labs // absolute value of long
TR::TreeEvaluator::fabsEvaluator, // TR::fabs // absolute value of float
TR::TreeEvaluator::dabsEvaluator, // TR::dabs // absolute value of double
TR::TreeEvaluator::ishlEvaluator, // TR::ishl // shift integer left (child1 << child2)
TR::TreeEvaluator::ishlEvaluator, // TR::lshl // shift long integer left (child1 << child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bshlEvaluator , // TR::bshl // shift byte left (child1 << child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sshlEvaluator , // TR::sshl // shift short integer left (child1 << child2)
TR::TreeEvaluator::ishrEvaluator, // TR::ishr // shift integer right arithmetically (child1 >> child2)
TR::TreeEvaluator::ishrEvaluator, // TR::lshr // shift long integer right arithmetically (child1 >> child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bshrEvaluator , // TR::bshr // shift byte right arithmetically (child1 >> child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sshrEvaluator , // TR::sshr // shift short integer arithmetically (child1 >> child2)
TR::TreeEvaluator::iushrEvaluator, // TR::iushr // shift integer right logically (child1 >> child2)
TR::TreeEvaluator::iushrEvaluator, // TR::lushr // shift long integer right logically (child1 >> child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bushrEvaluator , // TR::bushr // shift byte right logically (child1 >> child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sushrEvaluator , // TR::sushr // shift short integer right logically (child1 >> child2)
TR::TreeEvaluator::irolEvaluator, // TR::irol // rotate integer left
TR::TreeEvaluator::irolEvaluator, // TR::lrol // rotate long integer left
TR::TreeEvaluator::iandEvaluator, // TR::iand // boolean and of 2 integers
TR::TreeEvaluator::landEvaluator, // TR::land // boolean and of 2 long integers
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bandEvaluator , // TR::band // boolean and of 2 bytes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sandEvaluator , // TR::sand // boolean and of 2 short integers
TR::TreeEvaluator::iorEvaluator, // TR::ior // boolean or of 2 integers
TR::TreeEvaluator::lorEvaluator, // TR::lor // boolean or of 2 long integers
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::borEvaluator , // TR::bor // boolean or of 2 bytes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sorEvaluator , // TR::sor // boolean or of 2 short integers
TR::TreeEvaluator::ixorEvaluator, // TR::ixor // boolean xor of 2 integers
TR::TreeEvaluator::lxorEvaluator, // TR::lxor // boolean xor of 2 long integers
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bxorEvaluator , // TR::bxor // boolean xor of 2 bytes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sxorEvaluator , // TR::sxor // boolean xor of 2 short integers
TR::TreeEvaluator::i2lEvaluator, // TR::i2l // convert integer to long integer with sign extension
TR::TreeEvaluator::i2fEvaluator, // TR::i2f // convert integer to float
TR::TreeEvaluator::i2dEvaluator, // TR::i2d // convert integer to double
TR::TreeEvaluator::l2iEvaluator, // TR::i2b // convert integer to byte
TR::TreeEvaluator::l2iEvaluator, // TR::i2s // convert integer to short integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::i2aEvaluator , // TR::i2a // convert integer to address
TR::TreeEvaluator::iu2lEvaluator, // TR::iu2l // convert unsigned integer to long integer with zero extension
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iu2fEvaluator , // TR::iu2f // convert unsigned integer to float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iu2dEvaluator , // TR::iu2d // convert unsigned integer to double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iu2aEvaluator , // TR::iu2a // convert unsigned integer to address
TR::TreeEvaluator::l2iEvaluator, // TR::l2i // convert long integer to integer
TR::TreeEvaluator::l2fEvaluator, // TR::l2f // convert long integer to float
TR::TreeEvaluator::l2dEvaluator, // TR::l2d // convert long integer to double
TR::TreeEvaluator::l2iEvaluator, // TR::l2b // convert long integer to byte
TR::TreeEvaluator::l2iEvaluator, // TR::l2s // convert long integer to short integer
TR::TreeEvaluator::passThroughEvaluator, // TR::l2a // convert long integer to address
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lu2fEvaluator , // TR::lu2f // convert unsigned long integer to float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lu2dEvaluator , // TR::lu2d // convert unsigned long integer to double
TR::TreeEvaluator::passThroughEvaluator, // TR::lu2a // convert unsigned long integer to address
TR::TreeEvaluator::f2iEvaluator, // TR::f2i // convert float to integer
TR::TreeEvaluator::f2lEvaluator, // TR::f2l // convert float to long integer
TR::TreeEvaluator::f2dEvaluator, // TR::f2d // convert float to double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::f2bEvaluator , // TR::f2b // convert float to byte
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::f2sEvaluator , // TR::f2s // convert float to short integer
TR::TreeEvaluator::d2iEvaluator, // TR::d2i // convert double to integer
TR::TreeEvaluator::d2lEvaluator, // TR::d2l // convert double to long integer
TR::TreeEvaluator::d2fEvaluator, // TR::d2f // convert double to float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::d2bEvaluator , // TR::d2b // convert double to byte
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::d2sEvaluator , // TR::d2s // convert double to short integer
TR::TreeEvaluator::b2iEvaluator, // TR::b2i // convert byte to integer with sign extension
TR::TreeEvaluator::b2lEvaluator, // TR::b2l // convert byte to long integer with sign extension
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::b2fEvaluator , // TR::b2f // convert byte to float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::b2dEvaluator , // TR::b2d // convert byte to double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::b2sEvaluator , // TR::b2s // convert byte to short integer with sign extension
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::b2aEvaluator , // TR::b2a // convert byte to address
TR::TreeEvaluator::bu2iEvaluator, // TR::bu2i // convert byte to integer with zero extension
TR::TreeEvaluator::bu2lEvaluator, // TR::bu2l // convert byte to long integer with zero extension
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bu2fEvaluator , // TR::bu2f // convert unsigned byte to float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bu2dEvaluator , // TR::bu2d // convert unsigned byte to double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bu2sEvaluator , // TR::bu2s // convert byte to short integer with zero extension
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bu2aEvaluator , // TR::bu2a // convert unsigned byte to unsigned address
TR::TreeEvaluator::s2iEvaluator, // TR::s2i // convert short integer to integer with sign extension
TR::TreeEvaluator::s2lEvaluator, // TR::s2l // convert short integer to long integer with sign extension
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::s2fEvaluator , // TR::s2f // convert short integer to float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::s2dEvaluator , // TR::s2d // convert short integer to double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::s2bEvaluator , // TR::s2b // convert short integer to byte
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::s2aEvaluator , // TR::s2a // convert short integer to address
TR::TreeEvaluator::su2iEvaluator, // TR::su2i // zero extend short to int
TR::TreeEvaluator::su2lEvaluator, // TR::su2l // zero extend char to long
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::su2fEvaluator , // TR::su2f // convert char to float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::su2dEvaluator , // TR::su2d // convert char to double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::su2aEvaluator , // TR::su2a // convert char to address
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::a2iEvaluator , // TR::a2i // convert address to integer
TR::TreeEvaluator::passThroughEvaluator, // TR::a2l // convert address to long integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::a2bEvaluator , // TR::a2b // convert address to byte
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::a2sEvaluator , // TR::a2s // convert address to short
TR::TreeEvaluator::icmpeqEvaluator, // TR::icmpeq // integer compare if equal
TR::TreeEvaluator::icmpneEvaluator, // TR::icmpne // integer compare if not equal
TR::TreeEvaluator::icmpltEvaluator, // TR::icmplt // integer compare if less than
TR::TreeEvaluator::icmpgeEvaluator, // TR::icmpge // integer compare if greater than or equal
TR::TreeEvaluator::icmpgtEvaluator, // TR::icmpgt // integer compare if greater than
TR::TreeEvaluator::icmpleEvaluator, // TR::icmple // integer compare if less than or equal
TR::TreeEvaluator::icmpeqEvaluator, // TR::iucmpeq // unsigned integer compare if equal
TR::TreeEvaluator::icmpneEvaluator, // TR::iucmpne // unsigned integer compare if not equal
TR::TreeEvaluator::iucmpltEvaluator, // TR::iucmplt // unsigned integer compare if less than
TR::TreeEvaluator::iucmpgeEvaluator, // TR::iucmpge // unsigned integer compare if greater than or equal
TR::TreeEvaluator::iucmpgtEvaluator, // TR::iucmpgt // unsigned integer compare if greater than
TR::TreeEvaluator::iucmpleEvaluator, // TR::iucmple // unsigned integer compare if less than or equal
TR::TreeEvaluator::lcmpeqEvaluator, // TR::lcmpeq // long compare if equal
TR::TreeEvaluator::lcmpneEvaluator, // TR::lcmpne // long compare if not equal
TR::TreeEvaluator::lcmpltEvaluator, // TR::lcmplt // long compare if less than
TR::TreeEvaluator::lcmpgeEvaluator, // TR::lcmpge // long compare if greater than or equal
TR::TreeEvaluator::lcmpgtEvaluator, // TR::lcmpgt // long compare if greater than
TR::TreeEvaluator::lcmpleEvaluator, // TR::lcmple // long compare if less than or equal
TR::TreeEvaluator::lcmpeqEvaluator, // TR::lucmpeq // unsigned long compare if equal
TR::TreeEvaluator::lcmpneEvaluator, // TR::lucmpne // unsigned long compare if not equal
TR::TreeEvaluator::lucmpltEvaluator, // TR::lucmplt // unsigned long compare if less than
TR::TreeEvaluator::lucmpgeEvaluator, // TR::lucmpge // unsigned long compare if greater than or equal
TR::TreeEvaluator::lucmpgtEvaluator, // TR::lucmpgt // unsigned long compare if greater than
TR::TreeEvaluator::lucmpleEvaluator, // TR::lucmple // unsigned long compare if less than or equal
TR::TreeEvaluator::fcmpeqEvaluator, // TR::fcmpeq // float compare if equal
TR::TreeEvaluator::fcmpneEvaluator, // TR::fcmpne // float compare if not equal
TR::TreeEvaluator::fcmpltEvaluator, // TR::fcmplt // float compare if less than
TR::TreeEvaluator::fcmpgeEvaluator, // TR::fcmpge // float compare if greater than or equal
TR::TreeEvaluator::fcmpgtEvaluator, // TR::fcmpgt // float compare if greater than
TR::TreeEvaluator::fcmpleEvaluator, // TR::fcmple // float compare if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fcmpequEvaluator , // TR::fcmpequ // float compare if equal or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fcmpneuEvaluator , // TR::fcmpneu // float compare if not equal or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fcmpltuEvaluator , // TR::fcmpltu // float compare if less than or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fcmpgeuEvaluator , // TR::fcmpgeu // float compare if greater than or equal or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fcmpgtuEvaluator , // TR::fcmpgtu // float compare if greater than or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fcmpleuEvaluator , // TR::fcmpleu // float compare if less than or equal or unordered
TR::TreeEvaluator::dcmpeqEvaluator, // TR::dcmpeq // double compare if equal
TR::TreeEvaluator::dcmpneEvaluator, // TR::dcmpne // double compare if not equal
TR::TreeEvaluator::dcmpltEvaluator, // TR::dcmplt // double compare if less than
TR::TreeEvaluator::dcmpgeEvaluator, // TR::dcmpge // double compare if greater than or equal
TR::TreeEvaluator::dcmpgtEvaluator, // TR::dcmpgt // double compare if greater than
TR::TreeEvaluator::dcmpleEvaluator, // TR::dcmple // double compare if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcmpequEvaluator , // TR::dcmpequ // double compare if equal or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcmpneuEvaluator , // TR::dcmpneu // double compare if not equal or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcmpltuEvaluator , // TR::dcmpltu // double compare if less than or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcmpgeuEvaluator , // TR::dcmpgeu // double compare if greater than or equal or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcmpgtuEvaluator , // TR::dcmpgtu // double compare if greater than or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcmpleuEvaluator , // TR::dcmpleu // double compare if less than or equal or unordered
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::acmpeqEvaluator , // TR::acmpeq // address compare if equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::acmpneEvaluator , // TR::acmpne // address compare if not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::acmpltEvaluator , // TR::acmplt // address compare if less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::acmpgeEvaluator , // TR::acmpge // address compare if greater than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::acmpgtEvaluator , // TR::acmpgt // address compare if greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::acmpleEvaluator , // TR::acmple // address compare if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bcmpeqEvaluator , // TR::bcmpeq // byte compare if equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bcmpneEvaluator , // TR::bcmpne // byte compare if not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bcmpltEvaluator , // TR::bcmplt // byte compare if less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bcmpgeEvaluator , // TR::bcmpge // byte compare if greater than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bcmpgtEvaluator , // TR::bcmpgt // byte compare if greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bcmpleEvaluator , // TR::bcmple // byte compare if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bucmpeqEvaluator , // TR::bucmpeq // unsigned byte compare if equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bucmpneEvaluator , // TR::bucmpne // unsigned byte compare if not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bucmpltEvaluator , // TR::bucmplt // unsigned byte compare if less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bucmpgeEvaluator , // TR::bucmpge // unsigned byte compare if greater than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bucmpgtEvaluator , // TR::bucmpgt // unsigned byte compare if greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bucmpleEvaluator , // TR::bucmple // unsigned byte compare if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::scmpeqEvaluator , // TR::scmpeq // short integer compare if equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::scmpneEvaluator , // TR::scmpne // short integer compare if not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::scmpltEvaluator , // TR::scmplt // short integer compare if less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::scmpgeEvaluator , // TR::scmpge // short integer compare if greater than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::scmpgtEvaluator , // TR::scmpgt // short integer compare if greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::scmpleEvaluator , // TR::scmple // short integer compare if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sucmpeqEvaluator , // TR::sucmpeq // char compare if equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sucmpneEvaluator , // TR::sucmpne // char compare if not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sucmpltEvaluator , // TR::sucmplt // char compare if less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sucmpgeEvaluator , // TR::sucmpge // char compare if greater than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sucmpgtEvaluator , // TR::sucmpgt // char compare if greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sucmpleEvaluator , // TR::sucmple // char compare if less than or equal
TR::TreeEvaluator::lcmpEvaluator, // TR::lcmp // long compare (1 if child1 > child2; 0 if child1 == child2; -1 if child1 < child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fcmplEvaluator , // TR::fcmpl // float compare l (1 if child1 > child2; 0 if child1 == child2; -1 if child1 < child2 or unordered)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fcmpgEvaluator , // TR::fcmpg // float compare g (1 if child1 > child2 or unordered; 0 if child1 == child2; -1 if child1 < child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcmplEvaluator , // TR::dcmpl // double compare l (1 if child1 > child2; 0 if child1 == child2; -1 if child1 < child2 or unordered)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcmpgEvaluator , // TR::dcmpg // double compare g (1 if child1 > child2 or unordered; 0 if child1 == child2; -1 if child1 < child2)
TR::TreeEvaluator::ificmpeqEvaluator, // TR::ificmpeq // integer compare and branch if equal
TR::TreeEvaluator::ificmpneEvaluator, // TR::ificmpne // integer compare and branch if not equal
TR::TreeEvaluator::ificmpltEvaluator, // TR::ificmplt // integer compare and branch if less than
TR::TreeEvaluator::ificmpgeEvaluator, // TR::ificmpge // integer compare and branch if greater than or equal
TR::TreeEvaluator::ificmpgtEvaluator, // TR::ificmpgt // integer compare and branch if greater than
TR::TreeEvaluator::ificmpleEvaluator, // TR::ificmple // integer compare and branch if less than or equal
TR::TreeEvaluator::ificmpeqEvaluator, // TR::ifiucmpeq // unsigned integer compare and branch if equal
TR::TreeEvaluator::ificmpneEvaluator, // TR::ifiucmpne // unsigned integer compare and branch if not equal
TR::TreeEvaluator::ifiucmpltEvaluator, // TR::ifiucmplt // unsigned integer compare and branch if less than
TR::TreeEvaluator::ifiucmpgeEvaluator, // TR::ifiucmpge // unsigned integer compare and branch if greater than or equal
TR::TreeEvaluator::ifiucmpgtEvaluator, // TR::ifiucmpgt // unsigned integer compare and branch if greater than
TR::TreeEvaluator::ifiucmpleEvaluator, // TR::ifiucmple // unsigned integer compare and branch if less than or equal
TR::TreeEvaluator::iflcmpeqEvaluator, // TR::iflcmpeq // long compare and branch if equal
TR::TreeEvaluator::iflcmpneEvaluator, // TR::iflcmpne // long compare and branch if not equal
TR::TreeEvaluator::iflcmpltEvaluator, // TR::iflcmplt // long compare and branch if less than
TR::TreeEvaluator::iflcmpgeEvaluator, // TR::iflcmpge // long compare and branch if greater than or equal
TR::TreeEvaluator::iflcmpgtEvaluator, // TR::iflcmpgt // long compare and branch if greater than
TR::TreeEvaluator::iflcmpleEvaluator, // TR::iflcmple // long compare and branch if less than or equal
TR::TreeEvaluator::iflcmpeqEvaluator, // TR::iflucmpeq // unsigned long compare and branch if equal
TR::TreeEvaluator::iflcmpneEvaluator, // TR::iflucmpne // unsigned long compare and branch if not equal
TR::TreeEvaluator::iflucmpltEvaluator, // TR::iflucmplt // unsigned long compare and branch if less than
TR::TreeEvaluator::iflucmpgeEvaluator, // TR::iflucmpge // unsigned long compare and branch if greater than or equal
TR::TreeEvaluator::iflucmpgtEvaluator, // TR::iflucmpgt // unsigned long compare and branch if greater than
TR::TreeEvaluator::iflucmpleEvaluator, // TR::iflucmple // unsigned long compare and branch if less than or equal
TR::TreeEvaluator::iffcmpeqEvaluator, // TR::iffcmpeq // float compare and branch if equal
TR::TreeEvaluator::iffcmpneEvaluator, // TR::iffcmpne // float compare and branch if not equal
TR::TreeEvaluator::iffcmpltEvaluator, // TR::iffcmplt // float compare and branch if less than
TR::TreeEvaluator::iffcmpgeEvaluator, // TR::iffcmpge // float compare and branch if greater than or equal
TR::TreeEvaluator::iffcmpgtEvaluator, // TR::iffcmpgt // float compare and branch if greater than
TR::TreeEvaluator::iffcmpleEvaluator, // TR::iffcmple // float compare and branch if less than or equal
TR::TreeEvaluator::iffcmpequEvaluator, // TR::iffcmpequ // float compare and branch if equal or unordered
TR::TreeEvaluator::iffcmpneuEvaluator, // TR::iffcmpneu // float compare and branch if not equal or unordered
TR::TreeEvaluator::iffcmpltuEvaluator, // TR::iffcmpltu // float compare and branch if less than or unordered
TR::TreeEvaluator::iffcmpgeuEvaluator, // TR::iffcmpgeu // float compare and branch if greater than or equal or unordered
TR::TreeEvaluator::iffcmpgtuEvaluator, // TR::iffcmpgtu // float compare and branch if greater than or unordered
TR::TreeEvaluator::iffcmpleuEvaluator, // TR::iffcmpleu // float compare and branch if less than or equal or unordered
TR::TreeEvaluator::ifdcmpeqEvaluator, // TR::ifdcmpeq // double compare and branch if equal
TR::TreeEvaluator::ifdcmpneEvaluator, // TR::ifdcmpne // double compare and branch if not equal
TR::TreeEvaluator::ifdcmpltEvaluator, // TR::ifdcmplt // double compare and branch if less than
TR::TreeEvaluator::ifdcmpgeEvaluator, // TR::ifdcmpge // double compare and branch if greater than or equal
TR::TreeEvaluator::ifdcmpgtEvaluator, // TR::ifdcmpgt // double compare and branch if greater than
TR::TreeEvaluator::ifdcmpleEvaluator, // TR::ifdcmple // double compare and branch if less than or equal
TR::TreeEvaluator::ifdcmpequEvaluator, // TR::ifdcmpequ // double compare and branch if equal or unordered
TR::TreeEvaluator::ifdcmpneuEvaluator, // TR::ifdcmpneu // double compare and branch if not equal or unordered
TR::TreeEvaluator::ifdcmpltuEvaluator, // TR::ifdcmpltu // double compare and branch if less than or unordered
TR::TreeEvaluator::ifdcmpgeuEvaluator, // TR::ifdcmpgeu // double compare and branch if greater than or equal or unordered
TR::TreeEvaluator::ifdcmpgtuEvaluator, // TR::ifdcmpgtu // double compare and branch if greater than or unordered
TR::TreeEvaluator::ifdcmpleuEvaluator, // TR::ifdcmpleu // double compare and branch if less than or equal or unordered
TR::TreeEvaluator::iflcmpeqEvaluator, // TR::ifacmpeq // address compare and branch if equal
TR::TreeEvaluator::iflcmpneEvaluator, // TR::ifacmpne // address compare and branch if not equal
TR::TreeEvaluator::iflucmpltEvaluator, // TR::ifacmplt // address compare and branch if less than
TR::TreeEvaluator::iflucmpgeEvaluator, // TR::ifacmpge // address compare and branch if greater than or equal
TR::TreeEvaluator::iflucmpgtEvaluator, // TR::ifacmpgt // address compare and branch if greater than
TR::TreeEvaluator::iflucmpleEvaluator, // TR::ifacmple // address compare and branch if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbcmpeqEvaluator , // TR::ifbcmpeq // byte compare and branch if equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbcmpneEvaluator , // TR::ifbcmpne // byte compare and branch if not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbcmpltEvaluator , // TR::ifbcmplt // byte compare and branch if less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbcmpgeEvaluator , // TR::ifbcmpge // byte compare and branch if greater than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbcmpgtEvaluator , // TR::ifbcmpgt // byte compare and branch if greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbcmpleEvaluator , // TR::ifbcmple // byte compare and branch if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbucmpeqEvaluator , // TR::ifbucmpeq // unsigned byte compare and branch if equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbucmpneEvaluator , // TR::ifbucmpne // unsigned byte compare and branch if not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbucmpltEvaluator , // TR::ifbucmplt // unsigned byte compare and branch if less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbucmpgeEvaluator , // TR::ifbucmpge // unsigned byte compare and branch if greater than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbucmpgtEvaluator , // TR::ifbucmpgt // unsigned byte compare and branch if greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifbucmpleEvaluator , // TR::ifbucmple // unsigned byte compare and branch if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifscmpeqEvaluator , // TR::ifscmpeq // short integer compare and branch if equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifscmpneEvaluator , // TR::ifscmpne // short integer compare and branch if not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifscmpltEvaluator , // TR::ifscmplt // short integer compare and branch if less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifscmpgeEvaluator , // TR::ifscmpge // short integer compare and branch if greater than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifscmpgtEvaluator , // TR::ifscmpgt // short integer compare and branch if greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifscmpleEvaluator , // TR::ifscmple // short integer compare and branch if less than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifsucmpeqEvaluator , // TR::ifsucmpeq // char compare and branch if equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifsucmpneEvaluator , // TR::ifsucmpne // char compare and branch if not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifsucmpltEvaluator , // TR::ifsucmplt // char compare and branch if less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifsucmpgeEvaluator , // TR::ifsucmpge // char compare and branch if greater than or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifsucmpgtEvaluator , // TR::ifsucmpgt // char compare and branch if greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ifsucmpleEvaluator , // TR::ifsucmple // char compare and branch if less than or equal
TR::TreeEvaluator::loadaddrEvaluator, // TR::loadaddr // load address of non-heap storage item (Auto; Parm; Static or Method)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ZEROCHKEvaluator , // TR::ZEROCHK // Zero-check an int. Symref indicates call to perform when first child is zero. Other children are arguments to the call.
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::callIfEvaluator , // TR::callIf // Call symref if first child evaluates to true. Other childrem are arguments to the call.
TR::TreeEvaluator::iRegLoadEvaluator, // TR::iRegLoad // Load integer global register
TR::TreeEvaluator::aRegLoadEvaluator, // TR::aRegLoad // Load address global register
TR::TreeEvaluator::iRegLoadEvaluator, // TR::lRegLoad // Load long integer global register
TR::TreeEvaluator::fRegLoadEvaluator, // TR::fRegLoad // Load float global register
TR::TreeEvaluator::fRegLoadEvaluator, // TR::dRegLoad // Load double global register
TR::TreeEvaluator::iRegLoadEvaluator, // TR::sRegLoad // Load short global register
TR::TreeEvaluator::iRegLoadEvaluator, // TR::bRegLoad // Load byte global register
TR::TreeEvaluator::iRegStoreEvaluator, // TR::iRegStore // Store integer global register
TR::TreeEvaluator::iRegStoreEvaluator, // TR::aRegStore // Store address global register
TR::TreeEvaluator::iRegStoreEvaluator, // TR::lRegStore // Store long integer global register
TR::TreeEvaluator::iRegStoreEvaluator, // TR::fRegStore // Store float global register
TR::TreeEvaluator::iRegStoreEvaluator, // TR::dRegStore // Store double global register
TR::TreeEvaluator::iRegStoreEvaluator, // TR::sRegStore // Store short global register
TR::TreeEvaluator::iRegStoreEvaluator, // TR::bRegStore // Store byte global register
TR::TreeEvaluator::GlRegDepsEvaluator, // TR::GlRegDeps // Global Register Dependency List
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iternaryEvaluator , // TR::iternary // Ternary Operator: Based on the result of the first child; take the value of the
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lternaryEvaluator , // TR::lternary // second (first child evaluates to true) or third(first child evaluates to false) child
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bternaryEvaluator , // TR::bternary
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sternaryEvaluator , // TR::sternary
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::aternaryEvaluator , // TR::aternary
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fternaryEvaluator , // TR::fternary
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dternaryEvaluator , // TR::dternary
TR::TreeEvaluator::treetopEvaluator, // TR::treetop // tree top to anchor subtrees with side-effects
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::MethodEnterHookEvaluator , // TR::MethodEnterHook // called after a frame is built; temps initialized; and monitor acquired (if necessary)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::MethodExitHookEvaluator , // TR::MethodExitHook // called immediately before returning; frame not yet collapsed; monitor released (if necessary)
TR::TreeEvaluator::passThroughEvaluator, // TR::passThrough // Dummy node that represents its single child.
TR::TreeEvaluator::compressedRefsEvaluator, // TR::compressedRefs // no-op anchor providing optimizable subexpressions used for compression/decompression. First child is address load/store; second child is heap base displacement
TR::TreeEvaluator::BBStartEvaluator, // TR::BBStart // Start of Basic Block
TR::TreeEvaluator::BBEndEvaluator, // TR::BBEnd // End of Basic Block
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::viremEvaluator , // TR::virem // vector integer remainder
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::viminEvaluator , // TR::vimin // vector integer minimum
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vimaxEvaluator , // TR::vimax // vector integer maximum
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vigetelemEvaluator , // TR::vigetelem // get vector int element
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::visetelemEvaluator , // TR::visetelem // set vector int element
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vimergelEvaluator , // TR::vimergel // vector int merge low
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vimergehEvaluator , // TR::vimergeh // vector int merge high
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpeqEvaluator , // TR::vicmpeq // vector integer compare equal (return vector mask)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpgtEvaluator , // TR::vicmpgt // vector integer compare greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpgeEvaluator , // TR::vicmpge // vector integer compare greater equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpltEvaluator , // TR::vicmplt // vector integer compare less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpleEvaluator , // TR::vicmple // vector integer compare less equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpalleqEvaluator , // TR::vicmpalleq // vector integer all equal (return boolean)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpallneEvaluator , // TR::vicmpallne // vector integer all not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpallgtEvaluator , // TR::vicmpallgt // vector integer all greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpallgeEvaluator , // TR::vicmpallge // vector integer all greater equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpallltEvaluator , // TR::vicmpalllt // vector integer all less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpallleEvaluator , // TR::vicmpallle // vector integer all less equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpanyeqEvaluator , // TR::vicmpanyeq // vector integer any equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpanyneEvaluator , // TR::vicmpanyne // vector integer any not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpanygtEvaluator , // TR::vicmpanygt // vector integer any greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpanygeEvaluator , // TR::vicmpanyge // vector integer any greater equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpanyltEvaluator , // TR::vicmpanylt // vector integer any less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vicmpanyleEvaluator , // TR::vicmpanyle // vector integer any less equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vnotEvaluator , // TR::vnot // vector boolean not
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vselectEvaluator , // TR::vselect // vector select
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vpermEvaluator , // TR::vperm // vector permute
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vsplatsEvaluator , // TR::vsplats // vector splats
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdmergelEvaluator , // TR::vdmergel // vector double merge low
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdmergehEvaluator , // TR::vdmergeh // vector double merge high
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdsetelemEvaluator , // TR::vdsetelem // set vector double element
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdgetelemEvaluator , // TR::vdgetelem // get vector double element
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdselEvaluator , // TR::vdsel // get vector select double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdremEvaluator , // TR::vdrem // vector double remainder
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdmaddEvaluator , // TR::vdmadd // vector double fused multiply add
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdnmsubEvaluator , // TR::vdnmsub // vector double fused negative multiply subtract
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdmsubEvaluator , // TR::vdmsub // vector double fused multiply subtract
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdmaxEvaluator , // TR::vdmax // vector double maximum
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdminEvaluator , // TR::vdmin // vector double minimum
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpeqEvaluator , // TR::vdcmpeq // vector double compare equal (return vector mask)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpneEvaluator , // TR::vdcmpne // vector double compare not equal (return vector mask)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpgtEvaluator , // TR::vdcmpgt // vector double compare greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpgeEvaluator , // TR::vdcmpge // vector double compare greater equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpltEvaluator , // TR::vdcmplt // vector double compare less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpleEvaluator , // TR::vdcmple // vector double compare less equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpalleqEvaluator , // TR::vdcmpalleq // vector double compare all equal (return boolean)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpallneEvaluator , // TR::vdcmpallne // vector double compare all not equal (return boolean)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpallgtEvaluator , // TR::vdcmpallgt // vector double compare all greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpallgeEvaluator , // TR::vdcmpallge // vector double compare all greater equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpallltEvaluator , // TR::vdcmpalllt // vector double compare all less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpallleEvaluator , // TR::vdcmpallle // vector double compare all less equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpanyeqEvaluator , // TR::vdcmpanyeq // vector double compare any equal (return boolean)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpanyneEvaluator , // TR::vdcmpanyne // vector double compare any not equal (return boolean)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpanygtEvaluator , // TR::vdcmpanygt // vector double compare any greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpanygeEvaluator , // TR::vdcmpanyge // vector double compare any greater equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpanyltEvaluator , // TR::vdcmpanylt // vector double compare any less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdcmpanyleEvaluator , // TR::vdcmpanyle // vector double compare any less equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdsqrtEvaluator , // TR::vdsqrt // vector double square root
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdlogEvaluator , // TR::vdlog // vector double natural log
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vincEvaluator , // TR::vinc // vector increment
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdecEvaluator , // TR::vdec // vector decrement
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vnegEvaluator , // TR::vneg // vector negation
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vcomEvaluator , // TR::vcom // vector complement
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vaddEvaluator , // TR::vadd // vector add
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vsubEvaluator , // TR::vsub // vector subtract
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vmulEvaluator , // TR::vmul // vector multiply
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdivEvaluator , // TR::vdiv // vector divide
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vremEvaluator , // TR::vrem // vector remainder
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vandEvaluator , // TR::vand // vector logical AND
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vorEvaluator , // TR::vor // vector logical OR
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vxorEvaluator , // TR::vxor // vector exclusive OR integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vshlEvaluator , // TR::vshl // vector shift left
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vushrEvaluator , // TR::vushr // vector shift right logical
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vshrEvaluator , // TR::vshr // vector shift right arithmetic
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vcmpeqEvaluator , // TR::vcmpeq // vector compare equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vcmpneEvaluator , // TR::vcmpne // vector compare not equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vcmpltEvaluator , // TR::vcmplt // vector compare less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vucmpltEvaluator , // TR::vucmplt // vector unsigned compare less than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vcmpgtEvaluator , // TR::vcmpgt // vector compare greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vucmpgtEvaluator , // TR::vucmpgt // vector unsigned compare greater than
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vcmpleEvaluator , // TR::vcmple // vector compare less or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vucmpleEvaluator , // TR::vucmple // vector unsigned compare less or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vcmpgeEvaluator , // TR::vcmpge // vector compare greater or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vucmpgeEvaluator , // TR::vucmpge // vector unsigned compare greater or equal
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vloadEvaluator , // TR::vload // load vector
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vloadiEvaluator , // TR::vloadi // load indirect vector
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vstoreEvaluator , // TR::vstore // store vector
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vstoreiEvaluator , // TR::vstorei // store indirect vector
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vrandEvaluator , // TR::vrand // AND all elements into single value of element size
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vreturnEvaluator , // TR::vreturn // return a vector
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vcallEvaluator , // TR::vcall // direct call returning a vector
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vcalliEvaluator , // TR::vcalli // indirect call returning a vector
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vternaryEvaluator , // TR::vternary // vector ternary operator
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::v2vEvaluator , // TR::v2v // vector to vector conversion. preserves bit pattern (noop); only changes datatype
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vl2vdEvaluator , // TR::vl2vd // vector to vector conversion. converts each long element to double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vconstEvaluator , // TR::vconst // vector constant
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::getvelemEvaluator , // TR::getvelem // get vector element; returns a scalar
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vsetelemEvaluator , // TR::vsetelem // vector set element
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vbRegLoadEvaluator , // TR::vbRegLoad // Load vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vsRegLoadEvaluator , // TR::vsRegLoad // Load vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::viRegLoadEvaluator , // TR::viRegLoad // Load vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vlRegLoadEvaluator , // TR::vlRegLoad // Load vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vfRegLoadEvaluator , // TR::vfRegLoad // Load vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdRegLoadEvaluator , // TR::vdRegLoad // Load vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vbRegStoreEvaluator , // TR::vbRegStore // Store vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vsRegStoreEvaluator , // TR::vsRegStore // Store vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::viRegStoreEvaluator , // TR::viRegStore // Store vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vlRegStoreEvaluator , // TR::vlRegStore // Store vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vfRegStoreEvaluator , // TR::vfRegStore // Store vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::vdRegStoreEvaluator , // TR::vdRegStore // Store vector global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuconstEvaluator , // TR::iuconst // load unsigned integer constant (32-but unsigned)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luconstEvaluator , // TR::luconst // load unsigned long integer constant (64-bit unsigned)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::buconstEvaluator , // TR::buconst // load unsigned byte integer constant (8-bit unsigned)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuloadEvaluator , // TR::iuload // load unsigned integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luloadEvaluator , // TR::luload // load unsigned long integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::buloadEvaluator , // TR::buload // load unsigned byte
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuloadiEvaluator , // TR::iuloadi // load indirect unsigned integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luloadiEvaluator , // TR::luloadi // load indirect unsigned long integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::buloadiEvaluator , // TR::buloadi // load indirect unsigned byte
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iustoreEvaluator , // TR::iustore // store unsigned integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lustoreEvaluator , // TR::lustore // store unsigned long integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bustoreEvaluator , // TR::bustore // store unsigned byte
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iustoreiEvaluator , // TR::iustorei // store indirect unsigned integer (child1 a; child2 i)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lustoreiEvaluator , // TR::lustorei // store indirect unsigned long integer (child1 a; child2 l)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bustoreiEvaluator , // TR::bustorei // store indirect unsigned byte (child1 a; child2 b)
TR::TreeEvaluator::ireturnEvaluator, // TR::iureturn // return an unsigned integer
TR::TreeEvaluator::lreturnEvaluator, // TR::lureturn // return a long unsigned integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iucallEvaluator , // TR::iucall // direct call returning unsigned integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lucallEvaluator , // TR::lucall // direct call returning unsigned long integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuaddEvaluator , // TR::iuadd // add 2 unsigned integers
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luaddEvaluator , // TR::luadd // add 2 unsigned long integers
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::buaddEvaluator , // TR::buadd // add 2 unsigned bytes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iusubEvaluator , // TR::iusub // subtract 2 unsigned integers (child1 - child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lusubEvaluator , // TR::lusub // subtract 2 unsigned long integers (child1 - child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::busubEvaluator , // TR::busub // subtract 2 unsigned bytes (child1 - child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iunegEvaluator , // TR::iuneg // negate an unsigned integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lunegEvaluator , // TR::luneg // negate a unsigned long integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iushlEvaluator , // TR::iushl // shift unsigned integer left (child1 << child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lushlEvaluator , // TR::lushl // shift unsigned long integer left (child1 << child2)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::f2iuEvaluator , // TR::f2iu // convert float to unsigned integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::f2luEvaluator , // TR::f2lu // convert float to unsigned long integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::f2buEvaluator , // TR::f2bu // convert float to unsigned byte
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::f2cEvaluator , // TR::f2c // convert float to char
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::d2iuEvaluator , // TR::d2iu // convert double to unsigned integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::d2luEvaluator , // TR::d2lu // convert double to unsigned long integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::d2buEvaluator , // TR::d2bu // convert double to unsigned byte
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::d2cEvaluator , // TR::d2c // convert double to char
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuRegLoadEvaluator , // TR::iuRegLoad // Load unsigned integer global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luRegLoadEvaluator , // TR::luRegLoad // Load unsigned long integer global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuRegStoreEvaluator , // TR::iuRegStore // Store unsigned integer global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luRegStoreEvaluator , // TR::luRegStore // Store long integer global register
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuternaryEvaluator , // TR::iuternary // second or the third child. Analogous to the "condition ? a : b" operations in C/Java.
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luternaryEvaluator , // TR::luternary
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::buternaryEvaluator , // TR::buternary
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::suternaryEvaluator , // TR::suternary
TR::TreeEvaluator::cconstEvaluator, // TR::cconst // load unicode constant (16-bit unsigned)
TR::TreeEvaluator::cloadEvaluator, // TR::cload // load short unsigned integer
TR::TreeEvaluator::cloadEvaluator, // TR::cloadi // load indirect unsigned short integer
TR::TreeEvaluator::sstoreEvaluator, // TR::cstore // store unsigned short integer
TR::TreeEvaluator::sstoreEvaluator, // TR::cstorei // store indirect unsigned short integer (child1 a; child2 c)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::monentEvaluator , // TR::monent // acquire lock for synchronising method
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::monexitEvaluator , // TR::monexit // release lock for synchronising method
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::monexitfenceEvaluator , // TR::monexitfence //denotes the end of a monitored region solely for live monitor meta data
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::tstartEvaluator , // TR::tstart // transaction begin
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::tfinishEvaluator , // TR::tfinish // transaction end
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::tabortEvaluator , // TR::tabort // transaction abort
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::instanceofEvaluator , // TR::instanceof // instanceof - symref is the class object; cp index is in the "int" field; child is the object reference
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::checkcastEvaluator , // TR::checkcast // checkcast
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::checkcastAndNULLCHKEvaluator , // TR::checkcastAndNULLCHK // checkcast and NULL check the underlying object reference
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::NewEvaluator , // TR::New // new - child is class
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::newarrayEvaluator , // TR::newarray // new array of primitives
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::anewarrayEvaluator , // TR::anewarray // new array of objects
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::variableNewEvaluator , // TR::variableNew // new - child is class; type not known at compile time
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::variableNewArrayEvaluator , // TR::variableNewArray // new array - type not known at compile time; type must be a j9class; do not use type enums
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::multianewarrayEvaluator , // TR::multianewarray // multi-dimensional new array of objects
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::arraylengthEvaluator , // TR::arraylength // number of elements in an array
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::contigarraylengthEvaluator , // TR::contigarraylength // number of elements in a contiguous array
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::discontigarraylengthEvaluator , // TR::discontigarraylength // number of elements in a discontiguous array
TR::TreeEvaluator::indirectCallEvaluator, // TR::icalli // indirect call returning integer (child1 is addr of function)
TR::TreeEvaluator::indirectCallEvaluator, // TR::iucalli // indirect call returning unsigned integer (child1 is addr of function)
TR::TreeEvaluator::indirectCallEvaluator, // TR::lcalli // indirect call returning long integer (child1 is addr of function)
TR::TreeEvaluator::indirectCallEvaluator, // TR::lucalli // indirect call returning unsigned long integer (child1 is addr of function)
TR::TreeEvaluator::indirectCallEvaluator, // TR::fcalli // indirect call returning float (child1 is addr of function)
TR::TreeEvaluator::indirectCallEvaluator, // TR::dcalli // indirect call returning double (child1 is addr of function)
TR::TreeEvaluator::indirectCallEvaluator, // TR::acalli // indirect call returning reference (child1 is addr of function)
TR::TreeEvaluator::indirectCallEvaluator, // TR::calli // indirect call returning void (child1 is addr of function)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fenceEvaluator , // TR::fence // barrier to optimization
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luaddhEvaluator , // TR::luaddh // add 2 unsigned long integers (the high parts of prior luadd) as high part of 128bit addition.
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::caddEvaluator , // TR::cadd // add 2 unsigned short integers
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::aiaddEvaluator , // TR::aiadd // add integer to address with address result (child1 a; child2 i)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::aiuaddEvaluator , // TR::aiuadd // add unsigned integer to address with address result (child1 a; child2 i)
TR::TreeEvaluator::aladdEvaluator, // TR::aladd // add long integer to address with address result (child1 a; child2 i) (64-bit only)
TR::TreeEvaluator::aladdEvaluator, // TR::aluadd // add unsigned long integer to address with address result (child1 a; child2 i) (64-bit only)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lusubhEvaluator , // TR::lusubh // subtract 2 unsigned long integers (the high parts of prior lusub) as high part of 128bit subtraction.
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::csubEvaluator , // TR::csub // subtract 2 unsigned short integers (child1 - child2)
TR::TreeEvaluator::imulhEvaluator, // TR::imulh // multiply 2 integers; and return the high word of the product
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iumulhEvaluator , // TR::iumulh // multiply 2 unsigned integers; and return the high word of the product
TR::TreeEvaluator::lmulhEvaluator, // TR::lmulh // multiply 2 long integers; and return the high word of the product
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lumulhEvaluator , // TR::lumulh // multiply 2 unsigned long integers; and return the high word of the product
TR::TreeEvaluator::ibits2fEvaluator, // TR::ibits2f // type-coerce int to float
TR::TreeEvaluator::fbits2iEvaluator, // TR::fbits2i // type-coerce float to int
TR::TreeEvaluator::lbits2dEvaluator, // TR::lbits2d // type-coerce long to double
TR::TreeEvaluator::dbits2lEvaluator, // TR::dbits2l // type-coerce double to long
TR::TreeEvaluator::lookupEvaluator, // TR::lookup // lookupswitch (child1 is selector expression; child2 the default destination; subsequent children are case nodes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::trtLookupEvaluator , // TR::trtLookup // special lookupswitch (child1 must be trt; child2 the default destination; subsequent children are case nodes) The internal control flow is similar to lookup; but each CASE represents a special semantics associated with a flag on it
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::CaseEvaluator , // TR::Case // case nodes that are children of TR_switch. Uses the branchdestination and the int const field
TR::TreeEvaluator::tableEvaluator, // TR::table // tableswitch (child1 is the selector; child2 the default destination; subsequent children are the branch targets (the last child may be a branch table address; use getCaseIndexUpperBound() when iterating over branch targets)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::exceptionRangeFenceEvaluator , // TR::exceptionRangeFence // (J9) SymbolReference is the aliasing effect; initializer is where the code address gets put when binary is generated used for delimiting function; try blocks; catch clauses; finally clauses; etc.
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dbgFenceEvaluator , // TR::dbgFence // used to delimit code (stmts) for debug info. Has no symbol reference.
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::NULLCHKEvaluator , // TR::NULLCHK // Null check a pointer. child 1 is indirect reference. Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ResolveCHKEvaluator , // TR::ResolveCHK // Resolve check a static; field or method. child 1 is reference to be resolved. Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ResolveAndNULLCHKEvaluator , // TR::ResolveAndNULLCHK // Resolve check a static; field or method and Null check the underlying pointer. child 1 is reference to be resolved. Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::DIVCHKEvaluator , // TR::DIVCHK // Divide by zero check. child 1 is the divide. Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::OverflowCHKEvaluator , // TR::OverflowCHK // Overflow check. child 1 is the operation node(add; mul; sub). Child 2 and child 3 are the operands of the operation of the operation. Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::UnsignedOverflowCHKEvaluator , // TR::UnsignedOverflowCHK // UnsignedOverflow check. child 1 is the operation node(add; mul; sub). Child 2 and child 3 are the operands of the operation of the operation. Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::BNDCHKEvaluator , // TR::BNDCHK // Array bounds check; checks that child 1 > child 2 >= 0 (child 1 is bound; 2 is index). Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ArrayCopyBNDCHKEvaluator , // TR::ArrayCopyBNDCHK // Array copy bounds check; checks that child 1 >= child 2. Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::BNDCHKwithSpineCHKEvaluator , // TR::BNDCHKwithSpineCHK // Array bounds check and spine check
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::SpineCHKEvaluator , // TR::SpineCHK // Check if the base array has a spine
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ArrayStoreCHKEvaluator , // TR::ArrayStoreCHK // Array store check. child 1 is object; 2 is array. Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ArrayCHKEvaluator , // TR::ArrayCHK // Array compatibility check. child 1 is object1; 2 is object2. Symbolref indicates failure action/destination
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::RetEvaluator , // TR::Ret // Used by ilGen only
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::arraycopyEvaluator , // TR::arraycopy // Call to System.arraycopy that may be partially inlined
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::arraysetEvaluator , // TR::arrayset // Inline code for memory initialization of part of an array
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::arraytranslateEvaluator , // TR::arraytranslate // Inline code for translation of part of an array to another form via lookup
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::arraytranslateAndTestEvaluator , // TR::arraytranslateAndTest // Inline code for scanning of part of an array for a particular 8-bit character
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::long2StringEvaluator , // TR::long2String // Convert integer/long value to String
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bitOpMemEvaluator , // TR::bitOpMem // bit operations (AND; OR; XOR) for memory to memory
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bitOpMemNDEvaluator , // TR::bitOpMemND // 3 operand(source1;source2;target) version of bitOpMem
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::arraycmpEvaluator , // TR::arraycmp // Inline code for memory comparison of part of an array
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::arraycmpWithPadEvaluator , // TR::arraycmpWithPad // memory comparison when src1 length != src2 length and padding is needed
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::allocationFenceEvaluator , // TR::allocationFence // Internal fence guarding escape of newObject & final fields - eliminatable
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::loadFenceEvaluator , // TR::loadFence // JEP171: prohibits loadLoad and loadStore reordering (on globals)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::storeFenceEvaluator , // TR::storeFence // JEP171: prohibits loadStore and storeStore reordering (on globals)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fullFenceEvaluator , // TR::fullFence // JEP171: prohibits loadLoad; loadStore; storeLoad; and storeStore reordering (on globals)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::MergeNewEvaluator , // TR::MergeNew // Parent for New etc. nodes that can all be allocated together
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::computeCCEvaluator , // TR::computeCC // compute Condition Codes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::butestEvaluator , // TR::butest // zEmulator: mask unsigned byte (UInt8) and set condition codes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sutestEvaluator , // TR::sutest // zEmulator: mask unsigned short (UInt16) and set condition codes
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bucmpEvaluator , // TR::bucmp // Currently only valid for zEmulator. Based on the ordering of the two children set the return value:
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bcmpEvaluator , // TR::bcmp // 0 : child1 == child2
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sucmpEvaluator , // TR::sucmp // 1 : child1 < child2
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::scmpEvaluator , // TR::scmp // 2 : child1 > child2
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iucmpEvaluator , // TR::iucmp
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::icmpEvaluator , // TR::icmp
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lucmpEvaluator , // TR::lucmp
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ificmpoEvaluator , // TR::ificmpo // integer compare and branch if overflow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ificmpnoEvaluator , // TR::ificmpno // integer compare and branch if not overflow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iflcmpoEvaluator , // TR::iflcmpo // long compare and branch if overflow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iflcmpnoEvaluator , // TR::iflcmpno // long compare and branch if not overflow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ificmnoEvaluator , // TR::ificmno // integer compare negative and branch if overflow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ificmnnoEvaluator , // TR::ificmnno // integer compare negative and branch if not overflow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iflcmnoEvaluator , // TR::iflcmno // long compare negative and branch if overflow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iflcmnnoEvaluator , // TR::iflcmnno // long compare negative and branch if not overflow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuaddcEvaluator , // TR::iuaddc // Currently only valid for zEmulator. Add two unsigned ints with carry
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luaddcEvaluator , // TR::luaddc // Add two longs with carry
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iusubbEvaluator , // TR::iusubb // Subtract two ints with borrow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lusubbEvaluator , // TR::lusubb // Subtract two longs with borrow
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::icmpsetEvaluator , // TR::icmpset // icmpset(pointer;c;r): compare *pointer with c; if it matches; replace with r. Returns 0 on match; 1 otherwise
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lcmpsetEvaluator , // TR::lcmpset // the operation is done atomically - return type is int for both [il]cmpset
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bztestnsetEvaluator , // TR::bztestnset // bztestnset(pointer;c): atomically sets *pointer to c and returns the original value of *p (represents Test And Set on Z) the atomic ops.. atomically update the symref. first child is address; second child is the RHS interestingly; these ops act like loads and stores at the same time
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ibatomicorEvaluator , // TR::ibatomicor
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::isatomicorEvaluator , // TR::isatomicor
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iiatomicorEvaluator , // TR::iiatomicor
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ilatomicorEvaluator , // TR::ilatomicor
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dexpEvaluator , // TR::dexp // double exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::branchEvaluator , // TR::branch // generic branch --> DEPRECATED use TR::case instead
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::igotoEvaluator , // TR::igoto // indirect goto; branches to the address specified by a child
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bexpEvaluator , // TR::bexp // signed byte exponent (raise signed byte to power)
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::buexpEvaluator , // TR::buexp // unsigned byte exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sexpEvaluator , // TR::sexp // short exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::cexpEvaluator , // TR::cexp // unsigned short exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iexpEvaluator , // TR::iexp // integer exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuexpEvaluator , // TR::iuexp // unsigned integer exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lexpEvaluator , // TR::lexp // long exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luexpEvaluator , // TR::luexp // unsigned long exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fexpEvaluator , // TR::fexp // float exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fuexpEvaluator , // TR::fuexp // float base to unsigned integral exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::duexpEvaluator , // TR::duexp // double base to unsigned integral exponent
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ixfrsEvaluator , // TR::ixfrs // transfer sign integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lxfrsEvaluator , // TR::lxfrs // transfer sign long
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fxfrsEvaluator , // TR::fxfrs // transfer sign float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dxfrsEvaluator , // TR::dxfrs // transfer sign double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fintEvaluator , // TR::fint // truncate float to int
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dintEvaluator , // TR::dint // truncate double to int
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fnintEvaluator , // TR::fnint // round float to nearest int
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dnintEvaluator , // TR::dnint // round double to nearest int
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fsqrtEvaluator , // TR::fsqrt // square root of float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dsqrtEvaluator , // TR::dsqrt // square root of double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::getstackEvaluator , // TR::getstack // returns current value of SP
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::deallocaEvaluator , // TR::dealloca // resets value of SP
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ishflEvaluator , // TR::ishfl // int shift logical
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lshflEvaluator , // TR::lshfl // long shift logical
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iushflEvaluator , // TR::iushfl // unsigned int shift logical
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lushflEvaluator , // TR::lushfl // unsigned long shift logical
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bshflEvaluator , // TR::bshfl // byte shift logical
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sshflEvaluator , // TR::sshfl // short shift logical
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bushflEvaluator , // TR::bushfl // unsigned byte shift logical
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sushflEvaluator , // TR::sushfl // unsigned short shift logical
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::idozEvaluator , // TR::idoz // difference or zero
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcosEvaluator , // TR::dcos // cos of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dsinEvaluator , // TR::dsin // sin of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dtanEvaluator , // TR::dtan // tan of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dcoshEvaluator , // TR::dcosh // cos of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dsinhEvaluator , // TR::dsinh // sin of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dtanhEvaluator , // TR::dtanh // tan of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dacosEvaluator , // TR::dacos // arccos of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dasinEvaluator , // TR::dasin // arcsin of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::datanEvaluator , // TR::datan // arctan of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::datan2Evaluator , // TR::datan2 // arctan2 of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dlogEvaluator , // TR::dlog // log of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::imuloverEvaluator , // TR::imulover // (int) overflow predicate of int multiplication
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dfloorEvaluator , // TR::dfloor // floor of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ffloorEvaluator , // TR::ffloor // floor of float; returning float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dceilEvaluator , // TR::dceil // ceil of double; returning double
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fceilEvaluator , // TR::fceil // ceil of float; returning float
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ibranchEvaluator , // TR::ibranch // generic indirct branch --> first child is a constant indicating the mask
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::mbranchEvaluator , // TR::mbranch // generic branch to multiple potential targets
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::getpmEvaluator , // TR::getpm // get program mask
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::setpmEvaluator , // TR::setpm // set program mask
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::loadAutoOffsetEvaluator , // TR::loadAutoOffset // loads the offset (from the SP) of an auto
TR::TreeEvaluator::imaxEvaluator, // TR::imax // max of 2 or more integers
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iumaxEvaluator , // TR::iumax // max of 2 or more unsigned integers
TR::TreeEvaluator::lmaxEvaluator, // TR::lmax // max of 2 or more longs
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lumaxEvaluator , // TR::lumax // max of 2 or more unsigned longs
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fmaxEvaluator , // TR::fmax // max of 2 or more floats
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dmaxEvaluator , // TR::dmax // max of 2 or more doubles
TR::TreeEvaluator::iminEvaluator, // TR::imin // min of 2 or more integers
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::iuminEvaluator , // TR::iumin // min of 2 or more unsigned integers
TR::TreeEvaluator::lminEvaluator, // TR::lmin // min of 2 or more longs
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::luminEvaluator , // TR::lumin // min of 2 or more unsigned longs
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::fminEvaluator , // TR::fmin // min of 2 or more floats
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::dminEvaluator , // TR::dmin // min of 2 or more doubles
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::trtEvaluator , // TR::trt // translate and test
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::trtSimpleEvaluator , // TR::trtSimple // same as TRT but ignoring the returned source byte address and table entry value
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ihbitEvaluator , // TR::ihbit
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ilbitEvaluator , // TR::ilbit
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::inolzEvaluator , // TR::inolz
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::inotzEvaluator , // TR::inotz
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ipopcntEvaluator , // TR::ipopcnt
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lhbitEvaluator , // TR::lhbit
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::llbitEvaluator , // TR::llbit
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lnolzEvaluator , // TR::lnolz
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lnotzEvaluator , // TR::lnotz
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lpopcntEvaluator , // TR::lpopcnt
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ibyteswapEvaluator , // TR::ibyteswap // swap bytes in an integer
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::bbitpermuteEvaluator , // TR::bbitpermute
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::sbitpermuteEvaluator , // TR::sbitpermute
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::ibitpermuteEvaluator , // TR::ibitpermute
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::lbitpermuteEvaluator , // TR::lbitpermute
TR::TreeEvaluator::unImpOpEvaluator , // TODO:ARM64: Enable when Implemented: TR::TreeEvaluator::PrefetchEvaluator, // TR::Prefetch
| 149.427284 | 436 | 0.714276 | xiacijie |
7c81f5ab25ed38455d4260460579c2813d53a3ed | 4,941 | cpp | C++ | source/modules/soul_core/code_generation/soul_PatchGenerator.cpp | squirrelmaker/SOUL | 2f8f74e8efae005e6f1e6d5f4f11b5ae22104143 | [
"0BSD"
] | 1,711 | 2018-12-03T13:49:34.000Z | 2022-03-29T09:22:03.000Z | source/modules/soul_core/code_generation/soul_PatchGenerator.cpp | squirrelmaker/SOUL | 2f8f74e8efae005e6f1e6d5f4f11b5ae22104143 | [
"0BSD"
] | 68 | 2019-01-29T09:13:05.000Z | 2022-02-24T01:30:44.000Z | source/modules/soul_core/code_generation/soul_PatchGenerator.cpp | squirrelmaker/SOUL | 2f8f74e8efae005e6f1e6d5f4f11b5ae22104143 | [
"0BSD"
] | 123 | 2019-01-29T02:13:48.000Z | 2021-12-12T09:48:24.000Z | /*
_____ _____ _____ __
| __| | | | | The SOUL language
|__ | | | | | |__ Copyright (c) 2019 - ROLI Ltd.
|_____|_____|_____|_____|
The code in this file is provided under the terms of the ISC license:
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice and
this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
namespace soul
{
static inline constexpr auto manifestTemplate = R"manifest(
{
"MANIFEST_NAME":
{
"ID": "com.yourcompany.PATCH_NAME",
"version": "0.1",
"name": "PATCH_NAME",
"description": "This is a SOUL Patch called PATCH_NAME!",
"category": "CATEGORY",
"manufacturer": "Your Company Name",
"isInstrument": IS_INSTRUMENT,
"source": [ "PATCH_NAME.soul" ]
}
}
)manifest";
static inline constexpr auto synthCodeTemplate = R"proc(
/**
This is an auto-generated SOUL patch template.
This example code simply plays a trivial sinewave mono-synth -
it's up to you to build upon this and create a real synthesiser!
*/
graph PATCH_NAME [[main]]
{
input event soul::midi::Message midiIn;
output stream float audioOut;
let
{
midiParser = soul::midi::MPEParser;
voice = SineOsc;
}
connection
{
midiIn -> midiParser -> voice -> audioOut;
}
}
//==============================================================================
processor SineOsc
{
input event (soul::note_events::NoteOn,
soul::note_events::NoteOff) eventIn;
output stream float audioOut;
event eventIn (soul::note_events::NoteOn e)
{
currentNote = e.note;
phaseIncrement = float (twoPi * processor.period * soul::noteNumberToFrequency (e.note));
}
event eventIn (soul::note_events::NoteOff e)
{
if (e.note == currentNote)
currentNote = 0;
}
float currentNote, phaseIncrement, amplitude;
void run()
{
float phase;
loop
{
// A very simple amplitude envelope - linear attack, exponential decay
if (currentNote == 0)
amplitude *= 0.999f;
else
amplitude = min (amplitude + 0.001f, 1.0f);
phase = addModulo2Pi (phase, phaseIncrement);
audioOut << amplitude * sin (phase);
advance();
}
}
}
)proc";
static inline constexpr auto effectCodeTemplate = R"proc(
/**
This is an auto-generated SOUL patch template.
This example code simply performs a simple gain between its input
and output. Now it's your turn to build this up into a real effect!
*/
processor PATCH_NAME [[main]]
{
input stream float audioIn;
output stream float audioOut;
input stream float gainDb [[ name: "Gain", min: -60.0, max: 10.0, init: 0, step: 0.1, slewRate: 200.0 ]];
void run()
{
loop
{
let gain = soul::dBtoGain (gainDb);
audioOut << audioIn * gain;
advance();
}
}
}
)proc";
std::vector<SourceFile> createExamplePatchFiles (PatchGeneratorOptions options)
{
std::vector<SourceFile> files;
if (! (options.isSynth || options.isEffect))
options.isSynth = true;
options.name = makeSafeIdentifierName (choc::text::trim (options.name));
auto manifest = choc::text::replace (manifestTemplate,
"MANIFEST_NAME", soul::patch::getManifestTopLevelPropertyName(),
"PATCH_NAME", options.name,
"CATEGORY", options.isSynth ? "synth" : "effect",
"IS_INSTRUMENT", options.isSynth ? "true" : "false");
auto processorCode = choc::text::replace (options.isSynth ? synthCodeTemplate
: effectCodeTemplate,
"PATCH_NAME", options.name);
files.push_back ({ options.name + soul::patch::getManifestSuffix(), manifest });
files.push_back ({ options.name + ".soul", processorCode });
return files;
}
}
| 31.471338 | 111 | 0.57377 | squirrelmaker |
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 |
7ca2502c852021e8477872b042abdfb61ffd8681 | 669 | hpp | C++ | sw/3rd_party/VTK-7.1.0/ThirdParty/diy2/vtkdiy2/include/vtkdiy/time.hpp | esean/stl_voro_fill | c569a4019ff80afbf85482c7193711ea85a7cafb | [
"MIT"
] | 4 | 2019-05-30T01:52:12.000Z | 2021-09-29T21:12:13.000Z | sw/3rd_party/VTK-7.1.0/ThirdParty/diy2/vtkdiy2/include/vtkdiy/time.hpp | esean/stl_voro_fill | c569a4019ff80afbf85482c7193711ea85a7cafb | [
"MIT"
] | null | null | null | sw/3rd_party/VTK-7.1.0/ThirdParty/diy2/vtkdiy2/include/vtkdiy/time.hpp | esean/stl_voro_fill | c569a4019ff80afbf85482c7193711ea85a7cafb | [
"MIT"
] | 2 | 2019-08-30T23:36:13.000Z | 2019-11-08T16:52:01.000Z | #ifndef DIY_TIME_HPP
#define DIY_TIME_HPP
#include <sys/time.h>
#ifdef __MACH__
#include <mach/clock.h>
#include <mach/mach.h>
#endif
namespace diy
{
typedef unsigned long time_type;
inline time_type get_time()
{
#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
clock_serv_t cclock;
mach_timespec_t ts;
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
clock_get_time(cclock, &ts);
mach_port_deallocate(mach_task_self(), cclock);
#else
timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
#endif
return ts.tv_sec*1000 + ts.tv_nsec/1000000;
}
}
#endif
| 19.676471 | 72 | 0.690583 | esean |