blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
656276a85f3dfff7977e57916698005599b45cb0
e4fe2939fe1ec04376ffe0886450e8033cdc7c2f
/StoreManagement/WelcomeScreen.cpp
993ad6238aed9f8fa72221841cfc4e5ba9514bb8
[]
no_license
bcosescu/StoreManagement
17cc86787f11640564a0a5c8867e8f6916d31f66
d62a267a4b0f401a0ba9722f9cfc9b5389ef3747
refs/heads/master
2020-06-17T09:21:04.398193
2016-12-02T21:39:15
2016-12-02T21:39:15
75,021,763
0
0
null
null
null
null
UTF-8
C++
false
false
797
cpp
#include "StdAfx.h" #include "WelcomeScreen.h" #include <iostream> #include "NavigationManager.h" #include "SigninScreen.h" #include "SignUpScreen.h" #include "Utils.h" CWelcomeScreen::CWelcomeScreen(void) :CScreenBase("Welcome") { _shouldExitAppOption = true; } CWelcomeScreen::~CWelcomeScreen(void) { } void CWelcomeScreen::layoutContent() { std::cout << "[1] Login" << std::endl; std::cout << "[2] Sign up" << std::endl; std::cout << "[X] Exit"; } void CWelcomeScreen::handleInput(const std::string& userInput) { switch(CUtils::getNumericOption(userInput)) { case 1: CNavigationManager::instance().pushScreen(new CSignInScreen()); break; case 2: CNavigationManager::instance().pushScreen(new CSignUpScreen()); break; } } bool CWelcomeScreen::handleBack() { return false; }
[ "bogdanc@gmail.com" ]
bogdanc@gmail.com
4a73c38eba7a1c7722b6968f02d4fdbd409220bd
0a9a614314f9bb804b33b011fdcb297929b2c896
/CTest8.1(showJPG)/CTest8.1(showJPG)/CTest8.1(showJPG)View.cpp
126241f5b6c2a7582db70cc01f906073db81f0d5
[]
no_license
WSJ-github/MFC
f217d6bb0881c6ec8d0091eb9406823be1da513d
64d264f183f6f1fda5d4d3f42d4385b8780b40fa
refs/heads/master
2021-03-26T16:18:26.672169
2020-06-08T16:16:26
2020-06-08T16:16:26
247,721,744
0
0
null
null
null
null
GB18030
C++
false
false
2,121
cpp
// CTest8.1(showJPG)View.cpp : CCTest81showJPGView 类的实现 // #include "stdafx.h" // SHARED_HANDLERS 可以在实现预览、缩略图和搜索筛选器句柄的 // ATL 项目中进行定义,并允许与该项目共享文档代码。 #ifndef SHARED_HANDLERS #include "CTest8.1(showJPG).h" #endif #include "CTest8.1(showJPG)Doc.h" #include "CTest8.1(showJPG)View.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CCTest81showJPGView IMPLEMENT_DYNCREATE(CCTest81showJPGView, CView) BEGIN_MESSAGE_MAP(CCTest81showJPGView, CView) ON_COMMAND(ID_FILE_OPEN, &CCTest81showJPGView::OnFileOpen) END_MESSAGE_MAP() // CCTest81showJPGView 构造/析构 CCTest81showJPGView::CCTest81showJPGView() { // TODO: 在此处添加构造代码 } CCTest81showJPGView::~CCTest81showJPGView() { } BOOL CCTest81showJPGView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: 在此处通过修改 // CREATESTRUCT cs 来修改窗口类或样式 return CView::PreCreateWindow(cs); } // CCTest81showJPGView 绘制 void CCTest81showJPGView::OnDraw(CDC* /*pDC*/) { CCTest81showJPGDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; // TODO: 在此处为本机数据添加绘制代码 } // CCTest81showJPGView 诊断 #ifdef _DEBUG void CCTest81showJPGView::AssertValid() const { CView::AssertValid(); } void CCTest81showJPGView::Dump(CDumpContext& dc) const { CView::Dump(dc); } CCTest81showJPGDoc* CCTest81showJPGView::GetDocument() const // 非调试版本是内联的 { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCTest81showJPGDoc))); return (CCTest81showJPGDoc*)m_pDocument; } #endif //_DEBUG // CCTest81showJPGView 消息处理程序 void CCTest81showJPGView::OnFileOpen() { CFileDialog cfd(true); int r = cfd.DoModal(); CClientDC dc(this); CRect rect; int sx, sy; if (r == IDOK) { CString filename = cfd.GetPathName(); CImage img; img.Load(filename); GetClientRect(&rect); sx = (rect.right - img.GetWidth()) / 2; sy = (rect.bottom - img.GetHeight()) / 2; img.Draw(dc.m_hDC, sx, sy, img.GetWidth(), img.GetHeight()); } // TODO: 在此添加命令处理程序代码 }
[ "963013061@qq.com" ]
963013061@qq.com
57111c71e6b158e63bf622be76e839d8198ce427
e5fb5f86573feed4381cbe12e0c61bfbbd3b1a38
/venv/lib/python3.6/site-packages/pystan/stan/lib/stan_math/stan/math/prim/scal/prob/gamma_lpdf.hpp
33462a977a0537f556f76da50e0120692d664d1e
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
onurhuseyincantay/SpotixAPI
292079903126b38265b3c4af58b7faab98959af5
e427d963afbf7e202162ecdbed18b29c57c18de3
refs/heads/master
2020-03-06T19:04:05.583214
2018-03-28T15:36:13
2018-03-28T15:36:13
127,019,875
2
2
null
null
null
null
UTF-8
C++
false
false
6,504
hpp
#ifndef STAN_MATH_PRIM_SCAL_PROB_GAMMA_LPDF_HPP #define STAN_MATH_PRIM_SCAL_PROB_GAMMA_LPDF_HPP #include <stan/math/prim/scal/meta/is_constant_struct.hpp> #include <stan/math/prim/scal/meta/partials_return_type.hpp> #include <stan/math/prim/scal/meta/operands_and_partials.hpp> #include <stan/math/prim/scal/err/check_consistent_sizes.hpp> #include <stan/math/prim/scal/err/check_greater_or_equal.hpp> #include <stan/math/prim/scal/err/check_less_or_equal.hpp> #include <stan/math/prim/scal/err/check_nonnegative.hpp> #include <stan/math/prim/scal/err/check_not_nan.hpp> #include <stan/math/prim/scal/err/check_positive_finite.hpp> #include <stan/math/prim/scal/fun/constants.hpp> #include <stan/math/prim/scal/fun/multiply_log.hpp> #include <stan/math/prim/scal/fun/value_of.hpp> #include <stan/math/prim/scal/fun/gamma_p.hpp> #include <stan/math/prim/scal/fun/digamma.hpp> #include <stan/math/prim/scal/meta/VectorBuilder.hpp> #include <stan/math/prim/scal/meta/include_summand.hpp> #include <stan/math/prim/scal/meta/scalar_seq_view.hpp> #include <stan/math/prim/scal/fun/grad_reg_inc_gamma.hpp> #include <boost/random/gamma_distribution.hpp> #include <boost/random/variate_generator.hpp> #include <cmath> namespace stan { namespace math { /** * The log of a gamma density for y with the specified * shape and inverse scale parameters. * Shape and inverse scale parameters must be greater than 0. * y must be greater than or equal to 0. * \f{eqnarray*}{ y &\sim& \mbox{\sf{Gamma}}(\alpha, \beta) \\ \log (p (y \, |\, \alpha, \beta) ) &=& \log \left( \frac{\beta^\alpha}{\Gamma(\alpha)} y^{\alpha - 1} \exp^{- \beta y} \right) \\ &=& \alpha \log(\beta) - \log(\Gamma(\alpha)) + (\alpha - 1) \log(y) - \beta y\\ & & \mathrm{where} \; y > 0 \f} * @param y A scalar variable. * @param alpha Shape parameter. * @param beta Inverse scale parameter. * @throw std::domain_error if alpha is not greater than 0. * @throw std::domain_error if beta is not greater than 0. * @throw std::domain_error if y is not greater than or equal to 0. * @tparam T_y Type of scalar. * @tparam T_shape Type of shape. * @tparam T_inv_scale Type of inverse scale. */ template <bool propto, typename T_y, typename T_shape, typename T_inv_scale> typename return_type<T_y, T_shape, T_inv_scale>::type gamma_lpdf(const T_y& y, const T_shape& alpha, const T_inv_scale& beta) { static const char* function("gamma_lpdf"); typedef typename stan::partials_return_type<T_y, T_shape, T_inv_scale>::type T_partials_return; using stan::is_constant_struct; if (!(stan::length(y) && stan::length(alpha) && stan::length(beta))) return 0.0; T_partials_return logp(0.0); check_not_nan(function, "Random variable", y); check_positive_finite(function, "Shape parameter", alpha); check_positive_finite(function, "Inverse scale parameter", beta); check_consistent_sizes(function, "Random variable", y, "Shape parameter", alpha, "Inverse scale parameter", beta); if (!include_summand<propto, T_y, T_shape, T_inv_scale>::value) return 0.0; scalar_seq_view<T_y> y_vec(y); scalar_seq_view<T_shape> alpha_vec(alpha); scalar_seq_view<T_inv_scale> beta_vec(beta); for (size_t n = 0; n < length(y); n++) { const T_partials_return y_dbl = value_of(y_vec[n]); if (y_dbl < 0) return LOG_ZERO; } size_t N = max_size(y, alpha, beta); operands_and_partials<T_y, T_shape, T_inv_scale> ops_partials(y, alpha, beta); using boost::math::lgamma; using boost::math::digamma; using std::log; VectorBuilder<include_summand<propto, T_y, T_shape>::value, T_partials_return, T_y> log_y(length(y)); if (include_summand<propto, T_y, T_shape>::value) { for (size_t n = 0; n < length(y); n++) { if (value_of(y_vec[n]) > 0) log_y[n] = log(value_of(y_vec[n])); } } VectorBuilder<include_summand<propto, T_shape>::value, T_partials_return, T_shape> lgamma_alpha(length(alpha)); VectorBuilder<!is_constant_struct<T_shape>::value, T_partials_return, T_shape> digamma_alpha(length(alpha)); for (size_t n = 0; n < length(alpha); n++) { if (include_summand<propto, T_shape>::value) lgamma_alpha[n] = lgamma(value_of(alpha_vec[n])); if (!is_constant_struct<T_shape>::value) digamma_alpha[n] = digamma(value_of(alpha_vec[n])); } VectorBuilder<include_summand<propto, T_shape, T_inv_scale>::value, T_partials_return, T_inv_scale> log_beta(length(beta)); if (include_summand<propto, T_shape, T_inv_scale>::value) { for (size_t n = 0; n < length(beta); n++) log_beta[n] = log(value_of(beta_vec[n])); } for (size_t n = 0; n < N; n++) { const T_partials_return y_dbl = value_of(y_vec[n]); const T_partials_return alpha_dbl = value_of(alpha_vec[n]); const T_partials_return beta_dbl = value_of(beta_vec[n]); if (include_summand<propto, T_shape>::value) logp -= lgamma_alpha[n]; if (include_summand<propto, T_shape, T_inv_scale>::value) logp += alpha_dbl * log_beta[n]; if (include_summand<propto, T_y, T_shape>::value) logp += (alpha_dbl - 1.0) * log_y[n]; if (include_summand<propto, T_y, T_inv_scale>::value) logp -= beta_dbl * y_dbl; if (!is_constant_struct<T_y>::value) ops_partials.edge1_.partials_[n] += (alpha_dbl - 1) / y_dbl - beta_dbl; if (!is_constant_struct<T_shape>::value) ops_partials.edge2_.partials_[n] += -digamma_alpha[n] + log_beta[n] + log_y[n]; if (!is_constant_struct<T_inv_scale>::value) ops_partials.edge3_.partials_[n] += alpha_dbl / beta_dbl - y_dbl; } return ops_partials.build(logp); } template <typename T_y, typename T_shape, typename T_inv_scale> inline typename return_type<T_y, T_shape, T_inv_scale>::type gamma_lpdf(const T_y& y, const T_shape& alpha, const T_inv_scale& beta) { return gamma_lpdf<false>(y, alpha, beta); } } } #endif
[ "ohc3807@gmail.com" ]
ohc3807@gmail.com
6ccc8dfce33db2ef24943ed53b85a25edcc466fe
4d440b0b3393d7e087039cd51412a22b37072a33
/src/nnet3/nnet-compute-test.cc
ab0411206c6b01c769d7368566ce945f7a887c4b
[ "Apache-2.0", "LicenseRef-scancode-public-domain" ]
permissive
MistSC/kaldi-trunk
cca6c800055f906d7bc479c05cbb734430630ac1
aa9a8143e0fee12d85562ccc1d06e0e99f630029
refs/heads/master
2021-01-17T22:02:16.698728
2016-07-08T10:02:55
2016-07-08T10:02:55
54,094,863
1
0
null
null
null
null
UTF-8
C++
false
false
4,634
cc
// nnet3/nnet-compute-test.cc // Copyright 2015 Johns Hopkins University (author: Daniel Povey) // See ../../COPYING for clarification regarding multiple authors // // 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 // // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // See the Apache 2 License for the specific language governing permissions and // limitations under the License. #include "nnet3/nnet-nnet.h" #include "nnet3/nnet-compile.h" #include "nnet3/nnet-analyze.h" #include "nnet3/nnet-test-utils.h" #include "nnet3/nnet-optimize.h" #include "nnet3/nnet-compute.h" namespace kaldi { namespace nnet3 { void TestNnetDecodable(const ComputationRequest &request, const std::vector<Matrix<BaseFloat> > &inputs, const Nnet &nnet, const CuMatrixBase<BaseFloat> &reference_output) { // DecodableAmNnetSimpleOptions opts; // This is a placeholder for where we'll eventually test either the decodable // object or something similar to it (e.g. a base class) } void UnitTestNnetCompute() { for (int32 n = 0; n < 20; n++) { struct NnetGenerationOptions gen_config; std::vector<std::string> configs; GenerateConfigSequence(gen_config, &configs); Nnet nnet; for (size_t j = 0; j < configs.size(); j++) { KALDI_LOG << "Input config[" << j << "] is: " << configs[j]; std::istringstream is(configs[j]); nnet.ReadConfig(is); } ComputationRequest request; std::vector<Matrix<BaseFloat> > inputs; ComputeExampleComputationRequestSimple(nnet, &request, &inputs); NnetComputation computation; Compiler compiler(request, nnet); CompilerOptions opts; compiler.CreateComputation(opts, &computation); { std::ostringstream os; computation.Print(os, nnet); KALDI_LOG << "Generated computation is: " << os.str(); } CheckComputationOptions check_config; // we can do the rewrite check since it's before optimization. check_config.check_rewrite = true; ComputationChecker checker(check_config, nnet, computation); checker.Check(); if (RandInt(0, 1) == 0) { NnetOptimizeOptions opt_config; Optimize(opt_config, nnet, request, &computation); { std::ostringstream os; computation.Print(os, nnet); KALDI_LOG << "Optimized computation is: " << os.str(); } } NnetComputeOptions compute_opts; if (RandInt(0, 1) == 0) compute_opts.debug = true; computation.ComputeCudaIndexes(); NnetComputer computer(compute_opts, computation, nnet, &nnet); // provide the input to the computation. for (size_t i = 0; i < request.inputs.size(); i++) { CuMatrix<BaseFloat> temp(inputs[i]); KALDI_LOG << "Input sum is " << temp.Sum(); computer.AcceptInput(request.inputs[i].name, &temp); } computer.Forward(); const CuMatrixBase<BaseFloat> &output(computer.GetOutput("output")); TestNnetDecodable(request, inputs, nnet, output); KALDI_LOG << "Output sum is " << output.Sum(); CuMatrix<BaseFloat> output_deriv(output.NumRows(), output.NumCols()); output_deriv.SetRandn(); // output_deriv sum won't be informative so don't print it. if (request.outputs[0].has_deriv) computer.AcceptOutputDeriv("output", &output_deriv); computer.Backward(); for (size_t i = 0; i < request.inputs.size(); i++) { if (request.inputs[i].has_deriv) { const CuMatrixBase<BaseFloat> &in_deriv = computer.GetInputDeriv(request.inputs[i].name); KALDI_LOG << "Input-deriv sum for input '" << request.inputs[i].name << "' is " << in_deriv.Sum(); } } } } } // namespace nnet3 } // namespace kaldi int main() { using namespace kaldi; using namespace kaldi::nnet3; //SetVerboseLevel(2); for (kaldi::int32 loop = 0; loop < 2; loop++) { #if HAVE_CUDA == 1 if (loop == 0) CuDevice::Instantiate().SelectGpuId("no"); else CuDevice::Instantiate().SelectGpuId("yes"); #endif UnitTestNnetCompute(); } KALDI_LOG << "Nnet tests succeeded."; return 0; }
[ "shenchensccs@gmail.com" ]
shenchensccs@gmail.com
eed82fd6809586cde9767be7bb96361b38f7fa49
15eb185e990074d5b8eec7e41a4a1fdcdc3ad0d2
/hub4com/plugins/serial/comport.cpp
f6f5a6d4ad4df617249c86f411583e390f4db192
[]
no_license
rtigithub/com0com
7268cafe40b9f9955719e82b17ada2addad44c3e
da14c4461ea0d047fcadef0b761635378b4eb856
refs/heads/master
2022-02-15T03:57:49.542332
2012-06-18T07:32:13
2012-06-18T07:32:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
32,207
cpp
/* * $Id$ * * Copyright (c) 2006-2011 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * $Log$ * Revision 1.26 2011/05/19 16:46:59 vfrolov * Fixed unexpected assertion * Added human readable printing output options set * * Revision 1.25 2010/09/14 16:31:50 vfrolov * Implemented --write-limit=0 to disable writing to the port * * Revision 1.24 2008/12/22 09:40:46 vfrolov * Optimized message switching * * Revision 1.23 2008/12/18 16:50:52 vfrolov * Extended the number of possible IN options * * Revision 1.22 2008/12/17 11:52:35 vfrolov * Replaced ComIo::dcb by serialBaudRate, serialLineControl, * serialHandFlow and serialChars * Replaced ComPort::filterX by ComIo::FilterX() * Replaced SetManual*() by PinStateControlMask() * * Revision 1.21 2008/12/11 13:07:54 vfrolov * Added PURGE_TX * * Revision 1.20 2008/12/01 17:06:29 vfrolov * Improved write buffering * * Revision 1.19 2008/11/27 16:25:08 vfrolov * Improved write buffering * * Revision 1.18 2008/11/27 13:44:52 vfrolov * Added --write-limit option * * Revision 1.17 2008/11/24 16:30:56 vfrolov * Removed pOnXoffXon * * Revision 1.16 2008/11/24 12:37:00 vfrolov * Changed plugin API * * Revision 1.15 2008/11/13 07:35:10 vfrolov * Changed for staticaly linking * * Revision 1.14 2008/10/22 08:27:26 vfrolov * Added ability to set bytesize, parity and stopbits separately * * Revision 1.13 2008/10/16 16:04:39 vfrolov * Added LBR_STATUS and LLC_STATUS * * Revision 1.12 2008/09/30 08:28:32 vfrolov * Added ability to control OUT1 and OUT2 pins * Added ability to get remote baud rate and line control settings * Added ability to set baud rate and line control * Added fallback to non escape mode * * Revision 1.11 2008/08/29 13:02:37 vfrolov * Added ESC_OPTS_MAP_EO2GO() and ESC_OPTS_MAP_GO2EO() * * Revision 1.10 2008/08/28 16:07:09 vfrolov * Tracing of HUB_MSG_TYPE_SET_PIN_STATE moved to the trace filter * * Revision 1.9 2008/08/22 16:57:12 vfrolov * Added * HUB_MSG_TYPE_GET_ESC_OPTS * HUB_MSG_TYPE_FAIL_ESC_OPTS * HUB_MSG_TYPE_BREAK_STATUS * * Revision 1.8 2008/08/22 12:45:34 vfrolov * Added masking to HUB_MSG_TYPE_MODEM_STATUS and HUB_MSG_TYPE_LINE_STATUS * * Revision 1.7 2008/08/20 14:30:19 vfrolov * Redesigned serial port options * * Revision 1.6 2008/08/15 12:44:59 vfrolov * Added fake read filter method to ports * * Revision 1.5 2008/08/13 15:14:02 vfrolov * Print bit values in readable form * * Revision 1.4 2008/08/11 07:15:34 vfrolov * Replaced * HUB_MSG_TYPE_COM_FUNCTION * HUB_MSG_TYPE_INIT_LSR_MASK * HUB_MSG_TYPE_INIT_MST_MASK * by * HUB_MSG_TYPE_SET_PIN_STATE * HUB_MSG_TYPE_GET_OPTIONS * HUB_MSG_TYPE_SET_OPTIONS * * Revision 1.3 2008/04/11 14:48:42 vfrolov * Replaced SET_RT_EVENTS by INIT_LSR_MASK and INIT_MST_MASK * Replaced COM_ERRORS by LINE_STATUS * * Revision 1.2 2008/04/07 12:28:03 vfrolov * Replaced --rt-events option by SET_RT_EVENTS message * * Revision 1.1 2008/03/26 08:44:34 vfrolov * Redesigned for using plugins * * Revision 1.4 2007/04/16 07:33:38 vfrolov * Fixed LostReport() * * Revision 1.3 2007/02/06 11:53:33 vfrolov * Added options --odsr, --ox, --ix and --idsr * Added communications error reporting * * Revision 1.2 2007/02/05 09:33:20 vfrolov * Implemented internal flow control * * Revision 1.1 2007/01/23 09:13:10 vfrolov * Initial revision * */ #include "precomp.h" #include "../plugins_api.h" /////////////////////////////////////////////////////////////// namespace PortSerial { /////////////////////////////////////////////////////////////// #include "comport.h" #include "comio.h" #include "comparams.h" #include "import.h" /////////////////////////////////////////////////////////////// struct FIELD2NAME { DWORD field; DWORD mask; const char *name; }; #define TOFIELD2NAME2(p, s) { (ULONG)p##s, (ULONG)p##s, #s } static BOOL PrintFields( ostream &tout, const FIELD2NAME *pTable, DWORD fields, BOOL delimitNext = FALSE, const char *pUnknownPrefix = "", const char *pDelimiter = "|") { if (pTable) { while (pTable->name) { DWORD field = (fields & pTable->mask); if (field == pTable->field) { fields &= ~pTable->mask; if (delimitNext) tout << pDelimiter; else delimitNext = TRUE; tout << pTable->name; } pTable++; } } if (fields) { if (delimitNext) tout << pDelimiter; else delimitNext = TRUE; tout << pUnknownPrefix << "0x" << hex << fields << dec; } return delimitNext; } /////////////////////////////////////////////////////////////// static const FIELD2NAME fieldNameTableModemStatus[] = { TOFIELD2NAME2(MODEM_STATUS_, DCTS), TOFIELD2NAME2(MODEM_STATUS_, DDSR), TOFIELD2NAME2(MODEM_STATUS_, TERI), TOFIELD2NAME2(MODEM_STATUS_, DDCD), TOFIELD2NAME2(MODEM_STATUS_, CTS), TOFIELD2NAME2(MODEM_STATUS_, DSR), TOFIELD2NAME2(MODEM_STATUS_, RI), TOFIELD2NAME2(MODEM_STATUS_, DCD), {0, 0, NULL} }; /////////////////////////////////////////////////////////////// static const FIELD2NAME fieldNameTableLineStatus[] = { TOFIELD2NAME2(LINE_STATUS_, DR), TOFIELD2NAME2(LINE_STATUS_, OE), TOFIELD2NAME2(LINE_STATUS_, PE), TOFIELD2NAME2(LINE_STATUS_, FE), TOFIELD2NAME2(LINE_STATUS_, BI), TOFIELD2NAME2(LINE_STATUS_, THRE), TOFIELD2NAME2(LINE_STATUS_, TEMT), TOFIELD2NAME2(LINE_STATUS_, FIFOERR), {0, 0, NULL} }; /////////////////////////////////////////////////////////////// static const FIELD2NAME fieldNameTableGo0Options[] = { TOFIELD2NAME2(GO0_, LBR_STATUS), TOFIELD2NAME2(GO0_, LLC_STATUS), TOFIELD2NAME2(GO0_, ESCAPE_MODE), {0, 0, NULL} }; /////////////////////////////////////////////////////////////// static const FIELD2NAME fieldNameTableGo1Options[] = { TOFIELD2NAME2(GO1_, RBR_STATUS), TOFIELD2NAME2(GO1_, RLC_STATUS), TOFIELD2NAME2(GO1_, BREAK_STATUS), {0, 0, NULL} }; /////////////////////////////////////////////////////////////// static const FIELD2NAME fieldNameTableSetPinState[] = { TOFIELD2NAME2(PIN_STATE_, RTS), TOFIELD2NAME2(PIN_STATE_, DTR), TOFIELD2NAME2(PIN_STATE_, OUT1), TOFIELD2NAME2(PIN_STATE_, OUT2), TOFIELD2NAME2(PIN_STATE_, CTS), TOFIELD2NAME2(PIN_STATE_, DSR), TOFIELD2NAME2(PIN_STATE_, RI), TOFIELD2NAME2(PIN_STATE_, DCD), TOFIELD2NAME2(PIN_STATE_, BREAK), {0, 0, NULL} }; /////////////////////////////////////////////////////////////// static const FIELD2NAME fieldNameTableSoOptions[] = { TOFIELD2NAME2(SO_, SET_BR), TOFIELD2NAME2(SO_, SET_LC), {0, 0, NULL} }; /////////////////////////////////////////////////////////////// static const FIELD2NAME fieldNameTableComEvents[] = { TOFIELD2NAME2(EV_, CTS), TOFIELD2NAME2(EV_, DSR), TOFIELD2NAME2(EV_, RLSD), TOFIELD2NAME2(EV_, RING), {0, 0, NULL} }; /////////////////////////////////////////////////////////////// static const FIELD2NAME fieldNameTableCommErrors[] = { TOFIELD2NAME2(CE_, RXOVER), TOFIELD2NAME2(CE_, OVERRUN), TOFIELD2NAME2(CE_, RXPARITY), TOFIELD2NAME2(CE_, FRAME), TOFIELD2NAME2(CE_, BREAK), TOFIELD2NAME2(CE_, TXFULL), {0, 0, NULL} }; /////////////////////////////////////////////////////////////// static BOOL PrintGoOptions( ostream &tout, DWORD fields, BOOL delimitNext = FALSE) { int iGo = GO_O2I(fields); fields &= ~GO_I2O(-1); const FIELD2NAME *pTable; switch (iGo) { case 0: pTable = fieldNameTableGo0Options; break; case 1: delimitNext = PrintFields(tout, fieldNameTableModemStatus, GO1_O2V_MODEM_STATUS(fields), delimitNext, "MST_"); delimitNext = PrintFields(tout, fieldNameTableLineStatus, GO1_O2V_LINE_STATUS(fields), delimitNext, "LSR_"); fields &= ~(GO1_V2O_MODEM_STATUS(-1) | GO1_V2O_LINE_STATUS(-1)); pTable = fieldNameTableGo1Options; break; default: pTable = NULL; } stringstream buf; buf << "GO" << iGo << "_"; delimitNext = PrintFields(tout, pTable, fields, delimitNext, buf.str().c_str()); return delimitNext; } /////////////////////////////////////////////////////////////// static BOOL PrintEscOptions( ostream &tout, DWORD fields, BOOL delimitNext = FALSE) { PrintGoOptions(tout, ESC_OPTS_MAP_EO_2_GO1(fields) | GO_I2O(1), delimitNext); PrintFields(tout, NULL, fields & ~ESC_OPTS_MAP_GO1_2_EO(-1), delimitNext); return delimitNext; } /////////////////////////////////////////////////////////////// ComPort::ComPort( const ComParams &comParams, const char *pPath) : hMasterPort(NULL) , countReadOverlapped(0) , countWaitCommEventOverlapped(0) , countXoff(0) , escapeOptions(0) , outOptions(0) #ifdef _DEBUG , outOptionsRequested(0) #endif , connectionCounter(0) , connectSent(FALSE) , permanent(comParams.ShareMode() == 0) , writeQueueLimit(comParams.WriteQueueLimit()) , writeQueueLimitSendXoff((writeQueueLimit*2)/3) , writeQueueLimitSendXon(writeQueueLimit/3) , writeQueued(0) , writeSuspended(FALSE) , writeLost(0) , writeLostTotal(0) , errors(0) , pWriteBuf(NULL) , lenWriteBuf(0) { pComIo = new ComIo(*this, pPath); if (!pComIo) { cerr << "No enough memory." << endl; exit(2); } name = pComIo->Path().substr(pComIo->Path().rfind('\\') + 1); for (int iO = 0 ; iO < 2 ; iO++) { intercepted_options[iO] = 0; inOptions[iO] = 0; } for (int i = 0 ; i < 3 ; i++) { _ASSERTE(pComIo != NULL); WriteOverlapped *pOverlapped = new WriteOverlapped(*pComIo); if (!pOverlapped) { cerr << "No enough memory." << endl; exit(2); } writeOverlappedBuf.push(pOverlapped); } pComIo->Open(comParams); } BOOL ComPort::Init(HMASTERPORT _hMasterPort) { _ASSERTE(pComIo != NULL); if (pComIo->Handle() == INVALID_HANDLE_VALUE) { cerr << "ComPort::Init(): Invalid handle" << endl; return FALSE; } hMasterPort = _hMasterPort; return TRUE; } void ComPort::Update() { if ((permanent || connectionCounter > 0) && pComIo->Handle() == INVALID_HANDLE_VALUE) { if (pComIo->Open()) Start(FALSE); return; } if (!permanent && connectionCounter <= 0) { pComIo->Close(); if (connectSent) { connectSent = FALSE; HUB_MSG msg; msg.type = HUB_MSG_TYPE_CONNECT; msg.u.val = FALSE; pOnRead(hMasterPort, &msg); } } } BOOL ComPort::Start() { return Start(true); } BOOL ComPort::Start(BOOL first) { //cout << name << " Start " << ::GetCurrentThreadId() << endl; _ASSERTE(hMasterPort != NULL); _ASSERTE(pComIo != NULL); if (!first && !permanent && connectionCounter <= 0) { pComIo->Close(); return TRUE; } _ASSERTE(pComIo->Handle() != INVALID_HANDLE_VALUE || (!first && !permanent)); if (pComIo->Handle() == INVALID_HANDLE_VALUE) { cerr << name << " ComPort::Start(" << first << "): Invalid handle" << endl; return FALSE; } BYTE *pBuf = NULL; DWORD done = 0; HUB_MSG msg; if (!first) { UpdateOutOptions(outOptions); _ASSERTE((inOptions[0] & GO0_ESCAPE_MODE) == 0 || (escapeOptions & ~ESC_OPTS_V2O_ESCCHAR(-1)) != 0); if (inOptions[0] & GO0_ESCAPE_MODE) { DWORD failEscapeOptions = pComIo->SetEscMode(escapeOptions, &pBuf, &done); if (failEscapeOptions & ESC_OPTS_V2O_ESCCHAR(-1)) { cerr << name << " " "ComPort::Start(" << first << "): " "The escape mode rejected by driver" << endl; pComIo->Close(); pBufFree(pBuf); return FALSE; } if (failEscapeOptions & ~ESC_OPTS_V2O_ESCCHAR(-1)) { cerr << name << " " "ComPort::Start(" << first << "): " "requested escape mode input option(s) ["; PrintEscOptions(cerr, failEscapeOptions & ~ESC_OPTS_V2O_ESCCHAR(-1)); cerr << "] will be ignored by driver (possible serial driver was replaced)" << endl; } } } else if (intercepted_options[0] & GO0_ESCAPE_MODE) { _ASSERTE(escapeOptions == 0); _ASSERTE((inOptions[0] & GO0_ESCAPE_MODE) == 0); msg.type = HUB_MSG_TYPE_GET_ESC_OPTS; msg.u.pv.pVal = &escapeOptions; msg.u.pv.val = 0; pOnRead(hMasterPort, &msg); DWORD failEscapeOptions = pComIo->SetEscMode(escapeOptions, &pBuf, &done); if ((failEscapeOptions & ESC_OPTS_V2O_ESCCHAR(-1)) == 0) { inOptions[0] |= GO0_ESCAPE_MODE; escapeOptions &= ~failEscapeOptions; _ASSERTE((escapeOptions & ~ESC_OPTS_V2O_ESCCHAR(-1)) != 0); } if (failEscapeOptions & ~ESC_OPTS_V2O_ESCCHAR(-1)) { DWORD options_GO1 = 0; msg.type = HUB_MSG_TYPE_FAIL_ESC_OPTS; msg.u.pv.pVal = &options_GO1; msg.u.pv.val = failEscapeOptions; pOnRead(hMasterPort, &msg); intercepted_options[1] |= (options_GO1 & ~GO_I2O(-1)); cerr << name << " " "WARNING: " "The escape mode " << (((failEscapeOptions & ESC_OPTS_V2O_ESCCHAR(-1)) == 0) ? "enabled but " : "disabled and ") << "requested escape mode input option(s) ["; PrintEscOptions(cerr, failEscapeOptions & ~ESC_OPTS_V2O_ESCCHAR(-1)); cerr << "] rejected by driver"; if (options_GO1 & ~GO_I2O(-1)) { cerr << ". " "Instead them requested non escape mode input option(s) ["; PrintGoOptions(cerr, (options_GO1 & ~GO_I2O(-1)) | GO_I2O(1)); cerr << "]"; } cerr << endl; } } if (first) { for (int iO = 0 ; iO < 2 ; iO++) { inOptions[iO] |= ( intercepted_options[iO] & ( iO == 0 ? ( GO0_LBR_STATUS|GO0_LLC_STATUS ) : ( GO1_RBR_STATUS|GO1_RLC_STATUS | GO1_V2O_MODEM_STATUS( MODEM_STATUS_CTS | MODEM_STATUS_DSR | MODEM_STATUS_DCD | MODEM_STATUS_RI ) ) ) ); DWORD fail_options = (intercepted_options[iO] & ~inOptions[iO]); _ASSERTE((fail_options & GO_I2O(-1)) == 0); if (fail_options) { cerr << name << " WARNING: Requested input option(s) ["; PrintGoOptions(cerr, (fail_options & ~GO_I2O(-1)) | GO_I2O(iO == 0 ? 0 : 1)); cerr << "] will be ignored by driver" << endl; } msg.type = HUB_MSG_TYPE_FAIL_IN_OPTS; msg.u.val = (fail_options & ~GO_I2O(-1)) | GO_I2O(iO == 0 ? 0 : 1); pOnRead(hMasterPort, &msg); } if (inOptions[1] & GO1_RBR_STATUS) cerr << name << " WARNING: Suppose remote baud rate is equal local settings" << endl; if (inOptions[1] & GO1_RLC_STATUS) cerr << name << " WARNING: Suppose remote byte size, parity and stop bits are equal local settings" << endl; } if (inOptions[1] & GO1_V2O_MODEM_STATUS( MODEM_STATUS_CTS | MODEM_STATUS_DSR | MODEM_STATUS_DCD | MODEM_STATUS_RI)) { DWORD events = 0; if (inOptions[1] & GO1_V2O_MODEM_STATUS(MODEM_STATUS_CTS)) events |= EV_CTS; if (inOptions[1] & GO1_V2O_MODEM_STATUS(MODEM_STATUS_DSR)) events |= EV_DSR; if (inOptions[1] & GO1_V2O_MODEM_STATUS(MODEM_STATUS_DCD)) events |= EV_RLSD; if (inOptions[1] & GO1_V2O_MODEM_STATUS(MODEM_STATUS_RI)) events |= EV_RING; if (!first) { if (!pComIo->SetComEvents(&events) || !StartWaitCommEvent()) { cerr << name << " WARNING: Event(s) ["; PrintFields(cerr, fieldNameTableComEvents, events); cerr << "] will be ignored by driver" << endl; } } else { if (!pComIo->SetComEvents(&events) || !StartWaitCommEvent()) { pComIo->Close(); pBufFree(pBuf); return FALSE; } cout << name << " Event(s) ["; PrintFields(cout, fieldNameTableComEvents, events); cout << "] will be monitored" << endl; } } if (!permanent && connectionCounter <= 0) { pComIo->Close(); pBufFree(pBuf); return TRUE; } if (countXoff <= 0) { if (!StartRead()) { pComIo->Close(); pBufFree(pBuf); return FALSE; } } if (!connectSent) { connectSent = TRUE; msg.type = HUB_MSG_TYPE_CONNECT; msg.u.val = TRUE; pOnRead(hMasterPort, &msg); } if (inOptions[0] & GO0_LBR_STATUS) { msg.type = HUB_MSG_TYPE_LBR_STATUS; msg.u.val = pComIo->BaudRate(); pOnRead(hMasterPort, &msg); } if (inOptions[0] & GO0_LLC_STATUS) { msg.type = HUB_MSG_TYPE_LLC_STATUS; msg.u.val = pComIo->LineControl(); pOnRead(hMasterPort, &msg); } if (inOptions[1] & GO1_RBR_STATUS) { msg.type = HUB_MSG_TYPE_RBR_STATUS; msg.u.val = pComIo->BaudRate(); pOnRead(hMasterPort, &msg); } if (inOptions[1] & GO1_RLC_STATUS) { msg.type = HUB_MSG_TYPE_RLC_STATUS; msg.u.val = pComIo->LineControl(); pOnRead(hMasterPort, &msg); } if (pBuf) { msg.type = HUB_MSG_TYPE_LINE_DATA; msg.u.buf.pBuf = pBuf; msg.u.buf.size = done; pOnRead(hMasterPort, &msg); } CheckComEvents(DWORD(-1)); return TRUE; } BOOL ComPort::StartRead() { if (countReadOverlapped) return TRUE; _ASSERTE(pComIo != NULL); _ASSERTE(pComIo->Handle() != INVALID_HANDLE_VALUE); ReadOverlapped *pOverlapped; pOverlapped = new ReadOverlapped(*pComIo); if (!pOverlapped) return FALSE; if (!pOverlapped->StartRead()) { delete pOverlapped; return FALSE; } countReadOverlapped++; //cout << name << " Started Read " << countReadOverlapped << endl; return TRUE; } BOOL ComPort::FakeReadFilter(HUB_MSG *pInMsg) { _ASSERTE(pInMsg != NULL); switch (HUB_MSG_T2N(pInMsg->type)) { case HUB_MSG_T2N(HUB_MSG_TYPE_GET_IN_OPTS): { int iGo = GO_O2I(pInMsg->u.pv.val); if (iGo != 0 && iGo != 1) break; // get interceptable options from subsequent filters separately DWORD interceptable_options = ( pInMsg->u.pv.val & ( iGo == 0 ? ( GO0_ESCAPE_MODE|GO0_LBR_STATUS|GO0_LLC_STATUS ) : ( GO1_RBR_STATUS|GO1_RLC_STATUS|GO1_BREAK_STATUS | GO1_V2O_MODEM_STATUS(-1) | GO1_V2O_LINE_STATUS(-1) ) ) ); pInMsg->u.pv.val &= ~interceptable_options; pInMsg = pMsgInsertNone(pInMsg, HUB_MSG_TYPE_EMPTY); if (pInMsg) { pInMsg->type = HUB_MSG_TYPE_GET_IN_OPTS; pInMsg->u.pv.pVal = &intercepted_options[iGo == 0 ? 0 : 1]; pInMsg->u.pv.val = (interceptable_options & ~GO_I2O(-1)) | GO_I2O(iGo); } break; } } return pInMsg != NULL; } void ComPort::FlowControlUpdate() { if (writeSuspended) { if (writeQueued <= writeQueueLimitSendXon) { writeSuspended = FALSE; HUB_MSG msg; msg.type = HUB_MSG_TYPE_ADD_XOFF_XON; msg.u.val = FALSE; pOnRead(hMasterPort, &msg); } } else { if (writeQueued > writeQueueLimitSendXoff) { writeSuspended = TRUE; HUB_MSG msg; msg.type = HUB_MSG_TYPE_ADD_XOFF_XON; msg.u.val = TRUE; pOnRead(hMasterPort, &msg); } } } void ComPort::PurgeWrite(BOOL withLost) { _ASSERTE(pComIo != NULL); if (pComIo->Handle() != INVALID_HANDLE_VALUE) pComIo->PurgeWrite(); if (lenWriteBuf) { _ASSERTE(pWriteBuf != NULL); if (withLost) writeLost += lenWriteBuf; _ASSERTE(writeQueued >= lenWriteBuf); writeQueued -= lenWriteBuf; lenWriteBuf = 0; pBufFree(pWriteBuf); pWriteBuf = NULL; } if (!withLost) { _ASSERTE(writeLost >= writeQueued); writeLost -= writeQueued; // compensate } } void ComPort::FilterX(BYTE *pBuf, DWORD &len) { _ASSERTE(pComIo != NULL); _ASSERTE(pComIo->Handle() != INVALID_HANDLE_VALUE); BYTE xOn; BYTE xOff; if (pComIo->FilterX(xOn, xOff)) { BYTE *pSrc = pBuf; BYTE *pDst = pBuf; for (DWORD i = 0 ; i < len ; i++) { if (*pSrc == xOn || *pSrc == xOff) { pSrc++; writeLost++; } else { *pDst++ = *pSrc++; } } len = DWORD(pDst - pBuf); } } void ComPort::UpdateOutOptions(DWORD options) { WORD controlMask = pComIo->PinStateControlMask(); if (options & SO_V2O_PIN_STATE(PIN_STATE_RTS)) { if (controlMask & PIN_STATE_RTS) outOptions |= SO_V2O_PIN_STATE(PIN_STATE_RTS); else outOptions &= ~SO_V2O_PIN_STATE(PIN_STATE_RTS); } if (options & SO_V2O_PIN_STATE(PIN_STATE_DTR)) { if (controlMask & PIN_STATE_DTR) outOptions |= SO_V2O_PIN_STATE(PIN_STATE_DTR); else outOptions &= ~SO_V2O_PIN_STATE(PIN_STATE_DTR); } if (options & SO_V2O_PIN_STATE(PIN_STATE_OUT1)) { if (controlMask & PIN_STATE_OUT1) outOptions |= SO_V2O_PIN_STATE(PIN_STATE_OUT1); else outOptions &= ~SO_V2O_PIN_STATE(PIN_STATE_OUT1); } if (options & SO_V2O_PIN_STATE(PIN_STATE_OUT2)) { if (controlMask & PIN_STATE_OUT2) outOptions |= SO_V2O_PIN_STATE(PIN_STATE_OUT2); else outOptions &= ~SO_V2O_PIN_STATE(PIN_STATE_OUT2); } outOptions |= options & ( SO_V2O_PIN_STATE(PIN_STATE_BREAK) | SO_SET_BR | SO_SET_LC | SO_PURGE_TX); options &= ~outOptions; if (options) { cerr << name << " WARNING: Requested output option(s) ["; BOOL delimitNext = FALSE; delimitNext = PrintFields(cerr, fieldNameTableSetPinState, SO_O2V_PIN_STATE(options), delimitNext, "SET_"); PrintFields(cerr, fieldNameTableSoOptions, options & ~SO_V2O_PIN_STATE(-1), delimitNext); cerr << "] will be ignored by driver" << endl; } } BOOL ComPort::Write(HUB_MSG *pMsg) { _ASSERTE(pMsg != NULL); switch (HUB_MSG_T2N(pMsg->type)) { case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { if (!writeQueueLimit) return TRUE; DWORD len = pMsg->u.buf.size; if (!len) return TRUE; BYTE *pBuf = pMsg->u.buf.pBuf; if (!pBuf) { writeLost += len; return FALSE; } if (writeQueued > writeQueueLimit) PurgeWrite(TRUE); _ASSERTE(pComIo != NULL); if (pComIo->Handle() != INVALID_HANDLE_VALUE && writeOverlappedBuf.size()) { _ASSERTE(pWriteBuf == NULL); _ASSERTE(lenWriteBuf == 0); FilterX(pBuf, len); if (!len) return TRUE; WriteOverlapped *pOverlapped = writeOverlappedBuf.front(); _ASSERTE(pOverlapped != NULL); if (!pOverlapped->StartWrite(pBuf, len)) { writeLost += len; FlowControlUpdate(); return FALSE; } writeOverlappedBuf.pop(); pMsg->type = HUB_MSG_TYPE_EMPTY; // detach pBuf } else { _ASSERTE((pWriteBuf == NULL && lenWriteBuf == 0) || (pWriteBuf != NULL && lenWriteBuf != 0)); pBufAppend(&pWriteBuf, lenWriteBuf, pBuf, len); lenWriteBuf += len; } writeQueued += len; FlowControlUpdate(); //cout << name << " Started Write " << len << " " << writeQueued << endl; break; } case HUB_MSG_T2N(HUB_MSG_TYPE_CONNECT): { if (pMsg->u.val) { connectionCounter++; _ASSERTE(connectionCounter > 0); Update(); } else { _ASSERTE(connectionCounter > 0); connectionCounter--; Update(); } break; } case HUB_MSG_T2N(HUB_MSG_TYPE_SET_PIN_STATE): _ASSERTE((~SO_O2V_PIN_STATE(outOptionsRequested) & MASK2VAL(pMsg->u.val)) == 0); _ASSERTE(pComIo != NULL); pComIo->SetPinState((WORD)pMsg->u.val, SO_O2V_PIN_STATE(outOptions) & MASK2VAL(pMsg->u.val)); break; case HUB_MSG_T2N(HUB_MSG_TYPE_SET_BR): { _ASSERTE(outOptionsRequested & SO_SET_BR); _ASSERTE(pComIo != NULL); if ((outOptions & SO_SET_BR) == 0) break; DWORD oldVal = pComIo->BaudRate(); DWORD curVal = pComIo->SetBaudRate(pMsg->u.val); if (curVal != pMsg->u.val) { cerr << name << " WARNING: can't change" << " baud rate " << oldVal << " to " << pMsg->u.val << " (current=" << curVal << ")" << endl; } if (oldVal != curVal) { if (inOptions[0] & GO0_LBR_STATUS) { HUB_MSG msg; msg.type = HUB_MSG_TYPE_LBR_STATUS; msg.u.val = curVal; pOnRead(hMasterPort, &msg); } if (inOptions[1] & GO1_RBR_STATUS) { HUB_MSG msg; msg.type = HUB_MSG_TYPE_RBR_STATUS; msg.u.val = curVal; // suppose remote equal local pOnRead(hMasterPort, &msg); } } break; } case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LC): { _ASSERTE(outOptionsRequested & SO_SET_LC); _ASSERTE(pComIo != NULL); if ((outOptions & SO_SET_LC) == 0) break; DWORD oldVal = pComIo->LineControl(); DWORD curVal = pComIo->SetLineControl(pMsg->u.val); DWORD mask = (pMsg->u.val & (LC_MASK_BYTESIZE|LC_MASK_PARITY|LC_MASK_STOPBITS)); if (mask & LC_MASK_BYTESIZE) mask |= VAL2LC_BYTESIZE(-1); if (mask & LC_MASK_PARITY) mask |= VAL2LC_PARITY(-1); if (mask & LC_MASK_STOPBITS) mask |= VAL2LC_STOPBITS(-1); if ((curVal & mask) != (pMsg->u.val & mask)) { cerr << name << " WARNING: can't change" << hex << " line control 0x" << oldVal << " to 0x" << (pMsg->u.val | (oldVal & ~mask)) << " (current=0x" << curVal << ")" << dec << endl; } DWORD changes = (oldVal ^ curVal); if (changes) { if ((changes & (VAL2LC_BYTESIZE(-1)|LC_MASK_BYTESIZE)) == 0) curVal &= ~(VAL2LC_BYTESIZE(-1)|LC_MASK_BYTESIZE); if ((changes & (VAL2LC_PARITY(-1)|LC_MASK_PARITY)) == 0) curVal &= ~(VAL2LC_PARITY(-1)|LC_MASK_PARITY); if ((changes & (VAL2LC_STOPBITS(-1)|LC_MASK_STOPBITS)) == 0) curVal &= ~(VAL2LC_STOPBITS(-1)|LC_MASK_STOPBITS); if (inOptions[0] & GO0_LLC_STATUS) { HUB_MSG msg; msg.type = HUB_MSG_TYPE_LLC_STATUS; msg.u.val = curVal; pOnRead(hMasterPort, &msg); } if (inOptions[1] & GO1_RLC_STATUS) { HUB_MSG msg; msg.type = HUB_MSG_TYPE_RLC_STATUS; msg.u.val = curVal; // suppose remote equal local pOnRead(hMasterPort, &msg); } } break; } case HUB_MSG_T2N(HUB_MSG_TYPE_PURGE_TX): _ASSERTE(outOptionsRequested & SO_PURGE_TX); _ASSERTE(pComIo != NULL); if ((outOptions & SO_PURGE_TX) == 0) break; PurgeWrite(FALSE); FlowControlUpdate(); break; case HUB_MSG_T2N(HUB_MSG_TYPE_SET_OUT_OPTS): { _ASSERTE(pComIo != NULL); #ifdef _DEBUG outOptionsRequested |= pMsg->u.val; #endif pMsg->u.val &= ~outOptions; UpdateOutOptions(pMsg->u.val); pMsg->u.val &= ~outOptions; break; } case HUB_MSG_T2N(HUB_MSG_TYPE_ADD_XOFF_XON): if (pMsg->u.val) { countXoff++; } else { if (--countXoff == 0) { _ASSERTE(pComIo != NULL); if (pComIo->Handle() != INVALID_HANDLE_VALUE) StartRead(); } } break; } return TRUE; } BOOL ComPort::StartWaitCommEvent() { if (countWaitCommEventOverlapped) return TRUE; _ASSERTE(pComIo != NULL); if (pComIo->Handle() == INVALID_HANDLE_VALUE) return FALSE; WaitCommEventOverlapped *pOverlapped; pOverlapped = new WaitCommEventOverlapped(*pComIo); if (!pOverlapped) return FALSE; if (!pOverlapped->StartWaitCommEvent()) { pOverlapped->Delete(); return FALSE; } countWaitCommEventOverlapped++; return TRUE; } void ComPort::OnWrite(WriteOverlapped *pOverlapped, DWORD len, DWORD done) { //cout << name << " OnWrite " << ::GetCurrentThreadId() << " len=" << len << " done=" << done << " queued=" << writeQueued << endl; if (len > done) writeLost += len - done; _ASSERTE(writeQueued >= len); writeQueued -= len; _ASSERTE(pComIo != NULL); _ASSERTE(pWriteBuf != NULL || lenWriteBuf == 0); _ASSERTE(pWriteBuf == NULL || lenWriteBuf != 0); if (pComIo->Handle() != INVALID_HANDLE_VALUE && lenWriteBuf) { _ASSERTE(writeQueued >= lenWriteBuf); writeQueued -= lenWriteBuf; FilterX(pWriteBuf, lenWriteBuf); if (!lenWriteBuf || !pOverlapped->StartWrite(pWriteBuf, lenWriteBuf)) { writeOverlappedBuf.push(pOverlapped); writeLost += lenWriteBuf; pBufFree(pWriteBuf); } else { writeQueued += lenWriteBuf; } lenWriteBuf = 0; pWriteBuf = NULL; } else { writeOverlappedBuf.push(pOverlapped); } FlowControlUpdate(); } void ComPort::OnRead(ReadOverlapped *pOverlapped, BYTE *pBuf, DWORD done) { //cout << name << " OnRead " << ::GetCurrentThreadId() << endl; HUB_MSG msg; msg.type = HUB_MSG_TYPE_LINE_DATA; msg.u.buf.pBuf = pBuf; msg.u.buf.size = done; pOnRead(hMasterPort, &msg); if (pComIo->Handle() == INVALID_HANDLE_VALUE || countXoff > 0 || !pOverlapped->StartRead()) { delete pOverlapped; countReadOverlapped--; _ASSERTE(countReadOverlapped >= 0); if (countXoff <= 0) cout << name << " Stopped Read " << countReadOverlapped << endl; } } void ComPort::OnCommEvent(WaitCommEventOverlapped *pOverlapped, DWORD eMask) { cout << name << " OnCommEvent " << ::GetCurrentThreadId() << " ["; PrintFields(cout, fieldNameTableComEvents, eMask); cout << "]" << endl; CheckComEvents(eMask); if (pComIo->Handle() == INVALID_HANDLE_VALUE || !pOverlapped->StartWaitCommEvent()) { pOverlapped->Delete(); countWaitCommEventOverlapped--; _ASSERTE(countWaitCommEventOverlapped >= 0); cout << name << " Stopped WaitCommEvent " << countWaitCommEventOverlapped << endl; } } void ComPort::CheckComEvents(DWORD eMask) { _ASSERTE(pComIo != NULL); if (GO1_O2V_MODEM_STATUS(inOptions[1]) && (eMask & (EV_CTS|EV_DSR|EV_RLSD|EV_RING)) != 0) { DWORD stat = 0; if (pComIo->Handle() == INVALID_HANDLE_VALUE || ::GetCommModemStatus(pComIo->Handle(), &stat)) { HUB_MSG msg; msg.type = HUB_MSG_TYPE_MODEM_STATUS; msg.u.val = ((DWORD)(BYTE)stat | VAL2MASK(GO1_O2V_MODEM_STATUS(inOptions[1]))); pOnRead(hMasterPort, &msg); } } if (pComIo->Handle() != INVALID_HANDLE_VALUE && (eMask & (EV_BREAK|EV_ERR)) != 0) { DWORD errs; if (::ClearCommError(pComIo->Handle(), &errs, NULL)) errors |= errs; } } void ComPort::LostReport() { if (writeLost) { writeLostTotal += writeLost; cout << "Write lost " << name << ": " << writeLost << ", total " << writeLostTotal << endl; writeLost = 0; } CheckComEvents(EV_BREAK|EV_ERR); if (errors) { cout << "Error " << name << ": "; PrintFields(cout, fieldNameTableCommErrors, errors, FALSE, "", " "); errors = 0; _ASSERTE(pComIo != NULL); if (pComIo->Handle() != INVALID_HANDLE_VALUE) { #define IOCTL_SERIAL_GET_STATS CTL_CODE(FILE_DEVICE_SERIAL_PORT,35,METHOD_BUFFERED,FILE_ANY_ACCESS) typedef struct _SERIALPERF_STATS { ULONG ReceivedCount; ULONG TransmittedCount; ULONG FrameErrorCount; ULONG SerialOverrunErrorCount; ULONG BufferOverrunErrorCount; ULONG ParityErrorCount; } SERIALPERF_STATS, *PSERIALPERF_STATS; SERIALPERF_STATS stats; DWORD size; if (DeviceIoControl(pComIo->Handle(), IOCTL_SERIAL_GET_STATS, NULL, 0, &stats, sizeof(stats), &size, NULL)) { cout << ", total" << " RXOVER=" << stats.BufferOverrunErrorCount << " OVERRUN=" << stats.SerialOverrunErrorCount << " RXPARITY=" << stats.ParityErrorCount << " FRAME=" << stats.FrameErrorCount; } } cout << endl; } } /////////////////////////////////////////////////////////////// } // end namespace ///////////////////////////////////////////////////////////////
[ "" ]
f172bf7c08f1cd88fa53c8937aaee602b2f743df
ce3b36c49b7c80bf2c82403aae6ca68a7d04154e
/LabProjects/LabProject01/GraphicsPipeline.h
bde4c20ec0c14aacc9ef3ffa974dc567a1853d90
[]
no_license
JinbaeByeon/2020_3G_1T
2b41a60a5b70b08ccf53104d85f8173e8909f9a0
53a93262956c10323aabeac9c4dd654d1a5728e0
refs/heads/master
2021-05-18T18:44:56.195331
2020-07-03T13:58:16
2020-07-03T13:58:16
251,357,827
2
0
null
null
null
null
UTF-8
C++
false
false
477
h
#pragma once #include "GameObject.h" #include "Camera.h" class CGraphicsPipeline { private: static CGameObject* m_pGameObject; static CCamera* m_pCamera; public: static void SetGameObject(CGameObject* pGameObject) { m_pGameObject = pGameObject; } static void SetCamera(CCamera* pCamera) { m_pCamera = pCamera; } static XMVECTOR ScreenTransform(FXMVECTOR& v3Projection); static XMVECTOR Project(XMFLOAT3& f3Model); static XMVECTOR Transform(XMFLOAT3& f3Model); };
[ "quswlsqo@gmail.com" ]
quswlsqo@gmail.com
19eac7ecba404acf2fa9c6cb749c02b8d5e24f37
3ff1fe3888e34cd3576d91319bf0f08ca955940f
/tcss/include/tencentcloud/tcss/v20201101/model/DescribeEscapeEventInfoRequest.h
1dfa6b9f9a69fd1219312e4e4541a84a1c24c21c
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-cpp
9f5df8220eaaf72f7eaee07b2ede94f89313651f
42a76b812b81d1b52ec6a217fafc8faa135e06ca
refs/heads/master
2023-08-30T03:22:45.269556
2023-08-30T00:45:39
2023-08-30T00:45:39
188,991,963
55
37
Apache-2.0
2023-08-17T03:13:20
2019-05-28T08:56:08
C++
UTF-8
C++
false
false
6,619
h
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TENCENTCLOUD_TCSS_V20201101_MODEL_DESCRIBEESCAPEEVENTINFOREQUEST_H_ #define TENCENTCLOUD_TCSS_V20201101_MODEL_DESCRIBEESCAPEEVENTINFOREQUEST_H_ #include <string> #include <vector> #include <map> #include <tencentcloud/core/AbstractModel.h> #include <tencentcloud/tcss/v20201101/model/RunTimeFilters.h> namespace TencentCloud { namespace Tcss { namespace V20201101 { namespace Model { /** * DescribeEscapeEventInfo请求参数结构体 */ class DescribeEscapeEventInfoRequest : public AbstractModel { public: DescribeEscapeEventInfoRequest(); ~DescribeEscapeEventInfoRequest() = default; std::string ToJsonString() const; /** * 获取需要返回的数量,默认为10,最大值为100 * @return Limit 需要返回的数量,默认为10,最大值为100 * */ uint64_t GetLimit() const; /** * 设置需要返回的数量,默认为10,最大值为100 * @param _limit 需要返回的数量,默认为10,最大值为100 * */ void SetLimit(const uint64_t& _limit); /** * 判断参数 Limit 是否已赋值 * @return Limit 是否已赋值 * */ bool LimitHasBeenSet() const; /** * 获取偏移量,默认为0。 * @return Offset 偏移量,默认为0。 * */ uint64_t GetOffset() const; /** * 设置偏移量,默认为0。 * @param _offset 偏移量,默认为0。 * */ void SetOffset(const uint64_t& _offset); /** * 判断参数 Offset 是否已赋值 * @return Offset 是否已赋值 * */ bool OffsetHasBeenSet() const; /** * 获取过滤参数,Status:EVENT_UNDEAL:未处理,EVENT_DEALED:已处理,EVENT_INGNORE:忽略 * @return Filters 过滤参数,Status:EVENT_UNDEAL:未处理,EVENT_DEALED:已处理,EVENT_INGNORE:忽略 * */ std::vector<RunTimeFilters> GetFilters() const; /** * 设置过滤参数,Status:EVENT_UNDEAL:未处理,EVENT_DEALED:已处理,EVENT_INGNORE:忽略 * @param _filters 过滤参数,Status:EVENT_UNDEAL:未处理,EVENT_DEALED:已处理,EVENT_INGNORE:忽略 * */ void SetFilters(const std::vector<RunTimeFilters>& _filters); /** * 判断参数 Filters 是否已赋值 * @return Filters 是否已赋值 * */ bool FiltersHasBeenSet() const; /** * 获取升序降序,asc desc * @return Order 升序降序,asc desc * */ std::string GetOrder() const; /** * 设置升序降序,asc desc * @param _order 升序降序,asc desc * */ void SetOrder(const std::string& _order); /** * 判断参数 Order 是否已赋值 * @return Order 是否已赋值 * */ bool OrderHasBeenSet() const; /** * 获取排序字段 * @return By 排序字段 * */ std::string GetBy() const; /** * 设置排序字段 * @param _by 排序字段 * */ void SetBy(const std::string& _by); /** * 判断参数 By 是否已赋值 * @return By 是否已赋值 * */ bool ByHasBeenSet() const; private: /** * 需要返回的数量,默认为10,最大值为100 */ uint64_t m_limit; bool m_limitHasBeenSet; /** * 偏移量,默认为0。 */ uint64_t m_offset; bool m_offsetHasBeenSet; /** * 过滤参数,Status:EVENT_UNDEAL:未处理,EVENT_DEALED:已处理,EVENT_INGNORE:忽略 */ std::vector<RunTimeFilters> m_filters; bool m_filtersHasBeenSet; /** * 升序降序,asc desc */ std::string m_order; bool m_orderHasBeenSet; /** * 排序字段 */ std::string m_by; bool m_byHasBeenSet; }; } } } } #endif // !TENCENTCLOUD_TCSS_V20201101_MODEL_DESCRIBEESCAPEEVENTINFOREQUEST_H_
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
ad072ba963489f833927058cc178856464a544ee
c03797e575d003b21709caa0b3148b976fe5738a
/1116.cpp
05908ef9918c2ca41c3bd22bace7700fdc1fd388
[]
no_license
CJGC/Problems-URI-judge
cc38adfec7936edaf235db7c029618c3a2c5bbc7
3fba0b8d4adace131165bf8ca063bebec414f5d2
refs/heads/master
2020-03-28T14:43:57.822196
2018-09-12T18:00:12
2018-09-12T18:00:12
148,516,567
0
0
null
null
null
null
UTF-8
C++
false
false
373
cpp
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]){ int N; cin>> N; double values[2][N]; for(int i=0; i<N; i++) cin >> values[0][i] >> values[1][i]; for(int i=0; i<N; i++){ if(values[1][i] == 0){ cout<<"divisao impossivel"<<endl; continue;} cout<<fixed<<setprecision(1)<<values[0][i]/values[1][i]<<endl; } return 0; }
[ "chjugomez@utp.edu.co" ]
chjugomez@utp.edu.co
f3543060e355fc44326c2d00a0f224bca00db367
b3d5b6cc9c5c4a22b217b9411f8e5617b6ae01a1
/powerup.cpp
205cfa1dccc64a2be08f4599894b415cda27f712
[]
no_license
cowmanjoe/SFMLPong
9f4f4503992511a45fb4d79cff306e89aecddf6b
629b91218b2a0dfef15d0f3411be1e9a821f3af1
refs/heads/master
2021-01-21T10:19:44.256465
2017-05-08T06:09:50
2017-05-08T06:09:50
83,386,680
0
0
null
null
null
null
UTF-8
C++
false
false
619
cpp
#include "powerup.h" sf::Vector2f Powerup::getSize() { sf::IntRect sizeRect = getTextureRect(); return sf::Vector2f(sizeRect.width, sizeRect.height); } void Powerup::activate() { if (!activated) { setColor(sf::Color(255, 255, 255, 0)); timer = activeTime; activated = true; activateEffects(); } } void Powerup::deactivate() { if (activated) { deactivateEffects(); } finished = true; } void Powerup::update(sf::Time elapsed) { if (activated) { if (timer > 0) { timer -= elapsed.asSeconds(); } else { deactivate(); } } } bool Powerup::isActivated() { return activated; }
[ "ctcumming@gmail.com" ]
ctcumming@gmail.com
833b7a44af6398c8f6346e98637227e4be877ee6
b7dceccdd2c47c86f55de74c3021c07b0341ba50
/Engine/internal/physics/bullet/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
76c808ede7a7083ad077c848386ef86832a9812e
[ "Zlib" ]
permissive
OasisGallagher/Suede
a6d7c3ace34b7b41736f2cc5cb5fa1ec4ab7fe4f
b50fd4c36af4c2bd94f50f2545a5919226916a9e
refs/heads/master
2021-05-04T18:40:09.269280
2020-02-03T02:37:40
2020-02-03T02:37:40
120,184,251
0
0
null
null
null
null
UTF-8
C++
false
false
7,501
cpp
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "btContinuousConvexCollision.h" #include "internal/physics/bullet/BulletCollision/CollisionShapes/btConvexShape.h" #include "internal/physics/bullet/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h" #include "internal/physics/bullet/LinearMath/btTransformUtil.h" #include "internal/physics/bullet/BulletCollision/CollisionShapes/btSphereShape.h" #include "btGjkPairDetector.h" #include "btPointCollector.h" #include "internal/physics/bullet/BulletCollision/CollisionShapes/btStaticPlaneShape.h" btContinuousConvexCollision::btContinuousConvexCollision ( const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* penetrationDepthSolver) :m_simplexSolver(simplexSolver), m_penetrationDepthSolver(penetrationDepthSolver), m_convexA(convexA),m_convexB1(convexB),m_planeShape(0) { } btContinuousConvexCollision::btContinuousConvexCollision( const btConvexShape* convexA,const btStaticPlaneShape* plane) :m_simplexSolver(0), m_penetrationDepthSolver(0), m_convexA(convexA),m_convexB1(0),m_planeShape(plane) { } /// This maximum should not be necessary. It allows for untested/degenerate cases in production code. /// You don't want your game ever to lock-up. #define MAX_ITERATIONS 64 void btContinuousConvexCollision::computeClosestPoints( const btTransform& transA, const btTransform& transB,btPointCollector& pointCollector) { if (m_convexB1) { m_simplexSolver->reset(); btGjkPairDetector gjk(m_convexA,m_convexB1,m_convexA->getShapeType(),m_convexB1->getShapeType(),m_convexA->getMargin(),m_convexB1->getMargin(),m_simplexSolver,m_penetrationDepthSolver); btGjkPairDetector::ClosestPointInput input; input.m_transformA = transA; input.m_transformB = transB; gjk.getClosestPoints(input,pointCollector,0); } else { //convex versus plane const btConvexShape* convexShape = m_convexA; const btStaticPlaneShape* planeShape = m_planeShape; const btVector3& planeNormal = planeShape->getPlaneNormal(); const btScalar& planeConstant = planeShape->getPlaneConstant(); btTransform convexWorldTransform = transA; btTransform convexInPlaneTrans; convexInPlaneTrans= transB.inverse() * convexWorldTransform; btTransform planeInConvex; planeInConvex= convexWorldTransform.inverse() * transB; btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis()*-planeNormal); btVector3 vtxInPlane = convexInPlaneTrans(vtx); btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant); btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal; btVector3 vtxInPlaneWorld = transB * vtxInPlaneProjected; btVector3 normalOnSurfaceB = transB.getBasis() * planeNormal; pointCollector.addContactPoint( normalOnSurfaceB, vtxInPlaneWorld, distance); } } bool btContinuousConvexCollision::calcTimeOfImpact( const btTransform& fromA, const btTransform& toA, const btTransform& fromB, const btTransform& toB, CastResult& result) { /// compute linear and angular velocity for this interval, to interpolate btVector3 linVelA,angVelA,linVelB,angVelB; btTransformUtil::calculateVelocity(fromA,toA,btScalar(1.),linVelA,angVelA); btTransformUtil::calculateVelocity(fromB,toB,btScalar(1.),linVelB,angVelB); btScalar boundingRadiusA = m_convexA->getAngularMotionDisc(); btScalar boundingRadiusB = m_convexB1?m_convexB1->getAngularMotionDisc():0.f; btScalar maxAngularProjectedVelocity = angVelA.length() * boundingRadiusA + angVelB.length() * boundingRadiusB; btVector3 relLinVel = (linVelB-linVelA); btScalar relLinVelocLength = (linVelB-linVelA).length(); if ((relLinVelocLength+maxAngularProjectedVelocity) == 0.f) return false; btScalar lambda = btScalar(0.); btVector3 v(1,0,0); int maxIter = MAX_ITERATIONS; btVector3 n; n.setValue(btScalar(0.),btScalar(0.),btScalar(0.)); bool hasResult = false; btVector3 c; btScalar lastLambda = lambda; //btScalar epsilon = btScalar(0.001); int numIter = 0; //first solution, using GJK btScalar radius = 0.001f; // result.drawCoordSystem(sphereTr); btPointCollector pointCollector1; { computeClosestPoints(fromA,fromB,pointCollector1); hasResult = pointCollector1.m_hasResult; c = pointCollector1.m_pointInWorld; } if (hasResult) { btScalar dist; dist = pointCollector1.m_distance + result.m_allowedPenetration; n = pointCollector1.m_normalOnBInWorld; btScalar projectedLinearVelocity = relLinVel.dot(n); if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON) return false; //not close enough while (dist > radius) { if (result.m_debugDrawer) { result.m_debugDrawer->drawSphere(c,0.2f,btVector3(1,1,1)); } btScalar dLambda = btScalar(0.); projectedLinearVelocity = relLinVel.dot(n); //don't report time of impact for motion away from the contact normal (or causes minor penetration) if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON) return false; dLambda = dist / (projectedLinearVelocity+ maxAngularProjectedVelocity); lambda = lambda + dLambda; if (lambda > btScalar(1.)) return false; if (lambda < btScalar(0.)) return false; //todo: next check with relative epsilon if (lambda <= lastLambda) { return false; //n.setValue(0,0,0); break; } lastLambda = lambda; //interpolate to next lambda btTransform interpolatedTransA,interpolatedTransB,relativeTrans; btTransformUtil::integrateTransform(fromA,linVelA,angVelA,lambda,interpolatedTransA); btTransformUtil::integrateTransform(fromB,linVelB,angVelB,lambda,interpolatedTransB); relativeTrans = interpolatedTransB.inverseTimes(interpolatedTransA); if (result.m_debugDrawer) { result.m_debugDrawer->drawSphere(interpolatedTransA.getOrigin(),0.2f,btVector3(1,0,0)); } result.DebugDraw( lambda ); btPointCollector pointCollector; computeClosestPoints(interpolatedTransA,interpolatedTransB,pointCollector); if (pointCollector.m_hasResult) { dist = pointCollector.m_distance+result.m_allowedPenetration; c = pointCollector.m_pointInWorld; n = pointCollector.m_normalOnBInWorld; } else { result.reportFailure(-1, numIter); return false; } numIter++; if (numIter > maxIter) { result.reportFailure(-2, numIter); return false; } } result.m_fraction = lambda; result.m_normal = n; result.m_hitPoint = c; return true; } return false; }
[ "liam.wang@picovr.com" ]
liam.wang@picovr.com
e86f9ee1f470e0729df8011288bc490f2130e41a
08780938b9e5ca00caa2833c2285cb3d86f1e793
/graph/vector.hpp
ea7f880add336e57d3216b24acc83ea5bc76674b
[]
no_license
yuanhangtangle/ds_cpp
be70eb6767afbaee85236bfe1d1fb7df8f48c825
972d506e65cf8455eb4515c87fdbfc9fab1843cf
refs/heads/main
2023-05-09T12:25:43.818234
2021-06-03T10:32:38
2021-06-03T10:32:38
336,432,398
0
0
null
null
null
null
UTF-8
C++
false
false
6,240
hpp
#pragma once #include <iostream> #define DEFAULT_CAPACITY 100 #include <stdlib.h> using namespace std; typedef int Rank; template <typename T> class vector { private: Rank _size; int _capacity; T *_elem; void copyFrom(const T *v, Rank lo, Rank hi); void expand(); void merge2(Rank lo, Rank mi, Rank hi, T *p, T *q); void _mergeSort2(Rank lo, Rank hi, T *p, T *q); public: //vector(int c = DEFAULT_CAPACITY); vector(const vector<T> &v); vector(const vector<T> &v, Rank lo, Rank hi); vector(const T *A, int n); vector(const T *A, int lo, int hi); vector(int c = DEFAULT_CAPACITY, int s = 0, T v = 0) { _elem = new T[_capacity = c]; for (_size = 0; _size < s; _elem[_size++] = v); } ~vector(); int size() const; int empty() const; Rank insert(Rank r, const T &v); Rank insert(const T &v); T remove(Rank r); int remove(Rank lo, Rank hi); int disordered(); void permute(); Rank find(const T &v, Rank lo, Rank hi) const; Rank find(const T &v) const; int deduplicate(); int deduplicate2(); int uniquify(); T &operator[](Rank r) const; vector<T> &operator=(const vector<T> &V); template <typename VST> void traverse(VST visit); void mergeSort2(Rank lo, Rank hi); void mergeSort2(); //{ mergeSort2(0,_size); } }; /* template<typename T> vector<T>::vector(int c) { _size = 0; _elem = new T[_capacity = c]; } */ template <typename T> vector<T>::vector(const vector<T> &v) { copyFrom(v._elem, 0, v.size()); } template <typename T> vector<T>::vector(const vector<T> &v, Rank lo, Rank hi) { copyFrom(v._elem, lo, hi); } template <typename T> vector<T>::vector(const T *A, int n) { copyFrom(A, 0, n); } template <typename T> vector<T>::vector(const T *A, int lo, int hi) { copyFrom(A, lo, hi); } template <typename T> vector<T>::~vector() { delete[] _elem; } template <typename T> int vector<T>::size() const { return _size; } template <typename T> int vector<T>::empty() const { return _size == 0; } template <typename T> void vector<T>::copyFrom(const T *v, Rank lo, Rank hi) //size, capacity, elem 全部搞定 { //delete[] _elem; // 这里是构造函数, _elem本不存在; _elem = new T[_capacity = 2 * (hi - lo)]; for (_size = 0; lo < hi; _elem[_size++] = v[lo++]) ; //用for搞定 _size 处理以及复制 } template<typename T> vector<T>& vector<T>::operator=(const vector<T>& V) { if (_elem) delete[] _elem; copyFrom(V._elem, 0, V.size()); return *this; } template <typename T> void vector<T>::expand() { if (_size < _capacity) return; T *oldelem = _elem; _elem = new T[_capacity = 2 * _capacity]; for (int i = 0; i < _size; i++) _elem[i] = oldelem[i]; delete[] oldelem; } template <typename T> Rank vector<T>::insert(Rank r, T const &v) { expand(); for (int i = _size; i > r; _elem[i] = _elem[i - 1], i--) ; _elem[r] = v; _size++; return r; } template <typename T> Rank vector<T>::insert(const T &v) { insert(_size, v); return _size - 1; } template <typename T> T vector<T>::remove(Rank r) { T t = _elem[r]; --_size; for (; r < _size; _elem[r] = _elem[r + 1], r++) ; return t; } template <typename T> int vector<T>::remove(Rank lo, Rank hi) { for (; hi < _size; _elem[lo++] = _elem[hi++]) ; _size = lo; return hi - lo; } template <typename T> int vector<T>::disordered() { int s; for (int i = 0; i < _size - 1; i++) _elem[i] > _elem[i + 1] ? s++ : s; return s; } template <typename T> void vector<T>::permute() { for (int i = _size - 1; i > 0; swap(_elem[rand() % (i + 1)], _elem[i--])) ; } template <typename T> Rank vector<T>::find(const T &v, Rank lo, Rank hi) const { while ((--hi >= lo) && (_elem[hi] != v)) ; return hi; } template <typename T> Rank vector<T>::find(const T &v) const { return find(v, 0, _size); } template <typename T> T &vector<T>::operator[](Rank r) const { return _elem[r]; } template <typename T> int vector<T>::deduplicate() //向后搜索删除,相同元素保留第一个;csacpp给出的是向前搜索,相同元素保留最后一个 { int oldSize = _size; for (Rank i = 0; i < _size; i++) for (Rank j = i + 1; j < _size;) (_elem[j] == _elem[i]) ? remove(j) : j++; return oldSize - _size; } template <typename T> int vector<T>::deduplicate2() //向后搜索删除,相同元素保留第一个;csacpp给出的是向前搜索,相同元素保留最后一个 { int j = 0; for (Rank i = 1; i < _size; i++) find(_elem[i], 0, i) >= 0 ? j++ : _elem[i - j] = _elem[i]; _size -= j; return j; } template <typename T> int vector<T>::uniquify() { int j = 0; for (int i = 1; i < _size; i++) (_elem[i - 1] == _elem[i]) ? j++ : _elem[i - j] = _elem[i]; _size -= j; return j; } template <typename T> void vector<T>::merge2(Rank lo, Rank mi, Rank hi, T *p, T *q) { int l = mi - lo; int r = hi - mi; for (int i = 0; i < l; i++) p[i] = _elem[i + lo]; for (int i = 0; i < r; i++) q[i] = _elem[i + mi]; int i, j, s; for (i = j = 0, s = lo; (i < l) || (j < r); s++) { if (i >= l) _elem[s] = q[j++]; else if (j >= r) _elem[s] = p[i++]; else if (p[i] <= q[j]) _elem[s] = p[i++]; else _elem[s] = q[j++]; } } template <typename T> void vector<T>::_mergeSort2(Rank lo, Rank hi, T *p, T *q) { if (hi - lo <= 1) return; Rank mi = (lo + hi) / 2; _mergeSort2(lo, mi, p, q); _mergeSort2(mi, hi, p, q); merge2(lo, mi, hi, p, q); } template <typename T> void vector<T>::mergeSort2(Rank lo, Rank hi) { int l = ((hi - lo) >> 1) + 1; T *p = new T[l]; T *q = new T[l]; _mergeSort2(lo, hi, p, q); delete[] p; delete[] q; } template <typename T> template <typename VST> void vector<T>::traverse(VST visit) { for (int i = 0; i < _size; i++) visit(_elem[i]); } template <typename T> void vector<T>::mergeSort2() { mergeSort2(0, _size); }
[ "yuanhangtangle@gmail.com" ]
yuanhangtangle@gmail.com
ccd703f46337a9da1c20e363c5095a8510eda186
a42bb12642ab32202d9b0100c425a60a181d2843
/CatalanitzadorPerAWindows/OS/Sha1Sum.h
136d5a4340556b24eb7d96dc891dfb5a2ae5297a
[]
no_license
jmontane/CatalanitzadorPerAWindows
946d594e873dc0718a1fbc31d7263585f8146d73
949ee9db8798d1a658a429c1276f6d207a8ec75a
refs/heads/master
2021-01-16T20:06:19.388921
2012-08-15T01:14:29
2012-08-15T01:14:29
null
0
0
null
null
null
null
ISO-8859-10
C++
false
false
1,307
h
/* * Copyright (C) 2012 Jordi Mas i Hernāndez <jmas@softcatala.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #pragma once #include <string> using namespace std; #define BUFSIZE 4096 #define SHA1LEN 40 class _APICALL Sha1Sum { public: Sha1Sum(){} Sha1Sum(wstring file); void SetFile(wstring file) { m_file = file;} wstring GetSum() const { return m_sum;} wstring ComputeforFile(); wstring ReadFromFile(); bool operator== (Sha1Sum& other); bool operator!= (Sha1Sum& other) {return !(*this == other);}; private: void _compute(); wstring m_sum; wstring m_file; };
[ "jmas@softcatala.org" ]
jmas@softcatala.org
2527b14e4c3f665860af0579b4004801d8a6b1ae
26fb718dde08a92f44d1925cfa479703ff48e4eb
/boost_lib.hpp
cc01330b9d376ec3bf9ac81f5d556e57d7d98f23
[]
no_license
yuzsh/pragmafile_generator
37e18990a4ce76234ccf223086e4a40bcf79bf4b
b394d6b88f530a5e10c558f8f481219469385e31
refs/heads/master
2021-01-17T17:43:33.151005
2016-10-04T04:11:46
2016-10-04T04:11:46
69,175,710
0
0
null
null
null
null
UTF-8
C++
false
false
12,999
hpp
#ifndef BOOST_LIB #define BOOST_LIB #if _DEBUG #pragma comment(lib, "boost_atomic-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_chrono-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_container-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_context-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_coroutine-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_date_time-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_filesystem-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_graph-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_iostreams-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_locale-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_log-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_log_setup-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_math_c99-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_math_c99f-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_math_c99l-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_math_tr1-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_math_tr1f-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_math_tr1l-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_prg_exec_monitor-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_program_options-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_python-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_python3-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_random-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_regex-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_serialization-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_signals-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_system-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_thread-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_timer-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_type_erasure-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_unit_test_framework-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_wave-vc120-mt-gd-1_62.lib") #pragma comment(lib, "boost_wserialization-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_atomic-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_atomic-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_chrono-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_chrono-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_container-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_container-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_context-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_context-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_coroutine-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_coroutine-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_date_time-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_date_time-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_exception-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_exception-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_filesystem-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_filesystem-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_graph-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_graph-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_iostreams-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_iostreams-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_locale-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_locale-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_log-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_log-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_log_setup-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_log_setup-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_math_c99-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_math_c99-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_math_c99f-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_math_c99f-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_math_c99l-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_math_c99l-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_math_tr1-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_math_tr1-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_math_tr1f-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_math_tr1f-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_math_tr1l-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_math_tr1l-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_prg_exec_monitor-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_prg_exec_monitor-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_program_options-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_program_options-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_python-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_python-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_python3-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_python3-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_random-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_random-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_regex-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_regex-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_serialization-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_serialization-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_signals-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_signals-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_system-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_system-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_test_exec_monitor-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_test_exec_monitor-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_thread-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_thread-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_timer-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_timer-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_type_erasure-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_type_erasure-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_unit_test_framework-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_unit_test_framework-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_wave-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_wave-vc120-mt-sgd-1_62.lib") #pragma comment(lib, "libboost_wserialization-vc120-mt-gd-1_62.lib") #pragma comment(lib, "libboost_wserialization-vc120-mt-sgd-1_62.lib") #else #pragma comment(lib, "boost_atomic-vc120-mt-1_62.lib") #pragma comment(lib, "boost_chrono-vc120-mt-1_62.lib") #pragma comment(lib, "boost_container-vc120-mt-1_62.lib") #pragma comment(lib, "boost_context-vc120-mt-1_62.lib") #pragma comment(lib, "boost_coroutine-vc120-mt-1_62.lib") #pragma comment(lib, "boost_date_time-vc120-mt-1_62.lib") #pragma comment(lib, "boost_filesystem-vc120-mt-1_62.lib") #pragma comment(lib, "boost_graph-vc120-mt-1_62.lib") #pragma comment(lib, "boost_iostreams-vc120-mt-1_62.lib") #pragma comment(lib, "boost_locale-vc120-mt-1_62.lib") #pragma comment(lib, "boost_log-vc120-mt-1_62.lib") #pragma comment(lib, "boost_log_setup-vc120-mt-1_62.lib") #pragma comment(lib, "boost_math_c99-vc120-mt-1_62.lib") #pragma comment(lib, "boost_math_c99f-vc120-mt-1_62.lib") #pragma comment(lib, "boost_math_c99l-vc120-mt-1_62.lib") #pragma comment(lib, "boost_math_tr1-vc120-mt-1_62.lib") #pragma comment(lib, "boost_math_tr1f-vc120-mt-1_62.lib") #pragma comment(lib, "boost_math_tr1l-vc120-mt-1_62.lib") #pragma comment(lib, "boost_prg_exec_monitor-vc120-mt-1_62.lib") #pragma comment(lib, "boost_program_options-vc120-mt-1_62.lib") #pragma comment(lib, "boost_python-vc120-mt-1_62.lib") #pragma comment(lib, "boost_python3-vc120-mt-1_62.lib") #pragma comment(lib, "boost_random-vc120-mt-1_62.lib") #pragma comment(lib, "boost_regex-vc120-mt-1_62.lib") #pragma comment(lib, "boost_serialization-vc120-mt-1_62.lib") #pragma comment(lib, "boost_signals-vc120-mt-1_62.lib") #pragma comment(lib, "boost_system-vc120-mt-1_62.lib") #pragma comment(lib, "boost_thread-vc120-mt-1_62.lib") #pragma comment(lib, "boost_timer-vc120-mt-1_62.lib") #pragma comment(lib, "boost_type_erasure-vc120-mt-1_62.lib") #pragma comment(lib, "boost_unit_test_framework-vc120-mt-1_62.lib") #pragma comment(lib, "boost_wave-vc120-mt-1_62.lib") #pragma comment(lib, "boost_wserialization-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_atomic-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_atomic-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_chrono-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_chrono-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_container-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_container-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_context-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_context-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_coroutine-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_coroutine-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_date_time-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_date_time-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_exception-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_exception-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_filesystem-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_filesystem-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_graph-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_graph-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_iostreams-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_iostreams-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_locale-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_locale-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_log-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_log-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_log_setup-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_log_setup-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_math_c99-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_math_c99-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_math_c99f-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_math_c99f-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_math_c99l-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_math_c99l-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_math_tr1-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_math_tr1-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_math_tr1f-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_math_tr1f-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_math_tr1l-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_math_tr1l-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_prg_exec_monitor-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_prg_exec_monitor-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_program_options-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_program_options-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_python-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_python-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_python3-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_python3-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_random-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_random-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_regex-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_regex-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_serialization-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_serialization-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_signals-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_signals-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_system-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_system-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_test_exec_monitor-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_test_exec_monitor-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_thread-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_thread-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_timer-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_timer-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_type_erasure-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_type_erasure-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_unit_test_framework-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_unit_test_framework-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_wave-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_wave-vc120-mt-s-1_62.lib") #pragma comment(lib, "libboost_wserialization-vc120-mt-1_62.lib") #pragma comment(lib, "libboost_wserialization-vc120-mt-s-1_62.lib") #endif #endif
[ "yuzatakujp1013@gmail.com" ]
yuzatakujp1013@gmail.com
cb252fc57ecf520037b815bb3c4ec973753a28d9
33223560c920a053146540ea0c4d35056fe4d966
/main.cpp
539a933d71bd4e87450d85b9e9bbdb9979b6fbfc
[]
no_license
pzins/Sudoku
22cc0db79dddfdd97d2d0b6cfe8dc760113baea0
527157479cc69fa4e27cba8c4fd770ab7a699465
refs/heads/master
2021-05-30T13:18:41.144508
2016-02-15T15:21:45
2016-02-15T15:21:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
988
cpp
#include <iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include "sudokuSolver.h" #include "gridRecognizer.h" #include <QApplication> #include "mainwindow.h" using namespace cv; int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow win; win.getSudokuSolver()->addObserver(win); win.show(); return a.exec(); } //pour lancer : ne pas oublié le path au data des langues : export TESSDATA_PREFIX=/home/pierre/Dev/tess_build/share/ /** tesseract a besoin de libtenocia la dernière version de tessercat a besoin d'une version recente de libtenocia + que clle ds apt-get dc j'ai recup leptonica 1.73 => compilé ds download + make install dc ds system normalement (cmake puis make install) tesseract : ./autogen => crée le configure ./configure --prefix=XXXX make install on a les bons trucs ds le XXXX sinon par default ds /usr/locale conv() **/
[ "zins.pierre@gmail.com" ]
zins.pierre@gmail.com
bc58a43ee45dc912c6d15287e8dc2fdb574828ac
087cbbd3099ff8fd8d2051c60461a0458333dbac
/practice/data_structure/centroid_decomp/gen.cpp
f6765a9ba8bd8197050a92251157e56a58e2d03e
[]
no_license
1998factorial/Codeforces
1046ffb2dbee582191fa59e7290c53e902c0af5c
f5b8139810e0724828e6ce7e26f3f8228589b00a
refs/heads/master
2021-07-05T21:34:45.053171
2021-04-10T06:21:33
2021-04-10T06:21:33
228,158,437
1
0
null
null
null
null
UTF-8
C++
false
false
301
cpp
#include <bits/stdc++.h> using namespace std; int main(){ srand(time(NULL)); int N , K; N = 10000; printf("%d\n" , N); for(int i = 1; i <= N; ++i)printf("%d " , rand() % 200000 + 1); printf("\n"); for(int i = 1; i < N; ++i){ printf("%d %d\n" , i , i + 1); } }
[ "edward19980505@gmail.com" ]
edward19980505@gmail.com
62716be8902d436f3f85a234f7e5eaf77dcd33f6
232a520bfc541da60f45557bff3f47ac3854c021
/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskJetPlanarFlow.cxx
2a8f94aae37b0391bdaadc2b88365d441c2d5bbe
[]
permissive
aortizve/AliPhysics
1099a2bb348c0d21e6bac4239e84311368d1b3e5
ac9b9c48776ff1add335e614d77ccc68a2e92c47
refs/heads/master
2023-06-10T14:11:18.605035
2023-06-05T08:23:57
2023-06-05T08:23:57
146,625,837
0
0
BSD-3-Clause
2018-08-29T16:09:18
2018-08-29T16:09:18
null
UTF-8
C++
false
false
19,103
cxx
/************************************************************************* * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ // C++ #include <array> #include <sstream> // Root #include <TClonesArray.h> #include <TDatabasePDG.h> #include <TFile.h> #include <TGrid.h> #include <THashList.h> #include <THnSparse.h> #include <TMath.h> #include <TObjArray.h> #include <TParticle.h> #include <TParticlePDG.h> #include <TRandom3.h> #include <TVector2.h> #include <TVector3.h> #include <TH1F.h> #include <TH2F.h> #include <TH3F.h> #include <TKey.h> #include <TList.h> #include <TLorentzVector.h> #include <TProfile.h> #include <TSystem.h> #include <TTree.h> // Aliroot general #include "AliAnalysisDataSlot.h" #include "AliEMCALGeometry.h" #include "AliVEventHandler.h" // Aliroot EMCal jet framework #include "AliEmcalJetTask.h" #include "AliFJWrapper.h" #include "AliEmcalJetFinder.h" #include "AliPicoTrack.h" #include "FJ_includes.h" #include "AliAODMCHeader.h" #include "AliAnalysisManager.h" #include "AliAODInputHandler.h" #include "AliInputEventHandler.h" #include "AliEmcalJet.h" #include "AliEmcalParticle.h" #include "AliEmcalPythiaInfo.h" #include "AliGenPythiaEventHeader.h" #include "AliJetContainer.h" #include "AliLog.h" #include "AliMCEvent.h" #include "AliParticleContainer.h" #include "AliRhoParameter.h" #include "AliVTrack.h" #include "TMatrixD.h" #include "TMatrixDSym.h" #include "TMatrixDSymEigen.h" #include <AliAnalysisDataContainer.h> #include "AliAODEvent.h" #include "AliAnalysisTaskJetPlanarFlow.h" using std::cout; using std::endl; ClassImp(AliAnalysisTaskJetPlanarFlow) //________________________________________________________________________ AliAnalysisTaskJetPlanarFlow::AliAnalysisTaskJetPlanarFlow() : AliAnalysisTaskEmcalJet("AliAnalysisTaskJetPlanarFlow", kTRUE), fJetAnalysisType(kData), fJetSubType(kNoSub), fJetRadius(0.4), fMinJetPt(10.0), fMaxJetPt(100.0), fMinJetConstiteuntPAPt(0.15), fMaxJetConstiteuntPAPt(100.0), fSharedFractionPtMin(0.5), fTrackingEfficiency(1.0), fCentralitySelection(kFALSE), fCentralityMin(0.0), fCentralityMax(10.0), fRandom(0), fShapesVar_Particles_E(0), fShapesVar_Particles_E_Truth(0), fShapesVar_Particles_pT(0), fShapesVar_Particles_pT_Truth(0), fShapesVar_Particles_Phi(0), fShapesVar_Particles_Phi_Truth(0), fShapesVar_Particles_Theta(0), fShapesVar_Particles_Theta_Truth(0), fShapesVar_Particles_InJet(0), fShapesVar_Particles_InJet_Truth(0), fTreeJet(0), fTreeParticles(0), fhEvent(0x0) { for (Int_t i = 0; i < nVar; i++) { fShapesVar[i] = 0; } SetMakeGeneralHistograms(kTRUE); DefineOutput(1, TList::Class()); DefineOutput(2, TTree::Class()); DefineOutput(3, TTree::Class()); } //________________________________________________________________________ AliAnalysisTaskJetPlanarFlow::AliAnalysisTaskJetPlanarFlow(const char* name) : AliAnalysisTaskEmcalJet(name, kTRUE), fJetAnalysisType(kData), fJetSubType(kNoSub), fJetRadius(0.4), fMinJetPt(10.0), fMaxJetPt(100.0), fMinJetConstiteuntPAPt(0.15), fMaxJetConstiteuntPAPt(100.0), fSharedFractionPtMin(0.5), fTrackingEfficiency(1.0), fCentralitySelection(kFALSE), fCentralityMin(0.0), fCentralityMax(10.0), fRandom(0), fShapesVar_Particles_E(0), fShapesVar_Particles_E_Truth(0), fShapesVar_Particles_pT(0), fShapesVar_Particles_pT_Truth(0), fShapesVar_Particles_Phi(0), fShapesVar_Particles_Phi_Truth(0), fShapesVar_Particles_Theta(0), fShapesVar_Particles_Theta_Truth(0), fShapesVar_Particles_InJet(0), fShapesVar_Particles_InJet_Truth(0), fTreeJet(0), fTreeParticles(0), fhEvent(0x0) { // Standard constructor. for (Int_t i = 0; i < nVar; i++) { fShapesVar[i] = 0; } SetMakeGeneralHistograms(kTRUE); DefineOutput(1, TList::Class()); DefineOutput(2, TTree::Class()); DefineOutput(3, TTree::Class()); } //________________________________________________________________________ AliAnalysisTaskJetPlanarFlow::~AliAnalysisTaskJetPlanarFlow() { // Destructor. } //________________________________________________________________________ void AliAnalysisTaskJetPlanarFlow::UserCreateOutputObjects() { // Create user output. AliAnalysisTaskEmcalJet::UserCreateOutputObjects(); Bool_t oldStatus = TH1::AddDirectoryStatus(); TH1::AddDirectory(kFALSE); TH1::AddDirectory(oldStatus); // create a tree used for the MC data and making a 4D response matrix const char *nameoutput = GetOutputSlot(2)->GetContainer()->GetName(); fTreeJet = new TTree(nameoutput, nameoutput); TString *fShapesVarNames = new TString[nVar]; fShapesVarNames[0] = "pT_Jet"; fShapesVarNames[1] = "pT_Jet_Truth"; fShapesVarNames[2] = "Mass_Jet"; fShapesVarNames[3] = "Mass_Jet_Truth"; fShapesVarNames[4] = "Eta_Jet"; fShapesVarNames[5] = "Eta_Jet_Truth"; fShapesVarNames[6] = "DeltaR_Jet"; fShapesVarNames[7] = "DeltaR_Jet_Truth"; fShapesVarNames[8] = "Tau2to1"; fShapesVarNames[9] = "Tau2to1_Jet_Truth"; for (Int_t ivar = 0; ivar < nVar; ivar++) { cout << "looping over variables" << endl; fTreeJet->Branch(fShapesVarNames[ivar].Data(), &fShapesVar[ivar], Form("%s/D", fShapesVarNames[ivar].Data())); } const char *nameoutput_Particles = GetOutputSlot(3)->GetContainer()->GetName(); fTreeParticles = new TTree(nameoutput_Particles, nameoutput_Particles); TString *fShapesVarNames_Particles = new TString[nVar_Particles]; fShapesVarNames_Particles[0] = "E"; fShapesVarNames_Particles[1] = "E_Truth"; fShapesVarNames_Particles[2] = "pT"; fShapesVarNames_Particles[3] = "pT_Truth"; fShapesVarNames_Particles[4] = "Phi"; fShapesVarNames_Particles[5] = "Phi_Truth"; fShapesVarNames_Particles[6] = "Theta"; fShapesVarNames_Particles[7] = "Theta_Truth"; fShapesVarNames_Particles[8] = "InJet"; fShapesVarNames_Particles[9] = "InJet_Truth"; fTreeParticles->Branch(fShapesVarNames_Particles[0].Data(), &fShapesVar_Particles_E, 0, 1); fTreeParticles->Branch(fShapesVarNames_Particles[1].Data(), &fShapesVar_Particles_E_Truth, 0, 1); fTreeParticles->Branch(fShapesVarNames_Particles[2].Data(), &fShapesVar_Particles_pT, 0, 1); fTreeParticles->Branch(fShapesVarNames_Particles[3].Data(), &fShapesVar_Particles_pT_Truth, 0, 1); fTreeParticles->Branch(fShapesVarNames_Particles[4].Data(), &fShapesVar_Particles_Phi, 0, 1); fTreeParticles->Branch(fShapesVarNames_Particles[5].Data(), &fShapesVar_Particles_Phi_Truth, 0, 1); fTreeParticles->Branch(fShapesVarNames_Particles[6].Data(), &fShapesVar_Particles_Theta, 0, 1); fTreeParticles->Branch(fShapesVarNames_Particles[7].Data(), &fShapesVar_Particles_Theta_Truth, 0, 1); fTreeParticles->Branch(fShapesVarNames_Particles[8].Data(), &fShapesVar_Particles_InJet, 0, 1); fTreeParticles->Branch(fShapesVarNames_Particles[9].Data(), &fShapesVar_Particles_InJet_Truth, 0, 1); fhEvent = new TH1D("fhEvent", "fhEvent", 40, -0.5, 39.5); fOutput->Add(fhEvent); PostData(1, fOutput); PostData(2, fTreeJet); PostData(3, fTreeParticles); // delete [] fShapesVarNames; } //________________________________________________________________________ Bool_t AliAnalysisTaskJetPlanarFlow::Run() { // Run analysis code here, if needed. It will be executed before FillHistograms(). return kTRUE; } void AliAnalysisTaskJetPlanarFlow::SetTree(AliEmcalJet *jet, AliJetContainer *jetContainer, AliTrackContainer *trackContainer, Float_t jetPt, Int_t level) { AliVParticle *jetConstituent = NULL; Float_t jetMass = TMath::Sqrt((jet->E() * jet->E()) - (jet->Pt() * jet->Pt()) - (jet->Pz() * jet->Pz())); AliEmcalJetFinder JetFinderNSub1("NSubjettiness1"); JetFinderNSub1.SetJetMaxEta(0.9 - fJetRadius); JetFinderNSub1.SetRadius(fJetRadius); JetFinderNSub1.SetJetAlgorithm(0); JetFinderNSub1.SetRecombSheme(0); JetFinderNSub1.SetJetMinPt(jet->Pt()); AliEmcalJetFinder JetFinderNSub2("NSubjettiness2"); JetFinderNSub2.SetJetMaxEta(0.9 - fJetRadius); JetFinderNSub2.SetRadius(fJetRadius); JetFinderNSub2.SetJetAlgorithm(0); JetFinderNSub2.SetRecombSheme(0); JetFinderNSub2.SetJetMinPt(jet->Pt()); AliEmcalJetFinder JetFinderNSubdR("NSubjettinessdR"); JetFinderNSubdR.SetJetMaxEta(0.9 - fJetRadius); JetFinderNSubdR.SetRadius(fJetRadius); JetFinderNSubdR.SetJetAlgorithm(0); JetFinderNSubdR.SetRecombSheme(0); JetFinderNSubdR.SetJetMinPt(jet->Pt()); Double_t dVtxNSub1[3] = {1, 1, 1}; Double_t dVtxNSub2[3] = {1, 1, 1}; Double_t dVtxNSubdR[3] = {1, 1, 1}; Float_t Result_NSub1 = JetFinderNSub1.Nsubjettiness(jet, jetContainer, dVtxNSub1, 1, 0, fJetRadius, 0.0, 0, 0, 0.0, 0.1, 1); Float_t Result_NSub2 = JetFinderNSub2.Nsubjettiness(jet, jetContainer, dVtxNSub2, 2, 0, fJetRadius, 0.0, 0, 0, 0.0, 0.1, 1); Float_t deltaR = JetFinderNSubdR.Nsubjettiness(jet, jetContainer, dVtxNSubdR, 2, 0, fJetRadius, 0.0, 2, 0, 0.0, 0.1, 1); Float_t tau2to1 = Result_NSub2 / Result_NSub1; fShapesVar[0 + level] = jetPt; fShapesVar[2 + level] = jetMass; fShapesVar[4 + level] = jet->Eta(); fShapesVar[6 + level] = deltaR; fShapesVar[8 + level] = tau2to1; Float_t jetUnitVector[3] = {TMath::Cos(jet->Phi()) / TMath::CosH(jet->Eta()), TMath::Sin(jet->Phi()) / TMath::CosH(jet->Eta()), TMath::SinH(jet->Eta()) / TMath::CosH(jet->Eta())}; Float_t magPt = TMath::Sqrt((jetUnitVector[0] * jetUnitVector[0]) + (jetUnitVector[1] * jetUnitVector[1])); Float_t rotationMatrix[3][3]; Float_t cosTheta = jetUnitVector[2]; Float_t sinTheta = magPt; Float_t cosPhi = TMath::Cos(jet->Phi()); Float_t sinPhi = TMath::Sin(jet->Phi()); rotationMatrix[0][0] = -1.0 * cosTheta * cosPhi; rotationMatrix[0][1] = -1.0 * cosTheta * sinPhi; rotationMatrix[0][2] = sinTheta; rotationMatrix[1][0] = sinPhi; rotationMatrix[1][1] = -1.0 * cosPhi; rotationMatrix[1][2] = 0.; rotationMatrix[2][0] = sinTheta * cosPhi; rotationMatrix[2][1] = sinTheta * sinPhi; rotationMatrix[2][2] = cosTheta; Float_t principleMatrix[2][2]; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { principleMatrix[i][j] = 0.0; } } for (Int_t iConstituent = 0; iConstituent < jet->GetNumberOfTracks(); iConstituent++) { jetConstituent = static_cast<AliVParticle *>(jet->TrackAt(iConstituent, jetContainer->GetParticleContainer()->GetArray())); if (jetConstituent->Pt() < fMinJetConstiteuntPAPt || jetConstituent->Pt() >= fMaxJetConstiteuntPAPt) continue; if (fRandom.Rndm() > fTrackingEfficiency) continue; double normalisation_factor = (1.0 / (jetConstituent->E() * jetMass)); Float_t pxRotated = (rotationMatrix[0][0] * jetConstituent->Px()) + (rotationMatrix[0][1] * jetConstituent->Py()) + (rotationMatrix[0][2] * jetConstituent->Pz()); Float_t pyRotated = (rotationMatrix[1][0] * jetConstituent->Px()) + (rotationMatrix[1][1] * jetConstituent->Py()) + (rotationMatrix[1][2] * jetConstituent->Pz()); Float_t pzRotated = (rotationMatrix[2][0] * jetConstituent->Px()) + (rotationMatrix[2][1] * jetConstituent->Py()) + (rotationMatrix[2][2] * jetConstituent->Pz()); principleMatrix[0][0] += normalisation_factor * pxRotated * pxRotated; principleMatrix[0][1] += normalisation_factor * pxRotated * pyRotated; principleMatrix[1][0] += normalisation_factor * pyRotated * pxRotated; principleMatrix[1][1] += normalisation_factor * pyRotated * pyRotated; } Float_t principleMatrixTrace = principleMatrix[0][0] + principleMatrix[1][1]; Float_t PrinciplMatrixDeterminant = (principleMatrix[0][0] * principleMatrix[1][1]) - (principleMatrix[0][1] * principleMatrix[1][0]); Float_t eigenValue1 = 0.5 * (principleMatrixTrace + TMath::Sqrt(principleMatrixTrace * principleMatrixTrace - 4 * PrinciplMatrixDeterminant)); Float_t eigenValue2 = 0.5 * (principleMatrixTrace - TMath::Sqrt(principleMatrixTrace * principleMatrixTrace - 4 * PrinciplMatrixDeterminant)); Float_t planarFlow = (4.0 * PrinciplMatrixDeterminant) / (principleMatrixTrace * principleMatrixTrace); Float_t eigenVector1[2]; Float_t eigenVector2[2]; if (principleMatrix[1][0] == 0.0 || principleMatrix[0][1] == 0.0) { eigenVector1[0] = principleMatrix[0][0]; eigenVector1[1] = principleMatrix[1][1]; eigenVector2[0] = principleMatrix[0][0]; eigenVector2[1] = principleMatrix[1][1]; } else { eigenVector1[0] = eigenValue1 - principleMatrix[1][1]; eigenVector1[1] = principleMatrix[1][0]; eigenVector2[0] = principleMatrix[0][1]; eigenVector2[1] = eigenValue2 - principleMatrix[0][0]; } if (eigenValue1 < eigenValue2) { eigenVector1[0] = eigenVector2[0]; eigenVector1[1] = eigenVector2[1]; } Float_t theta = TMath::ATan(eigenVector1[1] / eigenVector1[0]); if (theta < 0) theta += TMath::Pi(); Float_t rotationMatrix2D[2][2]; rotationMatrix2D[0][0] = TMath::Cos(theta); rotationMatrix2D[0][1] = TMath::Sin(theta); rotationMatrix2D[1][0] = -TMath::Sin(theta); rotationMatrix2D[1][1] = TMath::Cos(theta); Float_t pxRotatedPrincipleAxis = 0.0; Float_t pyRotatedPrincipleAxis = 0.0; for (Int_t iTrack = 0; iTrack < trackContainer->GetNTracks(); iTrack++) { AliAODTrack *track = static_cast<AliAODTrack *>(trackContainer->GetAcceptParticle(iTrack)); if (!track) continue; if (TMath::Abs(track->Eta()) > 0.9) continue; bool isInJet = kFALSE; for (Int_t iConstituent = 0; iConstituent < jet->GetNumberOfTracks(); iConstituent++) { jetConstituent = static_cast<AliVParticle *>(jet->TrackAt(iConstituent, jetContainer->GetParticleContainer()->GetArray())); if (jetConstituent->GetLabel() == track->GetLabel()) { // Is this correct? isInJet = kTRUE; break; } } Float_t pxRotated = (rotationMatrix[0][0] * track->Px()) + (rotationMatrix[0][1] * track->Py()) + (rotationMatrix[0][2] * track->Pz()); Float_t pyRotated = (rotationMatrix[1][0] * track->Px()) + (rotationMatrix[1][1] * track->Py()) + (rotationMatrix[1][2] * track->Pz()); Float_t pzRotated = (rotationMatrix[2][0] * track->Px()) + (rotationMatrix[2][1] * track->Py()) + (rotationMatrix[2][2] * track->Pz()); pxRotatedPrincipleAxis = (rotationMatrix2D[0][0] * pxRotated) + (rotationMatrix2D[0][1] * pyRotated); pyRotatedPrincipleAxis = (rotationMatrix2D[1][0] * pxRotated) + (rotationMatrix2D[1][1] * pyRotated); Float_t thetaTrack = TMath::ACos(pzRotated / TMath::Sqrt((pxRotated * pxRotated) + (pyRotated * pyRotated) + (pzRotated * pzRotated))); Float_t phiTrack = TMath::ATan2(pyRotatedPrincipleAxis, pxRotatedPrincipleAxis); if (level == 0) { fShapesVar_Particles_E.push_back(track->E()); fShapesVar_Particles_pT.push_back(track->Pt()); fShapesVar_Particles_Phi.push_back(phiTrack); fShapesVar_Particles_Theta.push_back(thetaTrack); fShapesVar_Particles_InJet.push_back(isInJet); } if (level == 1) { fShapesVar_Particles_E_Truth.push_back(track->E()); fShapesVar_Particles_pT_Truth.push_back(track->Pt()); fShapesVar_Particles_Phi_Truth.push_back(phiTrack); fShapesVar_Particles_Theta_Truth.push_back(thetaTrack); fShapesVar_Particles_InJet_Truth.push_back(isInJet); } } } //________________________________________________________________________ Bool_t AliAnalysisTaskJetPlanarFlow::FillHistograms() { AliTrackContainer *trackContainer = GetTrackContainer(0); AliTrackContainer *trackContainerDet = NULL; AliTrackContainer *trackContainerTrue = NULL; AliJetContainer *jetContainer = GetJetContainer(0); AliJetContainer *jetContainerDet = NULL; AliJetContainer *jetContainerTrue = NULL; AliEmcalJet *jet = NULL; AliEmcalJet *jetDet = NULL; AliEmcalJet *jetTrue = NULL; if (fJetAnalysisType == kTrueDet) { jetContainerTrue = GetJetContainer(1); trackContainerTrue = GetTrackContainer(1); } if (fJetAnalysisType == kEmb) { jetContainerDet = GetJetContainer(1); trackContainerDet = GetTrackContainer(1); jetContainerTrue = GetJetContainer(2); trackContainerTrue = GetTrackContainer(2); } if (fCentralitySelection) { if ((fCent > fCentralityMax) || (fCent < fCentralityMin)) return kFALSE; } if (jetContainer) { jetContainer->ResetCurrentID(); //?? // Jet Loop Float_t jetpT = 0.0; while (jet = jetContainer->GetNextAcceptJet()) { if (!jet) continue; if (fJetSubType == kAreaSub) jetpT = jet->Pt() - GetRhoVal(0) * jet->Area(); else jetpT = jet->Pt(); if (jetpT < fMinJetPt || jetpT >= fMaxJetPt) continue; if (fJetAnalysisType == kTrueDet) { jetTrue = jet->ClosestJet(); if (!jetTrue) continue; SetTree(jetTrue, jetContainerTrue, trackContainerTrue, jetTrue->Pt(), 1); } if (fJetAnalysisType == kEmb) { if (jetContainer->AliJetContainer::GetFractionSharedPt(jet) < fSharedFractionPtMin) continue; // how does this work? should we not supply the other container? jetDet = jet->ClosestJet(); if (!jetDet) continue; jetTrue = jetDet->ClosestJet(); // do labels need to be checked? if (!jetTrue) continue; SetTree(jetTrue, jetContainerTrue, trackContainerTrue, jetTrue->Pt(), 1); } SetTree(jet, jetContainer, trackContainer, jetpT, 0); fTreeJet->Fill(); fTreeParticles->Fill(); } } delete trackContainer; delete trackContainerTrue; delete trackContainerDet; delete jetContainer; delete jetContainerTrue; delete jetContainerDet; delete jet; delete jetTrue; delete jetDet; return kTRUE; } //________________________________________________________________________ Bool_t AliAnalysisTaskJetPlanarFlow::RetrieveEventObjects() { // // retrieve event objects // if (!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) return kFALSE; return kTRUE; } //_______________________________________________________________________ void AliAnalysisTaskJetPlanarFlow::Terminate(Option_t*) { // Called once at the end of the analysis. }
[ "nzardosh@alicecerno2.cern.ch" ]
nzardosh@alicecerno2.cern.ch
29acb9f1d8ceb11acb6dee9e757dcd5d7ec3f88d
6a0c86842061a23e2a3673d25e06d2916d79bf6b
/stacks/EvaluateExpression.cpp
23d75406f11f8a5516e77dcc8e3bf9f18158e30a
[]
no_license
himanshu13196/interviewbit
aa86368954db9e592113f44b1ab4b0193f4366d2
1c09b395b851bb7029b9962ec29acd5c54a0856f
refs/heads/master
2020-03-18T21:50:52.848564
2016-07-25T00:33:04
2016-07-25T00:33:04
135,307,751
1
0
null
2018-05-29T14:23:32
2018-05-29T14:23:31
null
UTF-8
C++
false
false
1,314
cpp
/** * Evaluate the value of an arithmetic expression in Reverse Polish Notation. * Valid operators are +, -, *, /. Each operand may be an integer or another expression. * Examples: * ["2", "1", "+", "3", "*"] -> ((2 + 1) * 3) -> 9 * ["4", "13", "5", "/", "+"] -> (4 + (13 / 5)) -> 6 */ int Solution::evalRPN(vector<string> &A) { stack<int> nums; int op1, op2, temp; for (int i = 0; i < A.size(); i++) { if (A[i].size() > 1 || isdigit(A[i][0])) { temp = 0; int neg = 1; int j = 0; if (A[i][0] == '-') { neg = -1; j = 1; } else { neg = 1; j = 0; } for (; j < A[i].size(); j++) { temp = temp * 10 + (A[i][j] - '0'); } nums.push(neg * temp); } else { if (!nums.empty()) { op2 = nums.top(); nums.pop(); } else { cout << " error1:" << A[i][0] << " i:" << i; } if (!nums.empty()) { op1 = nums.top(); nums.pop(); } else { cout << " error2:" << A[i][0] << " i:" << i; } switch (A[i][0]) { case '+': op1 += op2; break; case '-': op1 -= op2; break; case '*': op1 *= op2; break; case '/': op1 = op1 / op2; break; default: break; } nums.push(op1); } } return nums.top(); }
[ "srujananjaneya@gmail.com" ]
srujananjaneya@gmail.com
cf11ba197c6da478c96efc12c1296234ff5aeec4
1a29e3fc23318be40f27339a749bbc3bdc59c0c3
/formosa/competitive-programming-1/midterm-2018/873.cpp
399f1544dc038ae61fc4d9baf39f06c571b4e8f5
[]
no_license
wdzeng/cp-solutions
6c2ac554f6d291774929bc6ad612c4c2e3966c9f
8d39fcbda812a1db7e03988654cd20042cf4f854
refs/heads/master
2023-03-23T17:23:08.809526
2020-12-05T00:29:21
2020-12-05T00:29:21
177,706,525
1
0
null
null
null
null
UTF-8
C++
false
false
743
cpp
#include <algorithm> #include <iostream> using namespace std; // AC long solve() { int s, p, sa, pa, sb, pb; cin >> s >> p >> sa >> pa >> sb >> pb; s = abs(s); if (s == 0 || pa==pb) return 0; if (sa < sb) { swap(sa, sb); swap(pa, pb); } int sdiff = sa - sb; if (sdiff == 0) return -1; int pdiff = pb - pa; if (pdiff < 0) return -1; long ret = (long)s * pdiff / sdiff; // cout << "ret: " << ret << endl; return ret > 1'000'000'000'000'000'000L ? -1 : ret; } int main() { int t; cin >> t; while (t--) { long ret = solve(); if (ret < 0) cout << "position zero!\n"; else cout << ret << "\n"; } return 0; }
[ "hyperbola.cs07@gmail.com" ]
hyperbola.cs07@gmail.com
f3852c41b12a08b7096faeeab037d644f359936a
eb6f8600cc9ed9afd2de857379d829077c0fb06b
/src/partisynth.cpp
aa679a73ed2fa67b2f9145b42c93afee025c8871
[ "MIT" ]
permissive
ludimation/partisynth
9941c07d7b7e4b9ba911789f56cd383e0efb5fbd
10863c7b8368a461cf111f4ea49368f1600d5acc
refs/heads/master
2021-01-19T07:37:46.441349
2014-10-29T22:02:48
2014-10-29T22:02:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
20,309
cpp
#include "partisynth.h" // TODO: (longterm) // - develop credits, including: // - audioOutputExample source code // - James M's contributions: // 1) working through math for linear tone/mouse relationship, and // 2) square wave // - separate synth into an addon // - create functionality to put debug reports into a GUI (to be called from main app) so that all partisynth properties can be read/accessed, etc //-------------------------------------------------------------- Partisynth::Partisynth(){ screenID = 'e'; numEmitters = 3; updateParticleTexture = false; xmlFilename = "circles_subdued.pex"; texFilename = "0005_circle.png"; sizeAdjustment = 1.0f; phase = 0; phaseAdder = 0.0f; phaseAdderTarget = 0.0f; phaseAdderTargetTween = 0.9f; volume = 1.0f; bNoise = false; paused = false; waveform = 's'; targetFrequency = 440.0f; pan = 0.5f; volumeFrequencyAdjustment = 1.0f; volumeWaveformAdjustment = 0.9995f; // will sort of not work if you assign any values >=1.0f volumeAdjustment = volumeFrequencyAdjustment * volumeWaveformAdjustment; // ===============---- sampleRate = 44100; } Partisynth::~Partisynth(){ exit(); } void Partisynth::exit(){ if ( lAudio.size() != 0 ) { lAudio.clear(); } //lAudio = NULL; if ( rAudio.size() != 0 ) { rAudio.clear(); } //rAudio = NULL; if ( emitters .size() != 0 ) { for (int i = 0; i < emitters.size(); i++) { emitters[i].exit(); } emitters.clear(); } //emitters = NULL; } void Partisynth::init(){ init(1.0f); } void Partisynth::init(float multiplier){ //* volume = multiplier; // ===============---- // 2 output channels, // 0 input channels // 22050 samples per second // 512 samples per buffer // 4 num buffers (latency) int bufferSize = 512; lAudio.assign(bufferSize, 0.0); rAudio.assign(bufferSize, 0.0); // TODO: trouble-shoot soundstream, is acting funny // "No matching member function for call to 'setup' //soundStream.setup(this, 2, 0, sampleRate, bufferSize, 4); // NOTES: //soundStream.listDevices(); //if you want to set the device id to be different than the default //soundStream.setDeviceID(1); //note some devices are input only and some are output only // populate emitter array emitters.clear(); for (int i=0; i < numEmitters; i++) { ofxParticleEmitter emitter; emitters.push_back(emitter); } // load emitter settings from saved ".pex" file for (int i=0; i < emitters.size(); i++) { if ( !emitters[i].loadFromXml( xmlFilename ) ) { ofLog( OF_LOG_ERROR, "testApp::setup() - failed to load emitter[" + ofToString(i) + "] config" ); } } setPhaseAdderTarget(); updateProperties(); //*/ } //-------------------------------------------------------------- void Partisynth::update(){ ///* updateEmitters(); //*/ } void Partisynth::updateEmitters(){ for (int i=0; i < emitters.size(); i++) { if (updateParticleTexture) { emitters[i].loadFromXml(xmlFilename); updateProperties(); } if (paused != emitters[i].paused) { emitters[i].pause(); } // particle emission angle rotates according to sample volume emitters[i].angle = (360/emitters.size()*2) * (lAudio[0] + rAudio[0] + 1.0f) + i * (360 / emitters.size()); // make colors more eratic as pitch increases emitters[i].startColor.red = targetFrequency / 10000.0f; emitters[i].startColorVariance.red = heightPct/2; emitters[i].startColor.green = heightPct/2; emitters[i].startColorVariance.green = heightPct; emitters[i].startColor.blue = 1 - (1-heightPct/2); emitters[i].startColor.alpha = heightPct*2; emitters[i].finishColor.red = 0.0f; emitters[i].finishColor.green = 0.0f; emitters[i].finishColor.blue = 0.0f; emitters[i].finishColor.alpha = 0.0f; emitters[i].startParticleSize = 0.5f / (1.05f-volume) + (heightPct) * 60.0f * sizeAdjustment; emitters[i].startParticleSizeVariance = 0.0f; // 20 + (1-heightPct) * 60.0f; emitters[i].finishParticleSize = (1-heightPct) * 120.0f * sizeAdjustment; emitters[i].finishParticleSizeVariance = 0.0f; // 20 + (1-heightPct) * 60.0f; emitters[i].speed = 40 + heightPct * 2500.0f * volume * sizeAdjustment; emitters[i].speedVariance = 0.0f; emitters[i].particleLifespan = MIN( 0.5f + 100.0f / emitters[i].speed, 30.0f); // TODO: update more emitter properties based on waveform (texture shape), and other properties emitters[i].update(); } if (updateParticleTexture) { updateParticleTexture = false; } } void Partisynth::updateProperties(){ int x = ofGetMouseX(); int y = ofGetMouseY(); updateProperties(x, y); } void Partisynth::updateProperties(int x, int y){ // int width = ofGetWidth(); // float height = ofGetHeight(); int width = 640; float height = 480; // set default values so we don't get ridiculous pitches at start of program if (!x && !y) { x = width / 2.0f; y = height / 2.0f; } // application can crash if you try to set things to move // to values less than zero and if (x < 0){ x = 0; } else if (x > width) { x = width; } if (y < 0) { y = 0; } else if (y > height) { y = height; } pan = (float)x / (float)width; heightPct = ((height-y) / height); // linear relationship between frequency and mouse Y // targetFrequency = 2000.0f * heightPct); // exponential relationship between frequency and mouse Y // TODO: could make this "snap" to chromatic scales // targetFrequency = 100.0f * pow(1.059463094359f, heightPct*75.0f); targetFrequency = 100.0f * pow(1.059463094359f, heightPct*75.0f); setPhaseAdderTarget(); for (int i=0; i < emitters.size(); i++) { emitters[i].sourcePosition.x = x; emitters[i].sourcePosition.y = y; } } //-------------------------------------------------------------- void Partisynth::setPhaseAdderTarget () { phaseAdderTarget = (targetFrequency / (float) sampleRate) * TWO_PI; } //-------------------------------------------------------------- void Partisynth::audioOut(float * output, int bufferSize, int nChannels, char mode){ //pan = 0.5f; float leftScale = 1 - pan; float rightScale = pan; // sin (n) seems to have trouble when n is very large, so we // keep phase in the range of 0-TWO_PI like this: while (phase > TWO_PI){ phase -= TWO_PI; } if ( bNoise == true){ // ---------------------- noise -------------- for (int i = 0; i < bufferSize; i++){ volumeWaveformAdjustment = 0.30f; lAudio[i] = ofRandom(-1, 1) * volume * leftScale; rAudio[i] = ofRandom(-1, 1) * volume * rightScale; output[i*nChannels ] += lAudio[i] * volumeWaveformAdjustment * sizeAdjustment; output[i*nChannels + 1] += rAudio[i] * volumeWaveformAdjustment * sizeAdjustment; } } else { // smooth frequency changes phaseAdder = phaseAdderTargetTween * phaseAdder + (1-phaseAdderTargetTween) * phaseAdderTarget; // phaseAdder = phaseAdderTarget; // no smoothing between frequency changes for (int i = 0; i < bufferSize; i++){ phase += phaseAdder; float sample; // sometimes we only care about phase in terms of a percentage of TWO_PI float phaseClamped = phase; while (phaseClamped > TWO_PI){ phaseClamped -= TWO_PI; } float pct = phaseClamped / TWO_PI; // sometimes you wan to mutlitpy in negative for first half of phase float multiplier; multiplier = (pct < 0.5f) ? 1.0f : -1.0f; //TODO: Make this waveform generator into an addon // - make attenuation better than this? switch (waveform) { case 't': // triangle wave /\/\/\/\/ pct -= (pct>0.5f) ? 0.5f : 0.0f; sample = multiplier * (2.0f * (pct*2.0f) -1.0f); volumeWaveformAdjustment = 0.400f; break; case 'i': // irregular triangle wave /\/\/\/\/ but wierder, looks like an actual saw blade pct += (pct<0.5f) ? 0.5f : 0.0f; sample = multiplier * (2.0f * pct -1.0f); volumeWaveformAdjustment = 0.200f; break; case 'w' : // sawtooth wave "////////////" sample = 2.0f * pct -1.0f; volumeWaveformAdjustment = 0.125f; break; case 'W': // sawtooth wave "\\\\\\\\\\\\\\" sample = -1 * (2.0f * pct -1.0f); volumeWaveformAdjustment = 0.125f; break; case 'q': // square wave sample = (sin(phase) > 0) ? 1 : -1; volumeWaveformAdjustment = 0.050f; break; case 's': // sine wave (default) default: sample = sin(phase); volumeWaveformAdjustment = 0.9995f; break; } lAudio[i] = sample * volume * leftScale; rAudio[i] = sample * volume * rightScale; // Adjust ouput volume based on both target frequency and waveform volumeWaveformAdjustment = 1.0f - ( (1.0f - volumeWaveformAdjustment) / (1.0f + heightPct)); volumeFrequencyAdjustment = 0.0001f + pow(0.9f, targetFrequency/250.0f); volumeAdjustment = volumeFrequencyAdjustment * volumeWaveformAdjustment; switch (mode) { case 'x': output[i*nChannels ] *= lAudio[i] * volumeAdjustment * sqrt(sizeAdjustment); output[i*nChannels + 1] *= rAudio[i] * volumeAdjustment * sqrt(sizeAdjustment); break; case '+': default: output[i*nChannels ] += lAudio[i] * volumeAdjustment * sqrt(sizeAdjustment); output[i*nChannels + 1] += rAudio[i] * volumeAdjustment * sqrt(sizeAdjustment); break; } } } } //-------------------------------------------------------------- void Partisynth::draw(){ ///* string screenLabel = "PARTISYNTH"; bool screenShake = false; bool screenFlicker = false; bool drawEmitter = false; bool drawWaveforms = false; bool drawInstructions = false; bool drawReport = false; ofPushMatrix(); // set elements to display based on screenID switch (screenID) { case 'e': // emitter screen //screenLabel += ": emitter screen"; if (!paused) { // screenFlicker = true; // TODO: make these be handled externally // screenShake = true; } drawEmitter = true; // drawInstructions = true; // drawReport = true; break; case 'd': // debug screen default: // modified from original audioOutputExample application //screenLabel += ": debug screen"; //drawWaveforms = true; //drawEmitter = true; //drawInstructions = true; drawReport = true; break; } if (screenShake) { ofTranslate(ofRandomf() * volume * pow(targetFrequency,2)/400000, ofRandomf() * volume * pow(targetFrequency,2)/400000, ofRandomf() * volume * targetFrequency /400); } /* if (screenFlicker) { ofBackground(16 + ofRandom( targetFrequency /100 ), 64 + ofRandom( heightPct /50 ), 128 + ofRandom( targetFrequency /25 )); } else { ofBackground(16, 64, 128); } //*/ if (drawInstructions) { // instructions ofSetColor(225,255,0); screenLabel += " | fps: " + ofToString( ofGetFrameRate(), 2 ); ofDrawBitmapString(screenLabel, 32, 32); string instructions = "press 'p' to paurse/unpause the audio\n"; instructions += "press 's' for sinewave (default)\n"; instructions += "press 't' for triangle wave\n"; instructions += "press 'i' for irregular triangle"; instructions += "press 'w' for sawtooth wave //////\n"; instructions += "press 'W' for sawtooth wave \\\\\\\\\\\\\n"; instructions += "press 'q' for square wave\n"; ofDrawBitmapString(instructions, 31, 62); } if (drawEmitter) { for (int i=0; i < emitters.size(); i++) { emitters[i].draw( 0, 0 ); } } if (drawWaveforms) { //////// // draw waveforms //////// ofNoFill(); // draw the left channel: ofPushStyle(); ofPushMatrix(); ofTranslate(32, 150, 0); ofSetColor(225); ofDrawBitmapString("Left Channel", 4, 18); ofSetLineWidth(1); ofRect(0, 0, 900, 200); ofSetColor(245, 58, 135); ofSetLineWidth(3); ofBeginShape(); for (unsigned int i = 0; i < lAudio.size(); i++){ float x = ofMap(i, 0, lAudio.size(), 0, 900, true); ofVertex(x, 100 -lAudio[i]*180.0f); } ofEndShape(false); ofPopMatrix(); ofPopStyle(); // draw the right channel: ofPushStyle(); ofPushMatrix(); ofTranslate(32, 350, 0); ofSetColor(225); ofDrawBitmapString("Right Channel", 4, 18); ofSetLineWidth(1); ofRect(0, 0, 900, 200); ofSetColor(245, 58, 135); ofSetLineWidth(3); ofBeginShape(); for (unsigned int i = 0; i < rAudio.size(); i++){ float x = ofMap(i, 0, rAudio.size(), 0, 900, true); ofVertex(x, 100 -rAudio[i]*180.0f); } ofEndShape(false); ofPopMatrix(); ofPopStyle(); } if (drawReport) { // display report ofSetColor(225, 255, 0); // decide which waveform to include in reportString string waveformString; switch (waveform) { case 't': waveformString = "triangle"; break; case 'i': waveformString = "irregular triangle"; break; case 'w': waveformString = "sawtooth"; break; case 'W': waveformString = "sawtooth reversed"; break; case 'q': waveformString = "square"; break; case 's': default: waveformString = "sine"; break; } // left column report string reportString = "volume: ("+ofToString(volume, 2)+") modify with -/+ keys\npan: ("+ofToString(pan, 2)+") modify with mouse x\nsynthesis: "; if( !bNoise ){ reportString += waveformString + " wave (" + ofToString(targetFrequency, 2) + "hz) modify with mouse y"; reportString += "\nsmoothing: (" + ofToString(phaseAdderTargetTween, 2) + ") modify with 'up' and 'down' arrows"; reportString += "\nvolumeWaveformAdjustment: ("+ofToString(volumeWaveformAdjustment, 5)+")"; reportString += "\nvolumeFrequencyAdjustment: ("+ofToString(volumeFrequencyAdjustment, 5)+")"; reportString += "\nvolumeAdjustment: ("+ofToString(volumeAdjustment, 5)+")"; } else{ reportString += "noise"; } ofDrawBitmapString(reportString, 32, 579); // right column report if( !bNoise ){ reportString = "heightPct: ("+ofToString(heightPct, 2)+") modify with mouse y"; reportString += "\n"; } ofDrawBitmapString(reportString, 632, 579); } ofPopMatrix(); //*/ } //-------------------------------------------------------------- void Partisynth::keyPressed(int key){ string filename = ""; if (key == '-' || key == '_' ){ volume -= 0.05; volume = MAX(volume, 0); } else if (key == '+' || key == '=' ){ volume += 0.05; volume = MIN(volume, 1); } /* // TODO: clean up soundstream stuff if( key == 'p' ){ if (paused) { soundStream.start(); paused = false; } else { soundStream.stop(); paused = true; } } // */ // handle screen ids and waveform id switch (key) { case 'e': // emitter screen case 'd': // debug screen screenID = key; break; case 't': // triangle xmlFilename = "triangles_subdued.pex"; texFilename = "0003_triangle.png"; updateParticleTexture = true; break; case 'i': // irregular triangle xmlFilename = "trianglesIrregular_subdued.pex"; texFilename = "0002_triangle_irregular.png"; updateParticleTexture = true; break; case 'w': // sawtooth xmlFilename = "sawtooth_subdued.pex"; texFilename = "0001_sawtooth.png"; updateParticleTexture = true; break; case 'W': // sawtooth reversed xmlFilename = "sawtooth_reversed_subdued.pex"; texFilename = "0000_sawtooth_reversed.png"; updateParticleTexture = true; break; case 'q': // square xmlFilename = "squares_subdued.pex"; texFilename = "0004_square.png"; updateParticleTexture = true; break; case 's': // sine xmlFilename = "circles_subdued.pex"; texFilename = "0005_circle.png"; updateParticleTexture = true; break; default: //TODO: some key input message here? break; } if (updateParticleTexture) { waveform = key; } // modify frequency smoothing if (key == OF_KEY_DOWN){ phaseAdderTargetTween -= 0.05f; phaseAdderTargetTween = MAX(phaseAdderTargetTween, 0.0f); } else if (key == OF_KEY_UP){ phaseAdderTargetTween += 0.05f; phaseAdderTargetTween = MIN(phaseAdderTargetTween, 0.95f); } } //-------------------------------------------------------------- void Partisynth::mouseMoved(int x, int y ){ updateProperties(x, y); } void Partisynth::updateEmitterPosition(int x, int y ) { updateProperties(x, y); } //-------------------------------------------------------------- void Partisynth::mouseDragged(int x, int y, int button){ updateProperties(x, y); } //-------------------------------------------------------------- void Partisynth::mousePressed(int x, int y, int button){ bNoise = true; } //-------------------------------------------------------------- void Partisynth::mouseReleased(int x, int y, int button){ bNoise = false; } //*/
[ "mail@dallendesign.com" ]
mail@dallendesign.com
7db220a9009fa49e76b46e8b412f48a8f931642a
6044ea7e01287cae22d9fa6cf6e0dc7f8ffd5943
/ReverseBits.cpp
97b5ef6b63e7977ba01c92e220fabe00257f0831
[]
no_license
woods-jiang/leetcode
fbe271dd6a444736d8ab8beb06dfb52e337443e6
f136e44ebb3f294d547d419e4b38d6eb06805a21
refs/heads/master
2020-05-20T06:03:39.040066
2015-08-05T23:31:51
2015-08-05T23:31:51
33,391,497
1
0
null
null
null
null
UTF-8
C++
false
false
378
cpp
class Solution { public: uint32_t reverseBits(uint32_t n) { uint32_t one=1; uint32_t result=0; for(int i=0;i<32;i++) { result = result << 1; if(n & one) { result += 1; } one=one<<1; } return result; } };
[ "woods.jiang.1@gmail.com" ]
woods.jiang.1@gmail.com
68c8d7d1de1c4d3a35d466a739d0b7f66ca04190
adfd75578669245e37f24a2f03eed2babd823e40
/Cplusplus_Gui_Qt4_SourceCode/chap08/diagram/diagramwindow.cpp
335e57b504052100006626c06ec24b2bc84f63f7
[]
no_license
liuhhaiffeng/mygitDesktopTest
97934c5079944f913005538dcc8487b78507dd49
030341ac882becacf6047b3777f5988d107ea9a1
refs/heads/master
2020-03-23T06:44:10.396854
2018-07-17T03:51:58
2018-07-17T03:51:58
141,226,316
0
1
null
null
null
null
UTF-8
C++
false
false
8,069
cpp
//#include <QtGui> #include <QtWidgets> #include "diagramwindow.h" #include "link.h" #include "node.h" #include "propertiesdialog.h" DiagramWindow::DiagramWindow() { scene = new QGraphicsScene(0, 0, 600, 500); view = new QGraphicsView; view->setScene(scene); view->setDragMode(QGraphicsView::RubberBandDrag); view->setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); view->setContextMenuPolicy(Qt::ActionsContextMenu); setCentralWidget(view); minZ = 0; maxZ = 0; seqNumber = 0; createActions(); createMenus(); createToolBars(); connect(scene, SIGNAL(selectionChanged()), this, SLOT(updateActions())); setWindowTitle(tr("Diagram")); updateActions(); } void DiagramWindow::addNode() { Node *node = new Node; node->setText(tr("Node %1").arg(seqNumber + 1)); setupNode(node); } void DiagramWindow::addLink() { NodePair nodes = selectedNodePair(); if (nodes == NodePair()) return; Link *link = new Link(nodes.first, nodes.second); scene->addItem(link); } void DiagramWindow::del() { QList<QGraphicsItem *> items = scene->selectedItems(); QMutableListIterator<QGraphicsItem *> i(items); while (i.hasNext()) { Link *link = dynamic_cast<Link *>(i.next()); if (link) { delete link; i.remove(); } } qDeleteAll(items); } void DiagramWindow::cut() { Node *node = selectedNode(); if (!node) return; copy(); delete node; } void DiagramWindow::copy() { Node *node = selectedNode(); if (!node) return; QString str = QString("Node %1 %2 %3 %4") .arg(node->textColor().name()) .arg(node->outlineColor().name()) .arg(node->backgroundColor().name()) .arg(node->text()); QApplication::clipboard()->setText(str); } void DiagramWindow::paste() { QString str = QApplication::clipboard()->text(); QStringList parts = str.split(" "); if (parts.count() >= 5 && parts.first() == "Node") { Node *node = new Node; node->setText(QStringList(parts.mid(4)).join(" ")); node->setTextColor(QColor(parts[1])); node->setOutlineColor(QColor(parts[2])); node->setBackgroundColor(QColor(parts[3])); setupNode(node); } } void DiagramWindow::bringToFront() { ++maxZ; setZValue(maxZ); } void DiagramWindow::sendToBack() { --minZ; setZValue(minZ); } void DiagramWindow::properties() { Node *node = selectedNode(); Link *link = selectedLink(); if (node) { PropertiesDialog dialog(node, this); dialog.exec(); } else if (link) { QColor color = QColorDialog::getColor(link->color(), this); if (color.isValid()) link->setColor(color); } } void DiagramWindow::updateActions() { bool hasSelection = !scene->selectedItems().isEmpty(); bool isNode = (selectedNode() != 0); bool isNodePair = (selectedNodePair() != NodePair()); cutAction->setEnabled(isNode); copyAction->setEnabled(isNode); addLinkAction->setEnabled(isNodePair); deleteAction->setEnabled(hasSelection); bringToFrontAction->setEnabled(isNode); sendToBackAction->setEnabled(isNode); propertiesAction->setEnabled(isNode); foreach (QAction *action, view->actions()) view->removeAction(action); foreach (QAction *action, editMenu->actions()) { if (action->isEnabled()) view->addAction(action); } } void DiagramWindow::createActions() { exitAction = new QAction(tr("E&xit"), this); exitAction->setShortcut(tr("Ctrl+Q")); connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); addNodeAction = new QAction(tr("Add &Node"), this); addNodeAction->setIcon(QIcon(":/images/node.png")); addNodeAction->setShortcut(tr("Ctrl+N")); connect(addNodeAction, SIGNAL(triggered()), this, SLOT(addNode())); addLinkAction = new QAction(tr("Add &Link"), this); addLinkAction->setIcon(QIcon(":/images/link.png")); addLinkAction->setShortcut(tr("Ctrl+L")); connect(addLinkAction, SIGNAL(triggered()), this, SLOT(addLink())); deleteAction = new QAction(tr("&Delete"), this); deleteAction->setIcon(QIcon(":/images/delete.png")); deleteAction->setShortcut(tr("Del")); connect(deleteAction, SIGNAL(triggered()), this, SLOT(del())); cutAction = new QAction(tr("Cu&t"), this); cutAction->setIcon(QIcon(":/images/cut.png")); cutAction->setShortcut(tr("Ctrl+X")); connect(cutAction, SIGNAL(triggered()), this, SLOT(cut())); copyAction = new QAction(tr("&Copy"), this); copyAction->setIcon(QIcon(":/images/copy.png")); copyAction->setShortcut(tr("Ctrl+C")); connect(copyAction, SIGNAL(triggered()), this, SLOT(copy())); pasteAction = new QAction(tr("&Paste"), this); pasteAction->setIcon(QIcon(":/images/paste.png")); pasteAction->setShortcut(tr("Ctrl+V")); connect(pasteAction, SIGNAL(triggered()), this, SLOT(paste())); bringToFrontAction = new QAction(tr("Bring to &Front"), this); bringToFrontAction->setIcon(QIcon(":/images/bringtofront.png")); connect(bringToFrontAction, SIGNAL(triggered()), this, SLOT(bringToFront())); sendToBackAction = new QAction(tr("&Send to Back"), this); sendToBackAction->setIcon(QIcon(":/images/sendtoback.png")); connect(sendToBackAction, SIGNAL(triggered()), this, SLOT(sendToBack())); propertiesAction = new QAction(tr("P&roperties..."), this); connect(propertiesAction, SIGNAL(triggered()), this, SLOT(properties())); } void DiagramWindow::createMenus() { fileMenu = menuBar()->addMenu(tr("&File")); fileMenu->addAction(exitAction); editMenu = menuBar()->addMenu(tr("&Edit")); editMenu->addAction(addNodeAction); editMenu->addAction(addLinkAction); editMenu->addAction(deleteAction); editMenu->addSeparator(); editMenu->addAction(cutAction); editMenu->addAction(copyAction); editMenu->addAction(pasteAction); editMenu->addSeparator(); editMenu->addAction(bringToFrontAction); editMenu->addAction(sendToBackAction); editMenu->addSeparator(); editMenu->addAction(propertiesAction); } void DiagramWindow::createToolBars() { editToolBar = addToolBar(tr("Edit")); editToolBar->addAction(addNodeAction); editToolBar->addAction(addLinkAction); editToolBar->addAction(deleteAction); editToolBar->addSeparator(); editToolBar->addAction(cutAction); editToolBar->addAction(copyAction); editToolBar->addAction(pasteAction); editToolBar->addSeparator(); editToolBar->addAction(bringToFrontAction); editToolBar->addAction(sendToBackAction); } void DiagramWindow::setZValue(int z) { Node *node = selectedNode(); if (node) node->setZValue(z); } void DiagramWindow::setupNode(Node *node) { node->setPos(QPoint(80 + (100 * (seqNumber % 5)), 80 + (50 * ((seqNumber / 5) % 7)))); scene->addItem(node); ++seqNumber; scene->clearSelection(); node->setSelected(true); bringToFront(); } Node *DiagramWindow::selectedNode() const { QList<QGraphicsItem *> items = scene->selectedItems(); if (items.count() == 1) { return dynamic_cast<Node *>(items.first()); } else { return 0; } } Link *DiagramWindow::selectedLink() const { QList<QGraphicsItem *> items = scene->selectedItems(); if (items.count() == 1) { return dynamic_cast<Link *>(items.first()); } else { return 0; } } DiagramWindow::NodePair DiagramWindow::selectedNodePair() const { QList<QGraphicsItem *> items = scene->selectedItems(); if (items.count() == 2) { Node *first = dynamic_cast<Node *>(items.first()); Node *second = dynamic_cast<Node *>(items.last()); if (first && second) return NodePair(first, second); } return NodePair(); }
[ "liuhhaiffeng@163.com" ]
liuhhaiffeng@163.com
51420ca3c0eca1a8c32e114508f18c6c867b6905
70670ce981def72d35bd2cbbdcb65ed1f11372a0
/software/tests/actuator/brake_target/main.cpp
33d6b88365882aeb2f88ac1ea47abdc92c42a71d
[ "MIT" ]
permissive
jbarry510/slonav
1ad2f69a463f0fa2858b2f5347896e2d39713e88
acebb8481e5623c3548258fe0e92a983618032a3
refs/heads/master
2021-01-20T10:46:37.206240
2017-06-05T07:37:11
2017-06-05T07:37:11
75,337,667
0
1
null
null
null
null
UTF-8
C++
false
false
939
cpp
/* @file main.h * * This file contains the test code for the linear acuator that will drive the * brake on the final system. * */ //------------------------------------------------------------------------------ #include "mbed.h" #include "brake.h" #include "PID.h" #include "pinout.h" //------------------------------------------------------------------------------ int main() { Serial ser(USBTX,USBRX); BRAKE brake(RPWM, LPWM, BRAKE_EN, BRAKE_POS); float sp = 0.0; while(1) { while(sp < 0.75){ brake.setPosition(sp); wait_ms(2000); ser.printf("Current Position: %f\r\n", brake.getPosition()); sp += 0.1; } while(sp > 0.0){ brake.setPosition(sp); wait_ms(2000); ser.printf("Current Position: %f\r\n", brake.getPosition()); sp -= 0.1; } } }
[ "jbarry510@gmail.com" ]
jbarry510@gmail.com
2b776e2306fd06edc02e7f63efd6e5e40673fcd0
a33aac97878b2cb15677be26e308cbc46e2862d2
/program_data/PKU_raw/103/520.c
ff9b8e0158d11a993882728acd66e75d70f28e32
[]
no_license
GabeOchieng/ggnn.tensorflow
f5d7d0bca52258336fc12c9de6ae38223f28f786
7c62c0e8427bea6c8bec2cebf157b6f1ea70a213
refs/heads/master
2022-05-30T11:17:42.278048
2020-05-02T11:33:31
2020-05-02T11:33:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
430
c
int main() { int i,j,p,q,count=0; char f[1000]; cin.getline(f,1000); for(i=0;i<1000;i++) {if(f[i]>='a' && f[i]<='z')f[i]=f[i]-'a'+'A';} for(p=0;p<strlen(f);p++) { if(f[p]=='\0')break; if(f[p]=='0')continue; for(q=p+1;q<strlen(f);q++) { if(f[q]==f[p]){count++;f[q]='0';} else {break;} } cout<<"("<<f[p]<<","<<count+1<<")"; f[p]='0'; count=0; } return 0; }
[ "bdqnghi@gmail.com" ]
bdqnghi@gmail.com
e3ba4573e666263e7ce8170401d1de2432ed706b
c8a38e65e71de888fc5b22fbd027bbaa0f3f6ef1
/Cpp/19.cpp
6e2d7259de47c682a048014b750c587aa6a63cbd
[]
no_license
skywhat/leetcode
e451a10cdab0026d884b8ed2b03e305b92a3ff0f
6aaf58b1e1170a994affd6330d90b89aaaf582d9
refs/heads/master
2023-03-30T15:54:27.062372
2023-03-30T06:51:20
2023-03-30T06:51:20
90,644,891
82
27
null
null
null
null
UTF-8
C++
false
false
966
cpp
// Given a linked list, remove the n-th node from the end of list and return its // head. // // Example: // // Given linked list: 1->2->3->4->5, and n = 2. // // After removing the second node from the end, the linked list becomes // 1->2->3->5. Note: // // Given n will always be valid. // // Follow up: // // Could you do this in one pass? /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n) { ListNode prevHead(-1); prevHead.next = head; ListNode* prev = &prevHead; ListNode* fast = head; for (int i = 0; i < n; ++i) { fast = fast->next; } while (fast) { prev = prev->next; fast = fast->next; } prev->next = prev->next->next; return prevHead.next; } };
[ "i@skywhat.com" ]
i@skywhat.com
b59f28b18850dbd63c0dde253bb655800ccbb732
1acc5667ae930ae4a3d4e61fdc0300fc6588809a
/6.Advanced Recursion/Print subset of array.cpp
bba600916a8715a38d885b723da3ac96dbded0ac
[]
no_license
sheikh-haji/CODING-NINJAS
0a878519e275f3fbd6766d6e286f61ea90e01a90
3f25038fa28eff936f4a0199acc324b31c7af85a
refs/heads/master
2022-12-30T00:40:09.156778
2020-10-18T05:49:26
2020-10-18T05:49:26
null
0
0
null
null
null
null
UTF-8
C++
false
false
541
cpp
void print(int *input,int n,int *output,int id){ if(n==0){ for(int i=0;i<id;i++){ cout<<output[i]<<" "; } cout<<endl; return ; } print(input+1,n-1,output,id); int *newop= new int[id+1]; for(int i=0;i<id;i++){ newop[i]=output[i]; } newop[id]=input[0]; print(input+1,n-1,newop,id+1); } void printSubsetsOfArray(int input[], int size) { // Write your code her int*output=new int[15]; print(input,size,output,0); }
[ "noreply@github.com" ]
noreply@github.com
73135cf8e9c16f7ecec7605fb56c40641553ef7a
04bf6df701c437383ad165a340d8572fafe83951
/common/tracelog.cpp
5ae3bd5b4f912f1748fe9cc2ea4f030b37380134
[]
no_license
SlackSeven/gfxtrace
cf3ed70c529a998fe63c2a788e92300fda5dde8b
191f4bc16c16788d8fb445f0405e6c049924f3cd
refs/heads/master
2020-08-04T19:13:27.492979
2013-05-16T22:18:18
2013-05-16T22:18:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,144
cpp
/* * Copyright (c) 2013, NVIDIA CORPORATION. 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 NVIDIA CORPORATION 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 ``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 "stdafx.h" #include "tracelog.h" #include <list> #include <vector> #include "functionhooks.gen.h" // Unfortunately, has to be stored as a global because GL is a C API. Boo hoo. std::list<std::pair<TraceLogLevel, std::vector<TCHAR>>> mMessages; void TraceGuts(TraceLogLevel _level, bool _log, const TCHAR* _fmt, va_list _args) { // Doh, this is MS specific. Need a WAR for other platforms. size_t requiredLength = _vsctprintf(_fmt, _args) + 1; std::vector<TCHAR> buffer(requiredLength); _vsntprintf_s(&buffer[0], requiredLength, requiredLength - 1, _fmt, _args); if (_log) { PrintTraceMessage(_level, &(*buffer.begin())); } else { mMessages.push_back(std::make_pair(_level, buffer)); } } void WriteMessages(FileLike* _out) { for (auto it = mMessages.begin(); it != mMessages.end(); ++it) { SSerializeDataPacket pkt; pkt.mDataType = EST_Message; pkt.mData_Message.level = it->first; pkt.mData_Message.messageBody = &it->second[0]; _out->Write(pkt); } mMessages.clear(); } void TraceVerbose(const TCHAR* fmt, ...) { va_list args; va_start(args, fmt); TraceGuts(TLLVerbose, false, fmt, args); va_end(args); } void TraceInfo(const TCHAR* fmt, ...) { va_list args; va_start(args, fmt); TraceGuts(TLLInfo, false, fmt, args); va_end(args); } void TraceWarn(const TCHAR* fmt, ...) { va_list args; va_start(args, fmt); TraceGuts(TLLWarn, false, fmt, args); va_end(args); } void TraceError(const TCHAR* fmt, ...) { va_list args; va_start(args, fmt); TraceGuts(TLLError, false, fmt, args); va_end(args); } void LogVerbose(const TCHAR* fmt, ...) { va_list args; va_start(args, fmt); TraceGuts(TLLVerbose, true, fmt, args); va_end(args); } void LogInfo(const TCHAR* fmt, ...) { va_list args; va_start(args, fmt); TraceGuts(TLLVerbose, true, fmt, args); va_end(args); } void LogWarn(const TCHAR* fmt, ...) { va_list args; va_start(args, fmt); TraceGuts(TLLVerbose, true, fmt, args); va_end(args); } void LogError(const TCHAR* fmt, ...) { va_list args; va_start(args, fmt); TraceGuts(TLLVerbose, true, fmt, args); va_end(args); } // To display the trace messages to stdout. void PrintTraceMessage(int _level, const TCHAR* _body) { const TCHAR* levelHeader = TC("Unknown"); switch (_level) { case TLLVerbose: levelHeader = TC("Verbose"); break; case TLLInfo: levelHeader = TC("Info"); break; case TLLWarn: levelHeader = TC("Warning"); break; case TLLError: levelHeader = TC("ERROR"); break; default: assert(0); break; }; _tprintf(TC("%s: %s\n"), levelHeader, _body); }
[ "jmcdonald@nvidia.com" ]
jmcdonald@nvidia.com
283df8adcc0f4f37e0042f6720172620c329aea0
293606fabbb24d2b849199edbd1dd4c2940c29a7
/cf/cf,7.13.b.cpp
5c6d086b0e6377d298cd72a1ed62095d2727baa3
[]
no_license
DMHACYJ/work1
bf71c8dfe8924778b0c5c1a2e9be57ee66de0f81
08ee204f6b6d91c047c54d932f85de4404a4b40e
refs/heads/master
2020-05-16T01:48:28.368661
2020-05-09T13:50:09
2020-05-09T13:50:09
182,610,200
0
0
null
null
null
null
UTF-8
C++
false
false
790
cpp
#include<iostream> #include<algorithm> using namespace std; const int maxa=410; const int maxb=205; int a[maxa]; int b[maxb]; int main() { int q; scanf("%d",&q); while(q--) { int n; int flag=0; scanf("%d",&n); for(int i=0;i<4*n;i++) { scanf("%d",&a[i]); } int bns=0; for(int i=0;i<4*n;i++) { for(int j=i+1;j<4*n;j++) { if(a[i]==a[j]&&a[i]&&a[j]) { b[bns++]=a[i]; a[i]=0; a[j]=0; } } } // if(bns==2*n) // { sort(b,b+2*n); for(int i=1,j=2*n-2;i<j;i++,j--) { if(b[i]*b[j]==b[i-1]*b[j+1]) { flag=1; } else { flag=0; break; } } // } if(flag||n==1) { cout<<"YES"<<endl; } else cout<<"NO"<<endl; } return 0; }
[ "noreply@github.com" ]
noreply@github.com
e60acc14fb7131538d642b82de7d24c139294fca
e6eac5904d9a205994c66742316c413373d5d132
/CursorList.cxx
01e9827853eff65080bebe792ba5672974d2aefa
[]
no_license
KatarzynaMialkowska/Tester_ArrayList_VS_LinkedList_VS_CursorList
38cc5c234c31bca386a7ee8474c7d85115605be5
2a815995d960a7fc5652378f12f727012fe527d6
refs/heads/master
2023-08-01T11:07:43.290789
2021-09-17T20:48:02
2021-09-17T20:48:02
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,830
cxx
#include "CursorList.hxx" #include <cassert> #include <iostream> #include <vector> #include <iterator> #include <chrono> #include <string> #include <sstream> int main(int argc, char *argv[]) { //auto start = std::chrono::high_resolution_clock::now(); std::ios_base::sync_with_stdio(false); CursorList<int,3000>s1; int n_operations, x, y; char s; std::cin >> n_operations; while(n_operations!=0){ std::cin >> s; switch(s){ case 'F': std::cin >> x; if(!s1.full()){ s1.push_front(x); }else std::cout<<"ArrayList Overflow"<<"\n"; break; case 'B': std::cin >> x; if(!s1.full()){ s1.push_back(x); }else std::cout<<"ArrayList Overflow"<<"\n"; break; case 'f': if(!s1.empty()) std::cout<<s1.pop_front()<<"\n"; else std::cout<<"EMPTY"<<"\n"; break; case 'b': if(!s1.empty()) std::cout<<s1.pop_back()<<"\n"; else std::cout<<"EMPTY"<<"\n"; break; case 'R': std::cin >> x; std::cin >> y; try { s1.insert(s1.erase(s1.find(x)),y); std::cout << "TRUE"<<"\n"; }catch (const std::invalid_argument& ia) { std::cout << "FALSE"<<"\n"; } break; case 'S': std::cout<<s1.size()<<"\n"; break; default: break; } // std::cout<<"\n \t "; // for(auto &a : s1) // std::cout<<a<<" "; // std::cout<<'\n'; n_operations--; } return 0; }
[ "catherinemialkowska@gmail.com" ]
catherinemialkowska@gmail.com
3c502bb84498af11bec9c3accf522a82b22ffc7b
5cbb6f03a7ee11223095d641329e53e5f2fd676f
/src/solver/qp_solver.cpp
f039c2ad46ccc477d306c08f365bd8a8133cef23
[]
no_license
aabin/DAGSfM
300e5caf92d74b80b6579a1dbb917ac4304ef25c
158646b9b554c5c7a0abf37016f243d37b987078
refs/heads/master
2022-11-08T07:12:26.793358
2020-06-24T09:14:38
2020-06-24T09:14:38
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,006
cpp
#include "solver/qp_solver.h" #include <glog/logging.h> #include <Eigen/Core> #include <algorithm> #include <limits> #include <string> #include "math/sparse_cholesky_llt.h" #include "util/stringprintf.h" namespace DAGSfM { QPSolver::QPSolver(const Options& options, const Eigen::SparseMatrix<double>& P, const Eigen::VectorXd& q, const double r) : options_(options), P_(P), q_(q), r_(r) { CHECK_EQ(P_.rows(), P_.cols()) << "P must be a symmetric matrix."; CHECK_EQ(P_.cols(), q_.size()) << "The dimensions of P and q must be consistent."; // Set the lower and upper bounds to be negative and positive infinity (i.e // no bounds). lb_.setConstant(P_.cols(), -std::numeric_limits<double>::infinity()); ub_.setConstant(P_.cols(), std::numeric_limits<double>::infinity()); // Set up the linear solver to compute the cholesky decomposition of: // P_ + rho * eye(N) Eigen::SparseMatrix<double> spd_mat(P_.rows(), P_.cols()); spd_mat.setIdentity(); spd_mat *= options_.rho; spd_mat += P_; linear_solver_.Compute(spd_mat); CHECK_EQ(linear_solver_.Info(), Eigen::Success); } void QPSolver::SetMaxIterations(const int max_iterations) { options_.max_num_iterations = max_iterations; } void QPSolver::SetUpperBound(const Eigen::VectorXd& ub) { ub_ = ub.array(); } void QPSolver::SetLowerBound(const Eigen::VectorXd& lb) { lb_ = lb.array(); } // Solve the quadratic program. bool QPSolver::Solve(Eigen::VectorXd* solution) { // Ensure the bounds are valid. If there are any invalid bounds then the // difference between the bounds would be a negative value. int coeff_index = -1; if ((ub_ - lb_).minCoeff(&coeff_index) < 0) { LOG(WARNING) << "You specified invalid lower or upper bounds for the " "problem. lower_bound[" << coeff_index << "] = " << lb_[coeff_index] << " but upper_bound[" << coeff_index << "] = " << ub_[coeff_index]; return false; } CHECK_NOTNULL(solution)->setZero(q_.size()); Eigen::VectorXd& x = *solution; Eigen::VectorXd z(P_.rows()), u(P_.rows()); z.setZero(); u.setZero(); Eigen::VectorXd z_old(z.size()), x_hat(P_.rows()); // Precompute some convergence terms. const double primal_abs_tolerance_eps = std::sqrt(P_.rows()) * options_.absolute_tolerance; const double dual_abs_tolerance_eps = std::sqrt(P_.rows()) * options_.absolute_tolerance; VLOG(2) << "Iteration Residual R norm S norm " "Primal eps Dual eps"; const std::string row_format = " % 4d % 4.4e % 4.4e % 4.4e % 4.4e % 4.4e"; // Run the iterations. for (int i = 0; i < options_.max_num_iterations; i++) { // Update x. x.noalias() = linear_solver_.Solve(options_.rho * (z - u) - q_); if (linear_solver_.Info() != Eigen::Success) { return false; } // Update x_hat. std::swap(z, z_old); x_hat.noalias() = options_.alpha * x + (1.0 - options_.alpha) * z_old; // Update z. z.noalias() = ub_.min(lb_.max((x_hat + u).array())).matrix(); // Update u. u.noalias() += x_hat - z; // Compute the convergence terms. const double objval = 0.5 * x.dot(P_ * x) + q_.dot(x) + r_; const double r_norm = (x - z).norm(); const double s_norm = (-options_.rho * (z - z_old)).norm(); const double max_norm = std::max({x.norm(), z.norm()}); const double primal_eps = primal_abs_tolerance_eps + options_.relative_tolerance * max_norm; const double dual_eps = dual_abs_tolerance_eps + options_.relative_tolerance * (options_.rho * u).norm(); // Log the result to the screen. VLOG(2) << StringPrintf(row_format.c_str(), objval, i, r_norm, s_norm, primal_eps, dual_eps); // Determine if the minimizer has converged. if (r_norm < primal_eps && s_norm < dual_eps) { break; } } return true; } } // namespace DAGSfM
[ "1701213988@pku.edu.cn" ]
1701213988@pku.edu.cn
52980e63dfb5a5743a7dc34896ab0eac055a4d2d
2b51187323ade299f02c744d03ca736b01c93c31
/plugins/options/optionswin.h
bfde31252f534fa649c74f9262c24732cfdb93d4
[]
no_license
mtux/sjae
9df16837e503b85630583e2e817317a2d20d2f99
3c5a9779503b3f60c84cbb12fbb9a3392817f470
refs/heads/master
2021-01-10T18:49:54.491241
2009-03-20T06:08:44
2009-03-20T06:08:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
788
h
#ifndef OPTIONSWIN_H #define OPTIONSWIN_H #include <QDialog> #include "ui_optionswin.h" #include <options_i.h> #include <QStackedLayout> #include <QTreeWidgetItem> class OptionsWin : public QDialog { Q_OBJECT public: OptionsWin(QWidget *parent = 0); ~OptionsWin(); bool add_page(const QString &category, OptionsPageI *w); void showPage(const QString &page); protected slots: void apply(); void cancel(); void changed(bool valid); void treeSelectionChanged(); protected: QMap<QTreeWidgetItem *, OptionsPageI *> pages; QMap<OptionsPageI *, QString> categories; QStackedLayout *stack; QList<QWidget *> pages_invalid, pages_changed; void showEvent(QShowEvent *e); void set_button_states(); private: Ui::OptionsWinClass ui; int numPages; }; #endif // OPTIONSWIN_H
[ "mehrdad.momeny@gmail.com" ]
mehrdad.momeny@gmail.com
6ecd5dd7a98134e514323edd66f206e550639492
036c026ca90f4a4a663f914b5333ecd1da9ff4d3
/bin/windows/obj/src/lime/utils/AssetLibrary.cpp
2345e3659cc3e15da3a5853c0777384620f29c01
[]
no_license
alexey-kolonitsky/hxlines
d049f9ea9cc038eaca814d99f26588abb7e67f44
96e1e7ff58b787985d87512e78929a367e27640b
refs/heads/master
2021-01-22T04:27:53.064692
2018-05-18T02:06:09
2018-05-18T02:06:09
102,267,235
0
1
null
2018-03-25T19:11:08
2017-09-03T13:40:29
C++
UTF-8
C++
false
true
74,112
cpp
// Generated by Haxe 3.4.0 (git build development @ d2a02e8) #include <hxcpp.h> #ifndef INCLUDED_95f339a1d026d52c #define INCLUDED_95f339a1d026d52c #include "hxMath.h" #endif #ifndef INCLUDED_Reflect #include <Reflect.h> #endif #ifndef INCLUDED_Std #include <Std.h> #endif #ifndef INCLUDED_Type #include <Type.h> #endif #ifndef INCLUDED_haxe_IMap #include <haxe/IMap.h> #endif #ifndef INCLUDED_haxe_ds_StringMap #include <haxe/ds/StringMap.h> #endif #ifndef INCLUDED_haxe_io_Bytes #include <haxe/io/Bytes.h> #endif #ifndef INCLUDED_lime_app_Future #include <lime/app/Future.h> #endif #ifndef INCLUDED_lime_app_Promise_lime_utils_AssetLibrary #include <lime/app/Promise_lime_utils_AssetLibrary.h> #endif #ifndef INCLUDED_lime_app__Event_Void_Void #include <lime/app/_Event_Void_Void.h> #endif #ifndef INCLUDED_lime_graphics_Image #include <lime/graphics/Image.h> #endif #ifndef INCLUDED_lime_media_AudioBuffer #include <lime/media/AudioBuffer.h> #endif #ifndef INCLUDED_lime_net__HTTPRequest_AbstractHTTPRequest #include <lime/net/_HTTPRequest/AbstractHTTPRequest.h> #endif #ifndef INCLUDED_lime_net__HTTPRequest_String #include <lime/net/_HTTPRequest_String.h> #endif #ifndef INCLUDED_lime_net__IHTTPRequest #include <lime/net/_IHTTPRequest.h> #endif #ifndef INCLUDED_lime_text_Font #include <lime/text/Font.h> #endif #ifndef INCLUDED_lime_utils_AssetLibrary #include <lime/utils/AssetLibrary.h> #endif #ifndef INCLUDED_lime_utils_AssetManifest #include <lime/utils/AssetManifest.h> #endif #ifndef INCLUDED_lime_utils_Log #include <lime/utils/Log.h> #endif #ifndef INCLUDED_lime_utils__Bytes_Bytes_Impl_ #include <lime/utils/_Bytes/Bytes_Impl_.h> #endif HX_DEFINE_STACK_FRAME(_hx_pos_302b88cc6233d9fb_25_new,"lime.utils.AssetLibrary","new",0x53ac9a93,"lime.utils.AssetLibrary.new","lime/utils/AssetLibrary.hx",25,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_58_exists,"lime.utils.AssetLibrary","exists",0xba577589,"lime.utils.AssetLibrary.exists","lime/utils/AssetLibrary.hx",58,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_154_getAsset,"lime.utils.AssetLibrary","getAsset",0x8eced667,"lime.utils.AssetLibrary.getAsset","lime/utils/AssetLibrary.hx",154,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_172_getAudioBuffer,"lime.utils.AssetLibrary","getAudioBuffer",0x882d8e2d,"lime.utils.AssetLibrary.getAudioBuffer","lime/utils/AssetLibrary.hx",172,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_201_getBytes,"lime.utils.AssetLibrary","getBytes",0x262d74e2,"lime.utils.AssetLibrary.getBytes","lime/utils/AssetLibrary.hx",201,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_251_getFont,"lime.utils.AssetLibrary","getFont",0x44386d38,"lime.utils.AssetLibrary.getFont","lime/utils/AssetLibrary.hx",251,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_282_getImage,"lime.utils.AssetLibrary","getImage",0x25fe8bd2,"lime.utils.AssetLibrary.getImage","lime/utils/AssetLibrary.hx",282,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_309_getPath,"lime.utils.AssetLibrary","getPath",0x4ac9f50e,"lime.utils.AssetLibrary.getPath","lime/utils/AssetLibrary.hx",309,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_316_getText,"lime.utils.AssetLibrary","getText",0x4d71dc16,"lime.utils.AssetLibrary.getText","lime/utils/AssetLibrary.hx",316,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_343_isLocal,"lime.utils.AssetLibrary","isLocal",0x436bccd4,"lime.utils.AssetLibrary.isLocal","lime/utils/AssetLibrary.hx",343,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_376_list,"lime.utils.AssetLibrary","list",0xe20b3ecb,"lime.utils.AssetLibrary.list","lime/utils/AssetLibrary.hx",376,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_398_loadAsset,"lime.utils.AssetLibrary","loadAsset",0xdf43a85d,"lime.utils.AssetLibrary.loadAsset","lime/utils/AssetLibrary.hx",398,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_414_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",414,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_443_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",443,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_444_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",444,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_445_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",445,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_452_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",452,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_453_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",453,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_454_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",454,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_461_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",461,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_462_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",462,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_463_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",463,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_470_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",470,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_471_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",471,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_472_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",472,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_479_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",479,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_480_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",480,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_481_load,"lime.utils.AssetLibrary","load",0xe20fbc93,"lime.utils.AssetLibrary.load","lime/utils/AssetLibrary.hx",481,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_500_loadAudioBuffer,"lime.utils.AssetLibrary","loadAudioBuffer",0xa3353ca3,"lime.utils.AssetLibrary.loadAudioBuffer","lime/utils/AssetLibrary.hx",500,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_527_loadBytes,"lime.utils.AssetLibrary","loadBytes",0x76a246d8,"lime.utils.AssetLibrary.loadBytes","lime/utils/AssetLibrary.hx",527,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_550_loadFont,"lime.utils.AssetLibrary","loadFont",0xbd1e8c02,"lime.utils.AssetLibrary.loadFont","lime/utils/AssetLibrary.hx",550,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_618_loadImage,"lime.utils.AssetLibrary","loadImage",0x76735dc8,"lime.utils.AssetLibrary.loadImage","lime/utils/AssetLibrary.hx",618,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_637_loadText,"lime.utils.AssetLibrary","loadText",0xc657fae0,"lime.utils.AssetLibrary.loadText","lime/utils/AssetLibrary.hx",637,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_667_unload,"lime.utils.AssetLibrary","unload",0x6003f8ac,"lime.utils.AssetLibrary.unload","lime/utils/AssetLibrary.hx",667,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_674___assetLoaded,"lime.utils.AssetLibrary","__assetLoaded",0x549222e8,"lime.utils.AssetLibrary.__assetLoaded","lime/utils/AssetLibrary.hx",674,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_723___fromManifest,"lime.utils.AssetLibrary","__fromManifest",0xf24ba706,"lime.utils.AssetLibrary.__fromManifest","lime/utils/AssetLibrary.hx",723,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_808_loadAudioBuffer_onComplete,"lime.utils.AssetLibrary","loadAudioBuffer_onComplete",0xd987b254,"lime.utils.AssetLibrary.loadAudioBuffer_onComplete","lime/utils/AssetLibrary.hx",808,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_840_loadBytes_onComplete,"lime.utils.AssetLibrary","loadBytes_onComplete",0xaa249a3f,"lime.utils.AssetLibrary.loadBytes_onComplete","lime/utils/AssetLibrary.hx",840,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_848_loadFont_onComplete,"lime.utils.AssetLibrary","loadFont_onComplete",0x9f1c7155,"lime.utils.AssetLibrary.loadFont_onComplete","lime/utils/AssetLibrary.hx",848,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_856_loadImage_onComplete,"lime.utils.AssetLibrary","loadImage_onComplete",0xa0d6094f,"lime.utils.AssetLibrary.loadImage_onComplete","lime/utils/AssetLibrary.hx",856,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_864_loadText_onComplete,"lime.utils.AssetLibrary","loadText_onComplete",0xe39ed337,"lime.utils.AssetLibrary.loadText_onComplete","lime/utils/AssetLibrary.hx",864,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_874_load_onError,"lime.utils.AssetLibrary","load_onError",0xb5eacb3d,"lime.utils.AssetLibrary.load_onError","lime/utils/AssetLibrary.hx",874,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_890_load_onProgress,"lime.utils.AssetLibrary","load_onProgress",0x56294f58,"lime.utils.AssetLibrary.load_onProgress","lime/utils/AssetLibrary.hx",890,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_106_fromBytes,"lime.utils.AssetLibrary","fromBytes",0x0ff3e514,"lime.utils.AssetLibrary.fromBytes","lime/utils/AssetLibrary.hx",106,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_113_fromFile,"lime.utils.AssetLibrary","fromFile",0xaa45f9f3,"lime.utils.AssetLibrary.fromFile","lime/utils/AssetLibrary.hx",113,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_118_fromManifest,"lime.utils.AssetLibrary","fromManifest",0x0354aea6,"lime.utils.AssetLibrary.fromManifest","lime/utils/AssetLibrary.hx",118,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_581_loadFromBytes,"lime.utils.AssetLibrary","loadFromBytes",0x12cf6b8e,"lime.utils.AssetLibrary.loadFromBytes","lime/utils/AssetLibrary.hx",581,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_579_loadFromBytes,"lime.utils.AssetLibrary","loadFromBytes",0x12cf6b8e,"lime.utils.AssetLibrary.loadFromBytes","lime/utils/AssetLibrary.hx",579,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_592_loadFromFile,"lime.utils.AssetLibrary","loadFromFile",0xee0460b9,"lime.utils.AssetLibrary.loadFromFile","lime/utils/AssetLibrary.hx",592,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_590_loadFromFile,"lime.utils.AssetLibrary","loadFromFile",0xee0460b9,"lime.utils.AssetLibrary.loadFromFile","lime/utils/AssetLibrary.hx",590,0x8b4b8bbb) HX_LOCAL_STACK_FRAME(_hx_pos_302b88cc6233d9fb_599_loadFromManifest,"lime.utils.AssetLibrary","loadFromManifest",0xde94f06c,"lime.utils.AssetLibrary.loadFromManifest","lime/utils/AssetLibrary.hx",599,0x8b4b8bbb) namespace lime{ namespace utils{ void AssetLibrary_obj::__construct(){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_25_new) HXLINE( 47) this->types = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 46) this->sizes = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 44) this->preload = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 43) this->paths = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 42) this->pathGroups = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 40) this->classTypes = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 39) this->cachedText = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 38) this->cachedImages = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 37) this->cachedFonts = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 36) this->cachedBytes = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 35) this->cachedAudioBuffers = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 28) this->onChange = ::lime::app::_Event_Void_Void_obj::__alloc( HX_CTX ); HXLINE( 52) this->bytesLoaded = (int)0; HXLINE( 53) this->bytesTotal = (int)0; } Dynamic AssetLibrary_obj::__CreateEmpty() { return new AssetLibrary_obj; } void *AssetLibrary_obj::_hx_vtable = 0; Dynamic AssetLibrary_obj::__Create(hx::DynamicArray inArgs) { hx::ObjectPtr< AssetLibrary_obj > _hx_result = new AssetLibrary_obj(); _hx_result->__construct(); return _hx_result; } bool AssetLibrary_obj::_hx_isInstanceOf(int inClassId) { return inClassId==(int)0x00000001 || inClassId==(int)0x425552e3; } bool AssetLibrary_obj::exists(::String id,::String type){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_58_exists) HXLINE( 60) ::String requestedType; HXDLIN( 60) if (hx::IsNotNull( type )) { HXLINE( 60) requestedType = type; } else { HXLINE( 60) requestedType = null(); } HXLINE( 61) ::String assetType = ( (::String)(this->types->get(id)) ); HXLINE( 63) if (hx::IsNotNull( assetType )) { HXLINE( 65) bool _hx_tmp; HXDLIN( 65) if ((assetType != requestedType)) { HXLINE( 65) bool _hx_tmp1; HXDLIN( 65) if ((requestedType != HX_("SOUND",af,c4,ba,fe))) { HXLINE( 65) _hx_tmp1 = (requestedType == HX_("MUSIC",85,08,49,8e)); } else { HXLINE( 65) _hx_tmp1 = true; } HXDLIN( 65) if (_hx_tmp1) { HXLINE( 65) if ((assetType != HX_("MUSIC",85,08,49,8e))) { HXLINE( 65) _hx_tmp = (assetType == HX_("SOUND",af,c4,ba,fe)); } else { HXLINE( 65) _hx_tmp = true; } } else { HXLINE( 65) _hx_tmp = false; } } else { HXLINE( 65) _hx_tmp = true; } HXDLIN( 65) if (_hx_tmp) { HXLINE( 67) return true; } HXLINE( 89) bool _hx_tmp2; HXDLIN( 89) bool _hx_tmp3; HXDLIN( 89) if ((requestedType != HX_("BINARY",01,68,8e,9f))) { HXLINE( 89) _hx_tmp3 = hx::IsNull( requestedType ); } else { HXLINE( 89) _hx_tmp3 = true; } HXDLIN( 89) if (!(_hx_tmp3)) { HXLINE( 89) if ((assetType == HX_("BINARY",01,68,8e,9f))) { HXLINE( 89) _hx_tmp2 = (requestedType == HX_("TEXT",ad,94,ba,37)); } else { HXLINE( 89) _hx_tmp2 = false; } } else { HXLINE( 89) _hx_tmp2 = true; } HXDLIN( 89) if (_hx_tmp2) { HXLINE( 91) return true; } } HXLINE( 99) return false; } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,exists,return ) ::Dynamic AssetLibrary_obj::getAsset(::String id,::String type){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_154_getAsset) HXLINE( 154) ::String _hx_switch_0 = type; if ( (_hx_switch_0==HX_("BINARY",01,68,8e,9f)) ){ HXLINE( 154) return this->getBytes(id); HXDLIN( 154) goto _hx_goto_2; } if ( (_hx_switch_0==HX_("FONT",cf,25,81,2e)) ){ HXLINE( 154) return this->getFont(id); HXDLIN( 154) goto _hx_goto_2; } if ( (_hx_switch_0==HX_("IMAGE",3b,57,57,3b)) ){ HXLINE( 154) return this->getImage(id); HXDLIN( 154) goto _hx_goto_2; } if ( (_hx_switch_0==HX_("MUSIC",85,08,49,8e)) || (_hx_switch_0==HX_("SOUND",af,c4,ba,fe)) ){ HXLINE( 154) return this->getAudioBuffer(id); HXDLIN( 154) goto _hx_goto_2; } if ( (_hx_switch_0==HX_("TEMPLATE",3a,78,cd,05)) ){ HXLINE( 162) HX_STACK_DO_THROW((HX_("Not sure how to get template: ",a1,19,8c,ad) + id)); HXDLIN( 162) goto _hx_goto_2; } if ( (_hx_switch_0==HX_("TEXT",ad,94,ba,37)) ){ HXLINE( 154) return this->getText(id); HXDLIN( 154) goto _hx_goto_2; } /* default */{ HXLINE( 163) HX_STACK_DO_THROW((HX_("Unknown asset type: ",86,5e,db,f9) + type)); } _hx_goto_2:; HXLINE( 154) return null(); } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,getAsset,return ) ::lime::media::AudioBuffer AssetLibrary_obj::getAudioBuffer(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_172_getAudioBuffer) HXLINE( 172) if (this->cachedAudioBuffers->exists(id)) { HXLINE( 174) return this->cachedAudioBuffers->get(id).StaticCast< ::lime::media::AudioBuffer >(); } else { HXLINE( 176) if (this->classTypes->exists(id)) { HXLINE( 186) return ::lime::media::AudioBuffer_obj::fromBytes(hx::TCast< ::haxe::io::Bytes >::cast(::Type_obj::createInstance(this->classTypes->get(id).StaticCast< hx::Class >(),::cpp::VirtualArray_obj::__new(0)))); } else { HXLINE( 192) return ::lime::media::AudioBuffer_obj::fromFile(( (::String)(this->paths->get(id)) )); } } HXLINE( 172) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,getAudioBuffer,return ) ::haxe::io::Bytes AssetLibrary_obj::getBytes(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_201_getBytes) HXLINE( 201) if (this->cachedBytes->exists(id)) { HXLINE( 203) return this->cachedBytes->get(id).StaticCast< ::haxe::io::Bytes >(); } else { HXLINE( 205) if (this->cachedText->exists(id)) { HXLINE( 207) ::haxe::io::Bytes bytes = ::lime::utils::_Bytes::Bytes_Impl__obj::ofString(( (::String)(this->cachedText->get(id)) )); HXLINE( 208) this->cachedBytes->set(id,bytes); HXLINE( 209) return bytes; } else { HXLINE( 211) if (this->classTypes->exists(id)) { HXLINE( 236) return ::Type_obj::createInstance(this->classTypes->get(id).StaticCast< hx::Class >(),::cpp::VirtualArray_obj::__new(0)); } else { HXLINE( 242) return ::lime::utils::_Bytes::Bytes_Impl__obj::fromFile(( (::String)(this->paths->get(id)) )); } } } HXLINE( 201) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,getBytes,return ) ::lime::text::Font AssetLibrary_obj::getFont(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_251_getFont) HXLINE( 251) if (this->cachedFonts->exists(id)) { HXLINE( 253) return this->cachedFonts->get(id).StaticCast< ::lime::text::Font >(); } else { HXLINE( 255) if (this->classTypes->exists(id)) { HXLINE( 267) return ::Type_obj::createInstance(this->classTypes->get(id).StaticCast< hx::Class >(),::cpp::VirtualArray_obj::__new(0)); } else { HXLINE( 273) return ::lime::text::Font_obj::fromFile(( (::String)(this->paths->get(id)) )); } } HXLINE( 251) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,getFont,return ) ::lime::graphics::Image AssetLibrary_obj::getImage(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_282_getImage) HXLINE( 282) if (this->cachedImages->exists(id)) { HXLINE( 284) return this->cachedImages->get(id).StaticCast< ::lime::graphics::Image >(); } else { HXLINE( 286) if (this->classTypes->exists(id)) { HXLINE( 294) return ::Type_obj::createInstance(this->classTypes->get(id).StaticCast< hx::Class >(),::cpp::VirtualArray_obj::__new(0)); } else { HXLINE( 300) return ::lime::graphics::Image_obj::fromFile(( (::String)(this->paths->get(id)) )); } } HXLINE( 282) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,getImage,return ) ::String AssetLibrary_obj::getPath(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_309_getPath) HXLINE( 309) return this->paths->get(id); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,getPath,return ) ::String AssetLibrary_obj::getText(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_316_getText) HXLINE( 316) if (this->cachedText->exists(id)) { HXLINE( 318) return this->cachedText->get(id); } else { HXLINE( 322) ::haxe::io::Bytes bytes = this->getBytes(id); HXLINE( 324) if (hx::IsNull( bytes )) { HXLINE( 326) return null(); } else { HXLINE( 330) return bytes->getString((int)0,bytes->length); } } HXLINE( 316) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,getText,return ) bool AssetLibrary_obj::isLocal(::String id,::String type){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_343_isLocal) HXLINE( 343) return true; } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,isLocal,return ) ::Array< ::String > AssetLibrary_obj::list(::String type){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_376_list) HXLINE( 378) ::String requestedType; HXDLIN( 378) if (hx::IsNotNull( type )) { HXLINE( 378) requestedType = type; } else { HXLINE( 378) requestedType = null(); } HXLINE( 379) ::Array< ::String > items = ::Array_obj< ::String >::__new(0); HXLINE( 381) { HXLINE( 381) ::Dynamic id = this->types->keys(); HXDLIN( 381) while(( (bool)(id->__Field(HX_("hasNext",6d,a5,46,18),hx::paccDynamic)()) )){ HXLINE( 381) ::String id1 = ( (::String)(id->__Field(HX_("next",f3,84,02,49),hx::paccDynamic)()) ); HXLINE( 383) bool _hx_tmp; HXDLIN( 383) if (hx::IsNotNull( requestedType )) { HXLINE( 383) _hx_tmp = this->exists(id1,type); } else { HXLINE( 383) _hx_tmp = true; } HXDLIN( 383) if (_hx_tmp) { HXLINE( 385) items->push(id1); } } } HXLINE( 391) return items; } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,list,return ) ::lime::app::Future AssetLibrary_obj::loadAsset(::String id,::String type){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_398_loadAsset) HXLINE( 398) ::String _hx_switch_0 = type; if ( (_hx_switch_0==HX_("BINARY",01,68,8e,9f)) ){ HXLINE( 398) return this->loadBytes(id); HXDLIN( 398) goto _hx_goto_13; } if ( (_hx_switch_0==HX_("FONT",cf,25,81,2e)) ){ HXLINE( 398) return this->loadFont(id); HXDLIN( 398) goto _hx_goto_13; } if ( (_hx_switch_0==HX_("IMAGE",3b,57,57,3b)) ){ HXLINE( 398) return this->loadImage(id); HXDLIN( 398) goto _hx_goto_13; } if ( (_hx_switch_0==HX_("MUSIC",85,08,49,8e)) || (_hx_switch_0==HX_("SOUND",af,c4,ba,fe)) ){ HXLINE( 398) return this->loadAudioBuffer(id); HXDLIN( 398) goto _hx_goto_13; } if ( (_hx_switch_0==HX_("TEMPLATE",3a,78,cd,05)) ){ HXLINE( 406) HX_STACK_DO_THROW((HX_("Not sure how to load template: ",43,70,39,d8) + id)); HXDLIN( 406) goto _hx_goto_13; } if ( (_hx_switch_0==HX_("TEXT",ad,94,ba,37)) ){ HXLINE( 398) return this->loadText(id); HXDLIN( 398) goto _hx_goto_13; } /* default */{ HXLINE( 407) HX_STACK_DO_THROW((HX_("Unknown asset type: ",86,5e,db,f9) + type)); } _hx_goto_13:; HXLINE( 398) return null(); } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,loadAsset,return ) ::lime::app::Future AssetLibrary_obj::load(){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_414_load) HXLINE( 416) if (this->loaded) { HXLINE( 418) return ::lime::app::Future_obj::withValue(hx::ObjectPtr<OBJ_>(this)); } HXLINE( 422) if (hx::IsNull( this->promise )) { HXLINE( 424) this->promise = ::lime::app::Promise_lime_utils_AssetLibrary_obj::__alloc( HX_CTX ); HXLINE( 425) this->bytesLoadedCache = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXLINE( 427) this->assetsLoaded = (int)0; HXLINE( 428) this->assetsTotal = (int)1; HXLINE( 430) { HXLINE( 430) ::Dynamic id = this->preload->keys(); HXDLIN( 430) while(( (bool)(id->__Field(HX_("hasNext",6d,a5,46,18),hx::paccDynamic)()) )){ HXLINE( 430) ::String id1 = ( (::String)(id->__Field(HX_("next",f3,84,02,49),hx::paccDynamic)()) ); HXLINE( 432) if (!(( (bool)(this->preload->get(id1)) ))) { HXLINE( 432) continue; } HXLINE( 434) ::String _hx_tmp = ((((HX_("Preloading asset: ",4f,4a,58,bd) + id1) + HX_(" [",3b,1c,00,00)) + ( (::String)(this->types->get(id1)) )) + HX_("]",5d,00,00,00)); HXDLIN( 434) ::lime::utils::Log_obj::verbose(_hx_tmp,hx::SourceInfo(HX_("AssetLibrary.hx",93,ac,ef,b3),434,HX_("lime.utils.AssetLibrary",21,55,e9,fc),HX_("load",26,9a,b7,47))); HXLINE( 436) { HXLINE( 436) ::String _g = ( (::String)(::haxe::IMap_obj::get(this->types,id1)) ); HXDLIN( 436) if (hx::IsNotNull( _g )) { HXLINE( 436) ::String _hx_switch_0 = _g; if ( (_hx_switch_0==HX_("BINARY",01,68,8e,9f)) ){ HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_0, ::Dynamic,f,::String,id2) HXARGC(2) void _hx_run(int a1,int a2){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_443_load) HXLINE( 443) f(id2,a1,a2); } HX_END_LOCAL_FUNC2((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_1,::String,id3, ::Dynamic,f1) HXARGC(1) void _hx_run( ::Dynamic a11){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_444_load) HXLINE( 444) f1(id3,a11); } HX_END_LOCAL_FUNC1((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_2,::String,id4, ::Dynamic,f2) HXARGC(1) void _hx_run( ::haxe::io::Bytes a12){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_445_load) HXLINE( 445) f2(id4,a12); } HX_END_LOCAL_FUNC1((void)) HXLINE( 440) this->assetsTotal++; HXLINE( 442) ::lime::app::Future future = this->loadBytes(id1); HXLINE( 443) ::Dynamic f = this->load_onProgress_dyn(); HXDLIN( 443) ::String id2 = id1; HXDLIN( 443) future->onProgress( ::Dynamic(new _hx_Closure_0(f,id2))); HXLINE( 444) ::Dynamic f1 = this->load_onError_dyn(); HXDLIN( 444) ::String id3 = id1; HXDLIN( 444) future->onError( ::Dynamic(new _hx_Closure_1(id3,f1))); HXLINE( 445) ::Dynamic f2 = this->loadBytes_onComplete_dyn(); HXDLIN( 445) ::String id4 = id1; HXDLIN( 445) future->onComplete( ::Dynamic(new _hx_Closure_2(id4,f2))); HXLINE( 438) goto _hx_goto_16; } if ( (_hx_switch_0==HX_("FONT",cf,25,81,2e)) ){ HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_3, ::Dynamic,f3,::String,id5) HXARGC(2) void _hx_run(int a13,int a21){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_452_load) HXLINE( 452) f3(id5,a13,a21); } HX_END_LOCAL_FUNC2((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_4,::String,id6, ::Dynamic,f4) HXARGC(1) void _hx_run( ::Dynamic a14){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_453_load) HXLINE( 453) f4(id6,a14); } HX_END_LOCAL_FUNC1((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_5, ::Dynamic,f5,::String,id7) HXARGC(1) void _hx_run( ::lime::text::Font a15){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_454_load) HXLINE( 454) f5(id7,a15); } HX_END_LOCAL_FUNC1((void)) HXLINE( 449) this->assetsTotal++; HXLINE( 451) ::lime::app::Future future1 = this->loadFont(id1); HXLINE( 452) ::Dynamic f3 = this->load_onProgress_dyn(); HXDLIN( 452) ::String id5 = id1; HXDLIN( 452) future1->onProgress( ::Dynamic(new _hx_Closure_3(f3,id5))); HXLINE( 453) ::Dynamic f4 = this->load_onError_dyn(); HXDLIN( 453) ::String id6 = id1; HXDLIN( 453) future1->onError( ::Dynamic(new _hx_Closure_4(id6,f4))); HXLINE( 454) ::Dynamic f5 = this->loadFont_onComplete_dyn(); HXDLIN( 454) ::String id7 = id1; HXDLIN( 454) future1->onComplete( ::Dynamic(new _hx_Closure_5(f5,id7))); HXLINE( 447) goto _hx_goto_16; } if ( (_hx_switch_0==HX_("IMAGE",3b,57,57,3b)) ){ HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_6, ::Dynamic,f6,::String,id8) HXARGC(2) void _hx_run(int a16,int a22){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_461_load) HXLINE( 461) f6(id8,a16,a22); } HX_END_LOCAL_FUNC2((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_7, ::Dynamic,f7,::String,id9) HXARGC(1) void _hx_run( ::Dynamic a17){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_462_load) HXLINE( 462) f7(id9,a17); } HX_END_LOCAL_FUNC1((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_8,::String,id10, ::Dynamic,f8) HXARGC(1) void _hx_run( ::lime::graphics::Image a18){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_463_load) HXLINE( 463) f8(id10,a18); } HX_END_LOCAL_FUNC1((void)) HXLINE( 458) this->assetsTotal++; HXLINE( 460) ::lime::app::Future future2 = this->loadImage(id1); HXLINE( 461) ::Dynamic f6 = this->load_onProgress_dyn(); HXDLIN( 461) ::String id8 = id1; HXDLIN( 461) future2->onProgress( ::Dynamic(new _hx_Closure_6(f6,id8))); HXLINE( 462) ::Dynamic f7 = this->load_onError_dyn(); HXDLIN( 462) ::String id9 = id1; HXDLIN( 462) future2->onError( ::Dynamic(new _hx_Closure_7(f7,id9))); HXLINE( 463) ::Dynamic f8 = this->loadImage_onComplete_dyn(); HXDLIN( 463) ::String id10 = id1; HXDLIN( 463) future2->onComplete( ::Dynamic(new _hx_Closure_8(id10,f8))); HXLINE( 456) goto _hx_goto_16; } if ( (_hx_switch_0==HX_("MUSIC",85,08,49,8e)) || (_hx_switch_0==HX_("SOUND",af,c4,ba,fe)) ){ HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_9,::String,id11, ::Dynamic,f9) HXARGC(2) void _hx_run(int a19,int a23){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_470_load) HXLINE( 470) f9(id11,a19,a23); } HX_END_LOCAL_FUNC2((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_10, ::Dynamic,f10,::String,id12) HXARGC(1) void _hx_run( ::Dynamic a110){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_471_load) HXLINE( 471) f10(id12,a110); } HX_END_LOCAL_FUNC1((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_11,::String,id13, ::Dynamic,f11) HXARGC(1) void _hx_run( ::lime::media::AudioBuffer a111){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_472_load) HXLINE( 472) f11(id13,a111); } HX_END_LOCAL_FUNC1((void)) HXLINE( 467) this->assetsTotal++; HXLINE( 469) ::lime::app::Future future3 = this->loadAudioBuffer(id1); HXLINE( 470) ::Dynamic f9 = this->load_onProgress_dyn(); HXDLIN( 470) ::String id11 = id1; HXDLIN( 470) future3->onProgress( ::Dynamic(new _hx_Closure_9(id11,f9))); HXLINE( 471) ::Dynamic f10 = this->load_onError_dyn(); HXDLIN( 471) ::String id12 = id1; HXDLIN( 471) future3->onError( ::Dynamic(new _hx_Closure_10(f10,id12))); HXLINE( 472) ::Dynamic f11 = this->loadAudioBuffer_onComplete_dyn(); HXDLIN( 472) ::String id13 = id1; HXDLIN( 472) future3->onComplete( ::Dynamic(new _hx_Closure_11(id13,f11))); HXLINE( 465) goto _hx_goto_16; } if ( (_hx_switch_0==HX_("TEXT",ad,94,ba,37)) ){ HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_12,::String,id14, ::Dynamic,f12) HXARGC(2) void _hx_run(int a112,int a24){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_479_load) HXLINE( 479) f12(id14,a112,a24); } HX_END_LOCAL_FUNC2((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_13,::String,id15, ::Dynamic,f13) HXARGC(1) void _hx_run( ::Dynamic a113){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_480_load) HXLINE( 480) f13(id15,a113); } HX_END_LOCAL_FUNC1((void)) HX_BEGIN_LOCAL_FUNC_S2(hx::LocalFunc,_hx_Closure_14,::String,id16, ::Dynamic,f14) HXARGC(1) void _hx_run(::String a114){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_481_load) HXLINE( 481) f14(id16,a114); } HX_END_LOCAL_FUNC1((void)) HXLINE( 476) this->assetsTotal++; HXLINE( 478) ::lime::app::Future future4 = this->loadText(id1); HXLINE( 479) ::Dynamic f12 = this->load_onProgress_dyn(); HXDLIN( 479) ::String id14 = id1; HXDLIN( 479) future4->onProgress( ::Dynamic(new _hx_Closure_12(id14,f12))); HXLINE( 480) ::Dynamic f13 = this->load_onError_dyn(); HXDLIN( 480) ::String id15 = id1; HXDLIN( 480) future4->onError( ::Dynamic(new _hx_Closure_13(id15,f13))); HXLINE( 481) ::Dynamic f14 = this->loadText_onComplete_dyn(); HXDLIN( 481) ::String id16 = id1; HXDLIN( 481) future4->onComplete( ::Dynamic(new _hx_Closure_14(id16,f14))); HXLINE( 474) goto _hx_goto_16; } /* default */{ } _hx_goto_16:; } } } } HXLINE( 489) this->_hx___assetLoaded(null()); } HXLINE( 493) return this->promise->future; } HX_DEFINE_DYNAMIC_FUNC0(AssetLibrary_obj,load,return ) ::lime::app::Future AssetLibrary_obj::loadAudioBuffer(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_500_loadAudioBuffer) HXLINE( 500) if (this->cachedAudioBuffers->exists(id)) { HXLINE( 502) return ::lime::app::Future_obj::withValue(this->cachedAudioBuffers->get(id).StaticCast< ::lime::media::AudioBuffer >()); } else { HXLINE( 504) if (this->classTypes->exists(id)) { HXLINE( 506) return ::lime::app::Future_obj::withValue(::Type_obj::createInstance(this->classTypes->get(id).StaticCast< hx::Class >(),::cpp::VirtualArray_obj::__new(0))); } else { HXLINE( 510) if (this->pathGroups->exists(id)) { HXLINE( 512) return ::lime::media::AudioBuffer_obj::loadFromFiles(( (::Array< ::String >)(this->pathGroups->get(id)) )); } else { HXLINE( 516) return ::lime::media::AudioBuffer_obj::loadFromFile(( (::String)(this->paths->get(id)) )); } } } HXLINE( 500) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,loadAudioBuffer,return ) ::lime::app::Future AssetLibrary_obj::loadBytes(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_527_loadBytes) HXLINE( 527) if (this->cachedBytes->exists(id)) { HXLINE( 529) return ::lime::app::Future_obj::withValue(this->cachedBytes->get(id).StaticCast< ::haxe::io::Bytes >()); } else { HXLINE( 531) if (this->classTypes->exists(id)) { HXLINE( 536) return ::lime::app::Future_obj::withValue(::Type_obj::createInstance(this->classTypes->get(id).StaticCast< hx::Class >(),::cpp::VirtualArray_obj::__new(0))); } else { HXLINE( 541) return ::lime::utils::_Bytes::Bytes_Impl__obj::loadFromFile(( (::String)(this->paths->get(id)) )); } } HXLINE( 527) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,loadBytes,return ) ::lime::app::Future AssetLibrary_obj::loadFont(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_550_loadFont) HXLINE( 550) if (this->cachedFonts->exists(id)) { HXLINE( 552) return ::lime::app::Future_obj::withValue(this->cachedFonts->get(id).StaticCast< ::lime::text::Font >()); } else { HXLINE( 554) if (this->classTypes->exists(id)) { HXLINE( 556) ::lime::text::Font font = ( ( ::lime::text::Font)(::Type_obj::createInstance(this->classTypes->get(id).StaticCast< hx::Class >(),::cpp::VirtualArray_obj::__new(0))) ); HXLINE( 561) return ::lime::app::Future_obj::withValue(font); } else { HXLINE( 569) return ::lime::text::Font_obj::loadFromFile(( (::String)(this->paths->get(id)) )); } } HXLINE( 550) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,loadFont,return ) ::lime::app::Future AssetLibrary_obj::loadImage(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_618_loadImage) HXLINE( 618) if (this->cachedImages->exists(id)) { HXLINE( 620) return ::lime::app::Future_obj::withValue(this->cachedImages->get(id).StaticCast< ::lime::graphics::Image >()); } else { HXLINE( 622) if (this->classTypes->exists(id)) { HXLINE( 624) return ::lime::app::Future_obj::withValue(::Type_obj::createInstance(this->classTypes->get(id).StaticCast< hx::Class >(),::cpp::VirtualArray_obj::__new(0))); } else { HXLINE( 628) return ::lime::graphics::Image_obj::loadFromFile(( (::String)(this->paths->get(id)) )); } } HXLINE( 618) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,loadImage,return ) ::lime::app::Future AssetLibrary_obj::loadText(::String id){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_637_loadText) HXLINE( 637) if (this->cachedText->exists(id)) { HXLINE( 639) return ::lime::app::Future_obj::withValue(this->cachedText->get(id)); } else { HXLINE( 641) bool _hx_tmp; HXDLIN( 641) if (!(this->cachedBytes->exists(id))) { HXLINE( 641) _hx_tmp = this->classTypes->exists(id); } else { HXLINE( 641) _hx_tmp = true; } HXDLIN( 641) if (_hx_tmp) { HXLINE( 643) ::haxe::io::Bytes bytes = this->getBytes(id); HXLINE( 645) if (hx::IsNull( bytes )) { HXLINE( 647) return ::lime::app::Future_obj::withValue(null()); } else { HXLINE( 651) ::String text = bytes->getString((int)0,bytes->length); HXLINE( 652) this->cachedText->set(id,text); HXLINE( 653) return ::lime::app::Future_obj::withValue(text); } } else { HXLINE( 659) ::lime::net::_HTTPRequest_String request = ::lime::net::_HTTPRequest_String_obj::__alloc( HX_CTX ,null()); HXLINE( 660) return request->load(( (::String)(this->paths->get(id)) )); } } HXLINE( 637) return null(); } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,loadText,return ) void AssetLibrary_obj::unload(){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_667_unload) } HX_DEFINE_DYNAMIC_FUNC0(AssetLibrary_obj,unload,(void)) void AssetLibrary_obj::_hx___assetLoaded(::String id){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_674___assetLoaded) HXLINE( 676) this->assetsLoaded++; HXLINE( 678) if (hx::IsNotNull( id )) { HXLINE( 680) ::String _hx_tmp = ((((HX_("Loaded asset: ",9b,25,2e,eb) + id) + HX_(" [",3b,1c,00,00)) + ( (::String)(this->types->get(id)) )) + HX_("] (",a5,ad,46,00)); HXDLIN( 680) ::String _hx_tmp1 = ((_hx_tmp + (this->assetsLoaded - (int)1)) + HX_("/",2f,00,00,00)); HXDLIN( 680) ::lime::utils::Log_obj::verbose(((_hx_tmp1 + (this->assetsTotal - (int)1)) + HX_(")",29,00,00,00)),hx::SourceInfo(HX_("AssetLibrary.hx",93,ac,ef,b3),680,HX_("lime.utils.AssetLibrary",21,55,e9,fc),HX_("__assetLoaded",f5,7a,49,36))); } HXLINE( 684) if (hx::IsNotNull( id )) { HXLINE( 686) ::Dynamic size = this->sizes->get(id); HXLINE( 688) if (!(this->bytesLoadedCache->exists(id))) { HXLINE( 690) ::lime::utils::AssetLibrary _hx_tmp2 = hx::ObjectPtr<OBJ_>(this); HXDLIN( 690) _hx_tmp2->bytesLoaded = (_hx_tmp2->bytesLoaded + size); } else { HXLINE( 694) ::Dynamic cache = this->bytesLoadedCache->get(id); HXLINE( 696) if (hx::IsLess( cache,size )) { HXLINE( 698) ::lime::utils::AssetLibrary _hx_tmp3 = hx::ObjectPtr<OBJ_>(this); HXDLIN( 698) _hx_tmp3->bytesLoaded = (_hx_tmp3->bytesLoaded + (size - cache)); } } HXLINE( 704) this->bytesLoadedCache->set(id,size); } HXLINE( 708) if ((this->assetsLoaded < this->assetsTotal)) { HXLINE( 710) this->promise->progress(this->bytesLoaded,this->bytesTotal); } else { HXLINE( 714) this->loaded = true; HXLINE( 715) this->promise->progress(this->bytesTotal,this->bytesTotal); HXLINE( 716) this->promise->complete(hx::ObjectPtr<OBJ_>(this)); } } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,_hx___assetLoaded,(void)) void AssetLibrary_obj::_hx___fromManifest( ::lime::utils::AssetManifest manifest){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_723___fromManifest) HXLINE( 725) bool hasSize = (manifest->version >= (int)2); HXLINE( 726) int size; HXDLIN( 726) ::String id; HXDLIN( 726) ::Array< ::String > pathGroup; HXDLIN( 726) hx::Class classRef; HXLINE( 728) ::String basePath = manifest->rootPath; HXLINE( 729) if (hx::IsNull( basePath )) { HXLINE( 729) basePath = HX_("",00,00,00,00); } HXLINE( 730) if ((basePath != HX_("",00,00,00,00))) { HXLINE( 730) basePath = (basePath + HX_("/",2f,00,00,00)); } HXLINE( 732) { HXLINE( 732) int _g = (int)0; HXDLIN( 732) ::cpp::VirtualArray _g1 = manifest->assets; HXDLIN( 732) while((_g < _g1->get_length())){ HXLINE( 732) ::Dynamic asset = _g1->__get(_g); HXDLIN( 732) _g = (_g + (int)1); HXLINE( 734) if (hasSize) { HXLINE( 734) size = ( (int)(asset->__Field(HX_("size",c1,a0,53,4c),hx::paccDynamic)) ); } else { HXLINE( 734) size = (int)100; } HXLINE( 735) id = ( (::String)(asset->__Field(HX_("id",db,5b,00,00),hx::paccDynamic)) ); HXLINE( 737) if (::Reflect_obj::hasField(asset,HX_("path",a5,e5,51,4a))) { HXLINE( 739) ::Dynamic this1 = this->paths; HXDLIN( 739) ( ( ::haxe::ds::StringMap)(this1) )->set(id,(basePath + ::Std_obj::string(::Reflect_obj::field(asset,HX_("path",a5,e5,51,4a))))); } HXLINE( 743) if (::Reflect_obj::hasField(asset,HX_("pathGroup",5a,a7,b4,8f))) { HXLINE( 745) pathGroup = ( (::Array< ::String >)(::Reflect_obj::field(asset,HX_("pathGroup",5a,a7,b4,8f))) ); HXLINE( 747) { HXLINE( 747) int _g3 = (int)0; HXDLIN( 747) int _g2 = pathGroup->length; HXDLIN( 747) while((_g3 < _g2)){ HXLINE( 747) _g3 = (_g3 + (int)1); HXDLIN( 747) int i = (_g3 - (int)1); HXLINE( 749) pathGroup[i] = (basePath + pathGroup->__get(i)); } } HXLINE( 753) this->pathGroups->set(id,pathGroup); } HXLINE( 757) this->sizes->set(id,size); HXLINE( 758) this->types->set(id,( (::String)(asset->__Field(HX_("type",ba,f2,08,4d),hx::paccDynamic)) )); HXLINE( 760) if (::Reflect_obj::hasField(asset,HX_("preload",c9,47,43,35))) { HXLINE( 762) ::Dynamic this2 = this->preload; HXDLIN( 762) ( ( ::haxe::ds::StringMap)(this2) )->set(id,( (bool)(::Reflect_obj::field(asset,HX_("preload",c9,47,43,35))) )); } HXLINE( 766) if (::Reflect_obj::hasField(asset,HX_("className",a3,92,3d,dc))) { HXLINE( 768) classRef = ::Type_obj::resolveClass(( (::String)(::Reflect_obj::field(asset,HX_("className",a3,92,3d,dc))) )); HXLINE( 778) this->classTypes->set(id,classRef); } } } HXLINE( 784) this->bytesTotal = (int)0; HXLINE( 786) { HXLINE( 786) int _g4 = (int)0; HXDLIN( 786) ::cpp::VirtualArray _g11 = manifest->assets; HXDLIN( 786) while((_g4 < _g11->get_length())){ HXLINE( 786) ::Dynamic asset1 = _g11->__get(_g4); HXDLIN( 786) _g4 = (_g4 + (int)1); HXLINE( 788) id = ( (::String)(asset1->__Field(HX_("id",db,5b,00,00),hx::paccDynamic)) ); HXLINE( 790) bool _hx_tmp; HXDLIN( 790) if (this->preload->exists(id)) { HXLINE( 790) _hx_tmp = ( (bool)(this->preload->get(id)) ); } else { HXLINE( 790) _hx_tmp = false; } HXDLIN( 790) if (_hx_tmp) { HXLINE( 792) ::lime::utils::AssetLibrary _hx_tmp1 = hx::ObjectPtr<OBJ_>(this); HXDLIN( 792) int _hx_tmp2 = _hx_tmp1->bytesTotal; HXDLIN( 792) _hx_tmp1->bytesTotal = (_hx_tmp2 + this->sizes->get(id)); } } } } HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,_hx___fromManifest,(void)) void AssetLibrary_obj::loadAudioBuffer_onComplete(::String id, ::lime::media::AudioBuffer audioBuffer){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_808_loadAudioBuffer_onComplete) HXLINE( 810) this->cachedAudioBuffers->set(id,audioBuffer); HXLINE( 812) if (this->pathGroups->exists(id)) { HXLINE( 814) ::Array< ::String > pathGroup = ( (::Array< ::String >)(this->pathGroups->get(id)) ); HXLINE( 816) { HXLINE( 816) ::Dynamic otherID = this->pathGroups->keys(); HXDLIN( 816) while(( (bool)(otherID->__Field(HX_("hasNext",6d,a5,46,18),hx::paccDynamic)()) )){ HXLINE( 816) ::String otherID1 = ( (::String)(otherID->__Field(HX_("next",f3,84,02,49),hx::paccDynamic)()) ); HXLINE( 818) if ((otherID1 == id)) { HXLINE( 818) continue; } HXLINE( 820) { HXLINE( 820) int _g = (int)0; HXDLIN( 820) while((_g < pathGroup->length)){ HXLINE( 820) ::String path = pathGroup->__get(_g); HXDLIN( 820) _g = (_g + (int)1); HXLINE( 822) if ((( (::Array< ::String >)(this->pathGroups->get(otherID1)) )->indexOf(path,null()) > (int)-1)) { HXLINE( 824) this->cachedAudioBuffers->set(otherID1,audioBuffer); HXLINE( 825) goto _hx_goto_45; } } _hx_goto_45:; } } } } HXLINE( 835) this->_hx___assetLoaded(id); } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,loadAudioBuffer_onComplete,(void)) void AssetLibrary_obj::loadBytes_onComplete(::String id, ::haxe::io::Bytes bytes){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_840_loadBytes_onComplete) HXLINE( 842) this->cachedBytes->set(id,bytes); HXLINE( 843) this->_hx___assetLoaded(id); } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,loadBytes_onComplete,(void)) void AssetLibrary_obj::loadFont_onComplete(::String id, ::lime::text::Font font){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_848_loadFont_onComplete) HXLINE( 850) this->cachedFonts->set(id,font); HXLINE( 851) this->_hx___assetLoaded(id); } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,loadFont_onComplete,(void)) void AssetLibrary_obj::loadImage_onComplete(::String id, ::lime::graphics::Image image){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_856_loadImage_onComplete) HXLINE( 858) this->cachedImages->set(id,image); HXLINE( 859) this->_hx___assetLoaded(id); } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,loadImage_onComplete,(void)) void AssetLibrary_obj::loadText_onComplete(::String id,::String text){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_864_loadText_onComplete) HXLINE( 866) this->cachedText->set(id,text); HXLINE( 867) this->_hx___assetLoaded(id); } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,loadText_onComplete,(void)) void AssetLibrary_obj::load_onError(::String id, ::Dynamic message){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_874_load_onError) HXLINE( 874) bool _hx_tmp; HXDLIN( 874) if (hx::IsNotNull( message )) { HXLINE( 874) _hx_tmp = hx::IsNotEq( message,HX_("",00,00,00,00) ); } else { HXLINE( 874) _hx_tmp = false; } HXDLIN( 874) if (_hx_tmp) { HXLINE( 876) ::lime::app::Promise_lime_utils_AssetLibrary _hx_tmp1 = this->promise; HXDLIN( 876) _hx_tmp1->error((((HX_("Error loading asset \"",d6,ff,4d,83) + id) + HX_("\": ",48,ff,19,00)) + ::Std_obj::string(message))); } else { HXLINE( 880) ::lime::app::Promise_lime_utils_AssetLibrary _hx_tmp2 = this->promise; HXDLIN( 880) _hx_tmp2->error(((HX_("Error loading asset \"",d6,ff,4d,83) + id) + HX_("\"",22,00,00,00))); } } HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,load_onError,(void)) void AssetLibrary_obj::load_onProgress(::String id,int bytesLoaded,int bytesTotal){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_890_load_onProgress) HXLINE( 890) if ((bytesLoaded > (int)0)) { HXLINE( 892) ::Dynamic size = this->sizes->get(id); HXLINE( 893) Float percent; HXLINE( 895) if ((bytesTotal > (int)0)) { HXLINE( 899) percent = ((Float)bytesLoaded / (Float)bytesTotal); HXLINE( 900) if ((percent > (int)1)) { HXLINE( 900) percent = (int)1; } HXLINE( 901) bytesLoaded = ::Math_obj::floor((percent * size)); } else { HXLINE( 903) if (hx::IsGreater( bytesLoaded,size )) { HXLINE( 905) bytesLoaded = size; } } HXLINE( 909) if (this->bytesLoadedCache->exists(id)) { HXLINE( 911) ::Dynamic cache = this->bytesLoadedCache->get(id); HXLINE( 913) if (hx::IsNotEq( bytesLoaded,cache )) { HXLINE( 915) ::lime::utils::AssetLibrary _hx_tmp = hx::ObjectPtr<OBJ_>(this); HXDLIN( 915) _hx_tmp->bytesLoaded = (_hx_tmp->bytesLoaded + (bytesLoaded - cache)); } } else { HXLINE( 921) ::lime::utils::AssetLibrary _hx_tmp1 = hx::ObjectPtr<OBJ_>(this); HXDLIN( 921) _hx_tmp1->bytesLoaded = (_hx_tmp1->bytesLoaded + bytesLoaded); } HXLINE( 925) this->bytesLoadedCache->set(id,bytesLoaded); HXLINE( 926) this->promise->progress(this->bytesLoaded,this->bytesTotal); } } HX_DEFINE_DYNAMIC_FUNC3(AssetLibrary_obj,load_onProgress,(void)) ::lime::utils::AssetLibrary AssetLibrary_obj::fromBytes( ::haxe::io::Bytes bytes,::String rootPath){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_106_fromBytes) HXLINE( 106) return ::lime::utils::AssetLibrary_obj::fromManifest(::lime::utils::AssetManifest_obj::fromBytes(bytes,rootPath)); } STATIC_HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,fromBytes,return ) ::lime::utils::AssetLibrary AssetLibrary_obj::fromFile(::String path,::String rootPath){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_113_fromFile) HXLINE( 113) return ::lime::utils::AssetLibrary_obj::fromManifest(::lime::utils::AssetManifest_obj::fromFile(path,rootPath)); } STATIC_HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,fromFile,return ) ::lime::utils::AssetLibrary AssetLibrary_obj::fromManifest( ::lime::utils::AssetManifest manifest){ HX_GC_STACKFRAME(&_hx_pos_302b88cc6233d9fb_118_fromManifest) HXLINE( 120) if (hx::IsNull( manifest )) { HXLINE( 120) return null(); } HXLINE( 122) ::lime::utils::AssetLibrary library = null(); HXLINE( 124) if (hx::IsNull( manifest->libraryType )) { HXLINE( 126) library = ::lime::utils::AssetLibrary_obj::__alloc( HX_CTX ); } else { HXLINE( 130) hx::Class libraryClass = ::Type_obj::resolveClass(manifest->libraryType); HXLINE( 132) if (hx::IsNotNull( libraryClass )) { HXLINE( 134) library = ( ( ::lime::utils::AssetLibrary)(::Type_obj::createInstance(libraryClass,manifest->libraryArgs)) ); } else { HXLINE( 138) ::lime::utils::Log_obj::warn((HX_("Could not find library type: ",a0,88,a8,78) + manifest->libraryType),hx::SourceInfo(HX_("AssetLibrary.hx",93,ac,ef,b3),138,HX_("lime.utils.AssetLibrary",21,55,e9,fc),HX_("fromManifest",39,d7,40,70))); HXLINE( 139) return null(); } } HXLINE( 145) library->_hx___fromManifest(manifest); HXLINE( 147) return library; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,fromManifest,return ) ::lime::app::Future AssetLibrary_obj::loadFromBytes( ::haxe::io::Bytes bytes,::String rootPath){ HX_BEGIN_LOCAL_FUNC_S0(hx::LocalFunc,_hx_Closure_0) HXARGC(1) ::lime::app::Future _hx_run( ::lime::utils::AssetManifest manifest){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_581_loadFromBytes) HXLINE( 581) return ::lime::utils::AssetLibrary_obj::loadFromManifest(manifest); } HX_END_LOCAL_FUNC1(return) HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_579_loadFromBytes) HXLINE( 579) return ::lime::utils::AssetManifest_obj::loadFromBytes(bytes,rootPath)->then( ::Dynamic(new _hx_Closure_0())); } STATIC_HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,loadFromBytes,return ) ::lime::app::Future AssetLibrary_obj::loadFromFile(::String path,::String rootPath){ HX_BEGIN_LOCAL_FUNC_S0(hx::LocalFunc,_hx_Closure_0) HXARGC(1) ::lime::app::Future _hx_run( ::lime::utils::AssetManifest manifest){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_592_loadFromFile) HXLINE( 592) return ::lime::utils::AssetLibrary_obj::loadFromManifest(manifest); } HX_END_LOCAL_FUNC1(return) HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_590_loadFromFile) HXLINE( 590) return ::lime::utils::AssetManifest_obj::loadFromFile(path,rootPath)->then( ::Dynamic(new _hx_Closure_0())); } STATIC_HX_DEFINE_DYNAMIC_FUNC2(AssetLibrary_obj,loadFromFile,return ) ::lime::app::Future AssetLibrary_obj::loadFromManifest( ::lime::utils::AssetManifest manifest){ HX_STACKFRAME(&_hx_pos_302b88cc6233d9fb_599_loadFromManifest) HXLINE( 601) ::lime::utils::AssetLibrary library = ::lime::utils::AssetLibrary_obj::fromManifest(manifest); HXLINE( 603) if (hx::IsNotNull( library )) { HXLINE( 605) return library->load(); } else { HXLINE( 609) return ::lime::app::Future_obj::withError(HX_("Could not load asset manifest",cd,c6,09,7f)); } HXLINE( 603) return null(); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(AssetLibrary_obj,loadFromManifest,return ) hx::ObjectPtr< AssetLibrary_obj > AssetLibrary_obj::__new() { hx::ObjectPtr< AssetLibrary_obj > __this = new AssetLibrary_obj(); __this->__construct(); return __this; } hx::ObjectPtr< AssetLibrary_obj > AssetLibrary_obj::__alloc(hx::Ctx *_hx_ctx) { AssetLibrary_obj *__this = (AssetLibrary_obj*)(hx::Ctx::alloc(_hx_ctx, sizeof(AssetLibrary_obj), true, "lime.utils.AssetLibrary")); *(void **)__this = AssetLibrary_obj::_hx_vtable; __this->__construct(); return __this; } AssetLibrary_obj::AssetLibrary_obj() { } void AssetLibrary_obj::__Mark(HX_MARK_PARAMS) { HX_MARK_BEGIN_CLASS(AssetLibrary); HX_MARK_MEMBER_NAME(onChange,"onChange"); HX_MARK_MEMBER_NAME(assetsLoaded,"assetsLoaded"); HX_MARK_MEMBER_NAME(assetsTotal,"assetsTotal"); HX_MARK_MEMBER_NAME(bytesLoaded,"bytesLoaded"); HX_MARK_MEMBER_NAME(bytesLoadedCache,"bytesLoadedCache"); HX_MARK_MEMBER_NAME(bytesTotal,"bytesTotal"); HX_MARK_MEMBER_NAME(cachedAudioBuffers,"cachedAudioBuffers"); HX_MARK_MEMBER_NAME(cachedBytes,"cachedBytes"); HX_MARK_MEMBER_NAME(cachedFonts,"cachedFonts"); HX_MARK_MEMBER_NAME(cachedImages,"cachedImages"); HX_MARK_MEMBER_NAME(cachedText,"cachedText"); HX_MARK_MEMBER_NAME(classTypes,"classTypes"); HX_MARK_MEMBER_NAME(loaded,"loaded"); HX_MARK_MEMBER_NAME(pathGroups,"pathGroups"); HX_MARK_MEMBER_NAME(paths,"paths"); HX_MARK_MEMBER_NAME(preload,"preload"); HX_MARK_MEMBER_NAME(promise,"promise"); HX_MARK_MEMBER_NAME(sizes,"sizes"); HX_MARK_MEMBER_NAME(types,"types"); HX_MARK_END_CLASS(); } void AssetLibrary_obj::__Visit(HX_VISIT_PARAMS) { HX_VISIT_MEMBER_NAME(onChange,"onChange"); HX_VISIT_MEMBER_NAME(assetsLoaded,"assetsLoaded"); HX_VISIT_MEMBER_NAME(assetsTotal,"assetsTotal"); HX_VISIT_MEMBER_NAME(bytesLoaded,"bytesLoaded"); HX_VISIT_MEMBER_NAME(bytesLoadedCache,"bytesLoadedCache"); HX_VISIT_MEMBER_NAME(bytesTotal,"bytesTotal"); HX_VISIT_MEMBER_NAME(cachedAudioBuffers,"cachedAudioBuffers"); HX_VISIT_MEMBER_NAME(cachedBytes,"cachedBytes"); HX_VISIT_MEMBER_NAME(cachedFonts,"cachedFonts"); HX_VISIT_MEMBER_NAME(cachedImages,"cachedImages"); HX_VISIT_MEMBER_NAME(cachedText,"cachedText"); HX_VISIT_MEMBER_NAME(classTypes,"classTypes"); HX_VISIT_MEMBER_NAME(loaded,"loaded"); HX_VISIT_MEMBER_NAME(pathGroups,"pathGroups"); HX_VISIT_MEMBER_NAME(paths,"paths"); HX_VISIT_MEMBER_NAME(preload,"preload"); HX_VISIT_MEMBER_NAME(promise,"promise"); HX_VISIT_MEMBER_NAME(sizes,"sizes"); HX_VISIT_MEMBER_NAME(types,"types"); } hx::Val AssetLibrary_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp) { switch(inName.length) { case 4: if (HX_FIELD_EQ(inName,"list") ) { return hx::Val( list_dyn()); } if (HX_FIELD_EQ(inName,"load") ) { return hx::Val( load_dyn()); } break; case 5: if (HX_FIELD_EQ(inName,"paths") ) { return hx::Val( paths); } if (HX_FIELD_EQ(inName,"sizes") ) { return hx::Val( sizes); } if (HX_FIELD_EQ(inName,"types") ) { return hx::Val( types); } break; case 6: if (HX_FIELD_EQ(inName,"loaded") ) { return hx::Val( loaded); } if (HX_FIELD_EQ(inName,"exists") ) { return hx::Val( exists_dyn()); } if (HX_FIELD_EQ(inName,"unload") ) { return hx::Val( unload_dyn()); } break; case 7: if (HX_FIELD_EQ(inName,"preload") ) { return hx::Val( preload); } if (HX_FIELD_EQ(inName,"promise") ) { return hx::Val( promise); } if (HX_FIELD_EQ(inName,"getFont") ) { return hx::Val( getFont_dyn()); } if (HX_FIELD_EQ(inName,"getPath") ) { return hx::Val( getPath_dyn()); } if (HX_FIELD_EQ(inName,"getText") ) { return hx::Val( getText_dyn()); } if (HX_FIELD_EQ(inName,"isLocal") ) { return hx::Val( isLocal_dyn()); } break; case 8: if (HX_FIELD_EQ(inName,"onChange") ) { return hx::Val( onChange); } if (HX_FIELD_EQ(inName,"getAsset") ) { return hx::Val( getAsset_dyn()); } if (HX_FIELD_EQ(inName,"getBytes") ) { return hx::Val( getBytes_dyn()); } if (HX_FIELD_EQ(inName,"getImage") ) { return hx::Val( getImage_dyn()); } if (HX_FIELD_EQ(inName,"loadFont") ) { return hx::Val( loadFont_dyn()); } if (HX_FIELD_EQ(inName,"loadText") ) { return hx::Val( loadText_dyn()); } break; case 9: if (HX_FIELD_EQ(inName,"loadAsset") ) { return hx::Val( loadAsset_dyn()); } if (HX_FIELD_EQ(inName,"loadBytes") ) { return hx::Val( loadBytes_dyn()); } if (HX_FIELD_EQ(inName,"loadImage") ) { return hx::Val( loadImage_dyn()); } break; case 10: if (HX_FIELD_EQ(inName,"bytesTotal") ) { return hx::Val( bytesTotal); } if (HX_FIELD_EQ(inName,"cachedText") ) { return hx::Val( cachedText); } if (HX_FIELD_EQ(inName,"classTypes") ) { return hx::Val( classTypes); } if (HX_FIELD_EQ(inName,"pathGroups") ) { return hx::Val( pathGroups); } break; case 11: if (HX_FIELD_EQ(inName,"assetsTotal") ) { return hx::Val( assetsTotal); } if (HX_FIELD_EQ(inName,"bytesLoaded") ) { return hx::Val( bytesLoaded); } if (HX_FIELD_EQ(inName,"cachedBytes") ) { return hx::Val( cachedBytes); } if (HX_FIELD_EQ(inName,"cachedFonts") ) { return hx::Val( cachedFonts); } break; case 12: if (HX_FIELD_EQ(inName,"assetsLoaded") ) { return hx::Val( assetsLoaded); } if (HX_FIELD_EQ(inName,"cachedImages") ) { return hx::Val( cachedImages); } if (HX_FIELD_EQ(inName,"load_onError") ) { return hx::Val( load_onError_dyn()); } break; case 13: if (HX_FIELD_EQ(inName,"__assetLoaded") ) { return hx::Val( _hx___assetLoaded_dyn()); } break; case 14: if (HX_FIELD_EQ(inName,"getAudioBuffer") ) { return hx::Val( getAudioBuffer_dyn()); } if (HX_FIELD_EQ(inName,"__fromManifest") ) { return hx::Val( _hx___fromManifest_dyn()); } break; case 15: if (HX_FIELD_EQ(inName,"loadAudioBuffer") ) { return hx::Val( loadAudioBuffer_dyn()); } if (HX_FIELD_EQ(inName,"load_onProgress") ) { return hx::Val( load_onProgress_dyn()); } break; case 16: if (HX_FIELD_EQ(inName,"bytesLoadedCache") ) { return hx::Val( bytesLoadedCache); } break; case 18: if (HX_FIELD_EQ(inName,"cachedAudioBuffers") ) { return hx::Val( cachedAudioBuffers); } break; case 19: if (HX_FIELD_EQ(inName,"loadFont_onComplete") ) { return hx::Val( loadFont_onComplete_dyn()); } if (HX_FIELD_EQ(inName,"loadText_onComplete") ) { return hx::Val( loadText_onComplete_dyn()); } break; case 20: if (HX_FIELD_EQ(inName,"loadBytes_onComplete") ) { return hx::Val( loadBytes_onComplete_dyn()); } if (HX_FIELD_EQ(inName,"loadImage_onComplete") ) { return hx::Val( loadImage_onComplete_dyn()); } break; case 26: if (HX_FIELD_EQ(inName,"loadAudioBuffer_onComplete") ) { return hx::Val( loadAudioBuffer_onComplete_dyn()); } } return super::__Field(inName,inCallProp); } bool AssetLibrary_obj::__GetStatic(const ::String &inName, Dynamic &outValue, hx::PropertyAccess inCallProp) { switch(inName.length) { case 8: if (HX_FIELD_EQ(inName,"fromFile") ) { outValue = fromFile_dyn(); return true; } break; case 9: if (HX_FIELD_EQ(inName,"fromBytes") ) { outValue = fromBytes_dyn(); return true; } break; case 12: if (HX_FIELD_EQ(inName,"fromManifest") ) { outValue = fromManifest_dyn(); return true; } if (HX_FIELD_EQ(inName,"loadFromFile") ) { outValue = loadFromFile_dyn(); return true; } break; case 13: if (HX_FIELD_EQ(inName,"loadFromBytes") ) { outValue = loadFromBytes_dyn(); return true; } break; case 16: if (HX_FIELD_EQ(inName,"loadFromManifest") ) { outValue = loadFromManifest_dyn(); return true; } } return false; } hx::Val AssetLibrary_obj::__SetField(const ::String &inName,const hx::Val &inValue,hx::PropertyAccess inCallProp) { switch(inName.length) { case 5: if (HX_FIELD_EQ(inName,"paths") ) { paths=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } if (HX_FIELD_EQ(inName,"sizes") ) { sizes=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } if (HX_FIELD_EQ(inName,"types") ) { types=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } break; case 6: if (HX_FIELD_EQ(inName,"loaded") ) { loaded=inValue.Cast< bool >(); return inValue; } break; case 7: if (HX_FIELD_EQ(inName,"preload") ) { preload=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } if (HX_FIELD_EQ(inName,"promise") ) { promise=inValue.Cast< ::lime::app::Promise_lime_utils_AssetLibrary >(); return inValue; } break; case 8: if (HX_FIELD_EQ(inName,"onChange") ) { onChange=inValue.Cast< ::lime::app::_Event_Void_Void >(); return inValue; } break; case 10: if (HX_FIELD_EQ(inName,"bytesTotal") ) { bytesTotal=inValue.Cast< int >(); return inValue; } if (HX_FIELD_EQ(inName,"cachedText") ) { cachedText=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } if (HX_FIELD_EQ(inName,"classTypes") ) { classTypes=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } if (HX_FIELD_EQ(inName,"pathGroups") ) { pathGroups=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } break; case 11: if (HX_FIELD_EQ(inName,"assetsTotal") ) { assetsTotal=inValue.Cast< int >(); return inValue; } if (HX_FIELD_EQ(inName,"bytesLoaded") ) { bytesLoaded=inValue.Cast< int >(); return inValue; } if (HX_FIELD_EQ(inName,"cachedBytes") ) { cachedBytes=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } if (HX_FIELD_EQ(inName,"cachedFonts") ) { cachedFonts=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } break; case 12: if (HX_FIELD_EQ(inName,"assetsLoaded") ) { assetsLoaded=inValue.Cast< int >(); return inValue; } if (HX_FIELD_EQ(inName,"cachedImages") ) { cachedImages=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } break; case 16: if (HX_FIELD_EQ(inName,"bytesLoadedCache") ) { bytesLoadedCache=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } break; case 18: if (HX_FIELD_EQ(inName,"cachedAudioBuffers") ) { cachedAudioBuffers=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; } } return super::__SetField(inName,inValue,inCallProp); } void AssetLibrary_obj::__GetFields(Array< ::String> &outFields) { outFields->push(HX_HCSTRING("onChange","\xef","\x87","\x1f","\x97")); outFields->push(HX_HCSTRING("assetsLoaded","\xe8","\xc8","\x28","\x8e")); outFields->push(HX_HCSTRING("assetsTotal","\x41","\xc0","\x37","\x03")); outFields->push(HX_HCSTRING("bytesLoaded","\xd0","\x66","\xca","\x99")); outFields->push(HX_HCSTRING("bytesLoadedCache","\x52","\xf1","\x40","\x0f")); outFields->push(HX_HCSTRING("bytesTotal","\x59","\x57","\xda","\x45")); outFields->push(HX_HCSTRING("cachedAudioBuffers","\x3f","\xb0","\x91","\xdb")); outFields->push(HX_HCSTRING("cachedBytes","\x29","\x45","\x82","\x36")); outFields->push(HX_HCSTRING("cachedFonts","\x82","\xf4","\x7b","\x7d")); outFields->push(HX_HCSTRING("cachedImages","\x3a","\x3a","\x9d","\x52")); outFields->push(HX_HCSTRING("cachedText","\xaf","\xf1","\x6f","\x7b")); outFields->push(HX_HCSTRING("classTypes","\x21","\x9d","\xe9","\x5d")); outFields->push(HX_HCSTRING("loaded","\x05","\x48","\x6f","\x58")); outFields->push(HX_HCSTRING("pathGroups","\xd9","\xc7","\x5d","\x2e")); outFields->push(HX_HCSTRING("paths","\x2e","\x0b","\x57","\xbd")); outFields->push(HX_HCSTRING("preload","\xc9","\x47","\x43","\x35")); outFields->push(HX_HCSTRING("promise","\x9b","\xcd","\xe9","\xf7")); outFields->push(HX_HCSTRING("sizes","\x92","\x08","\xd9","\x7c")); outFields->push(HX_HCSTRING("types","\x79","\x70","\xcb","\x1a")); super::__GetFields(outFields); }; #if HXCPP_SCRIPTABLE static hx::StorageInfo AssetLibrary_obj_sMemberStorageInfo[] = { {hx::fsObject /*::lime::app::_Event_Void_Void*/ ,(int)offsetof(AssetLibrary_obj,onChange),HX_HCSTRING("onChange","\xef","\x87","\x1f","\x97")}, {hx::fsInt,(int)offsetof(AssetLibrary_obj,assetsLoaded),HX_HCSTRING("assetsLoaded","\xe8","\xc8","\x28","\x8e")}, {hx::fsInt,(int)offsetof(AssetLibrary_obj,assetsTotal),HX_HCSTRING("assetsTotal","\x41","\xc0","\x37","\x03")}, {hx::fsInt,(int)offsetof(AssetLibrary_obj,bytesLoaded),HX_HCSTRING("bytesLoaded","\xd0","\x66","\xca","\x99")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,bytesLoadedCache),HX_HCSTRING("bytesLoadedCache","\x52","\xf1","\x40","\x0f")}, {hx::fsInt,(int)offsetof(AssetLibrary_obj,bytesTotal),HX_HCSTRING("bytesTotal","\x59","\x57","\xda","\x45")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,cachedAudioBuffers),HX_HCSTRING("cachedAudioBuffers","\x3f","\xb0","\x91","\xdb")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,cachedBytes),HX_HCSTRING("cachedBytes","\x29","\x45","\x82","\x36")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,cachedFonts),HX_HCSTRING("cachedFonts","\x82","\xf4","\x7b","\x7d")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,cachedImages),HX_HCSTRING("cachedImages","\x3a","\x3a","\x9d","\x52")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,cachedText),HX_HCSTRING("cachedText","\xaf","\xf1","\x6f","\x7b")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,classTypes),HX_HCSTRING("classTypes","\x21","\x9d","\xe9","\x5d")}, {hx::fsBool,(int)offsetof(AssetLibrary_obj,loaded),HX_HCSTRING("loaded","\x05","\x48","\x6f","\x58")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,pathGroups),HX_HCSTRING("pathGroups","\xd9","\xc7","\x5d","\x2e")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,paths),HX_HCSTRING("paths","\x2e","\x0b","\x57","\xbd")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,preload),HX_HCSTRING("preload","\xc9","\x47","\x43","\x35")}, {hx::fsObject /*::lime::app::Promise_lime_utils_AssetLibrary*/ ,(int)offsetof(AssetLibrary_obj,promise),HX_HCSTRING("promise","\x9b","\xcd","\xe9","\xf7")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,sizes),HX_HCSTRING("sizes","\x92","\x08","\xd9","\x7c")}, {hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(AssetLibrary_obj,types),HX_HCSTRING("types","\x79","\x70","\xcb","\x1a")}, { hx::fsUnknown, 0, null()} }; static hx::StaticInfo *AssetLibrary_obj_sStaticStorageInfo = 0; #endif static ::String AssetLibrary_obj_sMemberFields[] = { HX_HCSTRING("onChange","\xef","\x87","\x1f","\x97"), HX_HCSTRING("assetsLoaded","\xe8","\xc8","\x28","\x8e"), HX_HCSTRING("assetsTotal","\x41","\xc0","\x37","\x03"), HX_HCSTRING("bytesLoaded","\xd0","\x66","\xca","\x99"), HX_HCSTRING("bytesLoadedCache","\x52","\xf1","\x40","\x0f"), HX_HCSTRING("bytesTotal","\x59","\x57","\xda","\x45"), HX_HCSTRING("cachedAudioBuffers","\x3f","\xb0","\x91","\xdb"), HX_HCSTRING("cachedBytes","\x29","\x45","\x82","\x36"), HX_HCSTRING("cachedFonts","\x82","\xf4","\x7b","\x7d"), HX_HCSTRING("cachedImages","\x3a","\x3a","\x9d","\x52"), HX_HCSTRING("cachedText","\xaf","\xf1","\x6f","\x7b"), HX_HCSTRING("classTypes","\x21","\x9d","\xe9","\x5d"), HX_HCSTRING("loaded","\x05","\x48","\x6f","\x58"), HX_HCSTRING("pathGroups","\xd9","\xc7","\x5d","\x2e"), HX_HCSTRING("paths","\x2e","\x0b","\x57","\xbd"), HX_HCSTRING("preload","\xc9","\x47","\x43","\x35"), HX_HCSTRING("promise","\x9b","\xcd","\xe9","\xf7"), HX_HCSTRING("sizes","\x92","\x08","\xd9","\x7c"), HX_HCSTRING("types","\x79","\x70","\xcb","\x1a"), HX_HCSTRING("exists","\xdc","\x1d","\xe0","\xbf"), HX_HCSTRING("getAsset","\x7a","\x79","\x10","\x86"), HX_HCSTRING("getAudioBuffer","\x80","\x41","\xe3","\x26"), HX_HCSTRING("getBytes","\xf5","\x17","\x6f","\x1d"), HX_HCSTRING("getFont","\x85","\x0d","\x43","\x16"), HX_HCSTRING("getImage","\xe5","\x2e","\x40","\x1d"), HX_HCSTRING("getPath","\x5b","\x95","\xd4","\x1c"), HX_HCSTRING("getText","\x63","\x7c","\x7c","\x1f"), HX_HCSTRING("isLocal","\x21","\x6d","\x76","\x15"), HX_HCSTRING("list","\x5e","\x1c","\xb3","\x47"), HX_HCSTRING("loadAsset","\xea","\xb5","\x70","\x41"), HX_HCSTRING("load","\x26","\x9a","\xb7","\x47"), HX_HCSTRING("loadAudioBuffer","\xf0","\x71","\x7c","\xe3"), HX_HCSTRING("loadBytes","\x65","\x54","\xcf","\xd8"), HX_HCSTRING("loadFont","\x15","\x2f","\x60","\xb4"), HX_HCSTRING("loadImage","\x55","\x6b","\xa0","\xd8"), HX_HCSTRING("loadText","\xf3","\x9d","\x99","\xbd"), HX_HCSTRING("unload","\xff","\xa0","\x8c","\x65"), HX_HCSTRING("__assetLoaded","\xf5","\x7a","\x49","\x36"), HX_HCSTRING("__fromManifest","\x59","\x5a","\x01","\x91"), HX_HCSTRING("loadAudioBuffer_onComplete","\x27","\x96","\xe6","\x68"), HX_HCSTRING("loadBytes_onComplete","\xd2","\x0d","\x18","\xbc"), HX_HCSTRING("loadFont_onComplete","\x22","\xd1","\x7c","\xa1"), HX_HCSTRING("loadImage_onComplete","\xe2","\x7c","\xc9","\xb2"), HX_HCSTRING("loadText_onComplete","\x04","\x33","\xff","\xe5"), HX_HCSTRING("load_onError","\xd0","\xf3","\xd6","\x22"), HX_HCSTRING("load_onProgress","\xa5","\x84","\x70","\x96"), ::String(null()) }; static void AssetLibrary_obj_sMarkStatics(HX_MARK_PARAMS) { HX_MARK_MEMBER_NAME(AssetLibrary_obj::__mClass,"__mClass"); }; #ifdef HXCPP_VISIT_ALLOCS static void AssetLibrary_obj_sVisitStatics(HX_VISIT_PARAMS) { HX_VISIT_MEMBER_NAME(AssetLibrary_obj::__mClass,"__mClass"); }; #endif hx::Class AssetLibrary_obj::__mClass; static ::String AssetLibrary_obj_sStaticFields[] = { HX_HCSTRING("fromBytes","\xa1","\xf2","\x20","\x72"), HX_HCSTRING("fromFile","\x06","\x9d","\x87","\xa1"), HX_HCSTRING("fromManifest","\x39","\xd7","\x40","\x70"), HX_HCSTRING("loadFromBytes","\x9b","\xc3","\x86","\xf4"), HX_HCSTRING("loadFromFile","\x4c","\x89","\xf0","\x5a"), HX_HCSTRING("loadFromManifest","\x7f","\x5e","\x9c","\xdc"), ::String(null()) }; void AssetLibrary_obj::__register() { hx::Object *dummy = new AssetLibrary_obj; AssetLibrary_obj::_hx_vtable = *(void **)dummy; hx::Static(__mClass) = new hx::Class_obj(); __mClass->mName = HX_HCSTRING("lime.utils.AssetLibrary","\x21","\x55","\xe9","\xfc"); __mClass->mSuper = &super::__SGetClass(); __mClass->mConstructEmpty = &__CreateEmpty; __mClass->mConstructArgs = &__Create; __mClass->mGetStaticField = &AssetLibrary_obj::__GetStatic; __mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField; __mClass->mMarkFunc = AssetLibrary_obj_sMarkStatics; __mClass->mStatics = hx::Class_obj::dupFunctions(AssetLibrary_obj_sStaticFields); __mClass->mMembers = hx::Class_obj::dupFunctions(AssetLibrary_obj_sMemberFields); __mClass->mCanCast = hx::TCanCast< AssetLibrary_obj >; #ifdef HXCPP_VISIT_ALLOCS __mClass->mVisitFunc = AssetLibrary_obj_sVisitStatics; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mMemberStorageInfo = AssetLibrary_obj_sMemberStorageInfo; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mStaticStorageInfo = AssetLibrary_obj_sStaticStorageInfo; #endif hx::_hx_RegisterClass(__mClass->mName, __mClass); } } // end namespace lime } // end namespace utils
[ "akalanitski@playtika.com" ]
akalanitski@playtika.com
8aaec008d8ca62e16bca2f3cca994d3ad8385fb7
cbb8cc0b7d61961b1bb880435af5fb63b53454cd
/Check/v0.0.3/src/Corrector.CLI/cells/2016/516020910182/L61/L01/Cylinder.cpp
a0ad5204b8480a27d04a9786e8d448f9909480e5
[]
no_license
StarkShang/Projects
91ba09570fb3ee4e655ae3ae1b855d18524fcd74
5f6a3332db2ae1e2188a5aad2826d18022f2f57c
refs/heads/master
2020-07-30T05:43:13.708514
2017-04-17T13:51:23
2017-04-17T13:51:23
73,653,507
0
1
null
null
null
null
UTF-8
C++
false
false
261
cpp
#include <iostream> #include "Cylinder.h" Cylinder::Cylinder(double len, double r) { this->len=len; this->r=r; } double Cylinder::Area() { double s; s=2*3.14*r*r+2*3.14*r*len; return s; } double Cylinder::Volume() { double v; v=3.14*r*r*len; return v; }
[ "stark.shang@sjtu.edu.cn" ]
stark.shang@sjtu.edu.cn
38cd019dde8d12233ec89e6b0f14638336196b5e
ac93d6e3f60c3436303980a03ac3286fcad12b70
/lib/libcxx/include/__bsd_locale_fallbacks.h
ed0eabf60ece282166d3ceef03bc82296f464238
[ "MIT", "LicenseRef-scancode-other-permissive", "NCSA", "LLVM-exception", "Apache-2.0" ]
permissive
ZystemOS/zig
223452d9eaed13516aae512abd4e26a73e59eb31
c6288b97bae5d91beb73f8bb26926e8967e3d3d7
refs/heads/master
2023-08-16T06:58:01.600287
2021-10-16T18:00:30
2021-10-17T16:44:22
417,420,613
1
0
MIT
2021-10-15T19:28:04
2021-10-15T08:14:03
Zig
UTF-8
C++
false
false
4,032
h
// -*- C++ -*- //===---------------------- __bsd_locale_fallbacks.h ----------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // The BSDs have lots of *_l functions. This file provides reimplementations // of those functions for non-BSD platforms. //===----------------------------------------------------------------------===// #ifndef _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H #define _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H #include <memory> #include <stdarg.h> #include <stdlib.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD inline _LIBCPP_INLINE_VISIBILITY decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l) { __libcpp_locale_guard __current(__l); return MB_CUR_MAX; } inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_btowc_l(int __c, locale_t __l) { __libcpp_locale_guard __current(__l); return btowc(__c); } inline _LIBCPP_INLINE_VISIBILITY int __libcpp_wctob_l(wint_t __c, locale_t __l) { __libcpp_locale_guard __current(__l); return wctob(__c); } inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc, size_t __len, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return wcsnrtombs(__dest, __src, __nwc, __len, __ps); } inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return wcrtomb(__s, __wc, __ps); } inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms, size_t __len, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return mbsnrtowcs(__dest, __src, __nms, __len, __ps); } inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return mbrtowc(__pwc, __s, __n, __ps); } inline _LIBCPP_INLINE_VISIBILITY int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l) { __libcpp_locale_guard __current(__l); return mbtowc(__pwc, __pmb, __max); } inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return mbrlen(__s, __n, __ps); } inline _LIBCPP_INLINE_VISIBILITY lconv *__libcpp_localeconv_l(locale_t __l) { __libcpp_locale_guard __current(__l); return localeconv(); } inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return mbsrtowcs(__dest, __src, __len, __ps); } inline int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); __libcpp_locale_guard __current(__l); int __res = vsnprintf(__s, __n, __format, __va); va_end(__va); return __res; } inline int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); __libcpp_locale_guard __current(__l); int __res = vasprintf(__s, __format, __va); va_end(__va); return __res; } inline int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); __libcpp_locale_guard __current(__l); int __res = vsscanf(__s, __format, __va); va_end(__va); return __res; } _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H
[ "andrew@ziglang.org" ]
andrew@ziglang.org
8f507e3f4ab5912ac9ad3bea65744bf86515d1df
7f584be8371845c7189647936aba3253cf404727
/Chapter - 4/New folder/dijkstra.cpp
95e35744b277ab94a80a8a6d2355c08b4d7d8b4e
[]
no_license
SouhardyaSaha/Data-Structure
720d948919562995e1bbc3c48a6b3aa42111952f
0769589fd06d22206c15eeee885cf456e6e65ebf
refs/heads/master
2020-03-30T10:07:31.954383
2019-01-22T13:33:21
2019-01-22T13:33:21
151,106,739
0
0
null
null
null
null
UTF-8
C++
false
false
1,831
cpp
#include <bits/stdc++.h> using namespace std; #define V 100 int minDistance(int dist[], bool sptSet[]) { int min_=INT_MAX, min_index; for(int v=0; v<V; v++) { if(sptSet[v]==false && dist[v]<=min_) min_=dist[v], min_index=v; } return min_index; } void printPath(int parent[], int j) { if(parent[j]==-1) return; printPath(parent, parent[j]); printf("%d ",j); } int printSolution(int dist[], int parent[]) { int src=0; printf("Vertex \t Distance from Source \t Path \n"); for(int i=0; i<V; i++) { printf("%d \t %d \t \t \t %d ", i, dist[i], src); printPath(parent, i); printf("\n"); } } void dijkstra(int graph[V][V], int src) { int dist[V]; bool sptSet[V]; int parent[V]; parent[0] = -1; for(int i=0; i<V; i++) dist[i] = INT_MAX, sptSet[i] = false; dist[src] = 0; for(int count_=0; count_<V-1; count_++) { int u=minDistance(dist, sptSet); //cout<<u<<endl; sptSet[u]=true; for(int v=0; v<V; v++) { if(!sptSet[v] && graph[u][v] && dist[u]!=INT_MAX && dist[u]+graph[u][v]<dist[v]) { cout<<"v "<<v<<endl; dist[v]=dist[u]+graph[u][v]; parent[v]=u; } } } printSolution(dist, parent); } int main() { int vertex, edge; scanf("%d %d", &vertex, &edge); int graph[V][V]; memset(graph, 0, sizeof(graph)); while(edge--) { int a, b, weight; scanf("%d %d %d", &a, &b, &weight); graph[a][b] = weight; graph[b][a] = weight; } dijkstra(graph, 0); return 0; } /* Input: 6 9 0 1 3 0 5 5 0 6 1 1 2 1 2 3 2 2 4 1 3 4 2 4 5 6 5 6 2 ******* 0 1 3 0 2 2 1 2 1 1 3 3 2 4 3 3 4 3 3 5 5 4 5 7 */
[ "souhardya24@student.sust.edu" ]
souhardya24@student.sust.edu
9c1bfaa2dcfa89f2ef2a180a469eb55b8c8347f6
ec32fe5285222ca5dc4c56a5488cbec50dc9f76d
/dep/boost/libs/asio/example/cpp03/tutorial/timer1/timer.cpp
3d72c38c2ce61d7e7bfad43ee8c806ac9e701964
[ "BSL-1.0", "MIT" ]
permissive
SilverIce/JContainers
dbcbba00a51cd83598b954f886fa80aa7f388d55
98ca31304a74e299d1f7f003602c55fb07e866ee
refs/heads/develop
2022-11-08T23:26:19.432006
2020-02-04T23:20:05
2020-02-04T23:20:05
49,142,001
42
15
MIT
2022-10-31T04:55:25
2016-01-06T15:06:02
C++
UTF-8
C++
false
false
556
cpp
// // timer.cpp // ~~~~~~~~~ // // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include <iostream> #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> int main() { boost::asio::io_service io; boost::asio::deadline_timer t(io, boost::posix_time::seconds(5)); t.wait(); std::cout << "Hello, world!" << std::endl; return 0; }
[ "slifeleaf@gmail.com" ]
slifeleaf@gmail.com
0a994672ebb4aa5ca280dec3b7e753d84fdbbb20
ecd5948fadc8d28ddacd4b859a41409a4fa55e11
/DEMOS/ROUND.CPP
51dbb26310e0c598739c0b532bc60d7454799823
[]
no_license
gtraines/fuz-cy-logic
0f06822cdcb51b8363e1f740efd6ef74600adbcc
ccca335fae858624f90b704da9865c0de4021a22
refs/heads/master
2020-03-30T23:59:48.808873
2018-10-05T14:10:44
2018-10-05T14:10:44
151,721,039
0
1
null
null
null
null
UTF-8
C++
false
false
597
cpp
#include <stdio.h> #include <stdlib.h> #include <mtsptype.hpp> void main(void) { char number[16],prec[8]; double Num,rndNumber; int n,Prc,status; n=0; looptop: n++; if(n>10) return; fflush(stdin); printf("Enter a number : "); gets(number); Num=atof(number); if(Num==0) return; fflush(stdin); printf("Enter the precision: "); gets(prec); Prc=atoi(prec); rndNumber=MtsRound(Num,Prc,&status); printf("%s%12.7f\n","Number :",Num); printf("%s%12d\n", "Precison :",Prc); printf("%s%12.7f\n","rndNumber :",rndNumber); goto looptop; }
[ "gtraines@hotmail.com" ]
gtraines@hotmail.com
a26234a61e60cff7929841e006d455a1f0888f42
829b3f2d0ae685d01fe097c03bf5c1976cbc4723
/deps/boost/include/boost/atomic/detail/wait_caps_windows.hpp
00d623a7e86040f680ecc2fab045a5c35bf4d26e
[ "Apache-2.0" ]
permissive
liyoung1992/mediasoup-sfu-cpp
f0f0321f8974beb1f4263c9e658402620d82385f
b76564e068626b0d675f5486e56da3d69151e287
refs/heads/main
2023-08-21T21:40:51.710022
2021-10-14T06:29:18
2021-10-14T06:29:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,395
hpp
/* * 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) * * Copyright (c) 2020 Andrey Semashev */ /*! * \file atomic/detail/wait_caps_windows.hpp * * This header defines waiting/notifying operations capabilities macros. */ #ifndef BOOST_ATOMIC_DETAIL_WAIT_CAPS_WINDOWS_HPP_INCLUDED_ #define BOOST_ATOMIC_DETAIL_WAIT_CAPS_WINDOWS_HPP_INCLUDED_ #include <boost/winapi/config.hpp> #include <boost/atomic/detail/config.hpp> #include <boost/atomic/detail/capabilities.hpp> #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif // MSDN says WaitOnAddress, WakeByAddressSingle and WakeByAddressAll only support notifications between threads of the same process, so no address-free operations. // https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress // https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wakebyaddresssingle // https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wakebyaddressall #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM) #define BOOST_ATOMIC_HAS_NATIVE_INT8_WAIT_NOTIFY BOOST_ATOMIC_INT8_LOCK_FREE #define BOOST_ATOMIC_HAS_NATIVE_INT16_WAIT_NOTIFY BOOST_ATOMIC_INT16_LOCK_FREE #define BOOST_ATOMIC_HAS_NATIVE_INT32_WAIT_NOTIFY BOOST_ATOMIC_INT32_LOCK_FREE #define BOOST_ATOMIC_HAS_NATIVE_INT64_WAIT_NOTIFY BOOST_ATOMIC_INT64_LOCK_FREE #else // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM) // Since will detect availability of WaitOnAddress etc. at run time, we have to define capability macros to 1 instead of 2 #if BOOST_ATOMIC_INT8_LOCK_FREE > 0 #define BOOST_ATOMIC_HAS_NATIVE_INT8_WAIT_NOTIFY 1 #endif #if BOOST_ATOMIC_INT16_LOCK_FREE > 0 #define BOOST_ATOMIC_HAS_NATIVE_INT16_WAIT_NOTIFY 1 #endif #if BOOST_ATOMIC_INT32_LOCK_FREE > 0 #define BOOST_ATOMIC_HAS_NATIVE_INT32_WAIT_NOTIFY 1 #endif #if BOOST_ATOMIC_INT64_LOCK_FREE > 0 #define BOOST_ATOMIC_HAS_NATIVE_INT64_WAIT_NOTIFY 1 #endif #endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM) #endif // BOOST_ATOMIC_DETAIL_WAIT_CAPS_WINDOWS_HPP_INCLUDED_
[ "yanhua133@126.com" ]
yanhua133@126.com
80f8c842b502526d69629f3cabe73ee0223f798a
168f9854d10681aba52495e121d6ba6f079d788c
/src/color.cpp
c95243b0acef68a4da48e541037373e8c14c1ef6
[ "Apache-2.0" ]
permissive
CattleProdigy/ray-tracer
20abb08711255f18535fb8dfb08f3c68a2d8d5a4
78e6bda3af54933317431ac0f2c2c5a16fcf8d26
refs/heads/master
2021-01-02T09:42:37.821374
2013-12-20T20:11:09
2013-12-20T20:11:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,447
cpp
#include <Eigen/Core> #include "color.hpp" // ctors Color::Color() { rgb = V3(0, 0, 0); } Color::Color(float red, float green, float blue) { rgb[0] = red; rgb[1] = green; rgb[2] = blue; } Color::Color(const Color& other) { rgb = other.rgb; } Color::Color(const V3& rgb) { this->rgb = rgb; } // Binary Arithmetic Operators Color operator+(const Color& col_l, const Color& col_r) { return Color(col_l.rgb + col_r.rgb); } Color operator*(const Color& col_l, const Color& col_r) { return Color(col_l.rgb.cwiseProduct(col_r.rgb)); } Color operator/(const Color& col_l, const Color& col_r) { return Color(col_l.rgb.cwiseQuotient(col_r.rgb)); } Color operator*(const Color& col_l, float scalar) { return Color(col_l.rgb * scalar); } Color operator*(float scalar, const Color& col_r) { return Color(col_r.rgb * scalar); } Color operator/(const Color& col_l, float scalar) { return Color(col_l.rgb / scalar); } // Uniary Arithmetic Color Color::operator+() const { return *this; } Color Color::operator-() const { return Color(-rgb); } // Compound Assignment Arithmetic Color& Color::operator=(const Color& rhs) { rgb = rhs.rgb; return *this; } Color& Color::operator+=(const Color& rhs) { rgb += rhs.rgb; return *this; } Color& Color::operator-=(const Color& rhs) { rgb -= rhs.rgb; return *this; } Color& Color::operator*=(const Color& rhs) { rgb = rgb.cwiseProduct(rhs.rgb); return *this; } Color& Color::operator/=(const Color& rhs) { rgb = rgb.cwiseQuotient(rhs.rgb); return *this; } // Print std::ostream& operator<<(std::ostream& os, const Color& col) { os << "(R" << col.rgb[0] << ",G" << col.rgb[1] << ",B" << col.rgb[2] << ')' << std::endl; return os; } float Color::r() const { return rgb[0]; } float Color::g() const { return rgb[1]; } float Color::b() const { return rgb[2]; } V3i Color::to_pixel() const { V3i rgb_pixel; for (int i = 0; i < 3; i++) { if (rgb[i] > 1.0) rgb_pixel[i] = 255; else if (rgb[i] < 0.0) rgb_pixel[i] = 0; else rgb_pixel[i] = floor(255.0 * rgb[i]); } return rgb_pixel; } png::rgb_pixel Color::to_png_pixel() const { V3i int_pixel = to_pixel(); png::rgb_pixel rgb; rgb.red = int_pixel[0]; rgb.green = int_pixel[1]; rgb.blue = int_pixel[2]; return rgb; }
[ "paulschroeder90@gmail.com" ]
paulschroeder90@gmail.com
aa694d7cf1b3f0579577ac4101c73af791b5ffa5
5aad40ba5a1eb29799c1ad1c21495faa07e99b36
/src/examples/opengl/gpu_videoeffects/VideoPusherDoublePBO.cpp
42fc7f45577faab84dea815faeeb1285d750fae5
[]
no_license
q4a/navidia_proj
3525bcfdb12dc20dcecf08f2603324feceef7394
32c839744ad849f8d4d0273c635c4d601cc1980f
refs/heads/master
2023-04-16T10:44:39.466782
2019-11-30T10:26:47
2019-11-30T10:26:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,284
cpp
// ---------------------------------------------------------------------------- // // Content: // VideoPusherDoublePBO class // // Description: // A class managing OpenEXR images via OpenGL pixel buffer objects (PBO). // // Author: Frank Jargstorff (03/10/04) // // Note: // Copyright (C) 2004 by NVIDIA Croporation. All rights reserved. // // ---------------------------------------------------------------------------- // // Includes // #include <GL/glew.h> #include <GL/gl.h> #include "VideoPusherDoublePBO.h" #include "OpenEXRLoader.h" #include "defines.h" #include <assert.h> // // Macros // #define BUFFER_OFFSET(i) ((char *)NULL + (i)) // ---------------------------------------------------------------------------- // ImagePBO class // // // Public data // const char * VideoPusherDoublePBO::ClassName = "VideoPusherDoublePBO"; const char * VideoPusherDoublePBO::ClassDescription = "Video (Double PBO)"; // // Construction and destruction // // Default constructor // VideoPusherDoublePBO::VideoPusherDoublePBO(): ImagePusher() , _nCurrentBuffer(0) { init(); } // Constructor for textures with different aspect ratios // VideoPusherDoublePBO::VideoPusherDoublePBO(ImageSource::teTextureType eTextureType): ImagePusher(eTextureType) , _nCurrentBuffer(0) { init(); } // Destructor // VideoPusherDoublePBO::~VideoPusherDoublePBO() { unbind(); glDeleteBuffersARB(N_MAX_BUFFERS, _haPixelBuffer); } // // Public methods // void VideoPusherDoublePBO::init() { glewInit(); glGenBuffersARB(N_MAX_BUFFERS, _haPixelBuffer); } // setImage // // Description: // Specify a new image. // // Parameters: // rImage - const reference to the image object. // // Returns: // None // void VideoPusherDoublePBO::setImage(const ImageTex & rImage) { // Bind texture and create local image copy ImagePusher::setImage(rImage); glBindTexture(_nTextureTarget, _hTexture); // Now create the corresponding PBOs for (int iBuffer = 0; iBuffer < N_MAX_BUFFERS; ++iBuffer) { // bind pixel-buffer object glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, _haPixelBuffer[iBuffer]); // create buffer's data container glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, _oImage.imageDataSize(), NULL, GL_STREAM_DRAW_ARB); void * pPixelsPBO = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY); // copy original image into the buffer memcpy(pPixelsPBO, _oImage.data(), _oImage.imageDataSize()); if (!glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)) { std::cerr << "Couldn't unmap pixel buffer. Exiting\n"; assert(false); } // unbind pixel-buffer object glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } } // pushNewFrame // // Description: // Pushes a new frame up to the graphics board. // This specific image pusher imprints a time stamp // bit-pattern in the left-bottom corner of the image. // // Parameters: // nFrameStamp - the frame number to imprint. // // Returns: // The number of bytes actually pushed across the bus // to the graphics card. // unsigned int VideoPusherDoublePBO::pushNewFrame() { _nCurrentBuffer = (_nCurrentBuffer + 1) % N_MAX_BUFFERS; unsigned int iModifyBuffer = (_nCurrentBuffer + 1) % N_MAX_BUFFERS; glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, _haPixelBuffer[iModifyBuffer]); void * pPixelData = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY); imprintPixelData(pPixelData, _nFrameCounter); if (!glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)) { std::cerr << "Couldn't unmap pixel buffer. Exiting\n"; assert(false); } // bind the texture object bind(); glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, _haPixelBuffer[_nCurrentBuffer]); // copy buffer contents into the texture glTexSubImage2D(_nTextureTarget, 0, 0, 0, _oImage.width(), _oImage.height(), _oImage.glTextureFormat(), _oImage.glTextureType(), BUFFER_OFFSET(0)); glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); _nFrameCounter++; return _oImage.imageDataSize(); } // initVideoCopyContext // // Description: // Copies the contents of new frame up to the graphics board. // // Parameters: // // Returns: // The number of bytes actually pushed across the bus // to the graphics card. // unsigned int VideoPusherDoublePBO::initVideoCopyContext() { // _hDC[1] = wglGetCurrentDC( ); // _hRC[1] = wglCreateContext( _hDC[1] ); return 0; } // init the Video Buffers to the render stage // // Description: // This function will create the PBO for Video Copying, so the // DirectShow thread will run properly // // Parameters: // // Returns: // None // void VideoPusherDoublePBO::initVideoBuffers() { } // copyVideoFrame // // Description: // Copies data from a Video Frame to the graphics board. // // Parameters: // pSrc - the frame number to imprint. // numOfBytes - number of // // Returns: // The number of bytes actually pushed across the bus // to the graphics card. // unsigned int VideoPusherDoublePBO::copyVideoFrame(void *pSrc, ImageSize imginfo) { #if 0 copyToPixelBuffer(_oImage.data(), pSrc, _oImage.width(), _oImage.height(), imginfo.imageDataSize()); bind(); glTexSubImage2D(_nTextureTarget, 0, 0, 0, _oImage.width(), _oImage.height(), _oImage.glTextureFormat(), _oImage.glTextureType(), _oImage.data()); _nFrameCounter++; #endif return _oImage.imageDataSize(); } // pushNewFrame // // Description: // Pushes a new frame up to the graphics board. // This specific image pusher imprints a time stamp // bit-pattern in the left-bottom corner of the image. // // Parameters: // nFrameStamp - the frame number to imprint. // // Returns: // The number of bytes actually pushed across the bus // to the graphics card. // unsigned int VideoPusherDoublePBO::pushNewFrame(BYTE *src, LONG numOfBytes) { _nCurrentBuffer = (_nCurrentBuffer + 1) % N_MAX_BUFFERS; unsigned int iModifyBuffer = (_nCurrentBuffer + 1) % N_MAX_BUFFERS; glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, _haPixelBuffer[iModifyBuffer]); void * pPixelData = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY); imprintPixelData(pPixelData, _nFrameCounter); if (!glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB)) { std::cerr << "Couldn't unmap pixel buffer. Exiting\n"; assert(false); } // bind the texture object bind(); glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, _haPixelBuffer[_nCurrentBuffer]); // copy buffer contents into the texture glTexSubImage2D(_nTextureTarget, 0, 0, 0, _oImage.width(), _oImage.height(), _oImage.glTextureFormat(), _oImage.glTextureType(), BUFFER_OFFSET(0)); glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); _nFrameCounter++; return _oImage.imageDataSize(); }
[ "xtKnightMM@iCloud.com" ]
xtKnightMM@iCloud.com
0d420ef6a269fb9e5865818f13078225c2c2d494
a721d2096df01b67dd838edb1916e7a45d00164b
/Trees Algorithm/b_tree.cpp
14bdffbaefb4600ff624c1b1dfbc4340ee58769e
[ "MIT" ]
permissive
satyamsingh-sg/CPP-Programming
e0274af63287c4e735ae62c396e6b378bd2d3555
45d8c81f45b1b59203ec20fca25850e27aca9b81
refs/heads/master
2023-08-17T20:00:51.802837
2021-10-10T15:19:37
2021-10-10T15:19:37
412,334,405
1
0
MIT
2021-10-01T05:06:28
2021-10-01T05:06:28
null
UTF-8
C++
false
false
3,302
cpp
#include<iostream> using namespace std; struct BTree//node declaration { int *d; BTree **child_ptr; bool l; int n; }*r = NULL, *np = NULL, *x = NULL; BTree* init()//creation of node { int i; np = new BTree; np->d = new int[6];//order 6 np->child_ptr = new BTree *[7]; np->l = true; np->n = 0; for (i = 0; i < 7; i++) { np->child_ptr[i] = NULL; } return np; } void traverse(BTree *p)//traverse the tree { cout<<endl; int i; for (i = 0; i < p->n; i++) { if (p->l == false) { traverse(p->child_ptr[i]); } cout << " " << p->d[i]; } if (p->l == false) { traverse(p->child_ptr[i]); } cout<<endl; } void sort(int *p, int n)//sort the tree { int i, j, t; for (i = 0; i < n; i++) { for (j = i; j <= n; j++) { if (p[i] >p[j]) { t = p[i]; p[i] = p[j]; p[j] = t; } } } } int split_child(BTree *x, int i) { int j, mid; BTree *np1, *np3, *y; np3 = init();//create new node np3->l = true; if (i == -1) { mid = x->d[2];//find mid x->d[2] = 0; x->n--; np1 = init(); np1->l= false; x->l= true; for (j = 3; j < 6; j++) { np3->d[j - 3] = x->d[j]; np3->child_ptr[j - 3] = x->child_ptr[j]; np3->n++; x->d[j] = 0; x->n--; } for (j = 0; j < 6; j++) { x->child_ptr[j] = NULL; } np1->d[0] = mid; np1->child_ptr[np1->n] = x; np1->child_ptr[np1->n + 1] = np3; np1->n++; r = np1; } else { y = x->child_ptr[i]; mid = y->d[2]; y->d[2] = 0; y->n--; for (j = 3; j <6 ; j++) { np3->d[j - 3] = y->d[j]; np3->n++; y->d[j] = 0; y->n--; } x->child_ptr[i + 1] = y; x->child_ptr[i + 1] = np3; } return mid; } void insert(int a) { int i, t; x = r; if (x == NULL) { r = init(); x = r; } else { if (x->l== true && x->n == 6) { t = split_child(x, -1); x = r; for (i = 0; i < (x->n); i++) { if ((a >x->d[i]) && (a < x->d[i + 1])) { i++; break; } else if (a < x->d[0]) { break; } else { continue; } } x = x->child_ptr[i]; } else { while (x->l == false) { for (i = 0; i < (x->n); i++) { if ((a >x->d[i]) && (a < x->d[i + 1])) { i++; break; } else if (a < x->d[0]) { break; } else { continue; } } if ((x->child_ptr[i])->n == 6) { t = split_child(x, i); x->d[x->n] = t; x->n++; continue; } else { x = x->child_ptr[i]; } } } } x->d[x->n] = a; sort(x->d, x->n); x->n++; } int main() { int i, n, t; cout<<"enter the no of elements to be inserted\n"; cin>>n; for(i = 0; i < n; i++) { cout<<"enter the element\n"; cin>>t; insert(t); } cout<<"traversal of constructed B tree\n"; traverse(r); }
[ "noreply@github.com" ]
noreply@github.com
45d2147790031500e9938f475d3b171af1d4fbdd
aa402b47eb8430b7f0f74201cc5364aaffb05fac
/src/app/server/RendezvousServer.h
4a73a0ae00acc461205cdc583c26169691588e13
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Forest-Rain/connectedhomeip
7105a5f43c2f9edf16726863bf0e4335aca085f4
aef5db43b94095b5d60e94ba2009ca29ae92cdd0
refs/heads/master
2023-07-18T21:40:44.592434
2021-09-15T23:05:12
2021-09-15T23:05:12
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,505
h
/* * * Copyright (c) 2020 Project CHIP Authors * * 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. */ #pragma once #include <app/server/AppDelegate.h> #include <lib/core/CHIPPersistentStorageDelegate.h> #include <messaging/ExchangeMgr.h> #include <platform/CHIPDeviceLayer.h> #include <protocols/secure_channel/RendezvousParameters.h> #include <protocols/secure_channel/SessionIDAllocator.h> namespace chip { class RendezvousServer : public SessionEstablishmentDelegate { public: CHIP_ERROR WaitForPairing(const RendezvousParameters & params, uint32_t pbkdf2IterCount, const ByteSpan & salt, uint16_t passcodeID, Messaging::ExchangeManager * exchangeManager, TransportMgrBase * transportMgr, SecureSessionMgr * sessionMgr); CHIP_ERROR Init(AppDelegate * delegate, SessionIDAllocator * idAllocator) { VerifyOrReturnError(idAllocator != nullptr, CHIP_ERROR_INVALID_ARGUMENT); mIDAllocator = idAllocator; // The caller may chose to not provide a delegate object. The RendezvousServer checks for null delegate before calling // its methods. mDelegate = delegate; return CHIP_NO_ERROR; } //////////// SessionEstablishmentDelegate Implementation /////////////// void OnSessionEstablishmentError(CHIP_ERROR error) override; void OnSessionEstablished() override; void Cleanup(); void OnPlatformEvent(const DeviceLayer::ChipDeviceEvent * event); private: AppDelegate * mDelegate; Messaging::ExchangeManager * mExchangeManager = nullptr; PASESession mPairingSession; SecureSessionMgr * mSessionMgr = nullptr; SessionIDAllocator * mIDAllocator = nullptr; RendezvousAdvertisementDelegate * mAdvDelegate; bool HasAdvertisementDelegate() const { return mAdvDelegate != nullptr; } RendezvousAdvertisementDelegate * GetAdvertisementDelegate() { return mAdvDelegate; } }; } // namespace chip
[ "noreply@github.com" ]
noreply@github.com
8433f52c66cdadac41751a50f94ecd233d366bfe
2024fdbd98950b56fd8d26dd952d2ae02c393cef
/Largest product in a grid
7b8c9efb868ce249ab49a8e9377bf8c4e0389b1c
[]
no_license
Karmeshjain/Projecteuler
5b0aff52318e47653db73bd71df0f399524fd6e9
eac313a391f5acaeeb1daebe1731db8a6dc687bb
refs/heads/main
2023-05-31T16:56:49.834256
2021-06-14T00:13:56
2021-06-14T00:13:56
339,300,091
2
0
null
null
null
null
UTF-8
C++
false
false
1,476
#include <iostream> int main() { // always a 20x20 matrix const unsigned int Size = 20; unsigned int matrix[Size][Size]; // read from console for (unsigned int y = 0; y < Size; y++) for (unsigned int x = 0; x < Size; x++) std::cin >> matrix[x][y]; unsigned int best = 0; // walk through all cells of the matrix for (unsigned int y = 0; y < Size; y++) for (unsigned int x = 0; x < Size; x++) { // three more horizontal cells (right) if (x + 3 < Size) { unsigned int current = matrix[x][y] * matrix[x+1][y] * matrix[x+2][y] * matrix[x+3][y]; if (best < current) best = current; } // three more vertical cells available (down) if (y + 3 < Size) { unsigned int current = matrix[x][y] * matrix[x][y+1] * matrix[x][y+2] * matrix[x][y+3]; if (best < current) best = current; } // three more diagonal cells (right-down) if (x + 3 < Size && y + 3 < Size) { unsigned int current = matrix[x][y] * matrix[x+1][y+1] * matrix[x+2][y+2] * matrix[x+3][y+3]; if (best < current) best = current; } // three more diagonal cells (left-down) if (x + 3 < Size && y >= 3) { unsigned int current = matrix[x][y] * matrix[x+1][y-1] * matrix[x+2][y-2] * matrix[x+3][y-3]; if (best < current) best = current; } } std::cout << best << std::endl; return 0; }
[ "noreply@github.com" ]
noreply@github.com
2e9e09b5a9fa2022902c91207a573c859324fda5
81de1f1f62154bcb59cbf3e40e1998f74c46d35f
/NOPserver - 05.2004/Handlers/Client.h
14c755e0304df6f9182630df9151bdef977fc452
[]
no_license
M4th3m4tic4l/wow-emulator-archive
872ea550524821e52568c1bf3e3fe3d5b0b32c6c
75caaf4f5958dca3de6a4f35a1a54d5ee47a82e6
refs/heads/master
2023-07-29T09:06:17.391951
2021-09-16T12:35:29
2021-09-16T12:35:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,798
h
#ifndef _CLIENT_H_ #define _CLIENT_H_ #include "../Common.h" #include "../NetCode/ServerCore.h" #include "../WorldThread.h" #include "ObjectManager.h" #include "Character.h" class Client { public: Client (wxSocketBase *s); ~Client (void); void CharacterEnum (wowPacket *); void CreateChar (wowPacket *); void DeleteChar (wowPacket *); void PlayerLogin (wowPacket *); wxSocketBase *CurrentSocket; Character *CurrentChar; CharHashMap Characters; wxUint8 Admin; /* LogoutStatus: 0 = not logging out, 1 = logging out - first callbackhandler, 2 = log me out! wxUint8 LogoutStatus;*/ }; /*#include "..\Common.h" #include "servercore.h" void Client::SendLearnedSpell(wxUint32 spell) { wowPacket learnedspell; learnedspell.PutHeader(svWOW_LEARNED_SPELL); learnedspell.Putu32(spell); learnedspell.Finalize(); mSocket->Write(learnedspell.GetData(),learnedspell.GetSize()); } void Client::SendProficiency(wxUint32 value) { wowPacket prof; prof.PutHeader(svlWOW_PROFICIENCY); prof.Putu32(value); prof.Putu8(0); prof.Finalize(); mSocket->Write(prof.GetData(),prof.GetSize()); } void Client::SendBindPoint() { wowPacket bindpoint; bindpoint.PutHeader(svWOW_SAVEBINDPOINT); bindpoint.Putf32(mCharacter->mPosition.mPosX); bindpoint.Putf32(mCharacter->mPosition.mPosY); bindpoint.Putf32(mCharacter->mPosition.mPosZ); bindpoint.Putu32(0); bindpoint.Finalize(); mSocket->Write(bindpoint.GetData(),bindpoint.GetSize()); } void Client::EnterWorld () { // send svWOW_FRIENDLIST wowPacket flist; flist.PutHeader(svWOW_FRIENDLIST); flist.Putu8(0); flist.Finalize(); mSocket->Write(flist.GetData(),flist.GetSize()); // send svWOW_IGNORELIST wowPacket ilist; ilist.PutHeader(svWOW_IGNORELIST); ilist.Putu8(0); ilist.Finalize(); mSocket->Write(ilist.GetData(),ilist.GetSize()); SendBindPoint(); // send svWOW_CGTUTORIAL_ON_FLAG wowPacket tutorial; tutorial.PutHeader(svWOW_CGTUTORIAL_ON_FLAG); char voiddata[1024]; memset(voiddata,0,1024); tutorial.PutData(voiddata,32); tutorial.Finalize(); mSocket->Write(tutorial.GetData(),tutorial.GetSize()); SendLearnedSpell(7355); SendLearnedSpell(7267); SendLearnedSpell(7266); SendLearnedSpell(6603); SendLearnedSpell(6478); SendLearnedSpell(6477); SendLearnedSpell(6246); SendLearnedSpell(6233); SendLearnedSpell(2382); SendLearnedSpell(3050); SendLearnedSpell(3365); SendLearnedSpell(7744); SendLearnedSpell(5227); SendLearnedSpell(4084); SendLearnedSpell(5019); SendLearnedSpell(5009); SendLearnedSpell(198); SendLearnedSpell(585); SendLearnedSpell(2050); SendLearnedSpell(522); SendLearnedSpell(81); SendLearnedSpell(204); SendLearnedSpell(668); SendLearnedSpell(669); SendLearnedSpell(227); SendLearnedSpell(203); SendProficiency(0x08000002); // wands SendProficiency(0x08001002); SendProficiency(0x08441002); SendProficiency(0x00000304); unsigned char rawData_initialspells[113] = { 0x00, 0x1B, 0x00, 0x25, 0x0D, 0x00, 0x00, 0xEA, 0x0B, 0x00, 0x00, 0x4E, 0x09, 0x00, 0x00, 0x59, 0x18, 0x00, 0x00, 0x66, 0x18, 0x00, 0x00, 0x67, 0x18, 0x00, 0x00, 0x4D, 0x19, 0x00, 0x00, 0x4E, 0x19, 0x00, 0x00, 0xCB, 0x19, 0xFF, 0xFF, 0x62, 0x1C, 0x00, 0x00, 0x63, 0x1C, 0x00, 0x00, 0xBB, 0x1C, 0x00, 0x00, 0xF4, 0x0F, 0xFE, 0xFF, 0x6B, 0x14, 0xFD, 0xFF, 0x40, 0x1E, 0xFC, 0xFF, 0x91, 0x13, 0x00, 0x00, 0x9B, 0x13, 0xFB, 0xFF, 0xC6, 0x00, 0x00, 0x00, 0x02, 0x08, 0x01, 0x00, 0x49, 0x02, 0x02, 0x00, 0xCC, 0x00, 0x00, 0x00, 0x51, 0x00, 0xFA, 0xFF, 0x0A, 0x02, 0x00, 0x00, 0x9C, 0x02, 0x00, 0x00, 0x9D, 0x02, 0x00, 0x00, 0xE3, 0x00, 0x00, 0x00, 0xCB, 0x00, 0x00, 0x00, 0x00, 0x00, } ; // send svWOW_INITIAL_SPELLS wowPacket spells; spells.PutHeader(svWOW_INITIAL_SPELLS); spells.PutData(rawData_initialspells,113); spells.Finalize(); mSocket->Write(spells.GetData(),spells.GetSize()); // send svWOW_ACTION_BUTTONS wowPacket buttons; buttons.PutHeader(svWOW_ACTION_BUTTONS); buttons.PutData(mCharacter->mActionButtons,sizeof(wxUint32)*cNumActionButtons); buttons.Finalize(); mSocket->Write(buttons.GetData(),buttons.GetSize()); // send svWOW_INITIALIZE_FACTIONS wowPacket factions; factions.PutHeader(svWOW_INITIALIZE_FACTIONS); factions.Putu32(0x00000040); factions.Putu8(2); factions.Putu32(0); factions.Putu8(0); factions.Putu32(0); factions.Putu8(2); factions.Putu32(0); factions.Putu8(2); factions.Putu32(0); factions.PutData(voiddata,300); factions.Finalize(); mSocket->Write(factions.GetData(),factions.GetSize()); // send svWOW_NEW_TIME_SPEED wowPacket timespeed; timespeed.PutHeader(svWOW_NEW_TIME_SPEED); timespeed.Putu32(0x04010d35); timespeed.Putu32(0x3c888889); timespeed.Finalize(); mSocket->Write(timespeed.GetData(),timespeed.GetSize()); wowPacket obj; obj.PutHeader(svWOW_OBJECTUPDATE); obj.Putu32(1); // numobjects mCharacter->BuildObjectUpdate(obj,1); obj.Finalize(); mSocket->Write(obj.GetData(),obj.GetSize()); }*/ #endif
[ "francois@fat.sh" ]
francois@fat.sh
9714315f34f4f7548fe6281fbc6e1b00bfeab6fa
1fc03d2d7fab6aa76bac20d9e209f4ee793e458b
/ipasir/sat/cryptominisat4/src/stamp.h
3d6de8eecfa265dcc05dd922acb62d9a088088fe
[ "MIT" ]
permissive
yosid16/logic
45f887ba1bb11de35ea6a0980fbe8cee66d75e99
64d50680cba9d4d43d4f209dd1cd91904e25a015
refs/heads/master
2021-01-11T12:05:53.620540
2017-03-04T20:13:30
2017-03-04T20:13:30
79,369,707
0
0
null
null
null
null
UTF-8
C++
false
false
3,880
h
/* * CryptoMiniSat * * Copyright (c) 2009-2015, Mate Soos. All rights reserved. * * 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 * version 2.0 of the License. * * 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., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __STAMP_H__ #define __STAMP_H__ #include <vector> #include <algorithm> #include "solvertypes.h" #include "clause.h" #include "constants.h" namespace CMSat { using std::vector; enum StampType { STAMP_IRRED = 0 , STAMP_RED = 1 }; struct Timestamp { Timestamp() { start[STAMP_IRRED] = 0; start[STAMP_RED] = 0; end[STAMP_IRRED] = 0; end[STAMP_RED] = 0; } uint64_t start[2]; uint64_t end[2]; }; class Stamp { public: bool stampBasedClRem(const vector<Lit>& lits) const; std::pair<size_t, size_t> stampBasedLitRem( vector<Lit>& lits , StampType stampType ) const; void updateVars( const vector<uint32_t>& outerToInter , const vector<uint32_t>& interToOuter2 , vector<uint16_t>& seen ); void clearStamps(); void save_on_var_memory(const uint32_t newNumVars); uint64_t stampingTime = 0; vector<Timestamp> tstamp; void new_var() { tstamp.push_back(Timestamp()); tstamp.push_back(Timestamp()); } void new_vars(const size_t n) { tstamp.resize(tstamp.size() + 2*n, Timestamp()); } size_t mem_used() const { return tstamp.capacity()*sizeof(Timestamp); } void freeMem() { vector<Timestamp> tmp; tstamp.swap(tmp); } private: struct StampSorter { StampSorter( const vector<Timestamp>& _timestamp , const StampType _stampType , const bool _rev ) : timestamp(_timestamp) , stampType(_stampType) , rev(_rev) {} const vector<Timestamp>& timestamp; const StampType stampType; const bool rev; bool operator()(const Lit lit1, const Lit lit2) const { if (!rev) { return timestamp[lit1.toInt()].start[stampType] < timestamp[lit2.toInt()].start[stampType]; } else { return timestamp[lit1.toInt()].start[stampType] > timestamp[lit2.toInt()].start[stampType]; } } }; struct StampSorterInv { StampSorterInv( const vector<Timestamp>& _timestamp , const StampType _stampType , const bool _rev ) : timestamp(_timestamp) , stampType(_stampType) , rev(_rev) {} const vector<Timestamp>& timestamp; const StampType stampType; const bool rev; bool operator()(const Lit lit1, const Lit lit2) const { if (!rev) { return timestamp[(~lit1).toInt()].start[stampType] < timestamp[(~lit2).toInt()].start[stampType]; } else { return timestamp[(~lit1).toInt()].start[stampType] > timestamp[(~lit2).toInt()].start[stampType]; } } }; mutable vector<Lit> stampNorm; mutable vector<Lit> stampInv; }; } //end namespace #endif //__STAMP_H__
[ "yosid16@gmail.com" ]
yosid16@gmail.com
40cb7afbdd679b350231598ee237fb2819a887ac
b7e2b49b89ad9b842119410404b461f70b0716e5
/src/WebBrowserWnd.h
1675d3cba0c037832dce335806bd3cebf48d38fc
[]
no_license
charleson/emule_verycd
31f3c71e0478b036f957edacd10f0f398c886165
489f841518e9313e9b387ad87298d32141c212f8
refs/heads/master
2020-04-06T04:18:04.657439
2012-09-16T15:11:58
2012-09-16T15:11:58
null
0
0
null
null
null
null
GB18030
C++
false
false
1,876
h
#pragma once #include "ResizableLib\ResizableDialog.h" #include "htmlctrl.h" #include "browsertoolbarctrl.h" #include "comboboxenter.h" #include "afxcmn.h" #include "afxwin.h" typedef enum // 浏览器浏览不同页面状态 { EB_PT_LOADER, // 启动页 EB_PT_PAGE // 普通页面 }EM_BROWSER_PAGETYPE; // CWebBrowserWnd 对话框 class CWebBrowserWnd : public CResizableDialog { DECLARE_DYNAMIC(CWebBrowserWnd) public: CWebBrowserWnd(CWnd* pParent = NULL); // 标准构造函数 virtual ~CWebBrowserWnd(); // 对话框数据 enum { IDD = IDD_WEBBROWSER }; public: HICON m_browsericon; protected: CHtmlCtrl* m_pExplorer; //Added by thilon 2006.10.12 EM_BROWSER_PAGETYPE m_pagetype; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MESSAGE_MAP() afx_msg void OnNewAddress(); afx_msg void OnNewAddressEnter(); afx_msg void OnBack(); afx_msg void OnForward(); afx_msg void OnStop(); afx_msg void OnHomePage(); afx_msg void OnRefresh(); public: virtual BOOL OnInitDialog(); CBrowserToolbarCtrl m_toolbar; void Localize(void); CComboBoxEnter m_addressbox; CAnimateCtrl m_animate; CStatic m_status; CStatic m_staticError; // VC-SearchDream[2006-12-26]: Added for Runtime Error UINT m_uStridDisableReason; BOOL IsBrowserCanUse(){return NULL != m_pExplorer;} void DisableBrowser(UINT uStridReason); public: EM_BROWSER_PAGETYPE GetPageType(void) { return m_pagetype;} void SetAddress(LPCTSTR lpszURL); void StartAnimation(); void StopAnimation(); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); CString ResourceToURL(LPCTSTR lpszURL); //Chocobo Start //浏览器访问指定页面,added by Chocobo on 2006.08.07 //方便帮助链接在内置浏览器中显示 void Navigate(LPCTSTR lpszURL); //Chocobo End afx_msg void OnSize(UINT nType, int cx, int cy); };
[ "codingforfan@gmail.com" ]
codingforfan@gmail.com
ae4a490b951a1dc37a9e11fb1c21dc1a1cc963e6
1958b55376bf54fea19e15863f9a27f8a9eacde9
/src/DSFMLC/Graphics/CreateRenderStates.hpp
94d20354726e0fe8128246b238ae8e267470983b
[ "Zlib" ]
permissive
joelcnz/DSFML
97d4c5e0a3e3c61ab5da236988f6f93367152ae1
ed5170b9a2c8da89c05b94b7d5986c0718da04c3
refs/heads/master
2020-07-25T07:17:19.057362
2019-09-13T06:48:22
2019-09-13T06:48:22
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,445
hpp
/* * DSFML - The Simple and Fast Multimedia Library for D * * Copyright (c) 2013 - 2018 Jeremy DeHaan (dehaan.jeremiah@gmail.com) * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the * use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not claim * that you wrote the original software. If you use this software in a product, * an acknowledgment in the product documentation would be appreciated but is * not required. * * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source distribution * * * DSFML is based on SFML (Copyright Laurent Gomila) */ #ifndef DSFML_CONVERTRENDERSTATES_H #define DSFML_CONVERTRENDERSTATES_H #include <SFML/Graphics/RenderStates.hpp> #include <SFML/Graphics/BlendMode.hpp> #include <DSFMLC/Graphics/TextureStruct.h> #include <DSFMLC/Graphics/ShaderStruct.h> // Convert sfRenderStates* to sf::RenderStates inline sf::RenderStates createRenderStates(DInt colorSrcFactor, DInt colorDstFactor, DInt colorEquation, DInt alphaSrcFactor, DInt alphaDstFactor, DInt alphaEquation, const float* transform, const sfTexture* texture, const sfShader* shader) { sf::RenderStates sfmlStates; sf::BlendMode blendMode; blendMode.colorSrcFactor = static_cast<sf::BlendMode::Factor>(colorSrcFactor); blendMode.colorDstFactor = static_cast<sf::BlendMode::Factor>(colorDstFactor); blendMode.colorEquation = static_cast<sf::BlendMode::Equation>(colorEquation); blendMode.alphaSrcFactor = static_cast<sf::BlendMode::Factor>(alphaSrcFactor); blendMode.alphaDstFactor = static_cast<sf::BlendMode::Factor>(alphaDstFactor); blendMode.alphaEquation = static_cast<sf::BlendMode::Equation>(alphaEquation); sfmlStates.blendMode = blendMode; sfmlStates.transform = *reinterpret_cast<const sf::Transform*>(transform); sfmlStates.texture = texture ? texture->This : NULL; sfmlStates.shader = shader ? &shader->This : NULL; return sfmlStates; } #endif // DSFML_CONVERTRENDERSTATES_H
[ "dehaan.jeremiah@gmail.com" ]
dehaan.jeremiah@gmail.com
6606751c8be60e6d057e63df4d055a4186ea7587
37421acb6ab434bf46afc30fe20397892b55fd93
/code/l3lib/include/google/protobuf/type.pb.cc
ed71fb2ea856657bd26e6c7b4ca166b6c79098fe
[]
no_license
achishex/thunder
cd7f78b23eaf87a83b258eb2c930d97eccbe7e81
e07135f6c496f268c8b0b043148b9a30bcc60a64
refs/heads/master
2021-05-06T10:27:23.416594
2017-09-01T16:35:36
2017-09-01T16:35:36
null
0
0
null
null
null
null
UTF-8
C++
false
true
115,704
cc
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/type.proto #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include "../../../../l3lib/include/google/protobuf/type.pb.h" #include <algorithm> #include "../../../../l3lib/include/google/protobuf/stubs/common.h" #include "../../../../l3lib/include/google/protobuf/stubs/port.h" #include "../../../../l3lib/include/google/protobuf/stubs/once.h" #include "../../../../l3lib/include/google/protobuf/io/coded_stream.h" #include "../../../../l3lib/include/google/protobuf/wire_format_lite_inl.h" #include "../../../../l3lib/include/google/protobuf/descriptor.h" #include "../../../../l3lib/include/google/protobuf/generated_message_reflection.h" #include "../../../../l3lib/include/google/protobuf/reflection_ops.h" #include "../../../../l3lib/include/google/protobuf/wire_format.h" // @@protoc_insertion_point(includes) namespace google { namespace protobuf { namespace { const ::google::protobuf::Descriptor* Type_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* Type_reflection_ = NULL; const ::google::protobuf::Descriptor* Field_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* Field_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* Field_Kind_descriptor_ = NULL; const ::google::protobuf::EnumDescriptor* Field_Cardinality_descriptor_ = NULL; const ::google::protobuf::Descriptor* Enum_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* Enum_reflection_ = NULL; const ::google::protobuf::Descriptor* EnumValue_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* EnumValue_reflection_ = NULL; const ::google::protobuf::Descriptor* Option_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* Option_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* Syntax_descriptor_ = NULL; } // namespace void protobuf_AssignDesc_google_2fprotobuf_2ftype_2eproto() GOOGLE_ATTRIBUTE_COLD; void protobuf_AssignDesc_google_2fprotobuf_2ftype_2eproto() { protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); const ::google::protobuf::FileDescriptor* file = ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( "google/protobuf/type.proto"); GOOGLE_CHECK(file != NULL); Type_descriptor_ = file->message_type(0); static const int Type_offsets_[6] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, fields_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, oneofs_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, options_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, source_context_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, syntax_), }; Type_reflection_ = ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( Type_descriptor_, Type::default_instance_, Type_offsets_, -1, -1, -1, sizeof(Type), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, _internal_metadata_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, _is_default_instance_)); Field_descriptor_ = file->message_type(1); static const int Field_offsets_[10] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, kind_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, cardinality_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, number_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, type_url_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, oneof_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, packed_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, options_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, json_name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, default_value_), }; Field_reflection_ = ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( Field_descriptor_, Field::default_instance_, Field_offsets_, -1, -1, -1, sizeof(Field), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, _internal_metadata_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, _is_default_instance_)); Field_Kind_descriptor_ = Field_descriptor_->enum_type(0); Field_Cardinality_descriptor_ = Field_descriptor_->enum_type(1); Enum_descriptor_ = file->message_type(2); static const int Enum_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, enumvalue_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, options_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, source_context_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, syntax_), }; Enum_reflection_ = ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( Enum_descriptor_, Enum::default_instance_, Enum_offsets_, -1, -1, -1, sizeof(Enum), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, _internal_metadata_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, _is_default_instance_)); EnumValue_descriptor_ = file->message_type(3); static const int EnumValue_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, number_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, options_), }; EnumValue_reflection_ = ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( EnumValue_descriptor_, EnumValue::default_instance_, EnumValue_offsets_, -1, -1, -1, sizeof(EnumValue), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, _internal_metadata_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, _is_default_instance_)); Option_descriptor_ = file->message_type(4); static const int Option_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, value_), }; Option_reflection_ = ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( Option_descriptor_, Option::default_instance_, Option_offsets_, -1, -1, -1, sizeof(Option), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, _internal_metadata_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, _is_default_instance_)); Syntax_descriptor_ = file->enum_type(0); } namespace { GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); inline void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, &protobuf_AssignDesc_google_2fprotobuf_2ftype_2eproto); } void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Type_descriptor_, &Type::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Field_descriptor_, &Field::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Enum_descriptor_, &Enum::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( EnumValue_descriptor_, &EnumValue::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Option_descriptor_, &Option::default_instance()); } } // namespace void protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto() { delete Type::default_instance_; delete Type_reflection_; delete Field::default_instance_; delete Field_reflection_; delete Enum::default_instance_; delete Enum_reflection_; delete EnumValue::default_instance_; delete EnumValue_reflection_; delete Option::default_instance_; delete Option_reflection_; } void protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto() GOOGLE_ATTRIBUTE_COLD; void protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto() { static bool already_here = false; if (already_here) return; already_here = true; GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto(); ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( "\n\032google/protobuf/type.proto\022\017google.pro" "tobuf\032\031google/protobuf/any.proto\032$google" "/protobuf/source_context.proto\"\327\001\n\004Type\022" "\014\n\004name\030\001 \001(\t\022&\n\006fields\030\002 \003(\0132\026.google.p" "rotobuf.Field\022\016\n\006oneofs\030\003 \003(\t\022(\n\007options" "\030\004 \003(\0132\027.google.protobuf.Option\0226\n\016sourc" "e_context\030\005 \001(\0132\036.google.protobuf.Source" "Context\022\'\n\006syntax\030\006 \001(\0162\027.google.protobu" "f.Syntax\"\325\005\n\005Field\022)\n\004kind\030\001 \001(\0162\033.googl" "e.protobuf.Field.Kind\0227\n\013cardinality\030\002 \001" "(\0162\".google.protobuf.Field.Cardinality\022\016" "\n\006number\030\003 \001(\005\022\014\n\004name\030\004 \001(\t\022\020\n\010type_url" "\030\006 \001(\t\022\023\n\013oneof_index\030\007 \001(\005\022\016\n\006packed\030\010 " "\001(\010\022(\n\007options\030\t \003(\0132\027.google.protobuf.O" "ption\022\021\n\tjson_name\030\n \001(\t\022\025\n\rdefault_valu" "e\030\013 \001(\t\"\310\002\n\004Kind\022\020\n\014TYPE_UNKNOWN\020\000\022\017\n\013TY" "PE_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTYPE_INT6" "4\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT32\020\005\022\020\n\014" "TYPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022\r\n\tTYPE" "_BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_GROUP\020\n" "\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020\014\022\017\n\013TY" "PE_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYPE_SFIXE" "D32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_SINT32\020" "\021\022\017\n\013TYPE_SINT64\020\022\"t\n\013Cardinality\022\027\n\023CAR" "DINALITY_UNKNOWN\020\000\022\030\n\024CARDINALITY_OPTION" "AL\020\001\022\030\n\024CARDINALITY_REQUIRED\020\002\022\030\n\024CARDIN" "ALITY_REPEATED\020\003\"\316\001\n\004Enum\022\014\n\004name\030\001 \001(\t\022" "-\n\tenumvalue\030\002 \003(\0132\032.google.protobuf.Enu" "mValue\022(\n\007options\030\003 \003(\0132\027.google.protobu" "f.Option\0226\n\016source_context\030\004 \001(\0132\036.googl" "e.protobuf.SourceContext\022\'\n\006syntax\030\005 \001(\016" "2\027.google.protobuf.Syntax\"S\n\tEnumValue\022\014" "\n\004name\030\001 \001(\t\022\016\n\006number\030\002 \001(\005\022(\n\007options\030" "\003 \003(\0132\027.google.protobuf.Option\";\n\006Option" "\022\014\n\004name\030\001 \001(\t\022#\n\005value\030\002 \001(\0132\024.google.p" "rotobuf.Any*.\n\006Syntax\022\021\n\rSYNTAX_PROTO2\020\000" "\022\021\n\rSYNTAX_PROTO3\020\001BL\n\023com.google.protob" "ufB\tTypeProtoP\001\240\001\001\242\002\003GPB\252\002\036Google.Protob" "uf.WellKnownTypesb\006proto3", 1545); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/type.proto", &protobuf_RegisterTypes); Type::default_instance_ = new Type(); Field::default_instance_ = new Field(); Enum::default_instance_ = new Enum(); EnumValue::default_instance_ = new EnumValue(); Option::default_instance_ = new Option(); Type::default_instance_->InitAsDefaultInstance(); Field::default_instance_->InitAsDefaultInstance(); Enum::default_instance_->InitAsDefaultInstance(); EnumValue::default_instance_->InitAsDefaultInstance(); Option::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2ftype_2eproto); } // Force AddDescriptors() to be called at static initialization time. struct StaticDescriptorInitializer_google_2fprotobuf_2ftype_2eproto { StaticDescriptorInitializer_google_2fprotobuf_2ftype_2eproto() { protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); } } static_descriptor_initializer_google_2fprotobuf_2ftype_2eproto_; const ::google::protobuf::EnumDescriptor* Syntax_descriptor() { protobuf_AssignDescriptorsOnce(); return Syntax_descriptor_; } bool Syntax_IsValid(int value) { switch(value) { case 0: case 1: return true; default: return false; } } // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Type::kNameFieldNumber; const int Type::kFieldsFieldNumber; const int Type::kOneofsFieldNumber; const int Type::kOptionsFieldNumber; const int Type::kSourceContextFieldNumber; const int Type::kSyntaxFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Type::Type() : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Type) } void Type::InitAsDefaultInstance() { _is_default_instance_ = true; source_context_ = const_cast< ::google::protobuf::SourceContext*>(&::google::protobuf::SourceContext::default_instance()); } Type::Type(const Type& from) : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:google.protobuf.Type) } void Type::SharedCtor() { _is_default_instance_ = false; ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); source_context_ = NULL; syntax_ = 0; } Type::~Type() { // @@protoc_insertion_point(destructor:google.protobuf.Type) SharedDtor(); } void Type::SharedDtor() { name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != default_instance_) { delete source_context_; } } void Type::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Type::descriptor() { protobuf_AssignDescriptorsOnce(); return Type_descriptor_; } const Type& Type::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); return *default_instance_; } Type* Type::default_instance_ = NULL; Type* Type::New(::google::protobuf::Arena* arena) const { Type* n = new Type; if (arena != NULL) { arena->Own(n); } return n; } void Type::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.Type) name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (GetArenaNoVirtual() == NULL && source_context_ != NULL) delete source_context_; source_context_ = NULL; syntax_ = 0; fields_.Clear(); oneofs_.Clear(); options_.Clear(); } bool Type::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Type) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Type.name")); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_fields; break; } // repeated .google.protobuf.Field fields = 2; case 2: { if (tag == 18) { parse_fields: DO_(input->IncrementRecursionDepth()); parse_loop_fields: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_fields())); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_loop_fields; input->UnsafeDecrementRecursionDepth(); if (input->ExpectTag(26)) goto parse_oneofs; break; } // repeated string oneofs = 3; case 3: { if (tag == 26) { parse_oneofs: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_oneofs())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->oneofs(this->oneofs_size() - 1).data(), this->oneofs(this->oneofs_size() - 1).length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Type.oneofs")); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_oneofs; if (input->ExpectTag(34)) goto parse_options; break; } // repeated .google.protobuf.Option options = 4; case 4: { if (tag == 34) { parse_options: DO_(input->IncrementRecursionDepth()); parse_loop_options: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); } else { goto handle_unusual; } if (input->ExpectTag(34)) goto parse_loop_options; input->UnsafeDecrementRecursionDepth(); if (input->ExpectTag(42)) goto parse_source_context; break; } // optional .google.protobuf.SourceContext source_context = 5; case 5: { if (tag == 42) { parse_source_context: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_source_context())); } else { goto handle_unusual; } if (input->ExpectTag(48)) goto parse_syntax; break; } // optional .google.protobuf.Syntax syntax = 6; case 6: { if (tag == 48) { parse_syntax: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); set_syntax(static_cast< ::google::protobuf::Syntax >(value)); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } success: // @@protoc_insertion_point(parse_success:google.protobuf.Type) return true; failure: // @@protoc_insertion_point(parse_failure:google.protobuf.Type) return false; #undef DO_ } void Type::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.Type) // optional string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Type.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->name(), output); } // repeated .google.protobuf.Field fields = 2; for (unsigned int i = 0, n = this->fields_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2, this->fields(i), output); } // repeated string oneofs = 3; for (int i = 0; i < this->oneofs_size(); i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->oneofs(i).data(), this->oneofs(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Type.oneofs"); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->oneofs(i), output); } // repeated .google.protobuf.Option options = 4; for (unsigned int i = 0, n = this->options_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 4, this->options(i), output); } // optional .google.protobuf.SourceContext source_context = 5; if (this->has_source_context()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 5, *this->source_context_, output); } // optional .google.protobuf.Syntax syntax = 6; if (this->syntax() != 0) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 6, this->syntax(), output); } // @@protoc_insertion_point(serialize_end:google.protobuf.Type) } ::google::protobuf::uint8* Type::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Type) // optional string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Type.name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->name(), target); } // repeated .google.protobuf.Field fields = 2; for (unsigned int i = 0, n = this->fields_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( 2, this->fields(i), false, target); } // repeated string oneofs = 3; for (int i = 0; i < this->oneofs_size(); i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->oneofs(i).data(), this->oneofs(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Type.oneofs"); target = ::google::protobuf::internal::WireFormatLite:: WriteStringToArray(3, this->oneofs(i), target); } // repeated .google.protobuf.Option options = 4; for (unsigned int i = 0, n = this->options_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( 4, this->options(i), false, target); } // optional .google.protobuf.SourceContext source_context = 5; if (this->has_source_context()) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( 5, *this->source_context_, false, target); } // optional .google.protobuf.Syntax syntax = 6; if (this->syntax() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 6, this->syntax(), target); } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Type) return target; } int Type::ByteSize() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Type) int total_size = 0; // optional string name = 1; if (this->name().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional .google.protobuf.SourceContext source_context = 5; if (this->has_source_context()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( *this->source_context_); } // optional .google.protobuf.Syntax syntax = 6; if (this->syntax() != 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->syntax()); } // repeated .google.protobuf.Field fields = 2; total_size += 1 * this->fields_size(); for (int i = 0; i < this->fields_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->fields(i)); } // repeated string oneofs = 3; total_size += 1 * this->oneofs_size(); for (int i = 0; i < this->oneofs_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->oneofs(i)); } // repeated .google.protobuf.Option options = 4; total_size += 1 * this->options_size(); for (int i = 0; i < this->options_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->options(i)); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void Type::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Type) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } const Type* source = ::google::protobuf::internal::DynamicCastToGenerated<const Type>( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Type) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Type) MergeFrom(*source); } } void Type::MergeFrom(const Type& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Type) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } fields_.MergeFrom(from.fields_); oneofs_.MergeFrom(from.oneofs_); options_.MergeFrom(from.options_); if (from.name().size() > 0) { name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); } if (from.has_source_context()) { mutable_source_context()->::google::protobuf::SourceContext::MergeFrom(from.source_context()); } if (from.syntax() != 0) { set_syntax(from.syntax()); } } void Type::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Type) if (&from == this) return; Clear(); MergeFrom(from); } void Type::CopyFrom(const Type& from) { // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Type) if (&from == this) return; Clear(); MergeFrom(from); } bool Type::IsInitialized() const { return true; } void Type::Swap(Type* other) { if (other == this) return; InternalSwap(other); } void Type::InternalSwap(Type* other) { name_.Swap(&other->name_); fields_.UnsafeArenaSwap(&other->fields_); oneofs_.UnsafeArenaSwap(&other->oneofs_); options_.UnsafeArenaSwap(&other->options_); std::swap(source_context_, other->source_context_); std::swap(syntax_, other->syntax_); _internal_metadata_.Swap(&other->_internal_metadata_); std::swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata Type::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = Type_descriptor_; metadata.reflection = Type_reflection_; return metadata; } #if PROTOBUF_INLINE_NOT_IN_HEADERS // Type // optional string name = 1; void Type::clear_name() { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& Type::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Type.name) return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Type::set_name(const ::std::string& value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.Type.name) } void Type::set_name(const char* value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Type.name) } void Type::set_name(const char* value, size_t size) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Type.name) } ::std::string* Type::mutable_name() { // @@protoc_insertion_point(field_mutable:google.protobuf.Type.name) return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* Type::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Type.name) return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Type::set_allocated_name(::std::string* name) { if (name != NULL) { } else { } name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.name) } // repeated .google.protobuf.Field fields = 2; int Type::fields_size() const { return fields_.size(); } void Type::clear_fields() { fields_.Clear(); } const ::google::protobuf::Field& Type::fields(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Type.fields) return fields_.Get(index); } ::google::protobuf::Field* Type::mutable_fields(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Type.fields) return fields_.Mutable(index); } ::google::protobuf::Field* Type::add_fields() { // @@protoc_insertion_point(field_add:google.protobuf.Type.fields) return fields_.Add(); } ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >* Type::mutable_fields() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.fields) return &fields_; } const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >& Type::fields() const { // @@protoc_insertion_point(field_list:google.protobuf.Type.fields) return fields_; } // repeated string oneofs = 3; int Type::oneofs_size() const { return oneofs_.size(); } void Type::clear_oneofs() { oneofs_.Clear(); } const ::std::string& Type::oneofs(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Type.oneofs) return oneofs_.Get(index); } ::std::string* Type::mutable_oneofs(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Type.oneofs) return oneofs_.Mutable(index); } void Type::set_oneofs(int index, const ::std::string& value) { // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs) oneofs_.Mutable(index)->assign(value); } void Type::set_oneofs(int index, const char* value) { oneofs_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.Type.oneofs) } void Type::set_oneofs(int index, const char* value, size_t size) { oneofs_.Mutable(index)->assign( reinterpret_cast<const char*>(value), size); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Type.oneofs) } ::std::string* Type::add_oneofs() { // @@protoc_insertion_point(field_add_mutable:google.protobuf.Type.oneofs) return oneofs_.Add(); } void Type::add_oneofs(const ::std::string& value) { oneofs_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs) } void Type::add_oneofs(const char* value) { oneofs_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.Type.oneofs) } void Type::add_oneofs(const char* value, size_t size) { oneofs_.Add()->assign(reinterpret_cast<const char*>(value), size); // @@protoc_insertion_point(field_add_pointer:google.protobuf.Type.oneofs) } const ::google::protobuf::RepeatedPtrField< ::std::string>& Type::oneofs() const { // @@protoc_insertion_point(field_list:google.protobuf.Type.oneofs) return oneofs_; } ::google::protobuf::RepeatedPtrField< ::std::string>* Type::mutable_oneofs() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.oneofs) return &oneofs_; } // repeated .google.protobuf.Option options = 4; int Type::options_size() const { return options_.size(); } void Type::clear_options() { options_.Clear(); } const ::google::protobuf::Option& Type::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Type.options) return options_.Get(index); } ::google::protobuf::Option* Type::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Type.options) return options_.Mutable(index); } ::google::protobuf::Option* Type::add_options() { // @@protoc_insertion_point(field_add:google.protobuf.Type.options) return options_.Add(); } ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* Type::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.options) return &options_; } const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& Type::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Type.options) return options_; } // optional .google.protobuf.SourceContext source_context = 5; bool Type::has_source_context() const { return !_is_default_instance_ && source_context_ != NULL; } void Type::clear_source_context() { if (GetArenaNoVirtual() == NULL && source_context_ != NULL) delete source_context_; source_context_ = NULL; } const ::google::protobuf::SourceContext& Type::source_context() const { // @@protoc_insertion_point(field_get:google.protobuf.Type.source_context) return source_context_ != NULL ? *source_context_ : *default_instance_->source_context_; } ::google::protobuf::SourceContext* Type::mutable_source_context() { if (source_context_ == NULL) { source_context_ = new ::google::protobuf::SourceContext; } // @@protoc_insertion_point(field_mutable:google.protobuf.Type.source_context) return source_context_; } ::google::protobuf::SourceContext* Type::release_source_context() { // @@protoc_insertion_point(field_release:google.protobuf.Type.source_context) ::google::protobuf::SourceContext* temp = source_context_; source_context_ = NULL; return temp; } void Type::set_allocated_source_context(::google::protobuf::SourceContext* source_context) { delete source_context_; source_context_ = source_context; if (source_context) { } else { } // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.source_context) } // optional .google.protobuf.Syntax syntax = 6; void Type::clear_syntax() { syntax_ = 0; } ::google::protobuf::Syntax Type::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.Type.syntax) return static_cast< ::google::protobuf::Syntax >(syntax_); } void Type::set_syntax(::google::protobuf::Syntax value) { syntax_ = value; // @@protoc_insertion_point(field_set:google.protobuf.Type.syntax) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== const ::google::protobuf::EnumDescriptor* Field_Kind_descriptor() { protobuf_AssignDescriptorsOnce(); return Field_Kind_descriptor_; } bool Field_Kind_IsValid(int value) { switch(value) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: return true; default: return false; } } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const Field_Kind Field::TYPE_UNKNOWN; const Field_Kind Field::TYPE_DOUBLE; const Field_Kind Field::TYPE_FLOAT; const Field_Kind Field::TYPE_INT64; const Field_Kind Field::TYPE_UINT64; const Field_Kind Field::TYPE_INT32; const Field_Kind Field::TYPE_FIXED64; const Field_Kind Field::TYPE_FIXED32; const Field_Kind Field::TYPE_BOOL; const Field_Kind Field::TYPE_STRING; const Field_Kind Field::TYPE_GROUP; const Field_Kind Field::TYPE_MESSAGE; const Field_Kind Field::TYPE_BYTES; const Field_Kind Field::TYPE_UINT32; const Field_Kind Field::TYPE_ENUM; const Field_Kind Field::TYPE_SFIXED32; const Field_Kind Field::TYPE_SFIXED64; const Field_Kind Field::TYPE_SINT32; const Field_Kind Field::TYPE_SINT64; const Field_Kind Field::Kind_MIN; const Field_Kind Field::Kind_MAX; const int Field::Kind_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 const ::google::protobuf::EnumDescriptor* Field_Cardinality_descriptor() { protobuf_AssignDescriptorsOnce(); return Field_Cardinality_descriptor_; } bool Field_Cardinality_IsValid(int value) { switch(value) { case 0: case 1: case 2: case 3: return true; default: return false; } } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const Field_Cardinality Field::CARDINALITY_UNKNOWN; const Field_Cardinality Field::CARDINALITY_OPTIONAL; const Field_Cardinality Field::CARDINALITY_REQUIRED; const Field_Cardinality Field::CARDINALITY_REPEATED; const Field_Cardinality Field::Cardinality_MIN; const Field_Cardinality Field::Cardinality_MAX; const int Field::Cardinality_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Field::kKindFieldNumber; const int Field::kCardinalityFieldNumber; const int Field::kNumberFieldNumber; const int Field::kNameFieldNumber; const int Field::kTypeUrlFieldNumber; const int Field::kOneofIndexFieldNumber; const int Field::kPackedFieldNumber; const int Field::kOptionsFieldNumber; const int Field::kJsonNameFieldNumber; const int Field::kDefaultValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Field::Field() : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Field) } void Field::InitAsDefaultInstance() { _is_default_instance_ = true; } Field::Field(const Field& from) : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:google.protobuf.Field) } void Field::SharedCtor() { _is_default_instance_ = false; ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; kind_ = 0; cardinality_ = 0; number_ = 0; name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); oneof_index_ = 0; packed_ = false; json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } Field::~Field() { // @@protoc_insertion_point(destructor:google.protobuf.Field) SharedDtor(); } void Field::SharedDtor() { name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); json_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); default_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != default_instance_) { } } void Field::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Field::descriptor() { protobuf_AssignDescriptorsOnce(); return Field_descriptor_; } const Field& Field::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); return *default_instance_; } Field* Field::default_instance_ = NULL; Field* Field::New(::google::protobuf::Arena* arena) const { Field* n = new Field; if (arena != NULL) { arena->Own(n); } return n; } void Field::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.Field) #if defined(__clang__) #define ZR_HELPER_(f) \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ __builtin_offsetof(Field, f) \ _Pragma("clang diagnostic pop") #else #define ZR_HELPER_(f) reinterpret_cast<char*>(\ &reinterpret_cast<Field*>(16)->f) #endif #define ZR_(first, last) do {\ ::memset(&first, 0,\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ } while (0) ZR_(kind_, cardinality_); ZR_(number_, oneof_index_); name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); packed_ = false; json_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); default_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); #undef ZR_HELPER_ #undef ZR_ options_.Clear(); } bool Field::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Field) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .google.protobuf.Field.Kind kind = 1; case 1: { if (tag == 8) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); set_kind(static_cast< ::google::protobuf::Field_Kind >(value)); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_cardinality; break; } // optional .google.protobuf.Field.Cardinality cardinality = 2; case 2: { if (tag == 16) { parse_cardinality: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); set_cardinality(static_cast< ::google::protobuf::Field_Cardinality >(value)); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_number; break; } // optional int32 number = 3; case 3: { if (tag == 24) { parse_number: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &number_))); } else { goto handle_unusual; } if (input->ExpectTag(34)) goto parse_name; break; } // optional string name = 4; case 4: { if (tag == 34) { parse_name: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Field.name")); } else { goto handle_unusual; } if (input->ExpectTag(50)) goto parse_type_url; break; } // optional string type_url = 6; case 6: { if (tag == 50) { parse_type_url: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_type_url())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->type_url().data(), this->type_url().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Field.type_url")); } else { goto handle_unusual; } if (input->ExpectTag(56)) goto parse_oneof_index; break; } // optional int32 oneof_index = 7; case 7: { if (tag == 56) { parse_oneof_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &oneof_index_))); } else { goto handle_unusual; } if (input->ExpectTag(64)) goto parse_packed; break; } // optional bool packed = 8; case 8: { if (tag == 64) { parse_packed: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &packed_))); } else { goto handle_unusual; } if (input->ExpectTag(74)) goto parse_options; break; } // repeated .google.protobuf.Option options = 9; case 9: { if (tag == 74) { parse_options: DO_(input->IncrementRecursionDepth()); parse_loop_options: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); } else { goto handle_unusual; } if (input->ExpectTag(74)) goto parse_loop_options; input->UnsafeDecrementRecursionDepth(); if (input->ExpectTag(82)) goto parse_json_name; break; } // optional string json_name = 10; case 10: { if (tag == 82) { parse_json_name: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_json_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->json_name().data(), this->json_name().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Field.json_name")); } else { goto handle_unusual; } if (input->ExpectTag(90)) goto parse_default_value; break; } // optional string default_value = 11; case 11: { if (tag == 90) { parse_default_value: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_default_value())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->default_value().data(), this->default_value().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Field.default_value")); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } success: // @@protoc_insertion_point(parse_success:google.protobuf.Field) return true; failure: // @@protoc_insertion_point(parse_failure:google.protobuf.Field) return false; #undef DO_ } void Field::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.Field) // optional .google.protobuf.Field.Kind kind = 1; if (this->kind() != 0) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 1, this->kind(), output); } // optional .google.protobuf.Field.Cardinality cardinality = 2; if (this->cardinality() != 0) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 2, this->cardinality(), output); } // optional int32 number = 3; if (this->number() != 0) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->number(), output); } // optional string name = 4; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 4, this->name(), output); } // optional string type_url = 6; if (this->type_url().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->type_url().data(), this->type_url().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.type_url"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 6, this->type_url(), output); } // optional int32 oneof_index = 7; if (this->oneof_index() != 0) { ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->oneof_index(), output); } // optional bool packed = 8; if (this->packed() != 0) { ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->packed(), output); } // repeated .google.protobuf.Option options = 9; for (unsigned int i = 0, n = this->options_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 9, this->options(i), output); } // optional string json_name = 10; if (this->json_name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->json_name().data(), this->json_name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.json_name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 10, this->json_name(), output); } // optional string default_value = 11; if (this->default_value().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->default_value().data(), this->default_value().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.default_value"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 11, this->default_value(), output); } // @@protoc_insertion_point(serialize_end:google.protobuf.Field) } ::google::protobuf::uint8* Field::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Field) // optional .google.protobuf.Field.Kind kind = 1; if (this->kind() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 1, this->kind(), target); } // optional .google.protobuf.Field.Cardinality cardinality = 2; if (this->cardinality() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 2, this->cardinality(), target); } // optional int32 number = 3; if (this->number() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->number(), target); } // optional string name = 4; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 4, this->name(), target); } // optional string type_url = 6; if (this->type_url().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->type_url().data(), this->type_url().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.type_url"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 6, this->type_url(), target); } // optional int32 oneof_index = 7; if (this->oneof_index() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->oneof_index(), target); } // optional bool packed = 8; if (this->packed() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(8, this->packed(), target); } // repeated .google.protobuf.Option options = 9; for (unsigned int i = 0, n = this->options_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( 9, this->options(i), false, target); } // optional string json_name = 10; if (this->json_name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->json_name().data(), this->json_name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.json_name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 10, this->json_name(), target); } // optional string default_value = 11; if (this->default_value().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->default_value().data(), this->default_value().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Field.default_value"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 11, this->default_value(), target); } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Field) return target; } int Field::ByteSize() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Field) int total_size = 0; // optional .google.protobuf.Field.Kind kind = 1; if (this->kind() != 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->kind()); } // optional .google.protobuf.Field.Cardinality cardinality = 2; if (this->cardinality() != 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->cardinality()); } // optional int32 number = 3; if (this->number() != 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->number()); } // optional string name = 4; if (this->name().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional string type_url = 6; if (this->type_url().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->type_url()); } // optional int32 oneof_index = 7; if (this->oneof_index() != 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->oneof_index()); } // optional bool packed = 8; if (this->packed() != 0) { total_size += 1 + 1; } // optional string json_name = 10; if (this->json_name().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->json_name()); } // optional string default_value = 11; if (this->default_value().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->default_value()); } // repeated .google.protobuf.Option options = 9; total_size += 1 * this->options_size(); for (int i = 0; i < this->options_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->options(i)); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void Field::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Field) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } const Field* source = ::google::protobuf::internal::DynamicCastToGenerated<const Field>( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Field) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Field) MergeFrom(*source); } } void Field::MergeFrom(const Field& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Field) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } options_.MergeFrom(from.options_); if (from.kind() != 0) { set_kind(from.kind()); } if (from.cardinality() != 0) { set_cardinality(from.cardinality()); } if (from.number() != 0) { set_number(from.number()); } if (from.name().size() > 0) { name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); } if (from.type_url().size() > 0) { type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_); } if (from.oneof_index() != 0) { set_oneof_index(from.oneof_index()); } if (from.packed() != 0) { set_packed(from.packed()); } if (from.json_name().size() > 0) { json_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name_); } if (from.default_value().size() > 0) { default_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.default_value_); } } void Field::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Field) if (&from == this) return; Clear(); MergeFrom(from); } void Field::CopyFrom(const Field& from) { // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Field) if (&from == this) return; Clear(); MergeFrom(from); } bool Field::IsInitialized() const { return true; } void Field::Swap(Field* other) { if (other == this) return; InternalSwap(other); } void Field::InternalSwap(Field* other) { std::swap(kind_, other->kind_); std::swap(cardinality_, other->cardinality_); std::swap(number_, other->number_); name_.Swap(&other->name_); type_url_.Swap(&other->type_url_); std::swap(oneof_index_, other->oneof_index_); std::swap(packed_, other->packed_); options_.UnsafeArenaSwap(&other->options_); json_name_.Swap(&other->json_name_); default_value_.Swap(&other->default_value_); _internal_metadata_.Swap(&other->_internal_metadata_); std::swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata Field::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = Field_descriptor_; metadata.reflection = Field_reflection_; return metadata; } #if PROTOBUF_INLINE_NOT_IN_HEADERS // Field // optional .google.protobuf.Field.Kind kind = 1; void Field::clear_kind() { kind_ = 0; } ::google::protobuf::Field_Kind Field::kind() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.kind) return static_cast< ::google::protobuf::Field_Kind >(kind_); } void Field::set_kind(::google::protobuf::Field_Kind value) { kind_ = value; // @@protoc_insertion_point(field_set:google.protobuf.Field.kind) } // optional .google.protobuf.Field.Cardinality cardinality = 2; void Field::clear_cardinality() { cardinality_ = 0; } ::google::protobuf::Field_Cardinality Field::cardinality() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.cardinality) return static_cast< ::google::protobuf::Field_Cardinality >(cardinality_); } void Field::set_cardinality(::google::protobuf::Field_Cardinality value) { cardinality_ = value; // @@protoc_insertion_point(field_set:google.protobuf.Field.cardinality) } // optional int32 number = 3; void Field::clear_number() { number_ = 0; } ::google::protobuf::int32 Field::number() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.number) return number_; } void Field::set_number(::google::protobuf::int32 value) { number_ = value; // @@protoc_insertion_point(field_set:google.protobuf.Field.number) } // optional string name = 4; void Field::clear_name() { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& Field::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.name) return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Field::set_name(const ::std::string& value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.Field.name) } void Field::set_name(const char* value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Field.name) } void Field::set_name(const char* value, size_t size) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.name) } ::std::string* Field::mutable_name() { // @@protoc_insertion_point(field_mutable:google.protobuf.Field.name) return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* Field::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Field.name) return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Field::set_allocated_name(::std::string* name) { if (name != NULL) { } else { } name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.name) } // optional string type_url = 6; void Field::clear_type_url() { type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& Field::type_url() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.type_url) return type_url_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Field::set_type_url(const ::std::string& value) { type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.Field.type_url) } void Field::set_type_url(const char* value) { type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Field.type_url) } void Field::set_type_url(const char* value, size_t size) { type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.type_url) } ::std::string* Field::mutable_type_url() { // @@protoc_insertion_point(field_mutable:google.protobuf.Field.type_url) return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* Field::release_type_url() { // @@protoc_insertion_point(field_release:google.protobuf.Field.type_url) return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Field::set_allocated_type_url(::std::string* type_url) { if (type_url != NULL) { } else { } type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url); // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.type_url) } // optional int32 oneof_index = 7; void Field::clear_oneof_index() { oneof_index_ = 0; } ::google::protobuf::int32 Field::oneof_index() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.oneof_index) return oneof_index_; } void Field::set_oneof_index(::google::protobuf::int32 value) { oneof_index_ = value; // @@protoc_insertion_point(field_set:google.protobuf.Field.oneof_index) } // optional bool packed = 8; void Field::clear_packed() { packed_ = false; } bool Field::packed() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.packed) return packed_; } void Field::set_packed(bool value) { packed_ = value; // @@protoc_insertion_point(field_set:google.protobuf.Field.packed) } // repeated .google.protobuf.Option options = 9; int Field::options_size() const { return options_.size(); } void Field::clear_options() { options_.Clear(); } const ::google::protobuf::Option& Field::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Field.options) return options_.Get(index); } ::google::protobuf::Option* Field::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Field.options) return options_.Mutable(index); } ::google::protobuf::Option* Field::add_options() { // @@protoc_insertion_point(field_add:google.protobuf.Field.options) return options_.Add(); } ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* Field::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Field.options) return &options_; } const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& Field::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Field.options) return options_; } // optional string json_name = 10; void Field::clear_json_name() { json_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& Field::json_name() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.json_name) return json_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Field::set_json_name(const ::std::string& value) { json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.Field.json_name) } void Field::set_json_name(const char* value) { json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Field.json_name) } void Field::set_json_name(const char* value, size_t size) { json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.json_name) } ::std::string* Field::mutable_json_name() { // @@protoc_insertion_point(field_mutable:google.protobuf.Field.json_name) return json_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* Field::release_json_name() { // @@protoc_insertion_point(field_release:google.protobuf.Field.json_name) return json_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Field::set_allocated_json_name(::std::string* json_name) { if (json_name != NULL) { } else { } json_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name); // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.json_name) } // optional string default_value = 11; void Field::clear_default_value() { default_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& Field::default_value() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.default_value) return default_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Field::set_default_value(const ::std::string& value) { default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.Field.default_value) } void Field::set_default_value(const char* value) { default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Field.default_value) } void Field::set_default_value(const char* value, size_t size) { default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.default_value) } ::std::string* Field::mutable_default_value() { // @@protoc_insertion_point(field_mutable:google.protobuf.Field.default_value) return default_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* Field::release_default_value() { // @@protoc_insertion_point(field_release:google.protobuf.Field.default_value) return default_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Field::set_allocated_default_value(::std::string* default_value) { if (default_value != NULL) { } else { } default_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value); // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.default_value) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Enum::kNameFieldNumber; const int Enum::kEnumvalueFieldNumber; const int Enum::kOptionsFieldNumber; const int Enum::kSourceContextFieldNumber; const int Enum::kSyntaxFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Enum::Enum() : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Enum) } void Enum::InitAsDefaultInstance() { _is_default_instance_ = true; source_context_ = const_cast< ::google::protobuf::SourceContext*>(&::google::protobuf::SourceContext::default_instance()); } Enum::Enum(const Enum& from) : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:google.protobuf.Enum) } void Enum::SharedCtor() { _is_default_instance_ = false; ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); source_context_ = NULL; syntax_ = 0; } Enum::~Enum() { // @@protoc_insertion_point(destructor:google.protobuf.Enum) SharedDtor(); } void Enum::SharedDtor() { name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != default_instance_) { delete source_context_; } } void Enum::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Enum::descriptor() { protobuf_AssignDescriptorsOnce(); return Enum_descriptor_; } const Enum& Enum::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); return *default_instance_; } Enum* Enum::default_instance_ = NULL; Enum* Enum::New(::google::protobuf::Arena* arena) const { Enum* n = new Enum; if (arena != NULL) { arena->Own(n); } return n; } void Enum::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.Enum) name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (GetArenaNoVirtual() == NULL && source_context_ != NULL) delete source_context_; source_context_ = NULL; syntax_ = 0; enumvalue_.Clear(); options_.Clear(); } bool Enum::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Enum) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Enum.name")); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_enumvalue; break; } // repeated .google.protobuf.EnumValue enumvalue = 2; case 2: { if (tag == 18) { parse_enumvalue: DO_(input->IncrementRecursionDepth()); parse_loop_enumvalue: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_enumvalue())); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_loop_enumvalue; if (input->ExpectTag(26)) goto parse_loop_options; input->UnsafeDecrementRecursionDepth(); break; } // repeated .google.protobuf.Option options = 3; case 3: { if (tag == 26) { DO_(input->IncrementRecursionDepth()); parse_loop_options: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_loop_options; input->UnsafeDecrementRecursionDepth(); if (input->ExpectTag(34)) goto parse_source_context; break; } // optional .google.protobuf.SourceContext source_context = 4; case 4: { if (tag == 34) { parse_source_context: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_source_context())); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_syntax; break; } // optional .google.protobuf.Syntax syntax = 5; case 5: { if (tag == 40) { parse_syntax: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); set_syntax(static_cast< ::google::protobuf::Syntax >(value)); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } success: // @@protoc_insertion_point(parse_success:google.protobuf.Enum) return true; failure: // @@protoc_insertion_point(parse_failure:google.protobuf.Enum) return false; #undef DO_ } void Enum::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.Enum) // optional string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Enum.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->name(), output); } // repeated .google.protobuf.EnumValue enumvalue = 2; for (unsigned int i = 0, n = this->enumvalue_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2, this->enumvalue(i), output); } // repeated .google.protobuf.Option options = 3; for (unsigned int i = 0, n = this->options_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 3, this->options(i), output); } // optional .google.protobuf.SourceContext source_context = 4; if (this->has_source_context()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 4, *this->source_context_, output); } // optional .google.protobuf.Syntax syntax = 5; if (this->syntax() != 0) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 5, this->syntax(), output); } // @@protoc_insertion_point(serialize_end:google.protobuf.Enum) } ::google::protobuf::uint8* Enum::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Enum) // optional string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Enum.name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->name(), target); } // repeated .google.protobuf.EnumValue enumvalue = 2; for (unsigned int i = 0, n = this->enumvalue_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( 2, this->enumvalue(i), false, target); } // repeated .google.protobuf.Option options = 3; for (unsigned int i = 0, n = this->options_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( 3, this->options(i), false, target); } // optional .google.protobuf.SourceContext source_context = 4; if (this->has_source_context()) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( 4, *this->source_context_, false, target); } // optional .google.protobuf.Syntax syntax = 5; if (this->syntax() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 5, this->syntax(), target); } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Enum) return target; } int Enum::ByteSize() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Enum) int total_size = 0; // optional string name = 1; if (this->name().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional .google.protobuf.SourceContext source_context = 4; if (this->has_source_context()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( *this->source_context_); } // optional .google.protobuf.Syntax syntax = 5; if (this->syntax() != 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->syntax()); } // repeated .google.protobuf.EnumValue enumvalue = 2; total_size += 1 * this->enumvalue_size(); for (int i = 0; i < this->enumvalue_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->enumvalue(i)); } // repeated .google.protobuf.Option options = 3; total_size += 1 * this->options_size(); for (int i = 0; i < this->options_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->options(i)); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void Enum::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Enum) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } const Enum* source = ::google::protobuf::internal::DynamicCastToGenerated<const Enum>( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Enum) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Enum) MergeFrom(*source); } } void Enum::MergeFrom(const Enum& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Enum) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } enumvalue_.MergeFrom(from.enumvalue_); options_.MergeFrom(from.options_); if (from.name().size() > 0) { name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); } if (from.has_source_context()) { mutable_source_context()->::google::protobuf::SourceContext::MergeFrom(from.source_context()); } if (from.syntax() != 0) { set_syntax(from.syntax()); } } void Enum::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Enum) if (&from == this) return; Clear(); MergeFrom(from); } void Enum::CopyFrom(const Enum& from) { // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Enum) if (&from == this) return; Clear(); MergeFrom(from); } bool Enum::IsInitialized() const { return true; } void Enum::Swap(Enum* other) { if (other == this) return; InternalSwap(other); } void Enum::InternalSwap(Enum* other) { name_.Swap(&other->name_); enumvalue_.UnsafeArenaSwap(&other->enumvalue_); options_.UnsafeArenaSwap(&other->options_); std::swap(source_context_, other->source_context_); std::swap(syntax_, other->syntax_); _internal_metadata_.Swap(&other->_internal_metadata_); std::swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata Enum::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = Enum_descriptor_; metadata.reflection = Enum_reflection_; return metadata; } #if PROTOBUF_INLINE_NOT_IN_HEADERS // Enum // optional string name = 1; void Enum::clear_name() { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& Enum::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Enum.name) return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Enum::set_name(const ::std::string& value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.Enum.name) } void Enum::set_name(const char* value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Enum.name) } void Enum::set_name(const char* value, size_t size) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Enum.name) } ::std::string* Enum::mutable_name() { // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.name) return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* Enum::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Enum.name) return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Enum::set_allocated_name(::std::string* name) { if (name != NULL) { } else { } name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.name) } // repeated .google.protobuf.EnumValue enumvalue = 2; int Enum::enumvalue_size() const { return enumvalue_.size(); } void Enum::clear_enumvalue() { enumvalue_.Clear(); } const ::google::protobuf::EnumValue& Enum::enumvalue(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Enum.enumvalue) return enumvalue_.Get(index); } ::google::protobuf::EnumValue* Enum::mutable_enumvalue(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.enumvalue) return enumvalue_.Mutable(index); } ::google::protobuf::EnumValue* Enum::add_enumvalue() { // @@protoc_insertion_point(field_add:google.protobuf.Enum.enumvalue) return enumvalue_.Add(); } ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >* Enum::mutable_enumvalue() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.enumvalue) return &enumvalue_; } const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >& Enum::enumvalue() const { // @@protoc_insertion_point(field_list:google.protobuf.Enum.enumvalue) return enumvalue_; } // repeated .google.protobuf.Option options = 3; int Enum::options_size() const { return options_.size(); } void Enum::clear_options() { options_.Clear(); } const ::google::protobuf::Option& Enum::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Enum.options) return options_.Get(index); } ::google::protobuf::Option* Enum::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.options) return options_.Mutable(index); } ::google::protobuf::Option* Enum::add_options() { // @@protoc_insertion_point(field_add:google.protobuf.Enum.options) return options_.Add(); } ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* Enum::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.options) return &options_; } const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& Enum::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Enum.options) return options_; } // optional .google.protobuf.SourceContext source_context = 4; bool Enum::has_source_context() const { return !_is_default_instance_ && source_context_ != NULL; } void Enum::clear_source_context() { if (GetArenaNoVirtual() == NULL && source_context_ != NULL) delete source_context_; source_context_ = NULL; } const ::google::protobuf::SourceContext& Enum::source_context() const { // @@protoc_insertion_point(field_get:google.protobuf.Enum.source_context) return source_context_ != NULL ? *source_context_ : *default_instance_->source_context_; } ::google::protobuf::SourceContext* Enum::mutable_source_context() { if (source_context_ == NULL) { source_context_ = new ::google::protobuf::SourceContext; } // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.source_context) return source_context_; } ::google::protobuf::SourceContext* Enum::release_source_context() { // @@protoc_insertion_point(field_release:google.protobuf.Enum.source_context) ::google::protobuf::SourceContext* temp = source_context_; source_context_ = NULL; return temp; } void Enum::set_allocated_source_context(::google::protobuf::SourceContext* source_context) { delete source_context_; source_context_ = source_context; if (source_context) { } else { } // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.source_context) } // optional .google.protobuf.Syntax syntax = 5; void Enum::clear_syntax() { syntax_ = 0; } ::google::protobuf::Syntax Enum::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.Enum.syntax) return static_cast< ::google::protobuf::Syntax >(syntax_); } void Enum::set_syntax(::google::protobuf::Syntax value) { syntax_ = value; // @@protoc_insertion_point(field_set:google.protobuf.Enum.syntax) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int EnumValue::kNameFieldNumber; const int EnumValue::kNumberFieldNumber; const int EnumValue::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 EnumValue::EnumValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValue) } void EnumValue::InitAsDefaultInstance() { _is_default_instance_ = true; } EnumValue::EnumValue(const EnumValue& from) : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumValue) } void EnumValue::SharedCtor() { _is_default_instance_ = false; ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); number_ = 0; } EnumValue::~EnumValue() { // @@protoc_insertion_point(destructor:google.protobuf.EnumValue) SharedDtor(); } void EnumValue::SharedDtor() { name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != default_instance_) { } } void EnumValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumValue::descriptor() { protobuf_AssignDescriptorsOnce(); return EnumValue_descriptor_; } const EnumValue& EnumValue::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); return *default_instance_; } EnumValue* EnumValue::default_instance_ = NULL; EnumValue* EnumValue::New(::google::protobuf::Arena* arena) const { EnumValue* n = new EnumValue; if (arena != NULL) { arena->Own(n); } return n; } void EnumValue::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.EnumValue) name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); number_ = 0; options_.Clear(); } bool EnumValue::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.EnumValue) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.EnumValue.name")); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_number; break; } // optional int32 number = 2; case 2: { if (tag == 16) { parse_number: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &number_))); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_options; break; } // repeated .google.protobuf.Option options = 3; case 3: { if (tag == 26) { parse_options: DO_(input->IncrementRecursionDepth()); parse_loop_options: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_loop_options; input->UnsafeDecrementRecursionDepth(); if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } success: // @@protoc_insertion_point(parse_success:google.protobuf.EnumValue) return true; failure: // @@protoc_insertion_point(parse_failure:google.protobuf.EnumValue) return false; #undef DO_ } void EnumValue::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.EnumValue) // optional string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.EnumValue.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->name(), output); } // optional int32 number = 2; if (this->number() != 0) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->number(), output); } // repeated .google.protobuf.Option options = 3; for (unsigned int i = 0, n = this->options_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 3, this->options(i), output); } // @@protoc_insertion_point(serialize_end:google.protobuf.EnumValue) } ::google::protobuf::uint8* EnumValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValue) // optional string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.EnumValue.name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->name(), target); } // optional int32 number = 2; if (this->number() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->number(), target); } // repeated .google.protobuf.Option options = 3; for (unsigned int i = 0, n = this->options_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( 3, this->options(i), false, target); } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumValue) return target; } int EnumValue::ByteSize() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumValue) int total_size = 0; // optional string name = 1; if (this->name().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional int32 number = 2; if (this->number() != 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->number()); } // repeated .google.protobuf.Option options = 3; total_size += 1 * this->options_size(); for (int i = 0; i < this->options_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->options(i)); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void EnumValue::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumValue) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } const EnumValue* source = ::google::protobuf::internal::DynamicCastToGenerated<const EnumValue>( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumValue) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumValue) MergeFrom(*source); } } void EnumValue::MergeFrom(const EnumValue& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumValue) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } options_.MergeFrom(from.options_); if (from.name().size() > 0) { name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); } if (from.number() != 0) { set_number(from.number()); } } void EnumValue::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumValue) if (&from == this) return; Clear(); MergeFrom(from); } void EnumValue::CopyFrom(const EnumValue& from) { // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.EnumValue) if (&from == this) return; Clear(); MergeFrom(from); } bool EnumValue::IsInitialized() const { return true; } void EnumValue::Swap(EnumValue* other) { if (other == this) return; InternalSwap(other); } void EnumValue::InternalSwap(EnumValue* other) { name_.Swap(&other->name_); std::swap(number_, other->number_); options_.UnsafeArenaSwap(&other->options_); _internal_metadata_.Swap(&other->_internal_metadata_); std::swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata EnumValue::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = EnumValue_descriptor_; metadata.reflection = EnumValue_reflection_; return metadata; } #if PROTOBUF_INLINE_NOT_IN_HEADERS // EnumValue // optional string name = 1; void EnumValue::clear_name() { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& EnumValue::name() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.name) return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void EnumValue::set_name(const ::std::string& value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.EnumValue.name) } void EnumValue::set_name(const char* value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.EnumValue.name) } void EnumValue::set_name(const char* value, size_t size) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumValue.name) } ::std::string* EnumValue::mutable_name() { // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.name) return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* EnumValue::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.EnumValue.name) return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void EnumValue::set_allocated_name(::std::string* name) { if (name != NULL) { } else { } name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValue.name) } // optional int32 number = 2; void EnumValue::clear_number() { number_ = 0; } ::google::protobuf::int32 EnumValue::number() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.number) return number_; } void EnumValue::set_number(::google::protobuf::int32 value) { number_ = value; // @@protoc_insertion_point(field_set:google.protobuf.EnumValue.number) } // repeated .google.protobuf.Option options = 3; int EnumValue::options_size() const { return options_.size(); } void EnumValue::clear_options() { options_.Clear(); } const ::google::protobuf::Option& EnumValue::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.options) return options_.Get(index); } ::google::protobuf::Option* EnumValue::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.options) return options_.Mutable(index); } ::google::protobuf::Option* EnumValue::add_options() { // @@protoc_insertion_point(field_add:google.protobuf.EnumValue.options) return options_.Add(); } ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* EnumValue::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValue.options) return &options_; } const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& EnumValue::options() const { // @@protoc_insertion_point(field_list:google.protobuf.EnumValue.options) return options_; } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Option::kNameFieldNumber; const int Option::kValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Option::Option() : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Option) } void Option::InitAsDefaultInstance() { _is_default_instance_ = true; value_ = const_cast< ::google::protobuf::Any*>(&::google::protobuf::Any::default_instance()); } Option::Option(const Option& from) : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:google.protobuf.Option) } void Option::SharedCtor() { _is_default_instance_ = false; ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); value_ = NULL; } Option::~Option() { // @@protoc_insertion_point(destructor:google.protobuf.Option) SharedDtor(); } void Option::SharedDtor() { name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != default_instance_) { delete value_; } } void Option::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Option::descriptor() { protobuf_AssignDescriptorsOnce(); return Option_descriptor_; } const Option& Option::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ftype_2eproto(); return *default_instance_; } Option* Option::default_instance_ = NULL; Option* Option::New(::google::protobuf::Arena* arena) const { Option* n = new Option; if (arena != NULL) { arena->Own(n); } return n; } void Option::Clear() { // @@protoc_insertion_point(message_clear_start:google.protobuf.Option) name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (GetArenaNoVirtual() == NULL && value_ != NULL) delete value_; value_ = NULL; } bool Option::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Option) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "google.protobuf.Option.name")); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_value; break; } // optional .google.protobuf.Any value = 2; case 2: { if (tag == 18) { parse_value: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_value())); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } success: // @@protoc_insertion_point(parse_success:google.protobuf.Option) return true; failure: // @@protoc_insertion_point(parse_failure:google.protobuf.Option) return false; #undef DO_ } void Option::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.Option) // optional string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Option.name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->name(), output); } // optional .google.protobuf.Any value = 2; if (this->has_value()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2, *this->value_, output); } // @@protoc_insertion_point(serialize_end:google.protobuf.Option) } ::google::protobuf::uint8* Option::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Option) // optional string name = 1; if (this->name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "google.protobuf.Option.name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->name(), target); } // optional .google.protobuf.Any value = 2; if (this->has_value()) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( 2, *this->value_, false, target); } // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Option) return target; } int Option::ByteSize() const { // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Option) int total_size = 0; // optional string name = 1; if (this->name().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional .google.protobuf.Any value = 2; if (this->has_value()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( *this->value_); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void Option::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Option) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } const Option* source = ::google::protobuf::internal::DynamicCastToGenerated<const Option>( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Option) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Option) MergeFrom(*source); } } void Option::MergeFrom(const Option& from) { // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Option) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } if (from.name().size() > 0) { name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); } if (from.has_value()) { mutable_value()->::google::protobuf::Any::MergeFrom(from.value()); } } void Option::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Option) if (&from == this) return; Clear(); MergeFrom(from); } void Option::CopyFrom(const Option& from) { // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Option) if (&from == this) return; Clear(); MergeFrom(from); } bool Option::IsInitialized() const { return true; } void Option::Swap(Option* other) { if (other == this) return; InternalSwap(other); } void Option::InternalSwap(Option* other) { name_.Swap(&other->name_); std::swap(value_, other->value_); _internal_metadata_.Swap(&other->_internal_metadata_); std::swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata Option::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = Option_descriptor_; metadata.reflection = Option_reflection_; return metadata; } #if PROTOBUF_INLINE_NOT_IN_HEADERS // Option // optional string name = 1; void Option::clear_name() { name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& Option::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Option.name) return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Option::set_name(const ::std::string& value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:google.protobuf.Option.name) } void Option::set_name(const char* value) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Option.name) } void Option::set_name(const char* value, size_t size) { name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Option.name) } ::std::string* Option::mutable_name() { // @@protoc_insertion_point(field_mutable:google.protobuf.Option.name) return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* Option::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Option.name) return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void Option::set_allocated_name(::std::string* name) { if (name != NULL) { } else { } name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.name) } // optional .google.protobuf.Any value = 2; bool Option::has_value() const { return !_is_default_instance_ && value_ != NULL; } void Option::clear_value() { if (GetArenaNoVirtual() == NULL && value_ != NULL) delete value_; value_ = NULL; } const ::google::protobuf::Any& Option::value() const { // @@protoc_insertion_point(field_get:google.protobuf.Option.value) return value_ != NULL ? *value_ : *default_instance_->value_; } ::google::protobuf::Any* Option::mutable_value() { if (value_ == NULL) { value_ = new ::google::protobuf::Any; } // @@protoc_insertion_point(field_mutable:google.protobuf.Option.value) return value_; } ::google::protobuf::Any* Option::release_value() { // @@protoc_insertion_point(field_release:google.protobuf.Option.value) ::google::protobuf::Any* temp = value_; value_ = NULL; return temp; } void Option::set_allocated_value(::google::protobuf::Any* value) { delete value_; value_ = value; if (value) { } else { } // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.value) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) } // namespace protobuf } // namespace google // @@protoc_insertion_point(global_scope)
[ "“chenjiayi@tuandai.com”" ]
“chenjiayi@tuandai.com”
2b350632e1e3206965aa5d29bea78027382653a9
84f333eecb2fdefc79a8998a03426c5cb1138876
/headers/CS1InstructionsSet.h
5dc4bccec0301a0c4a6532a858daa23afaa9d236
[ "MIT" ]
permissive
illidan2004/SenScriptsDecompiler
62972ee512476724b5cde82db761c1a31a9aa574
f2a7fd091ebfcd74436f595180baea146206f719
refs/heads/main
2023-03-06T14:46:50.103291
2021-02-21T10:49:48
2021-02-21T10:49:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
310,478
h
#ifndef CS1INSTRUCTIONSSET_H #define CS1INSTRUCTIONSSET_H #include "headers/utilities.h" #include "headers/functions.h" #include "headers/translationfile.h" #include <QString> class CS1TranslationFile : public TranslationFile { public: CS1TranslationFile():TranslationFile(){} }; class CS1Builder : public Builder { public: CS1Builder(){ } QVector<QString> CS1UIFiles = {"battle_menu","camp_menu", "camp_menu_v","note_menu","note_menu_v","shop_menu","shop_menu_v","title_menu","title_menu_v"}; static void fun_140498b70(int &addr, QByteArray &content, Instruction * instr){ //related to text/text formating QByteArray current_op_value; int addr_ = addr; bool start = false; bool start_text = false; int cnt = 0; do{ unsigned char current_byte = content[addr]; if (current_byte<0x20){ if (current_byte == 0){ current_op_value.clear(); current_op_value[0] = 0; instr->AddOperande(operande(addr,"byte", current_op_value)); addr++; return; } else if (current_byte == 0x10){ start_text = false; if (current_op_value.size()>0) { instr->AddOperande(operande(addr_,"dialog", current_op_value)); } current_op_value.clear(); current_op_value.push_back(current_byte); instr->AddOperande(operande(addr,"byte", current_op_value)); current_op_value.clear(); addr++; instr->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } else if ((current_byte > 0x10)&&(current_byte < 0x13)){ start_text = false; if (current_op_value.size()>0) { instr->AddOperande(operande(addr_,"dialog", current_op_value)); } current_op_value.clear(); current_op_value.push_back(current_byte); instr->AddOperande(operande(addr,"byte", current_op_value)); current_op_value.clear(); addr++; instr->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } else if (current_byte == 0x2){ start_text = false; if (current_op_value.size()>0) { instr->AddOperande(operande(addr_,"dialog", current_op_value)); } current_op_value.clear(); current_op_value.push_back(current_byte); instr->AddOperande(operande(addr,"byte", current_op_value)); current_op_value.clear(); addr++; } else if ((start_text)&&current_byte == 0x1){ current_op_value.push_back(current_byte); addr++; } else{ if (current_op_value.size()>0) { instr->AddOperande(operande(addr_,"dialog", current_op_value)); } current_op_value.clear(); current_op_value.push_back(current_byte); instr->AddOperande(operande(addr,"byte", current_op_value)); addr++; current_op_value.clear(); } } else{ if (current_byte == 0x23){ current_op_value.push_back(0x23); addr_ = addr;//beginning of some format stuff addr++; current_byte = content[addr]; while (current_byte!=0){ if ((((current_byte == 0x45) || (current_byte == 0x65)) || (current_byte == 0x4d)) || (current_byte == 0x42)||(current_byte == 0x48)||(current_byte == 0x56)||(current_byte == 0x4b) || (current_byte == 0x6b) || (current_byte == 0x46)) { current_op_value.push_back(current_byte); addr++; current_byte = content[addr]; if (current_byte != 0x5f) { if (current_byte == 0x5b) { do{ current_op_value.push_back(current_byte); addr++; current_byte = content[addr]; } while(current_byte!=0x5D); current_op_value.push_back(current_byte); addr++; current_byte = content[addr]; } break; } else{ current_op_value.push_back(current_byte); addr++; current_byte = content[addr]; current_op_value.push_back(current_byte); addr++; current_byte = content[addr]; break; } } else if(((current_byte + 0xb7 & 0xdf) == 0)||(current_byte == 0x50)||(current_byte == 0x54)||(current_byte == 0x57)|| (current_byte == 0x53)||(current_byte == 0x73)||(current_byte == 0x43)||(current_byte == 99)||(current_byte == 0x78)|| (current_byte == 0x79)||(current_byte == 0x47)||(current_byte == 0x44)||(current_byte == 0x55)||(current_byte == 0x52)||(current_byte == 0x50)) { current_op_value.push_back(current_byte); addr++; current_byte = content[addr]; break; } else{ if (current_byte<0x20){ if (current_byte == 0){ current_op_value.clear(); current_op_value[0] = 0; instr->AddOperande(operande(addr,"byte", current_op_value)); addr++; return; } else if (current_byte == 0x10){ current_op_value.clear(); current_op_value.push_back(current_byte); instr->AddOperande(operande(addr,"byte", current_op_value)); current_op_value.clear(); addr++; current_byte = content[addr]; instr->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } else if ((current_byte > 0x10)&&(current_byte < 0x13)){ start_text = false; if (current_op_value.size()>0) { instr->AddOperande(operande(addr_,"dialog", current_op_value)); } current_op_value.clear(); current_op_value.push_back(current_byte); instr->AddOperande(operande(addr,"byte", current_op_value)); current_op_value.clear(); addr++; current_byte = content[addr]; instr->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } else if (current_byte == 0x2){ start_text = false; if (current_op_value.size()>0) instr->AddOperande(operande(addr_,"dialog", current_op_value)); current_op_value.clear(); current_op_value.push_back(current_byte); instr->AddOperande(operande(addr,"byte", current_op_value)); current_op_value.clear(); addr++; current_byte = content[addr]; } else if ((start_text)&&current_byte == 0x1){ current_op_value.push_back(current_byte); addr++; current_byte = content[addr]; } else{ if ((start_text)) instr->AddOperande(operande(addr_,"dialog", current_op_value)); current_op_value.clear(); current_op_value.push_back(current_byte); instr->AddOperande(operande(addr,"byte", current_op_value)); addr++; current_byte = content[addr]; current_op_value.clear(); } } else { current_op_value.push_back(current_byte); addr++; current_byte = content[addr]; } } } } else{ //here, should be actual text (I think) if (!start_text) { //instr->AddOperande(operande(addr_,"string", current_op_value)); //current_op_value.clear(); start_text = true; addr_ = addr; } current_op_value.push_back(current_byte); addr++; } } cnt++; } while(cnt<9999); } static void fun_1403c90e0(int &addr, QByteArray &content, Instruction * instr, int param){ QByteArray control_byte3_arr = ReadSubByteArray(content, addr, 1); instr->AddOperande(operande(addr,"byte", control_byte3_arr)); unsigned char control_byte3 = (unsigned char)control_byte3_arr[0]; if (control_byte3 == '\x11'){ instr->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); instr->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); } else if (control_byte3 != '3'){ if (control_byte3 == '\"'){ instr->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); instr->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } else if (control_byte3 != 0x44){ if (control_byte3 == 0xDD){ //there is a XOR,XOR EDI which causes a jump that ignores the strcpy if (param!=0)instr->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); instr->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } else if (control_byte3 == 0xFF){ instr->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); instr->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); } else{ if (control_byte3 != 0xEE){ } else{ instr->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); instr->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); } } } else{ instr->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); instr->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); if (param!=0)instr->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } } else{ instr->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); instr->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); } } static void sub05(int &addr, QByteArray &content, Instruction * instr){ QByteArray control_byte = ReadSubByteArray(content, addr, 1); instr->AddOperande(operande(addr,"byte", control_byte)); while ((int)control_byte[0]!=1){ switch ((unsigned char)control_byte[0]) { case 0x0: case 0x24: instr->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr, 4))); break; case 0x1c:{ //the next byte is the OP code for a new instruction std::shared_ptr<Instruction> instr2 = instr->Maker->CreateInstructionFromDAT(addr, content,0); operande op = operande(addr,"instruction", instr2->getBytes()); instr->AddOperande(op); break; } case 0x1e: instr->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; case 0x1f: case 0x20: case 0x23: instr->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); break; case 0x21: instr->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); instr->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); break; case 0x25: instr->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; default: ; } control_byte = ReadSubByteArray(content, addr, 1); instr->AddOperande(operande(addr,"byte", control_byte)); } } class CreateMonsters : public Instruction { public: CreateMonsters():Instruction(-1,256,nullptr){} CreateMonsters(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"CreateMonsters", 256,Maker){} CreateMonsters(int addr, Builder *Maker):Instruction(addr,"CreateMonsters", 256, Maker){} CreateMonsters(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"CreateMonsters", 256,Maker){ int initial_addr = addr; if (Maker->goal<addr+0x20){ addr = initial_addr; Maker->flag_monsters = false; return; } int first = ReadIntegerFromByteArray(addr,content); if ((first == -1)&&(addr + 0x20 == Maker->goal)){ this->AddOperande(operande(addr,"bytearray", ReadSubByteArray(content, addr, 0x1C))); //?? we don't forget to take the int as well Maker->flag_monsters = true; return; } this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr, 4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr, 4))); int check1 = ReadIntegerFromByteArray(addr,content); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr, 4))); int check2 = ReadIntegerFromByteArray(addr,content); if (check1 && check2 != 0){ //bad addr = initial_addr; Maker->flag_monsters = false; return; } this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr, 4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr, 2))); //0x10 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr, 2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr, 2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr, 2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr, 2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr, 2))); //0x1A this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr, 4))); //0x1C //0x20 int cnt = 0; do{ if (Maker->goal<initial_addr+0x20 + cnt * (0x90)){ addr = initial_addr; Maker->flag_monsters = false; return; } QByteArray array = ReadSubByteArray(content, addr, 4); this->AddOperande(operande(addr,"int", array)); int counter = 0; do{ counter++; QByteArray monsters_name = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", monsters_name)); QByteArray remaining = ReadSubByteArray(content, addr, 0x10-monsters_name.size()-1); operande fill = operande(addr,"fill", remaining); fill.setBytesToFill(0x10); this->AddOperande(fill); } while(counter < 0x8); for (int idx_byte = 0; idx_byte < 8; idx_byte++) this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); if ((unsigned char) content[addr] == 0)this->AddOperande(operande(addr,"bytearray", ReadSubByteArray(content, addr, 8))); //?? else { QByteArray monsters_name = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", monsters_name)); QByteArray remaining = ReadSubByteArray(content, addr, 12-monsters_name.size()-1); operande fill = operande(addr,"bytearray", remaining); fill.setBytesToFill(12); this->AddOperande(fill); } first = ReadIntegerFromByteArray(addr,content); cnt++; } while((first != -1)&&(addr != Maker->goal - 4)); if (addr == Maker->goal - 4) { first = ReadIntegerFromByteArray(addr,content); if (first != 1){ addr = initial_addr; Maker->flag_monsters = false; return; } else{ Maker->flag_monsters = true; return; } } this->AddOperande(operande(addr,"bytearray", ReadSubByteArray(content, addr, 0x1C))); //?? we don't forget to take the int as well Maker->flag_monsters = true; } }; class EffectsInstr : public Instruction { public: EffectsInstr():Instruction(-1,257,nullptr){} EffectsInstr(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"EffectsInstr", 257,Maker){} EffectsInstr(int addr, Builder *Maker):Instruction(addr,"EffectsInstr", 257, Maker){} EffectsInstr(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"EffectsInstr", 257,Maker){ unsigned char current_byte = content[addr]; while (current_byte!=0x01){ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr, 4))); QByteArray str = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", str)); QByteArray remaining = ReadSubByteArray(content, addr, 0x20-str.size()-1); operande fill = operande(addr,"fill", remaining); fill.setBytesToFill(0x20); this->AddOperande(fill); current_byte = content[addr]; } } }; class ActionTable : public Instruction { public: ActionTable():Instruction(-1,258,nullptr){} ActionTable(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"ActionTable", 258,Maker){} ActionTable(int addr, Builder *Maker):Instruction(addr,"ActionTable", 258, Maker){} ActionTable(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"ActionTable", 258,Maker){ short shrt = 0; unsigned char current_byte = content[addr]; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); int cnt = 0; while(cnt < current_byte){ shrt = ReadShortFromByteArray(addr, content); QByteArray short_bytes = ReadSubByteArray(content, addr,2); this->AddOperande(operande(addr,"short", short_bytes));//2 this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//3 this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//4 this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//5 this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//6 this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//7 this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//8 this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//9 this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//A this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//B this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//C this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//D this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//F this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//11 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//13 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//15 //here ok this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//17 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//19 QByteArray str = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", str)); QByteArray remaining = ReadSubByteArray(content, addr, 0x10-str.size()-1); operande fill = operande(addr,"fill", remaining); fill.setBytesToFill(0x10); this->AddOperande(fill); QByteArray str_ = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", str_)); QByteArray remaining_ = ReadSubByteArray(content, addr, 0x20-str_.size()-1); operande fill_ = operande(addr,"fill", remaining_); fill_.setBytesToFill(0x20); this->AddOperande(fill_); QByteArray str__ = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", str__)); QByteArray remaining__ = ReadSubByteArray(content, addr, 0x30-str__.size()-1); operande fill__ = operande(addr,"fill", remaining__); fill__.setBytesToFill(0x30); this->AddOperande(fill__); cnt++; } } }; class AddCollision : public Instruction { public: AddCollision():Instruction(-1,271,nullptr){} AddCollision(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"AddCollision", 271,Maker){} AddCollision(int addr, Builder *Maker):Instruction(addr,"AddCollision", 271, Maker){} AddCollision(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"AddCollision", 271,Maker){ qDebug() << hex << "start" << addr; unsigned char current_byte = content[addr]; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); int cnt = 0; while(cnt < current_byte){ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); cnt++; } } }; class AlgoTable : public Instruction { public: AlgoTable():Instruction(-1,259,nullptr){} AlgoTable(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"AlgoTable", 259,Maker){} AlgoTable(int addr, Builder *Maker):Instruction(addr,"AlgoTable", 259, Maker){} AlgoTable(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"AlgoTable", 259,Maker){ int cnt = 0; unsigned char current_byte = content[addr]; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1)));//3 while(cnt < current_byte){ QByteArray short_bytes = ReadSubByteArray(content, addr,2); this->AddOperande(operande(addr,"short", short_bytes)); this->AddOperande(operande(addr,"bytearray", ReadSubByteArray(content, addr,0x1E))); short shrt = ReadShortFromByteArray(0, short_bytes); if (shrt == -1) this->AddOperande(operande(addr,"bytearray", ReadSubByteArray(content, addr,0x8))); cnt++; } //this->AddOperande(operande(addr,"bytearray", ReadSubByteArray(content, addr,0x1E))); qDebug() << hex << "end" << addr; } }; class WeaponAttTable : public Instruction { public: WeaponAttTable():Instruction(-1,260,nullptr){} WeaponAttTable(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"WeaponAttTable", 260,Maker){} WeaponAttTable(int addr, Builder *Maker):Instruction(addr,"WeaponAttTable", 260, Maker){} WeaponAttTable(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"WeaponAttTable", 260,Maker){ int cnt = 0; this->AddOperande(operande(addr,"bytearray", ReadSubByteArray(content, addr,4))); } }; class BreakTable : public Instruction { public: BreakTable():Instruction(-1,261,nullptr){} BreakTable(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"BreakTable", 261,Maker){} BreakTable(int addr, Builder *Maker):Instruction(addr,"BreakTable", 261, Maker){} BreakTable(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"BreakTable", 261,Maker){ int cnt = 0; do{ QByteArray short_bytes = ReadSubByteArray(content, addr,2); short shrt = ReadShortFromByteArray(0, short_bytes); this->AddOperande(operande(addr,"short", short_bytes)); if (shrt == 0) break; QByteArray short_bytes2 = ReadSubByteArray(content, addr,2); this->AddOperande(operande(addr,"short", short_bytes2)); //not sure if two single bytes //or one short, guessing its one short cnt++; } while(cnt < 0x40); this->AddOperande(operande(addr,"bytearray", ReadSubByteArray(content, addr,0x2))); } }; class SummonTable : public Instruction //140142002 { public: SummonTable():Instruction(-1,262,nullptr){} SummonTable(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"SummonTable", 262,Maker){} SummonTable(int addr, Builder *Maker):Instruction(addr,"SummonTable", 262, Maker){} SummonTable(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"SummonTable", 262,Maker){ unsigned char current_byte = content[addr]; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); int cnt = 0; while(cnt < current_byte){ QByteArray short_bytes = ReadSubByteArray(content, addr,2); ushort shrt = ReadShortFromByteArray(0, short_bytes); this->AddOperande(operande(addr,"short", short_bytes)); if (shrt == 0xFFFF) break; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); QByteArray str = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", str)); QByteArray remaining = ReadSubByteArray(content, addr, 0x20-str.size()-1); operande fill = operande(addr,"fill", remaining); fill.setBytesToFill(0x20); this->AddOperande(fill); cnt++; } qDebug() << hex << "end addr " << addr; } }; class ReactionTable : public Instruction //140142002 { public: ReactionTable():Instruction(-1,263,nullptr){} ReactionTable(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"ReactionTable", 263,Maker){} ReactionTable(int addr, Builder *Maker):Instruction(addr,"ReactionTable", 263, Maker){} ReactionTable(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"ReactionTable", 263,Maker){ int cnt = 0; ushort current_shrt = ReadShortFromByteArray(addr,content); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); while(cnt < current_shrt){ QByteArray short_bytes = ReadSubByteArray(content, addr,2); ushort shrt = ReadShortFromByteArray(0, short_bytes); this->AddOperande(operande(addr,"short", short_bytes)); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); cnt++; } } }; class PartTable : public Instruction //14019797c { public: PartTable():Instruction(-1,264,nullptr){} PartTable(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"PartTable", 264,Maker){} PartTable(int addr, Builder *Maker):Instruction(addr,"PartTable", 264, Maker){} PartTable(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"PartTable", 264,Maker){ unsigned char current_byte = content[addr]; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); int cnt = 0; while(cnt < current_byte){ QByteArray int_bytes = ReadSubByteArray(content, addr,4); uint integer = ReadIntegerFromByteArray(0, int_bytes); this->AddOperande(operande(addr,"int", int_bytes)); QByteArray str = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", str)); QByteArray remaining = ReadSubByteArray(content, addr, 0x20-str.size()-1); operande fill = operande(addr,"fill", remaining); fill.setBytesToFill(0x20); this->AddOperande(fill); str = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", str)); remaining = ReadSubByteArray(content, addr, 0x20-str.size()-1); fill = operande(addr,"fill", remaining); fill.setBytesToFill(0x20); this->AddOperande(fill); cnt++; } } }; class AnimeClipTable : public Instruction //140253d20 { public: AnimeClipTable():Instruction(-1,265,nullptr){} AnimeClipTable(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"AnimeClipTable", 265,Maker){} AnimeClipTable(int addr, Builder *Maker):Instruction(addr,"AnimeClipTable", 265, Maker){} AnimeClipTable(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"AnimeClipTable", 265,Maker){ int cnt = 0; int first_integer; first_integer = ReadIntegerFromByteArray(addr, content); while(first_integer != 0){ QByteArray first_integer_bytes = ReadSubByteArray(content, addr,4); this->AddOperande(operande(addr,"int", first_integer_bytes));//14025b3c2 QByteArray str = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", str)); QByteArray remaining = ReadSubByteArray(content, addr, (0x20)-str.size()-1); operande fill = operande(addr,"fill", remaining); fill.setBytesToFill((0x20)); this->AddOperande(fill); str = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", str)); remaining = ReadSubByteArray(content, addr, (0x20)-str.size()-1); fill = operande(addr,"fill", remaining); fill.setBytesToFill((0x20)); this->AddOperande(fill); first_integer = ReadIntegerFromByteArray(addr, content); } QByteArray first_integer_bytes = ReadSubByteArray(content, addr,4); this->AddOperande(operande(addr,"int", first_integer_bytes)); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); //I think this is some sort of a table with ID at the beginning and then two names } }; class FieldMonsterData : public Instruction // 00000001402613C2 probably trigger only for monsters on the field { public: FieldMonsterData():Instruction(-1,266,nullptr){} FieldMonsterData(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"FieldMonsterData", 266,Maker){} FieldMonsterData(int addr, Builder *Maker):Instruction(addr,"FieldMonsterData", 266, Maker){} FieldMonsterData(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"FieldMonsterData", 266,Maker){ int cnt = 0; int first_integer; first_integer = ReadIntegerFromByteArray(addr, content); QByteArray first_integer_bytes = ReadSubByteArray(content, addr,4); this->AddOperande(operande(addr,"int", first_integer_bytes)); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } }; class FieldFollowData : public Instruction // { public: FieldFollowData():Instruction(-1,267,nullptr){} FieldFollowData(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"FieldMonsterData", 267,Maker){} FieldFollowData(int addr, Builder *Maker):Instruction(addr,"FieldMonsterData", 267, Maker){} FieldFollowData(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"FieldMonsterData", 267,Maker){ int cnt = 0; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } }; class FC_autoX : public Instruction // { public: FC_autoX():Instruction(-1,268,nullptr){} FC_autoX(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"FC_autoX", 268,Maker){} FC_autoX(int addr, Builder *Maker):Instruction(addr,"FC_autoX", 268, Maker){} FC_autoX(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"FC_autoX", 268,Maker){ QByteArray things = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", things)); } }; class BookData99 : public Instruction // { public: BookData99():Instruction(-1,269,nullptr){} BookData99(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"BookData99", 269,Maker){} BookData99(int addr, Builder *Maker):Instruction(addr,"BookData99", 269, Maker){} BookData99(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"BookData99", 269,Maker){ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; class BookDataX: public Instruction //0000000140464549 { public: BookDataX():Instruction(-1,270,nullptr){} BookDataX(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"BookDataX", 270,Maker){} BookDataX(int addr, Builder *Maker):Instruction(addr,"BookDataX", 270, Maker){} BookDataX(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"BookDataX", 270,Maker){ QByteArray control_short = ReadSubByteArray(content, addr, 2); short control = ReadShortFromByteArray(0, control_short); this->AddOperande(operande(addr,"short", control_short));//3 if (control>0){ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); QByteArray title = ReadStringSubByteArray(content, addr); this->AddOperande(operande(addr,"string", title)); QByteArray remaining = ReadSubByteArray(content, addr, 0x10-title.size()-1); operande fill = operande(addr,"bytearray", remaining); fill.setBytesToFill(0x10); this->AddOperande(fill); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x12 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x14 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x16 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x18 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x1A this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x1C this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x1E this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x20 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x22 this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2)));//RCX+0x24 this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } else { this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } } }; class OPCode0 : public Instruction { public: OPCode0():Instruction(-1,0,nullptr){} OPCode0(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"Instruction 0", 0,Maker){} OPCode0(int addr, Builder *Maker):Instruction(addr,"Instruction 0", 0, Maker){} OPCode0(int &addr, QByteArray &content,Builder *Maker):Instruction(addr,"Instruction 0", 0,Maker){ addr++; } }; class OPCode1 : public Instruction { public: OPCode1():Instruction(-1,1,nullptr){} OPCode1(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"Return", 1,Maker){} OPCode1(int addr, Builder *Maker):Instruction(addr,"Return",1,Maker){} OPCode1(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"Return", 1,Maker){ addr++; } }; class UI_OP13: public Instruction{ public: UI_OP13():Instruction(-1,0x13,nullptr){} UI_OP13(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x13,Maker){} UI_OP13(int addr, Builder *Maker):Instruction(addr,"???",0x13,Maker){} UI_OP13(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x13,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch ((unsigned char) control_byte[0]) { case 0x00:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x01:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 10:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0xb:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0xc:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x32: case 0x26: case 0xd:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0xe:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0xf:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x10:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x11:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x12:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x13:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x14:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x15:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x16:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x17:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x18:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x19:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x1B: case 0x1A:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x1C:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x1D:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x20: case 0x1F: case 0x1E:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x21:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x22:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x23:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x24:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x25:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x27:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x28:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x29:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x2A:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x2B:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x2C:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x2D:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x2E:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x30: case 0x2F:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x33:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x34:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x35:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x36:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x37:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x3B: case 0x38:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x3A: case 0x39:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x3C:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x41: case 0x3D:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x3E:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x3F:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x40:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x44: case 0x43:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } } } }; //SCENARIO FILES INSTRUCTIONS //0x05 class OPCode05: public Instruction{ public: OPCode05():Instruction(-1,0x05,nullptr){} OPCode05(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x05,Maker){} OPCode05(int addr, Builder *Maker):Instruction(addr,"???",0x05,Maker){} OPCode05(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x05,Maker){ addr++; sub05(addr, content, this); this->AddOperande(operande(addr,"pointer", ReadSubByteArray(content, addr, 4))); } }; //0x02 class OPCode02: public Instruction{ public: OPCode02():Instruction(-1,0x02,nullptr){} OPCode02(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x02,Maker){} OPCode02(int addr, Builder *Maker):Instruction(addr,"???",0x02,Maker){} OPCode02(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x02,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x03 class OPCode03: public Instruction{ public: OPCode03():Instruction(-1,0x03,nullptr){} OPCode03(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x03,Maker){} OPCode03(int addr, Builder *Maker):Instruction(addr,"???",0x03,Maker){} OPCode03(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x03,Maker){ addr++; this->AddOperande(operande(addr,"pointer", ReadSubByteArray(content, addr,4))); } }; //0x04 class OPCode04: public Instruction{ public: OPCode04():Instruction(-1,0x04,nullptr){} OPCode04(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x04,Maker){} OPCode04(int addr, Builder *Maker):Instruction(addr,"???",0x04,Maker){} OPCode04(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x04,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x06 class OPCode06: public Instruction{ public: OPCode06():Instruction(-1,0x06,nullptr){} OPCode06(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x06,Maker){} OPCode06(int addr, Builder *Maker):Instruction(addr,"???",0x06,Maker){} OPCode06(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x06,Maker){ addr++; sub05(addr, content, this); QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); if ((unsigned char) control_byte[0] != 0){ for (unsigned char i = 0; i<control_byte[0]; i++){ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"pointer", ReadSubByteArray(content, addr,4))); } } this->AddOperande(operande(addr,"pointer", ReadSubByteArray(content, addr,4))); } }; //0x07 class OPCode07: public Instruction{ public: OPCode07():Instruction(-1,0x07,nullptr){} OPCode07(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x07,Maker){} OPCode07(int addr, Builder *Maker):Instruction(addr,"???",0x07,Maker){} OPCode07(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x07,Maker){ addr++; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x08 class OPCode08: public Instruction{ public: OPCode08():Instruction(-1,0x08,nullptr){} OPCode08(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x08,Maker){} OPCode08(int addr, Builder *Maker):Instruction(addr,"???",0x08,Maker){} OPCode08(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x08,Maker){ addr++; sub05(addr, content, this); } }; //0x0A class OPCode0A: public Instruction{ public: OPCode0A():Instruction(-1,0x0A,nullptr){} OPCode0A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x0A,Maker){} OPCode0A(int addr, Builder *Maker):Instruction(addr,"???",0x0A,Maker){} OPCode0A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x0A,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); sub05(addr, content, this); } }; //0x0C class OPCode0C: public Instruction{ public: OPCode0C():Instruction(-1,0x0C,nullptr){} OPCode0C(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x0C,Maker){} OPCode0C(int addr, Builder *Maker):Instruction(addr,"???",0x0C,Maker){} OPCode0C(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x0C,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x0D class OPCode0D: public Instruction{ public: OPCode0D():Instruction(-1,0x0D,nullptr){} OPCode0D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x0D,Maker){} OPCode0D(int addr, Builder *Maker):Instruction(addr,"???",0x0D,Maker){} OPCode0D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x0D,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x0E class OPCode0E: public Instruction{ public: OPCode0E():Instruction(-1,0x0E,nullptr){} OPCode0E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x0E,Maker){} OPCode0E(int addr, Builder *Maker):Instruction(addr,"???",0x0E,Maker){} OPCode0E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x0E,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); } }; //0x0F class OPCode0F: public Instruction{ public: OPCode0F():Instruction(-1,0x0F,nullptr){} OPCode0F(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x0F,Maker){} OPCode0F(int addr, Builder *Maker):Instruction(addr,"???",0x0F,Maker){} OPCode0F(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x0F,Maker){ addr++; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x10 class OPCode10: public Instruction{ public: OPCode10():Instruction(-1,0x10,nullptr){} OPCode10(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x10,Maker){} OPCode10(int addr, Builder *Maker):Instruction(addr,"???",0x10,Maker){} OPCode10(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x10,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x11 class OPCode11: public Instruction{ public: OPCode11():Instruction(-1,0x11,nullptr){} OPCode11(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x11,Maker){} OPCode11(int addr, Builder *Maker):Instruction(addr,"???",0x11,Maker){} OPCode11(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x11,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x12 class OPCode12: public Instruction{ public: OPCode12():Instruction(-1,0x12,nullptr){} OPCode12(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x12,Maker){} OPCode12(int addr, Builder *Maker):Instruction(addr,"???",0x12,Maker){} OPCode12(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x12,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); sub05(addr, content, this); } }; //0x13 class OPCode13: public Instruction{ public: OPCode13():Instruction(-1,0x13,nullptr){} OPCode13(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x13,Maker){} OPCode13(int addr, Builder *Maker):Instruction(addr,"???",0x13,Maker){} OPCode13(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x13,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); QString fun_name = ReadStringFromByteArray(addr, content); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); int ID_fun = ReadIntegerFromByteArray(addr,content); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4)));//i think this one is the id of the battle function it triggers this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x14 class OPCode14: public Instruction{ public: OPCode14():Instruction(-1,0x14,nullptr){} OPCode14(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x14,Maker){} OPCode14(int addr, Builder *Maker):Instruction(addr,"???",0x14,Maker){} OPCode14(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x14,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x15 class OPCode15: public Instruction{ public: OPCode15():Instruction(-1,0x15,nullptr){} OPCode15(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x15,Maker){} OPCode15(int addr, Builder *Maker):Instruction(addr,"???",0x15,Maker){} OPCode15(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x15,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x16 class OPCode16: public Instruction{ public: OPCode16():Instruction(-1,0x16,nullptr){} OPCode16(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x16,Maker){} OPCode16(int addr, Builder *Maker):Instruction(addr,"???",0x16,Maker){} OPCode16(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x16,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x17 class OPCode17: public Instruction{ public: OPCode17():Instruction(-1,0x17,nullptr){} OPCode17(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x17,Maker){} OPCode17(int addr, Builder *Maker):Instruction(addr,"???",0x17,Maker){} OPCode17(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x17,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x18 class OPCode18: public Instruction{ public: OPCode18():Instruction(-1,0x18,nullptr){} OPCode18(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x18,Maker){} OPCode18(int addr, Builder *Maker):Instruction(addr,"???",0x18,Maker){} OPCode18(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x18,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); //this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); fun_140498b70(addr, content, this); } }; //0x19 class OPCode19: public Instruction{ public: OPCode19():Instruction(-1,0x19,nullptr){} OPCode19(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x19,Maker){} OPCode19(int addr, Builder *Maker):Instruction(addr,"???",0x19,Maker){} OPCode19(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x19,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x05: case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x01:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x02:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x1A class OPCode1A: public Instruction{ public: OPCode1A():Instruction(-1,0x1A,nullptr){} OPCode1A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x1A,Maker){} OPCode1A(int addr, Builder *Maker):Instruction(addr,"???",0x1A,Maker){} OPCode1A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x1A,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); fun_140498b70(addr, content, this); } }; //0x1B class OPCode1B: public Instruction{ public: OPCode1B():Instruction(-1,0x1B,nullptr){} OPCode1B(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x1B,Maker){} OPCode1B(int addr, Builder *Maker):Instruction(addr,"???",0x1B,Maker){} OPCode1B(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x1B,Maker){ addr++; } }; //0x1C class OPCode1C: public Instruction{ public: OPCode1C():Instruction(-1,0x1C,nullptr){} OPCode1C(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x1C,Maker){} OPCode1C(int addr, Builder *Maker):Instruction(addr,"???",0x1C,Maker){} OPCode1C(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x1C,Maker){ addr++; } }; //0x1D class OPCode1D: public Instruction{ public: OPCode1D():Instruction(-1,0x1D,nullptr){} OPCode1D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x1D,Maker){} OPCode1D(int addr, Builder *Maker):Instruction(addr,"???",0x1D,Maker){} OPCode1D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x1D,Maker){ addr++; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x1E class OPCode1E: public Instruction{ public: OPCode1E():Instruction(-1,0x1E,nullptr){} OPCode1E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x1E,Maker){} OPCode1E(int addr, Builder *Maker):Instruction(addr,"???",0x1E,Maker){} OPCode1E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x1E,Maker){ addr++; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x1F class OPCode1F: public Instruction{ public: OPCode1F():Instruction(-1,0x1F,nullptr){} OPCode1F(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x1F,Maker){} OPCode1F(int addr, Builder *Maker):Instruction(addr,"???",0x1F,Maker){} OPCode1F(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x1F,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); QByteArray control_byte2 = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte2)); if ((unsigned char)control_byte2[0]<0x4){ switch((unsigned char)control_byte[0]) { case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x01:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x02:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x04:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x05:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x07: case 0x06:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } } }; //0x20 class OPCode20: public Instruction{ public: OPCode20():Instruction(-1,0x20,nullptr){} OPCode20(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x20,Maker){} OPCode20(int addr, Builder *Maker):Instruction(addr,"???",0x20,Maker){} OPCode20(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x20,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); switch ((unsigned char)control_byte[0]) { case 0x02: case 0x01: case 0x00:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); break; } } } }; //0x21 class OPCode21: public Instruction{ public: OPCode21():Instruction(-1,0x21,nullptr){} OPCode21(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x21,Maker){} OPCode21(int addr, Builder *Maker):Instruction(addr,"???",0x21,Maker){} OPCode21(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x21,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; switch ((unsigned char)control_byte[0]) { case 0x01: { this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x22 class OPCode22: public Instruction{ public: OPCode22():Instruction(-1,0x22,nullptr){} OPCode22(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x22,Maker){} OPCode22(int addr, Builder *Maker):Instruction(addr,"???",0x22,Maker){} OPCode22(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x22,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } }; //0x23 class OPCode23: public Instruction{ public: OPCode23():Instruction(-1,0x23,nullptr){} OPCode23(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x23,Maker){} OPCode23(int addr, Builder *Maker):Instruction(addr,"???",0x23,Maker){} OPCode23(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x23,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x24 class OPCode24: public Instruction{ public: OPCode24():Instruction(-1,0x24,nullptr){} OPCode24(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x24,Maker){} OPCode24(int addr, Builder *Maker):Instruction(addr,"???",0x24,Maker){} OPCode24(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x24,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x25 class OPCode25: public Instruction{ public: OPCode25():Instruction(-1,0x25,nullptr){} OPCode25(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x25,Maker){} OPCode25(int addr, Builder *Maker):Instruction(addr,"???",0x25,Maker){} OPCode25(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x25,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } }; //0x26 class OPCode26: public Instruction{ public: OPCode26():Instruction(-1,0x26,nullptr){} OPCode26(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x26,Maker){} OPCode26(int addr, Builder *Maker):Instruction(addr,"???",0x26,Maker){} OPCode26(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x26,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x27 class OPCode27: public Instruction{ public: OPCode27():Instruction(-1,0x27,nullptr){} OPCode27(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x27,Maker){} OPCode27(int addr, Builder *Maker):Instruction(addr,"???",0x27,Maker){} OPCode27(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x27,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x0A:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x0B:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x0C:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x11: case 0x10: case 0x0F:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x12:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x13: case 0x14:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x15:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0xD: case 0xE:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } } } }; //0x28 class OPCode28: public Instruction{ public: OPCode28():Instruction(-1,0x28,nullptr){} OPCode28(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x28,Maker){} OPCode28(int addr, Builder *Maker):Instruction(addr,"???",0x28,Maker){} OPCode28(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x28,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x01:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case '\b': case 0x06: case 0x04: case 0x02:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case '\a': case 0x05:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 'm': case 'l': case 'k': case 'f': case 'e': case 'c': case '\x1C': case '\x1A': case '\x17': case '\x19': case '\x14': case '\r': case '\x10': case 'H': case ']': case '\t': case '^': case '_': case '`': case 's': case 't': case 'u': case 'y':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case '\x0f': case '\n':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case '\f': case '4': case 'Z': case '\v':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case '\x0e':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 'b': case '\x11': case 'z':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case '\x12':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); for (int i = 0; i<8; i++) this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case '\x13':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case '\x15':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case '2':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case '5':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case '6':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case '7':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case '<':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 'F':{ this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); break; } case 'P':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case '[':{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case '\\':{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 'a':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 'd':{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 'n':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case '~': case 'q':{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 'r':{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case '{':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 'i':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 'j':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x29 class OPCode29: public Instruction{ public: OPCode29():Instruction(-1,0x29,nullptr){} OPCode29(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x29,Maker){} OPCode29(int addr, Builder *Maker):Instruction(addr,"???",0x29,Maker){} OPCode29(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x29,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x2A class OPCode2A: public Instruction{ public: OPCode2A():Instruction(-1,0x2A,nullptr){} OPCode2A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x2A,Maker){} OPCode2A(int addr, Builder *Maker):Instruction(addr,"???",0x2A,Maker){} OPCode2A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x2A,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x2B class OPCode2B: public Instruction{ public: OPCode2B():Instruction(-1,0x2B,nullptr){} OPCode2B(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x2B,Maker){} OPCode2B(int addr, Builder *Maker):Instruction(addr,"???",0x2B,Maker){} OPCode2B(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x2B,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x2C class OPCode2C: public Instruction{ public: OPCode2C():Instruction(-1,0x2C,nullptr){} OPCode2C(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x2C,Maker){} OPCode2C(int addr, Builder *Maker):Instruction(addr,"???",0x2C,Maker){} OPCode2C(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x2C,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x2D class OPCode2D: public Instruction{ public: OPCode2D():Instruction(-1,0x2D,nullptr){} OPCode2D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x2D,Maker){} OPCode2D(int addr, Builder *Maker):Instruction(addr,"???",0x2D,Maker){} OPCode2D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x2D,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x02:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x14: case 0x03:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x04:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x05:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x07:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x08:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x09:{ this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); break; } case 0x0B:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x0D: case 0x0C:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x0E:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x0F:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); break; } case 0x11:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x12:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x13:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x15:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x16:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x17:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x2E class OPCode2E: public Instruction{ public: OPCode2E():Instruction(-1,0x2E,nullptr){} OPCode2E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x2E,Maker){} OPCode2E(int addr, Builder *Maker):Instruction(addr,"???",0x2E,Maker){} OPCode2E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x2E,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } }; //0x2F class OPCode2F: public Instruction{ public: OPCode2F():Instruction(-1,0x2F,nullptr){} OPCode2F(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x2F,Maker){} OPCode2F(int addr, Builder *Maker):Instruction(addr,"???",0x2F,Maker){} OPCode2F(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x2F,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x30 class OPCode30: public Instruction{ public: OPCode30():Instruction(-1,0x30,nullptr){} OPCode30(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x30,Maker){} OPCode30(int addr, Builder *Maker):Instruction(addr,"???",0x30,Maker){} OPCode30(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x30,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 1:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 2:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } default:{ break; } case 3:{ this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 4:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 5:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 6:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x31 class OPCode31: public Instruction{ public: OPCode31():Instruction(-1,0x31,nullptr){} OPCode31(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x31,Maker){} OPCode31(int addr, Builder *Maker):Instruction(addr,"???",0x31,Maker){} OPCode31(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x31,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); if ((unsigned char)control_byte[0] > 0xFD){ if ((unsigned char)control_byte[0] == 0xFE){ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } else if ((unsigned char)control_byte[0] == 0xFF){ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } return; } switch ((unsigned char)control_byte[0]) { case 0x00: case 0x32: { this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x33: case 0x01:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 4: case 7: case 8: case 9: case 10: case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x30: case 0x31: case 0x36: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: case 0x60: case 0x61: case 0x62: case 99: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: break; case 0x96: case 0x39: case 0x06: case 0x38: case 0x05: case 0x37: case 0x34: case 0x02:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x35: case 0x03:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x3A: { this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 100: { this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x65: { this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0xFD:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr,1))); } default:{} } } }; //0x32 class OPCode32: public Instruction{ public: OPCode32():Instruction(-1,0x32,nullptr){} OPCode32(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x32,Maker){} OPCode32(int addr, Builder *Maker):Instruction(addr,"???",0x32,Maker){} OPCode32(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x32,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); switch((unsigned char)control_byte[0]){ case 0x01:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x02:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x03:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x04: { this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } } } }; //0x33 class OPCode33: public Instruction{ public: OPCode33():Instruction(-1,0x33,nullptr){} OPCode33(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x33,Maker){} OPCode33(int addr, Builder *Maker):Instruction(addr,"???",0x33,Maker){} OPCode33(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x33,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x34 class OPCode34: public Instruction{ public: OPCode34():Instruction(-1,0x34,nullptr){} OPCode34(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x34,Maker){} OPCode34(int addr, Builder *Maker):Instruction(addr,"???",0x34,Maker){} OPCode34(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x34,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x35 class OPCode35: public Instruction{ public: OPCode35():Instruction(-1,0x35,nullptr){} OPCode35(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x35,Maker){} OPCode35(int addr, Builder *Maker):Instruction(addr,"???",0x35,Maker){} OPCode35(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x35,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x36 class OPCode36: public Instruction{ public: OPCode36():Instruction(-1,0x36,nullptr){} OPCode36(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x36,Maker){} OPCode36(int addr, Builder *Maker):Instruction(addr,"???",0x36,Maker){} OPCode36(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x36,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); QByteArray control_short = ReadSubByteArray(content, addr, 2); this->AddOperande(operande(addr,"short", control_short)); short second_arg = ReadShortFromByteArray(0, control_short); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); if ((second_arg == -0x1fe)||(second_arg == -0x1fd)){ this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x37 class OPCode37: public Instruction{ public: OPCode37():Instruction(-1,0x37,nullptr){} OPCode37(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x37,Maker){} OPCode37(int addr, Builder *Maker):Instruction(addr,"???",0x37,Maker){} OPCode37(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x37,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x38 class OPCode38: public Instruction{ public: OPCode38():Instruction(-1,0x38,nullptr){} OPCode38(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x38,Maker){} OPCode38(int addr, Builder *Maker):Instruction(addr,"???",0x38,Maker){} OPCode38(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x38,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x39 class OPCode39: public Instruction{ public: OPCode39():Instruction(-1,0x39,nullptr){} OPCode39(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x39,Maker){} OPCode39(int addr, Builder *Maker):Instruction(addr,"???",0x39,Maker){} OPCode39(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x39,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); unsigned char code = control_byte[0]; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); if ((code != 0xC)&&(code != 0x5)&&(code != 0x69)&&(code != 0xA)&&(code != 0xB)&&(code != 0xFF)&&(code != 0xFE)){ this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } } }; //0x3A class OPCode3A: public Instruction{ public: OPCode3A():Instruction(-1,0x3A,nullptr){} OPCode3A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x3A,Maker){} OPCode3A(int addr, Builder *Maker):Instruction(addr,"???",0x3A,Maker){} OPCode3A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x3A,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x3B class OPCode3B: public Instruction{ public: OPCode3B():Instruction(-1,0x3B,nullptr){} OPCode3B(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x3B,Maker){} OPCode3B(int addr, Builder *Maker):Instruction(addr,"???",0x3B,Maker){} OPCode3B(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x3B,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x3C static int FUN_00644350(ushort first_two_bytes){ if (first_two_bytes < 0x10) { return 0; } if (first_two_bytes == 0xFFFD) return 0; } class OPCode3C: public Instruction{ public: OPCode3C():Instruction(-1,0x3C,nullptr){} OPCode3C(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x3C,Maker){} OPCode3C(int addr, Builder *Maker):Instruction(addr,"???",0x3C,Maker){} OPCode3C(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x3C,Maker){ addr++; QByteArray control_short = ReadSubByteArray(content, addr, 2); this->AddOperande(operande(addr,"short", control_short)); QByteArray control_short2 = ReadSubByteArray(content, addr, 2); this->AddOperande(operande(addr,"short", control_short2)); QByteArray control_short3 = ReadSubByteArray(content, addr, 2); this->AddOperande(operande(addr,"short", control_short3)); ushort short1 = ReadShortFromByteArray(0, control_short); ushort short2 = ReadShortFromByteArray(0, control_short2); int var2 = FUN_00644350(short1); int var3 = FUN_00644350(short2); if (((var2 == 0) || (var3 == 0)) || (var2 == var3)) { if (short2 == 0xFFFF){ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } } } }; //0x3D class OPCode3D: public Instruction{ public: OPCode3D():Instruction(-1,0x3D,nullptr){} OPCode3D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x3D,Maker){} OPCode3D(int addr, Builder *Maker):Instruction(addr,"???",0x3D,Maker){} OPCode3D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x3D,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x3E class OPCode3E: public Instruction{ public: OPCode3E():Instruction(-1,0x3E,nullptr){} OPCode3E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x3E,Maker){} OPCode3E(int addr, Builder *Maker):Instruction(addr,"???",0x3E,Maker){} OPCode3E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x3E,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x3F class OPCode3F: public Instruction{ public: OPCode3F():Instruction(-1,0x3F,nullptr){} OPCode3F(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x3F,Maker){} OPCode3F(int addr, Builder *Maker):Instruction(addr,"???",0x3F,Maker){} OPCode3F(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x3F,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x09: case 0x0A: case 0x0B: case 0x01: case 0x06: case 0x05: case 0x04: case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x08:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x40 class OPCode40: public Instruction{ public: OPCode40():Instruction(-1,0x40,nullptr){} OPCode40(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x40,Maker){} OPCode40(int addr, Builder *Maker):Instruction(addr,"???",0x40,Maker){} OPCode40(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x40,Maker){ addr++; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x41 class OPCode41: public Instruction{ public: OPCode41():Instruction(-1,0x41,nullptr){} OPCode41(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x41,Maker){} OPCode41(int addr, Builder *Maker):Instruction(addr,"???",0x41,Maker){} OPCode41(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x41,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x42 class OPCode42: public Instruction{ public: OPCode42():Instruction(-1,0x42,nullptr){} OPCode42(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x42,Maker){} OPCode42(int addr, Builder *Maker):Instruction(addr,"???",0x42,Maker){} OPCode42(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x42,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x43 class OPCode43: public Instruction{ public: OPCode43():Instruction(-1,0x43,nullptr){} OPCode43(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x43,Maker){} OPCode43(int addr, Builder *Maker):Instruction(addr,"???",0x43,Maker){} OPCode43(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x43,Maker){ addr++; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x44 class OPCode44: public Instruction{ public: OPCode44():Instruction(-1,0x44,nullptr){} OPCode44(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x44,Maker){} OPCode44(int addr, Builder *Maker):Instruction(addr,"???",0x44,Maker){} OPCode44(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x44,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); switch((unsigned char)control_byte[0]){ case 0x00:{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x02:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x03:{ this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x04: case 0x05:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break;} } } }; //0x45 class OPCode45: public Instruction{ public: OPCode45():Instruction(-1,0x45,nullptr){} OPCode45(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x45,Maker){} OPCode45(int addr, Builder *Maker):Instruction(addr,"???",0x45,Maker){} OPCode45(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x45,Maker){ addr++; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x46 class OPCode46: public Instruction{ public: OPCode46():Instruction(-1,0x46,nullptr){} OPCode46(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x46,Maker){} OPCode46(int addr, Builder *Maker):Instruction(addr,"???",0x46,Maker){} OPCode46(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x46,Maker){ addr++; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x47 class OPCode47: public Instruction{ public: OPCode47():Instruction(-1,0x47,nullptr){} OPCode47(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x47,Maker){} OPCode47(int addr, Builder *Maker):Instruction(addr,"???",0x47,Maker){} OPCode47(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x47,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x48 class OPCode48: public Instruction{ public: OPCode48():Instruction(-1,0x48,nullptr){} OPCode48(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x48,Maker){} OPCode48(int addr, Builder *Maker):Instruction(addr,"???",0x48,Maker){} OPCode48(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x48,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x49 class OPCode49: public Instruction{ public: OPCode49():Instruction(-1,0x49,nullptr){} OPCode49(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x49,Maker){} OPCode49(int addr, Builder *Maker):Instruction(addr,"???",0x49,Maker){} OPCode49(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x49,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x0A: case 0x04: case 0x03: case 0x02: case 0x01: case 0x00:{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case '\r':{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x14:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x15:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x17:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x18:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x19:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x1C:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case '!':{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case '(': case '$': case '#':{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case '&':{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case ')':{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x4A class OPCode4A: public Instruction{ public: OPCode4A():Instruction(-1,0x4A,nullptr){} OPCode4A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x4A,Maker){} OPCode4A(int addr, Builder *Maker):Instruction(addr,"???",0x4A,Maker){} OPCode4A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x4A,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x4B class OPCode4B: public Instruction{ public: OPCode4B():Instruction(-1,0x4B,nullptr){} OPCode4B(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x4B,Maker){} OPCode4B(int addr, Builder *Maker):Instruction(addr,"???",0x4B,Maker){} OPCode4B(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x4B,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } }; //0x4C class OPCode4C: public Instruction{ public: OPCode4C():Instruction(-1,0x4C,nullptr){} OPCode4C(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x4C,Maker){} OPCode4C(int addr, Builder *Maker):Instruction(addr,"???",0x4C,Maker){} OPCode4C(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x4C,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x4D class OPCode4D: public Instruction{ public: OPCode4D():Instruction(-1,0x4D,nullptr){} OPCode4D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x4D,Maker){} OPCode4D(int addr, Builder *Maker):Instruction(addr,"???",0x4D,Maker){} OPCode4D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x4D,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); } }; //0x4E class OPCode4E: public Instruction{ public: OPCode4E():Instruction(-1,0x4E,nullptr){} OPCode4E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x4E,Maker){} OPCode4E(int addr, Builder *Maker):Instruction(addr,"???",0x4E,Maker){} OPCode4E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x4E,Maker){ addr++; } }; //0x4F class OPCode4F: public Instruction{ public: OPCode4F():Instruction(-1,0x4F,nullptr){} OPCode4F(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x4F,Maker){} OPCode4F(int addr, Builder *Maker):Instruction(addr,"???",0x4F,Maker){} OPCode4F(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x4F,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x50 class OPCode50: public Instruction{ public: OPCode50():Instruction(-1,0x50,nullptr){} OPCode50(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x50,Maker){} OPCode50(int addr, Builder *Maker):Instruction(addr,"???",0x50,Maker){} OPCode50(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x50,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x51 class OPCode51: public Instruction{ public: OPCode51():Instruction(-1,0x51,nullptr){} OPCode51(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x51,Maker){} OPCode51(int addr, Builder *Maker):Instruction(addr,"???",0x51,Maker){} OPCode51(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x51,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x52 class OPCode52: public Instruction{ public: OPCode52():Instruction(-1,0x52,nullptr){} OPCode52(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x52,Maker){} OPCode52(int addr, Builder *Maker):Instruction(addr,"???",0x52,Maker){} OPCode52(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x52,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x53 class OPCode53: public Instruction{ public: OPCode53():Instruction(-1,0x53,nullptr){} OPCode53(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x53,Maker){} OPCode53(int addr, Builder *Maker):Instruction(addr,"???",0x53,Maker){} OPCode53(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x53,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x55 class OPCode55: public Instruction{ public: OPCode55():Instruction(-1,0x55,nullptr){} OPCode55(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x55,Maker){} OPCode55(int addr, Builder *Maker):Instruction(addr,"???",0x55,Maker){} OPCode55(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x55,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x56 class OPCode56: public Instruction{ public: OPCode56():Instruction(-1,0x56,nullptr){} OPCode56(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x56,Maker){} OPCode56(int addr, Builder *Maker):Instruction(addr,"???",0x56,Maker){} OPCode56(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x56,Maker){ addr++; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x57 class OPCode57: public Instruction{ public: OPCode57():Instruction(-1,0x57,nullptr){} OPCode57(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x57,Maker){} OPCode57(int addr, Builder *Maker):Instruction(addr,"???",0x57,Maker){} OPCode57(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x57,Maker){ addr++; } }; //0x58 class OPCode58: public Instruction{ public: OPCode58():Instruction(-1,0x58,nullptr){} OPCode58(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x58,Maker){} OPCode58(int addr, Builder *Maker):Instruction(addr,"???",0x58,Maker){} OPCode58(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x58,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x59 class OPCode59: public Instruction{ public: OPCode59():Instruction(-1,0x59,nullptr){} OPCode59(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x59,Maker){} OPCode59(int addr, Builder *Maker):Instruction(addr,"???",0x59,Maker){} OPCode59(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x59,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x5A class OPCode5A: public Instruction{ public: OPCode5A():Instruction(-1,0x5A,nullptr){} OPCode5A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x5A,Maker){} OPCode5A(int addr, Builder *Maker):Instruction(addr,"???",0x5A,Maker){} OPCode5A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x5A,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x5B class OPCode5B: public Instruction{ public: OPCode5B():Instruction(-1,0x5B,nullptr){} OPCode5B(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x5B,Maker){} OPCode5B(int addr, Builder *Maker):Instruction(addr,"???",0x5B,Maker){} OPCode5B(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x5B,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); switch((unsigned char)control_byte[0]){ case 0x04: case 0x01: case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x5C class OPCode5C: public Instruction{ public: OPCode5C():Instruction(-1,0x5C,nullptr){} OPCode5C(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x5C,Maker){} OPCode5C(int addr, Builder *Maker):Instruction(addr,"???",0x5C,Maker){} OPCode5C(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x5C,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); switch((unsigned char)control_byte[0]){ case 0x01: case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x5D class OPCode5D: public Instruction{ public: OPCode5D():Instruction(-1,0x5D,nullptr){} OPCode5D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x5D,Maker){} OPCode5D(int addr, Builder *Maker):Instruction(addr,"???",0x5D,Maker){} OPCode5D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x5D,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); switch((unsigned char)control_byte[0]){ case 0x01: case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x04: case 0x03: case 0x02:{ this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); break; } case '\a':{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case '\b':{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } } } }; //0x5E class OPCode5E: public Instruction{ public: OPCode5E():Instruction(-1,0x5E,nullptr){} OPCode5E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x5E,Maker){} OPCode5E(int addr, Builder *Maker):Instruction(addr,"???",0x5E,Maker){} OPCode5E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x5E,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x0B: case 0x09: case 0x07: case 0x08: case 0x04: case 0x01:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x05: case 0x03: case 0x02:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x06:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x0A:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x0D: case 0x0C:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x5F class OPCode5F: public Instruction{ public: OPCode5F():Instruction(-1,0x5F,nullptr){} OPCode5F(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x5F,Maker){} OPCode5F(int addr, Builder *Maker):Instruction(addr,"???",0x5F,Maker){} OPCode5F(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x5F,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x00: case 0x03:{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x02:{ this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); break; } } } }; //0x60 class OPCode60: public Instruction{ public: OPCode60():Instruction(-1,0x60,nullptr){} OPCode60(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x60,Maker){} OPCode60(int addr, Builder *Maker):Instruction(addr,"???",0x60,Maker){} OPCode60(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x60,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x61 class OPCode61: public Instruction{ public: OPCode61():Instruction(-1,0x61,nullptr){} OPCode61(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x61,Maker){} OPCode61(int addr, Builder *Maker):Instruction(addr,"???",0x61,Maker){} OPCode61(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x61,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); } }; //0x62 class OPCode62: public Instruction{ public: OPCode62():Instruction(-1,0x62,nullptr){} OPCode62(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x62,Maker){} OPCode62(int addr, Builder *Maker):Instruction(addr,"???",0x62,Maker){} OPCode62(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x62,Maker){ addr++; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x63 class OPCode63: public Instruction{ public: OPCode63():Instruction(-1,0x63,nullptr){} OPCode63(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x63,Maker){} OPCode63(int addr, Builder *Maker):Instruction(addr,"???",0x63,Maker){} OPCode63(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x63,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x64 class OPCode64: public Instruction{ public: OPCode64():Instruction(-1,0x64,nullptr){} OPCode64(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x64,Maker){} OPCode64(int addr, Builder *Maker):Instruction(addr,"???",0x64,Maker){} OPCode64(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x64,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x65 class OPCode65: public Instruction{ public: OPCode65():Instruction(-1,0x65,nullptr){} OPCode65(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x65,Maker){} OPCode65(int addr, Builder *Maker):Instruction(addr,"???",0x65,Maker){} OPCode65(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x65,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x05: case 0x03: case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x06:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x09: case 0x07: case 0x04: case 0x01:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x02:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x08:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x66 class OPCode66: public Instruction{ public: OPCode66():Instruction(-1,0x66,nullptr){} OPCode66(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x66,Maker){} OPCode66(int addr, Builder *Maker):Instruction(addr,"???",0x66,Maker){} OPCode66(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x66,Maker){ addr++; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x67 class OPCode67: public Instruction{ public: OPCode67():Instruction(-1,0x67,nullptr){} OPCode67(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x67,Maker){} OPCode67(int addr, Builder *Maker):Instruction(addr,"???",0x67,Maker){} OPCode67(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x67,Maker){ addr++; QByteArray control_short = ReadSubByteArray(content, addr, 2); ushort control = ReadShortFromByteArray(0, control_short); this->AddOperande(operande(addr,"short", control_short)); QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); unsigned char code = control_byte[0]; switch(code){ case 0x02: case 0x01:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x03: case 0x04:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } } if ((control != 0xFFFF) &&(control <= 0x96)&& (code == 0x6)){ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } } }; //0x68 class OPCode68: public Instruction{ public: OPCode68():Instruction(-1,0x68,nullptr){} OPCode68(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x68,Maker){} OPCode68(int addr, Builder *Maker):Instruction(addr,"???",0x68,Maker){} OPCode68(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x68,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x01:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x00:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } } } }; //0x69 class OPCode69: public Instruction{ public: OPCode69():Instruction(-1,0x69,nullptr){} OPCode69(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x69,Maker){} OPCode69(int addr, Builder *Maker):Instruction(addr,"???",0x69,Maker){} OPCode69(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x69,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x00:{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x02:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x03:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x05:{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } } } }; //0x6A class OPCode6A: public Instruction{ public: OPCode6A():Instruction(-1,0x6A,nullptr){} OPCode6A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x6A,Maker){} OPCode6A(int addr, Builder *Maker):Instruction(addr,"???",0x6A,Maker){} OPCode6A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x6A,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); QByteArray control_byte2 = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte2)); if ((unsigned char)control_byte2[0] < 4){ switch ((unsigned char)control_byte[0]) { case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); break; } case 0x01:{ //fun_140498b70(addr, content, this); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x02:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x04:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; break; } case 0x05:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x07: case 0x06:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } } }; //0x6B class OPCode6B: public Instruction{ public: OPCode6B():Instruction(-1,0x6B,nullptr){} OPCode6B(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x6B,Maker){} OPCode6B(int addr, Builder *Maker):Instruction(addr,"???",0x6B,Maker){} OPCode6B(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x6B,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x6C class OPCode6C: public Instruction{ public: OPCode6C():Instruction(-1,0x6C,nullptr){} OPCode6C(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x6C,Maker){} OPCode6C(int addr, Builder *Maker):Instruction(addr,"???",0x6C,Maker){} OPCode6C(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x6C,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x6D class OPCode6D: public Instruction{ public: OPCode6D():Instruction(-1,0x6D,nullptr){} OPCode6D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x6D,Maker){} OPCode6D(int addr, Builder *Maker):Instruction(addr,"???",0x6D,Maker){} OPCode6D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x6D,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x6E class OPCode6E: public Instruction{ public: OPCode6E():Instruction(-1,0x6E,nullptr){} OPCode6E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x6E,Maker){} OPCode6E(int addr, Builder *Maker):Instruction(addr,"???",0x6E,Maker){} OPCode6E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x6E,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); switch((unsigned char)control_byte[0]){ case 0x05:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x6F class OPCode6F: public Instruction{ public: OPCode6F():Instruction(-1,0x6F,nullptr){} OPCode6F(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x6F,Maker){} OPCode6F(int addr, Builder *Maker):Instruction(addr,"???",0x6F,Maker){} OPCode6F(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x6F,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x00:{ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case 0x02: case 0x01:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } } } }; //0x70 class OPCode70: public Instruction{ public: OPCode70():Instruction(-1,0x70,nullptr){} OPCode70(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x70,Maker){} OPCode70(int addr, Builder *Maker):Instruction(addr,"???",0x70,Maker){} OPCode70(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x70,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); unsigned char code = control_byte[0]; if (code == 0x01){ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } } }; //0x71 class OPCode71: public Instruction{ public: OPCode71():Instruction(-1,0x71,nullptr){} OPCode71(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x71,Maker){} OPCode71(int addr, Builder *Maker):Instruction(addr,"???",0x71,Maker){} OPCode71(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x71,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); unsigned char code = control_byte[0]; if (code == 0x00){ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } } }; //0x72 class OPCode72: public Instruction{ public: OPCode72():Instruction(-1,0x72,nullptr){} OPCode72(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x72,Maker){} OPCode72(int addr, Builder *Maker):Instruction(addr,"???",0x72,Maker){} OPCode72(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x72,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x73 class OPCode73: public Instruction{ public: OPCode73():Instruction(-1,0x73,nullptr){} OPCode73(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x73,Maker){} OPCode73(int addr, Builder *Maker):Instruction(addr,"???",0x73,Maker){} OPCode73(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x73,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x03:{ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case 0x06: case 0x02:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x04:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } case 0x05:{ this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); break; } } } }; //0x74 class OPCode74: public Instruction{ public: OPCode74():Instruction(-1,0x74,nullptr){} OPCode74(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x74,Maker){} OPCode74(int addr, Builder *Maker):Instruction(addr,"???",0x74,Maker){} OPCode74(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x74,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); } }; //0x77 class OPCode77: public Instruction{ public: OPCode77():Instruction(-1,0x77,nullptr){} OPCode77(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x77,Maker){} OPCode77(int addr, Builder *Maker):Instruction(addr,"???",0x77,Maker){} OPCode77(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x77,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x78 class OPCode78: public Instruction{ public: OPCode78():Instruction(-1,0x78,nullptr){} OPCode78(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x78,Maker){} OPCode78(int addr, Builder *Maker):Instruction(addr,"???",0x78,Maker){} OPCode78(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x78,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x79 class OPCode79: public Instruction{ public: OPCode79():Instruction(-1,0x79,nullptr){} OPCode79(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x79,Maker){} OPCode79(int addr, Builder *Maker):Instruction(addr,"???",0x79,Maker){} OPCode79(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x79,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x7A class OPCode7A: public Instruction{ public: OPCode7A():Instruction(-1,0x7A,nullptr){} OPCode7A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x7A,Maker){} OPCode7A(int addr, Builder *Maker):Instruction(addr,"???",0x7A,Maker){} OPCode7A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x7A,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x7B class OPCode7B: public Instruction{ public: OPCode7B():Instruction(-1,0x7B,nullptr){} OPCode7B(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x7B,Maker){} OPCode7B(int addr, Builder *Maker):Instruction(addr,"???",0x7B,Maker){} OPCode7B(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x7B,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0x7D class OPCode7D: public Instruction{ public: OPCode7D():Instruction(-1,0x7D,nullptr){} OPCode7D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x7D,Maker){} OPCode7D(int addr, Builder *Maker):Instruction(addr,"???",0x7D,Maker){} OPCode7D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x7D,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x7E class OPCode7E: public Instruction{ public: OPCode7E():Instruction(-1,0x7E,nullptr){} OPCode7E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x7E,Maker){} OPCode7E(int addr, Builder *Maker):Instruction(addr,"???",0x7E,Maker){} OPCode7E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x7E,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x7F class OPCode7F: public Instruction{ public: OPCode7F():Instruction(-1,0x7F,nullptr){} OPCode7F(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x7F,Maker){} OPCode7F(int addr, Builder *Maker):Instruction(addr,"???",0x7F,Maker){} OPCode7F(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x7F,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x01 : case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); break; } case -2:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } case -1:{ break; } default:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } } } }; //0x80 class OPCode80: public Instruction{ public: OPCode80():Instruction(-1,0x80,nullptr){} OPCode80(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x80,Maker){} OPCode80(int addr, Builder *Maker):Instruction(addr,"???",0x80,Maker){} OPCode80(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x80,Maker){ addr++; this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); } }; //0x81 class OPCode81: public Instruction{ public: OPCode81():Instruction(-1,0x81,nullptr){} OPCode81(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x81,Maker){} OPCode81(int addr, Builder *Maker):Instruction(addr,"???",0x81,Maker){} OPCode81(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x81,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); unsigned char code = control_byte[0]; if (code == 0x00) this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x82 class OPCode82: public Instruction{ public: OPCode82():Instruction(-1,0x82,nullptr){} OPCode82(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x82,Maker){} OPCode82(int addr, Builder *Maker):Instruction(addr,"???",0x82,Maker){} OPCode82(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x82,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x83 class OPCode83: public Instruction{ public: OPCode83():Instruction(-1,0x83,nullptr){} OPCode83(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x83,Maker){} OPCode83(int addr, Builder *Maker):Instruction(addr,"???",0x83,Maker){} OPCode83(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x83,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x84 class OPCode84: public Instruction{ public: OPCode84():Instruction(-1,0x84,nullptr){} OPCode84(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x84,Maker){} OPCode84(int addr, Builder *Maker):Instruction(addr,"???",0x84,Maker){} OPCode84(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x84,Maker){ addr++; } }; //0x85 class OPCode85: public Instruction{ public: OPCode85():Instruction(-1,0x85,nullptr){} OPCode85(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x85,Maker){} OPCode85(int addr, Builder *Maker):Instruction(addr,"???",0x85,Maker){} OPCode85(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x85,Maker){ addr++; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x86 class OPCode86: public Instruction{ public: OPCode86():Instruction(-1,0x86,nullptr){} OPCode86(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x86,Maker){} OPCode86(int addr, Builder *Maker):Instruction(addr,"???",0x86,Maker){} OPCode86(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x86,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch ((unsigned char)control_byte[0]) { case 0x01: case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x87 class OPCode87: public Instruction{ public: OPCode87():Instruction(-1,0x87,nullptr){} OPCode87(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x87,Maker){} OPCode87(int addr, Builder *Maker):Instruction(addr,"???",0x87,Maker){} OPCode87(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x87,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x88 class OPCode88: public Instruction{ public: OPCode88():Instruction(-1,0x88,nullptr){} OPCode88(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x88,Maker){} OPCode88(int addr, Builder *Maker):Instruction(addr,"???",0x88,Maker){} OPCode88(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x88,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); unsigned char code = control_byte[0]; if (code == 0x00){ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); } } }; //0x89 class OPCode89: public Instruction{ public: OPCode89():Instruction(-1,0x89,nullptr){} OPCode89(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x89,Maker){} OPCode89(int addr, Builder *Maker):Instruction(addr,"???",0x89,Maker){} OPCode89(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x89,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); unsigned char code = control_byte[0]; if (code == 0x00){ this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } } }; //0x8A class OPCode8A: public Instruction{ public: OPCode8A():Instruction(-1,0x8A,nullptr){} OPCode8A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x8A,Maker){} OPCode8A(int addr, Builder *Maker):Instruction(addr,"???",0x8A,Maker){} OPCode8A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x8A,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); unsigned char code = control_byte[0]; if (code == 0x00){ this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } } }; //0x8B class OPCode8B: public Instruction{ public: OPCode8B():Instruction(-1,0x8B,nullptr){} OPCode8B(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x8B,Maker){} OPCode8B(int addr, Builder *Maker):Instruction(addr,"???",0x8B,Maker){} OPCode8B(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x8B,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x8C class OPCode8C: public Instruction{ public: OPCode8C():Instruction(-1,0x8C,nullptr){} OPCode8C(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x8C,Maker){} OPCode8C(int addr, Builder *Maker):Instruction(addr,"???",0x8C,Maker){} OPCode8C(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x8C,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x8D class OPCode8D: public Instruction{ public: OPCode8D():Instruction(-1,0x8D,nullptr){} OPCode8D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x8D,Maker){} OPCode8D(int addr, Builder *Maker):Instruction(addr,"???",0x8D,Maker){} OPCode8D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x8D,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x8E class OPCode8E: public Instruction{ public: OPCode8E():Instruction(-1,0x8E,nullptr){} OPCode8E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x8E,Maker){} OPCode8E(int addr, Builder *Maker):Instruction(addr,"???",0x8E,Maker){} OPCode8E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x8E,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x90 class OPCode90: public Instruction{ public: OPCode90():Instruction(-1,0x90,nullptr){} OPCode90(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x90,Maker){} OPCode90(int addr, Builder *Maker):Instruction(addr,"???",0x90,Maker){} OPCode90(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x90,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x00:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x91 class OPCode91: public Instruction{ public: OPCode91():Instruction(-1,0x91,nullptr){} OPCode91(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x91,Maker){} OPCode91(int addr, Builder *Maker):Instruction(addr,"???",0x91,Maker){} OPCode91(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x91,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x00:{ this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); break; } } } }; //0x92 class OPCode92: public Instruction{ public: OPCode92():Instruction(-1,0x92,nullptr){} OPCode92(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x92,Maker){} OPCode92(int addr, Builder *Maker):Instruction(addr,"???",0x92,Maker){} OPCode92(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x92,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; } }; //0x93 class OPCode93: public Instruction{ public: OPCode93():Instruction(-1,0x93,nullptr){} OPCode93(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x93,Maker){} OPCode93(int addr, Builder *Maker):Instruction(addr,"???",0x93,Maker){} OPCode93(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x93,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); } }; //0x94 class OPCode94: public Instruction{ public: OPCode94():Instruction(-1,0x94,nullptr){} OPCode94(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x94,Maker){} OPCode94(int addr, Builder *Maker):Instruction(addr,"???",0x94,Maker){} OPCode94(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x94,Maker){ addr++; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x95 class OPCode95: public Instruction{ public: OPCode95():Instruction(-1,0x95,nullptr){} OPCode95(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x95,Maker){} OPCode95(int addr, Builder *Maker):Instruction(addr,"???",0x95,Maker){} OPCode95(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x95,Maker){ addr++; } }; //0x96 class OPCode96: public Instruction{ public: OPCode96():Instruction(-1,0x96,nullptr){} OPCode96(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x96,Maker){} OPCode96(int addr, Builder *Maker):Instruction(addr,"???",0x96,Maker){} OPCode96(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x96,Maker){ addr++; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x97 class OPCode97: public Instruction{ public: OPCode97():Instruction(-1,0x97,nullptr){} OPCode97(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x97,Maker){} OPCode97(int addr, Builder *Maker):Instruction(addr,"???",0x97,Maker){} OPCode97(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x97,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x98 class OPCode98: public Instruction{ public: OPCode98():Instruction(-1,0x98,nullptr){} OPCode98(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x98,Maker){} OPCode98(int addr, Builder *Maker):Instruction(addr,"???",0x98,Maker){} OPCode98(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x98,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); } }; //0x99 class OPCode99: public Instruction{ public: OPCode99():Instruction(-1,0x99,nullptr){} OPCode99(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x99,Maker){} OPCode99(int addr, Builder *Maker):Instruction(addr,"???",0x99,Maker){} OPCode99(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x99,Maker){ addr++; } }; //0x9A class OPCode9A: public Instruction{ public: OPCode9A():Instruction(-1,0x9A,nullptr){} OPCode9A(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x9A,Maker){} OPCode9A(int addr, Builder *Maker):Instruction(addr,"???",0x9A,Maker){} OPCode9A(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x9A,Maker){ addr++; QByteArray control_byte = ReadSubByteArray(content, addr, 1); this->AddOperande(operande(addr,"byte", control_byte)); switch((unsigned char)control_byte[0]){ case 0x01: case 0x02:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"float", ReadSubByteArray(content, addr,4))); break; } case 0x03: case 0x04:{ this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); break; } } } }; //0x9B class OPCode9B: public Instruction{ public: OPCode9B():Instruction(-1,0x9B,nullptr){} OPCode9B(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x9B,Maker){} OPCode9B(int addr, Builder *Maker):Instruction(addr,"???",0x9B,Maker){} OPCode9B(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x9B,Maker){ addr++; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x9D class OPCode9D: public Instruction{ public: OPCode9D():Instruction(-1,0x9D,nullptr){} OPCode9D(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x9D,Maker){} OPCode9D(int addr, Builder *Maker):Instruction(addr,"???",0x9D,Maker){} OPCode9D(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x9D,Maker){ addr++; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; //0x9E class OPCode9E: public Instruction{ public: OPCode9E():Instruction(-1,0x9E,nullptr){} OPCode9E(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x9E,Maker){} OPCode9E(int addr, Builder *Maker):Instruction(addr,"???",0x9E,Maker){} OPCode9E(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x9E,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1))); } }; //0x9F class OPCode9F: public Instruction{ public: OPCode9F():Instruction(-1,0x9F,nullptr){} OPCode9F(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0x9F,Maker){} OPCode9F(int addr, Builder *Maker):Instruction(addr,"???",0x9F,Maker){} OPCode9F(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0x9F,Maker){ addr++; this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"short", ReadSubByteArray(content, addr,2))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"byte", ReadSubByteArray(content, addr, 1)));; this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); this->AddOperande(operande(addr,"string", ReadStringSubByteArray(content, addr))); } }; //0xFF class OPCodeFF: public Instruction{ public: OPCodeFF():Instruction(-1,0xFF,nullptr){} OPCodeFF(int &addr, int idx_row, QXlsx::Document &doc,Builder *Maker):Instruction(addr, idx_row, doc,"???", 0xFF,Maker){} OPCodeFF(int addr, Builder *Maker):Instruction(addr,"???",0xFF,Maker){} OPCodeFF(int &addr, QByteArray &content, Builder *Maker):Instruction(addr,"???", 0xFF,Maker){ addr++; this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); this->AddOperande(operande(addr,"int", ReadSubByteArray(content, addr,4))); } }; std::shared_ptr<Instruction> CreateInstructionFromDAT(int &addr, QByteArray &dat_content, int function_type){ int OP = (dat_content[addr]&0xFF); int i = CS1UIFiles.indexOf(SceneName); if ((i != -1)&&(OP == 0x13)) return std::make_shared<UI_OP13>(addr,dat_content,this); //UI files have a special 0x13 instruction if (function_type == 0){ //the function is read with OPCodes switch(OP){ case 0x00: return std::make_shared<OPCode0>(addr,dat_content,this); case 0x01: return std::make_shared<OPCode1>(addr,dat_content,this); case 0x02: return std::make_shared<OPCode02>(addr,dat_content,this); case 0x03: return std::make_shared<OPCode03>(addr,dat_content,this); case 0x04: return std::make_shared<OPCode04>(addr,dat_content,this); case 0x05: return std::make_shared<OPCode05>(addr,dat_content,this); case 0x06: return std::make_shared<OPCode06>(addr,dat_content,this); case 0x07: return std::make_shared<OPCode07>(addr,dat_content,this); case 0x08: return std::make_shared<OPCode08>(addr,dat_content,this); case 0x0A: return std::make_shared<OPCode0A>(addr,dat_content,this); case 0x0C: return std::make_shared<OPCode0C>(addr,dat_content,this); case 0x0D: return std::make_shared<OPCode0D>(addr,dat_content,this); case 0x0E: return std::make_shared<OPCode0E>(addr,dat_content,this); case 0x0F: return std::make_shared<OPCode0F>(addr,dat_content,this); case 0x10: return std::make_shared<OPCode10>(addr,dat_content,this); case 0x11: return std::make_shared<OPCode11>(addr,dat_content,this); case 0x12: return std::make_shared<OPCode12>(addr,dat_content,this); case 0x13: return std::make_shared<OPCode13>(addr,dat_content,this); case 0x14: return std::make_shared<OPCode14>(addr,dat_content,this); case 0x15: return std::make_shared<OPCode15>(addr,dat_content,this); case 0x16: return std::make_shared<OPCode16>(addr,dat_content,this); case 0x17: return std::make_shared<OPCode17>(addr,dat_content,this); case 0x18: return std::make_shared<OPCode18>(addr,dat_content,this); case 0x19: return std::make_shared<OPCode19>(addr,dat_content,this); case 0x1A: return std::make_shared<OPCode1A>(addr,dat_content,this); case 0x1B: return std::make_shared<OPCode1B>(addr,dat_content,this); case 0x1C: return std::make_shared<OPCode1C>(addr,dat_content,this); case 0x1D: return std::make_shared<OPCode1D>(addr,dat_content,this); case 0x1E: return std::make_shared<OPCode1E>(addr,dat_content,this); case 0x1F: return std::make_shared<OPCode1F>(addr,dat_content,this); case 0x20: return std::make_shared<OPCode20>(addr,dat_content,this); case 0x21: return std::make_shared<OPCode21>(addr,dat_content,this); case 0x22: return std::make_shared<OPCode22>(addr,dat_content,this); case 0x23: return std::make_shared<OPCode23>(addr,dat_content,this); case 0x24: return std::make_shared<OPCode24>(addr,dat_content,this); case 0x25: return std::make_shared<OPCode25>(addr,dat_content,this); case 0x26: return std::make_shared<OPCode26>(addr,dat_content,this); case 0x27: return std::make_shared<OPCode27>(addr,dat_content,this); case 0x28: return std::make_shared<OPCode28>(addr,dat_content,this); case 0x29: return std::make_shared<OPCode29>(addr,dat_content,this); case 0x2A: return std::make_shared<OPCode2A>(addr,dat_content,this); case 0x2B: return std::make_shared<OPCode2B>(addr,dat_content,this); case 0x2C: return std::make_shared<OPCode2C>(addr,dat_content,this); case 0x2D: return std::make_shared<OPCode2D>(addr,dat_content,this); case 0x2E: return std::make_shared<OPCode2E>(addr,dat_content,this); case 0x2F: return std::make_shared<OPCode2F>(addr,dat_content,this); case 0x30: return std::make_shared<OPCode30>(addr,dat_content,this); case 0x31: return std::make_shared<OPCode31>(addr,dat_content,this); case 0x32: return std::make_shared<OPCode32>(addr,dat_content,this); case 0x33: return std::make_shared<OPCode33>(addr,dat_content,this); case 0x34: return std::make_shared<OPCode34>(addr,dat_content,this); case 0x35: return std::make_shared<OPCode35>(addr,dat_content,this); case 0x36: return std::make_shared<OPCode36>(addr,dat_content,this); case 0x37: return std::make_shared<OPCode37>(addr,dat_content,this); case 0x38: return std::make_shared<OPCode38>(addr,dat_content,this); case 0x39: return std::make_shared<OPCode39>(addr,dat_content,this); case 0x3A: return std::make_shared<OPCode3A>(addr,dat_content,this); case 0x3B: return std::make_shared<OPCode3B>(addr,dat_content,this); case 0x3C: return std::make_shared<OPCode3C>(addr,dat_content,this); case 0x3D: return std::make_shared<OPCode3D>(addr,dat_content,this); case 0x3E: return std::make_shared<OPCode3E>(addr,dat_content,this); case 0x3F: return std::make_shared<OPCode3F>(addr,dat_content,this); case 0x40: return std::make_shared<OPCode40>(addr,dat_content,this); case 0x41: return std::make_shared<OPCode41>(addr,dat_content,this); case 0x42: return std::make_shared<OPCode42>(addr,dat_content,this); case 0x43: return std::make_shared<OPCode43>(addr,dat_content,this); case 0x44: return std::make_shared<OPCode44>(addr,dat_content,this); case 0x45: return std::make_shared<OPCode45>(addr,dat_content,this); case 0x46: return std::make_shared<OPCode46>(addr,dat_content,this); case 0x47: return std::make_shared<OPCode47>(addr,dat_content,this); case 0x48: return std::make_shared<OPCode48>(addr,dat_content,this); case 0x49: return std::make_shared<OPCode49>(addr,dat_content,this); case 0x4A: return std::make_shared<OPCode4A>(addr,dat_content,this); case 0x4B: return std::make_shared<OPCode4B>(addr,dat_content,this); case 0x4C: return std::make_shared<OPCode4C>(addr,dat_content,this); case 0x4D: return std::make_shared<OPCode4D>(addr,dat_content,this); //case 0x4E: return std::make_shared<OPCode4E>(addr,dat_content,this); case 0x4F: return std::make_shared<OPCode4F>(addr,dat_content,this); //case 0x50: return std::make_shared<OPCode50>(addr,dat_content,this); case 0x51: return std::make_shared<OPCode51>(addr,dat_content,this); case 0x52: return std::make_shared<OPCode52>(addr,dat_content,this); case 0x53: return std::make_shared<OPCode53>(addr,dat_content,this); case 0x55: return std::make_shared<OPCode55>(addr,dat_content,this); case 0x56: return std::make_shared<OPCode56>(addr,dat_content,this); case 0x57: return std::make_shared<OPCode57>(addr,dat_content,this); case 0x58: return std::make_shared<OPCode58>(addr,dat_content,this); case 0x59: return std::make_shared<OPCode59>(addr,dat_content,this); case 0x5A: return std::make_shared<OPCode5A>(addr,dat_content,this); case 0x5B: return std::make_shared<OPCode5B>(addr,dat_content,this); case 0x5C: return std::make_shared<OPCode5C>(addr,dat_content,this); case 0x5D: return std::make_shared<OPCode5D>(addr,dat_content,this); case 0x5E: return std::make_shared<OPCode5E>(addr,dat_content,this); case 0x5F: return std::make_shared<OPCode5F>(addr,dat_content,this); case 0x60: return std::make_shared<OPCode60>(addr,dat_content,this); case 0x61: return std::make_shared<OPCode61>(addr,dat_content,this); case 0x62: return std::make_shared<OPCode62>(addr,dat_content,this); case 0x63: return std::make_shared<OPCode63>(addr,dat_content,this); case 0x64: return std::make_shared<OPCode64>(addr,dat_content,this); case 0x65: return std::make_shared<OPCode65>(addr,dat_content,this); case 0x66: return std::make_shared<OPCode66>(addr,dat_content,this); case 0x67: return std::make_shared<OPCode67>(addr,dat_content,this); case 0x68: return std::make_shared<OPCode68>(addr,dat_content,this); case 0x69: return std::make_shared<OPCode69>(addr,dat_content,this); case 0x6A: return std::make_shared<OPCode6A>(addr,dat_content,this); case 0x6B: return std::make_shared<OPCode6B>(addr,dat_content,this); case 0x6C: return std::make_shared<OPCode6C>(addr,dat_content,this); case 0x6D: return std::make_shared<OPCode6D>(addr,dat_content,this); case 0x6E: return std::make_shared<OPCode6E>(addr,dat_content,this); case 0x6F: return std::make_shared<OPCode6F>(addr,dat_content,this); case 0x70: return std::make_shared<OPCode70>(addr,dat_content,this); case 0x71: return std::make_shared<OPCode71>(addr,dat_content,this); case 0x72: return std::make_shared<OPCode72>(addr,dat_content,this); case 0x73: return std::make_shared<OPCode73>(addr,dat_content,this); case 0x74: return std::make_shared<OPCode74>(addr,dat_content,this); case 0x77: return std::make_shared<OPCode77>(addr,dat_content,this); case 0x78: return std::make_shared<OPCode78>(addr,dat_content,this); case 0x79: return std::make_shared<OPCode79>(addr,dat_content,this); case 0x7A: return std::make_shared<OPCode7A>(addr,dat_content,this); case 0x7B: return std::make_shared<OPCode7B>(addr,dat_content,this); case 0x7D: return std::make_shared<OPCode7D>(addr,dat_content,this); case 0x7E: return std::make_shared<OPCode7E>(addr,dat_content,this); case 0x7F: return std::make_shared<OPCode7F>(addr,dat_content,this); case 0x80: return std::make_shared<OPCode80>(addr,dat_content,this); case 0x81: return std::make_shared<OPCode81>(addr,dat_content,this); case 0x82: return std::make_shared<OPCode82>(addr,dat_content,this); case 0x83: return std::make_shared<OPCode83>(addr,dat_content,this); case 0x84: return std::make_shared<OPCode84>(addr,dat_content,this); case 0x85: return std::make_shared<OPCode85>(addr,dat_content,this); case 0x86: return std::make_shared<OPCode86>(addr,dat_content,this); case 0x87: return std::make_shared<OPCode87>(addr,dat_content,this); case 0x88: return std::make_shared<OPCode88>(addr,dat_content,this); case 0x89: return std::make_shared<OPCode89>(addr,dat_content,this); case 0x8A: return std::make_shared<OPCode8A>(addr,dat_content,this); case 0x8B: return std::make_shared<OPCode8B>(addr,dat_content,this); case 0x8C: return std::make_shared<OPCode8C>(addr,dat_content,this); case 0x8D: return std::make_shared<OPCode8D>(addr,dat_content,this); case 0x8E: return std::make_shared<OPCode8E>(addr,dat_content,this); case 0x90: return std::make_shared<OPCode90>(addr,dat_content,this); case 0x91: return std::make_shared<OPCode91>(addr,dat_content,this); case 0x92: return std::make_shared<OPCode92>(addr,dat_content,this); case 0x93: return std::make_shared<OPCode93>(addr,dat_content,this); case 0x94: return std::make_shared<OPCode94>(addr,dat_content,this); case 0x95: return std::make_shared<OPCode95>(addr,dat_content,this); case 0x96: return std::make_shared<OPCode96>(addr,dat_content,this); case 0x97: return std::make_shared<OPCode97>(addr,dat_content,this); case 0x98: return std::make_shared<OPCode98>(addr,dat_content,this); case 0x99: return std::make_shared<OPCode99>(addr,dat_content,this); case 0x9A: return std::make_shared<OPCode9A>(addr,dat_content,this); case 0x9B: return std::make_shared<OPCode9B>(addr,dat_content,this); case 0x9D: return std::make_shared<OPCode9D>(addr,dat_content,this); case 0x9E: return std::make_shared<OPCode9E>(addr,dat_content,this); case 0x9F: return std::make_shared<OPCode9F>(addr,dat_content,this); default: std::stringstream stream; stream << "L'OP code " << std::hex << OP << " n'est pas défini !! " << addr; error = true; /*std::string result( stream.str() ); qFatal(result.c_str());*/ return std::shared_ptr<Instruction>(); } } else if (function_type==1){//the function is a "CreateMonsters" function return std::make_shared<CreateMonsters>(addr,dat_content,this); } else if (function_type==2){//the function is a "effect" function return std::make_shared<EffectsInstr>(addr,dat_content,this); } else if (function_type==3){ return std::make_shared<ActionTable>(addr,dat_content,this); } else if (function_type==4){ return std::make_shared<AlgoTable>(addr,dat_content,this); } else if (function_type==5){ return std::make_shared<WeaponAttTable>(addr,dat_content,this); } else if (function_type==6){ return std::make_shared<BreakTable>(addr,dat_content,this); } else if (function_type==7){ return std::make_shared<SummonTable>(addr,dat_content,this); } else if (function_type==8){ return std::make_shared<ReactionTable>(addr,dat_content,this); } else if (function_type==9){ return std::make_shared<PartTable>(addr,dat_content,this); } else if (function_type==10){ return std::make_shared<AnimeClipTable>(addr,dat_content,this); } else if (function_type==11){ return std::make_shared<FieldMonsterData>(addr,dat_content,this); } else if (function_type==12){ return std::make_shared<FieldFollowData>(addr,dat_content,this); } else if (function_type==13){ return std::make_shared<FC_autoX>(addr,dat_content,this); } else if (function_type==14){ return std::make_shared<BookData99>(addr,dat_content,this); } else if (function_type==15){ return std::make_shared<BookDataX>(addr,dat_content,this); } else if (function_type==16){ return std::make_shared<AddCollision>(addr,dat_content,this); } } bool CreateHeaderFromDAT(QByteArray &dat_content){ //Header structure: //The first 0x20 is something used to check if the file is a valid file: it will always be that value //The second 0x20 is the offset for the file name (shouldn't change too) //The next integer is the position of the first pointer //The 4th: probably the length in bytes of the pointer section //The fifth: probably the position of the "names positions" section (right after the pointer section) //The sixth: the number of functions inside the file //the seventh: the position one byte after the 0x00 separator at the end of the functions section //the eighth: 0xABCDEF00 => seems to always be there (no idea why) //Then the name of the file //Then the pointer section //Then the "names positions" section //Then the functions section //Done; here the "function" objects holds the number of functions, the addr, name positions //everything else can be deduced to recreate the header display_text("Reading header..."); uint nb_functions = ReadIntegerFromByteArray(0x14, dat_content); uint position_filename = ReadIntegerFromByteArray(0x4, dat_content); //should be 0x20, not always the case though (t0600 I SEE YOU) int position = position_filename, next_position = 0; QString filename = ReadStringFromByteArray(position, dat_content); SceneName = filename; int start_offset_area = ReadIntegerFromByteArray(0x8, dat_content); for (int idx_fun = 0; idx_fun < nb_functions; idx_fun++){ position = start_offset_area + 4*idx_fun; next_position = start_offset_area + 4*(idx_fun+1); int addr = ReadIntegerFromByteArray(position, dat_content); position = start_offset_area + 4*nb_functions + 2 * idx_fun; short name_pos = ReadShortFromByteArray(position, dat_content); int name_pos_int = name_pos; QString function_name = ReadStringFromByteArray(name_pos_int, dat_content); int end_addr; if (idx_fun == nb_functions-1) //we are at the last function, so it ends at the end of the file end_addr = dat_content.size(); else { end_addr = ReadIntegerFromByteArray(next_position, dat_content); } FunctionsToParse.push_back(function(idx_fun,function_name,name_pos,addr,end_addr)); } display_text("Header parsed."); return true; } std::shared_ptr<Instruction> CreateInstructionFromXLSX(int &addr, int row, QXlsx::Document &xls_content){ uint OP = xls_content.read(row+1, 2).toInt(); int i = CS1UIFiles.indexOf(SceneName); if ((i != -1)&&(OP == 0x13)) return std::make_shared<UI_OP13>(addr,row, xls_content,this); switch(OP){ case 0x00: return std::make_shared<OPCode0>(addr,row, xls_content,this); case 0x01: return std::make_shared<OPCode1>(addr,row, xls_content,this); case 0x02: return std::make_shared<OPCode02>(addr,row, xls_content,this); case 0x03: return std::make_shared<OPCode03>(addr,row, xls_content,this); case 0x04: return std::make_shared<OPCode04>(addr,row, xls_content,this); case 0x05: return std::make_shared<OPCode05>(addr,row, xls_content,this); case 0x06: return std::make_shared<OPCode06>(addr,row, xls_content,this); case 0x07: return std::make_shared<OPCode07>(addr,row, xls_content,this); case 0x08: return std::make_shared<OPCode08>(addr,row, xls_content,this); case 0x0A: return std::make_shared<OPCode0A>(addr,row, xls_content,this); case 0x0C: return std::make_shared<OPCode0C>(addr,row, xls_content,this); case 0x0D: return std::make_shared<OPCode0D>(addr,row, xls_content,this); case 0x0E: return std::make_shared<OPCode0E>(addr,row, xls_content,this); case 0x0F: return std::make_shared<OPCode0F>(addr,row, xls_content,this); case 0x10: return std::make_shared<OPCode10>(addr,row, xls_content,this); case 0x11: return std::make_shared<OPCode11>(addr,row, xls_content,this); case 0x12: return std::make_shared<OPCode12>(addr,row, xls_content,this); case 0x13: return std::make_shared<OPCode13>(addr,row, xls_content,this); case 0x14: return std::make_shared<OPCode14>(addr,row, xls_content,this); case 0x15: return std::make_shared<OPCode15>(addr,row, xls_content,this); case 0x16: return std::make_shared<OPCode16>(addr,row, xls_content,this); case 0x17: return std::make_shared<OPCode17>(addr,row, xls_content,this); case 0x18: return std::make_shared<OPCode18>(addr,row, xls_content,this); case 0x19: return std::make_shared<OPCode19>(addr,row, xls_content,this); case 0x1A: return std::make_shared<OPCode1A>(addr,row, xls_content,this); case 0x1B: return std::make_shared<OPCode1B>(addr,row, xls_content,this); case 0x1C: return std::make_shared<OPCode1C>(addr,row, xls_content,this); case 0x1D: return std::make_shared<OPCode1D>(addr,row, xls_content,this); case 0x1E: return std::make_shared<OPCode1E>(addr,row, xls_content,this); case 0x1F: return std::make_shared<OPCode1F>(addr,row, xls_content,this); case 0x20: return std::make_shared<OPCode20>(addr,row, xls_content,this); case 0x21: return std::make_shared<OPCode21>(addr,row, xls_content,this); case 0x22: return std::make_shared<OPCode22>(addr,row, xls_content,this); case 0x23: return std::make_shared<OPCode23>(addr,row, xls_content,this); case 0x24: return std::make_shared<OPCode24>(addr,row, xls_content,this); case 0x25: return std::make_shared<OPCode25>(addr,row, xls_content,this); case 0x26: return std::make_shared<OPCode26>(addr,row, xls_content,this); case 0x27: return std::make_shared<OPCode27>(addr,row, xls_content,this); case 0x28: return std::make_shared<OPCode28>(addr,row, xls_content,this); case 0x29: return std::make_shared<OPCode29>(addr,row, xls_content,this); case 0x2A: return std::make_shared<OPCode2A>(addr,row, xls_content,this); case 0x2B: return std::make_shared<OPCode2B>(addr,row, xls_content,this); case 0x2C: return std::make_shared<OPCode2C>(addr,row, xls_content,this); case 0x2D: return std::make_shared<OPCode2D>(addr,row, xls_content,this); case 0x2E: return std::make_shared<OPCode2E>(addr,row, xls_content,this); case 0x2F: return std::make_shared<OPCode2F>(addr,row, xls_content,this); case 0x30: return std::make_shared<OPCode30>(addr,row, xls_content,this); case 0x31: return std::make_shared<OPCode31>(addr,row, xls_content,this); case 0x32: return std::make_shared<OPCode32>(addr,row, xls_content,this); case 0x33: return std::make_shared<OPCode33>(addr,row, xls_content,this); case 0x34: return std::make_shared<OPCode34>(addr,row, xls_content,this); case 0x35: return std::make_shared<OPCode35>(addr,row, xls_content,this); case 0x36: return std::make_shared<OPCode36>(addr,row, xls_content,this); case 0x37: return std::make_shared<OPCode37>(addr,row, xls_content,this); case 0x38: return std::make_shared<OPCode38>(addr,row, xls_content,this); case 0x39: return std::make_shared<OPCode39>(addr,row, xls_content,this); case 0x3A: return std::make_shared<OPCode3A>(addr,row, xls_content,this); case 0x3B: return std::make_shared<OPCode3B>(addr,row, xls_content,this); case 0x3C: return std::make_shared<OPCode3C>(addr,row, xls_content,this); case 0x3D: return std::make_shared<OPCode3D>(addr,row, xls_content,this); case 0x3E: return std::make_shared<OPCode3E>(addr,row, xls_content,this); case 0x3F: return std::make_shared<OPCode3F>(addr,row, xls_content,this); case 0x40: return std::make_shared<OPCode40>(addr,row, xls_content,this); case 0x41: return std::make_shared<OPCode41>(addr,row, xls_content,this); case 0x42: return std::make_shared<OPCode42>(addr,row, xls_content,this); case 0x43: return std::make_shared<OPCode43>(addr,row, xls_content,this); case 0x44: return std::make_shared<OPCode44>(addr,row, xls_content,this); case 0x45: return std::make_shared<OPCode45>(addr,row, xls_content,this); case 0x46: return std::make_shared<OPCode46>(addr,row, xls_content,this); case 0x47: return std::make_shared<OPCode47>(addr,row, xls_content,this); case 0x48: return std::make_shared<OPCode48>(addr,row, xls_content,this); case 0x49: return std::make_shared<OPCode49>(addr,row, xls_content,this); case 0x4A: return std::make_shared<OPCode4A>(addr,row, xls_content,this); case 0x4B: return std::make_shared<OPCode4B>(addr,row, xls_content,this); case 0x4C: return std::make_shared<OPCode4C>(addr,row, xls_content,this); case 0x4D: return std::make_shared<OPCode4D>(addr,row, xls_content,this); //case 0x4E: return std::make_shared<OPCode4E>(addr,row, xls_content,this); case 0x4F: return std::make_shared<OPCode4F>(addr,row, xls_content,this); //case 0x50: return std::make_shared<OPCode50>(addr,row, xls_content,this); case 0x51: return std::make_shared<OPCode51>(addr,row, xls_content,this); case 0x52: return std::make_shared<OPCode52>(addr,row, xls_content,this); case 0x53: return std::make_shared<OPCode53>(addr,row, xls_content,this); case 0x55: return std::make_shared<OPCode55>(addr,row, xls_content,this); case 0x56: return std::make_shared<OPCode56>(addr,row, xls_content,this); case 0x57: return std::make_shared<OPCode57>(addr,row, xls_content,this); case 0x58: return std::make_shared<OPCode58>(addr,row, xls_content,this); case 0x59: return std::make_shared<OPCode59>(addr,row, xls_content,this); case 0x5A: return std::make_shared<OPCode5A>(addr,row, xls_content,this); case 0x5B: return std::make_shared<OPCode5B>(addr,row, xls_content,this); case 0x5C: return std::make_shared<OPCode5C>(addr,row, xls_content,this); case 0x5D: return std::make_shared<OPCode5D>(addr,row, xls_content,this); case 0x5E: return std::make_shared<OPCode5E>(addr,row, xls_content,this); case 0x5F: return std::make_shared<OPCode5F>(addr,row, xls_content,this); case 0x60: return std::make_shared<OPCode60>(addr,row, xls_content,this); case 0x61: return std::make_shared<OPCode61>(addr,row, xls_content,this); case 0x62: return std::make_shared<OPCode62>(addr,row, xls_content,this); case 0x63: return std::make_shared<OPCode63>(addr,row, xls_content,this); case 0x64: return std::make_shared<OPCode64>(addr,row, xls_content,this); case 0x65: return std::make_shared<OPCode65>(addr,row, xls_content,this); case 0x66: return std::make_shared<OPCode66>(addr,row, xls_content,this); case 0x67: return std::make_shared<OPCode67>(addr,row, xls_content,this); case 0x68: return std::make_shared<OPCode68>(addr,row, xls_content,this); case 0x69: return std::make_shared<OPCode69>(addr,row, xls_content,this); case 0x6A: return std::make_shared<OPCode6A>(addr,row, xls_content,this); case 0x6B: return std::make_shared<OPCode6B>(addr,row, xls_content,this); case 0x6C: return std::make_shared<OPCode6C>(addr,row, xls_content,this); case 0x6D: return std::make_shared<OPCode6D>(addr,row, xls_content,this); case 0x6E: return std::make_shared<OPCode6E>(addr,row, xls_content,this); case 0x6F: return std::make_shared<OPCode6F>(addr,row, xls_content,this); case 0x70: return std::make_shared<OPCode70>(addr,row, xls_content,this); case 0x71: return std::make_shared<OPCode71>(addr,row, xls_content,this); case 0x72: return std::make_shared<OPCode72>(addr,row, xls_content,this); case 0x73: return std::make_shared<OPCode73>(addr,row, xls_content,this); case 0x74: return std::make_shared<OPCode74>(addr,row, xls_content,this); case 0x77: return std::make_shared<OPCode77>(addr,row, xls_content,this); case 0x78: return std::make_shared<OPCode78>(addr,row, xls_content,this); case 0x79: return std::make_shared<OPCode79>(addr,row, xls_content,this); case 0x7A: return std::make_shared<OPCode7A>(addr,row, xls_content,this); case 0x7B: return std::make_shared<OPCode7B>(addr,row, xls_content,this); case 0x7D: return std::make_shared<OPCode7D>(addr,row, xls_content,this); case 0x7E: return std::make_shared<OPCode7E>(addr,row, xls_content,this); case 0x7F: return std::make_shared<OPCode7F>(addr,row, xls_content,this); case 0x80: return std::make_shared<OPCode80>(addr,row, xls_content,this); case 0x81: return std::make_shared<OPCode81>(addr,row, xls_content,this); case 0x82: return std::make_shared<OPCode82>(addr,row, xls_content,this); case 0x83: return std::make_shared<OPCode83>(addr,row, xls_content,this); case 0x84: return std::make_shared<OPCode84>(addr,row, xls_content,this); case 0x85: return std::make_shared<OPCode85>(addr,row, xls_content,this); case 0x86: return std::make_shared<OPCode86>(addr,row, xls_content,this); case 0x87: return std::make_shared<OPCode87>(addr,row, xls_content,this); case 0x88: return std::make_shared<OPCode88>(addr,row, xls_content,this); case 0x89: return std::make_shared<OPCode89>(addr,row, xls_content,this); case 0x8A: return std::make_shared<OPCode8A>(addr,row, xls_content,this); case 0x8B: return std::make_shared<OPCode8B>(addr,row, xls_content,this); case 0x8C: return std::make_shared<OPCode8C>(addr,row, xls_content,this); case 0x8D: return std::make_shared<OPCode8D>(addr,row, xls_content,this); case 0x8E: return std::make_shared<OPCode8E>(addr,row, xls_content,this); case 0x90: return std::make_shared<OPCode90>(addr,row, xls_content,this); case 0x91: return std::make_shared<OPCode91>(addr,row, xls_content,this); case 0x92: return std::make_shared<OPCode92>(addr,row, xls_content,this); case 0x93: return std::make_shared<OPCode93>(addr,row, xls_content,this); case 0x94: return std::make_shared<OPCode94>(addr,row, xls_content,this); case 0x95: return std::make_shared<OPCode95>(addr,row, xls_content,this); case 0x96: return std::make_shared<OPCode96>(addr,row, xls_content,this); case 0x97: return std::make_shared<OPCode97>(addr,row, xls_content,this); case 0x98: return std::make_shared<OPCode98>(addr,row, xls_content,this); case 0x99: return std::make_shared<OPCode99>(addr,row, xls_content,this); case 0x9A: return std::make_shared<OPCode9A>(addr,row, xls_content,this); case 0x9B: return std::make_shared<OPCode9B>(addr,row, xls_content,this); case 0x9D: return std::make_shared<OPCode9D>(addr,row, xls_content,this); case 0x9E: return std::make_shared<OPCode9E>(addr,row, xls_content,this); case 0x9F: return std::make_shared<OPCode9F>(addr,row, xls_content,this); case 256: return std::make_shared<CreateMonsters>(addr, row, xls_content,this); case 257: return std::make_shared<EffectsInstr>(addr, row, xls_content,this); case 258: return std::make_shared<ActionTable>(addr, row, xls_content,this); case 259: return std::make_shared<AlgoTable>(addr, row, xls_content,this); case 260: return std::make_shared<WeaponAttTable>(addr, row, xls_content,this); case 261: return std::make_shared<BreakTable>(addr, row, xls_content,this); case 262: return std::make_shared<SummonTable>(addr, row, xls_content,this); case 263: return std::make_shared<ReactionTable>(addr, row, xls_content,this); case 264: return std::make_shared<PartTable>(addr, row, xls_content,this); case 265: return std::make_shared<AnimeClipTable>(addr, row, xls_content,this); case 266: return std::make_shared<FieldMonsterData>(addr, row, xls_content,this); case 267: return std::make_shared<FieldFollowData>(addr, row, xls_content,this); case 268: return std::make_shared<FC_autoX>(addr, row, xls_content,this); case 269: return std::make_shared<BookData99>(addr, row, xls_content,this); case 270: return std::make_shared<BookDataX>(addr, row, xls_content,this); case 271: return std::make_shared<AddCollision>(addr, row, xls_content,this); default: std::stringstream stream; stream << "L'OP code " << std::hex << OP << " n'est pas défini !! " << this->SceneName.toStdString(); error = true; addr++; /*std::string result( stream.str() ); qFatal(result.c_str());*/ return std::shared_ptr<Instruction>(); } } QByteArray CreateHeaderBytes(){ QByteArray header; QByteArray scene_name_bytes = SceneName.toUtf8(); scene_name_bytes.append('\x0'); int size_of_scene_name = scene_name_bytes.length(); header.append(GetBytesFromInt(0x20)); header.append(GetBytesFromInt(0x20)); header.append(GetBytesFromInt(0x20+size_of_scene_name)); header.append(GetBytesFromInt(FunctionsParsed.size()*4)); header.append(GetBytesFromInt(0x20+size_of_scene_name + FunctionsParsed.size()*4)); header.append(GetBytesFromInt(FunctionsParsed.size())); int length_of_names_section = 0; for (int idx_fun = 0; idx_fun<FunctionsParsed.size(); idx_fun++) length_of_names_section = length_of_names_section + FunctionsParsed[idx_fun].name.toUtf8().length() + 1; header.append(GetBytesFromInt(0x20+size_of_scene_name + FunctionsParsed.size()*4 + FunctionsParsed.size()*2 + length_of_names_section)); header.append(GetBytesFromInt(0xABCDEF00)); header.append(scene_name_bytes); if (FunctionsParsed.size()>0){ QByteArray position_names; QByteArray actual_names; int offset_names = 0; for (int idx_fun = 0; idx_fun<FunctionsParsed.size(); idx_fun++) { header.append(GetBytesFromInt(FunctionsParsed[idx_fun].actual_addr)); QByteArray name = FunctionsParsed[idx_fun].name.toUtf8(); name.append('\x0'); position_names.append(GetBytesFromShort(0x20+size_of_scene_name + FunctionsParsed.size()*4 + FunctionsParsed.size()*2 + offset_names)); actual_names.append(name); offset_names = offset_names + name.size(); } header.append(position_names); header.append(actual_names); int multiple = 4; if (FunctionsParsed[0].name.startsWith("_")) multiple = 0x10; int nb_byte_to_add = (((int) ceil((float)header.size()/multiple)))*multiple - header.size(); QByteArray remaining; for (int i = 0; i < nb_byte_to_add;i++) { remaining.push_back('\x0'); } header.append(remaining); } return header; } }; #endif // CS1INSTRUCTIONSSET_H
[ "feitaishi45@gmail.com" ]
feitaishi45@gmail.com
1470526ab9886a540187b7fac7d4f25eab79cf2d
5e13af8bf82ca1271ac7e87c9d32151cc5bedbac
/others/DOMO-Core[PoW] OLD VERSION/src/qt/walletframe.h
43b249d60348cf4239c900f26027b2626c6c7d51
[ "MIT" ]
permissive
Utopianer/DOMO-Project
4c3aecc93806743c5165a6ee56b3a5d4bf750b8e
98a90801c91ab2455fe41c969d604e785c930777
refs/heads/master
2022-06-22T02:50:55.164677
2022-06-20T12:03:47
2022-06-20T12:03:47
145,428,530
0
3
null
2018-11-25T21:06:47
2018-08-20T14:27:46
C++
UTF-8
C++
false
false
2,351
h
// Copyright (c) 2011-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_WALLETFRAME_H #define BITCOIN_QT_WALLETFRAME_H #include <QFrame> #include <QMap> class BitcoinGUI; class ClientModel; class SendCoinsRecipient; class WalletModel; class WalletView; QT_BEGIN_NAMESPACE class QStackedWidget; QT_END_NAMESPACE class WalletFrame : public QFrame { Q_OBJECT public: explicit WalletFrame(BitcoinGUI *_gui = 0); ~WalletFrame(); void setClientModel(ClientModel *clientModel); bool addWallet(const QString& name, WalletModel *walletModel); bool setCurrentWallet(const QString& name); bool removeWallet(const QString &name); void removeAllWallets(); bool handlePaymentRequest(const SendCoinsRecipient& recipient); void showOutOfSyncWarning(bool fShow); private: QStackedWidget *walletStack; BitcoinGUI *gui; ClientModel *clientModel; QMap<QString, WalletView*> mapWalletViews; bool bOutOfSync; WalletView *currentWalletView(); public slots: /** Switch to overview (home) page */ void gotoOverviewPage(); /** Switch to history (transactions) page */ void gotoHistoryPage(); /** Switch to receive coins page */ void gotoReceiveCoinsPage(); /** Switch to send coins page */ void gotoSendCoinsPage(QString addr = ""); /** Switch to masternode page */ void gotoMasternodePage(); /** Show Sign/Verify Message dialog and switch to sign message tab */ void gotoSignMessageTab(QString addr = ""); /** Show Sign/Verify Message dialog and switch to verify message tab */ void gotoVerifyMessageTab(QString addr = ""); /** Encrypt the wallet */ void encryptWallet(bool status); /** Backup the wallet */ void backupWallet(); /** Change encrypted wallet passphrase */ void changePassphrase(); /** Ask for passphrase to unlock wallet temporarily */ void unlockWallet(); /** Lock wallet */ void lockWallet(); /** Toggle Wallet Lock State */ void toggleLockWallet(); /** Show used sending addresses */ void usedSendingAddresses(); /** Show used receiving addresses */ void usedReceivingAddresses(); }; #endif // BITCOIN_QT_WALLETFRAME_H
[ "alonewolf2ksk@gmail.com" ]
alonewolf2ksk@gmail.com
25472cbf029e6e8c2d9fcb41ae841ce8986e816d
4c0eeca84e892a01362b740e89468d161e5c4d27
/TestUtils.h
d33e7df6c1b33b335dddb5a0d8bf70048d82a9d2
[]
no_license
lborrero/swapStrat
d6882b6f66fbe685ec4a39009af2df449f3e966f
beb76730af2ddee7fbb8cc6f92b48878e3ab9365
refs/heads/master
2021-01-23T16:30:55.366824
2013-09-28T08:17:18
2013-09-28T08:17:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
289
h
/* * TestUtils.h * swapStratCpp * * Created by Leonardo Borrero Luz on 13-09-27. * Copyright 2013 __MyCompanyName__. All rights reserved. * */ class TestUtils { public: static int returningint2(){ return 10; } static int returningint(){ return returningint2(); } };
[ "leonardo_borrero_luz@live.com" ]
leonardo_borrero_luz@live.com
791fab5136a4287df964cfa1e2e1bc1a6342f698
e6f347aee11626d2ed01102ed4feabf98506fe42
/include/StringCompressor.h
14477042b5719bfc6b5238a44b1d3f73a61c6352
[ "BSD-2-Clause", "BSD-3-Clause" ]
permissive
zhiyuanjia/RakNet
81c33985747ba87be1ade23d70eb971c0e88a62f
4453eeb64f344d358901001b16d6e7cc41814ace
refs/heads/master
2020-03-12T19:20:33.926902
2018-03-24T00:25:25
2018-03-24T00:25:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,809
h
/* * Copyright (c) 2014, Oculus VR, Inc. * 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. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ /// \file /// \brief \b Compresses/Decompresses ASCII strings and writes/reads them to /// BitStream class instances. You can use this to easily serialize and /// deserialize your own strings. /// #ifndef __STRING_COMPRESSOR_H #define __STRING_COMPRESSOR_H #include "DS_Map.h" #include "Export.h" #include "NativeTypes.h" #include "RakMemoryOverride.h" #ifdef _STD_STRING_COMPRESSOR #include <string> #endif /// Forward declaration namespace RakNet { class BitStream; class RakString; }; // namespace RakNet namespace RakNet { /// Forward declarations class HuffmanEncodingTree; /// \brief Writes and reads strings to and from bitstreams. /// /// Only works with ASCII strings. The default compression is for English. /// You can call GenerateTreeFromStrings to compress and decompress other /// languages efficiently as well. class RAK_DLL_EXPORT StringCompressor { public: // Destructor ~StringCompressor(); /// static function because only static functions can access static members /// The RakPeer constructor adds a reference to this class, so don't call this /// until an instance of RakPeer exists, or unless you call AddReference /// yourself. \return the unique instance of the StringCompressor static StringCompressor *Instance(void); /// Given an array of strings, such as a chat log, generate the optimal /// encoding tree for it. This function is optional and if it is not called a /// default tree will be used instead. \param[in] input An array of bytes /// which should point to text. \param[in] inputLength Length of \a input /// \param[in] languageID An identifier for the language / string table to /// generate the tree for. English is automatically created with ID 0 in the /// constructor. void GenerateTreeFromStrings(unsigned char *input, unsigned inputLength, uint8_t languageId); /// Writes input to output, compressed. Takes care of the null terminator for /// you. \param[in] input Pointer to an ASCII string \param[in] /// maxCharsToWrite The max number of bytes to write of \a input. Use 0 to /// mean no limit. \param[out] output The bitstream to write the compressed /// string to \param[in] languageID Which language to use void EncodeString(const char *input, int maxCharsToWrite, RakNet::BitStream *output, uint8_t languageId = 0); /// Writes input to output, uncompressed. Takes care of the null terminator /// for you. \param[out] output A block of bytes to receive the output /// \param[in] maxCharsToWrite Size, in bytes, of \a output . A NULL /// terminator will always be appended to the output string. If the /// maxCharsToWrite is not large enough, the string will be truncated. /// \param[in] input The bitstream containing the compressed string /// \param[in] languageID Which language to use bool DecodeString(char *output, int maxCharsToWrite, RakNet::BitStream *input, uint8_t languageId = 0); #ifdef _CSTRING_COMPRESSOR void EncodeString(const CString &input, int maxCharsToWrite, RakNet::BitStream *output, uint8_t languageId = 0); bool DecodeString(CString &output, int maxCharsToWrite, RakNet::BitStream *input, uint8_t languageId = 0); #endif #ifdef _STD_STRING_COMPRESSOR void EncodeString(const std::string &input, int maxCharsToWrite, RakNet::BitStream *output, uint8_t languageId = 0); bool DecodeString(std::string *output, int maxCharsToWrite, RakNet::BitStream *input, uint8_t languageId = 0); #endif void EncodeString(const RakNet::RakString *input, int maxCharsToWrite, RakNet::BitStream *output, uint8_t languageId = 0); bool DecodeString(RakNet::RakString *output, int maxCharsToWrite, RakNet::BitStream *input, uint8_t languageId = 0); /// Used so I can allocate and deallocate this singleton at runtime static void AddReference(void); /// Used so I can allocate and deallocate this singleton at runtime static void RemoveReference(void); StringCompressor(); private: /// Singleton instance static StringCompressor *instance; /// Pointer to the huffman encoding trees. DataStructures::Map<int, HuffmanEncodingTree *> huffmanEncodingTrees; static int referenceCount; }; } // namespace RakNet #endif
[ "mhsjlw@users.noreply.github.com" ]
mhsjlw@users.noreply.github.com
bd80559771186c006dde066e6e5cf143382a52a0
bfaf571e0a66c40aaca7e6835a2c4f98f7958fbf
/src/Core/MObjectManager.h
9bf2180e1593c30a334f7c20412479c45624dca4
[ "Apache-2.0" ]
permissive
natangold85/pomdp_solver
b37d610807d74f6499a6464a0c289b8a6934085e
a27be134d9491c43dda0dd0928220f88b6a2241c
refs/heads/master
2020-09-02T19:23:55.318309
2017-11-20T15:34:54
2017-11-20T15:34:54
94,401,488
1
0
null
null
null
null
UTF-8
C++
false
false
1,344
h
#ifndef MObjectManager_H #define MObjectManager_H #include <list> using namespace std; #include "MObjectUser.h" using namespace momdp; namespace momdp { class MObject; template <typename T> class MObjectManager { private: list<MObjectUser<T> *> userList; public: MObjectManager(void) { } virtual ~MObjectManager(void) { } // delete the MObject from everywhere virtual void strongDelete(T *pointer) { for(typename list<MObjectUser<T> *>::iterator iter = userList.begin(); iter != userList.end(); iter ++) { (*iter)->forcedDelete(pointer); } localDelete(pointer); } // one user deleted the MObject, but the MObject may still be used by other users. Only decrease refCount virtual void weakDelete(T *pointer) { // TODO: obsolete this by using smart pointers //pointer->refCount -- ; //if(pointer->refCount == 1) //{ // // only the manager is using it, may do something here... //} //else if(pointer->refCount == 0) //{ // // no one is using it, delete // localDelete(pointer); //} } // this function perform the actual delete, must be instantiated virtual void localDelete(T *pointer) = 0; virtual void registerUser(MObjectUser<T> *pointer) { userList.push_back(pointer); } virtual void removeUser(MObjectUser<T> *pointer) { userList.remove(pointer); } }; } #endif
[ "natangold.85@gmail.com" ]
natangold.85@gmail.com
baed242b30a57bea70de5ace91c2732fb0f61bcc
e40398be3be2387e95db4266fe715c032b851038
/examen1.cpp
7389abb3e7cc3a2afe15134a6922a8de819c38b9
[]
no_license
RickyRom/RIcardoRomero_Examen1
da25b914681e078413138157648053769ee8900a
54109a0d5f5a570a6189c9b42e62f9e080b75111
refs/heads/master
2020-03-26T17:22:20.835031
2018-08-18T02:38:27
2018-08-18T02:38:27
145,157,618
0
0
null
null
null
null
UTF-8
C++
false
false
6,420
cpp
#include <iostream> using namespace std; void Attax(); void imprimirMatriz(char**, int); void liberarMatriz(char**&, int&); void turnoJ1(char**, int, int, int, int, int); void turnoJ2(char**, int, int, int, int, int); int main () { int opcion; do{ cout<<"Bienvenido a Attax"<<endl; cout<<"1.- Jugar Attax"<<endl; cout<<"2.- Salir"<<endl; cin>> opcion; switch(opcion) { case 1: Attax(); break; case 2: cout<<"TENGA BUEN DIA!"<<endl; } }while(opcion != 2); return 0; } void imprimirMatriz(char** matrix, int size) { for(int i = 0; i < size; i++) { for(int j = 0; j < size; j++) { cout<<"["<<matrix[i][j]<<"]"; } cout<<endl; } } void liberarMatriz(char**& matrix, int& size) { if(matrix != NULL) { for(int i = 0; i < size; i++) { delete[] matrix[i]; matrix[i] = NULL; } delete[] matrix; matrix = NULL; size = 0; } } void Attax() { int size = 11; int x, y, x2, y2; bool gameover = false; int opn; char** mainmatrix = new char*[size]; for(int i = 0; i < size; i++) { mainmatrix[i] = new char[size]; } for(int i = 0; i < size; i++) { for(int j = 0; j < size; j++) { mainmatrix[i][j] = ' '; } } mainmatrix[0][5] = '+'; mainmatrix[10][5] = '+'; mainmatrix[5][0] = '#'; mainmatrix[5][10] = '#'; imprimirMatriz(mainmatrix, size); while(!gameover){ turnoJ1(mainmatrix, size, x, y, x2, y2); turnoJ2(mainmatrix, size, x, y, x2, y2); } liberarMatriz(mainmatrix, size); } void turnoJ1(char** matrix, int size, int x, int y, int x2, int y2) { cout<<"Jugador 1"<<endl; cout<<"Ingrese X: "<<endl; cin>> x; cout<<"Ingrese Y: "<<endl; cin>> y; cout<<"A donde lo quiere mover"<<endl; cout<<"Ingrese X: "<<endl; cin>> x2; cout<<"Ingrese Y: "<<endl; cin>> y2; if(x < 0 || x > 10 || y < 0 || y > 10) { cout<<"Se salio del Rango de la Matriz"<<endl; }else{ if(matrix[x][y] == '+' && (x+1 == x2) || matrix[x][y] == '+' && (x-1 == x2) || matrix[x][y] == '+' && (y+1 == y2) || matrix[x][y] == '+' && (y-1 == y2) || matrix[x][y] == '+' && (x+1 == x2 && y+1 == y2) || matrix[x][y] == '+' && (x+1 == x2 && y-1 == y2) || matrix[x][y] == '+' && (x-1 == x2 && y-1 == y2) || matrix[x][y] == '+' && (x-1 == x2 && y+1 == y2)){ matrix[x2][y2] = '+'; /*if(matrix[x+1][y] == '#') { matrix[x+1][y] = '+'; } if(matrix[x-1][y] == '#') { matrix[x-1][y] = '+'; } if(matrix[x][y+1] == '#') { matrix[x][y+1] = '+'; } if(matrix[x][y-1] == '#') { matrix[x][y-1] = '+'; } if(matrix[x+1][y+1] == '#') { matrix[x+1][y+1] = '+'; } if(matrix[x+1][y-1] == '#') { matrix[x+1][y-1] = '+'; } if(matrix[x-1][y-1] == '#') { matrix[x-1][y-1] = '+'; } if(matrix[x-1][y+1] == '#') { matrix[x-1][y+1] = '+'; }*/ }else{ cout<<"No puede mover pieza"<<endl; } if(matrix[x][y] == '+' && (x+2 == x2) || matrix[x][y] == '+' && (x-2 == x2) || matrix[x][y] == '+' && (y+2 == y2) || matrix[x][y] == '+' && (y-2 == y2) || matrix[x][y] == '+' && (x+2 == x2 && y+2 == y2) || matrix[x][y] == '+' && (x+2 == x2 && y-2 == y2) || matrix[x][y] == '+' && (x-2 == x2 && y-2 == y2) || matrix[x][y] == '+' && (x-2 == x2 && y+2 == y2)){ matrix[x][y] = ' '; matrix[x2][y2] = '+'; /*if(matrix[x+2][y] == '#') { matrix[x+2][y] = '+'; } if(matrix[x-2][y] == '#') { matrix[x-2][y] = '+'; } if(matrix[x][y+2] == '#') { matrix[x][y+2] = '+'; } if(matrix[x][y-2] == '#') { matrix[x][y-2] = '+'; } if(matrix[x+2][y+2] == '#') { matrix[x+2][y+2] = '+'; } if(matrix[x+2][y-2] == '#') { matrix[x+2][y-2] = '+'; } if(matrix[x-2][y-2] == '#') { matrix[x-2][y-2] = '+'; } if(matrix[x-2][y+2] == '#') { matrix[x-2][y+2] = '+'; }*/ }else{ cout<<"No puede mover pieza"<<endl; imprimirMatriz(matrix, size); } } } void turnoJ2(char** matrix, int size, int x, int y, int x2, int y2) { cout<<"Jugador 2"<<endl; cout<<"Ingrese X: "<<endl; cin>> x; cout<<"Ingrese Y: "<<endl; cin>> y; cout<<"A donde lo quiere mover"<<endl; cout<<"Ingrese X: "<<endl; cin>> x2; cout<<"Ingrese Y: "<<endl; cin>> y2; if(x < 0 || x > 10 || y < 0 || y > 10) { cout<<"Se salio del Rango de la Matriz"<<endl; }else{ if(matrix[x][y] == '#' && (x+1 == x2) || matrix[x][y] == '#' && (x-1 == x2) || matrix[x][y] == '#' && (y+1 == y2) || matrix[x][y] == '#' && (y-1 == y2) || matrix[x][y] == '#' && (x+1 == x2 && y+1 == y2) || matrix[x][y] == '#' && (x+1 == x2 && y-1 == y2) || matrix[x][y] == '#' && (x-1 == x2 && y-1 == y2) || matrix[x][y] == '#' && (x-1 == x2 && y+1 == y2)){ matrix[x2][y2] = '#'; if(matrix[x+1][y] == '+') { matrix[x+1][y] = '#'; } if(matrix[x-1][y] == '+') { matrix[x-1][y] = '#'; } if(matrix[x][y+1] == '+') { matrix[x][y+1] = '#'; } if(matrix[x][y-1] == '+') { matrix[x][y-1] = '#'; } if(matrix[x+1][y+1] == '+') { matrix[x+1][y+1] = '#'; } if(matrix[x+1][y-1] == '+') { matrix[x+1][y-1] = '#'; } if(matrix[x-1][y-1] == '+') { matrix[x-1][y-1] = '#'; } if(matrix[x-1][y+1] == '+') { matrix[x-1][y+1] = '#'; } }else{ cout<<"No puede mover pieza"<<endl; } if(matrix[x][y] == '#' && (x+2 == x2) || matrix[x][y] == '#' && (x-2 == x2) || matrix[x][y] == '#' && (y+2 == y2) || matrix[x][y] == '#' && (y-2 == y2) || matrix[x][y] == '#' && (x+2 == x2 && y+2 == y2) || matrix[x][y] == '#' && (x+2 == x2 && y-2 == y2) || matrix[x][y] == '#' && (x-2 == x2 && y-2 == y2) || matrix[x][y] == '#' && (x-2 == x2 && y+2 == y2)){ matrix[x][y] = ' '; matrix[x2][y2] = '#'; if(matrix[x+2][y] == '+') { matrix[x+2][y] = '#'; } if(matrix[x-2][y] == '+') { matrix[x-2][y] = '#'; } if(matrix[x][y+2] == '+') { matrix[x][y+2] = '#'; } if(matrix[x][y-2] == '+') { matrix[x][y-2] = '#'; } if(matrix[x+2][y+2] == '+') { matrix[x+2][y+2] = '#'; } if(matrix[x+2][y-2] == '+') { matrix[x+2][y-2] = '#'; } if(matrix[x-2][y-2] == '+') { matrix[x-2][y-2] = '#'; } if(matrix[x-2][y+2] == '+') { matrix[x-2][y+2] = '#'; } }else{ cout<<"No puede mover pieza"<<endl; imprimirMatriz(matrix, size); } } }
[ "rickyromeros@outlook.com" ]
rickyromeros@outlook.com
acaa5638600f6e31a3476eb69c358c95582b2956
0bf1f7b901118b5cbe3d51bbc5885fcb634419c5
/Cpp/SDK/MovieSceneCapture_structs.h
4ff1f907f752fd40678e252b2b4f49642bf6dd81
[]
no_license
zH4x-SDK/zMCDungeons-SDK
3a90a959e4a72f4007fc749c53b8775b7155f3da
ab9d8f0ab04b215577dd2eb067e65015b5a70521
refs/heads/main
2023-07-15T15:43:17.217894
2021-08-27T13:49:22
2021-08-27T13:49:22
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,924
h
#pragma once // Name: DBZKakarot, Version: 1.0.3 /*!!DEFINE!!*/ /*!!HELPER_DEF!!*/ /*!!HELPER_INC!!*/ #ifdef _MSC_VER #pragma pack(push, 0x01) #endif namespace CG { //--------------------------------------------------------------------------- // Enums //--------------------------------------------------------------------------- // Enum MovieSceneCapture.EHDRCaptureGamut enum class MovieSceneCapture_EHDRCaptureGamut : uint8_t { HCGM_Rec709 = 0, HCGM_P3DCI = 1, HCGM_Rec2020 = 2, HCGM_ACES = 3, HCGM_ACEScg = 4, HCGM_Linear = 5, HCGM_MAX = 6, }; // Enum MovieSceneCapture.EMovieSceneCaptureProtocolState enum class MovieSceneCapture_EMovieSceneCaptureProtocolState : uint8_t { EMovieSceneCaptureProtocolState__Idle = 0, EMovieSceneCaptureProtocolState__Initialized = 1, EMovieSceneCaptureProtocolState__Capturing = 2, EMovieSceneCaptureProtocolState__Finalizing = 3, EMovieSceneCaptureProtocolState__EMovieSceneCaptureProtocolState_MAX = 4, }; //--------------------------------------------------------------------------- // Script Structs //--------------------------------------------------------------------------- // ScriptStruct MovieSceneCapture.CapturedPixels // 0x0000 struct FCapturedPixels { }; // ScriptStruct MovieSceneCapture.CapturedPixelsID // 0x0000 struct FCapturedPixelsID { }; // ScriptStruct MovieSceneCapture.CompositionGraphCapturePasses // 0x0000 struct FCompositionGraphCapturePasses { }; // ScriptStruct MovieSceneCapture.FrameMetrics // 0x0000 struct FFrameMetrics { }; // ScriptStruct MovieSceneCapture.MovieSceneCaptureSettings // 0x0000 struct FMovieSceneCaptureSettings { }; // ScriptStruct MovieSceneCapture.CaptureResolution // 0x0000 struct FCaptureResolution { }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "zp2kshield@gmail.com" ]
zp2kshield@gmail.com
9524989a8cdb7410d63556c21eac0815aa3e54f2
11ef4bbb8086ba3b9678a2037d0c28baaf8c010e
/Source Code/server/binaries/chromium/gen/mojo/public/mojom/base/generic_pending_receiver.mojom.cc
35304f541b6cec90690654bf676d117421a89787
[]
no_license
lineCode/wasmview.github.io
8f845ec6ba8a1ec85272d734efc80d2416a6e15b
eac4c69ea1cf0e9af9da5a500219236470541f9b
refs/heads/master
2020-09-22T21:05:53.766548
2019-08-24T05:34:04
2019-08-24T05:34:04
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,941
cc
// Copyright 2013 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. #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" #elif defined(_MSC_VER) #pragma warning(push) #pragma warning(disable:4056) #pragma warning(disable:4065) #pragma warning(disable:4756) #endif #include "mojo/public/mojom/base/generic_pending_receiver.mojom.h" #include <math.h> #include <stdint.h> #include <utility> #include "base/hash/md5_constexpr.h" #include "base/logging.h" #include "base/run_loop.h" #include "base/task/common/task_annotator.h" #include "mojo/public/cpp/bindings/lib/message_internal.h" #include "mojo/public/cpp/bindings/lib/serialization_util.h" #include "mojo/public/cpp/bindings/lib/unserialized_message_context.h" #include "mojo/public/cpp/bindings/lib/validate_params.h" #include "mojo/public/cpp/bindings/lib/validation_context.h" #include "mojo/public/cpp/bindings/lib/validation_errors.h" #include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h" #include "mojo/public/mojom/base/generic_pending_receiver.mojom-params-data.h" #include "mojo/public/mojom/base/generic_pending_receiver.mojom-shared-message-ids.h" #include "mojo/public/mojom/base/generic_pending_receiver.mojom-import-headers.h" #ifndef MOJO_PUBLIC_MOJOM_BASE_GENERIC_PENDING_RECEIVER_MOJOM_JUMBO_H_ #define MOJO_PUBLIC_MOJOM_BASE_GENERIC_PENDING_RECEIVER_MOJOM_JUMBO_H_ #endif namespace mojo_base { namespace mojom { GenericPendingReceiver::GenericPendingReceiver() : interface_name(), receiving_pipe() {} GenericPendingReceiver::GenericPendingReceiver( const std::string& interface_name_in, mojo::ScopedMessagePipeHandle receiving_pipe_in) : interface_name(std::move(interface_name_in)), receiving_pipe(std::move(receiving_pipe_in)) {} GenericPendingReceiver::~GenericPendingReceiver() = default; bool GenericPendingReceiver::Validate( const void* data, mojo::internal::ValidationContext* validation_context) { return Data_::Validate(data, validation_context); } } // namespace mojom } // namespace mojo_base namespace mojo { // static bool StructTraits<::mojo_base::mojom::GenericPendingReceiver::DataView, ::mojo_base::mojom::GenericPendingReceiverPtr>::Read( ::mojo_base::mojom::GenericPendingReceiver::DataView input, ::mojo_base::mojom::GenericPendingReceiverPtr* output) { bool success = true; ::mojo_base::mojom::GenericPendingReceiverPtr result(::mojo_base::mojom::GenericPendingReceiver::New()); if (!input.ReadInterfaceName(&result->interface_name)) success = false; result->receiving_pipe = input.TakeReceivingPipe(); *output = std::move(result); return success; } } // namespace mojo #if defined(__clang__) #pragma clang diagnostic pop #elif defined(_MSC_VER) #pragma warning(pop) #endif
[ "wasmview@gmail.com" ]
wasmview@gmail.com
be314bdf29b75cf707c93d5ab3af8ba4de4902e0
8aedff863cf1f5ae1a38ab501c2db75f1f0865cd
/src/sf/Reflection.cpp
1233a0c1c57fc528434d97b2270cd5a5928feae2
[]
no_license
oamaok/spear
c75cca5e9273d7c15411474cd3b583db3665fcd0
d8fd35df6493c0bf3c98b21926e9545f4b3a3285
refs/heads/master
2022-12-17T12:05:01.631476
2020-05-29T11:45:20
2020-05-29T11:45:20
267,842,145
0
0
null
2020-05-29T11:34:46
2020-05-29T11:34:46
null
UTF-8
C++
false
false
8,812
cpp
#include "Reflection.h" #include "Vector.h" #include "ext/mx/mx_platform.h" #include "sf/HashMap.h" namespace sf { static_assert(sizeof(Type) + 2*sizeof(void*) <= MaxTypeStructSize, "Type size plus user data is too large"); void Type::init() { } void Type::getName(sf::StringBuf &buf) { buf.append(name); } sf::CString Type::getPolymorphTagName() { return elementType->getPolymorphTagName(); } VoidSlice Type::instGetArray(void *inst) { return { }; } VoidSlice Type::instArrayReserve(void *inst, size_t size) { sf_assert(0 && "Array resize not supported"); return { }; } void Type::instArrayResize(void *inst, size_t size) { } void Type::instSetString(void *inst, sf::String str) { sf_assert(0 && "Set string not supported"); } const PolymorphType *Type::getPolymorphTypeByValue(uint32_t value) { return nullptr; } const PolymorphType *Type::getPolymorphTypeByName(sf::String name) { return nullptr; } void *Type::instGetPointer(void *inst) { return *(void**)inst; } void *Type::instSetPointer(void *inst) { sf_assert(0 && "Set pointer not supported"); return nullptr; } PolymorphInstance Type::instGetPolymorph(void *inst) { return { }; } void *Type::instSetPolymorph(void *inst, Type *type) { sf_assert(0 && "Set polymorph not supported"); return nullptr; } struct TypeEnum::Data { sf::HashMap<sf::CString, uint32_t> stringToValue; sf::HashMap<uint32_t, sf::CString> valueToString; }; TypeEnum::TypeEnum(const char *name, const TypeInfo &info, sf::Slice<const EnumValue> values, uint32_t userFlags) : Type(name, info, IsPod|HasString|HasSetString|userFlags), data(new Data()) { sf_assert(info.size == sizeof(uint32_t)); data->stringToValue.reserve((uint32_t)values.size); data->valueToString.reserve((uint32_t)values.size); for (const EnumValue &val : values) { data->stringToValue.insert(val.name, val.value); data->valueToString.insert(val.value, val.name); } } VoidSlice TypeEnum::instGetArray(void *inst) { uint32_t value = *(uint32_t*)inst; auto it = data->valueToString.find(value); sf_assert(it); return it->val.slice(); } void TypeEnum::instSetString(void *inst, sf::String str) { auto it = data->stringToValue.find(str); sf_assert(it); *(uint32_t*)inst = it->val; } struct TypePolymorphicStructBase::Data { sf::HashMap<uint32_t, sf::CString> valueToName; sf::HashMap<sf::CString, const PolymorphType*> nameToType; sf::HashMap<uint32_t, const PolymorphType*> valueToType; size_t tagOffset; sf::CString tagName; Data(Slice<const PolymorphType> types, size_t tagOffset, const char *tagName) : tagOffset(tagOffset), tagName(tagName) { nameToType.reserve((uint32_t)types.size); valueToType.reserve((uint32_t)types.size); valueToName.reserve((uint32_t)types.size); for (const PolymorphType &t : types) { valueToName.insert(t.value, t.name); nameToType.insert(t.name, &t); valueToType.insert(t.value, &t); } } }; TypePolymorphicStructBase::TypePolymorphicStructBase(const char *name, const TypeInfo &info, Slice<const PolymorphType> types, size_t tagOffset, const char *tagName, uint32_t userFlags) : Type(name, info, PolymorphBase|HasFields|userFlags), data(new Data(types, tagOffset, tagName)) { } sf::CString TypePolymorphicStructBase::getPolymorphTagName() { return data->tagName; } const PolymorphType *TypePolymorphicStructBase::getPolymorphTypeByValue(uint32_t value) { auto it = data->valueToType.find(value); return it ? it->val : nullptr; } const PolymorphType *TypePolymorphicStructBase::getPolymorphTypeByName(sf::String name) { auto it = data->nameToType.find(name); return it ? it->val : nullptr; } PolymorphInstance TypePolymorphicStructBase::instGetPolymorph(void *inst) { uint32_t tag = *(uint32_t*)((char*)inst + data->tagOffset); auto it = data->valueToType.find(tag); return { inst, it ? it->val : nullptr }; } static constexpr const uint32_t PrimitiveFlags = Type::IsPrimitive|Type::IsPod|Type::CompactString; template<> void initType<bool>(Type *t) { new (t) Type("bool", getTypeInfo<bool>(), PrimitiveFlags); t->primitive = Type::Bool; } template<> void initType<char>(Type *t) { new (t) Type("char", getTypeInfo<char>(), PrimitiveFlags); t->primitive = Type::Char; } template<> void initType<int8_t>(Type *t) { new (t) Type("int8_t", getTypeInfo<int8_t>(), PrimitiveFlags); t->primitive = Type::I8; } template<> void initType<int16_t>(Type *t) { new (t) Type("int16_t", getTypeInfo<int16_t>(), PrimitiveFlags); t->primitive = Type::I16; } template<> void initType<int32_t>(Type *t) { new (t) Type("int32_t", getTypeInfo<int32_t>(), PrimitiveFlags); t->primitive = Type::I32; } template<> void initType<int64_t>(Type *t) { new (t) Type("int64_t", getTypeInfo<int64_t>(), PrimitiveFlags); t->primitive = Type::I64; } template<> void initType<uint8_t>(Type *t) { new (t) Type("uint8_t", getTypeInfo<uint8_t>(), PrimitiveFlags); t->primitive = Type::U8; } template<> void initType<uint16_t>(Type *t) { new (t) Type("uint16_t", getTypeInfo<uint16_t>(), PrimitiveFlags); t->primitive = Type::U16; } template<> void initType<uint32_t>(Type *t) { new (t) Type("uint32_t", getTypeInfo<uint32_t>(), PrimitiveFlags); t->primitive = Type::U32; } template<> void initType<uint64_t>(Type *t) { new (t) Type("uint64_t", getTypeInfo<uint64_t>(), PrimitiveFlags); t->primitive = Type::U64; } template<> void initType<float>(Type *t) { new (t) Type("float", getTypeInfo<float>(), PrimitiveFlags); t->primitive = Type::F32; } template<> void initType<double>(Type *t) { new (t) Type("double", getTypeInfo<double>(), PrimitiveFlags); t->primitive = Type::F64; } void writeInstBinary(sf::Array<char> &dst, void *inst, Type *type) { uint32_t flags = type->flags; char *base = (char*)inst; if (flags & Type::IsPod) { dst.push(base, type->info.size); } else if (flags & Type::Polymorph) { sf::PolymorphInstance poly = type->instGetPolymorph(inst); if (poly.type) { uint32_t tagValue = (uint32_t)poly.type->value; dst.push((char*)&tagValue, sizeof(uint32_t)); writeInstBinary(dst, poly.inst, poly.type->type); } else { uint32_t tagValue = ~0u; dst.push((char*)&tagValue, sizeof(uint32_t)); } } else if (flags & Type::HasFields) { for (const Field &field : type->fields) { writeInstBinary(dst, base + field.offset, field.type); } } else if (flags & Type::HasArray) { Type *elem = type->elementType; size_t elemSize = elem->info.size; VoidSlice slice = type->instGetArray(inst); uint32_t size = (uint32_t)slice.size; dst.push((char*)&size, sizeof(uint32_t)); if (elem->flags & Type::IsPod) { dst.push((char*)slice.data, slice.size * elemSize); } else { char *ptr = (char*)slice.data; for (uint32_t i = 0; i < size; i++) { writeInstBinary(dst, ptr, elem); ptr += elemSize; } } } else { // TODO: Serialization callback sf_assert(0 && "Cannot serialize type"); } } bool readInstBinary(sf::Slice<char> &src, void *inst, Type *type) { uint32_t flags = type->flags; char *base = (char*)inst; if (flags & Type::IsPod) { if (src.size < type->info.size) return false; memcpy(inst, src.data, type->info.size); src = src.drop(type->info.size); } else if (flags & Type::Polymorph) { uint32_t tagValue; if (src.size < sizeof(uint32_t)) return false; memcpy(&tagValue, src.data, sizeof(uint32_t)); src = src.drop(sizeof(uint32_t)); const PolymorphType *polyType = type->elementType->getPolymorphTypeByValue(tagValue); void *ptr = type->instSetPolymorph(inst, polyType->type); return readInstBinary(src, ptr, polyType->type); } else if (flags & Type::HasFields) { for (const Field &field : type->fields) { if (!readInstBinary(src, base + field.offset, field.type)) return false; } } else if (flags & Type::HasArrayResize) { Type *elem = type->elementType; size_t elemSize = elem->info.size; uint32_t size; if (src.size < sizeof(uint32_t)) return false; memcpy(&size, src.data, sizeof(uint32_t)); src = src.drop(sizeof(uint32_t)); VoidSlice slice = type->instArrayReserve(inst, size); if (elem->flags & Type::IsPod) { size_t copySize = slice.size * elemSize; if (src.size < copySize) return false; memcpy(slice.data, src.data, copySize); src = src.drop(copySize); } else { char *ptr = (char*)slice.data; for (uint32_t i = 0; i < size; i++) { if (!readInstBinary(src, ptr, elem)) return false; ptr += elemSize; } } type->instArrayResize(inst, size); } else if (flags & Type::HasSetString) { uint32_t size; if (src.size < sizeof(uint32_t)) return false; memcpy(&size, src.data, sizeof(uint32_t)); src = src.drop(sizeof(uint32_t)); if (src.size < size) return false; type->instSetString(inst, src.take(size)); src = src.drop(size); } else { // TODO: Serialization callback sf_assert(0 && "Cannot serialize type"); } return true; } }
[ "samuli.1995@hotmail.com" ]
samuli.1995@hotmail.com
3647d69e1b4624465b78c489cbfba8e789d6fe05
34df1ced8810404885f7e6bf2888e4a6dd1f43fb
/uno_test/uno_test.ino
2f1c02c738d5dc627097c66405dbbdffdc165138
[]
no_license
SergeyGirin/myArduino
8e977f76d6257907d22c8e2db2ea47cb493c1b89
5a979de53dcae06e6bbd0be538462f6c207e7e74
refs/heads/master
2021-01-19T12:25:55.080243
2017-05-29T11:32:49
2017-05-29T11:32:49
82,330,534
0
0
null
null
null
null
UTF-8
C++
false
false
1,535
ino
const int LED_PIN = 13; const int PWM_IN_PIN = 7; long TIME = millis(); long TIME_OLD = millis(); //#include <Servo.h> int STBY = 4; //standby //Motor A //int PWMA = 9; //Speed control int AIN1 = 5; //Direction int AIN2 = 6; //Direction int PWMA = 9; //Speed control //Servo myservo; // create servo object to control a servo int potpin = 0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin void setup() { pinMode(LED_PIN, OUTPUT); pinMode(PWM_IN_PIN, INPUT); Serial.begin(115200); // myservo.attach(9); // attaches the servo on pin 9 to the servo object // myservo.write(100); pinMode(PWMA, OUTPUT); pinMode(STBY, OUTPUT); pinMode(AIN1, OUTPUT); pinMode(AIN2, OUTPUT); digitalWrite(STBY, 1); //disable standby digitalWrite(AIN1, 1); digitalWrite(AIN2, 0); } void loop() { TIME = millis(); if (TIME%1000==0 and TIME!=TIME_OLD) { digitalWrite(LED_PIN, !digitalRead(LED_PIN)); Serial.print(TIME/1000); TIME_OLD = TIME; int gradus = random(250); // myservo.write(gradus); gradus = 100; digitalWrite(AIN1, !digitalRead(AIN1)); digitalWrite(AIN2, !digitalRead(AIN2)); int puls = pulseIn(PWM_IN_PIN, HIGH); Serial.print("\tPWM ("); Serial.print(gradus); Serial.print(") = "); Serial.print(puls); Serial.print(" ("); Serial.print(map(puls,525,2375,0,180)); Serial.print(")"); Serial.print(" "); Serial.println(analogRead(0)); analogWrite(PWMA, gradus); } }
[ "girin863@yandex.ru" ]
girin863@yandex.ru
52c0c321fd6c8730c541513f9cf8cbbac6c620e3
e30131d9939b3eaacc79e6b41c9e1b172da4a8a4
/proxy/include/proxy/ProxyProtocol.h
2fbe3692c2fb0b7c494e6721c93c6b976f9dc822
[]
no_license
ashevchuk/proxy
5cf2772407a8284bd1c8d28e83baece4f8ce0ddc
200f55c45c3aa8a95d15d70cb1d2ddcb725100b5
refs/heads/master
2021-04-22T00:01:21.144935
2014-10-09T09:52:11
2014-10-09T09:52:11
null
0
0
null
null
null
null
GB18030
C++
false
false
3,489
h
#ifndef _NET_PROTOCOL_H_ #define _NET_PROTOCOL_H_ #include <cstdint> // 每一包的length要4字节对齐, // 所以最后所有包的length加起来可能比total大 #pragma pack(4) struct PACKET_HEAD { uint32_t magic; uint32_t type; uint16_t encrypt : 1; uint16_t count : 15; uint16_t length; uint32_t total : 28; uint32_t padding : 4; }; #pragma pack() const uint32_t PACKET_MAGIC_NUM = 0xfafafafa; const uint32_t PACKET_MAX_SIZE = 1280; const uint32_t PACKET_MAX_TOTAL_LENGTH = 0xfffffff; const uint32_t PACKET_HEAD_SIZE = sizeof(PACKET_HEAD); const uint32_t PACKET_MAX_PAYLOAD = PACKET_MAX_SIZE - PACKET_HEAD_SIZE; const uint32_t PACKET_COUNT_MAX = 0x7fff; const uint32_t PACKET_MAX_LEN = 2*1024*1024; const int HS_PROTOCOL_VER = 0x01; #define PACKET_TYPE(ver, t) ((ver) << 16 | t[1] << 8 | t[0]) #ifndef UINT16_MAX #define UINT16_MAX 65535 #endif const int PACKET_TYPE_EXCHANGE_ENCRYPT_KEY = PACKET_TYPE(UINT16_MAX, "ex"); const int PACKET_TYPE_HEART_BEAT = PACKET_TYPE(UINT16_MAX, "bt"); const int PACKAGE_TYPE_MSG = PACKET_TYPE(HS_PROTOCOL_VER, "ms"); const int PACKAGE_TYPE_PUSH = PACKET_TYPE(HS_PROTOCOL_VER, "pu"); const int PACKAGE_TYPE_LIVE = PACKET_TYPE(HS_PROTOCOL_VER, "li"); const int PACKAGE_TYPE_MP4 = PACKET_TYPE(HS_PROTOCOL_VER, "mp"); const int PACKAGE_TYPE_TALK = PACKET_TYPE(HS_PROTOCOL_VER, "ta"); const int PACKAGE_TYPE_PIC = PACKET_TYPE(HS_PROTOCOL_VER, "pc"); const int HEARTBEAT_TIME_OUT_SEC = 10000; const int SHORT_STR_LEN = 32; const int LONG_STR_LEN = 64; const int LONG_LONG_STR_LEN = 128; const char PROXY_CMD[] = "cmd"; const char PROXY_DATA[] = "data"; const char PROXY_AUTH[] = "auth"; const char PROXY_SN[] = "device_sn"; const char PROXY_USERNAME[] = "username"; const char PROXY_PASSWORD[] = "password"; const char PROXY_SESSION[] = "session"; const char PROXY_LIST[] = "list"; const char PROXY_BIND_DEVICE_FAILED[] = "bind device failed"; const char PROXY_NOT_ONLINE[] = "device not online"; const char PROXY_UNKNOWN_ERROR[] = "unknown error"; const char PROXY_CODE[] = "code"; const char PROXY_DESC[] = "desc"; const char PROXY_OK[] = "ok"; const char PROXY_ERROR[] = "error"; const char PROXY_PARSER_JSON_FAILED[] = "parser json failed"; const char PROXY_PARAM_ERROR[] = "param error"; const char PROXY_PARAM_NONE[] = ""; const char PROXY_ACTION[] = "action"; const char PROXY_OPEN[] = "open"; const char PROXY_CLOSE[] = "close"; const char PROXY_DOWNLOAD[] = "download"; const char PROXY_FILE[] = "file"; const char PROXY_RANGE[] = "range"; const char PROXY_DOWNLOAD_HEAD[] = "download_head"; const char PROXY_DOWNLOAD_TAIL[] = "download_tail"; const char PROXY_DOWNLOAD_FEEDBACK[] = "download_feedback"; const char PROXY_BYTE[] = "byte"; const char PROXY_LIVE[] = "live"; const char PROXY_TYPE[] = "type"; const char PROXY_CHANNL[] = "channl"; const char PROXY_MAIN_STREAM[] = "video1"; const char PROXY_SUB_STREAM[] = "video2"; const char PROXY_DEV_STATUS[] = "status"; const char PROXY_DEV_ONLINE[] = "online"; const char PROXY_DEV_OFFLINE[] = "offline"; const char PROXY_DEV_NONE[] = "deviceNotAdd"; const char PROXY_APPLE[] = "apple"; const char PROXY_BAIDU[] = "baidu"; const char PROXY_GOOGLE[] = "google"; const char PROXY_MOBILE_TYPE[] = "device_type"; const char PROXY_TOKEN[] = "token"; const char PROXY_USER_ID[] = "user_id"; const char PROXY_CHANNL_ID[] = "channel_id"; #endif
[ "arbboter@gmail.com" ]
arbboter@gmail.com
dcbba65caf97dd091b398f48853dd083f9ed2592
3d11674f98c494e40eaf6c75db43e8b2f539dc5a
/DXR/DXR/DXR/Vector.h
911d6e4be627dfa13a52f3d5709f73c0c2620dcb
[]
no_license
okmonn/Raytracing
e8ba73ca0df67b587cf5c9345270ba794c2be259
eddcf716ab9fddba3d18c0be06281d1b2e239c45
refs/heads/master
2020-08-30T03:58:22.426494
2020-02-12T03:50:42
2020-02-12T03:50:42
160,016,791
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
942
h
#pragma once template <typename T> class Vector2 { public: T x; T y; // コンストラクタ Vector2() { x = y = T(0); } Vector2(const T& x, const T& y) { this->x = x; this->y = y; } Vector2(const Vector2& vec) { (*this) = vec; } // デストラク ~Vector2() { } // 演算子オーバーロード void operator=(const Vector2& vec) { x = vec.x; y = vec.y; } }; using Vec2 = Vector2<int>; using Vec2f = Vector2<float>; template <typename T> class Vector3 { public: T x; T y; T z; // コンストラクタ Vector3() { x = y = z = T(0); } Vector3(const T& x, const T& y, const T& z) { this->x = x; this->y = y; this->z = z; } Vector3(const Vector3& vec) { (*this) = vec; } // デストラクタ ~Vector3() { } // 演算子オーバーロード void operator=(const Vector3& vec) { x = vec.x; y = vec.y; z = vec.z; } }; using Vec3 = Vector3<int>; using Vec3f = Vector3<float>;
[ "35838332+okmonn@users.noreply.github.com" ]
35838332+okmonn@users.noreply.github.com
9730bf22cdc2a13a30934a4317e9ec5a56be359f
b4f7073600455d0938d153a902e4e1a9d0b990ff
/learn_class/modern_C++_30/memorymodel_atomic/static_local_singleton.cpp
ddab782f28418df1ef22eee18aa1f4c19d4bae84
[]
no_license
Neflibatata/CPPThings
34784cb0d13b79484874e53e6f791a6448d283c2
52c5794f529396d438e447f5800836f56413cef5
refs/heads/master
2023-03-29T12:07:21.258987
2021-04-02T05:48:14
2021-04-02T05:48:14
353,918,825
5
0
null
null
null
null
UTF-8
C++
false
false
269
cpp
// // Created by light on 20-2-7. // #include <iostream> using namespace std; class singleton { private: static singleton *p; singleton() {} public: singleton *instance(); }; singleton *singleton::instance() { static singleton p; return &p; }
[ "1076119830@qq.com" ]
1076119830@qq.com
4468028429079e9ed2e8939ed96b6a05d433d25b
5b7e69802b8075da18dc14b94ea968a4a2a275ad
/DRG-SDK/SDK/DRG_MENU_TwitchOAuth_classes.hpp
920e20042b7e96e80f80e9893c8b821381f8f2d2
[]
no_license
ue4sdk/DRG-SDK
7effecf98a08282e07d5190467c71b1021732a00
15cc1f8507ccab588480528c65b9623390643abd
refs/heads/master
2022-07-13T15:34:38.499953
2019-03-16T19:29:44
2019-03-16T19:29:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,449
hpp
#pragma once // Deep Rock Galactic (0.22) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "DRG_MENU_TwitchOAuth_structs.hpp" namespace SDK { //--------------------------------------------------------------------------- //Classes //--------------------------------------------------------------------------- // WidgetBlueprintGeneratedClass MENU_TwitchOAuth.MENU_TwitchOAuth_C // 0x0020 (0x0228 - 0x0208) class UMENU_TwitchOAuth_C : public UUserWidget { public: struct FPointerToUberGraphFrame UberGraphFrame; // 0x0208(0x0008) (CPF_ZeroConstructor, CPF_Transient, CPF_DuplicateTransient) class UBasic_Menu_MinimalWindow_C* Basic_Menu_MinimalWindow; // 0x0210(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_RepNotify, CPF_Interp, CPF_NonTransactional, CPF_EditorOnly, CPF_NoDestructor, CPF_AutoWeak, CPF_ContainsInstancedReference, CPF_AssetRegistrySearchable, CPF_SimpleDisplay, CPF_AdvancedDisplay, CPF_Protected, CPF_BlueprintCallable, CPF_BlueprintAuthorityOnly, CPF_TextExportTransient, CPF_NonPIEDuplicateTransient, CPF_ExposeOnSpawn, CPF_PersistentInstance, CPF_UObjectWrapper, CPF_HasGetValueTypeHash, CPF_NativeAccessSpecifierPublic, CPF_NativeAccessSpecifierProtected, CPF_NativeAccessSpecifierPrivate) class UBasic_ButtonScalable_C* Close; // 0x0218(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_RepNotify, CPF_Interp, CPF_NonTransactional, CPF_EditorOnly, CPF_NoDestructor, CPF_AutoWeak, CPF_ContainsInstancedReference, CPF_AssetRegistrySearchable, CPF_SimpleDisplay, CPF_AdvancedDisplay, CPF_Protected, CPF_BlueprintCallable, CPF_BlueprintAuthorityOnly, CPF_TextExportTransient, CPF_NonPIEDuplicateTransient, CPF_ExposeOnSpawn, CPF_PersistentInstance, CPF_UObjectWrapper, CPF_HasGetValueTypeHash, CPF_NativeAccessSpecifierPublic, CPF_NativeAccessSpecifierProtected, CPF_NativeAccessSpecifierPrivate) class UWebBrowser* WebBrowser_32; // 0x0220(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_RepNotify, CPF_Interp, CPF_NonTransactional, CPF_EditorOnly, CPF_NoDestructor, CPF_AutoWeak, CPF_ContainsInstancedReference, CPF_AssetRegistrySearchable, CPF_SimpleDisplay, CPF_AdvancedDisplay, CPF_Protected, CPF_BlueprintCallable, CPF_BlueprintAuthorityOnly, CPF_TextExportTransient, CPF_NonPIEDuplicateTransient, CPF_ExposeOnSpawn, CPF_PersistentInstance, CPF_UObjectWrapper, CPF_HasGetValueTypeHash, CPF_NativeAccessSpecifierPublic, CPF_NativeAccessSpecifierProtected, CPF_NativeAccessSpecifierPrivate) static UClass* StaticClass() { static auto ptr = UObject::FindObject<UClass>("WidgetBlueprintGeneratedClass MENU_TwitchOAuth.MENU_TwitchOAuth_C"); return ptr; } void Init(); void Construct(); void BndEvt__WebBrowser_31_K2Node_ComponentBoundEvent_52_OnUrlChanged__DelegateSignature(const struct FText& Text); void BndEvt__Close_K2Node_ComponentBoundEvent_87_OnClicked__DelegateSignature(); void ExecuteUbergraph_MENU_TwitchOAuth(int EntryPoint); }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "igromanru@yahoo.de" ]
igromanru@yahoo.de
64074fa6b25117c39a0a031dadadc1fde34a4527
40b85924238752137a60c3c434e803f461479598
/Laboratories/Lectures/cpp09/cpp.09.01_first_template/main.cpp
ba5504ad61958f0a7ca65ef95ab2705421d9f4e8
[]
no_license
L0GI0/CPP
4ec3cb557c0d1d24a2be8dfcee526378bc0faace
063d8c177485745c28231665e895e1b2ca6360b8
refs/heads/master
2020-05-03T09:32:26.443048
2019-04-27T19:04:54
2019-04-27T19:04:54
178,556,663
0
0
null
null
null
null
UTF-8
C++
false
false
1,782
cpp
///////////////////////////////////////////////////////////////////////// /// \file /// \author Bartosz Mindur /// \author mindur@fatcat.ftj.agh.edu.pl /// \version 0.1 /// \date 22-11-2004 /// \brief Functions templates. First example. ///////////////////////////////////////////////////////////////////////// #include <iostream> #include <string> #include <typeinfo> #include "CFraction.h" namespace OOP{ template<typename T> T max(T a, T b) { std::cout << "Nazawa typu obiektu: " << typeid(T).name() << std::endl; return (a < b) ? b : a; } template<typename T> T min(T a, T b) { std::cout << "Nazawa typu obiektu: " << typeid(T).name() << std::endl; return (a < b) ? a : b; } } ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// int main(int argc, char** argv) { using namespace std; cout << "max(2, 3) = " << OOP::max(2, 3) << endl; cout << "min(2, 3) = " << OOP::min(2, 3) << endl; cout << "max(2.3, 3.3) = " << OOP::max(2.3, 3.3) << endl; cout << "min(2.3, 3.3) = " << OOP::min(2.3, 3.3) << endl; cout << "max('a', 'b') = " << OOP::max('a', 'b') << endl; cout << "min('a', 'b') = " << OOP::min('a', 'b') << endl; cout << "max(OOP::CFraction(2, 5), OOP::CFraction(13, 50)) = " << OOP::max(OOP::CFraction(2, 5), OOP::CFraction(13, 50)) << endl; cout << "min(OOP::CFraction(2, 5), OOP::CFraction(13, 50)) = " << OOP::min(OOP::CFraction(2, 5), OOP::CFraction(13, 50)) << endl; cout << "max(std::string(\"Ala\"), std::string(\"Ola\")) = " << OOP::max(std::string("Ala"), std::string("Ola")) << endl; cout << "min(std::string(\"Ala\"), std::string(\"Ola\")) = " << OOP::min(std::string("Ala"), std::string("Ola")) << endl; return 0; }
[ "logiocorp@gmail.com" ]
logiocorp@gmail.com
cab8cf4475d151a972ede8349cc6859544f4f0f9
1f1f93390d34ca30be5172a80abc2a3b72e42bb1
/src/Thread.cc
b574a8933e7d4d4cd1a2eb61e11c24af9a8e971f
[ "MIT" ]
permissive
libinqi/finger-f22u
f6b14bf7a0e1f24e49666b2188fa3a81cf5dfe19
ffdcea2de688af23dabf8f05b11a9f5f3cbb9301
refs/heads/master
2021-01-02T09:03:10.837362
2017-08-04T06:55:20
2017-08-04T06:55:20
99,127,404
0
0
null
null
null
null
UTF-8
C++
false
false
12,046
cc
#include "Thread.h" Baton *Thread::baton = NULL; uv_loop_t *Thread::loop = NULL; void (*Thread::doExecute)() = NULL; bool Thread::isWaiting = false; bool Thread::isRan = false; bool Thread::isDied = false; static std::string GBKToUTF8(const std::string &strGBK) { static std::string strOutUTF8 = ""; WCHAR *str1; int n = MultiByteToWideChar(CP_ACP, 0, strGBK.c_str(), -1, NULL, 0); str1 = new WCHAR[n]; MultiByteToWideChar(CP_ACP, 0, strGBK.c_str(), -1, str1, n); n = WideCharToMultiByte(CP_UTF8, 0, str1, -1, NULL, 0, NULL, NULL); char *str2 = new char[n]; WideCharToMultiByte(CP_UTF8, 0, str1, -1, str2, n, NULL, NULL); strOutUTF8 = str2; delete[] str1; str1 = NULL; delete[] str2; str2 = NULL; return strOutUTF8; } static std::string UNICODE_to_UTF8(const WCHAR *pSrc, int stringLength) { static std::string strOutUTF8 = ""; char *buffer = new char[stringLength + 1]; WideCharToMultiByte(CP_UTF8, NULL, pSrc, wcslen(pSrc), buffer, stringLength, NULL, NULL); buffer[stringLength] = '\0'; strOutUTF8 = buffer; delete[] buffer; const string &delim = " \t"; string r = strOutUTF8.erase(strOutUTF8.find_last_not_of(delim) + 1); return r.erase(0, r.find_first_not_of(delim)); } static std::string base64_encode(unsigned char const *bytes_to_encode, unsigned int in_len) { std::string ret; int i = 0; int j = 0; unsigned char char_array_3[3]; unsigned char char_array_4[4]; const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; while (in_len--) { char_array_3[i++] = *(bytes_to_encode++); if (i == 3) { char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); char_array_4[3] = char_array_3[2] & 0x3f; for (i = 0; (i < 4); i++) ret += base64_chars[char_array_4[i]]; i = 0; } } if (i) { for (j = i; j < 3; j++) char_array_3[j] = '\0'; char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); char_array_4[3] = char_array_3[2] & 0x3f; for (j = 0; (j < i + 1); j++) ret += base64_chars[char_array_4[j]]; while ((i++ < 3)) ret += '='; } return ret; } static std::string bmp_encode(unsigned char const *img_data_bytes) { // bmp 8位,大小256*288头文件信息 const std::string file_header = "Qk0AAAAAAAAAADYEAAAoAAAAAAEAACABAAABAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQACAgIAAwMDAAQEBAAFBQUABgYGAAcHBwAICAgACQkJAAoKCgALCwsADAwMAA0NDQAODg4ADw8PABAQEAAREREAEhISABMTEwAUFBQAFRUVABYWFgAXFxcAGBgYABkZGQAaGhoAGxsbABwcHAAdHR0AHh4eAB8fHwAgICAAISEhACIiIgAjIyMAJCQkACUlJQAmJiYAJycnACgoKAApKSkAKioqACsrKwAsLCwALS0tAC4uLgAvLy8AMDAwADExMQAyMjIAMzMzADQ0NAA1NTUANjY2ADc3NwA4ODgAOTk5ADo6OgA7OzsAPDw8AD09PQA+Pj4APz8/AEBAQABBQUEAQkJCAENDQwBEREQARUVFAEZGRgBHR0cASEhIAElJSQBKSkoAS0tLAExMTABNTU0ATk5OAE9PTwBQUFAAUVFRAFJSUgBTU1MAVFRUAFVVVQBWVlYAV1dXAFhYWABZWVkAWlpaAFtbWwBcXFwAXV1dAF5eXgBfX18AYGBgAGFhYQBiYmIAY2NjAGRkZABlZWUAZmZmAGdnZwBoaGgAaWlpAGpqagBra2sAbGxsAG1tbQBubm4Ab29vAHBwcABxcXEAcnJyAHNzcwB0dHQAdXV1AHZ2dgB3d3cAeHh4AHl5eQB6enoAe3t7AHx8fAB9fX0Afn5+AH9/fwCAgIAAgYGBAIKCggCDg4MAhISEAIWFhQCGhoYAh4eHAIiIiACJiYkAioqKAIuLiwCMjIwAjY2NAI6OjgCPj48AkJCQAJGRkQCSkpIAk5OTAJSUlACVlZUAlpaWAJeXlwCYmJgAmZmZAJqamgCbm5sAnJycAJ2dnQCenp4An5+fAKCgoAChoaEAoqKiAKOjowCkpKQApaWlAKampgCnp6cAqKioAKmpqQCqqqoAq6urAKysrACtra0Arq6uAK+vrwCwsLAAsbGxALKysgCzs7MAtLS0ALW1tQC2trYAt7e3ALi4uAC5ubkAurq6ALu7uwC8vLwAvb29AL6+vgC/v78AwMDAAMHBwQDCwsIAw8PDAMTExADFxcUAxsbGAMfHxwDIyMgAycnJAMrKygDLy8sAzMzMAM3NzQDOzs4Az8/PANDQ0ADR0dEA0tLSANPT0wDU1NQA1dXVANbW1gDX19cA2NjYANnZ2QDa2toA29vbANzc3ADd3d0A3t7eAN/f3wDg4OAA4eHhAOLi4gDj4+MA5OTkAOXl5QDm5uYA5+fnAOjo6ADp6ekA6urqAOvr6wDs7OwA7e3tAO7u7gDv7+8A8PDwAPHx8QDy8vIA8/PzAPT09AD19fUA9vb2APf39wD4+PgA+fn5APr6+gD7+/sA/Pz8AP39/QD+/v4A////"; const std::string file_info = "/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w=="; // 图片反转 unsigned int width = 256; unsigned int height = 288; unsigned int size = width * height; unsigned char imageBytes[256 * 288]; int srcPos = 0; int dstPos = 0; for (int i = 0; i <= height - 1; i++) { srcPos = i * width; dstPos = (height - 1 - i) * width; memmove(imageBytes + dstPos, srcPos == 0 ? img_data_bytes : img_data_bytes + srcPos, width); } // 图片base64编码处理 std::string bmpStr = base64_encode(imageBytes, size); bmpStr = file_header + bmpStr; bmpStr += file_info; return bmpStr; } // static unsigned char *bmp_encode(unsigned char const *img_data_bytes) // { // unsigned int width = 256; // unsigned int height = 288; // unsigned char file_header[] = { // //file header // 0x42, 0x4d, //file type BM (0 - 1) // //0x36,0x6c,0x01,0x00, //file size*** // 0x0, 0x0, 0x0, 0x00, //file size (2 - 5) // 0x00, 0x00, 0x00, 0x00, //reserved (6 - 9) // 0x36, // 0x0A bytes Header information block size // 0x4, 0x00, 0x00, //head byte // 0x28, 0x00, 0x00, 0x00, //struct size // 0x00, 0x00, 0x00, 0x00, //map width // 0x00, 0x00, 0x00, 0x00, //map height // 0x01, 0x00, //must be 1 // 0x08, 0x00, //color count // 0x00, 0x00, 0x00, 0x00, //compression // //0x00,0x68,0x01,0x00, //data size // 0x00, 0x00, 0x00, 0x00, //data size // 0x00, 0x00, 0x00, 0x00, //dpix // 0x00, 0x00, 0x00, 0x00, //dpiy // 0x00, 0x00, 0x00, 0x00, //color used // 0x00, 0x00, 0x00, 0x00, //color important // }; // unsigned char imageBytes[74806]; // memset(imageBytes, 0xFF, 74806); // memmove(imageBytes, file_header, 54); // unsigned int num = width; // imageBytes[18] = (byte)num; // num = num >> 8; // imageBytes[19] = (byte)num; // num = num >> 8; // imageBytes[20] = (byte)num; // num = num >> 8; // imageBytes[21] = (byte)num; // num = height; // imageBytes[22] = (byte)num; // num = num >> 8; // imageBytes[23] = (byte)num; // num = num >> 8; // imageBytes[24] = (byte)num; // num = num >> 8; // imageBytes[25] = (byte)num; // int j = 0; // for (int i = 54; i < 1078; i = i + 4) // { // imageBytes[i] = (byte)j; // imageBytes[i + 1] = (byte)j; // imageBytes[i + 2] = (byte)j; // imageBytes[i + 3] = 0; // j++; // } // int srcPos = 0; // int dstPos = 0; // for (int i = 0; i <= height - 1; i++) // { // srcPos = i * width; // dstPos = 1078 + (height - 1 - i) * width; // memmove(imageBytes + dstPos, srcPos == 0 ? img_data_bytes : img_data_bytes + srcPos, width); // } // return imageBytes; // } Local<Value> Thread::getObject(Isolate *isolate, Receiver receiver) { Local<Object> data = Object::New(isolate); switch (baton->receiver.type) { case ReceiveType::Image: { std::string mbStr = bmp_encode(receiver.fingerImageData); data->Set(String::NewFromUtf8(isolate, "type"), Number::New(isolate, receiver.type)); data->Set(String::NewFromUtf8(isolate, "isHeightImage"), Number::New(isolate, receiver.isHeightImage)); data->Set(String::NewFromUtf8(isolate, "data"), String::NewFromUtf8(isolate, mbStr.c_str())); break; } case ReceiveType::Feature: { std::string mbStr = base64_encode(receiver.fingerTemplateData, sizeof(receiver.fingerTemplateData)); data->Set(String::NewFromUtf8(isolate, "type"), Number::New(isolate, receiver.type)); data->Set(String::NewFromUtf8(isolate, "data"), String::NewFromUtf8(isolate, mbStr.c_str())); break; } case ReceiveType::Verify: { break; } } return {data}; } void Thread::callback(uv_async_t *request, int status) { Isolate *isolate = Isolate::GetCurrent(); HandleScope scope(isolate); Baton *baton = static_cast<Baton *>(request->data); Local<Value> argv[2]; if (!baton->onReceive.IsEmpty() && (baton->state == 0)) { // argv[0] = Number::New(isolate, baton->receiver.type); argv[0] = getObject(isolate, baton->receiver); // argv[1] = baton->receiver.data.; Local<Function>::New(isolate, baton->onReceive)->Call(isolate->GetCurrentContext()->Global(), 1, argv); } if (!baton->onError.IsEmpty() && (baton->state == 1)) { argv[0] = Number::New(isolate, baton->error.code); argv[1] = String::NewFromUtf8(isolate, baton->error.message.c_str()); Local<Function>::New(isolate, baton->onError)->Call(isolate->GetCurrentContext()->Global(), 2, argv); } } Thread::Thread() { } void Thread::run(uv_work_t *request) { isDied = false; while (true) { try { if (isDied) { break; } uv_mutex_lock(&baton->mutex); if (baton->isWaiting) { uv_cond_wait(&baton->condvar, &baton->mutex); baton->isWaiting = false; } uv_mutex_unlock(&baton->mutex); doExecute(); Sleep(10); } catch (exception &e) { cout << "exception: " << e.what() << endl; } } isDied = true; } void Thread::stop(uv_work_t *request, int status) { isDied = true; Baton *baton = static_cast<Baton *>(request->data); uv_close((uv_handle_t *)&baton->asyncRequest, NULL); } void Thread::bind(Isolate *isolate, Local<Function> onReceive, Local<Function> onError) { baton = new Baton(); baton->onReceive.Reset(isolate, Persistent<Function>::Persistent(isolate, onReceive)); baton->onError.Reset(isolate, Persistent<Function>::Persistent(isolate, onError)); baton->request.data = baton; loop = uv_default_loop(); uv_async_init(loop, &baton->asyncRequest, (uv_async_cb)callback); uv_cond_init(&baton->condvar); uv_mutex_init(&baton->mutex); } void Thread::resume(void) { if (!isRan) { uv_queue_work(loop, &baton->request, run, stop); uv_run(loop, UV_RUN_NOWAIT); isRan = true; } uv_mutex_lock(&baton->mutex); uv_cond_signal(&baton->condvar); uv_mutex_unlock(&baton->mutex); } void Thread::suspend(void) { uv_mutex_lock(&baton->mutex); baton->isWaiting = true; uv_mutex_unlock(&baton->mutex); } void Thread::doReceive(Receiver receiver) { baton->state = 0; baton->receiver = receiver; baton->asyncRequest.data = baton; uv_async_send(&baton->asyncRequest); } void Thread::doError(int code, string message) { baton->state = 1; baton->error.code = code; baton->error.message = message; baton->asyncRequest.data = baton; uv_async_send(&baton->asyncRequest); } Thread::~Thread() { uv_mutex_destroy(&baton->mutex); delete baton; }
[ "libinqi@outlook.com" ]
libinqi@outlook.com
cebd3a83c74ee3472b1cf174470fbaaf03930cd2
e80939771655bdf4102eebc419c952e1cecca3db
/CCLabelBMFont/HelloWorldScene.cpp
f75aeeb2ea2d6826bdb3dc9ef3161389df75d266
[]
no_license
fusijie/Cocos2dx-Issue
2f0f5dae7ec2ab1e497a64177a96827bda030388
2368f574d730a75888666d142742d5e3dc23a106
refs/heads/master
2020-12-24T14:18:25.202742
2015-01-30T06:43:13
2015-01-30T06:43:13
28,901,460
1
0
null
null
null
null
UTF-8
C++
false
false
3,268
cpp
#include "HelloWorldScene.h" USING_NS_CC; CCScene* HelloWorld::scene() { // 'scene' is an autorelease object CCScene *scene = CCScene::create(); // 'layer' is an autorelease object HelloWorld *layer = HelloWorld::create(); // add layer as a child to scene scene->addChild(layer); // return the scene return scene; } // on "init" you need to initialize your instance bool HelloWorld::init() { ////////////////////////////// // 1. super init first if ( !CCLayer::init() ) { return false; } CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize(); CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin(); ///////////////////////////// // 2. add a menu item with "X" image, which is clicked to quit the program // you may modify it. // add a "close" icon to exit the progress. it's an autorelease object CCMenuItemImage *pCloseItem = CCMenuItemImage::create( "CloseNormal.png", "CloseSelected.png", this, menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 , origin.y + pCloseItem->getContentSize().height/2)); // create menu, it's an autorelease object CCMenu* pMenu = CCMenu::create(pCloseItem, NULL); pMenu->setPosition(CCPointZero); this->addChild(pMenu, 1); ///////////////////////////// // 3. add your codes below... // add a label shows "Hello World" // create and initialize a label CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Arial", 24); // position the label on the center of the screen pLabel->setPosition(ccp(origin.x + visibleSize.width/2, origin.y + visibleSize.height - pLabel->getContentSize().height)); // add the label as a child to this layer this->addChild(pLabel, 1); // add "HelloWorld" splash screen" CCSprite* pSprite = CCSprite::create("HelloWorld.png"); // position the sprite on the center of the screen pSprite->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)); // add the sprite as a child to this layer //this->addChild(pSprite, 0); auto label = CCLabelBMFont::create("012345678.9", "commonNum.fnt"); label->setPosition(visibleSize.width/2,visibleSize.height/2); this->addChild(label); auto label1 = CCLabelBMFont::create(); label1->setFntFile( "commonNum.fnt"); label1->setString("012345678.9"); label1->setPosition(visibleSize.width/2,visibleSize.height/2-30); this->addChild(label1); this->setScale(3); return true; } void HelloWorld::menuCloseCallback(CCObject* pSender) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) CCMessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert"); #else CCDirector::sharedDirector()->end(); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) exit(0); #endif #endif }
[ "fusijie@vip.qq.com" ]
fusijie@vip.qq.com
87c8fa5293ec2c557ffb63dbfbefebf6daea54ef
bf9d43784465e8cb0cb1b263d1dbb23961f24f84
/GCMSLibManager/GCMSLibManager.cpp
f01870c9a8601f54dfd324639dbae20a0f626114
[]
no_license
jlyu/GCMSLibSearch
4515ee13e8838174548fcc12aa53d10be2694838
273724b37c2d753dbd4e214c8f48107d234bdb49
refs/heads/master
2021-01-22T11:59:16.969012
2015-04-15T04:42:16
2015-04-15T04:42:16
29,897,752
0
0
null
null
null
null
GB18030
C++
false
false
2,067
cpp
// GCMSLibManager.cpp : 定义 DLL 的初始化例程。 // #include "stdafx.h" #include "GCMSLibManager.h" #include "LibSearchStrategyView.h" #include "LibSettingView.h" #include "LibParaSearchView.h" #include "SqliteController.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // - DLL 导出 LIBMANAGERDLL_API VOID GCMSLibSearch(const LibConfig& libConfig, Compound &testCompound, std::vector<Compound> &libCompounds) { if (!libCompounds.empty()) { libCompounds.clear(); } CString libPathName[] = { libConfig._dbPath1st, libConfig._dbPath2nd, libConfig._dbPath3rd }; int matchDegree[] = { libConfig._minMass1st, libConfig._minMass2nd, libConfig._minMass3rd }; for (int t = 0; t != 3; t++) { const std::string strLibPathName = CT2A(libPathName[t]); SqliteController sqliteController(strLibPathName); testCompound = sqliteController.getCompound(100); // del sqliteController.libSearch(libConfig, testCompound, libCompounds); const int libCompoundsSize = libCompounds.size(); for (int i = 0; i != libCompoundsSize; i++) { if (libCompounds[i]._matchDegree > matchDegree[t]) { return; } } } libCompounds.clear(); } bool GCMSLibSearchStrategy(LibConfig& libConfig, CWnd* pParent /* = NULL */ ) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); LibSearchStrategyView libManagerView(pParent, libConfig); INT_PTR ret = libManagerView.DoModal(); libConfig = libManagerView._libConfig; if (ret == IDOK) { return true; } return false; } VOID GCMSLibSetting(const CString defaultLibPathName, CWnd* pParent /* = NULL */) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); LibSettingView libSettingView(defaultLibPathName, pParent); libSettingView.DoModal(); } LIBMANAGERDLL_API VOID GCMSLibParaSearch(const CString defaultLibPathName, CWnd* pParent /* = NULL */) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); LibParaSearchView libParaSearchView(defaultLibPathName, pParent); libParaSearchView.DoModal(); } //// CGCMSLibManagerApp BEGIN_MESSAGE_MAP(CGCMSLibManagerApp, CWinApp) END_MESSAGE_MAP() CGCMSLibManagerApp theApp;
[ "yujnln@gmail.com" ]
yujnln@gmail.com
f113a4a7d33336b0029dff49344b6dbc308c521e
eb8a48a6d06b0165352135830155aaec4c2a0ba3
/算法/banker.cpp
89f96925075056a74adb6dd84fb408fd797d1483
[]
no_license
Raymond-du/Raymond-du
9fb0f7a0b5a52d4e6e86811f1b6a476d98655e56
3b1df509c35022494dc77b3800937f94bda84b19
refs/heads/master
2022-03-06T03:06:40.724388
2022-03-01T01:45:55
2022-03-01T01:45:55
176,864,443
0
0
null
null
null
null
UTF-8
C++
false
false
2,201
cpp
#include<iostream> #include<string.h> #include<vector> using namespace std; #define M 3 //资源块的个数 #define N 4 //任务的数量 int resource[M]; //每个资源块的大小 int available[M]; //每个资源块的可获得大小 int claim[N][M]; //n个任务 对每个资源块的需求 int alloc[N][M]; //n个任务 对每个资源块以获得大小 int need[N][M]; //n个任务 对每个资源块还需要的大小 int main(){ cout<<"请输入每个任务对每个资源块的需求"<<endl; for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ cin>>claim[i][j]; } } cout<<"请输入每个任务对已获得每个资源块的大小"<<endl; for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ cin>>alloc[i][j]; } } cout<<"每个任务对每个资源块还需的大小"<<endl; for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ need[i][j]=claim[i][j]-alloc[i][j]; cout<<need[i][j]<<"\t"; } cout<<endl; } cout<<"请输入每个资源块的大小"<<endl; for(int i=0;i<M;i++){ cin>>resource[i]; } int alloc_sum[M];//每个资源已经获取的大小 bzero(alloc_sum,4*M); for(int i=0;i<M;i++){ for(int j=0;j<N;j++){ alloc_sum[i]+=alloc[j][i]; } } cout<<"每个资源块的可获得大小"<<endl; for(int i=0;i<M;i++){ available[i]=resource[i]-alloc_sum[i]; if(available[i]<0){ cout<<"任务资源分配不正确,资源总值比已分配的资源小"<<endl; return 0; } cout<<available[i]<<"\t"; } cout<<endl; vector<int> ans; int is_ok=0; int vis[N]; bzero(vis,4*N); while(1){ if(ans.size()==N){ is_ok=1; break; } int index; int flag; for(int i=0;i<N;i++){ int judge=1; if(!vis[i]){ for(int j=0;j<M;j++){ if(available[j]<need[i][j]){ judge=0; break; } } }else{ continue; } if(judge){ index=i; flag=1; break; } } if(flag){ vis[index]=1; ans.push_back(index); for(int k=0;k<M;k++){ available[k]+=alloc[index][k]; } }else{ cout<<"死锁状态,无法分配"<<endl; return 0; } } if(is_ok){ cout<<"安全序列是:"<<endl; for(unsigned int i=0;i<ans.size();i++){ cout<<ans[i]+1<<"\t"; } cout<<endl; } return 0; }
[ "noreply@github.com" ]
noreply@github.com
585e72110fc41004633b4a5b55c17ff5bbbd5fe6
91a882547e393d4c4946a6c2c99186b5f72122dd
/Source/XPSP1/NT/printscan/print/spooler/dbglib/dbgnul.cxx
83874030958645bf3428bfbf4a2e815ab53e0c92
[]
no_license
IAmAnubhavSaini/cryptoAlgorithm-nt5src
94f9b46f101b983954ac6e453d0cf8d02aa76fc7
d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2
refs/heads/master
2023-09-02T10:14:14.795579
2021-11-20T13:47:06
2021-11-20T13:47:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
713
cxx
/*++ Copyright (c) 1998-1999 Microsoft Corporation All rights reserved. Module Name: dbgnul.cxx Abstract: Debug Device (Null device) Author: Steve Kiraly (SteveKi) 5-Dec-1995 Revision History: --*/ #include "precomp.hxx" #pragma hdrstop #include "dbgnul.hxx" TDebugDeviceNull:: TDebugDeviceNull( IN LPCTSTR pszConfiguration, IN EDebugType eDebugType ) : TDebugDevice( pszConfiguration, eDebugType ) { } TDebugDeviceNull:: ~TDebugDeviceNull( VOID ) { } BOOL TDebugDeviceNull:: bValid( VOID ) { return TRUE; } BOOL TDebugDeviceNull:: bOutput ( IN UINT uSize, IN LPBYTE pBuffer ) { uSize++; pBuffer++; return TRUE; }
[ "support@cryptoalgo.cf" ]
support@cryptoalgo.cf
0c9a12f4f5d4e4bfbc927cb6774a32e201635ffe
c2b6bd54bef3c30e53c846e9cf57f1e44f8410df
/Temp/il2cppOutput/il2cppOutput/mscorlib_Mono_Security_Cryptography_SymmetricTrans1394030013.h
bf30c5407a7569243b4228cd3504d6f06ffceebf
[]
no_license
PriyeshWani/CrashReproduce-5.4p1
549a1f75c848bf9513b2f966f2f500ee6c75ba42
03dd84f7f990317fb9026cbcc3873bc110b1051e
refs/heads/master
2021-01-11T12:04:21.140491
2017-01-24T14:01:29
2017-01-24T14:01:29
79,388,416
0
0
null
null
null
null
UTF-8
C++
false
false
6,977
h
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "mscorlib_System_Object2689449295.h" // System.Security.Cryptography.SymmetricAlgorithm struct SymmetricAlgorithm_t1108166522; // System.Byte[] struct ByteU5BU5D_t3397334013; // System.Security.Cryptography.RandomNumberGenerator struct RandomNumberGenerator_t2510243513; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Mono.Security.Cryptography.SymmetricTransform struct SymmetricTransform_t1394030013 : public Il2CppObject { public: // System.Security.Cryptography.SymmetricAlgorithm Mono.Security.Cryptography.SymmetricTransform::algo SymmetricAlgorithm_t1108166522 * ___algo_0; // System.Boolean Mono.Security.Cryptography.SymmetricTransform::encrypt bool ___encrypt_1; // System.Int32 Mono.Security.Cryptography.SymmetricTransform::BlockSizeByte int32_t ___BlockSizeByte_2; // System.Byte[] Mono.Security.Cryptography.SymmetricTransform::temp ByteU5BU5D_t3397334013* ___temp_3; // System.Byte[] Mono.Security.Cryptography.SymmetricTransform::temp2 ByteU5BU5D_t3397334013* ___temp2_4; // System.Byte[] Mono.Security.Cryptography.SymmetricTransform::workBuff ByteU5BU5D_t3397334013* ___workBuff_5; // System.Byte[] Mono.Security.Cryptography.SymmetricTransform::workout ByteU5BU5D_t3397334013* ___workout_6; // System.Int32 Mono.Security.Cryptography.SymmetricTransform::FeedBackByte int32_t ___FeedBackByte_7; // System.Int32 Mono.Security.Cryptography.SymmetricTransform::FeedBackIter int32_t ___FeedBackIter_8; // System.Boolean Mono.Security.Cryptography.SymmetricTransform::m_disposed bool ___m_disposed_9; // System.Boolean Mono.Security.Cryptography.SymmetricTransform::lastBlock bool ___lastBlock_10; // System.Security.Cryptography.RandomNumberGenerator Mono.Security.Cryptography.SymmetricTransform::_rng RandomNumberGenerator_t2510243513 * ____rng_11; public: inline static int32_t get_offset_of_algo_0() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___algo_0)); } inline SymmetricAlgorithm_t1108166522 * get_algo_0() const { return ___algo_0; } inline SymmetricAlgorithm_t1108166522 ** get_address_of_algo_0() { return &___algo_0; } inline void set_algo_0(SymmetricAlgorithm_t1108166522 * value) { ___algo_0 = value; Il2CppCodeGenWriteBarrier(&___algo_0, value); } inline static int32_t get_offset_of_encrypt_1() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___encrypt_1)); } inline bool get_encrypt_1() const { return ___encrypt_1; } inline bool* get_address_of_encrypt_1() { return &___encrypt_1; } inline void set_encrypt_1(bool value) { ___encrypt_1 = value; } inline static int32_t get_offset_of_BlockSizeByte_2() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___BlockSizeByte_2)); } inline int32_t get_BlockSizeByte_2() const { return ___BlockSizeByte_2; } inline int32_t* get_address_of_BlockSizeByte_2() { return &___BlockSizeByte_2; } inline void set_BlockSizeByte_2(int32_t value) { ___BlockSizeByte_2 = value; } inline static int32_t get_offset_of_temp_3() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___temp_3)); } inline ByteU5BU5D_t3397334013* get_temp_3() const { return ___temp_3; } inline ByteU5BU5D_t3397334013** get_address_of_temp_3() { return &___temp_3; } inline void set_temp_3(ByteU5BU5D_t3397334013* value) { ___temp_3 = value; Il2CppCodeGenWriteBarrier(&___temp_3, value); } inline static int32_t get_offset_of_temp2_4() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___temp2_4)); } inline ByteU5BU5D_t3397334013* get_temp2_4() const { return ___temp2_4; } inline ByteU5BU5D_t3397334013** get_address_of_temp2_4() { return &___temp2_4; } inline void set_temp2_4(ByteU5BU5D_t3397334013* value) { ___temp2_4 = value; Il2CppCodeGenWriteBarrier(&___temp2_4, value); } inline static int32_t get_offset_of_workBuff_5() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___workBuff_5)); } inline ByteU5BU5D_t3397334013* get_workBuff_5() const { return ___workBuff_5; } inline ByteU5BU5D_t3397334013** get_address_of_workBuff_5() { return &___workBuff_5; } inline void set_workBuff_5(ByteU5BU5D_t3397334013* value) { ___workBuff_5 = value; Il2CppCodeGenWriteBarrier(&___workBuff_5, value); } inline static int32_t get_offset_of_workout_6() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___workout_6)); } inline ByteU5BU5D_t3397334013* get_workout_6() const { return ___workout_6; } inline ByteU5BU5D_t3397334013** get_address_of_workout_6() { return &___workout_6; } inline void set_workout_6(ByteU5BU5D_t3397334013* value) { ___workout_6 = value; Il2CppCodeGenWriteBarrier(&___workout_6, value); } inline static int32_t get_offset_of_FeedBackByte_7() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___FeedBackByte_7)); } inline int32_t get_FeedBackByte_7() const { return ___FeedBackByte_7; } inline int32_t* get_address_of_FeedBackByte_7() { return &___FeedBackByte_7; } inline void set_FeedBackByte_7(int32_t value) { ___FeedBackByte_7 = value; } inline static int32_t get_offset_of_FeedBackIter_8() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___FeedBackIter_8)); } inline int32_t get_FeedBackIter_8() const { return ___FeedBackIter_8; } inline int32_t* get_address_of_FeedBackIter_8() { return &___FeedBackIter_8; } inline void set_FeedBackIter_8(int32_t value) { ___FeedBackIter_8 = value; } inline static int32_t get_offset_of_m_disposed_9() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___m_disposed_9)); } inline bool get_m_disposed_9() const { return ___m_disposed_9; } inline bool* get_address_of_m_disposed_9() { return &___m_disposed_9; } inline void set_m_disposed_9(bool value) { ___m_disposed_9 = value; } inline static int32_t get_offset_of_lastBlock_10() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ___lastBlock_10)); } inline bool get_lastBlock_10() const { return ___lastBlock_10; } inline bool* get_address_of_lastBlock_10() { return &___lastBlock_10; } inline void set_lastBlock_10(bool value) { ___lastBlock_10 = value; } inline static int32_t get_offset_of__rng_11() { return static_cast<int32_t>(offsetof(SymmetricTransform_t1394030013, ____rng_11)); } inline RandomNumberGenerator_t2510243513 * get__rng_11() const { return ____rng_11; } inline RandomNumberGenerator_t2510243513 ** get_address_of__rng_11() { return &____rng_11; } inline void set__rng_11(RandomNumberGenerator_t2510243513 * value) { ____rng_11 = value; Il2CppCodeGenWriteBarrier(&____rng_11, value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
[ "priyeshwani@gmail.com" ]
priyeshwani@gmail.com
c1614a863e454e2500b119fbc1d79b735a36761f
602dab0925af232f18be0c2fb9dddb287385bf3e
/npat8.cpp
ac76bdaad1e6892dad3e15306811bf7b8764aece
[]
no_license
srnit/codeon
c5af9cd3de6f5f7e2bd63251451fc1e1e3b2b23e
fa51c809d263fb99d947d58a1a838dd9e1c2e7ad
refs/heads/master
2021-01-12T12:40:55.879728
2018-01-14T20:06:40
2018-01-14T20:06:40
69,899,399
1
0
null
null
null
null
UTF-8
C++
false
false
1,775
cpp
#include<bits/stdc++.h> using namespace std; void mostFreq3(int *a, int n, int b[3]) { // Write your code here // hint: sort a, find biggest 3 blocks int num[3]={0}; int check[3]={0}; for(int i=0; i<n; i++) { for(int j=i+1; j<n; j++) { if(a[i]>a[j]) { int temp=a[i]; a[i]=a[j]; a[j]=temp; } } //cout << num[i] << "\n"; } //cout<<"\n"; int count=0; int j=0; //int max=0; for(int i=0;i<n;i++) { count++; if(a[i]!=a[i+1]) { if(count>num[0]) { num[2]=num[1]; num[1]=num[0]; num[0]=count; } else if(count>num[1]) {num[2]=num[1]; num[1]=count; } else num[2]=count; } //num[j]=count; check[j]=a[i]; count=0; j++; } for(int i=0;i<3;i++) cout<<num[i]<<" "; int temp; for(int i=0; i<3; i++) { for(int j=i+1; j<=3; j++) { if(num[i]<num[j]) { temp=check[j]; check[j]=check[i]; check[i]=temp; } } } for(int i=0;i<3;i++) b[i]=check[i]; } int main() { int n; int a[100]; int b[3]; int i=0; cin >> n; for(i=0;i<n;i++){ cin >> a[i]; } mostFreq3(a,n,b); for(i=0; i<3; i++) cout << b[i] << " "; return 0; }
[ "ramansudhanshu150@gmail.com" ]
ramansudhanshu150@gmail.com
efbb674b3e59fbf82d60cdd17adaa1dbdbf7582f
65025edce8120ec0c601bd5e6485553697c5c132
/Engine/rendersystem/base/RenderDeviceTypes.h
345e06d58c6298e3e6e93a39b32c9b078e95fc43
[ "MIT" ]
permissive
stonejiang/genesis-3d
babfc99cfc9085527dff35c7c8662d931fbb1780
df5741e7003ba8e21d21557d42f637cfe0f6133c
refs/heads/master
2020-12-25T18:22:32.752912
2013-12-13T07:45:17
2013-12-13T07:45:17
15,157,071
4
4
null
null
null
null
GB18030
C++
false
false
9,562
h
/**************************************************************************** Copyright (c) 2011-2013,WebJet Business Division,CYOU http://www.genesis-3d.com.cn 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. ****************************************************************************/ #ifndef RENDERDEVICETYPES_H_ #define RENDERDEVICETYPES_H_ #include "../config/RenderDeviceConfig.h" #include "../foundation/util/array.h" #include "../foundation/math/float4.h" #include "../foundation/io/mediatype.h" #include "../foundation/util/string.h" #include "../foundation/util/stringatom.h" #include "../foundation/util/guid.h" #include "core/refcounted.h" #include "../foundation/util/scriptbind.h" #include "../rendersystem/base/PixelFormat.h" #include "../rendersystem/base/RenderCommandType.h" namespace RenderBase { typedef Util::StringAtom ResourcePath; class RenderResourceHandle { public: RenderResourceHandle() : mRO(NULL){ } RenderResourceHandle(RenderCommandType* ro) : mRO(ro){ } const Core::RefCounted* AsObject(void) const{ return static_cast<const Core::RefCounted*>(mRO); } Core::RefCounted* AsObject(void){ return static_cast<Core::RefCounted*>(mRO); } RenderCommandType::eRenderCMDType GetType() const{ return (NULL == mRO)? RenderCommandType::InvalidRenderCMDType : mRO->GetRenderCommandType(); } bool IsValid() const{ return mRO != NULL; } operator bool() const{ return mRO != NULL; } bool operator!=(const RenderResourceHandle& rhs) const{ return this->mRO != rhs.mRO; } bool operator==(const RenderResourceHandle& rhs) const{ return this->mRO == rhs.mRO; } bool operator<(const RenderResourceHandle& rhs) const{ return this->mRO < rhs.mRO; } //------------------------------------------------------------------------ bool operator<=(const RenderResourceHandle& rhs) const{ return this->mRO <= rhs.mRO; } //------------------------------------------------------------------------ bool operator>(const RenderResourceHandle& rhs) const{ return this->mRO > rhs.mRO; } //------------------------------------------------------------------------ bool operator>=(const RenderResourceHandle& rhs) const{ return this->mRO >= rhs.mRO; } protected: // 线程安全: 绝对不允许直接在RenderSystem以外访问RenderCommandType的数据 // 所有的访问都要通过RenderSystem来访问 RenderCommandType* mRO; friend class RenderSystem; }; typedef RenderResourceHandle PrimitiveHandle; typedef RenderResourceHandle RenderTargetHandle; typedef RenderResourceHandle MultipleRenderTargetHandle; typedef RenderResourceHandle GPUProgramHandle; typedef RenderResourceHandle TextureHandle; typedef RenderResourceHandle RenderStateDescHandle; enum FillMode { eFMPOINT, eFMWIREFRAME, eFMSOLID }; struct FillModeConverter { /// convert from string static FillMode FromString(Util::String str); /// convert to string static Util::String ToString(FillMode code); }; enum CullMode { eCMNONE, eCMFRONT, eCMBACK }; struct CullModeConverter { /// convert from string static CullMode FromString(Util::String str); /// convert to string static Util::String ToString(CullMode code); }; enum BlendOperation { eBOADD = 1, eBOSUBSTRACT = 2, eBOREVSUBTRACT = 3, eBOMIN = 4, eBOMAX = 5, }; struct BlendOperationConverter { /// convert from string static BlendOperation FromString(Util::String str); /// convert to string static Util::String ToString(BlendOperation bo); }; enum BlendFactor { eBFZERO, eBFONE, eBFSRCCOLOR, eBFINVSRCCOLOR, eBFSRCALPHA, eBFINVSRCALPHA, eBFDSTALPHA, eBFINVDESTALPHA, eBFDESTCOLOR, eBFINVDESTCOLOR, eBFSRCALPHASAT }; struct AlphaBlendFactorConverter { /// convert from string static BlendFactor FromString(Util::String str); /// convert to string static Util::String ToString(BlendFactor bo); }; enum CompareFunction { eCFNEVER, eCFLESS, eCFEQUAL, eCFLESSEQUAL, eCFGREATER, eCFNOTEQUAL, eCFGREATEREQUAL, eCFALWAYS, }; struct CompareFunctionConverter { /// convert from string static CompareFunction FromString(Util::String str); /// convert to string static Util::String ToString(CompareFunction cf); }; enum StencilOperation { eSOKEEP, eSOZERO, eSOREPLACE, eSOINCR, eSODECR, eSOINCRWRAP, eSODECRSAT, eSOINVERT }; enum ColorMask { eCOLORMASKRED = 1UL << 3, eCOLORMASKGREEN = 1UL << 2, eCOLORMASKBLUE = 1UL << 1, eCOLORMASKALPHA = 1UL << 0, eCOLORMASKRGB = eCOLORMASKRED | eCOLORMASKGREEN | eCOLORMASKBLUE, eCOLORMASKRGBA = eCOLORMASKRED | eCOLORMASKGREEN | eCOLORMASKBLUE | eCOLORMASKALPHA }; struct ColorMaskConverter { /// convert from string static ColorMask FromString(Util::String str); /// convert to string static Util::String ToString(ColorMask cm); }; enum TextureAddressMode { eTAMWRAP, eTAMMIRROR, eTAMCLAMP, eTAMBORDER }; struct TextureAddressModeConverter { /// convert from string static TextureAddressMode FromString(Util::String str); /// convert to string static Util::String ToString(TextureAddressMode tam); }; enum TextureFilter { eTFPOINT, eTFLINEAR, eTFANISOTROPIC, }; struct TextureFilterOperationConverter { /// convert from string static TextureFilter FromString(Util::String str); /// convert to string static Util::String ToString(TextureFilter tfo); }; struct DeviceRasterizerState { FillMode m_fillMode; CullMode m_cullMode; float m_slopScaleDepthBias; float m_depthBias; bool m_scissorTestEnable; bool m_multisampleEnable; DeviceRasterizerState(); }; struct DeviceDepthAndStencilState { bool m_depthEnable; bool m_depthWriteMask; CompareFunction m_zFunc; int m_stencilRef; bool m_stencilEnable; CompareFunction m_stencilFunc; unsigned short m_stencilReadMask; unsigned short m_stencilWriteMask; StencilOperation m_stencilFail; StencilOperation m_stencilZFail; StencilOperation m_stencilPass; bool m_stencilTwoEnable; CompareFunction m_StencilTwoFunc; unsigned short m_stencilTwoReadMask; unsigned short m_stencilTwoWriteMask; StencilOperation m_stencilTwoFail; StencilOperation m_stencilTwoZFail; StencilOperation m_stencilTwoPass; DeviceDepthAndStencilState(); }; struct DeviceBlendState { bool m_alphaTestEnable; bool m_separateAlphaBlendEnable; CompareFunction m_alphaFunc; float m_alphaRef; Util::Array<bool> m_alphaBlendEnable; Util::Array<BlendOperation> m_blendOP; Util::Array<BlendFactor> m_srcBlend; Util::Array<BlendFactor> m_destBlend; Util::Array<BlendOperation> m_blendOPAlpha; Util::Array<BlendFactor> m_srcBlendAlpha; Util::Array<BlendFactor> m_destBlendAlpha; Util::Array<unsigned short int> m_colorWriteMask; DeviceBlendState(); }; struct DeviceSamplerState { Util::Array<bool> m_textureIndexEnable; Util::Array<TextureAddressMode> m_addressU; Util::Array<TextureAddressMode> m_addressV; Util::Array<TextureAddressMode> m_addressW; Util::Array<Util::String> m_textureType; Util::Array<TextureFilter> m_Filter; Util::Array<unsigned char> m_maxAnisotropy; DeviceSamplerState(); }; class PrimitiveTopology { public: /// enumeration enum Code { InvalidPrimitiveTopology, PointList, LineList, LineStrip, TriangleList, TriangleStrip, }; /// convert from string static Code FromString(const Util::String& str); /// convert to string static Util::String ToString(Code code); }; class ImageFileFormat { public: /// image file formats enum Code { BMP, JPG, PNG, DDS, InvalidImageFileFormat, }; /// convert from string static Code FromString(const Util::String& str); /// convert to string static Util::String ToString(Code c); /// convert from media type (MIME) static Code FromMediaType(const IO::MediaType& mediaType); /// convert to media type (MIME) static IO::MediaType ToMediaType(Code c); }; class AntiAliasQuality { public: /// enum enum Code { None, Low, Medium, High, }; /// convert from string static Code FromString(const Util::String& str); /// convert to string static Util::String ToString(Code code); }; struct BoolModeConverter { /// convert from string static bool FromString(Util::String str); /// convert to string static Util::String ToString(bool b); }; } #endif //RENDERDEVICETYPES_H_
[ "jiangtao@tao-studio.net" ]
jiangtao@tao-studio.net
45705f9bc7548408761569a8491f279fe331a484
d349bfa73e751a8a6935fc12798fea5ce1a3a4d3
/Src/Sound/MPEG/position.cpp
296489a3cd67d57ced9846e10b7a92d1cdbcb1e7
[]
no_license
svn2github/supermodel
eb68bc17d9460133ed31a9a0fdf5130f880fd414
e528cb9e7ac2fc9258ff14a4e705a914d6107e75
refs/heads/master
2023-09-03T14:38:24.259632
2019-01-16T01:07:56
2019-01-16T01:07:56
144,584,755
3
0
null
null
null
null
UTF-8
C++
false
false
3,903
cpp
/** ** Supermodel ** A Sega Model 3 Arcade Emulator. ** Copyright 2011 Bart Trzynadlowski, Nik Henson ** ** This file is part of Supermodel. ** ** Supermodel 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. ** ** Supermodel 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 Supermodel. If not, see <http://www.gnu.org/licenses/>. **/ /* * position.cpp * * Amp library internal module. */ /* this file is a part of amp software, (C) tomislav uzelac 1996,1997 */ /* position.c ffwd/rew within a stream * * Creted by: Tomislav Uzelac, May 10 1997 */ #include <stdlib.h> #include <string.h> #include "amp.h" #include "amp_audio.h" #include "getbits.h" #define POSITION #include "position.h" /* Returns the number of frames actually skipped, -1 on error. * * Values in header are not changed if retval!=nframes. * This is not necessary because gethdr() doesn't clobber * the contents of header, but I don't want to rely on that. */ int ffwd(struct AUDIO_HEADER *header, int nframes) { int cnt=0,g; int hsize,bitrate,fs,mean_frame_size; struct AUDIO_HEADER tmp; memcpy(&tmp,header,sizeof(tmp)); while (cnt < nframes) { if (tmp.ID) if (tmp.mode==3) hsize=21; else hsize=36; else if (tmp.mode==3) hsize=13; else hsize=21; if (tmp.protection_bit==0) hsize+=2; if ((g=dummy_getinfo(hsize))) /* dummy_getinfo: reads hsize-4 bytes */ switch (g) { case GETHDR_EOF: return cnt; case GETHDR_ERR: default: return -1; } bitrate=t_bitrate[tmp.ID][3-tmp.layer][tmp.bitrate_index]; fs=t_sampling_frequency[tmp.ID][tmp.sampling_frequency]; if (tmp.ID) mean_frame_size=144000*bitrate/fs; else mean_frame_size=72000*bitrate/fs; fillbfr(mean_frame_size + tmp.padding_bit - hsize); if ((g=gethdr(&tmp))) switch (g) { case GETHDR_EOF: return cnt; case GETHDR_ERR: default: return -1; } cnt++; } memcpy(header,&tmp,sizeof(tmp)); return cnt; } /* Mostly the same as ffwd. Some streams might be 'tough', i.e. * the ones switching bitrates. */ int rew(struct AUDIO_HEADER *header, int nframes) { int cnt=0; int bitrate,fs,mean_frame_size; struct AUDIO_HEADER tmp; memcpy(&tmp,header,sizeof(tmp)); while (cnt < nframes) { /* ffwd/rew functions are to be called right after the header has been parsed * so we have to go back one frame + 4 bytes + 1 byte (in case padding was used). */ bitrate=t_bitrate[tmp.ID][3-tmp.layer][tmp.bitrate_index]; fs=t_sampling_frequency[tmp.ID][tmp.sampling_frequency]; if (tmp.ID) mean_frame_size=144000*bitrate/fs; else mean_frame_size=72000*bitrate/fs; if (rewind_stream(mean_frame_size) !=0) { memcpy(header,&tmp,sizeof(tmp)); return cnt; } if ((gethdr(&tmp))) return -1; cnt++; } /* We have to make sure that the bit reservoir contains enough data. * Hopefully, layer3_frame will take care of that. */ f_bdirty=TRUE; bclean_bytes=0; memcpy(header,&tmp,sizeof(tmp)); return cnt; } /* TODO: after the gethdr function is enhanced with the counter to count * the number of bytes to search for the next syncword, make the call to * gethdr() from rew() have that counter something like (frame_size-1) so * that we don't go back again and again to the same header. (not very important) */
[ "trzy@48849e4c-6218-0410-9df5-a815ca0b3254" ]
trzy@48849e4c-6218-0410-9df5-a815ca0b3254
f5597f7c8db9b6d6ea9c57c6880d059fe933926f
dd9b5bdca831aa90b6572a59d15a314230cd4e45
/longest_substring_without_repeat.cpp
5016e550d031019f0ae6294683d317c59e217ae6
[]
no_license
kishankr7979/CP
62fdea662b391a132cdb2b55dc2a845e44790d53
150e304eea519a964d34e4e9ffd49cac5dad5198
refs/heads/main
2023-06-18T06:47:52.908559
2021-07-17T14:26:25
2021-07-17T14:26:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,052
cpp
s#include <bits/stdc++.h> using namespace std; using ll = long long; int longestUniqueSubsttr(string S) { //code int n = S.size(), ans = INT_MIN; for (int i = 0; i < n; i++) { map<char, int> m; for (int j = 0; j < n; j++) { if (m.find(S[j]) == m.end()) { m[S[j]] = 1; ans = max(ans, j - i + 1); } else break; } } return ans; } //O(N) approach class Solution { public: int lengthOfLongestSubstring(string s) { int n = s.size(), ans = 0; int l = 0, r = 0; map<char, int> m; while (r < n) { if (m.find(s[r]) != m.end()) { l = max(l, m[s[r]] + 1); } m[s[r]] = r; ans = max(ans, r - l + 1); r++; } return ans; } }; class Solution { public: int lengthOfLongestSubstring(string s) { int n = s.size(), ans = 0; int l = 0, r = 0; vector<int> m(256, -1); while (r < n) { if (m[s[r]] != -1) { l = max(l, m[s[r]] + 1); } m[s[r]] = r; ans = max(ans, r - l + 1); r++; } return ans; } }; int longestUniqueSubstr(string S) { /*int n = S.size(), ans = 0; int l = 0, r = 0; map<int, int> m; while (r < n && l < n) { if (m.find(S[r]) == m.end())//m.find() will give wrong answer { ans = max(ans, r - l + 1); m[S[r++]]++; } else { m[S[l++]]--; ans = max(ans, r - l + 1); m[S[l]]++; } } return ans;*/ int n = S.size(), ans = 0; int l = 0, r = 0; map<char, int> m; while (r < n && l < n) { if (m[S[r]] == 0) { ans = max(ans, r - l + 1); m[S[r++]]++; } else { m[S[l++]]--; /*ans = max(ans, r - l + 1); m[S[l]]++;*/ } } return ans; } //Think about the sliding window technique. class Solution { public: int largestsubstring(string s) { int n = s.size(); int res = 0; // result // last index of all characters is initialized // as -1 vector<int> lastIndex(256, -1); // Initialize start of current window int i = 0; // Move end of current window for (int j = 0; j < n; j++) { // Find the last index of s[j] // Update i (starting index of current window) // as maximum of current value of i and last // index plus 1 i = max(i, lastIndex[s[j]] + 1); // Update result if we get a larger window res = max(res, j - i + 1); // Update last index of j. lastIndex[s[j]] = j; } return res; } }; class Solution { public: int lengthOfLongestSubstring(string s) { int n = s.size(); if (n == 0) return 0; int i = 0, j = 0, ans = 1; //initially window is of size 1 ans is 1 i.e window size 1 vector <int> cnt(300, 0); //maintaining count on every window size cnt[s[0]]++;//since window is of size 1 we increment the count of first character while (j != n - 1) { if (cnt[s[j + 1]] == 0) //if next element is nnot present we increment the window size { j++; cnt[s[j]]++;//setting the count of the current eement i.e next elemt in wndow ans = max(ans, j - i + 1); //maintaining local maxima in every window size } else { cnt[s[i]]--;//if cnt of next element is there then we decrement window size i++; } } return ans; } }; int longestSubstringWithoutRepeat(string s) { int n = s.size(); if (n == 0) return 0; int i = 0, j = 0, ans = 1; vector<int> cnt(300, 0); cnt[s[0]]++; while (j != n - 1) { if (cnt[s[j + 1]] == 0) { j++; cnt[s[j]]++; ans = max(ans, j - i + 1); } else { cnt[s[i++]]--; } } return ans; } void printlongestSubstringWithoutRepeat(string s) { int i = 0, j = 0, ans = 1, start = 0, n = s.size(); vector<int> cnt(326, 0); cnt[s[0]]++; while (j != n - 1) { if (cnt[s[j + 1]] == 0) { j++; cnt[s[j]]++; if (ans < (j - i + 1)) { ans = j - i + 1; start = i; } } else { cnt[s[i++]]--; } } for (int i = start; i < start + ans; i++) { cout << s[i]; } cout << endl; } int main() { ios_base :: sync_with_stdio(false); //cin.tie(NULL); //cout.tie(NULL); int T; cin >> T; while (T--) { string s; cin >> s; printlongestSubstringWithoutRepeat(s); } return 0; }
[ "umaidansari123@gmail.com" ]
umaidansari123@gmail.com
dac959115d5ff49c4e0c06c698526f18ddf50622
d78ab1e4cb8a669fbd4b5346683345c3926f4e07
/Editor/scintilla/src/LexVerilog.cxx
21697abf142c6ba0a0c76dd1ca7cb86ee0b9cae3
[ "LicenseRef-scancode-unknown-license-reference", "Artistic-2.0", "LicenseRef-scancode-scintilla" ]
permissive
sonneveld/ags
4baca2321a1c1a13621322eb107d5338e9231fbf
539a40a25f4caa7b7cec678084cfcde252418c77
refs/heads/ags3--sdl2
2022-04-30T19:38:51.480211
2019-07-27T11:08:38
2019-11-03T06:53:44
40,235,193
2
0
NOASSERTION
2022-02-20T11:15:37
2015-08-05T08:54:39
C
UTF-8
C++
false
false
10,394
cxx
// Scintilla source code edit control /** @file LexVerilog.cxx ** Lexer for Verilog. ** Written by Avi Yegudin, based on C++ lexer by Neil Hodgson **/ // Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org> // The License.txt file describes the conditions under which this software may be distributed. #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdarg.h> #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '\''); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '$'); } static void ColouriseVerilogDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; // Do not leak onto next line if (initStyle == SCE_V_STRINGEOL) initStyle = SCE_V_DEFAULT; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.atLineStart && (sc.state == SCE_V_STRING)) { // Prevent SCE_V_STRINGEOL from leaking back to previous line sc.SetState(SCE_V_STRING); } // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate. if (sc.state == SCE_V_OPERATOR) { sc.SetState(SCE_V_DEFAULT); } else if (sc.state == SCE_V_NUMBER) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_V_DEFAULT); } } else if (sc.state == SCE_V_IDENTIFIER) { if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { char s[100]; sc.GetCurrent(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_V_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_V_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_V_WORD3); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_V_USER); } sc.SetState(SCE_V_DEFAULT); } } else if (sc.state == SCE_V_PREPROCESSOR) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_V_DEFAULT); } } else if (sc.state == SCE_V_COMMENT) { if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_V_DEFAULT); } } else if (sc.state == SCE_V_COMMENTLINE || sc.state == SCE_V_COMMENTLINEBANG) { if (sc.atLineEnd) { sc.SetState(SCE_V_DEFAULT); } } else if (sc.state == SCE_V_STRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_V_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_V_STRINGEOL); sc.ForwardSetState(SCE_V_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_V_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '\'') || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_V_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_V_IDENTIFIER); } else if (sc.Match('/', '*')) { sc.SetState(SCE_V_COMMENT); sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { if (sc.Match("//!")) // Nice to have a different comment style sc.SetState(SCE_V_COMMENTLINEBANG); else sc.SetState(SCE_V_COMMENTLINE); } else if (sc.ch == '\"') { sc.SetState(SCE_V_STRING); } else if (sc.ch == '`') { sc.SetState(SCE_V_PREPROCESSOR); // Skip whitespace between ` and preprocessor word do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); if (sc.atLineEnd) { sc.SetState(SCE_V_DEFAULT); } } else if (isoperator(static_cast<char>(sc.ch)) || sc.ch == '@' || sc.ch == '#') { sc.SetState(SCE_V_OPERATOR); } } } sc.Complete(); } static bool IsStreamCommentStyle(int style) { return style == SCE_V_COMMENT; } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". static void FoldNoBoxVerilogDoc(unsigned int startPos, int length, int initStyle, Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0; // Verilog specific folding options: // fold_at_module - // Generally used methodology in verilog code is // one module per file, so folding at module definition is useless. // fold_at_brace/parenthese - // Folding of long port lists can be convenient. bool foldAtModule = styler.GetPropertyInt("fold.verilog.flags", 0) != 0; bool foldAtBrace = 1; bool foldAtParenthese = 1; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev)) { levelNext++; } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelNext--; } } if (foldComment && (style == SCE_V_COMMENTLINE)) { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelNext++; } else if (chNext2 == '}') { levelNext--; } } } if (foldPreprocessor && (style == SCE_V_PREPROCESSOR)) { if (ch == '`') { unsigned int j = i + 1; while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { j++; } if (styler.Match(j, "if")) { levelNext++; } else if (styler.Match(j, "end")) { levelNext--; } } } if (style == SCE_V_OPERATOR) { if (foldAtParenthese) { if (ch == '(') { levelNext++; } else if (ch == ')') { levelNext--; } } } if (style == SCE_V_OPERATOR) { if (foldAtBrace) { if (ch == '{') { levelNext++; } else if (ch == '}') { levelNext--; } } } if (style == SCE_V_WORD && stylePrev != SCE_V_WORD) { unsigned int j = i; if (styler.Match(j, "case") || styler.Match(j, "casex") || styler.Match(j, "casez") || styler.Match(j, "function") || styler.Match(j, "fork") || styler.Match(j, "table") || styler.Match(j, "task") || styler.Match(j, "specify") || styler.Match(j, "primitive") || styler.Match(j, "module") && foldAtModule || styler.Match(j, "begin")) { levelNext++; } else if (styler.Match(j, "endcase") || styler.Match(j, "endfunction") || styler.Match(j, "join") || styler.Match(j, "endtask") || styler.Match(j, "endtable") || styler.Match(j, "endspecify") || styler.Match(j, "endprimitive") || styler.Match(j, "endmodule") && foldAtModule || styler.Match(j, "end") && !IsAWordChar(styler.SafeGetCharAt(j+3))) { levelNext--; } } if (atEOL) { int levelUse = levelCurrent; if (foldAtElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } } static void FoldVerilogDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { FoldNoBoxVerilogDoc(startPos, length, initStyle, styler); } static const char * const verilogWordLists[] = { "Primary keywords and identifiers", "Secondary keywords and identifiers", "System Tasks", "User defined tasks and identifiers", "Unused", 0, }; LexerModule lmVerilog(SCLEX_VERILOG, ColouriseVerilogDoc, "verilog", FoldVerilogDoc, verilogWordLists);
[ "tobias.han@gmx.de" ]
tobias.han@gmx.de
ba8914ec53364ab18448d3b09f9474f371300460
87182ccf68cc0184e16e2bda314eeda2ac89f8fb
/skelletal code/wxraytracer/wxRaytracer/wxwidgets/include/wx/html/helpctrl.h
a3bb85dbe1ca0752d78b3774c5abb36eb7319cf0
[]
no_license
hamidib/raytrace
0cb1c9ad9a11a1893c36f3e371687135542f1dc9
892930aa2408341aa25afa58f8b3778d24632a23
refs/heads/master
2021-05-08T06:56:15.212204
2017-12-08T21:35:30
2017-12-08T21:35:30
106,647,448
0
0
null
null
null
null
UTF-8
C++
false
false
5,651
h
///////////////////////////////////////////////////////////////////////////// // Name: helpctrl.h // Purpose: wxHtmlHelpController // Notes: Based on htmlhelp.cpp, implementing a monolithic // HTML Help controller class, by Vaclav Slavik // Author: Harm van der Heijden and Vaclav Slavik // RCS-ID: $Id: helpctrl.h,v 1.36 2006/01/11 09:08:31 JS Exp $ // Copyright: (c) Harm van der Heijden and Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HELPCTRL_H_ #define _WX_HELPCTRL_H_ #include "wx/defs.h" #if wxUSE_WXHTML_HELP #include "wx/helpbase.h" #include "wx/html/helpfrm.h" #define wxID_HTML_HELPFRAME (wxID_HIGHEST + 1) // This style indicates that the window is // embedded in the application and must not be // destroyed by the help controller. #define wxHF_EMBEDDED 0x00008000 // Create a dialog for the help window. #define wxHF_DIALOG 0x00010000 // Create a frame for the help window. #define wxHF_FRAME 0x00020000 // Make the dialog modal when displaying help. #define wxHF_MODAL 0x00040000 class WXDLLIMPEXP_HTML wxHtmlHelpDialog; class WXDLLIMPEXP_HTML wxHtmlHelpWindow; class WXDLLIMPEXP_HTML wxHtmlHelpFrame; class WXDLLIMPEXP_HTML wxHtmlHelpDialog; class WXDLLIMPEXP_HTML wxHtmlHelpController : public wxHelpControllerBase // wxEvtHandler { DECLARE_DYNAMIC_CLASS(wxHtmlHelpController) public: wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE, wxWindow* parentWindow = NULL); virtual ~wxHtmlHelpController(); void SetTitleFormat(const wxString& format); void SetTempDir(const wxString& path) { m_helpData.SetTempDir(path); } bool AddBook(const wxString& book_url, bool show_wait_msg = false); bool AddBook(const wxFileName& book_file, bool show_wait_msg = false); bool Display(const wxString& x); bool Display(int id); bool DisplayContents(); bool DisplayIndex(); bool KeywordSearch(const wxString& keyword, wxHelpSearchMode mode = wxHELP_SEARCH_ALL); wxHtmlHelpWindow* GetHelpWindow() { return m_helpWindow; } void SetHelpWindow(wxHtmlHelpWindow* helpWindow); wxHtmlHelpFrame* GetFrame() { return m_helpFrame; } wxHtmlHelpDialog* GetDialog() { return m_helpDialog; } void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); // Assigns config object to the Ctrl. This config is then // used in subsequent calls to Read/WriteCustomization of both help // Ctrl and it's wxHtmlWindow virtual void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); virtual void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); //// Backward compatibility with wxHelpController API virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize(file); } virtual bool Initialize(const wxString& file); virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {} virtual bool LoadFile(const wxString& file = wxT("")); virtual bool DisplaySection(int sectionNo); virtual bool DisplaySection(const wxString& section) { return Display(section); } virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); } virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos); virtual void SetFrameParameters(const wxString& title, const wxSize& size, const wxPoint& pos = wxDefaultPosition, bool newFrameEachTime = false); /// Obtains the latest settings used by the help frame and the help /// frame. virtual wxFrame *GetFrameParameters(wxSize *size = NULL, wxPoint *pos = NULL, bool *newFrameEachTime = NULL); // Get direct access to help data: wxHtmlHelpData *GetHelpData() { return &m_helpData; } virtual bool Quit() ; virtual void OnQuit() {} void OnCloseFrame(wxCloseEvent& evt); // Make the help controller's frame 'modal' if // needed void MakeModalIfNeeded(); // Find the top-most parent window wxWindow* FindTopLevelWindow(); protected: virtual wxWindow* CreateHelpWindow(); virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData *data); virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData *data); virtual void DestroyHelpWindow(); wxHtmlHelpData m_helpData; wxHtmlHelpWindow* m_helpWindow; wxConfigBase * m_Config; wxString m_ConfigRoot; wxString m_titleFormat; int m_FrameStyle; wxHtmlHelpFrame* m_helpFrame; wxHtmlHelpDialog* m_helpDialog; DECLARE_NO_COPY_CLASS(wxHtmlHelpController) }; /* * wxHtmlModalHelp * A convenience class particularly for use on wxMac, * where you can only show modal dialogs from a modal * dialog. * * Use like this: * * wxHtmlModalHelp help(parent, filename, topic); * * If topic is empty, the help contents is displayed. */ class WXDLLIMPEXP_HTML wxHtmlModalHelp { public: wxHtmlModalHelp(wxWindow* parent, const wxString& helpFile, const wxString& topic = wxEmptyString, int style = wxHF_DEFAULT_STYLE | wxHF_DIALOG | wxHF_MODAL); }; #endif // wxUSE_WXHTML_HELP #endif // _WX_HELPCTRL_H_
[ "bhamidi@csu.fullerton.edu" ]
bhamidi@csu.fullerton.edu
8ad8448f522632c4562f05b5bfb950296992b58a
d4e96aa48ddff651558a3fe2212ebb3a3afe5ac3
/Modules/Filtering/MathematicalMorphology/include/itkMovingHistogramErodeImageFilter.h
cd7c866c4dc9bebe0d415778d30b5b6dcf79d5c5
[ "SMLNJ", "BSD-3-Clause", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-mit-old-style", "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer", "NTP", "IJG", "GPL-1.0-or-later", "libtiff", "BSD-4.3TAHOE", "...
permissive
nalinimsingh/ITK_4D
18e8929672df64df58a6446f047e6ec04d3c2616
95a2eacaeaffe572889832ef0894239f89e3f303
refs/heads/master
2020-03-17T18:58:50.953317
2018-10-01T20:46:43
2018-10-01T21:21:01
133,841,430
0
0
Apache-2.0
2018-05-17T16:34:54
2018-05-17T16:34:53
null
UTF-8
C++
false
false
4,426
h
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef itkMovingHistogramErodeImageFilter_h #define itkMovingHistogramErodeImageFilter_h #include "itkMovingHistogramMorphologyImageFilter.h" namespace itk { /** * \class MovingHistogramErodeImageFilter * \brief gray scale erosion of an image * * Erode an image using grayscale morphology. Erode takes the * minimum of all the pixels identified by the structuring element. * * The structuring element is assumed to be composed of binary * values (zero or one). Only elements of the structuring element * having values > 0 are candidates for affecting the center pixel. * * \sa MorphologyImageFilter, GrayscaleFunctionMorphologicalGradientImageFilter, BinaryMorphologicalGradientImageFilter * \ingroup ImageEnhancement MathematicalMorphologyImageFilters * \ingroup ITKMathematicalMorphology */ template< typename TInputImage, typename TOutputImage, typename TKernel > class MovingHistogramErodeImageFilter: public MovingHistogramMorphologyImageFilter< TInputImage, TOutputImage, TKernel, typename Function::MorphologyHistogram< typename TInputImage::PixelType, typename std::less< typename TInputImage ::PixelType > > > { public: /** Standard class typedefs. */ typedef MovingHistogramErodeImageFilter Self; typedef MovingHistogramMorphologyImageFilter< TInputImage, TOutputImage, TKernel, typename Function::MorphologyHistogram< typename TInputImage::PixelType, typename std::less< typename TInputImage ::PixelType > > > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Standard New method. */ itkNewMacro(Self); /** Runtime information support. */ itkTypeMacro(MovingHistogramErodeImageFilter, MovingHistogramMorphologyImageFilter); /** Image related typedefs. */ typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; typedef typename TInputImage::RegionType RegionType; typedef typename TInputImage::SizeType SizeType; typedef typename TInputImage::IndexType IndexType; typedef typename TInputImage::PixelType PixelType; typedef typename TInputImage::OffsetType OffsetType; typedef typename Superclass::OutputImageRegionType OutputImageRegionType; typedef typename TOutputImage::PixelType OutputPixelType; /** Image related typedefs. */ itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension); protected: MovingHistogramErodeImageFilter() { this->m_Boundary = NumericTraits< PixelType >::max(); } ~MovingHistogramErodeImageFilter() {} private: ITK_DISALLOW_COPY_AND_ASSIGN(MovingHistogramErodeImageFilter); }; // end of class } // end namespace itk #endif
[ "ruizhi@csail.mit.edu" ]
ruizhi@csail.mit.edu
7f7d899d181a769d007fff130bc7f06ca87e565a
4341fc406772b34c7c6cd4a764fefdf96a39e4be
/Project1/41函数:定义、样式、声明.cpp
89e8b210275d511193629ea70552d4637ec9505f
[]
no_license
dogballlee/road_2_machine_learning
fd6695681dbdc1c940d72d496479a5e6d29a18a1
0283ebac4d6cf4425a2924c088c05e9b0a67658e
refs/heads/master
2021-11-04T00:36:12.149597
2021-09-12T01:57:27
2021-09-12T01:57:27
181,323,668
0
0
null
null
null
null
GB18030
C++
false
false
1,264
cpp
#include<iostream> using namespace std; //函数的要素:返回值类型、函数名、参数列表、函数体语句、return表达式 //函数的声明(以下未举例):用于提前告知编译器函数的存在,让定义于后方的函数能够被前方的程序段执行而不报错 //函数的声明可以写多次,但是函数只能定义一次 int add(int num1, int num2) { int sum = num1 + num2; return sum; } //如果函数不需要返回值,声明的时候可以写void,这时不需要再写return了 void swap1(int num1, int num2) { cout << "交换前:" << endl; cout << "num1=" << num1 << endl; cout << "num2=" << num2 << endl; int t = num2; num2 = num1; num1 = t; cout << "交换后:" << endl; cout << "num1=" << num1 << endl; cout << "num2=" << num2 << endl; } //函数常见的样式 /* 1、无参有反 2、有参无反 3、无参无反 4、有参有返 */ int main41() { int a = 10; int b = 20; int sum = add(a, b); swap1(a, b); cout << "sum:" << sum << endl; cout << "a转换后:" << a << endl; cout << "b转换后:" << b << endl; //函数值传递只会改变形参,实参不会被改变 system("pause"); return 0; }
[ "noreply@github.com" ]
noreply@github.com
278b2cf08a952be603896cb37c3ae4fa199fc8e9
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5709773144064000_1/C++/kdq1992/E.cc
689525ef4c9b63464847d2920f8b2df9929b0966
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
C++
false
false
1,082
cc
#include <iostream> #include <cstdio> #include <cmath> #include <string> #include <cstring> #include <cstdlib> #include <algorithm> #define ll long long using namespace std; #define N 111111 int main() { freopen("B-large.in" , "r" , stdin) ; freopen("B-large.out" , "w" , stdout) ; int T ; cin >> T ; int ca = 0 ; while(T -- ) { double c , f , x ; cin >> c >> f >> x ; double t = 0 ; double now = 0 ; double add = 2 ; if(c >= x) printf("Case #%d: %.7f\n" ,++ ca , x / 2) ; else { while(now < x) { // double t1 = (x - now) / add ; double t2 = (c - now) / add + x / (add + f) ; if(t1 > t2) { t += (c - now) / add ; add = add + f ; } else { t += t1 ; break ; } } printf("Case #%d: %.7f\n",++ ca , t) ; } } return 0 ; }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
91c44ceb3e8cd3eb463a924f9621de24f178adb8
ef98d98431ff8a324863cc26302f16ac1f1e9151
/SINRGE2 Core/CRbPlane.h
200361d86630ae0ebe1350e620986816ed3c56c7
[ "Zlib" ]
permissive
orochi2k/SINRGE2
41542dc295a8ef475160a45bfa81d9cf401270ec
66ca171f21c042ad4c978c2965b06ed918af5f24
refs/heads/master
2023-03-18T00:41:19.460037
2018-09-01T03:35:23
2018-09-01T03:35:23
null
0
0
null
null
null
null
GB18030
C++
false
false
1,338
h
/* ** SINRGE2 ** Copyright (C) 2013 Syalon, Shy07 ** Gernischt@gmail.com ** ** Ruby Class Plane */ #ifndef __C_RB_PLANE_H__ #define __C_RB_PLANE_H__ #include "CRbDisplayObject.h" class SinSprite; class CRbBitmap; class CRbColor; class CRbTone; class CRbPlane : public DisplayObject { public: typedef DisplayObject super; public: CRbPlane(); virtual ~CRbPlane(); public: static void InitLibrary(); protected: virtual void mark(); virtual VALUE initialize(int argc, VALUE * argv, VALUE obj); virtual void render(u32 id); virtual VALUE get_z(); virtual VALUE set_z(VALUE z); virtual VALUE set_viewport(VALUE viewport); protected: void process_tone_texture(); protected: RbRenderNode * m_node; int m_opacity; int m_blend_type; int m_save_blend_type; // 保存位图修改计数值和先前色调值 s32 m_ref_bitmap_modify_count; DWORD m_ref_tone; HTEXTURE m_tone_tex; int m_tone_tex_width; int m_tone_tex_height; SinSprite * m_pSpr; CRbBitmap * m_bitmap_ptr; CRbColor * m_color_ptr; CRbTone * m_tone_ptr; protected: void check_raise(); protected: dm_method(dispose) dm_method(is_disposed) attr_accessor(bitmap) attr_accessor(zoom_x) attr_accessor(zoom_y) attr_accessor(opacity) attr_accessor(blend_type) attr_accessor(color) attr_accessor(tone) }; #endif
[ "Gernischt@gmail.com" ]
Gernischt@gmail.com
fff84c3017be696d28f0e5c3b8696b1cb4819256
d17a8870ff8ac77b82d0d37e20c85b23aa29ca74
/lite/core/optimizer/mir/sparse_conv_detect_pass.cc
5b6054a1e678f94bea56cea49b88814f49119fb1
[ "Apache-2.0" ]
permissive
PaddlePaddle/Paddle-Lite
4ab49144073451d38da6f085a8c56822caecd5b2
e241420f813bd91f5164f0d9ee0bc44166c0a172
refs/heads/develop
2023-09-02T05:28:14.017104
2023-09-01T10:32:39
2023-09-01T10:32:39
104,208,128
2,545
1,041
Apache-2.0
2023-09-12T06:46:10
2017-09-20T11:41:42
C++
UTF-8
C++
false
false
32,924
cc
// Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // This pass intends to improve the latency performance of the convolutional // operations with the kernel size of 1x1. In practice, the pass requires the // convolutional weights to be sparse. And, the sparser the weights // are, the more latency improvement we would potentially obtain. #include "lite/core/optimizer/mir/sparse_conv_detect_pass.h" #include <math.h> #include <list> #include <memory> #include <stdexcept> #include <string> #include <utility> #include <vector> #include "lite/core/optimizer/mir/pass_registry.h" #include "lite/utils/string.h" namespace paddle { namespace lite { namespace mir { template <typename T> int SparseConvDetectPass::ComputeSparseWeight( const lite::Tensor* w_tensor, const int M, const int K, const int N, const int num_nonzeroes, lite::Tensor* nonzero_output_tensor, lite::Tensor* oc_nonzeros_tensor, lite::Tensor* diffs_tensor) { const T* weights = w_tensor->data<T>(); T* nonzero_output = nonzero_output_tensor->mutable_data<T>(); auto* oc_nonzeros = oc_nonzeros_tensor->mutable_data<uint32_t>(); auto* diffs = diffs_tensor->mutable_data<int32_t>(); int first_ic = 0, last_ic = 0; bool first_nonzero = true; int nonzero_index = 0, diff_index = 0; for (int ocb = 0; ocb < M; ocb++) { oc_nonzeros[ocb] = 0; for (int ic = 0; ic < K; ic++) { if (weights[ocb * K + ic] != static_cast<T>(0)) { nonzero_output[nonzero_index++] = weights[ocb * K + ic]; if (first_nonzero) { first_ic = ic; } else { const int diff = (ic - last_ic) * sizeof(T); diffs[diff_index++] = diff * N; } first_nonzero = false; last_ic = ic; oc_nonzeros[ocb] += 1; } } oc_nonzeros[ocb] = nonzero_index; } int tmp_diff = 0; int tmp_ik = 0; for (size_t ocb = 0; ocb < M; ocb++) { if (ocb == 0) { for (int ik = 0; ik < oc_nonzeros[ocb]; ik++) { tmp_diff += diffs[tmp_ik++]; } } else { for (int ik = 0; ik < (oc_nonzeros[ocb] - oc_nonzeros[ocb - 1]); ik++) { tmp_diff += diffs[tmp_ik++]; } } if (tmp_ik != 0) { diffs[tmp_ik - 1] = tmp_diff; } } if (!first_nonzero) { const int diff = (first_ic - last_ic) * sizeof(T); diffs[diff_index++] = diff * N; } return first_ic; } template <typename T> int SparseConvDetectPass::ComputeSparseWeight( const lite::Tensor* w_tensor, const int M, const int K, const int N, const int num_nonzeroes, const int num_build_nonzeroes, lite::Tensor* nonzero_output_tensor, lite::Tensor* oc_nonzeros_tensor, lite::Tensor* diffs_tensor) { const T* weights = w_tensor->data<T>(); T* nonzero_output = nonzero_output_tensor->mutable_data<T>(); auto* oc_nonzeros = oc_nonzeros_tensor->mutable_data<uint32_t>(); auto* diffs = diffs_tensor->mutable_data<int32_t>(); std::vector<int32_t> act_diffs; act_diffs.resize(num_nonzeroes); int first_ic = 0, last_ic = 0; bool first_nonzero = true; int nonzero_index = 0, diff_index = 0; for (int ocb = 0; ocb < M; ocb++) { oc_nonzeros[ocb] = 0; for (int ic = 0; ic < K; ic++) { if (weights[ocb * K + ic] != static_cast<T>(0)) { nonzero_output[nonzero_index++] = weights[ocb * K + ic]; if (first_nonzero) { first_ic = ic; } else { const int diff = (ic - last_ic) * sizeof(T); act_diffs[diff_index++] = diff * N; } first_nonzero = false; last_ic = ic; oc_nonzeros[ocb] += 1; } } if (oc_nonzeros[ocb] % 4 != 0) { int extra_zeros = 4 - (oc_nonzeros[ocb] % 4); for (int j = 0; j < extra_zeros; j++) { nonzero_output[nonzero_index++] = 0; } } if (ocb != 0) { int cur_rem = oc_nonzeros[ocb - 1] & 3; oc_nonzeros[ocb] = (cur_rem == 0) ? (oc_nonzeros[ocb] + oc_nonzeros[ocb - 1]) : (oc_nonzeros[ocb] + oc_nonzeros[ocb - 1] + 4 - cur_rem); } } if (!first_nonzero) { const int diff = (first_ic - last_ic) * sizeof(T); act_diffs[diff_index++] = diff * N; } int left_index = 0, right_index = 0; for (size_t ocb = 0; ocb < M; ocb++) { if (ocb == 0) { for (int i = 0; i < oc_nonzeros[ocb]; i++) { diffs[right_index++] = act_diffs[left_index++]; } if (oc_nonzeros[ocb] % 4 != 0) { size_t extra_zeros = 4 - (oc_nonzeros[ocb] % 4); for (int j = 0; j < extra_zeros; j++) { diffs[right_index++] = 0; } } } else { int cur_rem = oc_nonzeros[ocb - 1] & 3; int cur_num = (cur_rem == 0) ? (oc_nonzeros[ocb] - oc_nonzeros[ocb - 1]) : (oc_nonzeros[ocb] - (oc_nonzeros[ocb - 1] + 4 - cur_rem)); for (int i = 0; i < cur_num; i++) { diffs[right_index++] = act_diffs[left_index++]; } if (cur_num % 4 != 0) { size_t extra_zeros = 4 - (cur_num % 4); for (int j = 0; j < extra_zeros; j++) { diffs[right_index++] = 0; } } } } int tmp_diff = 0; int tmp_ik = 0; for (size_t ocb = 0; ocb < M; ocb++) { if (ocb == 0) { for (int ik = 0; ik < oc_nonzeros[ocb]; ik++) { tmp_diff += diffs[tmp_ik++]; } } else { for (int ik = 0; ik < (oc_nonzeros[ocb] - oc_nonzeros[ocb - 1]); ik++) { tmp_diff += diffs[tmp_ik++]; } } if (tmp_ik != 0) { diffs[tmp_ik - 1] = tmp_diff; } } return first_ic; } template <typename T> int SparseConvDetectPass::ComputeSemiSparseWeight( const lite::Tensor* w_tensor, const int M, const int K, const int N, const int count_nonzeroes, const int count_channels, const int count_blocks, lite::Tensor* nonzero_output_tensor, lite::Tensor* oc_nonzeros_tensor, lite::Tensor* diffs_tensor) { const T* weights = w_tensor->data<T>(); T* nonzero_output = nonzero_output_tensor->mutable_data<T>(); auto* oc_nonzeros = oc_nonzeros_tensor->mutable_data<uint32_t>(); auto* diffs = diffs_tensor->mutable_data<int32_t>(); int align2 = M & (-2); size_t output_channels_block_size = 2; size_t first_ic = 0, last_ic = 0; bool first_nonzero = true; int nonzero_index = 0, diff_index = 0; size_t block_index = 0, block_n = 0; for (size_t ocb = 0; ocb < align2; ocb += output_channels_block_size) { for (size_t ic = 0; ic < K; ic++) { bool is_nonzero_block = false; for (size_t oco = 0; oco < output_channels_block_size; oco++) { is_nonzero_block |= (weights[(ocb + oco) * K + ic] != static_cast<T>(0)); } if (is_nonzero_block) { for (size_t oco = 0; oco < output_channels_block_size; oco++) { nonzero_output[nonzero_index++] = weights[(ocb + oco) * K + ic]; } if (first_nonzero) { first_ic = ic; } else { const int diff = (ic - last_ic) * sizeof(T); diffs[diff_index++] = diff * N; } first_nonzero = false; last_ic = ic; oc_nonzeros[block_index] += 1; block_n++; } } oc_nonzeros[block_index++] = block_n; } for (size_t ocb = align2; ocb < M; ocb++) { for (size_t ic = 0; ic < K; ic++) { if (weights[ocb * K + ic] != static_cast<T>(0)) { nonzero_output[nonzero_index++] = weights[ocb * K + ic]; if (first_nonzero) { first_ic = ic; } else { const int diff = (ic - last_ic) * sizeof(T); diffs[diff_index++] = diff * N; } first_nonzero = false; last_ic = ic; oc_nonzeros[block_index] += 1; block_n++; } } oc_nonzeros[block_index++] = block_n; } int tmp_diff = 0; int tmp_ik = 0; size_t block_i = 0; for (size_t ocb = 0; ocb < align2; ocb += output_channels_block_size) { if (block_i == 0) { for (int ik = 0; ik < oc_nonzeros[block_i]; ik++) { tmp_diff += diffs[tmp_ik++]; } } else { for (int ik = 0; ik < (oc_nonzeros[block_i] - oc_nonzeros[block_i - 1]); ik++) { tmp_diff += diffs[tmp_ik++]; } } if (tmp_ik != 0) { diffs[tmp_ik - 1] = tmp_diff; } block_i++; } for (size_t ocb = align2; ocb < M; ocb++) { if (block_i == 0) { for (int ik = 0; ik < oc_nonzeros[block_i]; ik++) { tmp_diff += diffs[tmp_ik++]; } } else { for (int ik = 0; ik < (oc_nonzeros[block_i] - oc_nonzeros[block_i - 1]); ik++) { tmp_diff += diffs[tmp_ik++]; } } if (tmp_ik != 0) { diffs[tmp_ik - 1] = tmp_diff; } block_i++; } if (!first_nonzero) { const int diff = (first_ic - last_ic) * sizeof(T); diffs[diff_index++] = diff * N; } return first_ic; } template <typename T> int SparseConvDetectPass::ComputeSemiSparseZeros(const lite::Tensor* weights, int* count_nonzeroes, int* count_channels, int* count_blocks, int* flag_semi, const int height, const int width) { const T* data = weights->data<T>(); int num_nonzeroes = 0; int num_nonzero_blocks2 = 0; int num_nonzero_blocks4 = 0; int align4 = height & (-4); int align2 = height & (-2); for (size_t oc = 0; oc < align4; oc += 4) { for (size_t ic = 0; ic < width; ic++) { const size_t row0_nonzero = static_cast<size_t>(data[oc * width + ic] != static_cast<T>(0)); const size_t row1_nonzero = static_cast<size_t>(data[(oc + 1) * width + ic] != static_cast<T>(0)); const size_t row2_nonzero = static_cast<size_t>(data[(oc + 2) * width + ic] != static_cast<T>(0)); const size_t row3_nonzero = static_cast<size_t>(data[(oc + 3) * width + ic] != static_cast<T>(0)); num_nonzeroes += row0_nonzero + row1_nonzero + row2_nonzero + row3_nonzero; num_nonzero_blocks2 += (row0_nonzero | row1_nonzero) + (row2_nonzero | row3_nonzero); num_nonzero_blocks4 += (row0_nonzero | row1_nonzero | row2_nonzero | row3_nonzero); } } for (size_t oc = align4; oc < align2; oc += 2) { for (size_t ic = 0; ic < width; ic++) { const size_t row0_nonzero = static_cast<size_t>(data[oc * width + ic] != static_cast<T>(0)); const size_t row1_nonzero = static_cast<size_t>(data[(oc + 1) * width + ic] != static_cast<T>(0)); num_nonzeroes += row0_nonzero + row1_nonzero; num_nonzero_blocks2 += (row0_nonzero | row1_nonzero); } } const size_t num_block2_nonzeroes = num_nonzeroes; for (size_t oc = align2; oc < height; oc++) { for (size_t ic = 0; ic < width; ic++) { num_nonzeroes += static_cast<size_t>(data[oc * width + ic] != static_cast<T>(0)); } } *flag_semi = 0; *count_channels = height; *count_nonzeroes = num_nonzeroes; *count_blocks = num_nonzeroes; if (num_block2_nonzeroes * 5 >= num_nonzero_blocks2 * 9) { // 2-channel blocks have 90%+ non-zeroes *count_channels = (*count_channels) / 2 + (*count_channels) % 2; // spmm_parameters = &xnn_params.f32.spmm2; *flag_semi = 1; // Non-zeroes which don't fit into whole 2-channel blocks, processed // one-by-one const size_t num_remaining_nonzeroes = num_nonzeroes - num_block2_nonzeroes; *count_nonzeroes = num_nonzero_blocks2 * 2 + num_remaining_nonzeroes; *count_blocks = num_nonzero_blocks2 + num_remaining_nonzeroes; } return height * width - (*count_nonzeroes); } /** * \brief Sparse representation of weights consists of three components: * @param w_tensor original dense weight data. * @param num_nonzeroes the number of non-zero kernel elements. * @param nonzero_output_tensor An array of float values storing non-zero kernel * elements. * @param oc_nonzeros_tensor the number of non-zero kernel elements per each * output channel. * @param diffs_tensor An array of int32_t values storing scaled [by * sizeof(input element)] difference * between input channels corresponding to successive non-zero element. */ template int SparseConvDetectPass::ComputeSparseWeight<float>( const lite::Tensor* w_tensor, const int M, const int K, const int N, const int num_nonzeroes, lite::Tensor* nonzero_output_tensor, lite::Tensor* oc_nonzeros_tensor, lite::Tensor* diffs_tensor); template int SparseConvDetectPass::ComputeSparseWeight<int8_t>( const lite::Tensor* w_tensor, const int M, const int K, const int N, const int num_nonzeroes, lite::Tensor* nonzero_output_tensor, lite::Tensor* oc_nonzeros_tensor, lite::Tensor* diffs_tensor); /** * \brief Sparse representation of weights consists of three components: * @param w_tensor original dense weight data. * @param num_nonzeroes the number of non-zero kernel elements. * @param num_build_nonzeroes the number of non-zero kernel elements after * reconstruction, * the number of non-zeros in each output channel is a multiple of 4, otherwise * zero-padded. * @param nonzero_output_tensor An array of float values storing non-zero kernel * elements. * @param oc_nonzeros_tensor the number of non-zero kernel elements per each * output channel. * @param diffs_tensor An array of int32_t values storing scaled [by * sizeof(input element)] difference * between input channels corresponding to successive non-zero element. */ template int SparseConvDetectPass::ComputeSparseWeight<float>( const lite::Tensor* w_tensor, const int M, const int K, const int N, const int num_nonzeroes, const int num_build_nonzeroes, lite::Tensor* nonzero_output_tensor, lite::Tensor* oc_nonzeros_tensor, lite::Tensor* diffs_tensor); template int SparseConvDetectPass::ComputeSparseWeight<int8_t>( const lite::Tensor* w_tensor, const int M, const int K, const int N, const int num_nonzeroes, const int num_build_nonzeroes, lite::Tensor* nonzero_output_tensor, lite::Tensor* oc_nonzeros_tensor, lite::Tensor* diffs_tensor); /** * \brief Semi-structured representation of weights consists of three * components: * @param w_tensor original dense weight data. * @param count_nonzeroes the number of non-zero kernel elements. * @param count_channels When semi-structured, it is equal to output channel / 2 * + output channel% 2 * @param count_blocks When semi-structured, the number of 2-channel blocks. * @param nonzero_output_tensor An array of float values storing non-zero kernel * elements. * @param oc_nonzeros_tensor the number of non-zero kernel elements per each * output channel. * @param diffs_tensor An array of int32_t values storing scaled [by * sizeof(input element)] difference * between input channels corresponding to successive non-zero element. */ template int SparseConvDetectPass::ComputeSemiSparseWeight<int8_t>( const lite::Tensor* w_tensor, const int M, const int K, const int N, const int count_nonzeroes, const int count_channels, const int count_blocks, lite::Tensor* nonzero_output_tensor, lite::Tensor* oc_nonzeros_tensor, lite::Tensor* diffs_tensor); template int SparseConvDetectPass::ComputeSemiSparseWeight<float>( const lite::Tensor* w_tensor, const int M, const int K, const int N, const int count_nonzeroes, const int count_channels, const int count_blocks, lite::Tensor* nonzero_output_tensor, lite::Tensor* oc_nonzeros_tensor, lite::Tensor* diffs_tensor); template <typename T> int SparseConvDetectPass::ComputeSparseZeros(const lite::Tensor* weights, const int num) { const T* data = weights->data<T>(); int zero_num = 0; for (int i = 0; i < num; ++i) { if (data[i] == static_cast<T>(0)) { ++zero_num; } } return zero_num; } template <typename T> int SparseConvDetectPass::ComputeSparseZeros(const lite::Tensor* weights, int* num_build_nonzeroes, const int height, const int width) { const T* data = weights->data<T>(); int num_nonzeroes = 0; int num_nonzeroes_act = 0; for (int i = 0; i < height; i++) { int line_nonzeroes = 0; for (int j = 0; j < width; j++) { if (data[i * width + j] != static_cast<T>(0)) { line_nonzeroes++; } } if (line_nonzeroes % 4 == 0) { num_nonzeroes += line_nonzeroes; } else { num_nonzeroes += line_nonzeroes + 4 - (line_nonzeroes % 4); } num_nonzeroes_act += line_nonzeroes; } *num_build_nonzeroes = num_nonzeroes; return height * width - num_nonzeroes_act; } template int SparseConvDetectPass::ComputeSparseZeros<float>( const lite::Tensor* weights, const int num); template int SparseConvDetectPass::ComputeSparseZeros<int8_t>( const lite::Tensor* weights, const int num); template int SparseConvDetectPass::ComputeSparseZeros<float>( const lite::Tensor* weights, int* num_build_nonzeroes, const int height, const int width); template int SparseConvDetectPass::ComputeSparseZeros<int8_t>( const lite::Tensor* weights, int* num_build_nonzeroes, const int height, const int width); template int SparseConvDetectPass::ComputeSemiSparseZeros<int8_t>( const lite::Tensor* weights, int* count_nonzeroes, int* count_channels, int* count_blocks, int* flag_semi, const int height, const int width); template int SparseConvDetectPass::ComputeSemiSparseZeros<float>( const lite::Tensor* weights, int* count_nonzeroes, int* count_channels, int* count_blocks, int* flag_semi, const int height, const int width); void SparseConvDetectPass::CopyAttrFromOpInfo(cpp::OpDesc* op_desc, OpInfo* op_info, const std::string& attr_name) { auto attr_type = op_info->GetAttrType(attr_name); switch (attr_type) { case OpDescAPI::AttrType::INT: op_desc->SetAttr(attr_name, op_info->GetAttr<int>(attr_name)); break; case OpDescAPI::AttrType::FLOAT: op_desc->SetAttr(attr_name, op_info->GetAttr<float>(attr_name)); break; case OpDescAPI::AttrType::BOOLEAN: op_desc->SetAttr(attr_name, op_info->GetAttr<bool>(attr_name)); break; case OpDescAPI::AttrType::STRING: op_desc->SetAttr(attr_name, op_info->GetAttr<std::string>(attr_name)); break; case OpDescAPI::AttrType::FLOATS: { op_desc->SetAttr(attr_name, op_info->GetAttr<std::vector<float>>(attr_name)); } break; case OpDescAPI::AttrType::INTS: { op_desc->SetAttr(attr_name, op_info->GetAttr<std::vector<int>>(attr_name)); } break; case OpDescAPI::AttrType::STRINGS: { op_desc->SetAttr(attr_name, op_info->GetAttr<std::vector<std::string>>(attr_name)); } break; default: LOG(FATAL) << ":Unknow type(" << static_cast<int>(attr_type) << ")"; break; } } void SparseConvDetectPass::CopyInputScaleFromOpInfo(cpp::OpDesc* op_desc, OpInfo* op_info, const std::string& name) { if (op_info->HasInputScale(name, true)) { op_desc->SetAttr<std::vector<float>>(name, op_info->GetInputScale(name, true)); } } void SparseConvDetectPass::CopyOutputScaleFromOpInfo(cpp::OpDesc* op_desc, OpInfo* op_info, const std::string& name) { if (op_info->HasOutputScale(name, true)) { op_desc->SetAttr<std::vector<float>>(name, op_info->GetOutputScale(name, true)); } } void SparseConvDetectPass::Apply(const std::unique_ptr<SSAGraph>& graph) { for (auto& node : graph->StmtTopologicalOrder()) { if (node->IsStmt() && node->AsStmt().op_type() == "conv2d") { auto* scope = node->stmt()->op()->scope(); auto conv_op_desc = node->stmt()->mutable_op_info(); auto x = conv_op_desc->Input("Input").front(); auto w = conv_op_desc->Input("Filter").front(); auto y = conv_op_desc->Output("Output").front(); auto x_tensor = scope->FindVar(x)->Get<lite::Tensor>(); auto w_tensor = scope->FindVar(w)->Get<lite::Tensor>(); auto x_dims = x_tensor.dims(); auto weight_dims = w_tensor.dims(); auto groups = conv_op_desc->GetAttr<int>("groups"); auto strides = conv_op_desc->GetAttr<std::vector<int>>("strides"); auto paddings = conv_op_desc->GetAttr<std::vector<int>>("paddings"); auto ch_out = weight_dims[0]; auto ch_in = weight_dims[1] * groups; auto kh = weight_dims[2]; auto kw = weight_dims[3]; auto im_size = x_dims[2] * x_dims[3]; int weight_num = ch_out * ch_in * kh * kw; bool use_int8 = (w_tensor.precision() == PrecisionType::kInt8); bool use_fp32 = (w_tensor.precision() == PrecisionType::kFloat); if (!(use_int8 || use_fp32)) { VLOG(4) << "The sparse conv detect pass now only support fp32 and int8"; continue; } if (!(kw == 1 && kh == 1)) { VLOG(4) << "The kernel size of the supported sparse conv must be 1x1"; continue; } if (groups != 1) { VLOG(4) << "The groups of the supported sparse conv must be 1"; continue; } if (!(strides[0] == 1 && strides[1] == 1)) { VLOG(4) << "The strides of the supported sparse conv must be 1"; continue; } if (!(paddings[0] == 0 && paddings[1] == 0)) { VLOG(4) << "The paddings of the supported sparse conv must be 0"; continue; } if (!(ch_out > 0 && ch_in > 0)) { VLOG(4) << "The input and output channels must be larger than 0"; continue; } int zero_num; int num_build_nonzeroes = 0; int count_nonzeroes = 0; int count_channels = 0; int count_blocks = 0; int flag_semi = 0; if (use_fp32) { zero_num = ComputeSemiSparseZeros<float>(&w_tensor, &count_nonzeroes, &count_channels, &count_blocks, &flag_semi, ch_out, ch_in); if (flag_semi == 0) { zero_num = ComputeSparseZeros<float>( &w_tensor, &num_build_nonzeroes, ch_out, ch_in); } } else if (use_int8) { zero_num = ComputeSemiSparseZeros<int8_t>(&w_tensor, &count_nonzeroes, &count_channels, &count_blocks, &flag_semi, ch_out, ch_in); } else { LOG(FATAL) << "use_fp32 and use_int8 must not both be false"; } int nonzero_num = weight_num - zero_num; VLOG(4) << "zero_num: " << zero_num << "weight_num: " << weight_num; float sparse_zero_percent = static_cast<float>(zero_num) / static_cast<float>(weight_num); VLOG(4) << "sparse zero num percent: " << sparse_zero_percent; if (sparse_zero_percent < sparse_threshold_) { VLOG(4) << "The sparse degree of the sparse conv must be greater than " "sparse_threshold: " << sparse_threshold_; continue; } auto nonzeros_output_name = string_format("%s_nonzeros_output", w.c_str()); auto oc_nonzeros_name = string_format("%s_oc_nonzeros", w.c_str()); auto ic_diffs_name = string_format("%s_ic_diffs", w.c_str()); auto* nonzeros_output_arg = graph->NewArgumentNode(nonzeros_output_name); auto* oc_nonzeros_arg = graph->NewArgumentNode(oc_nonzeros_name); auto* ic_diffs_arg = graph->NewArgumentNode(ic_diffs_name); nonzeros_output_arg->AsArg().is_persist = true; nonzeros_output_arg->AsArg().is_weight = true; oc_nonzeros_arg->AsArg().is_persist = true; oc_nonzeros_arg->AsArg().is_weight = true; ic_diffs_arg->AsArg().is_persist = true; ic_diffs_arg->AsArg().is_weight = true; auto* nonzeros_output_t = scope->Var(nonzeros_output_name)->GetMutable<Tensor>(); auto* oc_nonzeros_t = scope->Var(oc_nonzeros_name)->GetMutable<Tensor>(); auto* ic_diffs_t = scope->Var(ic_diffs_name)->GetMutable<Tensor>(); if (use_fp32) { if (flag_semi == 1) { nonzeros_output_t->Resize({count_nonzeroes}); oc_nonzeros_t->Resize({ch_out}); ic_diffs_t->Resize({count_blocks}); } else { nonzeros_output_t->Resize({num_build_nonzeroes}); oc_nonzeros_t->Resize({ch_out}); ic_diffs_t->Resize({num_build_nonzeroes}); } } else if (use_int8) { if (flag_semi == 1) { nonzeros_output_t->Resize({count_nonzeroes}); oc_nonzeros_t->Resize({ch_out}); ic_diffs_t->Resize({count_blocks}); } else { nonzeros_output_t->Resize({count_nonzeroes}); oc_nonzeros_t->Resize({ch_out}); ic_diffs_t->Resize({count_nonzeroes}); } } int first_ic; if (use_fp32) { if (flag_semi == 1) { first_ic = ComputeSemiSparseWeight<float>(&w_tensor, ch_out, ch_in, im_size, count_nonzeroes, count_channels, count_blocks, nonzeros_output_t, oc_nonzeros_t, ic_diffs_t); } else { first_ic = ComputeSparseWeight<float>(&w_tensor, ch_out, ch_in, im_size, nonzero_num, num_build_nonzeroes, nonzeros_output_t, oc_nonzeros_t, ic_diffs_t); } } else if (use_int8) { if (flag_semi == 1) { first_ic = ComputeSemiSparseWeight<int8_t>(&w_tensor, ch_out, ch_in, im_size, count_nonzeroes, count_channels, count_blocks, nonzeros_output_t, oc_nonzeros_t, ic_diffs_t); } else { first_ic = ComputeSparseWeight<int8_t>(&w_tensor, ch_out, ch_in, im_size, nonzero_num, nonzeros_output_t, oc_nonzeros_t, ic_diffs_t); } } else { LOG(FATAL) << "use_fp32 and use_int8 must not both be false"; } VLOG(4) << "zero_num: " << zero_num << " weight_num: " << weight_num << " first_ic: " << first_ic; nonzeros_output_t->set_persistable(true); oc_nonzeros_t->set_persistable(true); ic_diffs_t->set_persistable(true); if (use_fp32) nonzeros_output_t->set_precision(PRECISION(kFloat)); else if (use_int8) nonzeros_output_t->set_precision(PRECISION(kInt8)); oc_nonzeros_t->set_precision(PRECISION(kInt32)); ic_diffs_t->set_precision(PRECISION(kInt32)); auto sparse_conv2d_op = LiteOpRegistry::Global().Create("sparse_conv2d"); cpp::OpDesc op_desc; op_desc.SetType("sparse_conv2d"); op_desc.SetInput("Input", {x}); op_desc.SetInput("NonZeroWeights", {nonzeros_output_name}); op_desc.SetInput("OcNonZeros", {oc_nonzeros_name}); op_desc.SetInput("Diffs", {ic_diffs_name}); bool has_bias = conv_op_desc->HasInput("Bias") && conv_op_desc->Input("Bias").size() > 0; if (has_bias) { auto b = conv_op_desc->Input("Bias").front(); op_desc.SetInput("Bias", {b}); } op_desc.SetOutput("Output", {y}); if (use_int8) { if (!(conv_op_desc->HasAttr("enable_int8"))) conv_op_desc->SetAttr<bool>("enable_int8", true); else if (conv_op_desc->GetAttr<bool>("enable_int8") == false) conv_op_desc->SetAttr<bool>("enable_int8", true); } // copy attributes std::vector<std::string> attr_names = conv_op_desc->AttrNames(); for (size_t i = 0; i < attr_names.size(); i++) { if (conv_op_desc->HasAttr(attr_names[i])) { CopyAttrFromOpInfo(&op_desc, conv_op_desc, attr_names[i]); } } // Copy inputs/outputs scales if (conv_op_desc->HasAttr("enable_int8")) { CopyInputScaleFromOpInfo(&op_desc, conv_op_desc, "Input0_scale"); CopyInputScaleFromOpInfo(&op_desc, conv_op_desc, "Filter0_scale"); CopyOutputScaleFromOpInfo(&op_desc, conv_op_desc, "Output0_scale"); } op_desc.SetAttr<int>("first_ic", first_ic); op_desc.SetAttr<int>("flag_semi", flag_semi); sparse_conv2d_op->Attach(op_desc, node->stmt()->op()->scope()); auto* sparse_op_node = graph->GraphCreateInstructNode( sparse_conv2d_op, graph->valid_places()); for (auto iter = node->inlinks.begin(); iter != node->inlinks.end();) { auto it = std::find((*iter)->outlinks.begin(), (*iter)->outlinks.end(), node); if (it != (*iter)->outlinks.end()) { (*iter)->outlinks.erase(it); } bool is_weight = (*iter)->IsArg() && (*iter)->AsArg().is_weight; if (!is_weight) { DirectedLink(*iter, sparse_op_node); } else { graph->RemoveNode((*iter)); } iter = node->inlinks.erase(iter); } DirectedLink(nonzeros_output_arg, sparse_op_node); DirectedLink(oc_nonzeros_arg, sparse_op_node); DirectedLink(ic_diffs_arg, sparse_op_node); for (auto iter = node->outlinks.begin(); iter != node->outlinks.end();) { DirectedLink(sparse_op_node, *iter); auto it = std::find((*iter)->inlinks.begin(), (*iter)->inlinks.end(), node); if (it != (*iter)->inlinks.end()) { (*iter)->inlinks.erase(it); } iter = node->outlinks.erase(iter); } graph->RemoveNode(node); } } } } // namespace mir } // namespace lite } // namespace paddle REGISTER_MIR_PASS(sparse_conv_detect_pass, paddle::lite::mir::SparseConvDetectPass) .BindTargets({TARGET(kARM)}) .ExcludeTargets({TARGET(kXPU)}) .ExcludeTargets({TARGET(kOpenCL)}) .ExcludeTargets({TARGET(kX86)});
[ "noreply@github.com" ]
noreply@github.com
839cb7bdee49dcfda9794fd81732c46fce01ab5b
f5079cc796501fd933d833f2f5e24dee994eded0
/3年時/ステージエディター/ソース/item.cpp
c7ed6a6c9c6aa6db755a14a38ae2ec04c409956d
[]
no_license
thurapro/tensyoku
0bbcea59bf0b7d9a70b8997af3ccdc138771b35f
68432cae647fe77af87b0bd7f22b43f7b90b35bd
refs/heads/master
2023-08-23T05:11:53.656699
2021-10-19T15:20:11
2021-10-19T15:20:11
418,956,503
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
5,225
cpp
//============================================================================= // アイテム処理[item.cpp] // // 製作者 : 松尾 雄太 // // 機能 : アイテム //============================================================================= //============================================================================= // インクルード //============================================================================= #include "common.h" #include "manager.h" #include "field.h" #include "shadow.h" #include "item.h" #include "data.h" #include "scene.h" #include "player.h" //============================================================================= // マクロ定義 //============================================================================= #define MODEL_NUM_INIT (-1) // モデル初期値 #define TEXTURE_NUM_INIT (-1) // 画像初期値 //============================================================================= // 関数名 : CItem // 戻り値 : なし // 引数値 : なし // 機能 : インスタンス生成 //============================================================================= CItem::CItem(int nPriority, OBJTYPE objType):CSceneX(nPriority, objType) { m_pos = D3DXVECTOR3(0.0f, 0.0f, 0.0f); // Xオブジェクトの位置 m_rot = D3DXVECTOR3(0.0f, 0.0f, 0.0f); // Xオブジェクトの向き m_scl = D3DXVECTOR3(1.0f, 1.0f, 1.0f); // Xオブジェクトの大きさ m_nModelNum = MODEL_NUM_INIT; // モデル番号 m_nTextureNum = TEXTURE_NUM_INIT; // テクスチャ番号 m_pTexture = NULL; // テクスチャデータ m_pShadow = NULL; // 影の初期化 } //============================================================================= // 関数名 : ~CItem // 戻り値 : なし // 引数値 : なし // 機能 : インスタンス破棄 //============================================================================= CItem::~CItem(void) { // インスタンス破棄 } //============================================================================= // 関数名 : Create // 戻り値 : CItem (エラー NULL) // 引数値 : 表示位置 ( X , Y, Z ) , テクスチャ番号 // 機能 : なし //============================================================================= CItem *CItem::Create(float fPosX, float fPosY, float fPosZ, unsigned int nModelNum, unsigned int nTexNum) { HRESULT hr; // エラーチェック変数 CItem *pItem = NULL; // アイテム初期化 pItem = NEW CItem; // アイテムインスタンス生成 hr = pItem->Init(fPosX, fPosY, fPosZ, nModelNum, nTexNum); if( FAILED(hr) ) { // エラーチェック return NULL; // 作成失敗 } return pItem; // アイテムを返す } //============================================================================= // 関数名 : Init // 戻り値 : HRESULT // 引数値 : 表示位置 ( X , Y, Z ) , テクスチャ番号 // 機能 : なし //============================================================================= HRESULT CItem::Init(void) { return S_OK; } //============================================================================= // 関数名 : Init // 戻り値 : HRESULT // 引数値 : 表示位置 ( X , Y, Z ) , モデル番号 , テクスチャ番号 // 機能 : なし //============================================================================= HRESULT CItem::Init(float fPosX, float fPosY, float fPosZ, unsigned int nModelNum, unsigned int nTexNum) { HRESULT hr; // エラーチェック変数 hr = CSceneX::Init(fPosX, fPosY, fPosZ, nModelNum, nTexNum); // アイテム初期化 m_fRadius = 5.0f; ERROR_CHACK(hr); // エラーチェック if( m_pShadow == NULL ) { m_pShadow = CShadow::Create(m_pos.x, m_pos.y, m_pos.z, 10, 0, 10, 5); } return S_OK; // 正常コード } //============================================================================= // 関数名 : Uninit // 戻り値 : なし // 引数値 : なし // 機能 : アイテム終了処理 //============================================================================= void CItem::Uninit(void) { CSceneX::Uninit(); // アイテム破棄 m_pShadow->Uninit(); } //============================================================================= // 関数名 : Update // 戻り値 : なし // 引数値 : なし // 機能 : アイテム更新処理 //============================================================================= void CItem::Update(void) { float fHeight = 0; CField *pField = NULL; //switch( CManager::GetMode() ) //{ //case CManager::MODE_TITLE: // //pField = CManager::GetTitle(); // break; //case CManager::MODE_GAME: // pField = CManager::GetGame()->GetField(); // break; //default: // break; //} if( pField ) { fHeight = pField->GetHeight(m_pos); m_pos.y = fHeight + m_fRadius; } m_pShadow->SetPosition(m_pos.x, fHeight + 1, m_pos.z); } //============================================================================= // 関数名 : Draw // 戻り値 : なし // 引数値 : なし // 機能 : アイテム描画 //============================================================================= void CItem::Draw(void) { CSceneX::Draw(); // 描画 } // end of file
[ "result39peria@gmail.com" ]
result39peria@gmail.com
8d8a83fc015af97a7f131999ce408f82cbcb9a3d
f0a659196a43df2d36bf786027226fb2494d62b1
/C++Extension/ThirdParty/NewtonDynamics/dgCore/dgThreadHive.cpp
1a9415ca352e65dc41133efbac2ff30555c3400e
[ "Zlib", "MIT" ]
permissive
MrPrezident/MSPhysics
72dc3458a2612abcbed1e185cb2cee7a5306afbc
eb9f2b55d7823ad246d6da98c3c2eb03d5a08c18
refs/heads/master
2020-04-06T08:45:47.213958
2018-11-15T01:29:29
2018-11-15T01:29:29
157,315,489
0
0
MIT
2018-11-15T01:29:30
2018-11-13T03:35:07
C++
UTF-8
C++
false
false
4,902
cpp
/* Copyright (c) <2003-2016> <Julio Jerez, Newton Game Dynamics> * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source distribution. */ #include "dgStdafx.h" #include "dgTypes.h" #include "dgMemory.h" #include "dgProfiler.h" #include "dgThreadHive.h" dgThreadHive::dgWorkerThread::dgWorkerThread() :dgThread() ,m_hive(NULL) ,m_allocator(NULL) ,m_isBusy(0) ,m_jobsCount(0) ,m_workerSemaphore() { } dgThreadHive::dgWorkerThread::~dgWorkerThread() { while (IsBusy()); dgInterlockedExchange(&m_terminate, 1); m_workerSemaphore.Release(); Close(); } void dgThreadHive::dgWorkerThread::SetUp(dgMemoryAllocator* const allocator, const char* const name, dgInt32 id, dgThreadHive* const hive) { m_hive = hive; m_allocator = allocator; Init (name, id); #ifndef DG_USE_THREAD_EMULATION #if (defined (_WIN_32_VER) || defined (_WIN_64_VER)) SetThreadPriority(m_handle.native_handle(), THREAD_PRIORITY_ABOVE_NORMAL); #endif #endif } bool dgThreadHive::dgWorkerThread::IsBusy() const { return m_isBusy ? true : false; } void dgThreadHive::dgWorkerThread::Execute (dgInt32 threadId) { m_hive->OnBeginWorkerThread (threadId); while (!m_terminate) { dgInterlockedExchange(&m_isBusy, 0); SuspendExecution(m_workerSemaphore); dgInterlockedExchange(&m_isBusy, 1); if (!m_terminate) { RunNextJobInQueue(threadId); m_hive->m_semaphore[threadId].Release(); } } dgInterlockedExchange(&m_isBusy, 0); m_hive->OnEndWorkerThread (threadId); } dgInt32 dgThreadHive::dgWorkerThread::PushJob(const dgThreadJob& job) { dgAssert (m_jobsCount < sizeof (m_jobPool)/ sizeof (m_jobPool[0])); m_jobPool[m_jobsCount] = job; m_jobsCount ++; return m_jobsCount; } void dgThreadHive::dgWorkerThread::RunNextJobInQueue(dgInt32 threadId) { for (dgInt32 i = 0; i < m_jobsCount; i ++) { const dgThreadJob& job = m_jobPool[i]; DG_TRACKTIME_NAMED(job.m_jobName); job.m_callback (job.m_context0, job.m_context1, m_id); } m_jobsCount = 0; } dgThreadHive::dgThreadHive(dgMemoryAllocator* const allocator) :m_parentThread(NULL) ,m_workerThreads(NULL) ,m_allocator(allocator) ,m_jobsCount(0) ,m_workerThreadsCount(0) ,m_globalCriticalSection(0) { } dgThreadHive::~dgThreadHive() { DestroyThreads(); } void dgThreadHive::SetParentThread (dgThread* const parentThread) { m_parentThread = parentThread; } void dgThreadHive::DestroyThreads() { if (m_workerThreadsCount) { delete[] m_workerThreads; m_workerThreads = NULL; m_workerThreadsCount = 0; } } void dgThreadHive::SetThreadsCount (dgInt32 threads) { DestroyThreads(); m_workerThreadsCount = dgMin (threads, DG_MAX_THREADS_HIVE_COUNT); if (m_workerThreadsCount == 1) { m_workerThreadsCount = 0; } if (m_workerThreadsCount) { m_workerThreads = new (m_allocator) dgWorkerThread[dgUnsigned32 (m_workerThreadsCount)]; for (dgInt32 i = 0; i < m_workerThreadsCount; i ++) { char name[256]; sprintf (name, "dgWorkerThread%d", i); m_workerThreads[i].SetUp(m_allocator, name, i, this); } } } void dgThreadHive::QueueJob (dgWorkerThreadTaskCallback callback, void* const context0, void* const context1, const char* const functionName) { if (!m_workerThreadsCount) { DG_TRACKTIME(functionName); callback (context0, context1, 0); } else { dgInt32 workerTreadEntry = m_jobsCount % m_workerThreadsCount; #ifdef DG_USE_THREAD_EMULATION DG_TRACKTIME(functionName); callback (context0, context1, workerTreadEntry); #else dgInt32 index = m_workerThreads[workerTreadEntry].PushJob(dgThreadJob(context0, context1, callback, functionName)); if (index >= DG_THREAD_POOL_JOB_SIZE) { dgAssert (0); SynchronizationBarrier (); } #endif } m_jobsCount ++; } void dgThreadHive::OnBeginWorkerThread (dgInt32 threadId) { } void dgThreadHive::OnEndWorkerThread (dgInt32 threadId) { } void dgThreadHive::SynchronizationBarrier () { if (m_workerThreadsCount) { DG_TRACKTIME(__FUNCTION__); for (dgInt32 i = 0; i < m_workerThreadsCount; i ++) { m_workerThreads[i].m_workerSemaphore.Release(); } m_parentThread->SuspendExecution(m_workerThreadsCount, m_semaphore); } m_jobsCount = 0; }
[ "anton.synytsia@gmail.com" ]
anton.synytsia@gmail.com
069a3f1e237c7e0299d200c4422c3100238beba4
bf8e51adccd60a6915b002f619e750052bbeab8c
/Projects/Example01/Common/Communication/Server/GameServer_server.hpp
5f0465a5105cc6a113ba91b644ff3550d2fadebf
[ "BSD-3-Clause", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-unknown-license-reference" ]
permissive
teronis84/Segs
14b796a485d9de3b8bf89273d12c43ec18be1339
71ac841a079fd769c3a45836ac60f34e4fff32b9
refs/heads/master
2020-03-09T07:57:25.957769
2018-04-11T11:33:25
2018-04-11T11:33:25
128,677,317
0
0
BSD-3-Clause
2018-04-08T20:02:02
2018-04-08T20:02:01
null
UTF-8
C++
false
false
814
hpp
#ifndef MPRPC_GameServer_server_6abc2380_HPP__ #define MPRPC_GameServer_server_6abc2380_HPP__ #include "GameServer.hpp" namespace StickWorld { namespace GameServer { class server : public msgpack::rpc::server::base { public: server(msgpack::rpc::loop lo = msgpack::rpc::loop()) : msgpack::rpc::server::base(lo) { } ~server() { } void dispatch(msgpack::rpc::request req); private: class dispatch_table { public: dispatch_table(); ~dispatch_table(); void* pimpl; }; static dispatch_table s_dispatch_table; friend class dispatch_table; public: void login(msgpack::rpc::request::type<int32_t>, GameServer::login&); }; } // namespace GameServer /* void GameServer::server::login(msgpack::rpc::request::type<int32_t> req, GameServer::login& params) */ } // namespace StickWorld #endif
[ "nemerle@a19be42f-918d-4297-8077-ab25d1e4f51f" ]
nemerle@a19be42f-918d-4297-8077-ab25d1e4f51f
3a4fe282116f18a7533e0af7d834047ced5fd112
fc987d063c6d3812cc53f59d2c19fdcbe168bd04
/Utility/Utility.h
28b7b09691ed34f4ab9616c6fe4f2c1f7491d785
[]
no_license
arashkarshenass/Steady2D
61021d8fe9ad2610d1e3b3f2128d5193642c098b
f315c6380e77e17cea5e0ae5203c9ee0bdc3f69b
refs/heads/master
2020-03-25T09:08:40.673142
2018-08-05T21:46:37
2018-08-05T21:46:37
143,649,871
4
0
null
null
null
null
UTF-8
C++
false
false
421
h
#ifndef UTILITY_UTILITY_H_ #define UTILITY_UTILITY_H_ class Utility { public: void VectorInitializer(double*,int,double); void MatrixInitializer(double**,int,int,double); double VectorProduct2D(double,double,double,double); void VectorEqualizer(double*,double*,int); void MatrixEqualizer(double**,double**,int,int); void Monitoring2D(int,int,double**); private: double m=0; int colN=0; int size=0; }; #endif
[ "42058201+arashkarshenass@users.noreply.github.com" ]
42058201+arashkarshenass@users.noreply.github.com
fd9c12fd1b21e7de4ec1012f331f8e074032afbf
280493b8051a7e7e55504fc1221b6727cfdc8059
/core/fxge/cfx_fontcache.h
13806f00fcdd5821b6a10f7271c320dc56070d68
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
yanxijian/pdfium
c7b76652a61dee0db9e1058d1626b51cc038bcee
aba53245bf116a1d908f851a93236b500988a1ee
refs/heads/master
2023-07-05T22:04:57.446390
2021-08-18T02:14:13
2021-08-18T02:14:13
219,985,006
0
0
NOASSERTION
2019-11-06T11:50:33
2019-11-06T11:50:32
null
UTF-8
C++
false
false
926
h
// Copyright 2016 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef CORE_FXGE_CFX_FONTCACHE_H_ #define CORE_FXGE_CFX_FONTCACHE_H_ #include <map> #include <memory> #include "core/fxcrt/fx_system.h" #include "core/fxcrt/retain_ptr.h" #include "core/fxge/cfx_glyphcache.h" #include "core/fxge/fx_freetype.h" class CFX_Font; class CFX_FontCache { public: CFX_FontCache(); ~CFX_FontCache(); RetainPtr<CFX_GlyphCache> GetGlyphCache(const CFX_Font* pFont); #if defined(_SKIA_SUPPORT_) CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont); #endif private: std::map<CFX_Face*, ObservedPtr<CFX_GlyphCache>> m_GlyphCacheMap; std::map<CFX_Face*, ObservedPtr<CFX_GlyphCache>> m_ExtGlyphCacheMap; }; #endif // CORE_FXGE_CFX_FONTCACHE_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
236c099d6ef06db7fcfa495c6c2ad0fed4bc51a4
d1dd6834948d25d682aa18236c969d58815f83e0
/lib/include/ComponentFixedData.h
59675691987cd8b7e870220c58a175af05d3b7f1
[ "MIT" ]
permissive
Eric2-Praxinos/gaia
9c348620a1053415f79889f3503766b985ae9eed
218e25dedd12080847d731fe7a1f1da27be37e27
refs/heads/master
2021-03-04T22:44:44.735808
2020-07-21T14:40:28
2020-07-21T14:40:28
246,072,442
0
1
null
null
null
null
UTF-8
C++
false
false
2,415
h
#pragma once #include "ComponentData.h" #include <vector> #define DATA ::nGaia::cComponentFixedData #define EDIT(...) \ if (::nGaia::cEditionHandles GAIA_DATA_EDITION_HANDLES(__VA_ARGS__); true) \ if (auto GAIA_DATA_EDITION_TUPLE = ::nGaia::GetEditables(__VA_ARGS__); true) #define AS(...) \ if (auto [__VA_ARGS__] = GAIA_DATA_EDITION_TUPLE; true) #define EDITASSAME(...) \ EDIT(__VA_ARGS__) \ AS(__VA_ARGS__) namespace nGaia { template<typename T> class cComponentFixedData : public cComponentData { private: typedef cComponentFixedData<T> tSelfType; public: // destructor ~cComponentFixedData() { } // default constructor cComponentFixedData() { throw "Error !" } // assignment constructor cComponentFixedData(const T& iValue) : mValue(iValue) { } public: const T& Value() const { Emit(EventGetBefore); Emit(EventGetAfter); return mValue; } public: T& GetEditable() { //TODO: Add global mutex, for edition lock return mValue; } operator const T&() const { const T& t = Value(); return t; } const T& operator ()() const { const T& t = Value(); return t; } virtual void Lock() { //Lock Edition //Lock Get } virtual void Unlock() { //Lock Edition //Lock Get Emit(EventChanged); } private: T mValue; }; template <class ...Types> auto GetEditables(Types&... iData) { //TODO: Add global mutex, for edition lock return ::std::forward_as_tuple(iData.GetEditable()...); } class cEditionHandle { public: virtual void EditStart() {}; virtual void EditStop() {}; }; template <class T> class cEditionHandleT : public cEditionHandle { public: ~cEditionHandleT() { } cEditionHandleT(::nGaia::cComponentFixedData<T>& iData) : mData(iData) { } virtual void EditStart() { mData.Lock(); } virtual void EditStop() { mData.Unlock(); } ::nGaia::cComponentFixedData<T>& mData; }; template <class ... Types> class cEditionHandles { public: ~cEditionHandles() { for (auto& handle: mHandles) { handle->EditStop(); delete handle; } } cEditionHandles(Types& ... iData) : mHandles({new cEditionHandleT(iData)...}) { for (auto& handle: mHandles) handle->EditStart(); } ::std::vector<cEditionHandle*> mHandles; }; }
[ "eric@owlie.xyz" ]
eric@owlie.xyz
ddfe5d808aa81c3683f38e53db7188d5b86ca049
75a7af09cdef25e43b8183417ca2efbd080766f8
/src/eptools/FactEPMaximumPiValues.h
1999663d676a0ddab8a2879e2a0efc6ed1116be8
[ "BSD-3-Clause" ]
permissive
fedorzh/apbsint
fa03fd1cb906839d284066fc8776213107798e6f
6acd73fb1d7b5168f3cee8584a8074d6617478a6
refs/heads/master
2021-01-19T13:30:43.297440
2014-03-23T10:06:43
2014-03-23T10:06:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,277
h
/* ------------------------------------------------------------------- * LHOTSE: Toolbox for adaptive statistical models * ------------------------------------------------------------------- * Project source file * Module: eptools * Desc.: Header class FactEPMaximumPiValues * ------------------------------------------------------------------- */ #ifndef EPTOOLS_FACTEPMAXIMUMPIVALUES_H #define EPTOOLS_FACTEPMAXIMUMPIVALUES_H #if HAVE_CONFIG_H # include <config.h> #endif #include "src/eptools/MaximumValuesService.h" #include "src/eptools/FactorizedEPRepresentation.h" //BEGINNS(eptools) /** * Specialization of 'MaximumValuesService' to max_k pi_ki, where the * factor group (coupling factor B) and the pi values are maintained * by a 'FactorizedEPRepresentation' object. * * @author Matthias Seeger * @version %I% %G% */ class FactEPMaximumPiValues : public MaximumValuesService { protected: // Additional members Handle<FactorizedEPRepresentation> epRepr; public: // Public methods /** * Constructor. Consistency of 'ptopVal' with 'pepRepr' is not checked. * * @param pepRepr EP representation * @param pmaxSize K * @param pnumValid Entries must be in 1:pmaxSize * @param ptopInd * @param ptopVal * @param psubInd Optional * @param psubExcl Def.: false */ FactEPMaximumPiValues(const Handle<FactorizedEPRepresentation>& pepRepr, int pmaxSize,const ArrayHandle<int>& pnumValid, const ArrayHandle<int>& ptopInd, const ArrayHandle<double>& ptopVal, const ArrayHandle<int>& psubInd= ArrayHandleZero<int>::get(),bool psubExcl=false) : MaximumValuesService(pepRepr->numVariables(),pepRepr->numPotentials(), pmaxSize,pnumValid,ptopInd,ptopVal,psubInd,psubExcl), epRepr(pepRepr) {} int numVariables() const { return epRepr->numVariables(); } int numFactors() const { return epRepr->numPotentials(); } int getFactorValues(int i,const int*& vind,const int*& jind, const double*& xarr) const { // Maps directly to 'FactorizedEPRepresentation::accessCol' const double* bP,*betaP; return epRepr->accessCol(i,vind,jind,bP,betaP,xarr); } }; //ENDNS #endif
[ "mseeger@gmail.com" ]
mseeger@gmail.com
c1d308d90f3ca459eed2f1f458b424298357d43e
2118dd7a5237c1e5cb3c6821b9b3b41c9c81dfdb
/checks/arityck/test/data/bad.cxx
7df437f40f467f1e435e5b2b9dafbc25a46eb6ca
[ "BSD-3-Clause" ]
permissive
bodand/cg3
42d75f4db49c40172fb51af9d441c812a64b328f
e23075c542b658085f09dd10e712dd3c72773c4e
refs/heads/trunk
2023-06-08T11:33:34.429639
2022-12-28T21:00:54
2022-12-30T13:37:45
570,995,405
0
0
NOASSERTION
2022-12-06T21:10:23
2022-11-26T20:11:30
C++
UTF-8
C++
false
false
368
cxx
/* cg3 project * * Copyright (c) 2022 András Bodor * All rights reserved. * * Originally created: 2022. 12. 10. * * checks/arityck/test/data/bad -- * Test data for checking arityck to report functions that failed the check. */ #include <string> int quinary(std::string a, int b, int c, int d, int e) { // STAY ON LINE 14!!! // oh no return 42; }
[ "bodand@pm.me" ]
bodand@pm.me
f49d260217919905e14f7b654afb4698668c3cdb
c0caed81b5b3e1498cbca4c1627513c456908e38
/src/core/indexed_structure_store/H5FragmentStoreBackend.hh
bec7b632e6c6620cb42e8f7b93f65cf662cd6052
[]
no_license
malaifa/source
5b34ac0a4e7777265b291fc824da8837ecc3ee84
fc0af245885de0fb82e0a1144422796a6674aeae
refs/heads/master
2021-01-19T22:10:22.942155
2017-04-19T14:13:07
2017-04-19T14:13:07
88,761,668
0
2
null
null
null
null
UTF-8
C++
false
false
2,519
hh
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*- // vi: set ts=2 noet: // // (c) Copyright Rosetta Commons Member Institutions. // (c) This file is part of the Rosetta software suite and is made available under license. // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. // (c) For more information, see http://www.rosettacommons.org. Questions about this can be // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu. /// @file /// @brief /// @author Alex Ford <fordas@uw.edu> #ifndef INCLUDED_core_indexed_structure_store_H5FragmentStoreBackend_hh #define INCLUDED_core_indexed_structure_store_H5FragmentStoreBackend_hh #ifdef USEHDF5 // Utility Headers #include <vector> #include <string> #include <platform/types.hh> #include <utility/pointer/ReferenceCount.hh> #include <core/indexed_structure_store/H5FragmentStoreBackend.fwd.hh> #include <core/indexed_structure_store/FragmentStore.fwd.hh> #include "H5Cpp.h" namespace core { namespace indexed_structure_store { // @brief Core database handle. // Encapsulates reading Structure/Residue data from data store and manages retrieval on indices on store. class H5FragmentStoreBackend { public: // Structure database contains structure data and structure geometry indices for a collection // of target structures. The data is stored in the following tables: // '/fragments' = // TODO alexford document // // Opens file handle H5FragmentStoreBackend(std::string target_filename); // @brief Retrieves fragment store from backend. FragmentStoreOP get_fragment_store(std::string store_name); void append_to_fragment_store(FragmentStoreOP fragment_store, std::string store_name, std::string group_field, std::string group_type); //H5 DataTypes for store datatypes. static H5::DataType FragmentThresholdDistanceEntryDatatype(); static H5::DataType FragmentCoordinateEntryDatatype(FragmentSpecification fragment_spec); static H5::DataType FragmentInt64GroupEntryDatatype(std::string group_field); static H5::DataType FragmentRealGroupEntryDatatype(std::string group_field); static H5::DataType FragmentReal1PerResGroupEntryDatatype(std::string group_field,FragmentSpecification fragment_spec); static H5::DataType FragmentString1PerResGroupEntryDatatype(std::string group_field,FragmentSpecification fragment_spec); private: H5::H5File target_file_; std::string target_filename_; }; } } #endif #endif
[ "malaifa@yahoo.com" ]
malaifa@yahoo.com
b50223edfd3bfbaebbe2ef3680b2b9cbc112e7da
8a26199ba1e093249707bf5db321183700b83a29
/Energy-aware supercomputing/CPU.h
42586613b03087d462e4e203ef3aa78c1e4170d2
[]
no_license
ollim84/Cplusplus-projects
15a27203736ac0acc2bd886d15fc32539334503d
62b0c3277eedf19a6226f572ba48d86090cd7355
refs/heads/master
2020-04-18T06:23:50.392098
2019-04-16T10:23:45
2019-04-16T10:23:45
167,318,688
1
1
null
null
null
null
UTF-8
C++
false
false
1,000
h
#ifndef __INET_CPU_H #define __INET_CPU_H #include <vector> #include "Core.h" #include "Cache.h" #include <omnetpp.h> class CPU{// : public cSimpleModule{ // class name public: CPU();// default constructor //CPU(int n); // constructor overloaded int Architecture; //enumeration, 0=Intel, 1 = AMD int operatingSystem; // enumeration 0 = Linux, 1 = Windows bool DVFS; int Lithography; double Power_idle; double Power_max; //int corenumber; // #cores in this CPU std::vector<Core> cores; //container for Core(s) std::vector<Cache> caches;//container for Cache(s) typedef std::map<double, int> SameFreqCount; typedef std::map<double, double> SameFreqPower; double computePower(simtime_t from, simtime_t to); double calEnergRedFact(int numberOfCores, double frequency, int loadedCoreCount); double getIdlePower(); protected: //virtual void initialize(); //virtual void handleMessage(cMessage *msg); private: }; #endif
[ "noreply@github.com" ]
noreply@github.com
ddebb3c5aa62cb43180b60d379c8a4b0a1467030
df8464ba771a8a5de42fd82b4801d1f039d754ad
/discrete_math/3 term/lab1/B.cpp
1a51101c5aa6bb3817096a3b07e571190b68e4e4
[]
no_license
nowiwr01w/itmo
b13c135158de109acdaa9ee324cf5ea5e9c5343f
64c775a7779777e120bc5e6a098b49ee8eebc876
refs/heads/master
2022-12-17T04:50:24.002941
2020-09-13T12:27:33
2020-09-13T12:27:33
220,715,265
1
0
null
null
null
null
UTF-8
C++
false
false
1,407
cpp
#include <deque> #include <vector> #include <string> #include <iostream> #include <algorithm> using namespace std; int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); freopen("chvatal.in", "r", stdin); freopen("chvatal.out", "w", stdout); int n; string nn; getline(cin, nn); n = stoi(nn); deque<int> queue; vector<vector<int>> graph(n + 1, vector<int>(n + 1, 0)); for (int i = 1; i < n + 1; i++) { string buffer; getline(cin, buffer); int position = 1; queue.push_back(i); for (char j : buffer) { graph[i][position] = graph[position][i] = (j == '1'); position += 1; } } for (int k = 0; k < n * (n - 1); k++) { int first = queue[0]; int second = queue[1]; if (graph[first][second] == 0) { int j = 2; while (j < n - 1 && (graph[first][queue[j]] == 0 || graph[second][queue[j + 1]] == 0)) { j += 1; } if (j == n - 1) { j = 2; while (j < n && graph[first][queue[j]] == 0) { j += 1; } } reverse(queue.begin() + 1, queue.begin() + j + 1); } queue.pop_front(); queue.push_back(first); } for (auto i : queue) { cout << i << ' '; } return 0; }
[ "nowiwr01@gmail.com" ]
nowiwr01@gmail.com
65b67177a17d58897d6b83f020e29cd0663c900a
797a1fba6f3737eb5d23dcfe6835166496021aaa
/Plugin/Extensions/KeyboardExtension.cpp
8fb41764b3af7ed55d94a65f6ddc4a4f92abe2c9
[]
no_license
sppkopo0327/BrowserSourcePlugin
4a25f60427859d0e8ddbfb8df7158236b1f88e33
9d9735578e2a4cbf9f72a9f3d8e0e9ce783e34c3
refs/heads/master
2021-01-21T16:14:38.797488
2013-09-12T23:24:00
2013-09-12T23:24:00
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,495
cpp
/** * John Bradley (jrb@turrettech.com) */ #include "KeyboardExtension.h" KeyboardManager * KeyboardExtensionFactory::GetKeyboardManager() { return keyboardManager; } KeyboardManager *KeyboardExtensionFactory::keyboardManager = NULL; KeyboardExtension::KeyboardExtension(const KeyboardManager *keyboardManager) : JavascriptExtension("OBSKeyboardExtension") { this->keyboardManager = keyboardManager; returnArgumentFunctions.insert("getKeyEvents"); InitializeCriticalSection(&keyEventLock); } KeyboardExtension::~KeyboardExtension() { DeleteCriticalSection(&keyEventLock); } JSValue KeyboardExtension::Handle( const std::string &functionName, const JSArray &args) { // {events: [[type, vkCode]..] getKeyEvents() if (functionName == "getKeyEvents") { assert(args.size() == 0); EnterCriticalSection(&keyEventLock); JSArray returnArgs; while(keyEvents.size()) { Keyboard::Key &key = keyEvents[0]; JSArray args; args.Push(JSValue(key.type)); args.Push(JSValue((int)key.vkCode)); returnArgs.Push(args); keyEvents.erase(keyEvents.begin()); } LeaveCriticalSection(&keyEventLock); return returnArgs; } return JSValue::Undefined(); } void KeyboardExtension::KeyboardEvent(Keyboard::Key &key) { EnterCriticalSection(&keyEventLock); keyEvents.push_back(key); LeaveCriticalSection(&keyEventLock); }
[ "jrbradley@gmail.com" ]
jrbradley@gmail.com
71c61a5d18e4c84710877c8e33877131661a4754
8a2001b338d4fb854c9d99cfff1fee7d64cb4a64
/src/hearthstone-world/World.h
865865187dc70fb5afc695fa607ca60f82dc2646
[]
no_license
Sandshroud/Sandshroud-Onyx
06dceec3ded18013dfaf6d4ca7ff53a9af581167
133f92d1adcfd13bb28119bff777982690f41ff9
refs/heads/master
2021-01-25T05:21:26.141410
2013-02-19T06:10:57
2013-02-19T06:10:57
8,284,289
1
0
null
null
null
null
UTF-8
C++
false
false
19,585
h
/*** * Demonstrike Core */ #pragma once #define IS_INSTANCE(a) (a > 1 && a != 530 && a != 571 && a != 609) #define IS_MAIN_MAP(a) (a == 0 || a == 1 || a == 530 || a == 571 || a == 609) class Object; class WorldPacket; class WorldSession; class Unit; class Creature; class GameObject; class DynamicObject; class Player; class MapMgr; class Battleground; class Lacrimi; enum Rates { RATE_HEALTH=0, RATE_POWER1, RATE_POWER2, RATE_POWER3, RATE_DROP0, // separate rates for each quality level RATE_DROP1, RATE_DROP2, RATE_DROP3, RATE_DROP4, RATE_DROP5, RATE_DROP6, RATE_MONEY, RATE_QUEST_MONEY, RATE_XP, RATE_RESTXP, RATE_QUESTXP, RATE_HONOR, RATE_QUESTREPUTATION, RATE_KILLREPUTATION, RATE_SKILLCHANCE, RATE_SKILLRATE, RATE_ARENAPOINTMULTIPLIER2X, RATE_ARENAPOINTMULTIPLIER3X, RATE_ARENAPOINTMULTIPLIER5X, RATE_EOTS_CAPTURERATE, MAX_RATES }; enum EventIdFlags { EVENTID_FLAG_NONE = 0, EVENTID_FLAG_PHASE = 1, EVENTID_FLAG_MODELID = 2, EVENTID_FLAG_EQUIP = 4, //this obviously cannot be used for gameobjects EVENTID_FLAG_SPAWN = 8 }; enum EnviromentalDamage { DAMAGE_EXHAUSTED = 0, DAMAGE_DROWNING = 1, DAMAGE_FALL = 2, DAMAGE_LAVA = 3, DAMAGE_SLIME = 4, DAMAGE_FIRE = 5 }; enum CharCreateErrors { SUCCESS, FAILURE, CANCELLED, DISCONNECT_FROM_SERVER, FAILED_TO_CONNECT, CONNECTED, WRONG_CLIENT_VERSION, CONNECTING_TO_SERVER, NEGOTIATING_SECURITY, NEGOTIATING_SECURITY_COMPLETE, NEGOTIATING_SECURITY_FAILED, AUTHENTICATING, AUTHENTICATION_SUCCESSFUL, AUTHENTICATION_FAILED, LOGIN_UNAVAIBLE, SERVER_IS_NOT_VALID, SYSTEM_UNAVAIBLE, SYSTEM_ERROR, BILLING_SYSTEM_ERROR, ACCOUNT_BILLING_EXPIRED, WRONG_CLIENT_VERSION_2, UNKNOWN_ACCOUNT, INCORRECT_PASSWORD, SESSION_EXPIRED, SERVER_SHUTTING_DOWN, ALREADY_LOGGED_IN, INVALID_LOGIN_SERVER, POSITION_IN_QUEUE_0, THIS_ACCOUNT_HAS_BEEN_BANNED, THIS_CHARACTER_STILL_LOGGED_ON, YOUR_WOW_SUBSCRIPTION_IS_EXPIRED, THIS_SESSION_HAS_TIMED_OUT, THIS_ACCOUNT_TEMP_SUSPENDED, ACCOUNT_BLOCKED_BY_PARENTAL_CONTROL, RETRIEVING_REALMLIST, REALMLIST_RETRIEVED, UNABLE_TO_CONNECT_REALMLIST_SERVER, INVALID_REALMLIST, GAME_SERVER_DOWN, CREATING_ACCOUNT, ACCOUNT_CREATED, ACCOUNT_CREATION_FAIL, RETRIEVE_CHAR_LIST, CHARLIST_RETRIEVED, CHARLIST_ERROR, CREATING_CHARACTER, CHARACTER_CREATED, ERROR_CREATING_CHARACTER, CHARACTER_CREATION_FAIL, NAME_IS_IN_USE, CREATION_OF_RACE_DISABLED, ALL_CHARS_ON_PVP_REALM_MUST_AT_SAME_SIDE, ALREADY_HAVE_MAXIMUM_CHARACTERS, ALREADY_HAVE_MAXIMUM_CHARACTERS_2, SERVER_IS_CURRENTLY_QUEUED, ONLY_PLAYERS_WHO_HAVE_CHARACTERS_ON_THIS_REALM, NEED_EXPANSION_ACCOUNT, DELETING_CHARACTER, CHARACTER_DELETED, CHARACTER_DELETION_FAILED, ENTERING_WOW, LOGIN_SUCCESFUL, WORLD_SERVER_DOWN, A_CHARACTER_WITH_THAT_NAME_EXISTS, NO_INSTANCE_SERVER_AVAIBLE, LOGIN_FAILED, LOGIN_FOR_THAT_RACE_DISABLED, LOGIN_FOR_THAT_RACE_CLASS_DISABLED,//check ENTER_NAME_FOR_CHARACTER, NAME_AT_LEAST_TWO_CHARACTER, NAME_AT_MOST_12_CHARACTER, NAME_CAN_CONTAIN_ONLY_CHAR, NAME_CONTAIN_ONLY_ONE_LANG, NAME_CONTAIN_PROFANTY, NAME_IS_RESERVED, YOU_CANNOT_USE_APHOS, YOU_CAN_ONLY_HAVE_ONE_APHOS, YOU_CANNOT_USE_SAME_LETTER_3_TIMES, NO_SPACE_BEFORE_NAME, BLANK, INVALID_CHARACTER_NAME, BLANK_1 //All further codes give the number in dec. }; // ServerMessages.dbc enum ServerMessageType { SERVER_MSG_SHUTDOWN_TIME = 1, SERVER_MSG_RESTART_TIME = 2, SERVER_MSG_STRING = 3, SERVER_MSG_SHUTDOWN_CANCELLED = 4, SERVER_MSG_RESTART_CANCELLED = 5 }; enum ServerShutdownType { SERVER_SHUTDOWN_TYPE_SHUTDOWN = 1, SERVER_SHUTDOWN_TYPE_RESTART = 2, }; enum WorldMapInfoFlag { WMI_INSTANCE_ENABLED = 0x1, WMI_INSTANCE_WELCOME = 0x2, WMI_INSTANCE_MULTIMODE = 0x4, WMI_INSTANCE_XPACK_01 = 0x8 //The Burning Crusade expansion }; enum AccountFlags { ACCOUNT_FLAG_VIP = 0x1, ACCOUNT_FLAG_SPONSOR = 0x2, ACCOUNT_FLAG_SUPER_SPONSOR = 0x4, ACCOUNT_FLAG_XPACK_01 = 0x8 }; enum HolidayMasks { HOLIDAY_DARKMOON_FAIRE = 0x1, HOLIDAY_BREWFEST = 0x2, HOLIDAY_LOVE_IS_IN_AIR = 0x4, HOLIDAY_MIDSUMMER = 0x8, HOLIDAY_CHILD_WEEK = 0x10, HOLIDAY_WINTER_VIEL = 0x20, HOLIDAY_NOBLEGARDEN = 0x40, HOLIDAY_HALLOWS_END = 0x80, HOLIDAY_HARVEST_FEST = 0x100, HOLIDAY_LUNAR_FEST = 0x200, HOLIDAY_DAY_OF_DEAD = 0x400, HOLIDAY_PILGRIM_BOUNTY = 0x800, HOLIDAY_ALL = HOLIDAY_DARKMOON_FAIRE | HOLIDAY_BREWFEST | HOLIDAY_LOVE_IS_IN_AIR | HOLIDAY_MIDSUMMER | HOLIDAY_CHILD_WEEK | HOLIDAY_WINTER_VIEL | HOLIDAY_NOBLEGARDEN | HOLIDAY_HALLOWS_END | HOLIDAY_HARVEST_FEST | HOLIDAY_LUNAR_FEST | HOLIDAY_DAY_OF_DEAD | HOLIDAY_PILGRIM_BOUNTY }; #pragma pack(push,1) struct MapInfo { uint32 mapid; char * name; bool load; uint32 type; uint32 playerlimit; uint32 minlevel; uint32 LinkedAreaTrigger; float repopx; float repopy; float repopz; int32 repopmapid; uint32 flags; uint32 cooldown; uint32 required_quest; uint32 required_item; uint32 heroic_key[2]; bool HasFlag(uint32 flag) { return (flags & flag) != 0; } }; #pragma pack(pop) struct AreaTable; struct insert_playeritem { uint32 ownerguid; uint32 entry; uint32 wrapped_item_id; uint32 wrapped_creator; uint32 creator; uint32 count; uint32 charges; uint32 flags; uint32 randomprop; uint32 randomsuffix; uint32 itemtext; uint32 durability; int32 containerslot; int32 slot; string enchantments; }; struct insert_playerskill { uint32 player_guid; uint32 skill_id; uint32 type; uint32 currentlvl; uint32 maxlvl; }; struct insert_playerquest { uint32 player_guid; uint32 quest_id; uint32 slot; uint32 time_left; uint32 explored_area1; uint32 explored_area2; uint32 explored_area3; uint32 explored_area4; uint32 mob_kill1; uint32 mob_kill2; uint32 mob_kill3; uint32 mob_kill4; uint32 slain; }; struct insert_playerglyph { uint32 player_guid; uint32 spec; uint32 glyph1; uint32 glyph2; uint32 glyph3; uint32 glyph4; uint32 glyph5; uint32 glyph6; }; struct insert_playertalent { uint32 player_guid; uint32 spec; uint32 tid; uint32 rank; }; struct insert_playerspell { uint32 player_guid; uint32 spellid; }; class BasicTaskExecutor : public ThreadContext { CallbackBase * cb; uint32 priority; public: BasicTaskExecutor(CallbackBase * Callback, uint32 Priority) : cb(Callback), priority(Priority) {} ~BasicTaskExecutor() { delete cb; } bool run(); }; class Task { CallbackBase * _cb; public: Task(CallbackBase * cb) : _cb(cb), completed(false), in_progress(false) {} ~Task() { delete _cb; } bool completed; bool in_progress; void execute(); }; struct InsertQueueLoader : public Singleton<InsertQueueLoader> { private: uint32 m_UpdateTimer; public: InsertQueueLoader(); ~InsertQueueLoader(); void Update(uint32 timeDiff); }; class TaskList { set<Task*> tasks; Mutex queueLock; public: Task * GetTask(); void AddTask(Task* task); void RemoveTask(Task * task) { queueLock.Acquire(); tasks.erase(task); queueLock.Release(); } void spawn(); void kill(); void wait(); void waitForThreadsToExit(); uint32 thread_count; bool running; Mutex tcMutex; void incrementThreadCount() { tcMutex.Acquire(); ++thread_count; tcMutex.Release(); } void decrementThreadCount() { tcMutex.Acquire(); --thread_count; tcMutex.Release(); } }; enum BasicTaskExecutorPriorities { BTE_PRIORITY_LOW = 0, BTE_PRIORITY_MED = 1, BTW_PRIORITY_HIGH = 2, }; class TaskExecutor : public ThreadContext { TaskList * starter; public: TaskExecutor(TaskList * l) : ThreadContext(), starter(l) { l->incrementThreadCount(); } ~TaskExecutor() { starter->decrementThreadCount(); } bool run(); }; class WorldSocket; // Slow for remove in middle, oh well, wont get done much. typedef std::list<WorldSocket*> QueueSet; typedef set<WorldSession*> SessionSet; #define MAXIMUM_CEXPANSION_LEVEL 70 // Current expansion's max level #define MAXIMUM_ATTAINABLE_LEVEL 100 // Crow: Lets use 100, since its the highest the DBCs will support bool MatchesClass(uint8 _class, uint8 talentTree); class SERVER_DECL World : public Singleton<World>, public EventableObject { public: World(); ~World(); void Destruct(); uint32 GetMaxLevel(Player* plr); uint32 GetMaxLevelStatCalc(); /** Reloads the config and sets all of the setting variables */ void Rehash(bool load); void CleanupCheaters(); WorldSession* FindSession(uint32 id); WorldSession* FindSessionByName(const char *); void AddSession(WorldSession *s); void RemoveSession(uint32 id); void AddGlobalSession(WorldSession *GlobalSession); void RemoveGlobalSession(WorldSession *GlobalSession); void DeleteGlobalSession(WorldSession *GlobalSession); HEARTHSTONE_INLINE size_t GetSessionCount() const { return m_sessions.size(); } HEARTHSTONE_INLINE size_t GetQueueCount() { return mQueuedSessions.size(); } void GetStats(uint32 * GMCount, float * AverageLatency); HEARTHSTONE_INLINE uint32 GetPlayerLimit() const { return m_playerLimit; } void SetPlayerLimit(uint32 limit) { m_playerLimit = limit; } HEARTHSTONE_INLINE bool getAllowMovement() const { return m_allowMovement; } void SetAllowMovement(bool allow) { m_allowMovement = allow; } HEARTHSTONE_INLINE bool getGMTicketStatus() { return m_gmTicketSystem; }; bool toggleGMTicketStatus() { m_gmTicketSystem = !m_gmTicketSystem; return m_gmTicketSystem; }; HEARTHSTONE_INLINE std::string getGmClientChannel() { return GmClientChannel; } // MOTD line 1 void SetMotd(const char *motd) { m_motd = motd; } HEARTHSTONE_INLINE const char* GetMotd() const { return m_motd.c_str(); } HEARTHSTONE_INLINE time_t GetGameTime() const { return m_gameTime; } bool SetInitialWorldSettings(); // No touchie. void InternalInitialization(uint32 stime); void SendWorldText(const char *text, WorldSession *self = 0); void SendWorldWideScreenText(const char *text, WorldSession *self = 0); void SendGlobalMessage(WorldPacket *packet, WorldSession *self = 0); void SendZoneMessage(WorldPacket *packet, uint32 zoneid, WorldSession *self = 0); void SendInstanceMessage(WorldPacket *packet, uint32 instanceid, WorldSession *self = 0); void SendFactionMessage(WorldPacket *packet, uint8 teamId); void SendGMWorldText(const char* text, bool admin = false); void SendAdministratorMessage(WorldPacket *packet); void SendGamemasterMessage(WorldPacket *packet); void SendMessageToGMs(WorldSession *self, const char * text, ...); HEARTHSTONE_INLINE void SetStartTime(uint32 val) { m_StartTime = val; } HEARTHSTONE_INLINE uint32 GetUptime(void) { return (uint32)UNIXTIME - m_StartTime; } HEARTHSTONE_INLINE uint32 GetStartTime(void) { return m_StartTime; } std::string GetUptimeString(); // update the world server every frame void Update(time_t diff); void CheckForExpiredInstances(); void UpdateSessions(uint32 diff); HEARTHSTONE_INLINE void setRate(int index,float value) { regen_values[index]=value; } HEARTHSTONE_INLINE float getRate(int index) { return regen_values[index]; } // talent inspection lookup tables std::map< uint32, map<uint32, uint8> > ClassTalentTrees; uint32 GetClassTalentTree(uint8 index, uint32 _class) { std::map< uint32, map<uint32, uint8> >::iterator itr = ClassTalentTrees.find(_class); if(itr == ClassTalentTrees.end()) return 0; if(itr->second.find(index) == itr->second.end()) return 0; return itr->second[index]; }; std::map< uint32, uint32 > InspectTalentTabSize; uint8 GetTalentBitCount(uint32 Tree) { std::map< uint32, uint32 >::iterator itr = InspectTalentTabSize.find(Tree); if(itr == InspectTalentTabSize.end()) return 0; return itr->second; }; // map text emote to spell prices typedef std::map< uint32, uint32> SpellPricesMap; SpellPricesMap mPrices; uint32 MaxLevelCalc; struct NameGenData { string name; uint32 type; }; vector<NameGenData> _namegendata[3]; void LoadNameGenData(); std::string GenerateName(uint32 type = 0); std::map<uint32, AreaTable*> mAreaIDToTable; std::map<uint32, AreaTable*> mZoneIDToTable; std::map<uint32,uint32> TeachingSpellMap; uint32 GetTeachingSpell(uint32 NormalSpellId) { map<uint32,uint32>::iterator i = TeachingSpellMap.find(NormalSpellId); if(i!=TeachingSpellMap.end()) return i->second; return 0; } uint32 AddQueuedSocket(WorldSocket* Socket); void RemoveQueuedSocket(WorldSocket* Socket); uint32 GetQueuePos(WorldSocket* Socket); void UpdateQueuedSessions(uint32 diff); Mutex queueMutex; uint32 mQueueUpdateInterval; bool cross_faction_world; bool trade_world_chat; uint32 m_deathKnightReqLevel; bool m_deathKnightOnePerAccount; bool EnableFatigue; void SaveAllPlayers(); bool LogCheaters; bool LogCommands; bool LogPlayers; bool LogChats; bool NumericCommandGroups; string LuaScriptPath; string GameMonkeyScriptPath; string DBCPath; string MapPath; string vMapPath; string MMapPath; bool Collision; bool PathFinding; bool ServerPreloading; bool AHEnabled; bool DisableBufferSaving; bool SpeedhackProtection; uint32 mInWorldPlayerCount; bool CalculatedHeightChecks; uint32 mAcceptedConnections; float NetworkStressIn; float NetworkStressOut; bool CheckSanctuary(uint32 MapId, uint32 areaA, uint32 areaB) { if(FunServerMall != -1) if(areaA == FunServerMall || areaB == FunServerMall) return true; std::set<uint32>::iterator end = Sanctuaries.end(); if(areaA == areaB) { if(Sanctuaries.find(areaA) != end) return true; } else { if(Sanctuaries.find(areaA) != end) return true; if(Sanctuaries.find(areaB) != end) return true; } return SanctuaryMaps.find(MapId) != SanctuaryMaps.end(); } std::set<uint32> Sanctuaries; void SetSanctuaryArea(uint32 areaid) { Sanctuaries.insert(areaid); } void RemoveSanctuaryArea(uint32 areaid) { Sanctuaries.erase(areaid); } bool IsSanctuaryArea(uint32 areaid) { return Sanctuaries.find(areaid) != Sanctuaries.end(); } struct RestedAreaInfo { RestedAreaInfo(int8 team){ReqTeam = team;}; int8 ReqTeam; }; std::map<uint32, RestedAreaInfo*> RestedAreas; void SetRestedArea(uint32 areaid, int8 reqteam = -1) { if(RestedAreas[areaid] == NULL) RestedAreas[areaid] = new RestedAreaInfo(reqteam); else RestedAreas[areaid]->ReqTeam = reqteam; } void RemoveRestedArea(uint32 areaid) { RestedAreaInfo* info = RestedAreas[areaid]; if(info != NULL) { RestedAreas.erase(areaid); delete info; info = NULL; } } RestedAreaInfo* GetRestedAreaInfo(uint32 areaid) { return RestedAreas[areaid]; } std::set<uint32> SanctuaryMaps; void SetSanctuaryMap(uint32 mapid) { SanctuaryMaps.insert(mapid); } void RemoveSanctuaryMap(uint32 mapid) { SanctuaryMaps.erase(mapid); } bool IsSanctuaryMap(uint32 mapid) { return SanctuaryMaps.find(mapid) != SanctuaryMaps.end(); } std::map<uint32, RestedAreaInfo*> RestedMapIds; void SetRestedMap(uint32 mapid, int8 reqteam = -1) { if(RestedMapIds[mapid] == NULL) RestedMapIds[mapid] = new RestedAreaInfo(reqteam); else RestedMapIds[mapid]->ReqTeam = reqteam; } void RemoveRestedMap(uint32 mapid) { RestedAreaInfo* info = RestedMapIds[mapid]; if(info != NULL) { RestedMapIds.erase(mapid); delete info; info = NULL; } } RestedAreaInfo* GetRestedMapInfo(uint32 mapid) { return RestedMapIds[mapid]; } uint32 HordePlayers; uint32 AlliancePlayers; uint32 PeakSessionCount; bool IsPvPRealm; bool SendMovieOnJoin; int32 FunServerMall; int LogoutDelay; SessionSet gmList; RWLock gmList_lock; uint32 expansionUpdateTime; void DeleteObject(Object* obj); bool GuildsLoading; uint8 StartLevel; uint32 StartGold; uint32 flood_lines; uint32 flood_seconds; uint32 flood_message_time; uint32 flood_mute_after_flood; uint32 flood_caps_min_len; float flood_caps_pct; bool flood_message; bool gm_force_robes; bool antihack_teleport; bool antihack_speed; bool antihack_flight; bool antihack_cheatengine; bool no_antihack_on_gm; //Enable/Disable specific battlegrounds/arenas bool wg_enabled; bool av_enabled; uint32 av_minplrs; bool ab_enabled; uint32 ab_minplrs; bool wsg_enabled; uint32 wsg_minplrs; bool eots_enabled; uint32 eots_minplrs; bool sota_enabled; uint32 sota_minplrs; bool ioc_enabled; uint32 ioc_minplrs; // Level Caps uint32 LevelCap_Custom_All; bool Start_With_All_Taximasks; // could add configs for every expansion.. void CharacterEnumProc(QueryResultVector& results, uint32 AccountId); void LoadAccountDataProc(QueryResultVector& results, uint32 AccountId); void PollCharacterInsertQueue(DatabaseConnection * con); void PollMailboxInsertQueue(DatabaseConnection * con); void DisconnectUsersWithAccount(const char * account, WorldSession * session); void DisconnectUsersWithIP(const char * ip, WorldSession * session); void DisconnectUsersWithPlayerName(const char * plr, WorldSession * session); void LogoutPlayers(); void BackupDB(); void LogGM(WorldSession* session, string message, ...); void LogCheater(WorldSession* session, string message, ...); void LogPlayer(WorldSession* session, string message, ...); void LogChat(WorldSession* session, string message, ...); protected: // update Stuff, FIXME: use diff time_t _UpdateGameTime() { // Update Server time time_t thisTime = UNIXTIME; m_gameTime += thisTime - m_lastTick; //in seconds if(m_gameTime >= 86400) // One day has passed m_gameTime -= 86400; m_lastTick = thisTime; return m_gameTime; } void FillSpellReplacementsTable(); private: //! Timers typedef HM_NAMESPACE::hash_map<uint32, WorldSession*> SessionMap; SessionMap m_sessions; RWLock m_sessionlock; typedef HM_NAMESPACE::hash_map<uint32, AreaTrigger*> AreaTriggerMap; AreaTriggerMap m_AreaTrigger; protected: Mutex SessionsMutex;//FOR GLOBAL ! SessionSet GlobalSessions; float regen_values[MAX_RATES]; uint32 m_playerLimit; bool m_allowMovement; bool m_gmTicketSystem; std::string m_motd; time_t m_gameTime; time_t m_lastTick; uint32 m_StartTime; uint32 m_queueUpdateTimer; QueueSet mQueuedSessions; public: ThreadContext* LacrimiThread; Lacrimi* LacrimiPtr; Mutex PacketLogMutex; FILE* m_PacketLog; void LogPacket(uint32 len, uint16 opcode, const uint8* data, uint8 direction); std::string GmClientChannel; bool m_reqGmForCommands; list<SpellEntry*> dummyspells; bool m_limitedNames; bool m_useAccountData; float m_movementCompressThreshold; float m_movementCompressThresholdCreatures; uint32 m_movementCompressRate; uint32 m_movementCompressInterval; float m_speedHackThreshold; float m_speedHackLatencyMultiplier; uint32 m_speedHackResetInterval; uint32 m_CEThreshold; // shutdown uint32 m_shutdownTime; uint32 m_shutdownType; uint32 m_shutdownLastTime; void QueueShutdown(uint32 delay, uint32 type); void CancelShutdown(); void UpdateShutdownStatus(); void UpdatePlayerItemInfos(); bool VerifyName(const char * name, size_t nlen) { const char * p; size_t i; static const char * bannedCharacters = "\t\v\b\f\a\n\r\\\"\'\?<>[](){}_=+-|/!@#$%^&*~`.,0123456789\0"; for(i = 0; i < nlen; i++) { p = bannedCharacters; while(*p != 0 && name[i] != *p && name[i] != 0) ++p; if(*p != 0) return false; } return true; } bool QueryLog; public: // Crow: CPU and RAM shit. TODO: LINUX support float GetCPUUsage(bool external = false); float GetRAMUsage(bool external = false); #ifdef WIN32 private: bool m_bFirstTime; __int64 m_lnOldValue; LARGE_INTEGER m_OldPerfTime100nSec; uint32 number_of_cpus; uint32 m_current_holiday_mask; #endif // WIN32 }; #define sIQL InsertQueueLoader::getSingleton() #define sWorld World::getSingleton() uint32 PlayerMaskToClass(uint32 mask);
[ "Crow5736@yahoo.com" ]
Crow5736@yahoo.com
28eba83d17fa031027000a86167d7c8615df4217
c3203a11c0ab4f9e3a853fcd658166990cf8487b
/LeetCode/preparation/qs_dfs_targetSum.cpp
e9f5b845ae463b84c7ebbcd96eee09f342929bcc
[]
no_license
betogaona7/CompetitiveProgramming
3d37688f028593a2314c676f3e01cc0e5b6d1d8e
5ac5b7bf13941cc56f28e595eeb33acfa98650b3
refs/heads/master
2021-01-12T06:09:24.069374
2020-04-23T15:02:16
2020-04-23T15:02:16
77,318,404
0
0
null
null
null
null
UTF-8
C++
false
false
603
cpp
class Solution { public: int findTargetSumWays(vector<int>& nums, int S) { vector<int> dp (2001); dp[nums[0] + 1000] = 1; dp[-nums[0] + 1000] += 1; for(int i = 1; i < nums.size(); ++i){ vector <int> next (2001); for(int sum = -1000; sum <= 1000; ++sum){ if(dp[sum + 1000] > 0){ next[sum + nums[i] + 1000] += dp[sum + 1000]; next[sum - nums[i] + 1000] += dp[sum + 1000]; } } dp = next; } return S > 1000 ? 0 : dp[S + 1000]; } };
[ "albertoo_3c@hotmail.com" ]
albertoo_3c@hotmail.com
de9f618733236fcc5b2580ffc55505917eb3bb66
43a2fbc77f5cea2487c05c7679a30e15db9a3a50
/Cpp/External (Offsets Only)/SDK/BP_hair_col_brown_03_under_Desc_classes.h
8443c9b4ad99d45e561dbf65652e6c6b8ae5f9e5
[]
no_license
zH4x/SoT-Insider-SDK
57e2e05ede34ca1fd90fc5904cf7a79f0259085c
6bff738a1b701c34656546e333b7e59c98c63ad7
refs/heads/main
2023-06-09T23:10:32.929216
2021-07-07T01:34:27
2021-07-07T01:34:27
383,638,719
0
0
null
null
null
null
UTF-8
C++
false
false
851
h
#pragma once // Name: SoT-Insider, Version: 1.102.2382.0 /*!!DEFINE!!*/ /*!!HELPER_DEF!!*/ /*!!HELPER_INC!!*/ #ifdef _MSC_VER #pragma pack(push, 0x01) #endif namespace CG { //--------------------------------------------------------------------------- // Classes //--------------------------------------------------------------------------- // BlueprintGeneratedClass BP_hair_col_brown_03_under_Desc.BP_hair_col_brown_03_under_Desc_C // 0x0000 (FullSize[0x00E0] - InheritedSize[0x00E0]) class UBP_hair_col_brown_03_under_Desc_C : public UClothingDesc { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("BlueprintGeneratedClass BP_hair_col_brown_03_under_Desc.BP_hair_col_brown_03_under_Desc_C"); return ptr; } void AfterRead(); void BeforeDelete(); }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "Massimo.linker@gmail.com" ]
Massimo.linker@gmail.com
bd18496da57d64afbd77bb61e52fb51ec9be095d
6b40e9dccf2edc767c44df3acd9b626fcd586b4d
/NT/shell/osshell/security/dssec/cstrings.cpp
b85f85cebe2cb24f590f2b06ea55d68ff32a3eaa
[]
no_license
jjzhang166/WinNT5_src_20201004
712894fcf94fb82c49e5cd09d719da00740e0436
b2db264153b80fbb91ef5fc9f57b387e223dbfc2
refs/heads/Win2K3
2023-08-12T01:31:59.670176
2021-10-14T15:14:37
2021-10-14T15:14:37
586,134,273
1
0
null
2023-01-07T03:47:45
2023-01-07T03:47:44
null
UTF-8
C++
false
false
2,116
cpp
//+------------------------------------------------------------------------- // // Microsoft Windows // // Copyright (C) Microsoft Corporation, 1997 - 1999 // // File: cstrings.cpp // // Constant strings used by this app // //-------------------------------------------------------------------------- #include "pch.h" #pragma hdrstop TCHAR const c_szDllName[] = TEXT("dssec.dll"); TCHAR const c_szNetApi32[] = TEXT("NetApi32.dll"); TCHAR const c_szAclUI[] = TEXT("aclui.dll"); WCHAR const c_szFilterFile[] = L"dssec.dat"; WCHAR const c_szClassKey[] = L"@"; WCHAR const c_szGUIDFormat[] = L"{%s}"; WCHAR const c_szClassFilter[] = L"(objectClass=classSchema)"; WCHAR const c_szPropertyFilter[] = L"(objectClass=attributeSchema)"; WCHAR const c_szERFilterFormat[] = L"(&(objectClass=controlAccessRight)(appliesTo=%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x))"; WCHAR const c_szLDAPDisplayName[] = L"lDAPDisplayName"; WCHAR const c_szDisplayName[] = L"displayName"; WCHAR const c_szDisplayID[] = L"localizationDisplayId"; WCHAR const c_szValidAccesses[] = L"validAccesses"; WCHAR const c_szSchemaIDGUID[] = L"schemaIDGUID"; WCHAR const c_szRightsGuid[] = L"rightsGuid"; WCHAR const c_szSDProperty[] = L"nTSecurityDescriptor"; WCHAR const c_szSDRightsProp[] = L"sDRightsEffective"; WCHAR const c_szSchemaContext[] = L"schemaNamingContext"; WCHAR const c_szConfigContext[] = L"configurationNamingContext"; WCHAR const c_szERContainer[] = L"CN=Extended-Rights"; WCHAR const c_szRootDsePath[] = L"LDAP://rootdse"; WCHAR const c_szPathFormat[] = L"LDAP://%s"; WCHAR const c_szCNFormat[] = L"CN=%s"; WCHAR const c_szDefaultSchemaSD[] = L"defaultSecurityDescriptor"; WCHAR const c_szAttributeSecurityGuid[] = L"attributeSecurityGUID"; WCHAR const c_szObjectClass[] = L"objectclass"; WCHAR const c_szStructuralObjectClass[] = L"structuralobjectclass"; WCHAR const c_szObjectClassCategory[] = L"objectClassCategory";
[ "seta7D5@protonmail.com" ]
seta7D5@protonmail.com
bd13045139437cef022887061047f67a49048193
b84a4844b3e79108449f5efdbffa66ba78a99fa5
/Scripting/Scripting/objectTest.cpp
824bb0636a010e681e2f1419140f70c27f32f918
[]
no_license
HNoodles/Game
7365ed534c89ce0d57a9b0b67860ce8bb1aef454
c1ffafc1a7bbec7af867d1a650b490e37ec576bf
refs/heads/master
2022-03-25T07:51:48.506749
2019-12-08T01:39:52
2019-12-08T01:39:52
209,411,503
0
0
null
null
null
null
UTF-8
C++
false
false
2,943
cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <fstream> #include <streambuf> #include <iostream> #include <dukglue.h> #include "../EventMgmt/EObjMovement.h" #include "../Objects/Character.h" static void load_script_from_file(duk_context* ctx, const char* filename) // Note: I think it's better to take a const char* as an input because this is what string literals are. { // If this took a string, the compiler would add additional steps to convert the string literal to a string object. std::ifstream t(filename); std::stringstream buffer; buffer << t.rdbuf(); duk_push_lstring(ctx, buffer.str().c_str(), (duk_size_t)(buffer.str().length())); } static duk_ret_t native_print(duk_context* ctx) { duk_push_string(ctx, " "); duk_insert(ctx, 0); duk_join(ctx, duk_get_top(ctx) /* #args -> need to do this if we pass DUK_VARARGS when pushing this c_function */ - 1); printf("%s\n", duk_safe_to_string(ctx, -1)); return 0; } int main() { // Create a heap and initial context duk_context* ctx = NULL; ctx = duk_create_heap_default(); if (!ctx) { printf("Failed to create a Duktape heap.\n"); exit(1); } // Register objects and member functions inside our context dukglue_register_constructor<GameObject>(ctx, "GameObject"); dukglue_register_property(ctx, &GameObject::getId, nullptr, "Id"); dukglue_register_constructor<Character, string>(ctx, "Character"); dukglue_set_base_class<GameObject, Character>(ctx); // Can use the standard duktape API to register c_functions if necessary duk_push_c_function(ctx, native_print, DUK_VARARGS); duk_put_global_string(ctx, "print"); // Load script from file, evaluate script load_script_from_file(ctx, "testObject.js"); // This helper function pushes the script as a string to the value stack if (duk_peval(ctx) != 0) { printf("Error: %s\n", duk_safe_to_string(ctx, -1)); duk_destroy_heap(ctx); return 1; } duk_pop(ctx); // Ignore return, clear stack duk_push_global_object(ctx); // [...] -> [... global] (top) duk_get_prop_string(ctx, -1, "myTest"); // Accesses the object at index -1, i.e. the element at the top of the stack, the global object. // Gets the VALUE associated with the KEY string that belongs to said object, puts it at the top of the stack. // i.e. gets the function associated with the string identifier myTest, places the function at the top of the stack // [... global] ->[... global myTest] if (duk_pcall(ctx, /* Number of arguments to pull of the stack for the function call */ 0) != 0) // duk_pcall calls the function we specified on the stack (myTest) with number of arguments printf("Error: %s\n", duk_safe_to_string(ctx, -1)); // that we specify, then places any return value at the top of the stack (index -1) else printf("%s\n", duk_safe_to_string(ctx, -1)); duk_pop(ctx); duk_destroy_heap(ctx); system("pause"); return 0; }
[ "13671980486@163.com" ]
13671980486@163.com
0d038704297a2ad2f8a479b9aeb1c4b4fd344ef1
35064d6f6c3199a60e1edff8db7ab1e5b0416055
/include/Precision.hpp
b63ce0f0b0bdbe612f13807beb4123e096219dfb
[]
no_license
xyh-cosmo/xcos-lite
28de822796a48a9cd9363a8f105b6f5966ae1f87
a282028645591768df01d13ce3f08ee4fa376c54
refs/heads/master
2021-03-22T04:59:45.239150
2018-01-02T02:09:43
2018-01-02T02:09:43
114,603,469
0
0
null
null
null
null
UTF-8
C++
false
false
112
hpp
#ifndef __PRECISION__ #define __PRECISION__ #define __Romberg_Integrator_EPS__ 1E-10 #endif //__PRECISION__
[ "yhxu@nao.cas.cn" ]
yhxu@nao.cas.cn
6872502518d3eed8533e2482a6d1f280484d14e9
35bd87c9c6cacda05252f93b4e30400aa59a0e2f
/export/release/windows/obj/include/flixel/input/gamepad/id/OUYAID.h
a48eaca3237c539a8929cffa3f16c7e7fe6fd2c1
[ "Apache-2.0" ]
permissive
RE4L-CODE/vsZero-KE
53599f2099a17a9553adb25a7c8771db0a6bc6d4
44c126687ecd3caf7cc3af892164be8d520ae97a
refs/heads/main
2023-09-01T09:58:39.012592
2021-11-18T10:24:21
2021-11-18T10:24:21
429,388,364
0
0
null
null
null
null
UTF-8
C++
false
true
2,179
h
// Generated by Haxe 4.1.5 #ifndef INCLUDED_flixel_input_gamepad_id_OUYAID #define INCLUDED_flixel_input_gamepad_id_OUYAID #ifndef HXCPP_H #include <hxcpp.h> #endif HX_DECLARE_CLASS3(flixel,input,gamepad,FlxGamepadAnalogStick) HX_DECLARE_CLASS4(flixel,input,gamepad,id,OUYAID) namespace flixel{ namespace input{ namespace gamepad{ namespace id{ class HXCPP_CLASS_ATTRIBUTES OUYAID_obj : public ::hx::Object { public: typedef ::hx::Object super; typedef OUYAID_obj OBJ_; OUYAID_obj(); public: enum { _hx_ClassId = 0x2476577b }; void __construct(); inline void *operator new(size_t inSize, bool inContainer=false,const char *inName="flixel.input.gamepad.id.OUYAID") { return ::hx::Object::operator new(inSize,inContainer,inName); } inline void *operator new(size_t inSize, int extra) { return ::hx::Object::operator new(inSize+extra,false,"flixel.input.gamepad.id.OUYAID"); } inline static ::hx::ObjectPtr< OUYAID_obj > __new() { ::hx::ObjectPtr< OUYAID_obj > __this = new OUYAID_obj(); __this->__construct(); return __this; } inline static ::hx::ObjectPtr< OUYAID_obj > __alloc(::hx::Ctx *_hx_ctx) { OUYAID_obj *__this = (OUYAID_obj*)(::hx::Ctx::alloc(_hx_ctx, sizeof(OUYAID_obj), false, "flixel.input.gamepad.id.OUYAID")); *(void **)__this = OUYAID_obj::_hx_vtable; return __this; } static void * _hx_vtable; static Dynamic __CreateEmpty(); static Dynamic __Create(::hx::DynamicArray inArgs); //~OUYAID_obj(); HX_DO_RTTI_ALL; static bool __GetStatic(const ::String &inString, Dynamic &outValue, ::hx::PropertyAccess inCallProp); static bool __SetStatic(const ::String &inString, Dynamic &ioValue, ::hx::PropertyAccess inCallProp); static void __register(); bool _hx_isInstanceOf(int inClassId); ::String __ToString() const { return HX_("OUYAID",c9,5f,46,c2); } static void __boot(); static ::flixel::input::gamepad::FlxGamepadAnalogStick LEFT_ANALOG_STICK; static ::flixel::input::gamepad::FlxGamepadAnalogStick RIGHT_ANALOG_STICK; }; } // end namespace flixel } // end namespace input } // end namespace gamepad } // end namespace id #endif /* INCLUDED_flixel_input_gamepad_id_OUYAID */
[ "61307317+RE4L-CODE@users.noreply.github.com" ]
61307317+RE4L-CODE@users.noreply.github.com
79531648b30551ad03cf43dcde4e6c5a619ed007
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/curl/gumtree/curl_repos_function_674.cpp
85d0825703c130571bc07592ccbe798084f7585f
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
96
cpp
static void MD5_Final(unsigned char digest[16], MD5_CTX *ctx) { md5_digest(ctx, 16, digest); }
[ "993273596@qq.com" ]
993273596@qq.com
5d042042699299812e28b08ede1afcb1c7b8f3ac
c5e26167d000f9d52db0a1491c7995d0714f8714
/洛谷/P2613 【模板】有理数取余.cpp
caf20ac042fa13a2a0984e9b0b709fafc86ce8ac
[]
no_license
memset0/OI-Code
48d0970685a62912409d75e1183080ec0c243e21
237e66d21520651a87764c385345e250f73b245c
refs/heads/master
2020-03-24T21:23:04.692539
2019-01-05T12:38:28
2019-01-05T12:38:28
143,029,281
18
1
null
null
null
null
UTF-8
C++
false
false
642
cpp
// ============================== // author: memset0 // website: https://memset0.cn // ============================== #include <bits/stdc++.h> #define ll long long using namespace std; const int Mod = 19260817; ll a, b; ll read() { ll x = 0; char c = getchar(); while (!isdigit(c)) c = getchar(); while (isdigit(c)) x = (x * 10 + c - '0') % Mod, c = getchar(); return x; } ll inv(ll x) { if (x == 0 || x == 1) return 1; return (Mod - Mod / x) * inv(Mod % x) % Mod; } int main() { a = read(), b = read(); if (!b) printf("Angry!\n"); else printf("%lld\n", a * inv(b) % Mod); return 0; }
[ "memset0@outlook.com" ]
memset0@outlook.com