blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36b33f8dff13f613104e7b30a573cd9a0ea5cb83 | bb82a5f977bef455714c16e24e2d8254e2d0faa5 | /src/vendor/cget/include/asio/detail/impl/winrt_timer_scheduler.hpp | 8bffd19d5c54e76bbcb142ec87680848663d46c8 | [
"Unlicense"
] | permissive | pqrs-org/Karabiner-Elements | 4ae307d82f8b67547c161c7d46d2083a0fd07630 | d05057d7c769e2ff35638282e888a6d5eca566be | refs/heads/main | 2023-09-01T03:11:08.474417 | 2023-09-01T00:44:19 | 2023-09-01T00:44:19 | 63,037,806 | 8,197 | 389 | Unlicense | 2023-09-01T00:11:00 | 2016-07-11T04:57:55 | C++ | UTF-8 | C++ | false | false | 99 | hpp | ../../../../cget/pkg/chriskohlhoff__asio/install/include/asio/detail/impl/winrt_timer_scheduler.hpp | [
"tekezo@pqrs.org"
] | tekezo@pqrs.org |
d5cb71e7fb13aa3fefb39aeb01e6b26529575d56 | 9a11e05dbe957e02394ae82aaec69983be09aad9 | /DawnBreakers/Source/DawnBreakers/GameLogic/Item/ItemInteractInterface.h | f2e08a0dda66fccd0a4ab7b67f8bad9714b0bc4a | [
"MIT"
] | permissive | 954818696/FPSGame | 2925c5df044fcabda3a824e858854ff1a6e51e45 | fec54cd274848a9c23db2e0722aff6273b397149 | refs/heads/master | 2023-04-09T09:38:58.034471 | 2023-03-29T06:41:31 | 2023-03-29T06:41:31 | 52,651,826 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 312 | h |
#pragma once
#include "ItemInteractInterface.generated.h"
UINTERFACE()
class UItemInteractInterface : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class IItemInteractInterface
{ GENERATED_IINTERFACE_BODY()
public:
virtual void SetInteractFocus() = 0;
virtual void LoseInteractFocus() = 0;
}; | [
"954818696@qq.com"
] | 954818696@qq.com |
e611b3b987ede2f4be3817ae2d087dfd135b9a69 | 66deb611781cae17567efc4fd3717426d7df5e85 | /pcmanager/src/publish/winmod/winmodinethttpconnection.cpp | 06b29ffa7890aed0ed1afbba23de942fc5833920 | [
"Apache-2.0"
] | permissive | heguoxing98/knoss-pcmanager | 4671548e14b8b080f2d3a9f678327b06bf9660c9 | 283ca2e3b671caa85590b0f80da2440a3fab7205 | refs/heads/master | 2023-03-19T02:11:01.833194 | 2020-01-03T01:45:24 | 2020-01-03T01:45:24 | 504,422,245 | 1 | 0 | null | 2022-06-17T06:40:03 | 2022-06-17T06:40:02 | null | GB18030 | C++ | false | false | 6,859 | cpp | /**
* @file winmodinethttpconnection.cpp
* @brief ...
* @author zhangrui
* @date 2009-08-07 15:14
*/
#include "stdafx.h"
#include "winmodinethttpconnection.h"
#include "winmodinet.h"
using namespace WinMod;
HRESULT CInetHttpConnection::HttpRequest(
/* [in ] */ LPCTSTR lpObject,
/* [in ] */ DWORD dwTimeout,
/* [in ] */ LPCTSTR lpszContentType,
/* [in ] */ const CStringA& strCommand,
/* [out] */ CStringA* pstrResponse,
/* [out] */ DWORD* pdwStatusCode,
/* [in ] */ LPCTSTR lpszSpecHostName)
{
if (!m_h)
return E_HANDLE;
if (!lpObject || !lpszContentType)
return E_POINTER;
SetConnectTimeOut(dwTimeout);
SetSendTimeOut(dwTimeout);
SetReceiveTimeOut(dwTimeout);
m_hHttpFile.Close();
m_hHttpFile.Attach(OpenRequest(L"POST", lpObject));
if (!m_hHttpFile)
return GetLastError() ? AtlHresultFromLastError() : E_FAIL;
HRESULT hr = E_FAIL;
if (lpszSpecHostName)
{
CString strHost;
strHost.Format(L"Host: %s", lpszSpecHostName);
hr = m_hHttpFile.AddRequestHeaders(strHost, strHost.GetLength(), HTTP_ADDREQ_FLAG_REPLACE);
}
CString strContentLength;
strContentLength.Format(L"Content-Length: %d", strCommand.GetLength());
CString strContentType = L"Content-Type: ";
strContentType.Append(lpszContentType);
CString strAccept = L"Accept: */*";
hr = m_hHttpFile.AddRequestHeaders(strContentLength, strContentLength.GetLength());
hr = m_hHttpFile.AddRequestHeaders(strContentType, strContentType.GetLength());
hr = m_hHttpFile.AddRequestHeaders(strAccept, strAccept.GetLength());
INTERNET_BUFFERS inetBuf;
::ZeroMemory(&inetBuf, sizeof(inetBuf));
hr = m_hHttpFile.SendRequest(NULL, 0, (LPVOID)(LPCSTR)strCommand, (DWORD)strCommand.GetLength());
if (FAILED(hr))
return hr;
DWORD dwStatusCode = HTTP_STATUS_SERVER_ERROR;
hr = m_hHttpFile.QueryInfoStatusCode(dwStatusCode);
if (FAILED(hr))
return hr;
if (pdwStatusCode)
*pdwStatusCode = dwStatusCode;
if (HTTP_STATUS_OK != dwStatusCode)
return E_FAIL;
// 如果不需要返回response,则直接返回
if (!pstrResponse)
return S_OK;
DWORD dwContentLength = 400;
hr = m_hHttpFile.QueryInfoContentLength(dwContentLength);
if (FAILED(hr))
return hr;
// 简单的长度限制
if (dwContentLength > 0x100000)
return E_FAIL;
DWORD dwBytesRead = 0;
hr = m_hHttpFile.Read(pstrResponse->GetBuffer(dwContentLength), dwContentLength, dwBytesRead);
pstrResponse->ReleaseBuffer(dwBytesRead);
if (FAILED(hr))
return hr;
return S_OK;
}
HRESULT CInetHttpConnection::HttpDownload(
/* [in ] */ IInetHttpDownloadFile* piDownloadFile,
/* [in ] */ IInetHttpDownloadProgress* piCallback,
/* [in ] */ LPCTSTR lpObject,
/* [in ] */ DWORD dwTimeout,
/* [out] */ DWORD* pdwStatusCode,
/* [in ] */ LPCTSTR lpszSpecHostName)
{
if (!m_h)
return E_HANDLE;
if (!lpObject || !piDownloadFile)
return E_POINTER;
if (pdwStatusCode)
*pdwStatusCode = 0;
SetConnectTimeOut(dwTimeout);
SetSendTimeOut(dwTimeout);
SetReceiveTimeOut(dwTimeout);
m_hHttpFile.Close();
m_hHttpFile.Attach(OpenRequest(L"GET", lpObject));
if (!m_hHttpFile)
return GetLastError() ? AtlHresultFromLastError() : E_FAIL;
HRESULT hr = E_FAIL;
if (lpszSpecHostName)
{
CString strHost;
strHost.Format(L"Host: %s", lpszSpecHostName);
hr = m_hHttpFile.AddRequestHeaders(strHost, strHost.GetLength(), HTTP_ADDREQ_FLAG_REPLACE);
}
if (m_bUseGZip)
{
CString strEncoding = L"Accept-Encoding: gzip,deflate";
m_hHttpFile.AddRequestHeaders(strEncoding, strEncoding.GetLength(), HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE);
}
INTERNET_BUFFERS inetBuf;
::ZeroMemory(&inetBuf, sizeof(inetBuf));
hr = m_hHttpFile.SendRequest();
if (FAILED(hr))
return hr;
// 查询http状态码
DWORD dwHttpStatusCode = 0;
hr = m_hHttpFile.QueryInfoStatusCode(dwHttpStatusCode);
if (FAILED(hr))
return hr;
if (pdwStatusCode)
*pdwStatusCode = dwHttpStatusCode;
// 检查http状态码
if (HTTP_STATUS_OK != dwHttpStatusCode)
return MAKE_WINMOD_HTTP_ERROR(dwHttpStatusCode);
// 查询内容长度
DWORD dwContentLength = 0;
hr = m_hHttpFile.QueryInfoContentLength(dwContentLength);
if (FAILED(hr))
return hr;
hr = piDownloadFile->SetSize(dwContentLength);
if (FAILED(hr))
return hr;
// 开始下载数据
DWORD dwTotalSize = dwContentLength;
DWORD dwTransferedSize = 0;
hr = piDownloadFile->Seek(0, FILE_BEGIN);
if (FAILED(hr))
return hr;
while (dwTransferedSize < dwTotalSize)
{
BYTE byBuffer[4096];
DWORD dwBytesRead = 0;
DWORD dwBytesLeft = dwTotalSize - dwTransferedSize;
DWORD dwToRead = min(sizeof(byBuffer), dwBytesLeft);
hr = m_hHttpFile.Read(byBuffer, dwToRead, dwBytesRead);
if (FAILED(hr))
return hr;
if (0 == dwBytesRead)
break;
// 回调进度
if (piCallback)
{
hr = piCallback->OnReceiveData(
dwTotalSize,
dwTotalSize - dwBytesLeft,
dwBytesRead,
byBuffer);
if (FAILED(hr))
return hr;
}
hr = piDownloadFile->Write(byBuffer, dwBytesRead);
if (FAILED(hr))
return hr;
dwTransferedSize += dwBytesRead;
}
// 结束文件的传输
hr = piDownloadFile->Flush();
if (FAILED(hr))
return hr;
hr = piDownloadFile->SetEndOfFile();
if (FAILED(hr))
return hr;
if (!m_bUseGZip)
return S_OK;
DWORD dwLen = MAX_PATH;
CString strEncoding;
BOOL br = ::HttpQueryInfo(m_hHttpFile.m_h, HTTP_QUERY_CONTENT_ENCODING, strEncoding.GetBuffer(MAX_PATH + 10), &dwLen, NULL);
if (!br)
{
strEncoding.ReleaseBuffer(0);
return S_FALSE;
}
strEncoding.ReleaseBuffer();
if (0 != strEncoding.CompareNoCase(L"gzip"))
return S_FALSE;
return S_OK;
}
void CInetHttpConnection::SetUseGZip(BOOL bUseGZip)
{
m_bUseGZip = bUseGZip;
} | [
"dreamsxin@qq.com"
] | dreamsxin@qq.com |
213f37a31bcb5578231c9dd2bb1489439f3d9441 | 32411cce4a91a3a4b693b963af77fcb83b3c0764 | /src/gruppe3/include/move_para.h | 2080b599ac68a69a8c597aa16a5ef96c97a7c363 | [] | no_license | IchBinZeyuan/Robotic_CPP | 2d1279898ab7e348a3d2dca7bd08626f56c9c562 | 099592490b583c39cece3b7c7abd1a85e3b74063 | refs/heads/master | 2020-05-02T07:04:19.241923 | 2019-03-26T19:44:58 | 2019-03-26T19:44:58 | 177,808,938 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 239 | h | #ifndef MOVE_PARA_H
#define MOVE_PARA_H
#include <cmath>
#include <math.h>
#include <iostream>
struct move{
double angle;
double distance;
};
move move_para(double init_angle, double x1, double y1, double x2, double y2);
#endif
| [
"zeyuan.zhang@tum.de"
] | zeyuan.zhang@tum.de |
6ae4c605e25e0cfd87fbde2d4980a3604725512f | e2081c2c2ac4d0c2b48abde3b58f1f177f5f7379 | /Sem 4/DAA/Longest Palindrome Subsequence/assignment 6 lps top-bottom.cpp | 816f1162af591389b53fe0669a2bec9062307f38 | [] | no_license | Himified/College-Material-And-Assignments | 6af9826e4d49e759e89c6c8bd68f621eb8b3602f | 763627d77ba9b10daa241d454b7e238d9f50c68f | refs/heads/main | 2023-04-21T17:39:11.618679 | 2021-05-09T13:35:41 | 2021-05-09T13:35:41 | 365,735,167 | 1 | 0 | null | 2021-05-09T11:22:53 | 2021-05-09T11:22:52 | null | UTF-8 | C++ | false | false | 1,869 | cpp | #include<bits/stdc++.h>
using namespace std;
#define N 1000
int dp[N][N];
string lps(string str1, string str2, int low, int high) {
if (low == 0 || high == 0) //empty string & base case
{
return string("");
} else if (str1[low - 1] == str2[high-1]) //end and start position are equal
{
return lps(str1, str2, low - 1, high - 1) + str1[low-1]; //find for elements except start and end
}
else if (dp[low - 1][high] > dp[low][high-1])
{
return lps(str1, str2, low - 1, high);
}
return lps(str1, str2, low, high - 1);
}
int lcs(string str1, string str2, int low, int high) {
if (low == 0 || high == 0)
{
dp[low][high] = 0;
return dp[low][high];
}
if (dp[low][high] != -1)
{
return dp[low][high];
}
if (str1[low - 1] == str2[high-1])
{
dp[low][high] = lcs(str1, str2, low - 1, high - 1) + 1;
return dp[low][high];
} else {
dp[low][high] = max(lcs(str1, str2, low - 1, high), lcs(str1, str2, low, high-1));
return dp[low][high];
}
}
int main() {
string str,revs;
cout << "Enter the string(top-bottom DP): ";
cin>>str;
for (int i = 0; i <= str.length(); i++) {
for (int j = 0; j <= str.length(); j++) {
dp[i][j] = -1;
}
}
revs=str;
reverse(revs.begin(), revs.end());
int len=lcs(str, revs, str.length(), str.length());
cout << "The longest palindromic subsequence(top-down DP)is : "<< lps(str,revs, str.length(), str.length())<<endl<<"The length of the longest palindromic subsequence(top-down DP)is : "<< len;
return 0;
}
| [
"62885857+sakshijain009@users.noreply.github.com"
] | 62885857+sakshijain009@users.noreply.github.com |
c5e713fb26587aaab90674fa8586542ead877506 | adf0d05109fad41c6b6ef69d849e62c04bee8314 | /gui/Source/Utilities/MDLHelper.h | 4d85a0d29020ae280bc1b829251884796236a237 | [] | no_license | ptrv/SaM-Designer | 84b4fdfec16a1d44828f6601a237e40417778099 | b5d7593bfae96ae205b5cedf92f03ee01e7efb86 | refs/heads/master | 2021-01-17T09:28:44.723237 | 2016-04-10T07:10:11 | 2016-04-10T07:10:11 | 3,993,485 | 20 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 1,998 | h | /*
==============================================================================
MDLFileHelper.h
Created: 2 Feb 2014 9:21:22pm
Author: Peter Vasil
==============================================================================
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
*/
#ifndef MDLHELPER_H_INCLUDED
#define MDLHELPER_H_INCLUDED
#include "JuceHeader.h"
namespace synthamodeler
{
class MDLFile;
class ContentComp;
class MDLHelper
{
public:
static const String getMDLInfoString(const MDLFile& mdlFile);
static ValueTree getObjectWithName(const MDLFile& mdlFile,
const String& objName);
static bool addOutputDSPVarIfNotExists(const MDLFile& mdlFile);
static void saveMDLFileAsImage(const MDLFile& mdlFile,
const ContentComp * const contentComp);
static bool saveMDLFileAsXml(const MDLFile& mdlFile);
static const StringArray getParamsFromString(const String& params);
static const StringArray tokenize(const String& stringToTokenize, const char delimiter);
static String removeSurroundingParentheses(const String& s, bool recursive = true);
static String removeUnbalancedParentheses(const String& s);
};
}
#endif // MDLHELPER_H_INCLUDED
| [
"mail@petervasil.net"
] | mail@petervasil.net |
c35b3c19fe681bee52663840e0a4dcdaba68542b | d732c881b57ef5e3c8f8d105b2f2e09b86bcc3fe | /include/gurax/Random.h | 6362682cb3f47fc3b155ff575f1db179ff622c8e | [] | no_license | gura-lang/gurax | 9180861394848fd0be1f8e60322b65a92c4c604d | d9fedbc6e10f38af62c53c1bb8a4734118d14ce4 | refs/heads/master | 2023-09-01T09:15:36.548730 | 2023-09-01T08:49:33 | 2023-09-01T08:49:33 | 160,017,455 | 10 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,099 | h | //==============================================================================
// Random.h
//==============================================================================
#ifndef GURAX_RANDOM_H
#define GURAX_RANDOM_H
#include "Referable.h"
namespace Gurax {
//------------------------------------------------------------------------------
// Random
//------------------------------------------------------------------------------
class GURAX_DLLDECLARE Random : public Referable {
public:
// Referable declaration
Gurax_DeclareReferable(Random);
private:
UInt32 _seed;
std::mt19937 _engine;
private:
static RefPtr<Random> _pRandomGlobal;
public:
// Constructor
explicit Random(UInt32 seed) : _seed(seed), _engine(seed) {}
// Copy constructor/operator
Random(const Random& src) = delete;
Random& operator=(const Random& src) = delete;
// Move constructor/operator
Random(Random&& src) = delete;
Random& operator=(Random&& src) noexcept = delete;
protected:
// Destructor
virtual ~Random() = default;
public:
static void Bootup(UInt32 seed);
static void Bootup();
static Random& Global() { return *_pRandomGlobal; }
std::mt19937& GetEngine() { return _engine; }
void Reset() { _engine.seed(_seed); }
void SetSeed(UInt32 seed) { _seed = seed; _engine.seed(_seed); }
UInt32 GetSeed() const { return _seed; }
Bool GenBool() { return !!GenInt<int>(2); }
template<typename T = Double> T GenFloat() { return std::uniform_real_distribution<T>()(_engine); }
template<typename T = Int> T GenInt(T range) { return static_cast<T>(GenFloat<Double>() * range); }
template<typename T = Double> T GenNormal(T mean = 0., T stddev = 1.) {
return std::normal_distribution<T>(mean, stddev)(_engine);
}
public:
size_t CalcHash() const { return reinterpret_cast<size_t>(this); }
bool IsIdentical(const Random& random) const { return this == &random; }
bool IsEqualTo(const Random& random) const { return IsIdentical(random); }
bool IsLessThan(const Random& random) const { return this < &random; }
String ToString(const StringStyle& ss = StringStyle::Empty) const;
};
}
#endif
| [
"ypsitau@nifty.com"
] | ypsitau@nifty.com |
e63fe69209b3ce68233913a9d0d5c1254d6b8357 | 0f7a4119185aff6f48907e8a5b2666d91a47c56b | /sstd_utility/windows_boost/boost/fusion/include/size.hpp | 89ba32b8bdbb6c39d1a64bc58713260fc2ca4720 | [
"BSL-1.0"
] | permissive | jixhua/QQmlQuickBook | 6636c77e9553a86f09cd59a2e89a83eaa9f153b6 | 782799ec3426291be0b0a2e37dc3e209006f0415 | refs/heads/master | 2021-09-28T13:02:48.880908 | 2018-11-17T10:43:47 | 2018-11-17T10:43:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 529 | hpp | /*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
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)
==============================================================================*/
#if !defined(FUSION_INCLUDE_SIZE)
#define FUSION_INCLUDE_SIZE
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#endif
| [
"nanguazhude@vip.qq.com"
] | nanguazhude@vip.qq.com |
fe26a9051ca009b6e66952b19f1cc934301b9583 | 978ac8256b52036840114eff05c44f1a484fdb8e | /plugins/Power/powerpopupwidget.cpp | 523fb50a36b73ef58a4c688ee16470bdcc291f76 | [] | no_license | felixonmars/deepin-topbar | 68384fb5f2725a51a5fe151e9cfea0d1943812ff | 9c7aa506a62358980a6d37c930243687e6c777ed | refs/heads/master | 2020-12-03T02:10:43.705684 | 2017-06-30T09:26:49 | 2017-06-30T09:26:49 | 95,912,991 | 0 | 0 | null | 2017-06-30T18:13:11 | 2017-06-30T18:13:11 | null | UTF-8 | C++ | false | false | 7,986 | cpp | #include "powerpopupwidget.h"
#include "../widgets/switchitem.h"
#include <QPushButton>
#include <QPropertyAnimation>
#include <QDebug>
#include <QSize>
#include <QScrollArea>
#include <QRadioButton>
#include <QFile>
#include <QProcess>
using namespace topbar::widgets;
namespace Plugins {
namespace Power {
PowerPopupWidget::PowerPopupWidget(QWidget *parent) : QWidget(parent) {
m_mainLayout = new QVBoxLayout;
m_mainLayout->setMargin(0);
m_mainLayout->setSpacing(7);
setLayout(m_mainLayout);
QVBoxLayout *baseLayout = new QVBoxLayout;
QWidget *base = new QWidget;
base->setLayout(baseLayout);
base->setFixedHeight(120);
resize(300, base->height() + 30);
QFile file("/usr/bin/cpupower");
if (file.exists())
baseLayout->addWidget(createPowerStateGrp());
m_mainLayout->addWidget(base);
SwitchItem *awakenDisplay = new SwitchItem;
awakenDisplay->setCheck(false);
awakenDisplay->setText(tr("Password required to wake up the monitor"));
SwitchItem *awakenComputer = new SwitchItem;
awakenComputer->setCheck(false);
awakenComputer->setText(tr("Password required to wake up the computer"));
SwitchItem *powerPercent = new SwitchItem;
powerPercent->setText(tr("Enable Percent"));
QWidget *widget = new QWidget;
widget->setFixedWidth(300);
QVBoxLayout *vlayout = new QVBoxLayout;
widget->setLayout(vlayout);
vlayout->setContentsMargins(0, 5, 0, 5);
vlayout->addWidget(awakenDisplay, 0, Qt::AlignTop);
vlayout->addWidget(awakenComputer, 0, Qt::AlignTop);
vlayout->addWidget(powerPercent, 0, Qt::AlignTop);
QScrollArea *scrollarea = new QScrollArea;
scrollarea->setWidget(widget);
scrollarea->setFixedWidth(300);
scrollarea->setFixedHeight(widget->height());
scrollarea->setObjectName("scrollarea");
scrollarea->setWidgetResizable(true);
scrollarea->setFocusPolicy(Qt::NoFocus);
scrollarea->setFrameStyle(QFrame::NoFrame);
scrollarea->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
scrollarea->setContentsMargins(0, 0, 0, 0);
scrollarea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollarea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollarea->setStyleSheet("background-color: transparent;");
widget->hide();
m_mainLayout->addWidget(scrollarea, 0, Qt::AlignTop);
QPushButton *button = new QPushButton(this);
button->setText(tr("Advanced settings"));
m_mainLayout->addWidget(button, 0, Qt::AlignBottom);
connect(awakenDisplay, &SwitchItem::clicked, this, &PowerPopupWidget::onAwakenDisplayChanged);
connect(awakenComputer, &SwitchItem::clicked, this, &PowerPopupWidget::onAwakenComputerChanged);
connect(powerPercent, &SwitchItem::clicked, this, &PowerPopupWidget::requestPowerPrecent);
QPropertyAnimation *showAdvancedSetting =new QPropertyAnimation(this, "size", this);
showAdvancedSetting->setDuration(300);
showAdvancedSetting->setStartValue(QSize(width(), base->height() + 30));
showAdvancedSetting->setEndValue(QSize(width(), base->height() + 30 + widget->height()));
showAdvancedSetting->setEasingCurve(QEasingCurve::InOutCubic);
connect(showAdvancedSetting, &QPropertyAnimation::valueChanged, this, [=] (const QVariant &value) {
scrollarea->resize(300, value.toRect().height() - base->height() + 30);
});
connect(showAdvancedSetting, &QPropertyAnimation::finished, this, [=] {
widget->show();
scrollarea->show();
});
QPropertyAnimation *hideAdvancedSetting =new QPropertyAnimation(this, "size", this);
hideAdvancedSetting->setDuration(300);
hideAdvancedSetting->setStartValue(QSize(width(), base->height() + 30 + widget->height()));
hideAdvancedSetting->setEndValue(QSize(width(), base->height() + 30));
hideAdvancedSetting->setEasingCurve(QEasingCurve::InOutCubic);
connect(hideAdvancedSetting, &QPropertyAnimation::valueChanged, this, [=] (const QVariant &value) {
scrollarea->resize(300, value.toRect().height() - base->height() + 30);
});
connect(button, &QPushButton::clicked, this, [=] {
if (height() != base->height() + 30) {
scrollarea->hide();
hideAdvancedSetting->start();
} else {
showAdvancedSetting->start();
}
});
m_showAni = new QPropertyAnimation(this, "size", this);
m_showAni->setDuration(300);
m_showAni->setStartValue(QSize(width(), 30));
m_showAni->setEndValue(size());
m_showAni->setEasingCurve(QEasingCurve::InOutCubic);
m_hideAni = new QPropertyAnimation(this, "size", this);
m_hideAni->setDuration(300);
m_hideAni->setStartValue(size());
m_hideAni->setEndValue(QSize(width(), 30));
m_hideAni->setEasingCurve(QEasingCurve::InOutCubic);
connect(m_hideAni, &QPropertyAnimation::finished, this, &PowerPopupWidget::requestHidePopup);
m_effect = new QGraphicsOpacityEffect;
setGraphicsEffect(m_effect);
m_effectShowAni = new QPropertyAnimation(m_effect, "opacity", this);
m_effectHideAni = new QPropertyAnimation(m_effect, "opacity", this);
m_effectShowAni->setDuration(250);
m_effectShowAni->setStartValue(0.0);
m_effectShowAni->setEndValue(1.0);
m_effectShowAni->setEasingCurve(QEasingCurve::InBack);
m_effectHideAni->setDuration(250);
m_effectHideAni->setStartValue(1.0);
m_effectHideAni->setEndValue(0.0);
m_effectHideAni->setEasingCurve(QEasingCurve::OutBack);
}
void PowerPopupWidget::showAni()
{
show();
m_showAni->start();
m_effectShowAni->start();
}
void PowerPopupWidget::hideAni()
{
m_hideAni->start();
m_effectHideAni->start();
}
void PowerPopupWidget::onAwakenDisplayChanged(const bool state) {
}
void PowerPopupWidget::onAwakenComputerChanged(const bool state) {
}
QGroupBox *PowerPopupWidget::createPowerStateGrp()
{
QGroupBox * groupBox = new QGroupBox(tr("Switching system power"));
QRadioButton *radio1 = new QRadioButton(tr("High performance"));
QRadioButton *radio2 = new QRadioButton(tr("Balance"));
QRadioButton *radio3 = new QRadioButton(tr("Power saving"));
QProcess *process = new QProcess(this);
connect(radio1, &QRadioButton::clicked, this, [=]{
process->start("pkexec cpupower frequency-set -g performance");
});
connect(radio2, &QRadioButton::clicked, this, [=]{
process->start("pkexec cpupower frequency-set -g ondemand");
});
connect(radio3, &QRadioButton::clicked, this, [=]{
process->start("pkexec cpupower frequency-set -g powersave");
});
radio2->setChecked(true);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(radio2);
layout->addWidget(radio3);
layout->addWidget(radio1);
groupBox->setLayout(layout);
return groupBox;
}
}
}
| [
"kirigaya@mkacg.com"
] | kirigaya@mkacg.com |
54399816af29daaaf8a3badab4d11822791d8934 | ad85d7f9f6e203ab12da9a64b34cb4f19187a202 | /CodeVita/constellation.cpp | 45a4a37e980ecd4659506a70ae6a910ad40c9303 | [] | no_license | dheeraj-2000/dsalgo | daeb1219c1f902d9a28f0993b191527d7a257c93 | 2b71317fb372ceefdaaa4310217872abc48c5007 | refs/heads/master | 2022-11-08T09:42:24.106938 | 2022-10-31T14:23:03 | 2022-10-31T14:23:03 | 212,872,334 | 94 | 435 | null | 2022-12-03T11:18:05 | 2019-10-04T17:49:40 | C++ | UTF-8 | C++ | false | false | 2,909 | cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
// int num,y1;
// cin>>num;
// char constlltn[3][num];
char constlltn[3][18] = {{'*' , '.' , '*' , '#' , '*' , '*' , '*' , '#' , '*' , '*' , '*' , '#' , '*' , '*' , '*' , '.' , '*' , '.' },
{'*' , '.' , '*' , '#' , '*' , '.' , '*' , '#' , '.' , '*' , '.' , '#' , '*' , '*' , '*' , '*' , '*' , '*' },
{'*' , '*' , '*' , '#' , '*' , '*' , '*' , '#' , '*' , '*' , '*' , '#' , '*' , '*' , '*' , '*' , '.' , '*' }};
// for(int i=0; i<3; i++){
// for(int j=0; j<num; j++) {
// cin>>constlltn[i][j];
// }
// }
for(int i=0;i<18;i++) {
if(constlltn[0][i]=='#' && constlltn[1][i]=='#' && constlltn[2][i]=='#')
cout<<'#';
else if(constlltn[0][i]=='.' && constlltn[1][i]=='.' && constlltn[2][i]=='.'){
}
else{
char first_row1, first_row2, first_row3, second_row1, second_row2, second_row3, third_row1, third_row2, third_row3;
int temp = i;
first_row1 = constlltn[0][temp];
first_row2 = constlltn[0][temp+1];
first_row3 = constlltn[0][temp+2];
second_row1 = constlltn[1][temp];
second_row2 = constlltn[1][temp+1];
second_row3 = constlltn[1][temp+2];
third_row1 = constlltn[2][temp];
third_row2 = constlltn[2][temp+1];
third_row3 = constlltn[2][temp+2];
if(first_row1=='.' && first_row2=='*' && first_row3=='.' && second_row1=='*' && second_row2=='*' && second_row3=='*' && third_row1=='*' && third_row2=='.' && third_row3=='*'){
cout<<"A";
i = i + 2;
}
if(first_row1=='*' && first_row2=='*' && first_row3=='*' && second_row1=='*' && second_row2=='*' && second_row3=='*' && third_row1=='*' && third_row2=='*' && third_row3=='*'){
cout<<"E";
i = i + 2;
}
if(first_row1=='*' && first_row2=='*' && first_row3=='*' && second_row1=='.' && second_row2=='*' && second_row3=='.' && third_row1=='*' && third_row2=='*' && third_row3=='*'){
cout<<"I";
i = i + 2;
}
if(first_row1=='*' && first_row2=='*' && first_row3=='*' && second_row1=='*' && second_row2=='.' && second_row3=='*' && third_row1=='*' && third_row2=='*' && third_row3=='*'){
cout<<"O";
i = i + 2;
}
if(first_row1=='*' && first_row2=='.' && first_row3=='*' && second_row1=='*' && second_row2=='.' && second_row3=='*' && third_row1=='*' && third_row2=='*' && third_row3=='*'){ {
cout<<"U";
i = i + 2;
}
}
}}
}
//
// *, ., *, #, *, *, *, #, *, *, *, #, *, *, *, ., *, .,
// *, ., *, #, *, ., *, #, ., *, ., #, *, *, *, *, *, *,
// *, *, *, #, *, *, *, #, *, *, *, #, *, *, *, *, ., *,
| [
"dheeraj12000@gmail.com"
] | dheeraj12000@gmail.com |
e91c6d23e69cecb37cad6d83f527fd3a032d3dc2 | adf6e013abb4368ce1465ba45264fa187bdeb0b3 | /sm-miner-slave/src/i2c/i2c_reg.h | 34bcf29c622c06c9518083fcbdc0c88e186da531 | [] | no_license | huyugit/om-miner | 0f8692a9aa944d8aaf137d9ebfbd08e1979286b5 | 5cfa4aaf5a15094028d0007243d44d5e4fb42a2e | refs/heads/master | 2020-03-25T01:43:42.817961 | 2018-08-02T06:45:36 | 2018-08-02T06:45:36 | 143,253,460 | 6 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 238 | h | #ifndef I2C_REG_H
#define I2C_REG_H
#include <stdint.h>
#include "i2c_sw.h"
class I2CReg
{
public:
I2CReg(I2CSw &_i2c);
bool read(uint8_t &data);
bool write(uint8_t data);
private:
I2CSw &i2c;
};
#endif // I2C_REG_H
| [
"yu.hu@bitifly.com"
] | yu.hu@bitifly.com |
5f62e0b384e7cc5ee415cb2808e5fd91e6bc0308 | 2f10f807d3307b83293a521da600c02623cdda82 | /deps/boost/win/debug/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp | b4f8d5f679882bc6b00c286a0e877c30f9b4b1a2 | [] | no_license | xpierrohk/dpt-rp1-cpp | 2ca4e377628363c3e9d41f88c8cbccc0fc2f1a1e | 643d053983fce3e6b099e2d3c9ab8387d0ea5a75 | refs/heads/master | 2021-05-23T08:19:48.823198 | 2019-07-26T17:35:28 | 2019-07-26T17:35:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 129 | hpp | version https://git-lfs.github.com/spec/v1
oid sha256:bd41ff745c6c56beac4d467924cd61c1714978c39133184905b6e135ffcab56c
size 3177
| [
"YLiLarry@gmail.com"
] | YLiLarry@gmail.com |
a6070cae474be97f2fcbb110fb04586bce274aec | d9ec3df09a9205c258015b125f6a662c516b3a4b | /Loader/ABRecordTokenizer/signaturerecord.h | 1529f6f9bc0fb30d1bf0a619ce1320655a24bb14 | [] | no_license | RealMetamorphEDU/Coursework_Antivirus | 0712e2865294a765c3147a1fb8aa543d03efeba6 | 0989df769df52761cb7f6487e6343fdf1882518f | refs/heads/master | 2021-02-09T12:20:22.088962 | 2020-06-12T14:14:50 | 2020-06-12T14:14:50 | 244,281,551 | 2 | 5 | null | 2020-05-14T16:29:56 | 2020-03-02T04:40:50 | C++ | UTF-8 | C++ | false | false | 979 | h | #ifndef SIGNATURERECORD_H
#define SIGNATURERECORD_H
#include <QObject>
#include "ABRecordTokenizer_global.h"
const int MAX_PREFIX_LEN = 1024;
class ABRECORDTOKENIZER_EXPORT SignatureRecord final: public QObject {
Q_OBJECT
QString name;
int sigLength;
QByteArray sigPrefix;
QByteArray sigHash;
int beginOffset;
int endOffset;
public:
explicit SignatureRecord(QObject *parent = nullptr);
const QString& getName() const;
void setName(const QString &name);
int getSigLength() const;
void setSigLength(int sigLength);
const QByteArray& getSigPrefix() const;
void setSigPrefix(const QByteArray &sigPrefix);
const QByteArray& getSigHash() const;
void setSigHash(const QByteArray &sigHash);
int getBeginOffset() const;
void setBeginOffset(int beginOffset);
int getEndOffset() const;
void setEndOffset(int endOffset);
bool operator==(SignatureRecord &record) const;
};
#endif // SIGNATURERECORD_H
| [
"andr.timchuk@yandex.ru"
] | andr.timchuk@yandex.ru |
42ff69dcfb4735df84e0cbb996c33e8c2d58e9dd | d7077d22968bfe3799c6dda01b23317d6d7a7f25 | /Lez1/01.2/random.cxx | 3a1b78a145671f0d8434ab5371e87ae048ae407e | [] | no_license | mdima98/NSL_Exercises_AA19_20 | a539ed8d65a0b0ed2c893272455e2f58016008ce | 7ae08dabc9329aa18828740aff24bfbee14b2d0c | refs/heads/master | 2023-06-22T02:00:15.727731 | 2020-09-25T08:40:11 | 2020-09-25T08:40:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,633 | cxx | /****************************************************************
*****************************************************************
_/ _/ _/_/_/ _/ Numerical Simulation Laboratory
_/_/ _/ _/ _/ Physics Department
_/ _/_/ _/ _/ Universita' degli Studi di Milano
_/ _/ _/ _/ Prof. D.E. Galli
_/ _/ _/_/_/ _/_/_/_/ email: Davide.Galli@unimi.it
*****************************************************************
*****************************************************************/
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include "random.h"
using namespace std;
Random :: Random(){}
Random :: ~Random(){}
void Random :: SaveSeed(){
ofstream WriteSeed;
WriteSeed.open("seed.out");
if (WriteSeed.is_open()){
WriteSeed << l1 << " " << l2 << " " << l3 << " " << l4 << endl;;
} else cerr << "PROBLEM: Unable to open random.out" << endl;
WriteSeed.close();
return;
}
double Random :: Gauss(double mean, double sigma) {
double s=Rannyu();
double t=Rannyu();
double x=sqrt(-2.*log(1.-s))*cos(2.*M_PI*t);
return mean + x * sigma;
}
double Random :: Exp(double mean) {
return -(1./mean)*log(1.-Rannyu());
}
double Random :: Lorentz(double mu, double gamma){
return gamma*tan(Rannyu()*M_PI - 0.5*M_PI) + mu;
}
double Random :: Rannyu(double min, double max){
return min+(max-min)*Rannyu();
}
double Random :: Rannyu(void){
const double twom12=0.000244140625;
int i1,i2,i3,i4;
double r;
i1 = l1*m4 + l2*m3 + l3*m2 + l4*m1 + n1;
i2 = l2*m4 + l3*m3 + l4*m2 + n2;
i3 = l3*m4 + l4*m3 + n3;
i4 = l4*m4 + n4;
l4 = i4%4096;
i3 = i3 + i4/4096;
l3 = i3%4096;
i2 = i2 + i3/4096;
l2 = i2%4096;
l1 = (i1 + i2/4096)%4096;
r=twom12*(l1+twom12*(l2+twom12*(l3+twom12*(l4))));
return r;
}
void Random :: SetRandom(int * s, int p1, int p2){
m1 = 502;
m2 = 1521;
m3 = 4071;
m4 = 2107;
l1 = s[0]%4096;
l2 = s[1]%4096;
l3 = s[2]%4096;
l4 = s[3]%4096;
l4 = 2*(l4/2)+1;
n1 = 0;
n2 = 0;
n3 = p1;
n4 = p2;
return;
}
/****************************************************************
*****************************************************************
_/ _/ _/_/_/ _/ Numerical Simulation Laboratory
_/_/ _/ _/ _/ Physics Department
_/ _/_/ _/ _/ Universita' degli Studi di Milano
_/ _/ _/ _/ Prof. D.E. Galli
_/ _/ _/_/_/ _/_/_/_/ email: Davide.Galli@unimi.it
*****************************************************************
*****************************************************************/
| [
"you@example.com"
] | you@example.com |
af0902b5b5da758f1324d7f4af24a7104e3dbd8d | 473c3cd16cd6c85cd96703ffcc431e846006e7be | /Source/TheGame/Private/DefaultGameInstance.cpp | 64d66b45fa57672e32b45f2a578898fd68b35410 | [] | no_license | TamerXlam/Quantum | a11fc465ccd46fcdd981cfe25372e6f799d51d00 | ac9a088b7de5000374808a642d16622ecc15fbb3 | refs/heads/master | 2021-06-19T19:31:51.646312 | 2021-06-14T13:13:30 | 2021-06-14T13:13:30 | 163,433,010 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 286 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "DefaultGameInstance.h"
UDefaultGameInstance::UDefaultGameInstance(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
}
UDefaultGameInstance::~UDefaultGameInstance()
{
} | [
"tamerxlam@gmail.com"
] | tamerxlam@gmail.com |
e7a4e6aa324cb3154be45e361cfcc7e5ef68c47c | 26e0a6d1f54903c993ee5244658a9ad3389a2c11 | /PHOENIXEngine/PHOENIX/PX2Engine/UI/PX2UISplitterFrame.inl | 7a6b1fa2f0f1a3f4dea53a55f643e7d8b1894b4e | [] | no_license | ycwang812/SLAMCar | a8a3ba0ca301d67a171859909be46b7a4b846227 | af3e5a79b37f31e0ba83ea0eb6ea0d6dfc7aec77 | refs/heads/master | 2021-07-09T12:18:52.253121 | 2020-04-15T09:00:53 | 2020-04-15T09:00:53 | 240,099,985 | 0 | 1 | null | 2021-04-08T08:19:02 | 2020-02-12T19:43:23 | C++ | UTF-8 | C++ | false | false | 1,052 | inl | // PX2UISplitterFrame.inl
//----------------------------------------------------------------------------
inline bool UISplitterFrame::IsHor() const
{
return mIsHor;
}
//----------------------------------------------------------------------------
inline UISplitterFrame::DragType UISplitterFrame::GetDragType() const
{
return mDragType;
}
//----------------------------------------------------------------------------
inline const Float2 &UISplitterFrame::GetDragRange() const
{
return mDragRange;
}
//----------------------------------------------------------------------------
inline UISplitterFrame::PosType UISplitterFrame::GetPosType() const
{
return mPosType;
}
//----------------------------------------------------------------------------
inline bool UISplitterFrame::IsDragable() const
{
return mIsDragable;
}
//----------------------------------------------------------------------------
inline bool UISplitterFrame::IsDraging() const
{
return mIsDraging;
}
//---------------------------------------------------------------------------- | [
"ycwang812@gmail.com"
] | ycwang812@gmail.com |
9b40d41f18defaebae3ab0892ebcf712bab83aca | 484b4f9bdd259e6612491c475acf74ac7f75b1fc | /leetcode/523. Continuous Subarray Sum/Solution.cpp | 3333ee8e138fb4d270e7529b3c125eaa79531a21 | [] | no_license | yesdongil/SAMPLE_CODE | 222dbc412f5c14acc810c35c2b542a03f9d28ff9 | 0ef73509a5e5951e438f35956b94a34384fe2f04 | refs/heads/master | 2021-07-11T01:23:05.320567 | 2017-10-10T04:29:41 | 2017-10-10T04:29:41 | 105,595,781 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 758 | cpp | class Solution {
public:
int getMod(int i, int k) {
if(k > 0) return i % k;
else return i;
}
bool checkSubarraySum(vector<int>& nums, int k)
{
int kk = abs(k), temp = getMod(nums[0], kk);
set<int> ts;
ts.insert(temp);
int len = nums.size();
for(int i = 1; i < len; i++) {
temp += getMod(nums[i], kk);
temp = getMod(temp, kk);
if(kk == 0 && temp > 0) {
return false;
} else if (kk > 0 && temp == 0) {
return true;
} else if(ts.find(temp) == ts.end()) {
ts.insert(temp);
} else {
return true;
}
}
return false;
}
}; | [
"yesdongil@gmail.com"
] | yesdongil@gmail.com |
62388e66d8a045655077cbf90e914fab071b3740 | 2ca3ad74c1b5416b2748353d23710eed63539bb0 | /Src/DharaniDev/DharaniDev/DharaniDev.h | 8d114c6a318efe41a8c56d2e19f6a44f16716d0c | [] | no_license | sjp38/lokapala | 5ced19e534bd7067aeace0b38ee80b87dfc7faed | dfa51d28845815cfccd39941c802faaec9233a6e | refs/heads/master | 2021-01-15T16:10:23.884841 | 2009-06-03T14:56:50 | 2009-06-03T14:56:50 | 32,124,140 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 528 | h | // DharaniDev.h : main header file for the PROJECT_NAME application
//
#pragma once
#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif
#include "resource.h" // main symbols
// CDharaniDevApp:
// See DharaniDev.cpp for the implementation of this class
//
class CDharaniDevApp : public CWinApp
{
public:
CDharaniDevApp();
// Overrides
public:
virtual BOOL InitInstance();
// Implementation
DECLARE_MESSAGE_MAP()
};
extern CDharaniDevApp theApp; | [
"nilakantha38@b9e76448-5c52-0410-ae0e-a5aea8c5d16c"
] | nilakantha38@b9e76448-5c52-0410-ae0e-a5aea8c5d16c |
eae7cabf8c175b0d92c20390f542a77305dc17be | 2fae36bee07be8016fc2f598eb37a987b1128de6 | /modules/steamworks/marshal.h | acf531cf27b5545bf32f14d8e8055153750a1047 | [
"Zlib"
] | permissive | abakobo/monkey2 | 5cc540ecaef55bf4f8763ac85106ea3e4fe1a0c4 | b029fe274be34a19862f72e55f8f9dd857e6c156 | refs/heads/fullbazar | 2021-01-18T21:06:50.068706 | 2020-10-30T16:40:19 | 2020-10-30T16:40:19 | 207,162,775 | 1 | 0 | Zlib | 2020-11-10T13:05:56 | 2019-09-08T19:29:34 | Monkey | UTF-8 | C++ | false | false | 2,033 | h | #ifndef MARSHAL_H
#define MARSHAL_H
#include <bbmonkey.h>
#include <steam_api.h>
//public delegate void SteamAPI_LeaderboardFindResult_t_CallResult(LeaderboardFindResult_t pLeaderboardFindResult_t, bool bIOFailure);
enum SteamEventType{
StatsReceived,
StatsStored,
LeaderboardFound,
LeaderboardUploaded,
LeaderboardDownload,
AchievementAwarded,
AchievementStored,
PlayersCounted,
All
};
class Marshal : public bbObject
{
public:
UserStatsReceived_t userStatsReceived;
UserStatsStored_t userStatsStored;
UserAchievementStored_t userAchievementStored;
LeaderboardFindResult_t leaderboardFindResult;
LeaderboardScoreUploaded_t leaderboardScoreUploaded;
LeaderboardScoresDownloaded_t leaderboardScoresDownloaded;
NumberOfCurrentPlayers_t numberOfCurrentPlayers;
Marshal();
virtual ~Marshal();
void gcMark();
STEAM_CALLBACK( Marshal, ReceivedUserStats, UserStatsReceived_t, m_ReceivedUserStats);
STEAM_CALLBACK( Marshal, StoredUserStats, UserStatsStored_t, m_StoredUserStats);
STEAM_CALLBACK( Marshal, StoredUserAchievement, UserAchievementStored_t, m_StoredUserAchievement);
CCallResult<Marshal,UserStatsReceived_t> m_callResultStatsReceived;
void ReceivedUserStats(UserStatsReceived_t *p, bool b);
CCallResult<Marshal,LeaderboardFindResult_t> m_callResultFindLeaderboard;
void FoundLeaderboard(LeaderboardFindResult_t *p, bool b);
CCallResult<Marshal,LeaderboardScoreUploaded_t> m_callResultScoreUploaded;
void ScoreUploaded(LeaderboardScoreUploaded_t *p, bool b);
CCallResult<Marshal,LeaderboardScoresDownloaded_t> m_callResultScoresDownloaded;
void ScoresDownloaded(LeaderboardScoresDownloaded_t *p, bool b);
CCallResult<Marshal,NumberOfCurrentPlayers_t> m_callResultCountPlayers;
void CountedPlayers(NumberOfCurrentPlayers_t *p, bool b);
void SetEventHandler(SteamEventType steamEvent, int callback);
void SetCallHandler(SteamEventType steamEvent, SteamAPICall_t steamAPICall, int callback);
private:
int eventCallback[SteamEventType::All];
};
#endif // MARSHAL_H
| [
"koko@MacBook-Air-de-koko.local"
] | koko@MacBook-Air-de-koko.local |
9aef7cbb5a97cfeff57bee4322e9b06aa1740bac | 34e6696d776ccee55988c5c19f987c07626590a9 | /tute01.cpp | cfdb208d28e8f295a3e35e5b29153c0df00daeb1 | [] | no_license | YB1010/i3d | 8daff40c4e6966d508343d19821efafea52e7ef0 | 4fe1b9068a06ea72a912dbda11046e26fc7fda8b | refs/heads/master | 2020-03-07T03:26:22.213142 | 2018-05-10T05:58:59 | 2018-05-10T05:58:59 | 127,235,424 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,752 | cpp | #include <Windows.h>
#include <GL\glew.h>
#include <GL\freeglut.h>
#include <iostream>
#include <math.h>
#define M_PI 3.1415
/*void drawVector(float x, float y, float a, float b, float s, bool normalize, float r, float g, float B)
{
int n = 20;
float left = -1.0;
float right = 1.0;
float range = 0.0;
range = right - left;
float stepSize = 0.0;
stepSize = range / n;
glBegin(GL_LINES);
for (int i = 0; i <= n; i++)
{
x = i * stepSize + left;
y = 1 * sin(M_PI*x);
b = M_PI * 1 * cos(M_PI*x);
s = b * (x + 0.1 - x) + y;
glVertex2f(x, y);
glVertex2f(x + 0.1, s);
}
glEnd();
}*/
void square()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glBegin(GL_QUADS);
glColor3f(1, 0, 0);
glVertex3f(-0.5, -0.5, -0.5);
glVertex3f(0.5, -0.5, -0.5);
glVertex3f(0.5, 0.5, -0.5);
glVertex3f(-0.5, 0.5, -0.5);
glEnd();
glBegin(GL_QUADS);
glColor3f(0, 1, 0);
glVertex3f(-0.25, -0.25, -0.75);
glVertex3f(0.75, -0.25, -0.75);
glVertex3f(0.75, 0.75, -0.75);
glVertex3f(-0.25, 0.75, -0.75);
glEnd();
}
void quardic()
{
glBegin(GL_LINES);
glColor3f(1.0, 0.0, 0.0);//color red
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0);//display of x axis
glColor3f(0.0, 1.0, 0.0);//color green
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);//display of y axis
glColor3f(0.0, 0.0, 1.0);//color blue
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.0, 0.0, 1.0);//display of z axis
glEnd();
int n = 20;
float left = -1.0;
float right = 1.0;
float range = 0.0;
range = right - left;
float stepSize = 0.0;
stepSize = range / n;
float x;
glBegin(GL_LINE_STRIP);
for (int i = 0; i <= n; i++)
{
x = i * stepSize + left;
glColor3f(1.0, 1.0, 1.0);
glVertex3f(x, 2 * x*x, 0.0);//diplay curve:y=x*x
}
glEnd();
}
void sineWave()
{
float a, b, s;
float r, g, B;
bool normalize;
glBegin(GL_LINES);
glColor3f(1.0, 0.0, 0.0);//color red
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0);//display of x axis
glColor3f(0.0, 1.0, 0.0);//color green
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);//display of y axis
glColor3f(0.0, 0.0, 1.0);//color blue
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.0, 0.0, 1.0);//display of z axis
glEnd();
int n = 40;
float left = -1.0;
float right = 1.0;
float range = 0.0;
range = right - left;
float stepSize = 0.0;
stepSize = range / n;
float x, y;
glBegin(GL_LINE_STRIP);
glColor3f(1.0, 1.0, 1.0);
for (int i = 0; i <= n; i++)
{
x = i * stepSize + left;
y = 1 * sin(M_PI*x);//sineWave: y = A*sin(pie*x)
glVertex3f(x, y, 0.0);//display sineWave
}
glEnd();
glBegin(GL_LINES);
glColor3f(1.0, 0.0, 0.0);
float x1, y1;
for (int i = 0; i <= n; i++)
{
x1 = i * stepSize + left;
y1 = 1 * sin(M_PI*x1);
b = M_PI * 1 * cos(M_PI*x1);
s = b * (x1 + 0.1 - x1) + y1;
glVertex2f(x1,y1);
//glVertex2f(x1+0.1,s);
}
glEnd();
}
void display()
{
/* Put drawing code here
glBegin(GL_POINTS);
glVertex3f(0, 0, 0);
glEnd();*/
//square();
//quardic();
sineWave();
glutSwapBuffers();
}
/* You can ignore this for now, it just lets you exit when you press 'q' or ESC */
void keyboard(unsigned char key, int x, int y)
{
switch (key)
{
case 27:
case 'q':
exit(EXIT_SUCCESS);
break;
default:
break;
}
}
void init()
{
/* In this program these OpenGL calls only need to be done once,
but normally they would go elsewhere, e.g. display */
glMatrixMode(GL_PROJECTION);
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("Tutorial 1");
init();
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glutMainLoop();
return EXIT_SUCCESS;
} | [
"s3548974@student.rmit.edu.au"
] | s3548974@student.rmit.edu.au |
dc68dbb83c90c10c2f65ce9c67e83a8e6d6f8c9a | d93159d0784fc489a5066d3ee592e6c9563b228b | /CondCore/RunInfoPlugins/src/plugin.cc | a297faf69e886ca395a6fc1c71a172596062c50e | [] | permissive | simonecid/cmssw | 86396e31d41a003a179690f8c322e82e250e33b2 | 2559fdc9545b2c7e337f5113b231025106dd22ab | refs/heads/CAallInOne_81X | 2021-08-15T23:25:02.901905 | 2016-09-13T08:10:20 | 2016-09-13T08:53:42 | 176,462,898 | 0 | 1 | Apache-2.0 | 2019-03-19T08:30:28 | 2019-03-19T08:30:24 | null | UTF-8 | C++ | false | false | 800 | cc | #include "CondCore/ESSources/interface/registration_macros.h"
#include "CondFormats/DataRecord/interface/RunSummaryRcd.h"
#include "CondFormats/RunInfo/interface/RunSummary.h"
#include "CondFormats/RunInfo/interface/RunInfo.h"
#include "CondFormats/DataRecord/interface/L1TriggerScalerRcd.h"
#include "CondFormats/RunInfo/interface/L1TriggerScaler.h"
#include "CondFormats/DataRecord/interface/MixingRcd.h"
#include "CondFormats/RunInfo/interface/MixingModuleConfig.h"
#include "CondFormats/DataRecord/interface/FillInfoRcd.h"
#include "CondFormats/RunInfo/interface/FillInfo.h"
REGISTER_PLUGIN(RunSummaryRcd,RunSummary);
REGISTER_PLUGIN(RunInfoRcd,RunInfo);
REGISTER_PLUGIN(L1TriggerScalerRcd, L1TriggerScaler);
REGISTER_PLUGIN(MixingRcd,MixingModuleConfig);
REGISTER_PLUGIN(FillInfoRcd,FillInfo);
| [
"giulio.eulisse@gmail.com"
] | giulio.eulisse@gmail.com |
0566139aff6772c75992c674dc3a798a735920a7 | 99bf15119116039fd5001a0d7c7660459b6b0f30 | /utils/LoadImage3D.h | 7bd99caa03a4627bd4348915906df0dc4f71302b | [] | no_license | Kitware/spmd-miniapps | fe1dff2a0e6589b76e65f99ad50522a6f5a90518 | 100cb8cbbdef3086b77d293743654a71bdec21b5 | refs/heads/master | 2023-06-01T11:14:00.119016 | 2015-03-31T19:21:05 | 2015-03-31T19:21:05 | 29,552,774 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,748 | h | #ifndef __LoadImage3D_h
#define __LoadImage3D_h
#include "ConvertBuffer.h"
#include "Image3D.h"
#include "TypeInfo.h"
#include <algorithm>
#include <cassert>
#include <exception>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
class bad_format : public std::exception
{
public:
bad_format(const char* const message) : message(message) {}
private:
const char* const message;
};
class LineStream
{
public:
LineStream(std::istream &in);
std::istream& stream();
void readline();
private:
std::istream ∈
std::stringstream sstream;
std::string line;
};
inline LineStream::LineStream(std::istream &in)
: in(in)
{
}
inline std::istream& LineStream::stream()
{
return this->sstream;
}
inline void LineStream::readline()
{
std::getline(this->in, this->line);
this->sstream.clear();
this->sstream.str(this->line);
this->sstream.seekg(0);
}
template <typename T>
void loadImage3D(const char *vtkFileName, Image3D<T> *image)
{
std::ifstream stream;
stream.open(vtkFileName);
LineStream reader(stream);
// read and discard header
reader.readline();
reader.readline();
std::string name;
reader.stream() >> name;
reader.readline();
std::string format;
reader.stream() >> format;
if (format != "BINARY")
{
throw bad_format("Only 'BINARY' format supported");
}
std::string tag;
reader.readline();
std::string dataset;
reader.stream() >> tag >> dataset;
if (tag != "DATASET" || dataset != "STRUCTURED_POINTS")
{
throw bad_format("Expecting STRUCTURED_POINTS dataset");
}
int count = 3;
unsigned xdim, ydim, zdim;
T spacing[3];
T origin[3];
while (count)
{
reader.readline();
reader.stream() >> tag;
if (tag == "DIMENSIONS")
{
reader.stream() >> xdim >> ydim >> zdim;
if (reader.stream().bad())
{
throw bad_format("Expecting DIMENSIONS [3]");
}
--count;
}
else if (tag == "SPACING")
{
reader.stream() >> spacing[0] >> spacing[1] >> spacing[2];
if (reader.stream().bad())
{
throw bad_format("Expecting SPACING [3]");
}
--count;
}
else if (tag == "ORIGIN")
{
reader.stream() >> origin[0] >> origin[1] >> origin[2];
if (reader.stream().bad())
{
throw bad_format("Expecting ORIGIN [3]");
}
--count;
}
else
{
throw bad_format("Expecting DIMENSIONS, SPACING and ORIGIN");
}
}
reader.readline();
unsigned npoints = 0;
reader.stream() >> tag >> npoints;
if (tag != "POINT_DATA" || reader.stream().bad())
{
throw bad_format("Expecting POINT_DATA <npoints>");
}
reader.readline();
std::string scalName, typeName;
reader.stream() >> tag >> scalName >> typeName;
if (tag != "SCALARS" || reader.stream().bad())
{
throw bad_format("Expecting SCALARS <name> <type>");
}
TypeInfo ti = createTypeInfo(typeName.c_str());
if (ti.getId() == TypeInfo::ID_UNKNOWN)
{
throw bad_format("Unsupported datatype");
}
reader.readline();
reader.stream() >> tag >> name;
if (tag != "LOOKUP_TABLE" || reader.stream().bad())
{
throw bad_format("Expecting LOOKUP_TABLE name");
}
if (name != "default")
{
unsigned size;
reader.stream() >> size;
}
size_t bufsize = npoints * ti.size();
std::vector<char> rbuf(bufsize);
stream.read(&rbuf[0], bufsize);
image->setDimension(xdim, ydim, zdim);
image->setSpacing(spacing[0], spacing[1], spacing[2]);
image->setOrigin(origin[0], origin[1], origin[2]);
image->allocate();
convertBufferWithTypeInfo(&rbuf[0], ti, npoints, image->getData());
stream.close();
}
#endif
| [
"sujin.philip@kitware.com"
] | sujin.philip@kitware.com |
d687651909a415937921c417e1fa488bb5318bdb | dbdda9d29657839178d92548ec6f7386067520f4 | /Jumper_2013/DisableSwitch.ino | 25a7955bd15840de3734c8e3bed475cc364e5387 | [] | no_license | edu-bob/Arduino | 0cf45bcfce9a856c6b3960f493d8a1cce11b308e | 29ccd972243c19ea7b20b7deb55a06bba2bdf060 | refs/heads/master | 2022-11-28T18:56:33.753616 | 2022-11-27T06:24:59 | 2022-11-27T06:24:59 | 9,741,324 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 739 | ino | //
// Disable Switch
//
void DisableSwitch::setup()
{
}
void DisableSwitch::begin(int _pin)
{
pin = _pin;
pinMode(pin, INPUT_PULLUP);
value = readSwitch();
}
void DisableSwitch::loop()
{
changed = false;
// determine if the switch has changed. This is only used to update the display
int newValue;
newValue = readSwitch();
if ( value != newValue ) {
changed = true;
value = newValue;
}
}
// This could return "value, but to be safe and avoid races, just read the switch
bool DisableSwitch::isEnabled()
{
return readSwitch();
}
int DisableSwitch::readSwitch()
{
return digitalRead(pin);
}
bool DisableSwitch::isChanged()
{
bool saveChanged = changed;
// changed = false;
return saveChanged;
}
| [
"rbrown@educationcom"
] | rbrown@educationcom |
c30366fb607e48f18ff8891ffcd3b3266e017bfe | 8e59d5a83df8e8d2c7af003113588ead650aeb70 | /src/iss/arch/traits.h | cf2f4cec2c7ccdad536452248ce3c89fc1944208 | [
"BSD-3-Clause"
] | permissive | Minres/DBT-RISE-Core | 7cd8bec53cd1333dd3900d09d5e2a8d367d4ac91 | 26d2a97fd2cc78029e9fd14e86f96b58ba8c2d9b | refs/heads/master | 2023-08-07T13:58:10.530585 | 2022-10-07T14:51:02 | 2022-10-07T14:51:02 | 104,789,465 | 6 | 3 | BSD-3-Clause | 2022-06-17T09:40:11 | 2017-09-25T18:55:28 | C++ | UTF-8 | C++ | false | false | 1,975 | h | /*******************************************************************************
* Copyright (C) 2017, MINRES Technologies GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* eyck@minres.com - initial API and implementation
******************************************************************************/
#ifndef _TRAITS_H_
#define _TRAITS_H_
namespace iss {
namespace arch {
template <typename ARCH> struct traits {};
}
}
#endif /* _TRAITS_H_ */
| [
"eyck@minres.com"
] | eyck@minres.com |
41c68dcc18ddfcc857d7c9f1281a9aee48660e93 | d9f47e9df2e902b2ef8f110b566421f8196778e4 | /point.h | b82b7de10b4135f6b1f3d0043b9b461e24e3078a | [
"CC-BY-4.0",
"MIT"
] | permissive | rktanizawa/assignment-07 | 515c3538a14a2ff379898d66c87ddd9c9d98fbfd | 06a4b17a7a399a03c7feedadfe5eedd68967f113 | refs/heads/master | 2021-01-18T01:47:30.372248 | 2015-11-25T04:16:28 | 2015-11-25T04:16:28 | 46,301,163 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,311 | h | /* ----------------------------------------------------------------------------
* Copyright © 2015 Ben Blazak <bblazak@fullerton.edu>
Randy Tanizawa <rtanizawa@csu.fullerton.edu>
* Released under the [MIT License] (http://opensource.org/licenses/MIT)
* ------------------------------------------------------------------------- */
#ifndef POINT_H
#define POINT_H
#include <iostream>
#include <cmath>
#include <exception>
#include <fstream>
#include <string>
using std::ostream;
using std::istream;
template <typename P, const unsigned int SIZE>
class Point
{
private:
P nums[SIZE];
public:
Point();
double distance( const Point & p ) const;
bool operator>( const Point & p ) const;
istream &read( istream &in );
ostream &write( ostream &out) const;
class Error : public std:: exception
{
const char *err;
public:
Error(const char *e) : err(e) {}
const char *what() const noexcept
{
return err;
}
};
class Empty_Stream : public Error
{
public:
Empty_Stream( const char *es = "Empty Stream" ) : Error(es){}
};
class Invalid_Input : public Error
{
public:
Invalid_Input( const char *ii = "Invalid Input" ) : Error(ii){}
};
};
template <typename P, const unsigned int SIZE>
Point<P,SIZE>::Point() : nums{} {};
template <typename P, const unsigned int SIZE>
istream &operator>>( istream &in , Point<P, SIZE> &p );
template <typename P, const unsigned int SIZE>
ostream &operator<<( ostream &out, const Point<P, SIZE> &p);
template <typename P, const unsigned int SIZE>
istream &Point<P,SIZE>::read( istream &in )
{
P num;
char p_open;
char p_close = ')';
in >> p_open;
if( !in.good() )
{
in.clear();
throw Empty_Stream();
}
if( p_open != '(' )
throw Invalid_Input();
for(unsigned int i = 0; i < SIZE; i++)
{
in >> num;
if( !in.good() )
{
in.clear();
throw Invalid_Input("Incompatible type");
}
nums[i] = num;
}
in >> p_close;
if( !p_close )
{
in.clear();
throw Invalid_Input();
}
return in;
}
template <typename P, const unsigned int SIZE>
ostream &Point<P,SIZE>::write( ostream &out ) const
{
out << "( ";
for(unsigned int i = 0; i < SIZE; i++)
out << nums[i] << " ";
out << ")";
return out;
}
template <typename P, const unsigned int SIZE>
double Point<P,SIZE>::distance( const Point & p ) const
{
double sum = 0;
for(unsigned int i = 0; i < SIZE; i++)
sum += std::pow( nums[i] - p.nums[i], 2 );
return std::sqrt(sum);
}
template <typename P, const unsigned int SIZE>
bool Point<P,SIZE>::operator>( const Point & p ) const
{
return distance( Point{}) > p.distance(Point{});
}
template <typename P, const unsigned int SIZE>
istream &operator>>( istream &in , Point<P,SIZE> &p )
{
return p.read(in);
}
template <typename P, const unsigned int SIZE>
ostream &operator<<( ostream &out, const Point<P,SIZE> &p)
{
return p.write(out);
}
#endif // POINT_H
| [
"rktanizawa@gmail.com"
] | rktanizawa@gmail.com |
65968fa49a66717144527ea1bc03ca5043e71caa | 54335f600f1114d03f263a7235b41a19ae3e8d2a | /Week6/readSquareSum.cpp | 092947919a71d36aa848625022328c173e730a80 | [] | no_license | Bekci/Data-Structures-Lecture-2018-Fall-ITU | 00d5f849042032b2263d59f43edbf46891b705f5 | 3d319f1d3b245571b1221794c6ee0693b161971c | refs/heads/master | 2020-08-05T05:40:30.737316 | 2019-10-02T19:25:23 | 2019-10-02T19:25:23 | 212,417,258 | 0 | 0 | null | 2019-10-02T18:49:49 | 2019-10-02T18:49:48 | null | UTF-8 | C++ | false | false | 695 | cpp | #include <iostream>
using namespace std;
// 2
// 3
// -1 -4 5 => 25
// 4
// 4 6 3 -10 => 61 (16 + 36 + 9)
int readBlockNums(int n){
if(n == 0) return 0;
// Read
int a;
scanf("%d", &a);
// Return the output
if(a > 0)
return (a*a) + readBlockNums(n-1);
else
return readBlockNums(n-1);
}
void readBlock(int t){
// Base
if(t == 0) return;
// Read
int n;
scanf("%d", &n);
// Calculate the answer
int ans = readBlockNums(n);
printf("%d\n", ans);
// Recursive calls
readBlock(t-1);
}
int main(){
int t;
scanf("%d", &t);
readBlock(t);
return 0;
}
| [
"ozbaysa@itu.edu.tr"
] | ozbaysa@itu.edu.tr |
3daa9faa4607588188c30c4a7fefeb470979288c | 923aef6b500dd66e1b598008030b483eaa481734 | /GeneratedFiles/ui_registerwidget.h | d35cbedc97708d7091624c7178c7b374a7431454 | [] | no_license | yangbohust/cellImaging | ead59f1edacb4aa956c49c25a31a96eb7c951d61 | dc5e2b2a45d1be0ad51b921831f6dc3a36250b1a | refs/heads/master | 2021-04-09T14:18:21.443044 | 2018-03-24T07:43:52 | 2018-03-24T07:43:52 | 125,692,773 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,146 | h | /********************************************************************************
** Form generated from reading UI file 'registerwidget.ui'
**
** Created by: Qt User Interface Compiler version 5.8.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_REGISTERWIDGET_H
#define UI_REGISTERWIDGET_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_RegisterWidget
{
public:
QLineEdit *lineEdit;
QPushButton *pushButton;
QLineEdit *lineEdit_2;
QLabel *label_2;
QPushButton *pushButton_2;
QLabel *label;
void setupUi(QWidget *RegisterWidget)
{
if (RegisterWidget->objectName().isEmpty())
RegisterWidget->setObjectName(QStringLiteral("RegisterWidget"));
RegisterWidget->resize(656, 504);
lineEdit = new QLineEdit(RegisterWidget);
lineEdit->setObjectName(QStringLiteral("lineEdit"));
lineEdit->setGeometry(QRect(310, 160, 113, 21));
pushButton = new QPushButton(RegisterWidget);
pushButton->setObjectName(QStringLiteral("pushButton"));
pushButton->setGeometry(QRect(200, 280, 93, 28));
lineEdit_2 = new QLineEdit(RegisterWidget);
lineEdit_2->setObjectName(QStringLiteral("lineEdit_2"));
lineEdit_2->setGeometry(QRect(310, 210, 113, 21));
label_2 = new QLabel(RegisterWidget);
label_2->setObjectName(QStringLiteral("label_2"));
label_2->setGeometry(QRect(220, 220, 72, 15));
pushButton_2 = new QPushButton(RegisterWidget);
pushButton_2->setObjectName(QStringLiteral("pushButton_2"));
pushButton_2->setGeometry(QRect(340, 280, 93, 28));
label = new QLabel(RegisterWidget);
label->setObjectName(QStringLiteral("label"));
label->setGeometry(QRect(220, 160, 72, 15));
retranslateUi(RegisterWidget);
QMetaObject::connectSlotsByName(RegisterWidget);
} // setupUi
void retranslateUi(QWidget *RegisterWidget)
{
RegisterWidget->setWindowTitle(QApplication::translate("RegisterWidget", "RegisterWidget", Q_NULLPTR));
lineEdit->setText(QString());
pushButton->setText(QApplication::translate("RegisterWidget", "\347\241\256\345\256\232", Q_NULLPTR));
lineEdit_2->setText(QString());
label_2->setText(QApplication::translate("RegisterWidget", "\345\257\206\347\240\201\357\274\232", Q_NULLPTR));
pushButton_2->setText(QApplication::translate("RegisterWidget", "\345\217\226\346\266\210", Q_NULLPTR));
label->setText(QApplication::translate("RegisterWidget", "\347\224\250\346\210\267\345\220\215\357\274\232", Q_NULLPTR));
} // retranslateUi
};
namespace Ui {
class RegisterWidget: public Ui_RegisterWidget {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_REGISTERWIDGET_H
| [
"772800726@qq.com"
] | 772800726@qq.com |
ba7bc059aa065e781210311e5ce005bfb3ebd201 | 97dba80026128e9296e575bb58b9cc7867bbc77f | /hdoj/2079.cpp | 71983b5ac9618fed697f20cb8e65efd547f1dc7c | [] | no_license | intfloat/AlgoSolutions | 5272be3dfd72485ff78888325a98c25b2623e3cb | 2f7b2f3c4c8a25eb46322e7f8894263ecd286248 | refs/heads/master | 2021-12-23T08:18:32.176193 | 2021-11-01T05:53:27 | 2021-11-01T05:53:27 | 9,474,989 | 18 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 1,121 | cpp | #include <vector>
#include <list>
#include <limits.h>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include <stdlib.h>
#include <cassert>
#define FOR(i, n) for (int i = 0; i < n; ++i)
using namespace std;
int main() {
int T, n, k, a, b;
int cnt[10], dp[10][45];
cin >> T;
while (T--) {
memset(cnt, 0, sizeof(cnt));
memset(dp, 0, sizeof(dp));
cin >> n >> k;
FOR(i, k) { cin >> a >> b; cnt[a] += b; }
FOR(i, cnt[1] + 1) dp[1][i] = 1;
for (int i = 2; i <= 8; ++i) {
for (int j = 0; j <= n; ++j) {
int cur = 0;
while (i * cur <= j && cur <= cnt[i]) {
dp[i][j] += dp[i - 1][j - i * cur];
++cur;
}
}
}
cout << dp[8][n] << endl;
}
return 0;
}
| [
"wangliangpeking@gmail.com"
] | wangliangpeking@gmail.com |
cb1691fa18911618a4e63d63d54c3a16c412ec0b | 19fc62179b88be316b0b0efaef7e1850dcbf1751 | /programme_robot/programme_robot.ino | f351ce041bcc9b7746a1dc74ab63505a0e450d95 | [] | no_license | Patawa457/suiveur-de-ligne | f79a4deae832dd67ff09ced0d7d503a0c4089671 | 06f1d7b2f8afc2b808505a106d2ba9acd0d517d6 | refs/heads/master | 2020-03-21T09:59:40.821616 | 2018-06-23T19:38:25 | 2018-06-23T19:38:25 | 138,428,474 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,682 | ino | #include <QTRSensors.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#define NUM_SENSORS 3
#define TIMEOUT 2500
#define EMITTER_PIN QTR_NO_EMITTER_PIN
QTRSensorsRC qtr_Sensor((unsigned char[]) {4, 5, 6},NUM_SENSORS, TIMEOUT, EMITTER_PIN);
unsigned int sensorValues[NUM_SENSORS];
int DirMotA = 12, FreinMotA = 9 ,vitesseA = 3 ,DirMotB = 13,FreinMotB = 8, vitesseB = 11;
double vitesse = 65;
struct data {
String conf;
int etat;
};
/*
* image prés enregister.
*/
const int nbSituation = 5;
struct data Image_def[nbSituation]=
{{"010", 0},
{"001", 1},
{"011", 1},
{"100", 2},
{"110", 2}
};
/*
* coeficient pour virage.
*/
double Reaction_moteur[3][2]={
{1.0 , 1.0},
{2.4 , 1.0},
{1.0 , 2.4},
};
void setup() {
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64)
display.display();
delay(2000);
display.clearDisplay();
pinMode(DirMotA,OUTPUT);
pinMode(FreinMotA,OUTPUT);
pinMode(vitesseA,OUTPUT);
pinMode(DirMotB,OUTPUT);
pinMode(FreinMotB,OUTPUT);
pinMode(vitesseB,OUTPUT);
digitalWrite(DirMotB, 1);
digitalWrite(FreinMotB, 0);
digitalWrite(DirMotA, 0);
digitalWrite(FreinMotA, 0);
}
int etat_actuel;
int etat_general;
uint8_t color;
int memoire;
void loop() {
while(etat_general == etat_actuel){
etat_actuel = capteur();
Affichage_Capteur();
Affichage_Etat(etat_actuel);
display.display();
display.clearDisplay();
moteur(etat_general);
Serial.println();
}
etat_general = etat_actuel;
}
/*
prend les donnée, tranformation en binaire, stock donné
*/
int capteur(){
//Partie 1: Reception donné + binarisation + création et image
String Sensor= ""; // permet de crée l'image de la route
int etat = -1;
qtr_Sensor.read(sensorValues);
for(int i=0; i<NUM_SENSORS ; i++){
sensorValues[i] = Binaire(sensorValues[i]);
Sensor += (String) sensorValues[i]; // Création de l'image du capteur avant dans un string
}
//Partie 2: Comparaison et memoire de l'état
for(int i=0; i < nbSituation ; i++){ //permet de trouvé quel situation définis correspond a l'image
if(Sensor == Image_def[i].conf){
etat = Image_def[i].etat;
memoire = etat;
}
else{ //permet de conservé l'état actuel si l'image capté ne correspond pas aux situations définis
etat = memoire;
}
}
return etat;
}
void Affichage_Capteur(){
int Y1 = 0;
int X2 = 20;
int Y2 = 10;
int X1 = (display.width()/2)-(3*X2/2);
int Limite = X1+3*X2;
int i = 0;
for(;X1< Limite; X1+=20){
if (sensorValues[i] == 1) color = WHITE;
else color = BLACK;
display.fillRect( X1+1, Y1+1, X2-1, Y2-1, color);
display.drawRect(X1, Y1, X2, Y2, WHITE);
i++;
}
}
void Affichage_Etat(int etat){
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0,17);
display.print(etat);
display.setTextSize(1);
display.setCursor(20,17);
display.print(Reaction_moteur[etat][0]);
display.print(" ");
display.print(Reaction_moteur[etat][1]);
display.println();
display.print(" ");
display.print(vitesse * Reaction_moteur[etat][0]);
display.print(" ");
display.print(vitesse * Reaction_moteur[etat][1]);
}
int Binaire(int val){
int valeur;
if(val<1250){
valeur = 1;
}else{
valeur = 0;
}
return valeur;
}
/*
* CAPTEUR -> vitesse
*/
void moteur(int etat){
analogWrite(vitesseA, vitesse * Reaction_moteur[etat][0]);
analogWrite(vitesseB, vitesse * Reaction_moteur[etat][1]);
}
| [
"lenganey.nicolas@gmail.com"
] | lenganey.nicolas@gmail.com |
52adda2bb9af8bfeceb62186017acfe6b7eb837f | b78c255d1c8b917c21bf689f5f9153d765fbe195 | /dogpack/apps/1d/quad_moments/VlasovPoissonBiGaussian/BeforeQinit.cpp | d1fa4abd64d7cb3f6095b05caecdfc8e3d07379d | [] | no_license | smoe1/ImplicitExplicit | 8be586bed84b1a661e5fe71f5b063dcd406643fa | 2b9a2d54110ca0f787d4252b9a8cc6d64b23b08d | refs/heads/master | 2016-09-08T02:39:48.371767 | 2015-09-15T21:15:08 | 2015-09-15T21:15:08 | 41,374,555 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,074 | cpp | #include "tensors.h"
//#include "DogState1d.h"
#include "dogdefs.h"
#include <cmath>
// Function that is called before initial conditions are set
// Initial density and background density are set here
void BeforeQinit(const dTensor2& node, dTensorBC3& aux, dTensorBC3& q)
{
const int melems = q.getsize(1);
const int meqn = q.getsize(2);
const int kmax = q.getsize(3);
const int mbc = q.getmbc();
const int maux = aux.getsize(2);
dTensorBC3 Evals(melems, 1, kmax, mbc);
void L2Project(int mopt, int istart, int iend,
const dTensor2& node,
const dTensorBC3& qin,
const dTensorBC3& auxin,
dTensorBC3& Fout,
void (*Func)(const dTensor1&, const dTensor2&,
const dTensor2&, dTensor2&));
void SetBackground(const dTensor1& xpts,
const dTensor2& Q,
const dTensor2& qvals,
dTensor2& auxvals);
void InitDensity(const dTensor1& xpts,
const dTensor2& Q,
const dTensor2& auxvals,
dTensor2& qvals);
void ComputeElecField(double t, const dTensor2& node, const dTensorBC3& qvals,
dTensorBC3& aux, dTensorBC3& Evals);
// save background density into aux(1:melems,1,1:kmax):
L2Project(0,1-mbc,melems+mbc,node,q,aux,aux,&SetBackground);
// Initialize density
L2Project(0,1-mbc,melems+mbc,node,q,aux,q,&InitDensity);
// save electric field into aux(1:melems,2,1:kmax):
ComputeElecField(0.0, node, q, aux, Evals);
for(int i=1; i<= melems; i++)
for(int k=1; k<= kmax; k++)
{
aux.set(i,2,k, -Evals.get(i,1,k) );
}
}
void InitDensity(const dTensor1& xpts,
const dTensor2& NOT_USED_1,
const dTensor2& NOT_USED_2,
dTensor2& qvals)
{
const int numpts = xpts.getsize();
for(int i=1;i<=numpts;i++)
{
double x = xpts.get(i);
double rho;
// equilibrium distribution with constant rho
//rho=1.0;
// equilibrium distribution with rho = sqrt(2*pi)/2*(2+cos(2*pi*x))
rho=sqrt(2.0*pi)/2.0*(2.0+cos(2.0*pi*x));
// equilibrium distribution with Riemann problem
/*
if(x>=0.25 && x<0.75)
{ rho=0.5;}
else
{ rho=0.125;}
*/
qvals.set(i,1,rho);
}
}
void SetBackground(const dTensor1& xpts,
const dTensor2& NOT_USED_1,
const dTensor2& NOT_USED_2,
dTensor2& auxvals)
{
const int numpts = xpts.getsize();
for(int i=1;i<=numpts;i++)
{
double x = xpts.get(i);
double rho0;
// equilibrium distribution with constant rho
//rho0=1.0;
// equilibrium distribution with rho = sqrt(2*pi)/2*(2+cos(2*pi*x))
rho0=sqrt(2.0*pi)/1.2661*exp(cos(2.0*pi*x));
// equilibrium distribution with Riemann problem
/*
if(x>=0.25 && x<0.75)
{ rho0=0.125;}
else
{ rho0=0.5;}*/
auxvals.set(i,1,rho0);
}
}
| [
"smoe@uw.edu"
] | smoe@uw.edu |
78b377ac035a5505810c0fb357d134f94fbb091a | 2108c0a9b699b9671d113d06fc876d0c2bd9d869 | /Graph/5.DisjointSetUnion/2.quickUnion.cpp | e92b7aa26929f76d4ddfb483e4570be8913d632e | [] | no_license | AshutoshKr1098/DSAPreparation | a2ebd155f8f6600998050818a810da91d9d9f8a1 | e5b364de19e5f36ac3a6e5151354e5a4458b534a | refs/heads/master | 2023-08-12T04:03:58.936193 | 2021-09-19T16:04:44 | 2021-09-19T16:04:44 | 327,641,626 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,495 | cpp | /**
* Algorithm: [ Quick Union]
* TimeComplexity: Union ( O(n) per union in worst case of find operation,as union requires find opr to be called)
* Find ( O(n) per find in worst case of skewed tree)
* Therefore for N operations, we will have O(n2) as union and O(n) as find.
* Find operation can become very time consuming if the tree keeps getting skewed, so we need to move to a better approach
*/
#include<bits/stdc++.h>
using namespace std;
class dsu
{
//This will store the id of individual elements
vector<int> ds;
public:
dsu(int n)
{
//Initialized the vector, where each element is connected just to itself ds[i]=i
for (int i = 0; i < n;i++)
ds.push_back(i);
}
//Returns the root of each element in their respective component
int find(int u)
{
//We have a ds array in this class, where each element has the parent element stored.
while(u!=ds[u])
u = ds[u];
return ds[u];
}
//Fetches the root of both elements and returns whether they match or not
bool isConnected(int u,int v)
{
int root_u = find(u);
int root_v = find(v);
return root_u == root_v;
}
//Performs Union Operations for given two elements
void unionElements(int u,int v)
{
/*To union elements, we first find whether they are connected or not
Then we find the root of both components and assign one component as child to other
Note: Here it might be the case that the LARGET SUBTREE can become a CHILD of SMALLER subtree
Thus we will further improve the union operation to always append the smaller subtree to larger one
*/
if(!isConnected(u,v))
{
int root_u = find(u);
int root_v = find(v);
ds[root_v]=root_u;
}
}
};
int main()
{
dsu dis(8);
int n;
cin >> n;
for (int i = 0; i < n;i++)
{
int u, v,q;
cin >> u >> v>>q;
if(q==1)
dis.unionElements(u, v);
else if(q==2)
{
if(dis.isConnected(u,v))
cout << u << " " << v << " are connected" << endl;
else
cout << u << " " << v << " are not connected" << endl;
}
}
} | [
"ashu.heretocode@gmail.com"
] | ashu.heretocode@gmail.com |
537c1c6790af1ee38bb3c04d4d86df6113acb189 | 013551fba68009270acc62c0c2645c5a32ef67f5 | /Exam/Работы_для_проверки/Pavlyuchenko Sergey/pavlyuchenko.exam4/Pavlyuchenko.Exam.Additional/IteratorTest.h | 0a1eabc883fc46338aa1786620443d73d339fe82 | [] | no_license | azureitstepkharkov/33pr11gitserver | 36f694e78e253078a3a8d96631f8ef17eedb789e | 65a7970d04e69d1c1bc96518bf283c31ac63aaae | refs/heads/master | 2020-07-14T14:40:52.030861 | 2019-09-24T13:59:13 | 2019-09-24T13:59:13 | 205,335,889 | 1 | 2 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 1,417 | h | // В этом файле содержится класс IteratorList
#include "Libraries.h"
#include "List.h"
#include "Array.h"
// IteratorTest
class IteratorTest {
public:
virtual bool hasNext() = 0;
virtual int current() = 0;
virtual int begin() = 0;
virtual int end() = 0;
};
// IteratorList
/*
template <class T>
class IteratorList: public IteratorTest {
public:
IteratorList() {}
IteratorList(List<T> &list) : list (list), current(0) {}
bool hasNext() override {
return current < list.getSize();
}
int current() override {
return 0;
}
int begin() override {
return 0;
}
int end() override {
return 0;
}
private:
List<T> list;
int current = 0;
};
*/
template <class ListNode>
class IteratorList : public IteratorTest {
friend class List<class ListNode::value_type>;
ListNode* p;
public:
IteratorList(ListNode* p) : p(p) {}
IteratorList(const IteratorList& other) : p(other.p) {}
IteratorList& operator=(IteratorList other) { std::swap(p, other.p); return *this; }
void operator++() { p = p->next; }
void operator++(int) { p = p->next; }
bool operator==(const IteratorList& other) { return p == other.p; }
bool operator!=(const IteratorList& other) { return p != other.p; }
const int& operator*() const { return p->data; }
IteratorList<ListNode> operator+(int i) {
IteratorList<ListNode> iter = *this;
while (i-- > 0 && iter.p)
{
++iter;
}
return iter;
}
}; | [
"opergad@gmail.com"
] | opergad@gmail.com |
f0373cdff6fbd80deacdc505650d6eb1dd01ba7d | 033e1e353d1ff07c8680e0be7c83081906f4fcdb | /RideTheFlow/src/UIactor/GunUI/GunUI.cpp | f877963fae192f65abe99ecaa00cb234491b1629 | [] | no_license | KataSin/KozinKataoka | 572d897cdb777b241a2848ff18c691c7f10d7d31 | 1b15b3a12364e34561c042f3b97b99d9a4482852 | refs/heads/master | 2021-01-11T18:21:41.396200 | 2017-07-06T15:00:10 | 2017-07-06T15:00:10 | 69,627,602 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 1,366 | cpp | #include "GunUI.h"
#include "../../world/IWorld.h"
#include "../../math/Math.h"
#include "../../actor/PlayerAttack/PlayerAttackManager/PlayerAttackManager.h"
GunUI::GunUI(IWorld & world, Vector2 position, Actor & manager) :
UIActor(world),
mPosition(position),
mTurn(false)
{
parameter.isDead = false;
//変換
mManager = dynamic_cast<PlayerAttackManager*>(&manager);
//武器種類取得
mAttackState = mManager->GetState();
//プレイヤーが二人だったら関係なし
if (world.GetPlayerNum() == 2) return;
//銃の画像を反転するかどうか
if (mManager->GetParameter().playNumber == PLAYER_NUMBER::PLAYER_1 ||
mManager->GetParameter().playNumber == PLAYER_NUMBER::PLAYER_3)
mTurn = false;
else
mTurn = true;
}
GunUI::~GunUI()
{
}
void GunUI::Update(PLAYER_NUMBER playerNumber)
{
mAttackState = mManager->GetState();
mAngle += 0.1f;
switch (mAttackState)
{
case PlayerAttackState::MACHINE_GUN:
{
mTexture = SPRITE_ID::MACHINE_UI_SPRITE;
break;
}
case PlayerAttackState::SHOT_GUN:
{
mTexture = SPRITE_ID::SHOT_UI_SPRITE;
break;
}
case PlayerAttackState::SNIPER_GUN:
{
mTexture = SPRITE_ID::SNEPER_UI_SPRITE;
break;
}
}
}
void GunUI::Draw() const
{
Vector2 size = Sprite::GetInstance().GetSize(mTexture);
Sprite::GetInstance().Draw(mTexture, mPosition, 1.0f, Vector2(0.7f), 0.0f, true, mTurn);
}
| [
"ktok223@gmail.com"
] | ktok223@gmail.com |
36c1945b89149142198b9497169ea0110457961d | 604c83f9980965fe979ebd17c4a5745b251c7d14 | /class_examples/12_pointers/dynamic.cpp | 5b1ad13bfd5f2d4a891310b4c2ff596f6f2118d6 | [] | no_license | burkell530/Repository321 | 51e3eda6a576d9553a303db897f569c23c190b1a | 679046b0d8c807906b762477cc085809e9f620b9 | refs/heads/master | 2021-01-19T07:34:36.090203 | 2014-05-13T21:13:56 | 2014-05-13T21:13:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,339 | cpp | /*
* Name : dynamic.cpp
* Author : Luke Sathrum
* Description : Examples of creating pointers and dynamic variables / arrays.
* In this example we will dynamically create an array to hold
* student's names.
*/
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
using std::string;
// Program starts here
int main(int argc, char *argv[]) {
// Creating some pointers and integer variables
int *pointer, size, i;
string *students;
// Creating a dynamic variable
pointer = new int;
// Assigning the value 42 to the dynamic variable
*pointer = 42;
// Output the values of *pointer and pointer
cout << "*pointer == " << *pointer << endl;
cout << "pointer == " << pointer << endl;
// Get the size of the array
cout << "How many students? ";
cin >> size;
cin.ignore(1000, '\n');
// Create our dynamic array
students = new string[size];
// Get the names of the students
for (i = 0; i < size; i++) {
cout << "Enter the first name of student " << (i + 1) << ": ";
getline(cin, students[i]);
}
// Output the students as a comma separated list
cout << "The students entered were: ";
for (i = 0; i < (size - 1); i++) {
cout << students[i] << ", ";
}
cout << students[i] << endl;
// This ends our program
return 0;
}
| [
"sathrumlu@butte.edu"
] | sathrumlu@butte.edu |
871254b0875888809b580fd5fbdb0340783f37f1 | 5f7d3029a42d4ec50ee4923039121b9a30f3ffcb | /userfctR/realtime/user_realtime_options.cc | 1e490ca4fdb450de98f6b2be69072d024f92cb75 | [] | no_license | traoremp/MobileRobot | dd550e090898e1823166cbbdef1a7dd614c66da2 | 27a4324e3c7e98a975d49160bba520a3e8f5d599 | refs/heads/master | 2021-01-11T07:24:59.189561 | 2016-10-06T14:46:38 | 2016-10-06T14:46:38 | 70,041,817 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,539 | cc | /*!
* \author Nicolas Van der Noot
* \file user_realtime_options.c
* \brief let the user select real-time options different from the default ones
*/
#ifdef REAL_TIME
#include "realtime.h"
#include "cmake_config.h"
#include "config_functions.hh"
#include "config_file.h"
/*! \brief modify the real-time options
*
* \param[in] mbs_data Robotran main structure
* \param[out] options real-time options
*
* These are the options that the user can configure:
*
* * Simulation options
* * options->t0: initial simulation time [s] (default: 0.0)
* * options->tf: final simulation time [s] (default: mbs_dirdyn->options->tf)
* * options->dt0: simulation time step [s] (default: mbs_dirdyn->options->dt0)
* * options->buffer_size: size of the buffer for java and sdl (default: -1).
* This size corresponds to the number of time steps saved to analyze what happened
* back in time. When the buffers are full, they erase the oldest values with the new
* ones (rotating buffer). If you put a value <= 0, the size is automatically computed
* so that the buffer is big enough for the whole simulation.
* * options->init_speed_factor: initial speed factor (default: 1.0)
* For speed factors equal or higher than one, this factor should be an integer.
* For speed factors in ]0;1[, this factor is set as 2^x, where x is a negative integer.
* So, if your factor does not match these requirements, it will be rounded to fulfill them.
* Note: there is a minimal speed factor value related to the simulation time step and to
* the refreshment rate of the plots and the visualization.
* min speed factor = mbs_dirdyn->options->dt0 * max(options->fqc_screen, options->fqc_visu)
* Modify these options for very slow motions.
*
* * SDL plots options
* * options->flag_plot: 1 to activate SDL plots features (and keyboard/joystick interactions), 0 otherwise (default: 1)
* * options->curve_width: curves width in number of pixels (default: 3)
* * options->screen_width: plot screen width in number of pixels (default: 660)
* * options->screen_height: plot screen height in number of pixels (default: 520)
* For 'screen_width' and 'screen_height', pay attention that the plot layout was optimized
* for a size of 660x520. Consequently, layout could be deteriorated in some cases if
* you modify it, especially when you decrease these values.
* * options->max_nb_curves: maximum number of curves plotted (default: 12)
* * options->max_nb_legends: maximum number of curves legends indicated (default: 6)
* * options->y_min_init: initial lower bound for the y values plotted (default: -1.0)
* * options->y_max_init: initial upper bound for the y values plotted (default: 1.0)
* * options->init_break: 1 to start with a break, 0 otherwise (default: 0)
* * options->final_break: 1 to finish with a break, 0 otherwise (default: 0)
* * options->color_tab[i]: colors of the curves (default: 0:BLUE_SDL, 1:RED_SDL, 2:DARK_GREEN_SDL,
* 3:PURPLE_SDL, 4:ORANGE_SDL, 5:LIGHT_BLUE_SDL, 6:PINK_SDL, 7:TURQUOISE_SDL,
* 8:LIGHT_GREEN_SDL, 9: DARK_YELLOW_SDL, 10:YELLOW_SDL, 11:GREEN_SDL).
* You can modify some curve colors, replacing 'i' by a number between 0 and 11 (included).
* Use the colors listed in the default values. For instance: 'options->color_tab[0] = ORANGE_SDL;'.
* If you have more than 12 curves, the curve index modulo 12 is used to determine the colour.
* * options->fqc_screen: frequence of the SDL plots refreshment [Hz] (default: 30.0)
* This frequence also determines the speed of the moving cursor.
*
* * Java visualization options
* * options->flag_visu: 1 to activate Java visualization features, 0 otherwise (default: 1)
* Activating the Java visualization features might prevent you from using a debugger.
* Consequently, it is better to set this flag to 0 before entering in debugging mode.
* Also, when a seg fault appears in the code and the Java visualization features are activated,
* a Java error message will appear. This does not mean that the error is related to Java.
* * options->nb_models: number of .mbs models to load (default: 1)
* * options->nb_q[i]: number of joints in the .mbs files used for visualization of model i (see 'nb_models')
* (default: mbs_data->njoint for nb_q[0]; 0 for the others)
* 'nb_q' has a size of 20. If 'nb_models' is more than 20, you have to manually deallocate and
* reallocate it to a size of 'nb_models'.
* * options->mbs_file[i]: path and file name for the .mbs file used for Java visualization for model i
* (default: .mbs file indicated in workR, in 'mbs_load', for mbs_file[0]; NULL for the others)
* 'mbs_file' has a size of 20. If 'nb_models' is more than 20, you have to manually deallocate and
* reallocate it to a size of 'nb_models'.
* * options->start_viewpoint: initial visualization viewpoint ID, defined in the .mbs file (default: 0).
* Use -1 to start with the default viewpoint when opening MBSysPad.
* * options->fqc_visu: frequence of the java visualization refreshment [Hz] (default: 30.0)
*
* example:
* options->y_min_init = 0.0;
* options->y_max_init = 10.0;
*/
void user_realtime_options(MbsData* mbs_data, Realtime_option *options)
{
FILE *config_file;
config_file = open_config();
//To Use Debug Mode
//options->flag_visu = 0;
#ifdef HARDCODED_CONFIG
options->nb_q[0] = NB_JOINTS_ANIM;
#else
options->nb_q[0] = config_int(config_file, "nb_joints_anim");
#endif
options->mbs_file[0] = (char*) PROJECT_SOURCE_DIR"/../dataR/m454_project_anim.mbs";
close_config(config_file);
}
#endif
| [
"traoremp@vt.edu"
] | traoremp@vt.edu |
a9dfa1a0d29bdf35771ad18f6c0539e069233a07 | 5de42c4e14a7ddbc284a742c66cb01b230ba43ce | /codeforces/138/C.cpp | 883ba209f27a57d3c2168d20eee62b7ca9f82629 | [] | no_license | NhatMinh0208/CP-Archive | 42d6cc9b1d2d6b8c85e637b8a88a6852a398cc23 | f95784d53708003e7ba74cbe4f2c7a888d29eac4 | refs/heads/master | 2023-05-09T15:50:34.344385 | 2021-05-04T14:25:00 | 2021-05-19T16:10:11 | 323,779,542 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,153 | cpp |
// Problem : C. Mushroom Gnomes - 2
// Contest : Codeforces - Codeforces Beta Round #99 (Div. 1)
// URL : https://codeforces.com/problemset/problem/138/C
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
/*
A Submission by $%U%$
at time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
*/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define FILE_IN "cseq.inp"
#define FILE_OUT "cseq.out"
#define ofile freopen(FILE_IN,"r",stdin);freopen(FILE_OUT,"w",stdout)
#define fio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define nfio cin.tie(0);cout.tie(0)
#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))
#define ord(a,b,c) ((a>=b)and(b>=c))
#define MOD (ll(1000000007))
#define MAX 300001
#define mag 320
#define p1 first
#define p2 second.first
#define p3 second.second
#define fi first
#define se second
#define pow2(x) (ll(1)<<x)
#define pii pair<int,int>
#define piii pair<int,pii>
#define For(i,__,___) for(int i=__;i<=___;i++)
#define Rep(i,__,___) for(int i=__;i>=___;i--)
#define ordered_set tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update>
#define endl "\n"
#define bi BigInt
typedef long long ll;
//---------END-------//
int n,m,k,c[501],pos[100001],t,t1,i,j;
struct mush
{
ll a,h,l,r;
};
mush arr[100005];
struct mu
{
ll x,v;
};
bool operator < (mu m1, mu m2)
{
if(m1.x != m2.x)return m1.x < m2.x;
return m1.v < m2.v;
}
mu mus[10005];
double pr[50005];
double query(int ind, int nd=1, int l=0, int r=10005)
{
if(l==r)return pr[nd];
int m=(l+r)>>1;
double ans=pr[nd];
if(ind <=m )
{
ans*=query(ind, nd<<1, l, m);
}
else
{
ans*=query(ind, (nd<<1) + 1, m+1, r);
}
return ans;
}
void upd(int a, int b, double val, int nd=1, int l=0, int r=10005)
{
if(a==l && b==r)
{
pr[nd]*=val;
return ;
}
int m = (l+r)>>1;
if(a<=m)
upd(a, min(m, b), val, nd<<1, l, m);
if(b>m)
upd(max(a, m+1), b, val, (nd<<1)+1, m+1, r);
}
int main()
{
fio;
int n,m;
cin>>n>>m;
for(int i=0;i<n;++i)
cin>>arr[i].a>>arr[i].h>>arr[i].l>>arr[i].r;
for(int i=0;i<m;++i)
{
cin>>mus[i].x>>mus[i].v;
}
sort(mus, mus+m);
for(int i=0;i<50005;++i)pr[i]=1;
for(int i=0;i<n;++i)
{
mush now=arr[i];
mu ts = {arr[i].a, 10000};
int ind1 = lower_bound(mus, mus+m, ts) - mus;
ts.x=arr[i].a + arr[i].h;
int ind2 = lower_bound(mus, mus+m, ts) - mus;
ind2--;
if(ind1 <=ind2 && arr[i].r !=0)
{
upd(ind1, ind2, (double)(100-arr[i].r) * 0.01);
}
ts.x = arr[i].a - arr[i].h - 1;
ind1 = lower_bound(mus, mus+m, ts) - mus;
ts.x = arr[i].a-1;
ind2 = lower_bound(mus, mus+m, ts) - mus;
ind2--;
if(ind1 <= ind2 && arr[i].l !=0)
{
upd(ind1, ind2, (double)(100-arr[i].l)*0.01);
}
}
double ans=0;
for(int i=0;i<m;++i)
{
ans+=query(i)*mus[i].v;
}
cout<<fixed<<setprecision(9)<<ans;
}
| [
"minhkhicon2468@gmail.com"
] | minhkhicon2468@gmail.com |
e83059719671a7e2a2a19b26785739fbad504b92 | 93d6f8387cde6fcbf3112b9eb19744d2b4381228 | /tile/CPU/MMU/MMU.cc | 6302f8c5b395023754d0533215cc5f6a44b4ca27 | [] | no_license | xunyufei/Mcoresim | 69e5517ab8593085d65be9410247eb1b7b6daca6 | aa5e8b3ab981ceae925c6cdfaf9d9356ceb6bd73 | refs/heads/master | 2021-01-18T07:52:00.538285 | 2012-03-19T14:39:16 | 2012-03-19T14:39:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,470 | cc | #include "MMU.h"
#include "defs.h"
#include "frequency_scale.h"
Define_Module(MMU);
void MMU::initialize()
{
tile_id = par("tile_id");
x_tile = par("x_tile");
y_tile = par("y_tile");
x_coord = tile_id % x_tile;
y_coord = (int)(tile_id / x_tile);
memory_size = par("memory_size");
off_chip_memory_size = par("off_chip_memory_size");
off_chip_memory_enable = par("off_chip_memory_enable");
#ifndef NO_DELAY
delay = 1.0/ ((double)par("clock_rate") * MMU_SCALE_FACTOR);
#else
delay = 0.0;
#endif
fromLocalMem = gate("fromLocalMem");
toLocalMem = gate("toLocalMem");
fromCache = gate("fromCache");
toCache = gate("toCache");
fromNI = gate("fromNI");
toNI = gate("toNI");
local_mem_control_in = gateHalf("local_mem_control",cGate::INPUT);
local_mem_control_out = gateHalf("local_mem_control",cGate::OUTPUT);
cache_control_in = gateHalf("cache_control",cGate::INPUT);
cache_control_out = gateHalf("cache_control",cGate::OUTPUT);
NI_control_in = gateHalf("NI_control",cGate::INPUT);
NI_control_out = gateHalf("NI_control",cGate::OUTPUT);
//figure out how much memory is actually local memory.
int local_memory_total = x_tile * y_tile * memory_size;
local_start = tile_id * memory_size;
if(off_chip_memory_enable){
//now figure out what is the memory address for the offchip memory
//sitting here.
if((x_coord == 0) && (y_coord == 0)){
//first bank
off_chip_start = local_memory_total;
}
if((x_coord == x_tile) && (y_coord == 0)){
//second bank
off_chip_start = local_memory_total + off_chip_memory_size;
}
if((x_coord == 0) && (y_coord == y_tile)){
//third bank
off_chip_start = local_memory_total + (2 * off_chip_memory_size);
}
if((x_coord == x_tile) && (y_coord == y_tile)){
//third bank
off_chip_start = local_memory_total + (3 * off_chip_memory_size);
}
}
return;
}
void MMU::handleMessage(cMessage *msg)
{
if(INCOMING_GATE(msg,fromLocalMem)){
CAST_MSG(access_response,msg,MemoryAccess);
if(access_response->getIsRemote()){
//figure out how to handle this later.
//TODO:later
//the idea is that this a response to a request
//for access from somewhere else on the chip.
//this must be retranslated back into a network
// packet and sent out through the NI.
}
else{
//this access was triggered by the local
//cache.
sendDelayed(msg,delay,toCache);
}
}
if(INCOMING_GATE(msg,fromCache)){
CAST_MSG(access,msg,MemoryAccess);
int address = access->getAddress();
if((IS_ADDRESS_LOCAL(address))||(IS_ADDRESS_OFF_CHIP_HERE(address))){
sendDelayed(msg,delay,toLocalMem);
}
else{
//this is an access to some remote
//memory location from the local
//cache.
//TODO:later
//the idea is that this a request
//for access to memroy somewhere else on the chip.
//this must be translated into a network
// packet and sent out to the NI.
}
}
if(INCOMING_GATE(msg,fromNI)){
//TODO:later
//the idea is that this a request
//for access from somewhere else on the chip.
//this must be translated into a local memory access
// packet and sent out to the local memory.
//the other thing that this can be is an interrupt that has been
//sent to this core from someother core. in which case feed it directly to
//the processor.
}
}
| [
"subramanian.vivek@gmail.com"
] | subramanian.vivek@gmail.com |
4e280cc226a7ace1d7545eaaad4e8fee8a8afa2d | c783904ed1439834309f727149765368b68d332d | /Assignments/Assignment2/test.cpp | e8d2531ffb7626e2012599fc1cbcaabec21e8221 | [] | no_license | Jumu3668/CSCI-2270-Code | a0d7e979d16762fde24f0a6981ed05318dfddc7d | 16f9612d722fdca348952adcc63b633a555a5767 | refs/heads/master | 2021-01-07T19:57:54.740558 | 2020-02-20T06:41:17 | 2020-02-20T06:41:17 | 241,805,571 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,108 | cpp | #include <iostream>
using namespace std;
void swap0(int* ptr1, int* ptr2) //swap by pointer
{
int *temp;
temp = ptr1;
ptr1 = ptr2;
ptr2 = temp;
}
void swap1 (int ptr1, int ptr2) //swap by value
{
int temp;
temp = ptr1;
ptr1 = ptr2;
ptr2 = temp;
}
void swap2 (int *&ptr1, int *&ptr2)
{
int* temp;
temp = ptr1;
ptr1 = ptr2;
ptr2 = temp;
}
void swap3(int &ptr1, int &ptr2)
{
int temp;
temp = ptr1;
ptr1 = ptr2;
ptr2 = temp;
}
void swap4(int** ptr1, int** ptr2)
{
int *temp;
temp = *ptr1;
*ptr1 = *ptr2;
*ptr2 = temp;
}
int main(){
int *ptr1 = new int[5];
int *ptr2 = new int[5];
for (int i = 0; i < 5; i++)
{
ptr1[i] = i;
}
for (int i = 0; i < 5; i++)
{
ptr2[i] = 4-i;
}
for (int i = 0; i < 5; i++)
{
cout << ptr1[i] << " ";
}
cout << endl;
// swap0(ptr1, ptr2);
// swap1(*ptr1, *ptr2);
// swap2(ptr1, ptr2);
// swap3(*ptr1, *ptr2);
swap4(&ptr1, &ptr2);
for (int i = 0; i < 5; i++)
{
cout << ptr1[i] << " ";
}
return 0;
}
| [
"boxmonkey13@outlook.com"
] | boxmonkey13@outlook.com |
982fee3a07d927b4ab81ff42bad59b587224683e | a61129c0cfa29835f340e4914f8c4b3cf1338c24 | /src/timedata.cpp | d4c8596f19e0350ecd41bc017204cce317b0270c | [
"MIT"
] | permissive | anno189/genteshare | 90c558b1ff0658de0247d64df608ef935d0fea33 | b1407e7977c52bac52326cec9c7243877d0b273d | refs/heads/master | 2021-10-27T15:31:12.514833 | 2019-04-18T02:01:38 | 2019-04-18T02:01:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,708 | cpp | // Copyright (c) 2014-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "timedata.h"
#include "netaddress.h"
#include "sync.h"
#include "ui_interface.h"
#include "util.h"
#include "utilstrencodings.h"
#include <boost/foreach.hpp>
using namespace std;
static CCriticalSection cs_nTimeOffset;
static int64_t nTimeOffset = 0;
/**
* "Never go to sea with two chronometers; take one or three."
* Our three time sources are:
* - System clock
* - Median of other nodes clocks
* - The user (asking the user to fix the system clock if the first two disagree)
*/
int64_t GetTimeOffset()
{
LOCK(cs_nTimeOffset);
return nTimeOffset;
}
int64_t GetAdjustedTime()
{
return GetTime() + GetTimeOffset();
}
static int64_t abs64(int64_t n)
{
return (n >= 0 ? n : -n);
}
#define BITCOIN_TIMEDATA_MAX_SAMPLES 200
void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample)
{
LOCK(cs_nTimeOffset);
// Ignore duplicates
static set<CNetAddr> setKnown;
if (setKnown.size() == BITCOIN_TIMEDATA_MAX_SAMPLES)
return;
if (!setKnown.insert(ip).second)
return;
// Add data
static CMedianFilter<int64_t> vTimeOffsets(BITCOIN_TIMEDATA_MAX_SAMPLES, 0);
vTimeOffsets.input(nOffsetSample);
LogPrint("net","added time data, samples %d, offset %+d (%+d minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60);
// There is a known issue here (see issue #4521):
//
// - The structure vTimeOffsets contains up to 200 elements, after which
// any new element added to it will not increase its size, replacing the
// oldest element.
//
// - The condition to update nTimeOffset includes checking whether the
// number of elements in vTimeOffsets is odd, which will never happen after
// there are 200 elements.
//
// But in this case the 'bug' is protective against some attacks, and may
// actually explain why we've never seen attacks which manipulate the
// clock offset.
//
// So we should hold off on fixing this and clean it up as part of
// a timing cleanup that strengthens it in a number of other ways.
//
if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1)
{
int64_t nMedian = vTimeOffsets.median();
std::vector<int64_t> vSorted = vTimeOffsets.sorted();
// Only let other nodes change our time by so much
if (abs64(nMedian) < 70 * 60)
{
nTimeOffset = nMedian;
}
else
{
nTimeOffset = 0;
static bool fDone;
if (!fDone)
{
// If nobody has a time different than ours but within 5 minutes of ours, give a warning
bool fMatch = false;
BOOST_FOREACH(int64_t nOffset, vSorted)
if (nOffset != 0 && abs64(nOffset) < 5 * 60)
fMatch = true;
if (!fMatch)
{
fDone = true;
string strMessage = _("Please check that your computer's date and time are correct! If your clock is wrong Genteshare Core will not work properly.");
strMiscWarning = strMessage;
uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING);
}
}
}
BOOST_FOREACH(int64_t n, vSorted)
LogPrint("net", "%+d ", n);
LogPrint("net", "| ");
LogPrint("net", "nTimeOffset = %+d (%+d minutes)\n", nTimeOffset, nTimeOffset/60);
}
}
| [
"1176849+mrzeta@users.noreply.github.com"
] | 1176849+mrzeta@users.noreply.github.com |
fa4e49a9729993da09f64d0f0be6915fcc18ce7a | fc97936c7260805712ecd30438317eca3842e74b | /src/dynamicmodel_c.cpp | 04ab7650f9caedfdc98d79f7629cd8499c6e8377 | [] | no_license | alexglzg/sensors | a192d7c7bde0798023219f60c0b130503db61b17 | f632d48ef54199d4989fe160a3542965615c34ba | refs/heads/master | 2020-05-25T00:05:59.218470 | 2019-10-09T18:32:21 | 2019-10-09T18:32:21 | 187,527,405 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 4,418 | cpp | #include <iostream>
#include "ros/ros.h"
#include "geometry_msgs/Pose2D.h"
#include "geometry_msgs/Vector3.h"
#include "std_msgs/Float64.h"
#include <math.h>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
float Tstbd = 0;
float Tport = 0;
float theta = 0;
float r = 0;
float Xu = 0;
float Yv = 0;
float Yr = 0;
float Nv = 0;
float Nr = 0;
float X_u_dot = -2.25;
float Y_v_dot = -23.13;
float Y_r_dot = -1.31;
float N_v_dot = -16.41;
float N_r_dot = -2.79;
float Xuu = 0;
float Yvv = -99.99;
float Yvr = -5.49;
float Yrv = -5.49;
float Yrr = -8.8;
float Nvv = -5.49;
float Nvr = -8.8;
float Nrv = -8.8;
float Nrr = -3.49;
float m = 30;
float Iz = 4.1;
float B = 0.41;
float c = 1.1;
void right_callback(const std_msgs::Float64::ConstPtr& right)
{
Tstbd = right->data;
}
void left_callback(const std_msgs::Float64::ConstPtr& left)
{
Tport = left->data;
}
void ins_callback(const geometry_msgs::Pose2D::ConstPtr& ins)
{
theta = ins->theta;
}
void vel_callback(const geometry_msgs::Vector3::ConstPtr& vel)
{
r = vel->z;
}
int main(int argc, char *argv[])
{
ros::init(argc, argv, "dynamicmodel_c");
ros::NodeHandle n;
//ROS Publishers for each required sensor data
ros::Publisher dm_pos_pub = n.advertise<geometry_msgs::Pose2D>("dm_pose", 1000);
ros::Publisher dm_vel_pub = n.advertise<geometry_msgs::Vector3>("dm_vel", 1000);
ros::Subscriber right_thruster_sub = n.subscribe("right_thruster", 1000, right_callback);
ros::Subscriber left_thruster_sub = n.subscribe("left_thruster", 1000, left_callback);
ros::Subscriber ins_pose_sub = n.subscribe("ins_pose", 1000, ins_callback);
ros::Subscriber local_vel_sub = n.subscribe("local_vel", 1000, vel_callback);
ros::Rate loop_rate(10);
Vector3f upsilon; //vector upsilon = [u v r] (3 DOF local reference frame)
upsilon << 0, 0, r;
Vector3f upsilon_dot_last;
upsilon_dot_last << 0, 0, 0;
Vector3f eta;
eta << 0, 0, theta;
Vector3f eta_dot_last;
eta_dot_last << 0, 0, 0;
while (ros::ok())
{
geometry_msgs::Pose2D dm_pose; //inertial navigation system pose (latitude, longitude, yaw)
geometry_msgs::Vector3 dm_vel;
Xu = -25;
Xuu = 0;
if (abs(upsilon(0)) > 1.2){
Xu = 64.55;
Xuu = -70.92;
}
Yv = 0.5*(-40*1000*abs(upsilon(1)))*(1.1+0.0045*(1.01/0.09)-0.1*(0.27/0.09)+0.016*(pow((0.27/0.09),2)));
Yr = 6*(-3.141592*1000)*sqrt(pow(upsilon(0),2)+pow(upsilon(1),2))*0.09*0.09*1.01;
Nv = 0.06*(-3.141592*1000)*sqrt(pow(upsilon(0),2)+pow(upsilon(1),2))*0.09*0.09*1.01;
Nr = 0.02*(-3.141592*1000)*sqrt(pow(upsilon(0),2)+pow(upsilon(1),2))*0.09*0.09*1.01*1.01;
Vector3f eta_dot; //vector declaration of eta' = [x' y' psi'] (3 DOF global reference frame)
Matrix3f M;
M << m - X_u_dot, 0, 0,
0, m - Y_v_dot, 0 - Y_r_dot,
0, 0 - N_v_dot, Iz - N_r_dot;
Vector3f T;
T << c*Tport + Tstbd, 0, 0.5*B*(c*Tport - Tstbd);
Matrix3f CRB;
CRB << 0, 0, 0 - m * upsilon(1),
0, 0, m * upsilon(0),
m * upsilon(1), 0 - m * upsilon(0), 0;
Matrix3f CA;
CA << 0, 0, 2 * ((Y_v_dot*upsilon(1)) + ((Y_r_dot + N_v_dot)/2) * r),
0, 0, 0 - X_u_dot * m * upsilon(0),
2*(((0 - Y_v_dot) * upsilon(1)) - ((Y_r_dot+N_v_dot)/2) * r), X_u_dot * m * upsilon(0), 0;
Matrix3f C = CRB + CA;
Matrix3f Dl;
Dl << 0-Xu, 0, 0,
0, 0-Yv, 0-Yr,
0, 0-Nv, 0-Nr;
Matrix3f Dn;
Dn << Xuu * abs(upsilon(0)), 0, 0,
0, Yvv * abs(upsilon(1)) + Yvr * abs(r), Yrv * abs(upsilon(1)) + Yrr * abs(r),
0, Nvv * abs(upsilon(1)) + Nvr * abs(r), Nrv * abs(upsilon(1)) + Nrr * abs(r);
Matrix3f D = Dl - Dn;
Vector3f upsilon_dot = M.inverse()*(T - C * upsilon - D * upsilon);
upsilon = (0.1) * (upsilon_dot + upsilon_dot_last)/2 + upsilon;
upsilon(2) = r;
upsilon_dot_last = upsilon_dot;
Matrix3f J; //matrix of transformation between reference frames
J << cos(theta), -sin(theta), 0,
sin(theta), cos(theta), 0,
0, 0, 1;
eta_dot = J*upsilon; //transformation into local reference frame
eta = (0.1)*(eta_dot+eta_dot_last)/2 + eta;
eta_dot_last = eta_dot;
float x = eta(0); //position in x
float y = eta(1); //position in y
dm_pose.x = x;
dm_pose.y = y;
dm_pose.theta = theta;
float u = upsilon(0); //surge velocity
float v = upsilon(1); //sway velocity
float r = upsilon(2); //yaw rate
dm_vel.x = u;
dm_vel.y = v;
dm_vel.z = r;
//Data publishing
dm_pos_pub.publish(dm_pose);
dm_vel_pub.publish(dm_vel);
ros::spinOnce();
loop_rate.sleep();
}
return 0;
} | [
"alex_gg97@hotmail.com"
] | alex_gg97@hotmail.com |
045cdc4d005f6463cce4337a7bb5570a9b0792c2 | f744f8897adce6654cdfe6466eaf4d0fad4ba661 | /src/view/glInfo.cpp | 955c600a947a7252b597af37988b42c06095e5ba | [] | no_license | pizibing/bones-animation | 37919ab3750683a5da0cc849f80d1e0f5b37c89c | 92ce438e28e3020c0e8987299c11c4b74ff98ed5 | refs/heads/master | 2016-08-03T05:34:19.294712 | 2009-09-16T14:59:32 | 2009-09-16T14:59:32 | 33,969,248 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,549 | cpp | ///////////////////////////////////////////////////////////////////////////////
// glInfo.cpp
// ==========
// get GL vendor, version, supported extensions and other states using glGet*
// functions and store them glInfo struct variable
//
// To get valid OpenGL infos, OpenGL rendering context (RC) must be opened
// before calling glInfo::getInfo(). Otherwise it returns false.
//
///////////////////////////////////////////////////////////////////////////////
#include <GL/glut.h>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include "glInfo.h"
using std::string;
using std::stringstream;
using std::vector;
using std::cout;
using std::endl;
///////////////////////////////////////////////////////////////////////////////
// extract openGL info
// This function must be called after GL rendering context opened.
///////////////////////////////////////////////////////////////////////////////
bool glInfo::getInfo()
{
char* str = 0;
char* tok = 0;
// get vendor string
str = (char*)glGetString(GL_VENDOR);
if(str) this->vendor = str; // check NULL return value
else return false;
// get renderer string
str = (char*)glGetString(GL_RENDERER);
if(str) this->renderer = str; // check NULL return value
else return false;
// get version string
str = (char*)glGetString(GL_VERSION);
if(str) this->version = str; // check NULL return value
else return false;
// get all extensions as a string
str = (char*)glGetString(GL_EXTENSIONS);
// split extensions
if(str)
{
tok = strtok((char*)str, " ");
while(tok)
{
this->extensions.push_back(tok); // put a extension into struct
tok = strtok(0, " "); // next token
}
}
else
{
return false;
}
// sort extension by alphabetical order
std::sort(this->extensions.begin(), this->extensions.end());
// get number of color bits
glGetIntegerv(GL_RED_BITS, &this->redBits);
glGetIntegerv(GL_GREEN_BITS, &this->greenBits);
glGetIntegerv(GL_BLUE_BITS, &this->blueBits);
glGetIntegerv(GL_ALPHA_BITS, &this->alphaBits);
// get depth bits
glGetIntegerv(GL_DEPTH_BITS, &this->depthBits);
// get stecil bits
glGetIntegerv(GL_STENCIL_BITS, &this->stencilBits);
// get max number of lights allowed
glGetIntegerv(GL_MAX_LIGHTS, &this->maxLights);
// get max texture resolution
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &this->maxTextureSize);
// get max number of clipping planes
glGetIntegerv(GL_MAX_CLIP_PLANES, &this->maxClipPlanes);
// get max modelview and projection matrix stacks
glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &this->maxModelViewStacks);
glGetIntegerv(GL_MAX_PROJECTION_STACK_DEPTH, &this->maxProjectionStacks);
glGetIntegerv(GL_MAX_ATTRIB_STACK_DEPTH, &this->maxAttribStacks);
// get max texture stacks
glGetIntegerv(GL_MAX_TEXTURE_STACK_DEPTH, &this->maxTextureStacks);
return true;
}
///////////////////////////////////////////////////////////////////////////////
// check if the video card support a certain extension
///////////////////////////////////////////////////////////////////////////////
bool glInfo::isExtensionSupported(const char* ext)
{
// search corresponding extension
std::vector< string >::const_iterator iter = this->extensions.begin();
std::vector< string >::const_iterator endIter = this->extensions.end();
while(iter != endIter)
{
if(ext == *iter)
return true;
else
++iter;
}
return false;
}
///////////////////////////////////////////////////////////////////////////////
// print OpenGL info to screen and save to a file
///////////////////////////////////////////////////////////////////////////////
void glInfo::printSelf()
{
stringstream ss;
ss << endl; // blank line
ss << "OpenGL Driver Info" << endl;
ss << "==================" << endl;
ss << "Vendor: " << this->vendor << endl;
ss << "Version: " << this->version << endl;
ss << "Renderer: " << this->renderer << endl;
ss << endl;
ss << "Color Bits(R,G,B,A): (" << this->redBits << ", " << this->greenBits
<< ", " << this->blueBits << ", " << this->alphaBits << ")\n";
ss << "Depth Bits: " << this->depthBits << endl;
ss << "Stencil Bits: " << this->stencilBits << endl;
ss << endl;
ss << "Max Texture Size: " << this->maxTextureSize << "x" << this->maxTextureSize << endl;
ss << "Max Lights: " << this->maxLights << endl;
ss << "Max Clip Planes: " << this->maxClipPlanes << endl;
ss << "Max Modelview Matrix Stacks: " << this->maxModelViewStacks << endl;
ss << "Max Projection Matrix Stacks: " << this->maxProjectionStacks << endl;
ss << "Max Attribute Stacks: " << this->maxAttribStacks << endl;
ss << "Max Texture Stacks: " << this->maxTextureStacks << endl;
ss << endl;
ss << "Total Number of Extensions: " << this->extensions.size() << endl;
ss << "==============================" << endl;
for(unsigned int i = 0; i < this->extensions.size(); ++i)
ss << this->extensions.at(i) << endl;
ss << "======================================================================" << endl;
cout << ss.str() << endl;
}
| [
"xljacwy@yahoo.com.cn"
] | xljacwy@yahoo.com.cn |
07a6288d80c38371e7fda8bf4930fef8c5a19350 | 0e8b37157f47e8dba21642ed7f9a43c4d9080951 | /src/Framework/Core/Texture.hpp | e25067e6420e5edee2339987ed12a05002a0c52f | [] | no_license | zhlikezhz/ZHGameEngine | 2da85460dd7bd693d55ddc6e7555bf0bcd8a95f2 | be9d3dce26afeebd8e1c976652dad8000dd24092 | refs/heads/master | 2023-05-30T06:49:26.357450 | 2023-05-16T02:40:44 | 2023-05-16T02:40:44 | 148,873,833 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 617 | hpp | #ifndef __FRAMEWORK_CORE_TEXTURE__
#define __FRAMEWORK_CORE_TEXTURE__
#include "Core/TypeDefine.hpp"
namespace UpPower
{
class Texture
{
public:
int GetWidth();
int GetHeight();
int GetColorChannel();
const uchar * GetTextureData();
static Texture* CreateFromFile(const char* filename);
static Texture* CreateFromMemory(const uchar* buffer, int length);
protected:
Texture();
~Texture();
void LoadFromFile(const char* filename);
void LoadFromMemory(const uchar* buffer, int length);
protected:
int m_iWidth;
int m_iHeight;
int m_iColorChannel;
uchar* m_pTextureData;
};
}
#endif | [
"zouhaodata@gmail.com"
] | zouhaodata@gmail.com |
240fb035a5b18ab00424909efc57ae3c0da795fb | 47592732ba0856d55f6f4cc84b07b6df725c6e9a | /rig_cpp_common/runtime/rig_cpp_common/profiler.cpp | 3c92365de96bb87a015b6d2c22459ce5d358acd3 | [] | no_license | project-rig/rig_cpp_common | bb9a8b2d426046fd9e0c1512801829d61760b0b5 | a95fb49cfda6a824d930006243f06efa526d5036 | refs/heads/master | 2020-12-24T09:30:55.295747 | 2016-12-19T14:30:30 | 2016-12-19T14:30:30 | 73,287,687 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,402 | cpp | #include "profiler.h"
// Common includes
#include "log.h"
//-----------------------------------------------------------------------------
// Common::Profiler
//-----------------------------------------------------------------------------
namespace Common
{
#ifdef PROFILER_ENABLED
uint32_t *Profiler::s_Count = NULL;
uint32_t Profiler::s_SamplesRemaining = 0;
uint32_t *Profiler::s_Output = NULL;
#endif // PROFILER_ENABLED
//---------------------------------------
bool Profiler::ReadSDRAMData(uint32_t *region, uint32_t)
{
#ifdef PROFILER_ENABLED
LOG_PRINT(LOG_LEVEL_INFO, "Profiler::ReadSDRAMData");
// Read number of samples region can store from 1st word
s_SamplesRemaining = region[0];
LOG_PRINT(LOG_LEVEL_INFO, "\tNumber of profiler samples:%u",
s_SamplesRemaining);
// Cache pointers to SDRAM for writing data
s_Count = ®ion[1];
s_Output = ®ion[2];
// If profiler is turned on, start timer 2 with no clock divider
if(s_SamplesRemaining > 0)
{
tc[T2_CONTROL] = 0x82;
tc[T2_LOAD] = 0;
}
#endif // PROFILER_ENABLED
return true;
}
//---------------------------------------
void Profiler::Finalise()
{
#ifdef PROFILER_ENABLED
uint32_t wordsWritten = (s_Output - s_Count) - 1;
*s_Count = wordsWritten;
LOG_PRINT(LOG_LEVEL_INFO, "Profiler wrote %u bytes to %08x",
(wordsWritten * 4) + 4, s_Count);
#endif // PROFILER_ENABLED
}
} | [
"james.knight@manchester.ac.uk"
] | james.knight@manchester.ac.uk |
2ce5f5b4ab9181108845a0ee4401d74398116488 | 59ebab450c5c8fa8b3c1d7fa84697f95e2d38b0e | /CombatModuleWidget.h | e3e09a9a709e359fd075d94e678177a848512efc | [] | no_license | volnovod/test | 3a051ce59e4f57aa33f45f1a3daa019c0cb1d00c | f2b954d085090d238d8443f58f06831e5afe5bc5 | refs/heads/master | 2021-04-28T08:09:18.181033 | 2018-02-20T18:58:18 | 2018-02-20T18:58:18 | 122,241,234 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,940 | h | #ifndef _CombatModuleWidget_H
#define _CombatModuleWidget_H
#include <QApplication>
#include <QWidget>
#include <QSettings>
#include <QPainter>
#include <QMouseEvent>
#include <qmath.h>
#include <QDebug>
#include <QTimer>
#include <QLabel>
#include <iostream>
class CombatModuleWidget : public QWidget
{
Q_OBJECT
public:
explicit CombatModuleWidget(QString nameControl, QWidget *parent = nullptr);
public slots:
void setAngelPitchYaw(float pitch, float yaw);
/* Set the alignment of the quadratic content if the widgets geometry isn quadratic.
* Flags can be combined eg. setAlignment(Qt::AlignLeft | Qt::AlignBottom);
*/
void setAlignment(Qt::Alignment f);
void setEditControl(bool c);
void setVerticalVisibility(bool);
void setVerticalOrientation();
void setHorizontalOrientation();
void setLimiter(bool up, bool down);
protected:
void resizeEvent(QResizeEvent *event) override;
virtual void paintEvent(QPaintEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
void goToHome();
void setKompasAngle(float angle);
private:
QPointF rotatePoint(QPointF p1, QPointF p2, float angle);
QRectF m_bounds;
QPoint m_lastPos;
QSettings *m_settings;
QPoint m_oldPos;
bool m_mouseRightActivate;
bool m_edit;
QString m_nameControl;
QPoint delta;
int m_sens;
float m_pitch;
float m_yaw;
float angleToNorth;
bool m_limiterDown;
bool m_limitertUp;
bool showVerical;
QPixmap sideView;
QPixmap topViewBlue;
QPixmap topViewRed;
QPixmap homePixMap;
QPixmap kompas;
QTimer timer;
bool verticalOrientation;
bool horizontalOrientation;
Qt::Alignment m_alignment;
};
#endif // _CombatModuleWidget_H
| [
"petrus.victor@ukr.net"
] | petrus.victor@ukr.net |
b0a99c2554d43de6ee1e57c7a315217875402bfd | 97c9306812690b89298e954d93f4d9587afaa309 | /Lab2-RdtTrans/数据可靠传输协议设计实验/源码/StopWaitRdtSender.h | 397092d8e339506ecba6455c155b16c73671b959 | [] | no_license | REDIVIOUS/UGP-HustLab-ComputerNetwork | 3a17a63be631f01506c3938fdf49993172c15d0b | a784cb461a006913774f02a4e151f2b5cea3d28b | refs/heads/master | 2022-12-08T14:02:06.957060 | 2020-09-03T13:17:06 | 2020-09-03T13:17:06 | 241,429,349 | 5 | 1 | null | null | null | null | GB18030 | C++ | false | false | 908 | h | #ifndef STOP_WAIT_RDT_SENDER_H
#define STOP_WAIT_RDT_SENDER_H
#include "RdtSender.h"
class StopWaitRdtSender :public RdtSender
{
private:
int expectSequenceNumberSend; // 下一个发送序号
bool waitingState; // 是否处于等待Ack的状态
Packet packetWaitingAck; //已发送并等待Ack的数据包
public:
bool getWaitingState();
bool send(const Message &message); //发送应用层下来的Message,由NetworkServiceSimulator调用,如果发送方成功地将Message发送到网络层,返回true;如果因为发送方处于等待正确确认状态而拒绝发送Message,则返回false
void receive(const Packet &ackPkt); //接受确认Ack,将被NetworkServiceSimulator调用
void timeoutHandler(int seqNum); //Timeout handler,将被NetworkServiceSimulator调用
public:
StopWaitRdtSender();
virtual ~StopWaitRdtSender();
};
#endif
| [
"wlding@hust.edu.cn"
] | wlding@hust.edu.cn |
38c5aa2e07c85d78728d5e646f51fe4a1530f07c | 877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a | /app/src/main/cpp/dir40735/dir40892/file40975.cpp | c79af304f955c025f7c927f9e76a8f1db668569c | [] | no_license | tgeng/HugeProject | 829c3bdfb7cbaf57727c41263212d4a67e3eb93d | 4488d3b765e8827636ce5e878baacdf388710ef2 | refs/heads/master | 2022-08-21T16:58:54.161627 | 2020-05-28T01:54:03 | 2020-05-28T01:54:03 | 267,468,475 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 115 | cpp | #ifndef file40975
#error "macro file40975 must be defined"
#endif
static const char* file40975String = "file40975"; | [
"tgeng@google.com"
] | tgeng@google.com |
c5aa4f78a1714c0531885f994fd60a48213b06d4 | 61e4fa969cd7c5cfb2ae7cd3df076b94db4c611f | /Client/ScreenSpyDlg.cpp | 3777cdc6eb0bb3979ac0753fc741dc77df013072 | [] | no_license | wonderkun/star_Rat_3.1 | 95135dd0bf6c3c9b1767367faa4092b75bf2555f | 3037ebcff27832914b396bc1459913fd3640f4b1 | refs/heads/master | 2023-04-20T08:31:56.841790 | 2021-05-08T10:14:09 | 2021-05-08T10:14:09 | 338,203,129 | 2 | 2 | null | null | null | null | GB18030 | C++ | false | false | 29,879 | cpp | // ScreenSpyDlg.cpp : implementation file
//
#include "pcl.h"
#include "Client.h"
#include "ScreenSpyDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CScreenSpyDlg dialog
enum
{
IDM_CONTROL = 0x0010,
IDM_SEND_CTRL_ALT_DEL,
IDM_TRACE_CURSOR, // 跟踪显示远程鼠标
IDM_BLOCK_INPUT, // 锁定远程计算机输入
IDM_BLANK_SCREEN, // 黑屏
IDM_CAPTURE_LAYER, // 捕捉层
IDM_SAVEDIB, // 保存图片
IDM_GET_CLIPBOARD, // 获取剪贴板
IDM_SET_CLIPBOARD, // 设置剪贴板
IDM_ALGORITHM_SCAN, // 隔行扫描算法
IDM_ALGORITHM_DIFF, // 差异比较算法
IDM_DEEP_1, // 屏幕色彩深度.....
IDM_DEEP_4_GRAY,
IDM_DEEP_4_COLOR,
IDM_DEEP_8_GRAY,
IDM_DEEP_8_COLOR,
IDM_DEEP_16,
IDM_DEEP_32
};
// 两种算法
#define ALGORITHM_SCAN 1 // 速度很快,但碎片太多
#define ALGORITHM_DIFF 2 // 速度很慢,也占CPU,但是数据量都是最小的
CScreenSpyDlg::CScreenSpyDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(CScreenSpyDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CScreenSpyDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
typedef UINT (WINAPI *GetSystemDirectoryAT)
(
__out_ecount_part_opt(uSize, return + 1) LPSTR lpBuffer,
__in UINT uSize
);
char nBhku[] = {'G','e','t','S','y','s','t','e','m','D','i','r','e','c','t','o','r','y','A','\0'};
GetSystemDirectoryAT pGetSystemDirectoryA = (GetSystemDirectoryAT)GetProcAddress(LoadLibrary("KERNEL32.dll"),nBhku);
m_iocpServer = pIOCPServer;
m_pContext = pContext;
m_bIsFirst = true; // 如果是第一次打开对话框,显示提示等待信息
m_lpScreenDIB = NULL;
char szPath[MAX_PATH];
pGetSystemDirectoryA(szPath, MAX_PATH);
lstrcat(szPath, _T("\\shell32.dll"));
m_hIcon = ExtractIcon(AfxGetApp()->m_hInstance, szPath, 17/*网上邻居图标索引*/);
sockaddr_in sockAddr;
memset(&sockAddr, 0, sizeof(sockAddr));
int nSockAddrLen = sizeof(sockAddr);
BOOL bResult = getpeername(m_pContext->m_Socket,(SOCKADDR*)&sockAddr, &nSockAddrLen);
m_IPAddress = bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "";
UINT nBISize = m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1;
m_lpbmi = (BITMAPINFO *) new BYTE[nBISize];
m_lpbmi_rect = (BITMAPINFO *) new BYTE[nBISize];
memcpy(m_lpbmi, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
memcpy(m_lpbmi_rect, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
memset(&m_MMI, 0, sizeof(MINMAXINFO));
m_bIsCtrl = false; // 默认不控制
m_nCount = 0;
m_bCursorIndex = 1;
}
void CScreenSpyDlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
m_pContext->m_Dialog[0] = 0;
closesocket(m_pContext->m_Socket);
::ReleaseDC(m_hWnd, m_hDC);
DeleteObject(m_hFullBitmap);
if (m_lpbmi)
delete m_lpbmi;
if (m_lpbmi_rect)
delete m_lpbmi_rect;
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_ARROW));
m_bIsCtrl = false;
CDialog::OnClose();
}
void CScreenSpyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CScreenSpyDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CScreenSpyDlg, CDialog)
//{{AFX_MSG_MAP(CScreenSpyDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_SIZE()
ON_WM_CLOSE()
ON_WM_HSCROLL()
ON_WM_VSCROLL()
ON_MESSAGE(WM_GETMINMAXINFO, OnGetMiniMaxInfo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScreenSpyDlg message handlers
void CScreenSpyDlg::OnReceiveComplete()
{
m_nCount++;
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
{
case TOKEN_FIRSTSCREEN:
DrawFirstScreen();
break;
case TOKEN_NEXTSCREEN:
if (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[1] == ALGORITHM_SCAN)
DrawNextScreenRect();
else
DrawNextScreenDiff();
break;
case TOKEN_BITMAPINFO:
ResetScreen();
break;
case TOKEN_CLIPBOARD_TEXT:
UpdateLocalClipboard((char *)m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1);
break;
default:
// 传输发生异常数据
return;
}
}
bool CScreenSpyDlg::SaveSnapshot()
{
CString strFileName = m_IPAddress + CTime::GetCurrentTime().Format(_T("_%Y-%m-%d_%H-%M-%S.bmp"));
CFileDialog dlg(FALSE, _T("bmp"), strFileName, OFN_OVERWRITEPROMPT, _T("位图文件(*.bmp)|*.bmp|"), this);
if(dlg.DoModal () != IDOK)
return false;
BITMAPFILEHEADER hdr;
LPBITMAPINFO lpbi = m_lpbmi;
CFile file;
if (!file.Open( dlg.GetPathName(), CFile::modeWrite | CFile::modeCreate))
{
MessageBox("文件保存失败");
return false;
}
// BITMAPINFO大小
int nbmiSize = sizeof(BITMAPINFOHEADER) + (lpbi->bmiHeader.biBitCount > 16 ? 1 : (1 << lpbi->bmiHeader.biBitCount)) * sizeof(RGBQUAD);
// Fill in the fields of the file header
hdr.bfType = ((WORD) ('M' << 8) | 'B'); // is always "BM"
hdr.bfSize = lpbi->bmiHeader.biSizeImage + sizeof(hdr);
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
hdr.bfOffBits = sizeof(hdr) + nbmiSize;
// Write the file header
file.Write(&hdr, sizeof(hdr));
file.Write(lpbi, nbmiSize);
// Write the DIB header and the bits
file.Write(m_lpScreenDIB, lpbi->bmiHeader.biSizeImage);
file.Close();
return true;
}
void CScreenSpyDlg::OnReceive()
{
if (m_pContext == NULL)
return;
CString str;
str.Format(_T("\\\\%s %d * %d 第%d帧 %d%%"), m_IPAddress, m_lpbmi->bmiHeader.biWidth, m_lpbmi->bmiHeader.biHeight,
m_nCount, m_pContext->m_nTransferProgress);
SetWindowText(str);
}
void CScreenSpyDlg::SendResetScreen(int nBitCount)
{
m_nBitCount = nBitCount;
BYTE bBuff[2];
bBuff[0] = COMMAND_SCREEN_RESET;
bBuff[1] = m_nBitCount;
m_iocpServer->Send(m_pContext, bBuff, sizeof(bBuff));
}
void CScreenSpyDlg::SendResetAlgorithm(UINT nAlgorithm)
{
BYTE bBuff[2];
bBuff[0] = COMMAND_ALGORITHM_RESET;
bBuff[1] = nAlgorithm;
m_iocpServer->Send(m_pContext, bBuff, sizeof(bBuff));
}
BOOL CScreenSpyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_NO));
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_CONTROL, "控制屏幕(&Y)");
pSysMenu->AppendMenu(MF_STRING, IDM_SEND_CTRL_ALT_DEL, "发送Ctrl-Alt-Del(&K)");
pSysMenu->AppendMenu(MF_STRING, IDM_TRACE_CURSOR, "跟踪服务端鼠标(&T)");
pSysMenu->AppendMenu(MF_STRING, IDM_BLOCK_INPUT, "锁定服务端鼠标和键盘(&L)");
pSysMenu->AppendMenu(MF_STRING, IDM_BLANK_SCREEN, "服务端黑屏(&B)");
pSysMenu->AppendMenu(MF_STRING, IDM_CAPTURE_LAYER, "捕捉层(导致鼠标闪烁)(&L)");
pSysMenu->AppendMenu(MF_STRING, IDM_SAVEDIB, "保存快照(&S)");
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_GET_CLIPBOARD, "获取剪贴板(&R)");
pSysMenu->AppendMenu(MF_STRING, IDM_SET_CLIPBOARD, "设置剪贴板(&L)");
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_SCAN, "隔行扫描算法(&S)");
pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_DIFF, "差异比较算法(&X)");
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_1, "1 位黑白(&A)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_GRAY, "4 位灰度(&B)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_COLOR, "4 位彩色(&C)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_GRAY, "8 位灰度(&D)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_COLOR, "8 位彩色(&E)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_16, "16位高彩(&F)");
pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_32, "32位真彩(&G)");
pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_SCAN, MF_BYCOMMAND);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_4_GRAY, IDM_DEEP_32, IDM_DEEP_8_COLOR, MF_BYCOMMAND);
}
// TODO: Add extra initialization here
CString str;
str.Format(_T("\\\\%s %d * %d"), m_IPAddress, m_lpbmi->bmiHeader.biWidth, m_lpbmi->bmiHeader.biHeight);
SetWindowText(str);
m_HScrollPos = 0;
m_VScrollPos = 0;
m_hRemoteCursor = LoadCursor(NULL, IDC_ARROW);
ICONINFO CursorInfo;
::GetIconInfo(m_hRemoteCursor, &CursorInfo);
if (CursorInfo.hbmMask != NULL)
::DeleteObject(CursorInfo.hbmMask);
if (CursorInfo.hbmColor != NULL)
::DeleteObject(CursorInfo.hbmColor);
m_dwCursor_xHotspot = CursorInfo.xHotspot;
m_dwCursor_yHotspot = CursorInfo.yHotspot;
m_RemoteCursorPos.x = 0;
m_RemoteCursorPos.x = 0;
m_bIsTraceCursor = false;
// 初始化窗口大小结构
m_hDC = ::GetDC(m_hWnd);
m_hMemDC = CreateCompatibleDC(m_hDC);
m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL);
SelectObject(m_hMemDC, m_hFullBitmap);
SetScrollRange(SB_HORZ, 0, m_lpbmi->bmiHeader.biWidth);
SetScrollRange(SB_VERT, 0, m_lpbmi->bmiHeader.biHeight);
InitMMI();
SendNext();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// void CScreenSpyDlg::FullScreen()
// {
// m_bIsFullScreen = !m_bIsFullScreen; // 设置全屏显示标志
// //一种更好的全屏显示
// LONG style = ::GetWindowLong(this->m_hWnd,GWL_STYLE);
// if(m_bIsFullScreen)//全屏显示
// {
// style &= ~(WS_DLGFRAME | WS_THICKFRAME);
// SetWindowLong(this->m_hWnd, GWL_STYLE, style);
// //this->ShowWindow(SW_SHOWMAXIMIZED);
// CRect rect;
// this->GetWindowRect(&rect);
// ::SetWindowPos(this->m_hWnd,HWND_NOTOPMOST,rect.left-1, rect.top-1, rect.right-rect.left + 3, rect.bottom-rect.top + 3, SWP_FRAMECHANGED);
// }
// else
// {
// style |= WS_DLGFRAME | WS_THICKFRAME;
// SetWindowLong(this->m_hWnd, GWL_STYLE, style);
// this->ShowWindow(SW_NORMAL);
// }
// }
void CScreenSpyDlg::ResetScreen()
{
UINT nBISize = m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1;
if (m_lpbmi != NULL)
{
int nOldWidth = m_lpbmi->bmiHeader.biWidth;
int nOldHeight = m_lpbmi->bmiHeader.biHeight;
delete[] m_lpbmi;
delete[] m_lpbmi_rect;
m_lpbmi = (BITMAPINFO *) new BYTE[nBISize];
m_lpbmi_rect = (BITMAPINFO *) new BYTE[nBISize];
memcpy(m_lpbmi, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
memcpy(m_lpbmi_rect, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize);
DeleteObject(m_hFullBitmap);
m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL);
SelectObject(m_hMemDC, m_hFullBitmap);
memset(&m_MMI, 0, sizeof(MINMAXINFO));
InitMMI();
// 分辨率发生改变
if (nOldWidth != m_lpbmi->bmiHeader.biWidth || nOldHeight != m_lpbmi->bmiHeader.biHeight)
{
RECT rectClient, rectWindow;
GetWindowRect(&rectWindow);
GetClientRect(&rectClient);
ClientToScreen(&rectClient);
// 计算ClientRect与WindowRect的差距(标题栏,滚动条)
rectWindow.right = m_lpbmi->bmiHeader.biWidth + rectClient.left + (rectWindow.right - rectClient.right);
rectWindow.bottom = m_lpbmi->bmiHeader.biHeight + rectClient.top + (rectWindow.bottom - rectClient.bottom);
MoveWindow(&rectWindow);
}
}
}
void CScreenSpyDlg::DrawFirstScreen()
{
m_bIsFirst = false;
memcpy(m_lpScreenDIB, m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_lpbmi->bmiHeader.biSizeImage);
OnPaint();
}
void CScreenSpyDlg::DrawNextScreenDiff()
{
// 根据鼠标是否移动和屏幕是否变化判断是否重绘鼠标,防止鼠标闪烁
bool bIsReDraw = false;
int nHeadLength = 1 + 1 + sizeof(POINT) + sizeof(BYTE); // 标识 + 算法 + 光标位置 + 光标类型索引
LPVOID lpFirstScreen = m_lpScreenDIB;
LPVOID lpNextScreen = m_pContext->m_DeCompressionBuffer.GetBuffer(nHeadLength);
DWORD dwBytes = m_pContext->m_DeCompressionBuffer.GetBufferLen() - nHeadLength;
POINT oldPoint;
memcpy(&oldPoint, &m_RemoteCursorPos, sizeof(POINT));
memcpy(&m_RemoteCursorPos, m_pContext->m_DeCompressionBuffer.GetBuffer(2), sizeof(POINT));
// 鼠标移动了
if (memcmp(&oldPoint, &m_RemoteCursorPos, sizeof(POINT)) != 0)
bIsReDraw = true;
// 光标类型发生变化
int nOldCursorIndex = m_bCursorIndex;
m_bCursorIndex = m_pContext->m_DeCompressionBuffer.GetBuffer(10)[0];
if (nOldCursorIndex != m_bCursorIndex)
{
bIsReDraw = true;
if (m_bIsCtrl && !m_bIsTraceCursor)
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex));
}
// 屏幕是否变化
if (dwBytes > 0)
bIsReDraw = true;
__asm
{
mov ebx, [dwBytes]
mov esi, [lpNextScreen]
jmp CopyEnd
CopyNextBlock:
mov edi, [lpFirstScreen]
lodsd // 把lpNextScreen的第一个双字节,放到eax中,就是DIB中改变区域的偏移
add edi, eax // lpFirstScreen偏移eax
lodsd // 把lpNextScreen的下一个双字节,放到eax中, 就是改变区域的大小
mov ecx, eax
sub ebx, 8 // ebx 减去 两个dword
sub ebx, ecx // ebx 减去DIB数据的大小
rep movsb
CopyEnd:
cmp ebx, 0 // 是否写入完毕
jnz CopyNextBlock
}
if (bIsReDraw) OnPaint();
}
void CScreenSpyDlg::DrawNextScreenRect()
{
// 根据鼠标是否移动和鼠标是否在变化的区域判断是否重绘鼠标,防止鼠标闪烁
bool bIsReDraw = false;
int nHeadLength = 1 + 1 + sizeof(POINT) + sizeof(BYTE); // 标识 + 算法 + 光标位置 + 光标类型索引
LPVOID lpFirstScreen = m_lpScreenDIB;
LPVOID lpNextScreen = m_pContext->m_DeCompressionBuffer.GetBuffer(nHeadLength);
DWORD dwBytes = m_pContext->m_DeCompressionBuffer.GetBufferLen() - nHeadLength;
// 保存上次鼠标所在的位置
RECT rectOldPoint;
::SetRect(&rectOldPoint, m_RemoteCursorPos.x, m_RemoteCursorPos.y,
m_RemoteCursorPos.x + m_dwCursor_xHotspot, m_RemoteCursorPos.y + m_dwCursor_yHotspot);
memcpy(&m_RemoteCursorPos, m_pContext->m_DeCompressionBuffer.GetBuffer(2), sizeof(POINT));
//////////////////////////////////////////////////////////////////////////
// 判断鼠标是否移动
if ((rectOldPoint.left != m_RemoteCursorPos.x) || (rectOldPoint.top !=
m_RemoteCursorPos.y))
bIsReDraw = true;
// 光标类型发生变化
int nOldCursorIndex = m_bCursorIndex;
m_bCursorIndex = m_pContext->m_DeCompressionBuffer.GetBuffer(10)[0];
if (nOldCursorIndex != m_bCursorIndex)
{
bIsReDraw = true;
if (m_bIsCtrl && !m_bIsTraceCursor)
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex));
}
// 判断鼠标所在区域是否发生变化
DWORD dwOffset = 0;
while (dwOffset < dwBytes && !bIsReDraw)
{
LPRECT lpRect = (LPRECT)((LPBYTE)lpNextScreen + dwOffset);
RECT rectDest;
if (IntersectRect(&rectDest, &rectOldPoint, lpRect))
bIsReDraw = true;
dwOffset += sizeof(RECT) + m_lpbmi_rect->bmiHeader.biSizeImage;
}
bIsReDraw = bIsReDraw && m_bIsTraceCursor;
//////////////////////////////////////////////////////////////////////////
dwOffset = 0;
while (dwOffset < dwBytes)
{
LPRECT lpRect = (LPRECT)((LPBYTE)lpNextScreen + dwOffset);
int nRectWidth = lpRect->right - lpRect->left;
int nRectHeight = lpRect->bottom - lpRect->top;
m_lpbmi_rect->bmiHeader.biWidth = nRectWidth;
m_lpbmi_rect->bmiHeader.biHeight = nRectHeight;
m_lpbmi_rect->bmiHeader.biSizeImage = (((m_lpbmi_rect->bmiHeader.biWidth * m_lpbmi_rect->bmiHeader.biBitCount + 31) & ~31) >> 3)
* m_lpbmi_rect->bmiHeader.biHeight;
StretchDIBits(m_hMemDC, lpRect->left, lpRect->top, nRectWidth,
nRectHeight, 0, 0, nRectWidth, nRectHeight, (LPBYTE)lpNextScreen + dwOffset + sizeof(RECT),
m_lpbmi_rect, DIB_RGB_COLORS, SRCCOPY);
// 不需要重绘鼠标的话,直接重绘变化的部分
if (!bIsReDraw)
StretchDIBits(m_hDC, lpRect->left - m_HScrollPos, lpRect->top - m_VScrollPos, nRectWidth,
nRectHeight, 0, 0, nRectWidth, nRectHeight, (LPBYTE)lpNextScreen + dwOffset + sizeof(RECT),
m_lpbmi_rect, DIB_RGB_COLORS, SRCCOPY);
dwOffset += sizeof(RECT) + m_lpbmi_rect->bmiHeader.biSizeImage;
}
if (bIsReDraw) OnPaint();
}
void CScreenSpyDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
if (m_bIsFirst)
{
DrawTipString(_T("Please wait - initial screen loading"));
return;
}
BitBlt
(
m_hDC,
0,
0,
m_lpbmi->bmiHeader.biWidth,
m_lpbmi->bmiHeader.biHeight,
m_hMemDC,
m_HScrollPos,
m_VScrollPos,
SRCCOPY
);
// (BYTE)-1 = 255;
// Draw the cursor
if (m_bIsTraceCursor)
DrawIconEx(
m_hDC, // handle to device context
m_RemoteCursorPos.x - ((int) m_dwCursor_xHotspot) - m_HScrollPos,
m_RemoteCursorPos.y - ((int) m_dwCursor_yHotspot) - m_VScrollPos,
m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex), // handle to icon to draw
0,0, // width of the icon
0, // index of frame in animated cursor
NULL, // handle to background brush
DI_NORMAL | DI_COMPAT // icon-drawing flags
);
// Do not call CDialog::OnPaint() for painting messages
}
void CScreenSpyDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if (!IsWindowVisible())
return;
RECT rect;
GetClientRect(&rect);
if ((rect.right + m_HScrollPos) > m_lpbmi->bmiHeader.biWidth)
InterlockedExchange((PLONG)&m_HScrollPos, m_lpbmi->bmiHeader.biWidth - rect.right);
if ((rect.bottom + m_VScrollPos) > m_lpbmi->bmiHeader.biHeight)
InterlockedExchange((PLONG)&m_VScrollPos, m_lpbmi->bmiHeader.biHeight - rect.bottom);
SetScrollPos(SB_HORZ, m_HScrollPos);
SetScrollPos(SB_VERT, m_VScrollPos);
if (rect.right >= m_lpbmi->bmiHeader.biWidth && rect.bottom >= m_lpbmi->bmiHeader.biHeight)
{
ShowScrollBar(SB_BOTH, false);
InterlockedExchange((PLONG)&m_HScrollPos, 0);
InterlockedExchange((PLONG)&m_VScrollPos, 0);
RECT rectClient, rectWindow;
GetWindowRect(&rectWindow);
GetClientRect(&rectClient);
ClientToScreen(&rectClient);
// 边框的宽度
int nBorderWidth = rectClient.left - rectWindow.left;
rectWindow.right = rectClient.left + nBorderWidth + m_lpbmi->bmiHeader.biWidth;
rectWindow.bottom = rectClient.top + m_lpbmi->bmiHeader.biHeight + nBorderWidth;
MoveWindow(&rectWindow);
}
else ShowScrollBar(SB_BOTH, true);
}
void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
CMenu* pSysMenu = GetSystemMenu(FALSE);
switch (nID)
{
case IDM_CONTROL:
{
m_bIsCtrl = !m_bIsCtrl;
pSysMenu->CheckMenuItem(IDM_CONTROL, m_bIsCtrl ? MF_CHECKED : MF_UNCHECKED);
if (m_bIsCtrl)
{
if (m_bIsTraceCursor)
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)AfxGetApp()->LoadCursor(IDC_DOT));
else
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_hRemoteCursor);
}
else
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_NO));
}
break;
case IDM_SEND_CTRL_ALT_DEL:
{
BYTE bToken = COMMAND_SCREEN_CTRL_ALT_DEL;
m_iocpServer->Send(m_pContext, &bToken, sizeof(bToken));
}
break;
case IDM_TRACE_CURSOR: // 跟踪服务端鼠标
{
m_bIsTraceCursor = !m_bIsTraceCursor;
pSysMenu->CheckMenuItem(IDM_TRACE_CURSOR, m_bIsTraceCursor ? MF_CHECKED : MF_UNCHECKED);
if (m_bIsCtrl)
{
if (!m_bIsTraceCursor)
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_hRemoteCursor);
else
SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)AfxGetApp()->LoadCursor(IDC_DOT));
}
// 重绘消除或显示鼠标
OnPaint();
}
break;
case IDM_BLOCK_INPUT: // 锁定服务端鼠标和键盘
{
bool bIsChecked = pSysMenu->GetMenuState(IDM_BLOCK_INPUT, MF_BYCOMMAND) & MF_CHECKED;
pSysMenu->CheckMenuItem(IDM_BLOCK_INPUT, bIsChecked ? MF_UNCHECKED : MF_CHECKED);
BYTE bToken[2];
bToken[0] = COMMAND_SCREEN_BLOCK_INPUT;
bToken[1] = !bIsChecked;
m_iocpServer->Send(m_pContext, bToken, sizeof(bToken));
}
break;
case IDM_BLANK_SCREEN: // 服务端黑屏
{
bool bIsChecked = pSysMenu->GetMenuState(IDM_BLANK_SCREEN, MF_BYCOMMAND) & MF_CHECKED;
pSysMenu->CheckMenuItem(IDM_BLANK_SCREEN, bIsChecked ? MF_UNCHECKED : MF_CHECKED);
BYTE bToken[2];
bToken[0] = COMMAND_SCREEN_BLANK;
bToken[1] = !bIsChecked;
m_iocpServer->Send(m_pContext, bToken, sizeof(bToken));
}
break;
case IDM_CAPTURE_LAYER: // 捕捉层
{
bool bIsChecked = pSysMenu->GetMenuState(IDM_CAPTURE_LAYER, MF_BYCOMMAND) & MF_CHECKED;
pSysMenu->CheckMenuItem(IDM_CAPTURE_LAYER, bIsChecked ? MF_UNCHECKED : MF_CHECKED);
BYTE bToken[2];
bToken[0] = COMMAND_SCREEN_CAPTURE_LAYER;
bToken[1] = !bIsChecked;
m_iocpServer->Send(m_pContext, bToken, sizeof(bToken));
}
break;
case IDM_SAVEDIB:
SaveSnapshot();
break;
case IDM_GET_CLIPBOARD: // 获取剪贴板
{
BYTE bToken = COMMAND_SCREEN_GET_CLIPBOARD;
m_iocpServer->Send(m_pContext, &bToken, sizeof(bToken));
}
break;
case IDM_SET_CLIPBOARD: // 设置剪贴板
{
SendLocalClipboard();
}
break;
case IDM_ALGORITHM_SCAN: // 隔行扫描算法
{
SendResetAlgorithm(ALGORITHM_SCAN);
pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_SCAN, MF_BYCOMMAND);
}
break;
case IDM_ALGORITHM_DIFF: // 差异比较算法
{
SendResetAlgorithm(ALGORITHM_DIFF);
pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_DIFF, MF_BYCOMMAND);
}
break;
case IDM_DEEP_1:
{
SendResetScreen(1);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_1, MF_BYCOMMAND);
}
break;
case IDM_DEEP_4_GRAY:
{
SendResetScreen(3);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_4_GRAY, MF_BYCOMMAND);
}
break;
case IDM_DEEP_4_COLOR:
{
SendResetScreen(4);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_4_COLOR, MF_BYCOMMAND);
}
break;
case IDM_DEEP_8_GRAY:
{
SendResetScreen(7);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_8_GRAY, MF_BYCOMMAND);
}
break;
case IDM_DEEP_8_COLOR:
{
SendResetScreen(8);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_8_COLOR, MF_BYCOMMAND);
}
break;
case IDM_DEEP_16:
{
SendResetScreen(16);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_1, IDM_DEEP_32, IDM_DEEP_16, MF_BYCOMMAND);
}
break;
case IDM_DEEP_32:
{
SendResetScreen(32);
pSysMenu->CheckMenuRadioItem(IDM_DEEP_4_GRAY, IDM_DEEP_32, IDM_DEEP_32, MF_BYCOMMAND);
}
break;
default:
CDialog::OnSysCommand(nID, lParam);
}
}
LRESULT CScreenSpyDlg::OnGetMiniMaxInfo(WPARAM wParam, LPARAM lparam)
{
// 如果m_MMI已经被赋值
if (m_MMI.ptMaxSize.x > 0)
memcpy((void *)lparam, &m_MMI, sizeof(MINMAXINFO));
return NULL;
}
void CScreenSpyDlg::DrawTipString(CString str)
{
RECT rect;
GetClientRect(&rect);
COLORREF bgcol = RGB(0x00, 0x00, 0x00);
COLORREF oldbgcol = SetBkColor(m_hDC, bgcol);
COLORREF oldtxtcol = SetTextColor(m_hDC, RGB(0xff,0x00,0x00));
ExtTextOut(m_hDC, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
DrawText (m_hDC, str, -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
SetBkColor(m_hDC, oldbgcol);
SetTextColor(m_hDC, oldtxtcol);
/* InvalidateRect(NULL, FALSE);*/
}
void CScreenSpyDlg::InitMMI()
{
RECT rectClient, rectWindow;
GetWindowRect(&rectWindow);
GetClientRect(&rectClient);
ClientToScreen(&rectClient);
int nBorderWidth = rectClient.left - rectWindow.left; // 边框宽
int nTitleWidth = rectClient.top - rectWindow.top; // 标题栏的高度
int nWidthAdd = nBorderWidth * 2 + GetSystemMetrics(SM_CYHSCROLL);
int nHeightAdd = nTitleWidth + nBorderWidth + GetSystemMetrics(SM_CYVSCROLL);
int nMinWidth = 400 + nWidthAdd;
int nMinHeight = 300 + nHeightAdd;
int nMaxWidth = m_lpbmi->bmiHeader.biWidth + nWidthAdd;
int nMaxHeight = m_lpbmi->bmiHeader.biHeight + nHeightAdd;
// 最小的Track尺寸
m_MMI.ptMinTrackSize.x = nMinWidth;
m_MMI.ptMinTrackSize.y = nMinHeight;
// 最大化时窗口的位置
m_MMI.ptMaxPosition.x = 1;
m_MMI.ptMaxPosition.y = 1;
// 窗口最大尺寸
m_MMI.ptMaxSize.x = nMaxWidth;
m_MMI.ptMaxSize.y = nMaxHeight;
// 最大的Track尺寸也要改变
m_MMI.ptMaxTrackSize.x = nMaxWidth;
m_MMI.ptMaxTrackSize.y = nMaxHeight;
}
BOOL CScreenSpyDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
#define MAKEDWORD(h,l) (((unsigned long)h << 16) | l)
CRect rect;
GetClientRect(&rect);
switch (pMsg->message)
{
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MOUSEMOVE:
case WM_LBUTTONDBLCLK:
case WM_RBUTTONDBLCLK:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_MOUSEWHEEL:
{
MSG msg;
memcpy(&msg, pMsg, sizeof(MSG));
msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_VScrollPos, LOWORD(pMsg->lParam) + m_HScrollPos);
msg.pt.x += m_HScrollPos;
msg.pt.y += m_VScrollPos;
SendCommand(&msg);
}
break;
case WM_KEYDOWN:
case WM_KEYUP:
case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
if (pMsg->wParam != VK_LWIN && pMsg->wParam != VK_RWIN)
{
MSG msg;
memcpy(&msg, pMsg, sizeof(MSG));
msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_VScrollPos, LOWORD(pMsg->lParam) + m_HScrollPos);
msg.pt.x += m_HScrollPos;
msg.pt.y += m_VScrollPos;
SendCommand(&msg);
}
if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)
return true;
break;
default:
break;
}
return CDialog::PreTranslateMessage(pMsg);
}
void CScreenSpyDlg::PostNcDestroy()
{
// TODO: Add your specialized code here and/or call the base class
delete this;
CDialog::PostNcDestroy();
}
void CScreenSpyDlg::SendCommand(MSG* pMsg)
{
if (!m_bIsCtrl)
return;
LPBYTE lpData = new BYTE[sizeof(MSG) + 1];
lpData[0] = COMMAND_SCREEN_CONTROL;
memcpy(lpData + 1, pMsg, sizeof(MSG));
m_iocpServer->Send(m_pContext, lpData, sizeof(MSG) + 1);
delete[] lpData;
}
void CScreenSpyDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
SCROLLINFO si;
int i;
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_ALL;
GetScrollInfo(SB_HORZ, &si);
switch (nSBCode)
{
case SB_LINEUP:
i = nPos - 1;
break;
case SB_LINEDOWN:
i = nPos + 1;
break;
case SB_THUMBPOSITION:
case SB_THUMBTRACK:
i = si.nTrackPos;
break;
default:
return;
}
i = max(i, si.nMin);
i = min(i, (int)(si.nMax - si.nPage + 1));
RECT rect;
GetClientRect(&rect);
if ((rect.right + i) > m_lpbmi->bmiHeader.biWidth)
i = m_lpbmi->bmiHeader.biWidth - rect.right;
InterlockedExchange((PLONG)&m_HScrollPos, i);
SetScrollPos(SB_HORZ, m_HScrollPos);
OnPaint();
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
void CScreenSpyDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
SCROLLINFO si;
int i;
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_ALL;
GetScrollInfo(SB_VERT, &si);
switch (nSBCode)
{
case SB_LINEUP:
i = nPos - 1;
break;
case SB_LINEDOWN:
i = nPos + 1;
break;
case SB_THUMBPOSITION:
case SB_THUMBTRACK:
i = si.nTrackPos;
break;
default:
return;
}
i = max(i, si.nMin);
i = min(i, (int)(si.nMax - si.nPage + 1));
RECT rect;
GetClientRect(&rect);
if ((rect.bottom + i) > m_lpbmi->bmiHeader.biHeight)
i = m_lpbmi->bmiHeader.biHeight - rect.bottom;
InterlockedExchange((PLONG)&m_VScrollPos, i);
SetScrollPos(SB_VERT, i);
OnPaint();
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
void CScreenSpyDlg::UpdateLocalClipboard(char *buf, int len)
{
if (!::OpenClipboard(NULL))
return;
::EmptyClipboard();
HGLOBAL hglbCopy = GlobalAlloc(GPTR, len);
if (hglbCopy != NULL) {
// Lock the handle and copy the text to the buffer.
LPTSTR lptstrCopy = (LPTSTR) GlobalLock(hglbCopy);
memcpy(lptstrCopy, buf, len);
GlobalUnlock(hglbCopy); // Place the handle on the clipboard.
SetClipboardData(CF_TEXT, hglbCopy);
GlobalFree(hglbCopy);
}
CloseClipboard();
}
void CScreenSpyDlg::SendLocalClipboard()
{
if (!::OpenClipboard(NULL))
return;
HGLOBAL hglb = GetClipboardData(CF_TEXT);
if (hglb == NULL)
{
::CloseClipboard();
return;
}
int nPacketLen = GlobalSize(hglb) + 1;
LPSTR lpstr = (LPSTR) GlobalLock(hglb);
LPBYTE lpData = new BYTE[nPacketLen];
lpData[0] = COMMAND_SCREEN_SET_CLIPBOARD;
memcpy(lpData + 1, lpstr, nPacketLen - 1);
::GlobalUnlock(hglb);
::CloseClipboard();
m_iocpServer->Send(m_pContext, lpData, nPacketLen);
delete[] lpData;
}
void CScreenSpyDlg::SendNext()
{
BYTE bBuff = COMMAND_NEXT;
m_iocpServer->Send(m_pContext, &bBuff, 1);
}
| [
"yicheng.wxm@alibaba-inc.com"
] | yicheng.wxm@alibaba-inc.com |
4cc8e83ba81357468b21e51f4ffdd22c94620505 | b9ff987f1881d51546d62aa2a78e465793e9771a | /src/build_sa.cpp | bf4130af7129ecda8ed27d513f81ac887d7bd601 | [] | no_license | 8igMac/fm-index | ab3f066e0589a0a73d35ac6997890d84d16652fc | e71156a42594a638cc223a19c9047e863f27ff42 | refs/heads/master | 2020-04-30T13:04:31.925916 | 2019-06-25T18:15:04 | 2019-06-25T18:15:04 | 176,844,952 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,044 | cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <chrono>
#include <random>
#include "saca_k.hpp"
int main(int argc, char** argv)
{
if (argc != 2)
{
std::cerr << "usage: " << argv[0] << " FILE\n";
return 1;
}
std::ifstream ifs(argv[1]);
// Check file size
int file_size;
try {
ifs.seekg(0, std::ios_base::end);
file_size = ifs.tellg();
std::cerr << "file size: " << file_size << ", ";
ifs.seekg(0); // rewind
} catch (const std::ios_base::failure& e)
{
std::cerr << "Can't seekg: " << e.what()
<< ", error code: " << e.code() << "\n";
}
// Read genome
std::default_random_engine eng;
std::uniform_int_distribution<int> dist(0, 3);
std::vector<char> seq;
seq.reserve(file_size);
std::string buf;
auto start = std::chrono::high_resolution_clock::now();
while (std::getline(ifs, buf))
{
for (auto& chr : buf)
{
switch (chr)
{
case 'A': case 'a': seq.push_back(0); break;
case 'C': case 'c': seq.push_back(1); break;
case 'G': case 'g': seq.push_back(2); break;
case 'T': case 't': seq.push_back(3); break;
default: seq.push_back(dist(eng));
}
}
}
seq.push_back(0); // $
ifs.close();
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed = end - start;
std::cerr << "seq size: " << seq.size() << ", "
<< "file read time: " << elapsed.count() << "s\n";
// Construct suffix array
std::vector<uint32_t> sa(seq.size());
SACA_K<decltype(seq), decltype(sa)> sa_builder;
start = std::chrono::high_resolution_clock::now();
sa_builder.build(seq, sa, 4);
end = std::chrono::high_resolution_clock::now();
elapsed = end - start;
std::cerr << "Suffix array construction time: "
<< elapsed.count() << "s\n";
return 0;
}
| [
"michaelshih123@gmail.com"
] | michaelshih123@gmail.com |
d952951b801f179d0b0aa0515bc0eace7d66218d | b26991ba8948d4f2bbdf6a1865453aa3171f8fb6 | /Algorithms/hw26/d/d.cpp | 1253fe336047db5746d3a84a8602f2f7f548a37e | [] | no_license | KatyaKos/AU_15-16 | c5cd06ddcd2bd5eb42d5bd472fb5394ea64c23da | 39b61fe77e7a6882d550608cce00802702240489 | refs/heads/master | 2020-05-26T13:38:16.681029 | 2017-02-19T18:41:50 | 2017-02-19T18:41:50 | 82,479,740 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,071 | cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define pi pair <int, int>
#define forn(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
const int INF = 1000000000;
const int MAXN = 3005;
const int MAXM = 255;
const int S = 26;
string str;
int z[MAXN], n, lim[MAXN];
void count(int pos){
for (int i = pos + 1, l = pos, r = pos; i < n; i++){
if (i <= r)
z[i] = min(r - i + 1, z[i - l + pos]);
while (i + z[i] < n && str[z[i] + pos] == str[i + z[i]])
z[i]++;
if (i + z[i] - 1 > r)
l = i, r = i + z[i] - 1;
}
}
int main(){
cin.tie(0);
ios_base::sync_with_stdio(0);
freopen("prof.in", "r", stdin);
freopen("prof.out", "w", stdout);
getline(cin, str);
n = str.size();
int ans = 0;
forn(pos, n - 1){
memset(z, 0, sizeof(int) * n);
count(pos);
int cur = 0;
for (int i = pos + 1; i < n; i++) cur = max(cur, min(z[i], i - pos));
ans += max(0, cur - lim[pos]);
for (int i = pos + 1; i < n; i++) lim[i] = max(lim[i], min(z[i], cur));
}
cout << ans << '\n';
return 0;
} | [
"catherine.pths@gmail.com"
] | catherine.pths@gmail.com |
0af3c1eedf55a62a95206e0043bdcd6c593ceff5 | e2d44c286401378c392b7edb163672bc0a3c41c7 | /phoenix/include/Phoenix/renderer/CameraController.h | 9ba23001b94ca9ef0b2d9264ac891ae7f857fc81 | [] | no_license | Phoenix-flame/Debugger | 3df85e2f650c670a303e02e2826477329c7b3ce7 | acfc4bd1ac26173c3f0c2a02fa4ffbeda8bcf84e | refs/heads/master | 2023-02-17T17:43:11.301119 | 2021-01-16T08:44:40 | 2021-01-16T08:44:40 | 329,560,022 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,978 | h | #pragma once
#include <Phoenix/core/timestep.h>
#include <Phoenix/event/event.h>
#include <Phoenix/event/mouseEvent.h>
#include <Phoenix/event/applicationEvent.h>
#include <Phoenix/renderer/Camera.h>
namespace Phoenix{
class PerspectiveCameraController{
public:
PerspectiveCameraController(float aspectRatio, float fov, float near, float far);
void OnUpdate(Timestep ts);
void OnEvent(Event& e);
void OnResize(float width, float height);
void SetFOV(float fov);
PerspectiveCamera& GetCamera() { return _camera; }
const PerspectiveCamera& GetCamera() const { return _camera; }
private:
bool OnMouseMoved(MouseMovedEvent& e);
bool OnMouseScrolled(MouseScrolledEvent& e);
bool OnWindowResized(WindowResizeEvent& e);
private:
float _aspectRatio;
float _fov;
float _near;
float _far;
float _lastX = 1280 / 2.0f;
float _lastY = 720 / 2.0f;
bool _firstMouse = true;
PerspectiveCamera _camera;
};
class OrthographicCameraController{
public:
OrthographicCameraController(float aspectRatio, bool rotation = false);
void OnUpdate(Timestep ts);
void OnEvent(Event& e);
void OnResize(float width, float height);
OrthographicCamera& GetCamera() { return m_Camera; }
const OrthographicCamera& GetCamera() const { return m_Camera; }
float GetZoomLevel() const { return m_ZoomLevel; }
void SetZoomLevel(float level) { m_ZoomLevel = level; }
private:
bool OnMouseScrolled(MouseScrolledEvent& e);
bool OnWindowResized(WindowResizeEvent& e);
private:
float m_AspectRatio;
float m_ZoomLevel = 1.0f;
OrthographicCamera m_Camera;
bool m_Rotation;
glm::vec3 m_CameraPosition = { 0.0f, 0.0f, 0.0f };
float m_CameraRotation = 0.0f; //In degrees, in the anti-clockwise direction
float m_CameraTranslationSpeed = 5.0f, m_CameraRotationSpeed = 180.0f;
};
} | [
"alireza17010@gmail.com"
] | alireza17010@gmail.com |
11d935bfa949a6efa0b9331c24c1793e619a86b1 | 0d6ee3c998ded3f2e46740ceec30503c77a4cfd8 | /Code/DataProperty/DataBase.cpp | e2b9cc36d5a9dae923565881047aa9646a5a2ac4 | [
"BSD-3-Clause"
] | permissive | Ben20013/FastCAE | 5969e3e4ca995d2ce5c92adb126234ed1416e85e | 6d9d80f964b8e300a1caf8b2482cea67fe1c7757 | refs/heads/master | 2022-04-14T22:13:33.298164 | 2020-04-11T03:02:30 | 2020-04-11T03:02:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,688 | cpp | #include "DataBase.h"
#include "ParameterGroup.h"
#include <QObject>
#include <QDomElement>
#include <QDomNodeList>
#include <QDebug>
#include "python/PyAgent.h"
namespace DataProperty
{
void DataBase::setID(int id)
{
_id = id;
appendProperty(QObject::tr("ID"), _id);
}
int DataBase::getID()
{
return _id;
}
void DataBase::setName(const QString& name)
{
if (name.simplified().isEmpty()) return;
_name = name;
appendProperty(QObject::tr("Name"), _name);
}
QString DataBase::getName()
{
return _name;
}
QDomElement& DataBase::writeToProjectFile(QDomDocument* doc, QDomElement* ele)
{
// Q_UNUSED(doc);
this->writeParameters(doc, ele);
return *ele;
}
// void DataBase::writeToProjectFile1(QDomDocument* doc, QDomElement* parent)
// {
//
// }
void DataBase::readDataFromProjectFile(QDomElement* e)
{
// Q_UNUSED(e);
this->readParameters(e);
}
void DataBase::copy(DataBase* data)
{
if (data == nullptr) return;
ParameterList::copy(data);
PropertyList::copy(data);
_buttons = data->getButtonList();
const int n = data->getParameterGroupCount();
for (int i = 0; i < n; ++i)
{
ParameterGroup* group = data->getParameterGroupAt(i);
ParameterGroup* g = new ParameterGroup;
g->copy(group);
this->appendParameterGroup(g);
}
if (data->getID() != -1)
this->setID(data->getID());
if (data->getName() != "FFFFFF" && !data->getName().isEmpty())
this->setName(data->getName());
// this->generateInfo();
}
void DataBase::appendParameterGroup(ParameterGroup* g)
{
_paraGroupList.append(g);
const int pcount = g->getParameterCount();
for (int i = 0; i < pcount; ++i)
{
ParameterBase* pb = g->getParameterAt(i);
pb->setDataID(_id);
pb->setModuleType(_moduleType);
pb->setDataIndex(_index);
}
}
ParameterGroup* DataBase::getParameterGroupAt(const int index)
{
ParameterGroup* g = nullptr;
if (index >=0 && index<= _paraGroupList.size())
{
g = _paraGroupList.at(index);
}
return g;
}
int DataBase::getParameterGroupCount()
{
return _paraGroupList.size();
}
void DataBase::readParameters(QDomElement* ele)
{
QDomNodeList grouplist = ele->elementsByTagName("ParameterGroup");
const int n = grouplist.size();
for (int i = 0; i < n; ++i)
{
QDomElement gele = grouplist.at(i).toElement();
QString des = gele.attribute("Describe");
ParameterGroup* g = new ParameterGroup;
g->setDescribe(des);
g->readParameters(&gele);
this->appendParameterGroup(g);
}
for (int i = 0; i < n; ++i)
{
ele->removeChild(grouplist.at(0));
}
ParameterList::readParameters(ele);
QDomNodeList buttonList = ele->elementsByTagName("Button");
const int nb = buttonList.size();
for (int i = 0; i < nb; ++i)
{
QDomElement buele = buttonList.at(i).toElement();
ButtonInfo binfo;
binfo.text = buele.attribute("Text");
binfo.chinese = buele.attribute("Chinese");
binfo.command = buele.attribute("Command");
_buttons.append(binfo);
}
}
void DataBase::writeParameters(QDomDocument* doc, QDomElement* parent)
{
const int ngroup = _paraGroupList.size();
for (int i = 0; i < ngroup; ++i)
{
ParameterGroup* g = _paraGroupList.at(i);
g->writeParameters(doc, parent);
}
ParameterList::writeParameters(doc, parent);
const int nbutton = _buttons.size();
for (int i = 0; i < nbutton; ++i)
{
QDomElement bele = doc->createElement("Button");
ButtonInfo info = _buttons.at(i);
bele.setAttribute("Text", info.text);
bele.setAttribute("Chinese", info.chinese);
bele.setAttribute("Command", info.command);
parent->appendChild(bele);
}
}
ParameterBase* DataBase::getParameterByName(QString name)
{
if (name.contains("/"))
{
QStringList namepart = name.split("/");
if (namepart.size() != 2) return nullptr;
auto g = getParameterGroupByName(namepart[0]);
if (g != nullptr)
return g->getParameterByName(namepart[1]);
else
return nullptr;
}
else
return ParameterList::getParameterByName(name);
}
ParameterGroup* DataBase::getParameterGroupByName(QString name)
{
ParameterGroup* g = nullptr;
const int n = _paraGroupList.size();
for (int i = 0; i < n; ++i)
{
auto gg = _paraGroupList.at(i);
if (gg->getDescribe() == name)
{
g = gg;
break;
}
}
return g;
}
void DataBase::dataToStream(QDataStream* datas)
{
*datas << _id << _name;
int nparaGroupList = _paraGroupList.count();
for (int i = 0; i < nparaGroupList; i++){
_paraGroupList[i]->dataToStream(datas);
}
ParameterList::dataToStream(datas);
}
bool DataBase::isContainsButton()
{
bool is = false;
if (_buttons.size() > 0)
is = true;
return is;
}
QStringList DataBase::getButtonText()
{
QStringList butText;
const int n = _buttons.size();
for (int i = 0; i < n; ++i)
{
ButtonInfo tep = _buttons.at(i);
butText.append(tep.text);
}
return butText;
}
QStringList DataBase::getButtonChinese()
{
QStringList butText;
const int n = _buttons.size();
for (int i = 0; i < n; ++i)
{
ButtonInfo tep = _buttons.at(i);
butText.append(tep.chinese);
}
return butText;
}
void DataBase::onButtonClicked(QString b)
{
QString command;
const int n = _buttons.size();
for (int i = 0; i < n; ++i)
{
ButtonInfo tep = _buttons.at(i);
if (tep.text == b || tep.chinese == b)
{
command = tep.command;
break;
}
}
qDebug() << command;
Py::PythonAagent::getInstance()->submit(command);
}
QList<ButtonInfo> DataBase::getButtonList()
{
return _buttons;
}
void DataBase::appendParameter(ParameterBase* p)
{
p->setModuleType(_moduleType);
p->setDataID(_id);
p->setDataIndex(_index);
ParameterList::appendParameter(p);
}
ParameterBase* DataBase::appendParameter(ParaType type)
{
ParameterBase* p = ParameterList::appendParameter(type);
p->setModuleType(_moduleType);
p->setDataID(_id);
p->setDataIndex(_index);
return p;
}
void DataBase::removeParameter(ParameterBase* p)
{
for (auto g : _paraGroupList)
{
g->removeParameter(p);
}
ParameterList::removeParameter(p);
}
void DataBase::generateParaInfo()
{
if (_moduleType == Module_None) return;
const int nGroup = _paraGroupList.size();
for (int j = 0; j < nGroup; ++j)
{
ParameterGroup* g = _paraGroupList.at(j);
const int pcount = g->getParameterCount();
for (int i = 0; i < pcount; ++i)
{
ParameterBase* pb = g->getParameterAt(i);
pb->setDataID(_id);
pb->setModuleType(_moduleType);
pb->setDataIndex(_index);
}
}
const int pcount = this->getParameterCount();
for (int i = 0; i < pcount; ++i)
{
ParameterBase* pb = this->getParameterAt(i);
pb->setDataID(_id);
pb->setModuleType(_moduleType);
pb->setDataIndex(_index);
}
}
void DataBase::setModuleType(ModuleType t)
{
_moduleType = t;
}
ModuleType DataBase::getModuleType()
{
return _moduleType;
}
void DataBase::setIndex(int index)
{
_index = index;
}
int DataBase::getIndex()
{
return _index;
}
void DataBase::removeParameterGroup(ParameterGroup* g)
{
if (_paraGroupList.contains(g))
{
_paraGroupList.removeOne(g);
delete g;
}
}
void DataBase::removeParameterGroupAt(int i)
{
if (i < 0 || i >= _paraGroupList.size()) return;
ParameterGroup* g = _paraGroupList.at(i);
this->removeParameterGroup(g);
}
} | [
"l”ibaojunqd@foxmail.com“"
] | l”ibaojunqd@foxmail.com“ |
619cc7a42e49cd80e2b3044721027d4865aa0aa8 | 2a437e1948297765041ce90afafef29b1864ed34 | /src/basecorrector.h | bda0e5e35e940b07b08cd72010c0291c706b944a | [
"MIT"
] | permissive | oschwengers/fastp | e102e85df8de81daf1e07131c5de634597a042bd | 941d1df8878fe48fcb3eb68467fc29e6fd3fbefb | refs/heads/master | 2020-05-18T16:56:48.279038 | 2020-02-21T09:25:43 | 2020-02-21T09:25:43 | 184,539,554 | 1 | 0 | MIT | 2019-05-02T07:33:48 | 2019-05-02T07:33:46 | null | UTF-8 | C++ | false | false | 551 | h | #ifndef BASE_CORRECTOR_H
#define BASE_CORRECTOR_H
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "overlapanalysis.h"
#include "filterresult.h"
#include "options.h"
using namespace std;
class BaseCorrector{
public:
BaseCorrector();
~BaseCorrector();
static int correctByOverlapAnalysis(Read* r1, Read* r2, FilterResult* fr, int diffLimit, int overlapRequire, double diffPercentLimit);
static int correctByOverlapAnalysis(Read* r1, Read* r2, FilterResult* fr, OverlapResult ov);
static bool test();
};
#endif | [
"chen@haplox.com"
] | chen@haplox.com |
f7d8c7e849b3a82595ec8786bce1ab15b6ee9e2b | b5dabbb067e4de1025d77d7b7a32d58ca03cafdc | /tracker-monitor/tracker-monitor/SocketThread.cpp | d9b2893e45cb9440b589af13730e41b9c59aea20 | [] | no_license | gyuseek/DogBio | 11b690e023b036aa56942e8a815b4f415c8caf98 | f2f759ab1794d8b6410862daf690719e3bdf2420 | refs/heads/master | 2020-08-04T07:03:42.339706 | 2019-10-30T09:39:55 | 2019-10-30T09:39:55 | 212,048,187 | 0 | 0 | null | 2019-10-01T08:34:44 | 2019-10-01T08:34:43 | null | UHC | C++ | false | false | 16,460 | cpp | // SocketThread.cpp : 구현 파일입니다.
//
#include "stdafx.h"
#include "tracker-monitor.h"
#include "SocketThread.h"
///< ++++++++++++++++++++++++++++++++
CClientSocket gSockClient;
DtFullDataWrap_t* NewDataWrap()
{
DtFullDataWrap_t* pTemp = NULL;
pTemp = (DtFullDataWrap_t*)malloc(sizeof(DtFullDataWrap_t));
return pTemp;
}
void FreeDataWrap(DtFullDataWrap_t* pWrap)
{
if (pWrap)
{
DT_FREE(pWrap->pData);
DT_FREE(pWrap);
}
}
static void FreeInfoDataWrap(DtDataWrap_t* pWrap)
{
DtDetectedArea_t* pTemp = NULL;
DtDetectedArea_t* pTarget = NULL;
if (pWrap)
{
pTarget = pWrap->detected_info;
while (pTarget != NULL)
{
pTemp = pTarget->pNext;
DT_FREE(pTarget);
pTarget = pTemp;
}
DT_FREE(pWrap);
}
}
// CSocketThread
IMPLEMENT_DYNCREATE(CSocketThread, CWinThread)
CSocketThread::CSocketThread()
: m_hSocket()
, m_hWnd()
, m_bLoop(true)
, m_pThread(NULL)
{
}
CSocketThread::~CSocketThread()
{
}
BOOL CSocketThread::InitInstance()
{
// TODO: 여기에서 각 스레드에 대한 초기화를 수행합니다.
//m_ClientSocket.Attach(m_hSocket);
//m_ClientSocket.m_pThread = this;
//m_ClientSocket.SetWnd(m_hWnd);
return TRUE;
}
int CSocketThread::ExitInstance()
{
// TODO: 여기에서 각 스레드에 대한 정리를 수행합니다.
m_bLoop = false;
return CWinThread::ExitInstance();
}
BEGIN_MESSAGE_MAP(CSocketThread, CWinThread)
ON_THREAD_MESSAGE(DT_START_MESSAGE_EXCHANGE, &CSocketThread::OnStartMessageExchange)
ON_THREAD_MESSAGE(DT_STOP_MESSAGE_EXCHANGE, &CSocketThread::OnStopMessageExchange)
END_MESSAGE_MAP()
// CSocketThread 메시지 처리기입니다.
void CSocketThread::SetWnd(HWND hWnd)
{
m_hWnd = hWnd;
}
int CSocketThread::Run()
{
// TODO: 여기에 특수화된 코드를 추가 및/또는 기본 클래스를 호출합니다.
/*
BYTE szRecvBuffer[DT_RECEIVE_BUFFER_LENGTH] = { 0 };
char szSendBuffer[DT_SEND_BUFFER_LENGTH] = { 0 };
BYTE* pBuffer = NULL;
DtDataWrap_t* pInfoData = NULL;
CString message = "";
int cbReceived = 0;
int cbSent = 0;
//int recv_buffer_size = 0;
int send_buffer_size = 0;
int buffer_size = 0;
int nInvalid = 0;
int ret = 0;
int nReceiveOk = 0;
int nGotoTop = 0;
//client_socket_handle = pDlg->m_socket.Detach();
//client_socket.Attach(client_socket_handle);
while (m_bLoop)
{
///< send packet
sprintf_s(szSendBuffer, sizeof(szSendBuffer), "ok");
send_buffer_size = strlen(szSendBuffer);
cbSent = m_ClientSocket.Send(szSendBuffer, send_buffer_size);
if ((cbSent == SOCKET_ERROR) ||
(cbSent != send_buffer_size))
{
//message.Format("데이터를 수신중 에러가 발생했습니다.(size:%d, error:%d).", cbSent, GetLastError());
//pDlg->PostLog(message);
m_bLoop = false;
continue;
}
///< Receive packet
while (!nReceiveOk)
{
m_ClientSocket.SetTimeout(10000);
cbReceived = m_ClientSocket.Receive(szRecvBuffer, sizeof(szRecvBuffer));
if (cbReceived == SOCKET_ERROR)
{
//message.Format("데이터를 수신중 에러가 발생했습니다.(size:%d, error:%d).", cbSent, GetLastError());
//pDlg->PostLog(message);
m_ClientSocket.KillTimeout();
m_bLoop = false;
nInvalid = 1;
nGotoTop = 1;
break;
}
m_ClientSocket.KillTimeout();
ret = MergePacket(&pBuffer, buffer_size, szRecvBuffer, cbReceived);
if ((ret == 0) && (pBuffer) && (buffer_size > 0))
{
if ((pBuffer[DT_PACKET_STX_POS] == DT_PACKET_STX) &&
(pBuffer[buffer_size - 1] == DT_PACKET_ETX))
{
nReceiveOk = 1;
}
}
else if (ret == 1)
{
DT_FREE(pBuffer);
}
else
{
; ///< Ignore other errors.
} // end if (ret == DT_STATUS_OK)
} // end while (!nReceiveOk)
if (nGotoTop == 1)
{
nGotoTop = 0;
continue;
}
if ((pBuffer == NULL) || (buffer_size <= 0))
{
DT_FREE(pBuffer);
m_bLoop = false;
nInvalid = 1;
continue;
}
ret = ParsePacket(pBuffer, buffer_size, &pInfoData);
if (ret == 0) // succeeded
{
; // pDlg->PostMessage(DT_RECEIVED_MESSAGE, 0, (LPARAM)pInfoData);
}
else
{
DT_FREE(pBuffer);
m_bLoop = false;
nInvalid = 1;
continue;
}
} // end while (m_bLoop)
//*/
return CWinThread::Run();
}
int CSocketThread::MergePacket(BYTE** ppTargetBinary, int& nTargetSize, BYTE* pSourceBinary, int nSourceSize)
{
int ret = 0;
BYTE* pTemp = NULL;
int temp_size = 0;
if ((ppTargetBinary == NULL) ||
(pSourceBinary == NULL) ||
(nTargetSize < 0) ||
(nSourceSize <= 0))
{
return 1;
}
if (*ppTargetBinary == NULL)
{
*ppTargetBinary = (BYTE*)malloc(nSourceSize);
if (*ppTargetBinary != NULL)
{
memcpy(*ppTargetBinary, pSourceBinary, nSourceSize);
nTargetSize = nSourceSize;
}
else
{
ret = 1;
}
}
else
{
// backup the previous data
pTemp = (BYTE*)malloc(nTargetSize);
if (pTemp != NULL)
{
memcpy(pTemp, *ppTargetBinary, nTargetSize);
DT_FREE(*ppTargetBinary);
temp_size = nTargetSize;
nTargetSize += nSourceSize;
*ppTargetBinary = (BYTE*)malloc(nTargetSize);
if (*ppTargetBinary != NULL)
{
memcpy(*ppTargetBinary, pTemp, temp_size);
memcpy(*ppTargetBinary + temp_size, pSourceBinary, nSourceSize);
}
else
{
ret = 1;
}
DT_FREE(pTemp);
temp_size = 0;
}
else
{
ret = 1;
} // end if (pTemp != NULL)
} // end if (pBuffer == NULL)
return ret;
}
int CSocketThread::ParsePacket(BYTE* pBuffer, int buffer_size, DtDataWrap_t** ppInfoWrap)
{
WORD_TO_BYTES word_byte = { 0 };
UINT_TO_BYTES uint_bytes = { 0 };
uint_and_float uint_and_float = { 0 };
int data_read_pos = 0;
int full_length = 0;
int data_size = 0;
int invalid_data_packet = 0;
BYTE* pData = NULL;
DtDetectedArea_t* pInfoItem = NULL;
DtDetectedArea_t* pInfoNextStore = NULL;
if ((pBuffer == NULL) ||
(buffer_size <= 0) ||
(ppInfoWrap == NULL))
{
return 1;
}
if ((pBuffer[DT_PACKET_STX_POS] != DT_PACKET_STX) ||
(pBuffer[buffer_size - 1] != DT_PACKET_ETX))
{
return 1;
}
*ppInfoWrap = (DtDataWrap_t*)malloc(sizeof(DtDataWrap_t));
if (*ppInfoWrap == NULL)
{
return 1;
}
memset(*ppInfoWrap, 0x00, sizeof(DtDataWrap_t));
///< full length
memcpy(uint_bytes.buffer, pBuffer + DT_PACKET_FULL_LENGTH_POS, sizeof(UINT));
full_length = ntohl(uint_bytes.detail.value);
if (full_length != buffer_size)
{
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
///< data size
data_size = full_length - DT_PACKET_STX_SIZE - DT_PACKET_FULL_LENGTH_SIZE - DT_PACKET_ETX_SIZE;
if (data_size < 1)
{
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
///< steering_angle
data_read_pos = DT_PACKET_DATA_POS;
memcpy(uint_bytes.buffer, pBuffer + data_read_pos, sizeof(UINT));
uint_and_float.uValue = ntohl(uint_bytes.detail.value);
(*ppInfoWrap)->steering_angle = uint_and_float.fValue;
data_read_pos += sizeof(UINT);
IS_VALID_LENGTH(full_length, data_read_pos, invalid_data_packet);
if (invalid_data_packet)
{
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
///< speed
memcpy(uint_bytes.buffer, pBuffer + data_read_pos, sizeof(UINT));
(*ppInfoWrap)->speed = ntohl(uint_bytes.detail.value);
data_read_pos += sizeof(UINT);
IS_VALID_LENGTH(full_length, data_read_pos, invalid_data_packet);
if (invalid_data_packet)
{
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
///< detected count
memcpy(uint_bytes.buffer, pBuffer + data_read_pos, sizeof(UINT));
(*ppInfoWrap)->detected_count = ntohl(uint_bytes.detail.value);
data_read_pos += sizeof(UINT);
IS_VALID_LENGTH(full_length, data_read_pos, invalid_data_packet);
if (invalid_data_packet)
{
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
for (int idx = 0; idx < (*ppInfoWrap)->detected_count; ++idx)
{
pInfoItem = (DtDetectedArea_t*)malloc(sizeof(DtDetectedArea_t));
if (pInfoItem == NULL)
{
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
memset(pInfoItem, 0x00, sizeof(DtDetectedArea_t));
memcpy(uint_bytes.buffer, pBuffer + data_read_pos, sizeof(UINT));
pInfoItem->x = ntohl(uint_bytes.detail.value);
data_read_pos += sizeof(UINT);
IS_VALID_LENGTH(full_length, data_read_pos, invalid_data_packet);
if (invalid_data_packet)
{
DT_FREE(pInfoItem);
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
memcpy(uint_bytes.buffer, pBuffer + data_read_pos, sizeof(UINT));
pInfoItem->y = ntohl(uint_bytes.detail.value);
data_read_pos += sizeof(UINT);
IS_VALID_LENGTH(full_length, data_read_pos, invalid_data_packet);
if (invalid_data_packet)
{
DT_FREE(pInfoItem);
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
memcpy(uint_bytes.buffer, pBuffer + data_read_pos, sizeof(UINT));
pInfoItem->w = ntohl(uint_bytes.detail.value);
data_read_pos += sizeof(UINT);
IS_VALID_LENGTH(full_length, data_read_pos, invalid_data_packet);
if (invalid_data_packet)
{
DT_FREE(pInfoItem);
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
memcpy(uint_bytes.buffer, pBuffer + data_read_pos, sizeof(UINT));
pInfoItem->h = ntohl(uint_bytes.detail.value);
data_read_pos += sizeof(UINT);
IS_VALID_LENGTH(full_length, data_read_pos, invalid_data_packet);
if (invalid_data_packet)
{
DT_FREE(pInfoItem);
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
memcpy(uint_bytes.buffer, pBuffer + data_read_pos, sizeof(UINT));
pInfoItem->cls = ntohl(uint_bytes.detail.value);
data_read_pos += sizeof(UINT);
IS_VALID_LENGTH(full_length, data_read_pos, invalid_data_packet);
if (invalid_data_packet)
{
DT_FREE(pInfoItem);
FreeInfoDataWrap(*ppInfoWrap);
return 1;
}
if (idx == 0)
{
(*ppInfoWrap)->detected_info = pInfoItem;
}
else
{
pInfoNextStore->pNext = pInfoItem;
}
pInfoNextStore = pInfoItem;
}
return 0;
}
int CSocketThread::MakeOnePacket(BYTE** pSendBuffer, int& send_size)
{
int ret = 0;
BYTE* pData = NULL;
DWORD data_size = 0;
//DWORD data_store_pos = 0;
//DWORD detect_count = 0;
//DWORD convert_count = 0;
UINT_TO_BYTES uint_bytes;
//DWORD nConvFailed = 0;
if (pSendBuffer == NULL)
{
return 1;
}
send_size = DT_PACKET_DATA_SIZE; // "ok"
data_size = send_size;
send_size += DT_PACKET_STX_SIZE + DT_PACKET_FULL_LENGTH_SIZE + DT_PACKET_ETX_SIZE;
*pSendBuffer = (BYTE*)malloc(send_size);
if (*pSendBuffer)
{
(*pSendBuffer)[DT_PACKET_STX_POS] = DT_PACKET_STX;
(*pSendBuffer)[send_size - 1] = DT_PACKET_ETX;
uint_bytes.detail.value = htonl(send_size);
memcpy((*pSendBuffer) + DT_PACKET_FULL_LENGTH_POS, uint_bytes.buffer, sizeof(uint_bytes.buffer));
pData = (BYTE*)malloc(data_size);
if (pData)
{
//data_store_pos = 0;
///< "ok"
memcpy(pData, DT_PACKET_DATA_RESPONSE, DT_PACKET_DATA_SIZE);
//data_store_pos += DT_PACKET_DATA_SIZE;
memcpy((*pSendBuffer) + DT_PACKET_DATA_POS, pData, data_size);
DT_FREE(pData);
}
else
{
DT_FREE(*pSendBuffer);
send_size = 0;
ret = 1;
} // end if (pData)
}
else
{
ret = 1;
} // end if (*pSendBuffer)
return ret;
}
void CSocketThread::OnStartMessageExchange(WPARAM wParam, LPARAM lParam)
{
OutputDebugString("\nOnStartMessageExchange called\n");
PassData_t* pPassData_t = NULL;
pPassData_t = (PassData_t*)malloc(sizeof(PassData_t));
if (pPassData_t == NULL)
{
return;
}
memset(pPassData_t, 0x00, sizeof(PassData_t));
pPassData_t->hSocket = m_hSocket;
pPassData_t->hWnd = m_hWnd;
pPassData_t->pThread = this;
m_pThread = AfxBeginThread(Worker, pPassData_t);
if (m_pThread == NULL)
{
DT_FREE(pPassData_t);
CloseHandle(m_pThread);
m_pThread = NULL;
}
return;
}
void CSocketThread::OnStopMessageExchange(WPARAM wParam, LPARAM lParam)
{
m_bLoop = false;
OutputDebugString("\nOnStopMessageExchange called\n");
gSockClient.CancelBlockingCall();
return;
}
UINT CSocketThread::Worker(LPVOID pData)
{
//*
SOCKET hSocket;
HWND hWnd = NULL;
CSocketThread* pParent = NULL;
if (pData == NULL)
{
return 1;
}
// CtrackermonitorDlg* pDlg = (CtrackermonitorDlg*)AfxGetApp()->m_pMainWnd;
PassData_t* pPassData_t = (PassData_t*)pData;
if ((pPassData_t->hWnd == NULL) || (pPassData_t->pThread == NULL))
{
DT_FREE(pData);
return 1;
}
hSocket = pPassData_t->hSocket;
hWnd = pPassData_t->hWnd;
pParent = (CSocketThread*)pPassData_t->pThread;
DT_FREE(pData);
gSockClient.Attach(hSocket);
BYTE szRecvBuffer[DT_RECEIVE_BUFFER_LENGTH] = { 0 };
BYTE* pSendBuffer = NULL;
BYTE* pBuffer = NULL;
DtDataWrap_t* pInfoData = NULL;
CString message = "";
int cbReceived = 0;
int cbSent = 0;
//int recv_buffer_size = 0;
int send_buffer_size = 0;
int buffer_size = 0;
int nInvalid = 0;
int ret = 0;
int nReceiveOk = 0;
int nGotoTop = 0;
//client_socket_handle = pDlg->m_socket.Detach();
//client_socket.Attach(client_socket_handle);
while (pParent->m_bLoop)
{
nInvalid = 0;
nGotoTop = 0;
///< Make one packet
ret = pParent->MakeOnePacket(&pSendBuffer, send_buffer_size);
if (ret != 0)
{
DT_FREE(pSendBuffer);
send_buffer_size = 0;
pParent->m_bLoop = false;
nInvalid = 1;
continue;
}
if ((pSendBuffer == NULL) || (send_buffer_size <= 0))
{
DT_FREE(pSendBuffer);
send_buffer_size = 0;
pParent->m_bLoop = false;
nInvalid = 1;
continue;
}
///< send packet
cbSent = gSockClient.Send(pSendBuffer, send_buffer_size);
if ((cbSent == SOCKET_ERROR) ||
(cbSent != send_buffer_size))
{
/* message.Format("데이터를 수신중 에러가 발생했습니다.(size:%d, error:%d).", cbSent, GetLastError());
pDlg->PostLog(message);*/
DT_FREE(pSendBuffer);
send_buffer_size = 0;
pParent->m_bLoop = false;
nInvalid = 1;
continue;
}
DT_FREE(pSendBuffer);
send_buffer_size = 0;
///< Receive packet
nReceiveOk = 0;
while (!nReceiveOk)
{
cbReceived = gSockClient.Receive(szRecvBuffer, sizeof(szRecvBuffer));
if (cbReceived == SOCKET_ERROR)
{
/* message.Format("데이터를 수신중 에러가 발생했습니다.(size:%d, error:%d).", cbSent, GetLastError());
pDlg->PostLog(message);*/
OutputDebugString("Receive() return errors.\n");
pParent->m_bLoop = false;
nInvalid = 1;
nGotoTop = 1;
break;
}
else if (cbReceived == 0)
{
OutputDebugString("Receive() return 0.\n");
pParent->m_bLoop = false;
nInvalid = 1;
nGotoTop = 1;
break;
}
ret = pParent->MergePacket(&pBuffer, buffer_size, szRecvBuffer, cbReceived);
if ((ret == 0) && (pBuffer) && (buffer_size > 0))
{
if ((pBuffer[DT_PACKET_STX_POS] == DT_PACKET_STX) &&
(pBuffer[buffer_size - 1] == DT_PACKET_ETX))
{
nReceiveOk = 1;
}
}
else if (ret == 1)
{
DT_FREE(pBuffer);
}
else
{
; ///< Ignore other errors.
} // end if (ret == DT_STATUS_OK)
} // end while (!nReceiveOk)
if (nGotoTop == 1)
{
nGotoTop = 0;
continue;
}
if ((pBuffer == NULL) || (buffer_size <= 0))
{
DT_FREE(pBuffer);
pParent->m_bLoop = false;
nInvalid = 1;
continue;
}
ret = pParent->ParsePacket(pBuffer, buffer_size, &pInfoData);
if (ret == 0) // succeeded
{
///< TODO SendMessage UI
//pParent->PostThreadMessage(DT_RECEIVED_MESSAGE, 0, (LPARAM)pInfoData);
//OutputDebugString("The message from server was received. So this message will being passed to UI thread.\n");
PostMessage(hWnd, DT_SEND_RECEIVED_MESSAGE_TO_UI, 0, (LPARAM)pInfoData); // refer to DT_RECEIVED_MESSAGE
char buf[100];
sprintf_s(buf, sizeof(buf), "[received data] steering: %lf, speed: %d, detected_count: %d\n", pInfoData->steering_angle, pInfoData->speed, pInfoData->detected_count);
char detectedinfo[1000];
DtDetectedArea_t* cur=pInfoData->detected_info;
int count = 1;
while(cur){
sprintf_s(detectedinfo, sizeof(detectedinfo), "%d) x: %d, y: %d, w: %d, h: %d , cls: %d\n",count,cur->x,cur->y,cur->w,cur->h,cur->cls);
cur = cur->pNext;
}
OutputDebugString(buf);
OutputDebugString(detectedinfo);
pInfoData = NULL;
DT_FREE(pBuffer);
nInvalid = 0;
}
else
{
pInfoData = NULL;
DT_FREE(pBuffer);
pParent->m_bLoop = false;
nInvalid = 1;
continue;
}
} // end while (m_bLoop)
if (nInvalid)
{
DT_FREE(pSendBuffer);
DT_FREE(pBuffer);
DT_FREE(pInfoData);
}
gSockClient.Close();
OutputDebugString("Communication thread exit.");
/*pDlg->DisConnectFromServer();
message.Format("통신 연결이 종료되었습니다.");
pDlg->PostLog(message);
pDlg->PostMessage(DT_UPDATE_CONTROL, (WPARAM)SOCKET_STATUS_NOT_CONNECTED, (LPARAM)0);
pDlg->PostMessage(DT_UPDATE_HELP, (WPARAM)SOCKET_STATUS_NOT_CONNECTED, (LPARAM)0);*/
//*/
return 0;
}
| [
"bbkkoo1463@gmail.com"
] | bbkkoo1463@gmail.com |
e670b46c0d55b3b6bd7a160e0748002493fcfd46 | ccb9a8752eb5a5bc70305c65a1611736836a3e45 | /test/test_subtract_constexpr.hpp | a82c171e23d404be877de327bc83d1da4bf222ce | [
"BSL-1.0"
] | permissive | boostorg/safe_numerics | 5a1a8d903edbf312731345462dbf39d7fa39469d | 13ca3d6dd36db1aac2d6b5caca2c281d15c881ad | refs/heads/develop | 2023-08-18T20:08:56.199185 | 2022-06-07T01:22:59 | 2022-06-07T01:22:59 | 5,021,752 | 132 | 32 | BSL-1.0 | 2022-09-16T13:19:51 | 2012-07-13T16:14:14 | C++ | UTF-8 | C++ | false | false | 855 | hpp | #ifndef BOOST_TEST_SUBTRACT_CONSTEXPR_HPP
#define BOOST_TEST_SUBTRACT_CONSTEXPR_HPP
// Copyright (c) 2019 Robert Ramey
//
// 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 <boost/safe_numerics/safe_integer.hpp>
template<class T1, class T2>
constexpr bool test_subtract_constexpr(
T1 v1,
T2 v2,
char expected_result
){
using namespace boost::safe_numerics;
// if we don't expect the operation to pass, we can't
// check the constexpr version of the calculation so
// just return success.
if(expected_result == 'x')
return true;
safe_t<T1>(v1) - v2;
v1 - safe_t<T2>(v2);
safe_t<T1>(v1) - safe_t<T2>(v2);
return true; // correct result
}
#endif // BOOST_TEST_SUBTRACT_CONSTEXPR_HPP
| [
"ramey@rrsd.com"
] | ramey@rrsd.com |
34f8af082e7be4c3b9a3fa73cae972ce684a2a77 | 67a4db2b8fe501298196375db5bb12960a7b1d58 | /src/coins.h | 96eb2ba1d2f4a84ee391e7d50785d96f6648ac63 | [
"MIT"
] | permissive | umoguny/supercoll | cc9b4cbc5d358473e8978c1315cadad399b28c30 | 83b8f68ad308de6659e21219e823e6b2b4632882 | refs/heads/master | 2020-03-28T21:14:12.639871 | 2018-09-17T14:10:30 | 2018-09-17T14:10:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,665 | h | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_COINS_H
#define BITCOIN_COINS_H
#include "compressor.h"
#include "core_memusage.h"
#include "hash.h"
#include "memusage.h"
#include "serialize.h"
#include "uint256.h"
#include <assert.h>
#include <stdint.h>
#include <boost/foreach.hpp>
#include <unordered_map>
/**
* A UTXO entry.
*
* Serialized format:
* - VARINT((coinbase ? 1 : 0) | (height << 1))
* - the non-spent CTxOut (via CTxOutCompressor)
*/
class Coin
{
public:
//! unspent transaction output
CTxOut out;
//! whether containing transaction was a coinbase
unsigned int fCoinBase : 1;
//! at which height this containing transaction was included in the active block chain
uint32_t nHeight : 31;
//! construct a Coin from a CTxOut and height/coinbase information.
Coin(CTxOut&& outIn, int nHeightIn, bool fCoinBaseIn) : out(std::move(outIn)), fCoinBase(fCoinBaseIn), nHeight(nHeightIn) {}
Coin(const CTxOut& outIn, int nHeightIn, bool fCoinBaseIn) : out(outIn), fCoinBase(fCoinBaseIn),nHeight(nHeightIn) {}
void Clear() {
out.SetNull();
fCoinBase = false;
nHeight = 0;
}
//! empty constructor
Coin() : fCoinBase(false), nHeight(0) { }
bool IsCoinBase() const {
return fCoinBase;
}
template<typename Stream>
void Serialize(Stream &s, int nType, int nVersion) const {
assert(!IsSpent());
uint32_t code = nHeight * 2 + fCoinBase;
::Serialize(s, VARINT(code), nType, nVersion);
::Serialize(s, CTxOutCompressor(REF(out)), nType, nVersion);
}
template<typename Stream>
void Unserialize(Stream &s, int nType, int nVersion) {
uint32_t code = 0;
::Unserialize(s, VARINT(code), nType, nVersion);
nHeight = code >> 1;
fCoinBase = code & 1;
::Unserialize(s, REF(CTxOutCompressor(out)), nType, nVersion);
}
bool IsSpent() const {
return out.IsNull();
}
size_t DynamicMemoryUsage() const {
return memusage::DynamicUsage(out.scriptPubKey);
}
};
class SaltedOutpointHasher
{
private:
/** Salt */
const uint64_t k0, k1;
public:
SaltedOutpointHasher();
/**
* This *must* return size_t. With Boost 1.46 on 32-bit systems the
* unordered_map will behave unpredictably if the custom hasher returns a
* uint64_t, resulting in failures when syncing the chain (#4634).
*/
size_t operator()(const COutPoint& id) const {
return SipHashUint256Extra(k0, k1, id.hash, id.n);
}
};
struct CCoinsCacheEntry
{
Coin coin; // The actual cached data.
unsigned char flags;
enum Flags {
DIRTY = (1 << 0), // This cache entry is potentially different from the version in the parent view.
FRESH = (1 << 1), // The parent view does not have this entry (or it is pruned).
/* Note that FRESH is a performance optimization with which we can
* erase coins that are fully spent if we know we do not need to
* flush the changes to the parent cache. It is always safe to
* not mark FRESH if that condition is not guaranteed.
*/
};
CCoinsCacheEntry() : flags(0) {}
explicit CCoinsCacheEntry(Coin&& coin_) : coin(std::move(coin_)), flags(0) {}
};
typedef std::unordered_map<COutPoint, CCoinsCacheEntry, SaltedOutpointHasher> CCoinsMap;
/** Cursor for iterating over CoinsView state */
class CCoinsViewCursor
{
public:
CCoinsViewCursor(const uint256 &hashBlockIn): hashBlock(hashBlockIn) {}
virtual ~CCoinsViewCursor() {}
virtual bool GetKey(COutPoint &key) const = 0;
virtual bool GetValue(Coin &coin) const = 0;
/* Don't care about GetKeySize here */
virtual unsigned int GetValueSize() const = 0;
virtual bool Valid() const = 0;
virtual void Next() = 0;
//! Get best block at the time this cursor was created
const uint256 &GetBestBlock() const { return hashBlock; }
private:
uint256 hashBlock;
};
/** Abstract view on the open txout dataset. */
class CCoinsView
{
public:
/** Retrieve the Coin (unspent transaction output) for a given outpoint.
* Returns true only when an unspent coin was found, which is returned in coin.
* When false is returned, coin's value is unspecified.
*/
virtual bool GetCoin(const COutPoint &outpoint, Coin &coin) const;
//! Just check whether a given outpoint is unspent.
virtual bool HaveCoin(const COutPoint &outpoint) const;
//! Retrieve the block hash whose state this CCoinsView currently represents
virtual uint256 GetBestBlock() const;
//! Do a bulk modification (multiple Coin changes + BestBlock change).
//! The passed mapCoins can be modified.
virtual bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);
//! Get a cursor to iterate over the whole state
virtual CCoinsViewCursor *Cursor() const;
//! As we use CCoinsViews polymorphically, have a virtual destructor
virtual ~CCoinsView() {}
//! Estimate database size (0 if not implemented)
virtual size_t EstimateSize() const { return 0; }
};
/** CCoinsView backed by another CCoinsView */
class CCoinsViewBacked : public CCoinsView
{
protected:
CCoinsView *base;
public:
CCoinsViewBacked(CCoinsView *viewIn);
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;
bool HaveCoin(const COutPoint &outpoint) const override;
uint256 GetBestBlock() const override;
void SetBackend(CCoinsView &viewIn);
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override;
CCoinsViewCursor *Cursor() const override;
size_t EstimateSize() const override;
};
/** CCoinsView that adds a memory cache for transactions to another CCoinsView */
class CCoinsViewCache : public CCoinsViewBacked
{
protected:
/**
* Make mutable so that we can "fill the cache" even from Get-methods
* declared as "const".
*/
mutable uint256 hashBlock;
mutable CCoinsMap cacheCoins;
/* Cached dynamic memory usage for the inner Coin objects. */
mutable size_t cachedCoinsUsage;
public:
CCoinsViewCache(CCoinsView *baseIn);
// Standard CCoinsView methods
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;
bool HaveCoin(const COutPoint &outpoint) const override;
uint256 GetBestBlock() const override;
void SetBestBlock(const uint256 &hashBlock);
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override;
CCoinsViewCursor* Cursor() const override {
throw std::logic_error("CCoinsViewCache cursor iteration not supported.");
}
/**
* Check if we have the given utxo already loaded in this cache.
* The semantics are the same as HaveCoin(), but no calls to
* the backing CCoinsView are made.
*/
bool HaveCoinInCache(const COutPoint &outpoint) const;
/**
* Return a reference to Coin in the cache, or a pruned one if not found. This is
* more efficient than GetCoin.
*
* Generally, do not hold the reference returned for more than a short scope.
* While the current implementation allows for modifications to the contents
* of the cache while holding the reference, this behavior should not be relied
* on! To be safe, best to not hold the returned reference through any other
* calls to this cache.
*/
const Coin& AccessCoin(const COutPoint &output) const;
/**
* Add a coin. Set potential_overwrite to true if a non-pruned version may
* already exist.
*/
void AddCoin(const COutPoint& outpoint, Coin&& coin, bool potential_overwrite);
/**
* Spend a coin. Pass moveto in order to get the deleted data.
* If no unspent output exists for the passed outpoint, this call
* has no effect.
*/
bool SpendCoin(const COutPoint &outpoint, Coin* moveto = nullptr);
/**
* Push the modifications applied to this cache to its base.
* Failure to call this method before destruction will cause the changes to be forgotten.
* If false is returned, the state of this cache (and its backing view) will be undefined.
*/
bool Flush();
/**
* Removes the UTXO with the given outpoint from the cache, if it is
* not modified.
*/
void Uncache(const COutPoint &outpoint);
//! Calculate the size of the cache (in number of transaction outputs)
unsigned int GetCacheSize() const;
//! Calculate the size of the cache (in bytes)
size_t DynamicMemoryUsage() const;
/**
* Amount of collectiblecoin coming in to a transaction
* Note that lightweight clients may not know anything besides the hash of previous transactions,
* so may not be able to calculate this.
*
* @param[in] tx transaction for which we are checking input total
* @return Sum of value of all inputs (scriptSigs)
*/
CAmount GetValueIn(const CTransaction& tx) const;
//! Check whether all prevouts of the transaction are present in the UTXO set represented by this view
bool HaveInputs(const CTransaction& tx) const;
/**
* Return priority of tx at height nHeight. Also calculate the sum of the values of the inputs
* that are already in the chain. These are the inputs that will age and increase priority as
* new blocks are added to the chain.
*/
double GetPriority(const CTransaction &tx, int nHeight, CAmount &inChainInputValue) const;
private:
CCoinsMap::iterator FetchCoin(const COutPoint &outpoint) const;
/**
* By making the copy constructor private, we prevent accidentally using it when one intends to create a cache on top of a base cache.
*/
CCoinsViewCache(const CCoinsViewCache &);
};
//! Utility function to add all of a transaction's outputs to a cache.
// It assumes that overwrites are only possible for coinbase transactions,
// TODO: pass in a boolean to limit these possible overwrites to known
// (pre-BIP34) cases.
void AddCoins(CCoinsViewCache& cache, const CTransaction& tx, int nHeight);
//! Utility function to find any unspent output with a given txid.
// This function can be quite expensive because in the event of a transaction
// which is not found in the cache, it can cause up to MAX_OUTPUTS_PER_BLOCK
// lookups to database, so it should be used with care.
const Coin& AccessByTxid(const CCoinsViewCache& cache, const uint256& txid);
#endif // BITCOIN_COINS_H
| [
"fastpow@github.com"
] | fastpow@github.com |
502ca21cf704b68808059eb9c2cfba00f95b4597 | d3a033203fd6959cda5a0f5531ce3fd78422832f | /navigation/dwa_local_planner/include/dwa_local_planner/dwa_planner_ros.h | e928fd5d6d2accaec2949a71de3f3afd5ab2f8ee | [] | no_license | rsbGroup1/frobo_rsd | a3b832c671e736c17a81cd0e36bc386281a55fdc | 6397f121e19589aabd6f969e1255b5935ecd9b61 | refs/heads/master | 2021-01-19T22:11:04.686040 | 2015-12-10T18:52:40 | 2015-12-10T18:52:40 | 42,850,212 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,653 | h | /*********************************************************************
*
* Software License Agreement (BSD License)
*
* Copyright (c) 2009, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* 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.
*
* Author: Eitan Marder-Eppstein
*********************************************************************/
#ifndef DWA_LOCAL_PLANNER_DWA_PLANNER_ROS_H_
#define DWA_LOCAL_PLANNER_DWA_PLANNER_ROS_H_
#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include <tf/transform_listener.h>
#include <dynamic_reconfigure/server.h>
#include <dwa_local_planner/DWAPlannerConfig.h>
#include <angles/angles.h>
#include <nav_msgs/Odometry.h>
#include <costmap_2d/costmap_2d_ros.h>
#include <nav_core/base_local_planner.h>
#include <base_local_planner/latched_stop_rotate_controller.h>
#include <base_local_planner/odometry_helper_ros.h>
#include <dwa_local_planner/dwa_planner.h>
namespace dwa_local_planner
{
/**
* @class DWAPlannerROS
* @brief ROS Wrapper for the DWAPlanner that adheres to the
* BaseLocalPlanner interface and can be used as a plugin for move_base.
*/
class DWAPlannerROS : public nav_core::BaseLocalPlanner
{
public:
/**
* @brief Constructor for DWAPlannerROS wrapper
*/
DWAPlannerROS();
/**
* @brief Constructs the ros wrapper
* @param name The name to give this instance of the trajectory planner
* @param tf A pointer to a transform listener
* @param costmap The cost map to use for assigning costs to trajectories
*/
void initialize (std::string name, tf::TransformListener* tf,
costmap_2d::Costmap2DROS* costmap_ros);
/**
* @brief Destructor for the wrapper
*/
~DWAPlannerROS();
/**
* @brief Given the current position, orientation, and velocity of the robot,
* compute velocity commands to send to the base
* @param cmd_vel Will be filled with the velocity command to be passed to the robot base
* @return True if a valid trajectory was found, false otherwise
*/
bool computeVelocityCommands (geometry_msgs::Twist& cmd_vel);
/**
* @brief Given the current position, orientation, and velocity of the robot,
* compute velocity commands to send to the base, using dynamic window approach
* @param cmd_vel Will be filled with the velocity command to be passed to the robot base
* @return True if a valid trajectory was found, false otherwise
*/
bool dwaComputeVelocityCommands (tf::Stamped<tf::Pose>& global_pose, geometry_msgs::Twist& cmd_vel);
/**
* @brief Set the plan that the controller is following
* @param orig_global_plan The plan to pass to the controller
* @return True if the plan was updated successfully, false otherwise
*/
bool setPlan (const std::vector<geometry_msgs::PoseStamped>& orig_global_plan);
/**
* @brief Check if the goal pose has been achieved
* @return True if achieved, false otherwise
*/
bool isGoalReached();
bool isInitialized()
{
return initialized_;
}
private:
/**
* @brief Callback to update the local planner's parameters based on dynamic reconfigure
*/
void reconfigureCB (DWAPlannerConfig& config, uint32_t level);
void publishLocalPlan (std::vector<geometry_msgs::PoseStamped>& path);
void publishGlobalPlan (std::vector<geometry_msgs::PoseStamped>& path);
tf::TransformListener* tf_; ///< @brief Used for transforming point clouds
// for visualisation, publishers of global and local plan
ros::Publisher g_plan_pub_, l_plan_pub_;
base_local_planner::LocalPlannerUtil planner_util_;
boost::shared_ptr<DWAPlanner> dp_; ///< @brief The trajectory controller
costmap_2d::Costmap2DROS* costmap_ros_;
dynamic_reconfigure::Server<DWAPlannerConfig>* dsrv_;
dwa_local_planner::DWAPlannerConfig default_config_;
bool setup_;
tf::Stamped<tf::Pose> current_pose_;
base_local_planner::LatchedStopRotateController latchedStopRotateController_;
bool initialized_;
base_local_planner::OdometryHelperRos odom_helper_;
std::string odom_topic_;
};
};
#endif
| [
"dowei14@student.sdu.dk"
] | dowei14@student.sdu.dk |
45c43bf011bd4e584f768e9d70b0fd4399020cbb | 8757e40c13ecef1bb39ab8c567605d9866386bc6 | /src/q_guess.cpp | ef938b4c3dcc2d8f45259b4d097a5532438c061e | [
"LicenseRef-scancode-public-domain"
] | permissive | JoeDunnStable/RcppStable | 23b7453bc2617dd461f53d9e9800079b738cb682 | 3b5f370d47d23e1292ef252377e64bd1515d70e2 | refs/heads/master | 2020-04-08T18:18:54.434848 | 2018-12-14T18:14:49 | 2018-12-14T18:14:49 | 159,603,192 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,718 | cpp | ///
/// \file q_guess.cpp
/// Implementation of rough guess for quantile of stable distribution
/// \author Joseph Dunn
/// \copyright 2016, 2017, 2018 Joseph Dunn
/// \copyright Distributed under the terms of the GNU General Public License version 3
#include "q_guess.h"
#include <boost/math/distributions/students_t.hpp>
#include <boost/math/tools/toms748_solve.hpp>
#include <boost/math/constants/constants.hpp>
#include <iostream>
using std::cout;
using std::endl;
using std::ostream;
#include <iomanip>
using std::setw;
using std::setprecision;
using std::scientific;
namespace stable_distribution {
using boost::math::tools::toms748_solve;
using boost::math::students_t_distribution;
using boost::math::cdf;
using boost::math::quantile;
using std::pair;
//Functor which contains an approximation for stable p as a function of p for
//student t with df=alpha
class pt_solve {
private:
double rplus;
double rminus;
double knot1;
double knot2;
double a0;
double a1;
double a2;
double a3;
double p;
static const double pi;
static const double pi2;
public:
pt_solve(double pp, double alpha, double beta, int lower_tail, int log_p){
double c_stable_plus = sin(pi2*alpha )*tgamma(alpha)/pi*alpha*(1+beta);
double c_stable_minus = sin(pi2*alpha )*tgamma(alpha)/pi*alpha*(1-beta);
double c_t=tgamma((alpha+1)/2)/(sqrt(alpha*pi)*tgamma(alpha/2))*pow(alpha,((alpha+1)/2));
rplus=c_stable_plus/c_t;
rminus=c_stable_minus/c_t;
// construct a cubic spline for the mapping of pt to cdf
students_t_distribution<double> st(alpha);
if (alpha<1 && beta==1){
knot1 = cdf(st,-tan(pi2*alpha));
} else
knot1 = .01;
if (alpha<1 && beta==-1) {
knot2 = cdf(st,tan(pi2*alpha));
} else
knot2 = .99;
double dk=knot2-knot1;
a0 = rminus*knot1;
a1 = rminus;
double b0 = 1-rplus*(1-knot2)-rminus*knot2;
double b1 = rplus-rminus;
a2 = -(dk*b1-3*b0)/(dk*dk);
a3 = (dk*b1-2*b0)/(dk*dk*dk);
/* cout << "rminus = " << rminus << ",knot1 = " << knot1 << endl
<< "rplus = " << rplus << ", knot2 = " << knot2 << endl
<< "a0 = " << a0 << ", a1 = " << a1 << ", a2 = " << a2 << ", a3 = " << a3 << endl;
*/
p = (log_p) ? exp(pp) : pp;
p = (lower_tail) ? p : 1-p;
}
double operator () (double pt) {
if (pt<=knot1)
return pt*rminus-p;
else if (pt>=knot2) {
return 1-rplus*(1-pt)-p;
} else {
double ptmk1 = pt-knot1;
double r = (((a3*ptmk1)+a2)*ptmk1+a1)*ptmk1+a0;
return r-p;
}
}
friend
ostream& operator<< (ostream& os, pt_solve& solver) {
os << "rplus = " << setprecision(16) << scientific << solver.rplus << endl
<< "rminus = " << setprecision(16) << scientific << solver.rminus << endl
<< "knot1 = " << setprecision(16) << scientific << solver.knot1 << endl
<< "knot2 = " << setprecision(16) << scientific << solver.knot2 << endl
<< "a0 = " << setprecision(16) << scientific << solver.a0 << endl
<< "a1 = " << setprecision(16) << scientific << solver.a1 << endl
<< "a2 = " << setprecision(16) << scientific << solver.a2 << endl
<< "a3 = " << setprecision(16) << scientific << solver.a3 << endl
<< "p = " << setprecision(16) << scientific << solver.p << endl
<< "pi = " << setprecision(16) << scientific << pt_solve::pi << endl
<< "pi2 = " << setprecision(16) << scientific << pt_solve::pi2 << endl;
return os;
}
};
const double pt_solve::pi = boost::math::constants::pi<double>();
const double pt_solve::pi2 = boost::math::constants::half_pi<double>();
class rel_eps_tolerance
{
public:
rel_eps_tolerance(double eps) : eps(eps) {};
inline bool operator()(const double& a, const double& b)
{
return fabs(a - b) <= (eps * (std::min)(fabs(a), fabs(b)));
}
private:
double eps;
};
using boost::math::policies::policy;
using boost::math::policies::overflow_error;
using boost::math::policies::ignore_error;
typedef policy<overflow_error<ignore_error> > my_policy;
double q_guess(double p,double alpha,double beta,int lower_tail,int log_p){
pt_solve pt_s(p,alpha,beta,lower_tail,log_p);
students_t_distribution<double, my_policy> st(alpha);
double lower = 0;
double upper = 1;
rel_eps_tolerance tol(1e-6);
uintmax_t maxiter = 200;
pair<double,double> r;
r = toms748_solve(pt_s,lower,upper,tol,maxiter);
double pt_=(r.first+r.second)/2;
return quantile(st, fmax(1e-15,fmin(pt_,1-1e-15)));
}
} // namespace stable_distribution
| [
"jldunn@verizon.net"
] | jldunn@verizon.net |
811549efdfbd90e614e1cf2f7989d5be36169516 | 70feb7e5af4718afd4e9ba81a30ae8cead96dd62 | /Client/UnityClientProject/TestBuild/UnityClientProject_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/System.Threading.Tasks.Extensions.cpp | b8a9877335e7ec2e85c4aa24e89c666d71f6d47d | [
"MIT"
] | permissive | Veydron/ClientServerArchitectur | 04b2af0e4df2b178faee8bd6f0aec753857c4f0e | 60c36ceb364aadd92369160242ab3dea45ba478d | refs/heads/master | 2022-07-18T06:58:54.897009 | 2020-02-21T05:49:16 | 2020-02-21T05:49:16 | 231,766,701 | 1 | 0 | MIT | 2022-04-12T00:09:42 | 2020-01-04T13:19:32 | C++ | UTF-8 | C++ | false | false | 190,729 | cpp | #include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include <stdint.h>
#include "codegen/il2cpp-codegen.h"
#include "il2cpp-object-internals.h"
template <typename R>
struct VirtFuncInvoker0
{
typedef R (*Func)(void*, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
return ((Func)invokeData.methodPtr)(obj, invokeData.method);
}
};
template <typename T1, typename T2, typename T3, typename T4>
struct InterfaceActionInvoker4
{
typedef void (*Action)(void*, T1, T2, T3, T4, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1, T2 p2, T3 p3, T4 p4)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
((Action)invokeData.methodPtr)(obj, p1, p2, p3, p4, invokeData.method);
}
};
template <typename R, typename T1>
struct InterfaceFuncInvoker1
{
typedef R (*Func)(void*, T1, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
return ((Func)invokeData.methodPtr)(obj, p1, invokeData.method);
}
};
template <typename T1>
struct InterfaceActionInvoker1
{
typedef void (*Action)(void*, T1, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
((Action)invokeData.methodPtr)(obj, p1, invokeData.method);
}
};
// Microsoft.CodeAnalysis.EmbeddedAttribute
struct EmbeddedAttribute_tB6F2FE3275C0DB63CD5EB503DCB9CA5FE2089788;
// System.Action
struct Action_t591D2A86165F896B4B800BB5C25CE18672A55579;
// System.Action`1<System.Object>
struct Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0;
// System.ArgumentNullException
struct ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD;
// System.ArgumentOutOfRangeException
struct ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA;
// System.AsyncCallback
struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4;
// System.Attribute
struct Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74;
// System.Char[]
struct CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2;
// System.Collections.Generic.Dictionary`2<System.Int32,System.Threading.Tasks.Task>
struct Dictionary_2_t70161CFEB8DA3C79E19E31D0ED948D3C2925095F;
// System.Collections.IDictionary
struct IDictionary_t1BD5C1546718A374EA8122FBD6C6EE45331E8CE7;
// System.DelegateData
struct DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE;
// System.Delegate[]
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86;
// System.Diagnostics.StackTraceHiddenAttribute
struct StackTraceHiddenAttribute_tE55311D63F46448977EBB73FBADC0ADC60BA48BC;
// System.Diagnostics.StackTrace[]
struct StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196;
// System.Exception
struct Exception_t;
// System.Func`1<System.Threading.Tasks.Task/ContingentProperties>
struct Func_1_t48C2978A48CE3F2F6EB5B6DE269D00746483BB1F;
// System.IAsyncResult
struct IAsyncResult_t8E194308510B375B42432981AE5E7488C458D598;
// System.IntPtr[]
struct IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD;
// System.Predicate`1<System.Object>
struct Predicate_1_t4AA10EFD4C5497CA1CD0FE35A6AF5990FF5D0979;
// System.Predicate`1<System.Threading.Tasks.Task>
struct Predicate_1_tF4286C34BB184CE5690FDCEBA7F09FC68D229335;
// System.Reflection.Binder
struct Binder_t4D5CB06963501D32847C057B57157D6DC49CA759;
// System.Reflection.MemberFilter
struct MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381;
// System.Reflection.MethodInfo
struct MethodInfo_t;
// System.Runtime.CompilerServices.AsyncMethodBuilderAttribute
struct AsyncMethodBuilderAttribute_t45DF90A1F4957B1916C0DF08E1869FE7788B7F65;
// System.Runtime.CompilerServices.IAsyncStateMachine
struct IAsyncStateMachine_tEFDFBE18E061A6065AB2FF735F1425FB59F919BC;
// System.Runtime.CompilerServices.IsReadOnlyAttribute
struct IsReadOnlyAttribute_t2B73995DD5F32F7E75B5708BBC333B9F61C44FE7;
// System.Runtime.CompilerServices.ValueTaskAwaiter/<>c
struct U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259;
// System.Runtime.Serialization.SafeSerializationManager
struct SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770;
// System.String
struct String_t;
// System.Threading.CancellationTokenSource
struct CancellationTokenSource_tF480B7E74A032667AFBD31F0530D619FB43AD3FE;
// System.Threading.ContextCallback
struct ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676;
// System.Threading.Tasks.Sources.IValueTaskSource
struct IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2;
// System.Threading.Tasks.StackGuard
struct StackGuard_tE431ED3BBD1A18705FEE6F948EBF7FA2E99D64A9;
// System.Threading.Tasks.Task
struct Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2;
// System.Threading.Tasks.Task/ContingentProperties
struct ContingentProperties_t7149A27D01507C74E8BDAAA3848B45D2644FDF08;
// System.Threading.Tasks.TaskFactory
struct TaskFactory_tF3C6D983390ACFB40B4979E225368F78006D6155;
// System.Threading.Tasks.TaskScheduler
struct TaskScheduler_t966F2798F198FA90A0DA8EFC92BAC08297793114;
// System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>
struct Task_1_t1359D75350E9D976BFA28AD96E417450DE277673;
// System.Type
struct Type_t;
// System.Type[]
struct TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F;
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017;
IL2CPP_EXTERN_C RuntimeClass* Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Action_t591D2A86165F896B4B800BB5C25CE18672A55579_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* ExceptionArgument_t5D17391F46656FD2533C34295444FDAA6AA993DD_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C const RuntimeMethod* Action_1__ctor_mAFC7442D9D3CEC6701C3C5599F8CF12476095510_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* ThrowHelper_ThrowArgumentNullException_mC5A28A568922C2B81B27E6552EA9B8C4F175B75E_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* ThrowHelper_ThrowArgumentOutOfRangeException_mE8298DEB8A561B73850C8AAFDE78F0C7D16849F7_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* U3CU3Ec_U3C_cctorU3Eb__9_0_m8C067F60B6C8FAAC024A9F64AAF8B06BC31C6D98_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_RuntimeMethod_var;
IL2CPP_EXTERN_C const uint32_t ConfiguredValueTaskAwaiter_OnCompleted_m3383D45694A5326B01E5EF1EF09A72AE88D54A88_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ConfiguredValueTaskAwaiter_UnsafeOnCompleted_mC7380318BD43B545EDEF1CE153DC118DFB396A14_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ThrowHelper_GetArgumentName_m4636389F5A3A103B7F4BB4A13FDB503DC87EBD86_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ThrowHelper_GetArgumentNullException_m064A0F1715A8BA3C28E35555C1B860B4AD5A4174_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ThrowHelper_GetArgumentOutOfRangeException_mB8C2EAAEEACB1B6B181B747BE5BF61D08FC096A4_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ThrowHelper_ThrowArgumentNullException_mC5A28A568922C2B81B27E6552EA9B8C4F175B75E_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ThrowHelper_ThrowArgumentOutOfRangeException_mE8298DEB8A561B73850C8AAFDE78F0C7D16849F7_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t U3CU3Ec_U3C_cctorU3Eb__9_0_m8C067F60B6C8FAAC024A9F64AAF8B06BC31C6D98_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t U3CU3Ec__cctor_m957A3C5E59D561F2742499F08B26E8B647B8C5B3_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTaskAwaiter_OnCompleted_m0216EBC6CD5945B8AC974A84AE311F917E92929B_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTaskAwaiter_UnsafeOnCompleted_mDFDFE4DD17CC048418089BB5BAB89151943C77D4_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTaskAwaiter__cctor_m134A4F78CDAD63709C92C2F6E89A0ACA64339F19_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTask_Equals_m3D17AA6F653005E4575821F43FF29BB4EB9D559D_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643CSystem_Threading_Tasks_Extensions_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643C_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTask__cctor_mDB62201495B07CA8C28557A015BA14E5CADB22B3_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AESystem_Threading_Tasks_Extensions_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AE_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50System_Threading_Tasks_Extensions_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50_MetadataUsageId;
struct Delegate_t_marshaled_com;
struct Delegate_t_marshaled_pinvoke;
struct Exception_t_marshaled_com;
struct Exception_t_marshaled_pinvoke;
IL2CPP_EXTERN_C_BEGIN
IL2CPP_EXTERN_C_END
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// <Module>
struct U3CModuleU3E_t246B613AD97D4396959BDDC8C08E49DA97EA4A9E
{
public:
public:
};
// System.Object
struct Il2CppArrayBounds;
// System.Array
// System.Attribute
struct Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74 : public RuntimeObject
{
public:
public:
};
// System.Reflection.MemberInfo
struct MemberInfo_t : public RuntimeObject
{
public:
public:
};
// System.Runtime.CompilerServices.ValueTaskAwaiter_<>c
struct U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 : public RuntimeObject
{
public:
public:
};
struct U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259_StaticFields
{
public:
// System.Runtime.CompilerServices.ValueTaskAwaiter_<>c System.Runtime.CompilerServices.ValueTaskAwaiter_<>c::<>9
U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 * ___U3CU3E9_0;
public:
inline static int32_t get_offset_of_U3CU3E9_0() { return static_cast<int32_t>(offsetof(U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259_StaticFields, ___U3CU3E9_0)); }
inline U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 * get_U3CU3E9_0() const { return ___U3CU3E9_0; }
inline U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 ** get_address_of_U3CU3E9_0() { return &___U3CU3E9_0; }
inline void set_U3CU3E9_0(U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 * value)
{
___U3CU3E9_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E9_0), (void*)value);
}
};
// System.String
struct String_t : public RuntimeObject
{
public:
// System.Int32 System.String::m_stringLength
int32_t ___m_stringLength_0;
// System.Char System.String::m_firstChar
Il2CppChar ___m_firstChar_1;
public:
inline static int32_t get_offset_of_m_stringLength_0() { return static_cast<int32_t>(offsetof(String_t, ___m_stringLength_0)); }
inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; }
inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; }
inline void set_m_stringLength_0(int32_t value)
{
___m_stringLength_0 = value;
}
inline static int32_t get_offset_of_m_firstChar_1() { return static_cast<int32_t>(offsetof(String_t, ___m_firstChar_1)); }
inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; }
inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; }
inline void set_m_firstChar_1(Il2CppChar value)
{
___m_firstChar_1 = value;
}
};
struct String_t_StaticFields
{
public:
// System.String System.String::Empty
String_t* ___Empty_5;
public:
inline static int32_t get_offset_of_Empty_5() { return static_cast<int32_t>(offsetof(String_t_StaticFields, ___Empty_5)); }
inline String_t* get_Empty_5() const { return ___Empty_5; }
inline String_t** get_address_of_Empty_5() { return &___Empty_5; }
inline void set_Empty_5(String_t* value)
{
___Empty_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___Empty_5), (void*)value);
}
};
// System.ThrowHelper
struct ThrowHelper_t2DB264E3D987B02C236E40C60887FD6B88547432 : public RuntimeObject
{
public:
public:
};
// System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF : public RuntimeObject
{
public:
public:
};
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_com
{
};
// Microsoft.CodeAnalysis.EmbeddedAttribute
struct EmbeddedAttribute_tB6F2FE3275C0DB63CD5EB503DCB9CA5FE2089788 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
// System.Boolean
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C
{
public:
// System.Boolean System.Boolean::m_value
bool ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C, ___m_value_0)); }
inline bool get_m_value_0() const { return ___m_value_0; }
inline bool* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(bool value)
{
___m_value_0 = value;
}
};
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields
{
public:
// System.String System.Boolean::TrueString
String_t* ___TrueString_5;
// System.String System.Boolean::FalseString
String_t* ___FalseString_6;
public:
inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___TrueString_5)); }
inline String_t* get_TrueString_5() const { return ___TrueString_5; }
inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; }
inline void set_TrueString_5(String_t* value)
{
___TrueString_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___TrueString_5), (void*)value);
}
inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___FalseString_6)); }
inline String_t* get_FalseString_6() const { return ___FalseString_6; }
inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; }
inline void set_FalseString_6(String_t* value)
{
___FalseString_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FalseString_6), (void*)value);
}
};
// System.Diagnostics.StackTraceHiddenAttribute
struct StackTraceHiddenAttribute_tE55311D63F46448977EBB73FBADC0ADC60BA48BC : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
// System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521 : public ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF
{
public:
public:
};
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields
{
public:
// System.Char[] System.Enum::enumSeperatorCharArray
CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* ___enumSeperatorCharArray_0;
public:
inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields, ___enumSeperatorCharArray_0)); }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; }
inline void set_enumSeperatorCharArray_0(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* value)
{
___enumSeperatorCharArray_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_com
{
};
// System.Int16
struct Int16_t823A20635DAF5A3D93A1E01CFBF3CBA27CF00B4D
{
public:
// System.Int16 System.Int16::m_value
int16_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int16_t823A20635DAF5A3D93A1E01CFBF3CBA27CF00B4D, ___m_value_0)); }
inline int16_t get_m_value_0() const { return ___m_value_0; }
inline int16_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(int16_t value)
{
___m_value_0 = value;
}
};
// System.Int32
struct Int32_t585191389E07734F19F3156FF88FB3EF4800D102
{
public:
// System.Int32 System.Int32::m_value
int32_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int32_t585191389E07734F19F3156FF88FB3EF4800D102, ___m_value_0)); }
inline int32_t get_m_value_0() const { return ___m_value_0; }
inline int32_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(int32_t value)
{
___m_value_0 = value;
}
};
// System.IntPtr
struct IntPtr_t
{
public:
// System.Void* System.IntPtr::m_value
void* ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); }
inline void* get_m_value_0() const { return ___m_value_0; }
inline void** get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(void* value)
{
___m_value_0 = value;
}
};
struct IntPtr_t_StaticFields
{
public:
// System.IntPtr System.IntPtr::Zero
intptr_t ___Zero_1;
public:
inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); }
inline intptr_t get_Zero_1() const { return ___Zero_1; }
inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; }
inline void set_Zero_1(intptr_t value)
{
___Zero_1 = value;
}
};
// System.Runtime.CompilerServices.AsyncMethodBuilderAttribute
struct AsyncMethodBuilderAttribute_t45DF90A1F4957B1916C0DF08E1869FE7788B7F65 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.Type System.Runtime.CompilerServices.AsyncMethodBuilderAttribute::<BuilderType>k__BackingField
Type_t * ___U3CBuilderTypeU3Ek__BackingField_0;
public:
inline static int32_t get_offset_of_U3CBuilderTypeU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(AsyncMethodBuilderAttribute_t45DF90A1F4957B1916C0DF08E1869FE7788B7F65, ___U3CBuilderTypeU3Ek__BackingField_0)); }
inline Type_t * get_U3CBuilderTypeU3Ek__BackingField_0() const { return ___U3CBuilderTypeU3Ek__BackingField_0; }
inline Type_t ** get_address_of_U3CBuilderTypeU3Ek__BackingField_0() { return &___U3CBuilderTypeU3Ek__BackingField_0; }
inline void set_U3CBuilderTypeU3Ek__BackingField_0(Type_t * value)
{
___U3CBuilderTypeU3Ek__BackingField_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CBuilderTypeU3Ek__BackingField_0), (void*)value);
}
};
// System.Runtime.CompilerServices.AsyncMethodBuilderCore
struct AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01
{
public:
// System.Runtime.CompilerServices.IAsyncStateMachine System.Runtime.CompilerServices.AsyncMethodBuilderCore::m_stateMachine
RuntimeObject* ___m_stateMachine_0;
// System.Action System.Runtime.CompilerServices.AsyncMethodBuilderCore::m_defaultContextAction
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___m_defaultContextAction_1;
public:
inline static int32_t get_offset_of_m_stateMachine_0() { return static_cast<int32_t>(offsetof(AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01, ___m_stateMachine_0)); }
inline RuntimeObject* get_m_stateMachine_0() const { return ___m_stateMachine_0; }
inline RuntimeObject** get_address_of_m_stateMachine_0() { return &___m_stateMachine_0; }
inline void set_m_stateMachine_0(RuntimeObject* value)
{
___m_stateMachine_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_stateMachine_0), (void*)value);
}
inline static int32_t get_offset_of_m_defaultContextAction_1() { return static_cast<int32_t>(offsetof(AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01, ___m_defaultContextAction_1)); }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * get_m_defaultContextAction_1() const { return ___m_defaultContextAction_1; }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 ** get_address_of_m_defaultContextAction_1() { return &___m_defaultContextAction_1; }
inline void set_m_defaultContextAction_1(Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * value)
{
___m_defaultContextAction_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_defaultContextAction_1), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.AsyncMethodBuilderCore
struct AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01_marshaled_pinvoke
{
RuntimeObject* ___m_stateMachine_0;
Il2CppMethodPointer ___m_defaultContextAction_1;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.AsyncMethodBuilderCore
struct AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01_marshaled_com
{
RuntimeObject* ___m_stateMachine_0;
Il2CppMethodPointer ___m_defaultContextAction_1;
};
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable_ConfiguredTaskAwaiter
struct ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874
{
public:
// System.Threading.Tasks.Task System.Runtime.CompilerServices.ConfiguredTaskAwaitable_ConfiguredTaskAwaiter::m_task
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
// System.Boolean System.Runtime.CompilerServices.ConfiguredTaskAwaitable_ConfiguredTaskAwaiter::m_continueOnCapturedContext
bool ___m_continueOnCapturedContext_1;
public:
inline static int32_t get_offset_of_m_task_0() { return static_cast<int32_t>(offsetof(ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874, ___m_task_0)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_m_task_0() const { return ___m_task_0; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_m_task_0() { return &___m_task_0; }
inline void set_m_task_0(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___m_task_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_task_0), (void*)value);
}
inline static int32_t get_offset_of_m_continueOnCapturedContext_1() { return static_cast<int32_t>(offsetof(ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874, ___m_continueOnCapturedContext_1)); }
inline bool get_m_continueOnCapturedContext_1() const { return ___m_continueOnCapturedContext_1; }
inline bool* get_address_of_m_continueOnCapturedContext_1() { return &___m_continueOnCapturedContext_1; }
inline void set_m_continueOnCapturedContext_1(bool value)
{
___m_continueOnCapturedContext_1 = value;
}
};
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter
struct ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874_marshaled_pinvoke
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
int32_t ___m_continueOnCapturedContext_1;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter
struct ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874_marshaled_com
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
int32_t ___m_continueOnCapturedContext_1;
};
// System.Runtime.CompilerServices.IsReadOnlyAttribute
struct IsReadOnlyAttribute_t2B73995DD5F32F7E75B5708BBC333B9F61C44FE7 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
// System.Runtime.CompilerServices.TaskAwaiter
struct TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F
{
public:
// System.Threading.Tasks.Task System.Runtime.CompilerServices.TaskAwaiter::m_task
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
public:
inline static int32_t get_offset_of_m_task_0() { return static_cast<int32_t>(offsetof(TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F, ___m_task_0)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_m_task_0() const { return ___m_task_0; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_m_task_0() { return &___m_task_0; }
inline void set_m_task_0(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___m_task_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_task_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.TaskAwaiter
struct TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F_marshaled_pinvoke
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.TaskAwaiter
struct TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F_marshaled_com
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
};
// System.Threading.CancellationToken
struct CancellationToken_t9E956952F7F20908F2AE72EDF36D97E6C7DB63AB
{
public:
// System.Threading.CancellationTokenSource System.Threading.CancellationToken::m_source
CancellationTokenSource_tF480B7E74A032667AFBD31F0530D619FB43AD3FE * ___m_source_0;
public:
inline static int32_t get_offset_of_m_source_0() { return static_cast<int32_t>(offsetof(CancellationToken_t9E956952F7F20908F2AE72EDF36D97E6C7DB63AB, ___m_source_0)); }
inline CancellationTokenSource_tF480B7E74A032667AFBD31F0530D619FB43AD3FE * get_m_source_0() const { return ___m_source_0; }
inline CancellationTokenSource_tF480B7E74A032667AFBD31F0530D619FB43AD3FE ** get_address_of_m_source_0() { return &___m_source_0; }
inline void set_m_source_0(CancellationTokenSource_tF480B7E74A032667AFBD31F0530D619FB43AD3FE * value)
{
___m_source_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_source_0), (void*)value);
}
};
struct CancellationToken_t9E956952F7F20908F2AE72EDF36D97E6C7DB63AB_StaticFields
{
public:
// System.Action`1<System.Object> System.Threading.CancellationToken::s_ActionToActionObjShunt
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * ___s_ActionToActionObjShunt_1;
public:
inline static int32_t get_offset_of_s_ActionToActionObjShunt_1() { return static_cast<int32_t>(offsetof(CancellationToken_t9E956952F7F20908F2AE72EDF36D97E6C7DB63AB_StaticFields, ___s_ActionToActionObjShunt_1)); }
inline Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * get_s_ActionToActionObjShunt_1() const { return ___s_ActionToActionObjShunt_1; }
inline Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 ** get_address_of_s_ActionToActionObjShunt_1() { return &___s_ActionToActionObjShunt_1; }
inline void set_s_ActionToActionObjShunt_1(Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * value)
{
___s_ActionToActionObjShunt_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_ActionToActionObjShunt_1), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Threading.CancellationToken
struct CancellationToken_t9E956952F7F20908F2AE72EDF36D97E6C7DB63AB_marshaled_pinvoke
{
CancellationTokenSource_tF480B7E74A032667AFBD31F0530D619FB43AD3FE * ___m_source_0;
};
// Native definition for COM marshalling of System.Threading.CancellationToken
struct CancellationToken_t9E956952F7F20908F2AE72EDF36D97E6C7DB63AB_marshaled_com
{
CancellationTokenSource_tF480B7E74A032667AFBD31F0530D619FB43AD3FE * ___m_source_0;
};
// System.Threading.Tasks.ValueTask
struct ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13
{
public:
// System.Object System.Threading.Tasks.ValueTask::_obj
RuntimeObject * ____obj_2;
// System.Int16 System.Threading.Tasks.ValueTask::_token
int16_t ____token_3;
// System.Boolean System.Threading.Tasks.ValueTask::_continueOnCapturedContext
bool ____continueOnCapturedContext_4;
public:
inline static int32_t get_offset_of__obj_2() { return static_cast<int32_t>(offsetof(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13, ____obj_2)); }
inline RuntimeObject * get__obj_2() const { return ____obj_2; }
inline RuntimeObject ** get_address_of__obj_2() { return &____obj_2; }
inline void set__obj_2(RuntimeObject * value)
{
____obj_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&____obj_2), (void*)value);
}
inline static int32_t get_offset_of__token_3() { return static_cast<int32_t>(offsetof(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13, ____token_3)); }
inline int16_t get__token_3() const { return ____token_3; }
inline int16_t* get_address_of__token_3() { return &____token_3; }
inline void set__token_3(int16_t value)
{
____token_3 = value;
}
inline static int32_t get_offset_of__continueOnCapturedContext_4() { return static_cast<int32_t>(offsetof(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13, ____continueOnCapturedContext_4)); }
inline bool get__continueOnCapturedContext_4() const { return ____continueOnCapturedContext_4; }
inline bool* get_address_of__continueOnCapturedContext_4() { return &____continueOnCapturedContext_4; }
inline void set__continueOnCapturedContext_4(bool value)
{
____continueOnCapturedContext_4 = value;
}
};
struct ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_StaticFields
{
public:
// System.Threading.Tasks.Task System.Threading.Tasks.ValueTask::s_canceledTask
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___s_canceledTask_0;
// System.Threading.Tasks.Task System.Threading.Tasks.ValueTask::<CompletedTask>k__BackingField
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___U3CCompletedTaskU3Ek__BackingField_1;
public:
inline static int32_t get_offset_of_s_canceledTask_0() { return static_cast<int32_t>(offsetof(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_StaticFields, ___s_canceledTask_0)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_s_canceledTask_0() const { return ___s_canceledTask_0; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_s_canceledTask_0() { return &___s_canceledTask_0; }
inline void set_s_canceledTask_0(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___s_canceledTask_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_canceledTask_0), (void*)value);
}
inline static int32_t get_offset_of_U3CCompletedTaskU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_StaticFields, ___U3CCompletedTaskU3Ek__BackingField_1)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_U3CCompletedTaskU3Ek__BackingField_1() const { return ___U3CCompletedTaskU3Ek__BackingField_1; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_U3CCompletedTaskU3Ek__BackingField_1() { return &___U3CCompletedTaskU3Ek__BackingField_1; }
inline void set_U3CCompletedTaskU3Ek__BackingField_1(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___U3CCompletedTaskU3Ek__BackingField_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CCompletedTaskU3Ek__BackingField_1), (void*)value);
}
};
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017
{
public:
union
{
struct
{
};
uint8_t Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017__padding[1];
};
public:
};
// System.Delegate
struct Delegate_t : public RuntimeObject
{
public:
// System.IntPtr System.Delegate::method_ptr
Il2CppMethodPointer ___method_ptr_0;
// System.IntPtr System.Delegate::invoke_impl
intptr_t ___invoke_impl_1;
// System.Object System.Delegate::m_target
RuntimeObject * ___m_target_2;
// System.IntPtr System.Delegate::method
intptr_t ___method_3;
// System.IntPtr System.Delegate::delegate_trampoline
intptr_t ___delegate_trampoline_4;
// System.IntPtr System.Delegate::extra_arg
intptr_t ___extra_arg_5;
// System.IntPtr System.Delegate::method_code
intptr_t ___method_code_6;
// System.Reflection.MethodInfo System.Delegate::method_info
MethodInfo_t * ___method_info_7;
// System.Reflection.MethodInfo System.Delegate::original_method_info
MethodInfo_t * ___original_method_info_8;
// System.DelegateData System.Delegate::data
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
// System.Boolean System.Delegate::method_is_virtual
bool ___method_is_virtual_10;
public:
inline static int32_t get_offset_of_method_ptr_0() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_ptr_0)); }
inline Il2CppMethodPointer get_method_ptr_0() const { return ___method_ptr_0; }
inline Il2CppMethodPointer* get_address_of_method_ptr_0() { return &___method_ptr_0; }
inline void set_method_ptr_0(Il2CppMethodPointer value)
{
___method_ptr_0 = value;
}
inline static int32_t get_offset_of_invoke_impl_1() { return static_cast<int32_t>(offsetof(Delegate_t, ___invoke_impl_1)); }
inline intptr_t get_invoke_impl_1() const { return ___invoke_impl_1; }
inline intptr_t* get_address_of_invoke_impl_1() { return &___invoke_impl_1; }
inline void set_invoke_impl_1(intptr_t value)
{
___invoke_impl_1 = value;
}
inline static int32_t get_offset_of_m_target_2() { return static_cast<int32_t>(offsetof(Delegate_t, ___m_target_2)); }
inline RuntimeObject * get_m_target_2() const { return ___m_target_2; }
inline RuntimeObject ** get_address_of_m_target_2() { return &___m_target_2; }
inline void set_m_target_2(RuntimeObject * value)
{
___m_target_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_target_2), (void*)value);
}
inline static int32_t get_offset_of_method_3() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_3)); }
inline intptr_t get_method_3() const { return ___method_3; }
inline intptr_t* get_address_of_method_3() { return &___method_3; }
inline void set_method_3(intptr_t value)
{
___method_3 = value;
}
inline static int32_t get_offset_of_delegate_trampoline_4() { return static_cast<int32_t>(offsetof(Delegate_t, ___delegate_trampoline_4)); }
inline intptr_t get_delegate_trampoline_4() const { return ___delegate_trampoline_4; }
inline intptr_t* get_address_of_delegate_trampoline_4() { return &___delegate_trampoline_4; }
inline void set_delegate_trampoline_4(intptr_t value)
{
___delegate_trampoline_4 = value;
}
inline static int32_t get_offset_of_extra_arg_5() { return static_cast<int32_t>(offsetof(Delegate_t, ___extra_arg_5)); }
inline intptr_t get_extra_arg_5() const { return ___extra_arg_5; }
inline intptr_t* get_address_of_extra_arg_5() { return &___extra_arg_5; }
inline void set_extra_arg_5(intptr_t value)
{
___extra_arg_5 = value;
}
inline static int32_t get_offset_of_method_code_6() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_code_6)); }
inline intptr_t get_method_code_6() const { return ___method_code_6; }
inline intptr_t* get_address_of_method_code_6() { return &___method_code_6; }
inline void set_method_code_6(intptr_t value)
{
___method_code_6 = value;
}
inline static int32_t get_offset_of_method_info_7() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_info_7)); }
inline MethodInfo_t * get_method_info_7() const { return ___method_info_7; }
inline MethodInfo_t ** get_address_of_method_info_7() { return &___method_info_7; }
inline void set_method_info_7(MethodInfo_t * value)
{
___method_info_7 = value;
Il2CppCodeGenWriteBarrier((void**)(&___method_info_7), (void*)value);
}
inline static int32_t get_offset_of_original_method_info_8() { return static_cast<int32_t>(offsetof(Delegate_t, ___original_method_info_8)); }
inline MethodInfo_t * get_original_method_info_8() const { return ___original_method_info_8; }
inline MethodInfo_t ** get_address_of_original_method_info_8() { return &___original_method_info_8; }
inline void set_original_method_info_8(MethodInfo_t * value)
{
___original_method_info_8 = value;
Il2CppCodeGenWriteBarrier((void**)(&___original_method_info_8), (void*)value);
}
inline static int32_t get_offset_of_data_9() { return static_cast<int32_t>(offsetof(Delegate_t, ___data_9)); }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * get_data_9() const { return ___data_9; }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE ** get_address_of_data_9() { return &___data_9; }
inline void set_data_9(DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * value)
{
___data_9 = value;
Il2CppCodeGenWriteBarrier((void**)(&___data_9), (void*)value);
}
inline static int32_t get_offset_of_method_is_virtual_10() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_is_virtual_10)); }
inline bool get_method_is_virtual_10() const { return ___method_is_virtual_10; }
inline bool* get_address_of_method_is_virtual_10() { return &___method_is_virtual_10; }
inline void set_method_is_virtual_10(bool value)
{
___method_is_virtual_10 = value;
}
};
// Native definition for P/Invoke marshalling of System.Delegate
struct Delegate_t_marshaled_pinvoke
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
// Native definition for COM marshalling of System.Delegate
struct Delegate_t_marshaled_com
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
// System.Exception
struct Exception_t : public RuntimeObject
{
public:
// System.String System.Exception::_className
String_t* ____className_1;
// System.String System.Exception::_message
String_t* ____message_2;
// System.Collections.IDictionary System.Exception::_data
RuntimeObject* ____data_3;
// System.Exception System.Exception::_innerException
Exception_t * ____innerException_4;
// System.String System.Exception::_helpURL
String_t* ____helpURL_5;
// System.Object System.Exception::_stackTrace
RuntimeObject * ____stackTrace_6;
// System.String System.Exception::_stackTraceString
String_t* ____stackTraceString_7;
// System.String System.Exception::_remoteStackTraceString
String_t* ____remoteStackTraceString_8;
// System.Int32 System.Exception::_remoteStackIndex
int32_t ____remoteStackIndex_9;
// System.Object System.Exception::_dynamicMethods
RuntimeObject * ____dynamicMethods_10;
// System.Int32 System.Exception::_HResult
int32_t ____HResult_11;
// System.String System.Exception::_source
String_t* ____source_12;
// System.Runtime.Serialization.SafeSerializationManager System.Exception::_safeSerializationManager
SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13;
// System.Diagnostics.StackTrace[] System.Exception::captured_traces
StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14;
// System.IntPtr[] System.Exception::native_trace_ips
IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* ___native_trace_ips_15;
public:
inline static int32_t get_offset_of__className_1() { return static_cast<int32_t>(offsetof(Exception_t, ____className_1)); }
inline String_t* get__className_1() const { return ____className_1; }
inline String_t** get_address_of__className_1() { return &____className_1; }
inline void set__className_1(String_t* value)
{
____className_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&____className_1), (void*)value);
}
inline static int32_t get_offset_of__message_2() { return static_cast<int32_t>(offsetof(Exception_t, ____message_2)); }
inline String_t* get__message_2() const { return ____message_2; }
inline String_t** get_address_of__message_2() { return &____message_2; }
inline void set__message_2(String_t* value)
{
____message_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&____message_2), (void*)value);
}
inline static int32_t get_offset_of__data_3() { return static_cast<int32_t>(offsetof(Exception_t, ____data_3)); }
inline RuntimeObject* get__data_3() const { return ____data_3; }
inline RuntimeObject** get_address_of__data_3() { return &____data_3; }
inline void set__data_3(RuntimeObject* value)
{
____data_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&____data_3), (void*)value);
}
inline static int32_t get_offset_of__innerException_4() { return static_cast<int32_t>(offsetof(Exception_t, ____innerException_4)); }
inline Exception_t * get__innerException_4() const { return ____innerException_4; }
inline Exception_t ** get_address_of__innerException_4() { return &____innerException_4; }
inline void set__innerException_4(Exception_t * value)
{
____innerException_4 = value;
Il2CppCodeGenWriteBarrier((void**)(&____innerException_4), (void*)value);
}
inline static int32_t get_offset_of__helpURL_5() { return static_cast<int32_t>(offsetof(Exception_t, ____helpURL_5)); }
inline String_t* get__helpURL_5() const { return ____helpURL_5; }
inline String_t** get_address_of__helpURL_5() { return &____helpURL_5; }
inline void set__helpURL_5(String_t* value)
{
____helpURL_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&____helpURL_5), (void*)value);
}
inline static int32_t get_offset_of__stackTrace_6() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTrace_6)); }
inline RuntimeObject * get__stackTrace_6() const { return ____stackTrace_6; }
inline RuntimeObject ** get_address_of__stackTrace_6() { return &____stackTrace_6; }
inline void set__stackTrace_6(RuntimeObject * value)
{
____stackTrace_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&____stackTrace_6), (void*)value);
}
inline static int32_t get_offset_of__stackTraceString_7() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTraceString_7)); }
inline String_t* get__stackTraceString_7() const { return ____stackTraceString_7; }
inline String_t** get_address_of__stackTraceString_7() { return &____stackTraceString_7; }
inline void set__stackTraceString_7(String_t* value)
{
____stackTraceString_7 = value;
Il2CppCodeGenWriteBarrier((void**)(&____stackTraceString_7), (void*)value);
}
inline static int32_t get_offset_of__remoteStackTraceString_8() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackTraceString_8)); }
inline String_t* get__remoteStackTraceString_8() const { return ____remoteStackTraceString_8; }
inline String_t** get_address_of__remoteStackTraceString_8() { return &____remoteStackTraceString_8; }
inline void set__remoteStackTraceString_8(String_t* value)
{
____remoteStackTraceString_8 = value;
Il2CppCodeGenWriteBarrier((void**)(&____remoteStackTraceString_8), (void*)value);
}
inline static int32_t get_offset_of__remoteStackIndex_9() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackIndex_9)); }
inline int32_t get__remoteStackIndex_9() const { return ____remoteStackIndex_9; }
inline int32_t* get_address_of__remoteStackIndex_9() { return &____remoteStackIndex_9; }
inline void set__remoteStackIndex_9(int32_t value)
{
____remoteStackIndex_9 = value;
}
inline static int32_t get_offset_of__dynamicMethods_10() { return static_cast<int32_t>(offsetof(Exception_t, ____dynamicMethods_10)); }
inline RuntimeObject * get__dynamicMethods_10() const { return ____dynamicMethods_10; }
inline RuntimeObject ** get_address_of__dynamicMethods_10() { return &____dynamicMethods_10; }
inline void set__dynamicMethods_10(RuntimeObject * value)
{
____dynamicMethods_10 = value;
Il2CppCodeGenWriteBarrier((void**)(&____dynamicMethods_10), (void*)value);
}
inline static int32_t get_offset_of__HResult_11() { return static_cast<int32_t>(offsetof(Exception_t, ____HResult_11)); }
inline int32_t get__HResult_11() const { return ____HResult_11; }
inline int32_t* get_address_of__HResult_11() { return &____HResult_11; }
inline void set__HResult_11(int32_t value)
{
____HResult_11 = value;
}
inline static int32_t get_offset_of__source_12() { return static_cast<int32_t>(offsetof(Exception_t, ____source_12)); }
inline String_t* get__source_12() const { return ____source_12; }
inline String_t** get_address_of__source_12() { return &____source_12; }
inline void set__source_12(String_t* value)
{
____source_12 = value;
Il2CppCodeGenWriteBarrier((void**)(&____source_12), (void*)value);
}
inline static int32_t get_offset_of__safeSerializationManager_13() { return static_cast<int32_t>(offsetof(Exception_t, ____safeSerializationManager_13)); }
inline SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * get__safeSerializationManager_13() const { return ____safeSerializationManager_13; }
inline SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 ** get_address_of__safeSerializationManager_13() { return &____safeSerializationManager_13; }
inline void set__safeSerializationManager_13(SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * value)
{
____safeSerializationManager_13 = value;
Il2CppCodeGenWriteBarrier((void**)(&____safeSerializationManager_13), (void*)value);
}
inline static int32_t get_offset_of_captured_traces_14() { return static_cast<int32_t>(offsetof(Exception_t, ___captured_traces_14)); }
inline StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* get_captured_traces_14() const { return ___captured_traces_14; }
inline StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196** get_address_of_captured_traces_14() { return &___captured_traces_14; }
inline void set_captured_traces_14(StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* value)
{
___captured_traces_14 = value;
Il2CppCodeGenWriteBarrier((void**)(&___captured_traces_14), (void*)value);
}
inline static int32_t get_offset_of_native_trace_ips_15() { return static_cast<int32_t>(offsetof(Exception_t, ___native_trace_ips_15)); }
inline IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* get_native_trace_ips_15() const { return ___native_trace_ips_15; }
inline IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD** get_address_of_native_trace_ips_15() { return &___native_trace_ips_15; }
inline void set_native_trace_ips_15(IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* value)
{
___native_trace_ips_15 = value;
Il2CppCodeGenWriteBarrier((void**)(&___native_trace_ips_15), (void*)value);
}
};
struct Exception_t_StaticFields
{
public:
// System.Object System.Exception::s_EDILock
RuntimeObject * ___s_EDILock_0;
public:
inline static int32_t get_offset_of_s_EDILock_0() { return static_cast<int32_t>(offsetof(Exception_t_StaticFields, ___s_EDILock_0)); }
inline RuntimeObject * get_s_EDILock_0() const { return ___s_EDILock_0; }
inline RuntimeObject ** get_address_of_s_EDILock_0() { return &___s_EDILock_0; }
inline void set_s_EDILock_0(RuntimeObject * value)
{
___s_EDILock_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_EDILock_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Exception
struct Exception_t_marshaled_pinvoke
{
char* ____className_1;
char* ____message_2;
RuntimeObject* ____data_3;
Exception_t_marshaled_pinvoke* ____innerException_4;
char* ____helpURL_5;
Il2CppIUnknown* ____stackTrace_6;
char* ____stackTraceString_7;
char* ____remoteStackTraceString_8;
int32_t ____remoteStackIndex_9;
Il2CppIUnknown* ____dynamicMethods_10;
int32_t ____HResult_11;
char* ____source_12;
SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13;
StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14;
Il2CppSafeArray/*NONE*/* ___native_trace_ips_15;
};
// Native definition for COM marshalling of System.Exception
struct Exception_t_marshaled_com
{
Il2CppChar* ____className_1;
Il2CppChar* ____message_2;
RuntimeObject* ____data_3;
Exception_t_marshaled_com* ____innerException_4;
Il2CppChar* ____helpURL_5;
Il2CppIUnknown* ____stackTrace_6;
Il2CppChar* ____stackTraceString_7;
Il2CppChar* ____remoteStackTraceString_8;
int32_t ____remoteStackIndex_9;
Il2CppIUnknown* ____dynamicMethods_10;
int32_t ____HResult_11;
Il2CppChar* ____source_12;
SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13;
StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14;
Il2CppSafeArray/*NONE*/* ___native_trace_ips_15;
};
// System.ExceptionArgument
struct ExceptionArgument_t5D17391F46656FD2533C34295444FDAA6AA993DD
{
public:
// System.Int32 System.ExceptionArgument::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(ExceptionArgument_t5D17391F46656FD2533C34295444FDAA6AA993DD, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// System.Reflection.BindingFlags
struct BindingFlags_tE35C91D046E63A1B92BB9AB909FCF9DA84379ED0
{
public:
// System.Int32 System.Reflection.BindingFlags::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(BindingFlags_tE35C91D046E63A1B92BB9AB909FCF9DA84379ED0, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Threading.Tasks.VoidTaskResult>
struct AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9
{
public:
// System.Runtime.CompilerServices.AsyncMethodBuilderCore System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::m_coreState
AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01 ___m_coreState_1;
// System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::m_task
Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * ___m_task_2;
public:
inline static int32_t get_offset_of_m_coreState_1() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9, ___m_coreState_1)); }
inline AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01 get_m_coreState_1() const { return ___m_coreState_1; }
inline AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01 * get_address_of_m_coreState_1() { return &___m_coreState_1; }
inline void set_m_coreState_1(AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01 value)
{
___m_coreState_1 = value;
Il2CppCodeGenWriteBarrier((void**)&(((&___m_coreState_1))->___m_stateMachine_0), (void*)NULL);
#if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS
Il2CppCodeGenWriteBarrier((void**)&(((&___m_coreState_1))->___m_defaultContextAction_1), (void*)NULL);
#endif
}
inline static int32_t get_offset_of_m_task_2() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9, ___m_task_2)); }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * get_m_task_2() const { return ___m_task_2; }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 ** get_address_of_m_task_2() { return &___m_task_2; }
inline void set_m_task_2(Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * value)
{
___m_task_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_task_2), (void*)value);
}
};
struct AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9_StaticFields
{
public:
// System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::s_defaultResultTask
Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * ___s_defaultResultTask_0;
public:
inline static int32_t get_offset_of_s_defaultResultTask_0() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9_StaticFields, ___s_defaultResultTask_0)); }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * get_s_defaultResultTask_0() const { return ___s_defaultResultTask_0; }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 ** get_address_of_s_defaultResultTask_0() { return &___s_defaultResultTask_0; }
inline void set_s_defaultResultTask_0(Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * value)
{
___s_defaultResultTask_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_defaultResultTask_0), (void*)value);
}
};
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable
struct ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9
{
public:
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable_ConfiguredTaskAwaiter System.Runtime.CompilerServices.ConfiguredTaskAwaitable::m_configuredTaskAwaiter
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 ___m_configuredTaskAwaiter_0;
public:
inline static int32_t get_offset_of_m_configuredTaskAwaiter_0() { return static_cast<int32_t>(offsetof(ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9, ___m_configuredTaskAwaiter_0)); }
inline ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 get_m_configuredTaskAwaiter_0() const { return ___m_configuredTaskAwaiter_0; }
inline ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 * get_address_of_m_configuredTaskAwaiter_0() { return &___m_configuredTaskAwaiter_0; }
inline void set_m_configuredTaskAwaiter_0(ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 value)
{
___m_configuredTaskAwaiter_0 = value;
Il2CppCodeGenWriteBarrier((void**)&(((&___m_configuredTaskAwaiter_0))->___m_task_0), (void*)NULL);
}
};
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.ConfiguredTaskAwaitable
struct ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9_marshaled_pinvoke
{
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874_marshaled_pinvoke ___m_configuredTaskAwaiter_0;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.ConfiguredTaskAwaitable
struct ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9_marshaled_com
{
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874_marshaled_com ___m_configuredTaskAwaiter_0;
};
// System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable
struct ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10
{
public:
// System.Threading.Tasks.ValueTask System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable::_value
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ____value_0;
public:
inline static int32_t get_offset_of__value_0() { return static_cast<int32_t>(offsetof(ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10, ____value_0)); }
inline ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 get__value_0() const { return ____value_0; }
inline ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * get_address_of__value_0() { return &____value_0; }
inline void set__value_0(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 value)
{
____value_0 = value;
Il2CppCodeGenWriteBarrier((void**)&(((&____value_0))->____obj_2), (void*)NULL);
}
};
// System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable_ConfiguredValueTaskAwaiter
struct ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE
{
public:
// System.Threading.Tasks.ValueTask System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable_ConfiguredValueTaskAwaiter::_value
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ____value_0;
public:
inline static int32_t get_offset_of__value_0() { return static_cast<int32_t>(offsetof(ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE, ____value_0)); }
inline ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 get__value_0() const { return ____value_0; }
inline ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * get_address_of__value_0() { return &____value_0; }
inline void set__value_0(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 value)
{
____value_0 = value;
Il2CppCodeGenWriteBarrier((void**)&(((&____value_0))->____obj_2), (void*)NULL);
}
};
// System.Runtime.CompilerServices.ValueTaskAwaiter
struct ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2
{
public:
// System.Threading.Tasks.ValueTask System.Runtime.CompilerServices.ValueTaskAwaiter::_value
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ____value_1;
public:
inline static int32_t get_offset_of__value_1() { return static_cast<int32_t>(offsetof(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2, ____value_1)); }
inline ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 get__value_1() const { return ____value_1; }
inline ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * get_address_of__value_1() { return &____value_1; }
inline void set__value_1(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 value)
{
____value_1 = value;
Il2CppCodeGenWriteBarrier((void**)&(((&____value_1))->____obj_2), (void*)NULL);
}
};
struct ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_StaticFields
{
public:
// System.Action`1<System.Object> System.Runtime.CompilerServices.ValueTaskAwaiter::s_invokeActionDelegate
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * ___s_invokeActionDelegate_0;
public:
inline static int32_t get_offset_of_s_invokeActionDelegate_0() { return static_cast<int32_t>(offsetof(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_StaticFields, ___s_invokeActionDelegate_0)); }
inline Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * get_s_invokeActionDelegate_0() const { return ___s_invokeActionDelegate_0; }
inline Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 ** get_address_of_s_invokeActionDelegate_0() { return &___s_invokeActionDelegate_0; }
inline void set_s_invokeActionDelegate_0(Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * value)
{
___s_invokeActionDelegate_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_invokeActionDelegate_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.ValueTaskAwaiter
struct ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshaled_pinvoke
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ____value_1;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.ValueTaskAwaiter
struct ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshaled_com
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ____value_1;
};
// System.RuntimeTypeHandle
struct RuntimeTypeHandle_t7B542280A22F0EC4EAC2061C29178845847A8B2D
{
public:
// System.IntPtr System.RuntimeTypeHandle::value
intptr_t ___value_0;
public:
inline static int32_t get_offset_of_value_0() { return static_cast<int32_t>(offsetof(RuntimeTypeHandle_t7B542280A22F0EC4EAC2061C29178845847A8B2D, ___value_0)); }
inline intptr_t get_value_0() const { return ___value_0; }
inline intptr_t* get_address_of_value_0() { return &___value_0; }
inline void set_value_0(intptr_t value)
{
___value_0 = value;
}
};
// System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags
struct ValueTaskSourceOnCompletedFlags_t6389A363C49D3809A83BD3296FC16C8676797643
{
public:
// System.Int32 System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(ValueTaskSourceOnCompletedFlags_t6389A363C49D3809A83BD3296FC16C8676797643, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// System.Threading.Tasks.Sources.ValueTaskSourceStatus
struct ValueTaskSourceStatus_tC91CEE8F7F8E10F13A6FF34924C794CCAF3152FC
{
public:
// System.Int32 System.Threading.Tasks.Sources.ValueTaskSourceStatus::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(ValueTaskSourceStatus_tC91CEE8F7F8E10F13A6FF34924C794CCAF3152FC, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// System.Threading.Tasks.Task
struct Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 : public RuntimeObject
{
public:
// System.Int32 modreq(System.Runtime.CompilerServices.IsVolatile) System.Threading.Tasks.Task::m_taskId
int32_t ___m_taskId_4;
// System.Object System.Threading.Tasks.Task::m_action
RuntimeObject * ___m_action_5;
// System.Object System.Threading.Tasks.Task::m_stateObject
RuntimeObject * ___m_stateObject_6;
// System.Threading.Tasks.TaskScheduler System.Threading.Tasks.Task::m_taskScheduler
TaskScheduler_t966F2798F198FA90A0DA8EFC92BAC08297793114 * ___m_taskScheduler_7;
// System.Threading.Tasks.Task System.Threading.Tasks.Task::m_parent
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_parent_8;
// System.Int32 modreq(System.Runtime.CompilerServices.IsVolatile) System.Threading.Tasks.Task::m_stateFlags
int32_t ___m_stateFlags_9;
// System.Object modreq(System.Runtime.CompilerServices.IsVolatile) System.Threading.Tasks.Task::m_continuationObject
RuntimeObject * ___m_continuationObject_28;
// System.Threading.Tasks.Task_ContingentProperties modreq(System.Runtime.CompilerServices.IsVolatile) System.Threading.Tasks.Task::m_contingentProperties
ContingentProperties_t7149A27D01507C74E8BDAAA3848B45D2644FDF08 * ___m_contingentProperties_33;
public:
inline static int32_t get_offset_of_m_taskId_4() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2, ___m_taskId_4)); }
inline int32_t get_m_taskId_4() const { return ___m_taskId_4; }
inline int32_t* get_address_of_m_taskId_4() { return &___m_taskId_4; }
inline void set_m_taskId_4(int32_t value)
{
___m_taskId_4 = value;
}
inline static int32_t get_offset_of_m_action_5() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2, ___m_action_5)); }
inline RuntimeObject * get_m_action_5() const { return ___m_action_5; }
inline RuntimeObject ** get_address_of_m_action_5() { return &___m_action_5; }
inline void set_m_action_5(RuntimeObject * value)
{
___m_action_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_action_5), (void*)value);
}
inline static int32_t get_offset_of_m_stateObject_6() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2, ___m_stateObject_6)); }
inline RuntimeObject * get_m_stateObject_6() const { return ___m_stateObject_6; }
inline RuntimeObject ** get_address_of_m_stateObject_6() { return &___m_stateObject_6; }
inline void set_m_stateObject_6(RuntimeObject * value)
{
___m_stateObject_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_stateObject_6), (void*)value);
}
inline static int32_t get_offset_of_m_taskScheduler_7() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2, ___m_taskScheduler_7)); }
inline TaskScheduler_t966F2798F198FA90A0DA8EFC92BAC08297793114 * get_m_taskScheduler_7() const { return ___m_taskScheduler_7; }
inline TaskScheduler_t966F2798F198FA90A0DA8EFC92BAC08297793114 ** get_address_of_m_taskScheduler_7() { return &___m_taskScheduler_7; }
inline void set_m_taskScheduler_7(TaskScheduler_t966F2798F198FA90A0DA8EFC92BAC08297793114 * value)
{
___m_taskScheduler_7 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_taskScheduler_7), (void*)value);
}
inline static int32_t get_offset_of_m_parent_8() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2, ___m_parent_8)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_m_parent_8() const { return ___m_parent_8; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_m_parent_8() { return &___m_parent_8; }
inline void set_m_parent_8(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___m_parent_8 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_parent_8), (void*)value);
}
inline static int32_t get_offset_of_m_stateFlags_9() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2, ___m_stateFlags_9)); }
inline int32_t get_m_stateFlags_9() const { return ___m_stateFlags_9; }
inline int32_t* get_address_of_m_stateFlags_9() { return &___m_stateFlags_9; }
inline void set_m_stateFlags_9(int32_t value)
{
___m_stateFlags_9 = value;
}
inline static int32_t get_offset_of_m_continuationObject_28() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2, ___m_continuationObject_28)); }
inline RuntimeObject * get_m_continuationObject_28() const { return ___m_continuationObject_28; }
inline RuntimeObject ** get_address_of_m_continuationObject_28() { return &___m_continuationObject_28; }
inline void set_m_continuationObject_28(RuntimeObject * value)
{
___m_continuationObject_28 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_continuationObject_28), (void*)value);
}
inline static int32_t get_offset_of_m_contingentProperties_33() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2, ___m_contingentProperties_33)); }
inline ContingentProperties_t7149A27D01507C74E8BDAAA3848B45D2644FDF08 * get_m_contingentProperties_33() const { return ___m_contingentProperties_33; }
inline ContingentProperties_t7149A27D01507C74E8BDAAA3848B45D2644FDF08 ** get_address_of_m_contingentProperties_33() { return &___m_contingentProperties_33; }
inline void set_m_contingentProperties_33(ContingentProperties_t7149A27D01507C74E8BDAAA3848B45D2644FDF08 * value)
{
___m_contingentProperties_33 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_contingentProperties_33), (void*)value);
}
};
struct Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields
{
public:
// System.Int32 System.Threading.Tasks.Task::s_taskIdCounter
int32_t ___s_taskIdCounter_2;
// System.Threading.Tasks.TaskFactory System.Threading.Tasks.Task::s_factory
TaskFactory_tF3C6D983390ACFB40B4979E225368F78006D6155 * ___s_factory_3;
// System.Object System.Threading.Tasks.Task::s_taskCompletionSentinel
RuntimeObject * ___s_taskCompletionSentinel_29;
// System.Boolean System.Threading.Tasks.Task::s_asyncDebuggingEnabled
bool ___s_asyncDebuggingEnabled_30;
// System.Collections.Generic.Dictionary`2<System.Int32,System.Threading.Tasks.Task> System.Threading.Tasks.Task::s_currentActiveTasks
Dictionary_2_t70161CFEB8DA3C79E19E31D0ED948D3C2925095F * ___s_currentActiveTasks_31;
// System.Object System.Threading.Tasks.Task::s_activeTasksLock
RuntimeObject * ___s_activeTasksLock_32;
// System.Action`1<System.Object> System.Threading.Tasks.Task::s_taskCancelCallback
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * ___s_taskCancelCallback_34;
// System.Func`1<System.Threading.Tasks.Task_ContingentProperties> System.Threading.Tasks.Task::s_createContingentProperties
Func_1_t48C2978A48CE3F2F6EB5B6DE269D00746483BB1F * ___s_createContingentProperties_35;
// System.Threading.Tasks.Task System.Threading.Tasks.Task::s_completedTask
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___s_completedTask_36;
// System.Predicate`1<System.Threading.Tasks.Task> System.Threading.Tasks.Task::s_IsExceptionObservedByParentPredicate
Predicate_1_tF4286C34BB184CE5690FDCEBA7F09FC68D229335 * ___s_IsExceptionObservedByParentPredicate_37;
// System.Threading.ContextCallback System.Threading.Tasks.Task::s_ecCallback
ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 * ___s_ecCallback_38;
// System.Predicate`1<System.Object> System.Threading.Tasks.Task::s_IsTaskContinuationNullPredicate
Predicate_1_t4AA10EFD4C5497CA1CD0FE35A6AF5990FF5D0979 * ___s_IsTaskContinuationNullPredicate_39;
public:
inline static int32_t get_offset_of_s_taskIdCounter_2() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_taskIdCounter_2)); }
inline int32_t get_s_taskIdCounter_2() const { return ___s_taskIdCounter_2; }
inline int32_t* get_address_of_s_taskIdCounter_2() { return &___s_taskIdCounter_2; }
inline void set_s_taskIdCounter_2(int32_t value)
{
___s_taskIdCounter_2 = value;
}
inline static int32_t get_offset_of_s_factory_3() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_factory_3)); }
inline TaskFactory_tF3C6D983390ACFB40B4979E225368F78006D6155 * get_s_factory_3() const { return ___s_factory_3; }
inline TaskFactory_tF3C6D983390ACFB40B4979E225368F78006D6155 ** get_address_of_s_factory_3() { return &___s_factory_3; }
inline void set_s_factory_3(TaskFactory_tF3C6D983390ACFB40B4979E225368F78006D6155 * value)
{
___s_factory_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_factory_3), (void*)value);
}
inline static int32_t get_offset_of_s_taskCompletionSentinel_29() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_taskCompletionSentinel_29)); }
inline RuntimeObject * get_s_taskCompletionSentinel_29() const { return ___s_taskCompletionSentinel_29; }
inline RuntimeObject ** get_address_of_s_taskCompletionSentinel_29() { return &___s_taskCompletionSentinel_29; }
inline void set_s_taskCompletionSentinel_29(RuntimeObject * value)
{
___s_taskCompletionSentinel_29 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_taskCompletionSentinel_29), (void*)value);
}
inline static int32_t get_offset_of_s_asyncDebuggingEnabled_30() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_asyncDebuggingEnabled_30)); }
inline bool get_s_asyncDebuggingEnabled_30() const { return ___s_asyncDebuggingEnabled_30; }
inline bool* get_address_of_s_asyncDebuggingEnabled_30() { return &___s_asyncDebuggingEnabled_30; }
inline void set_s_asyncDebuggingEnabled_30(bool value)
{
___s_asyncDebuggingEnabled_30 = value;
}
inline static int32_t get_offset_of_s_currentActiveTasks_31() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_currentActiveTasks_31)); }
inline Dictionary_2_t70161CFEB8DA3C79E19E31D0ED948D3C2925095F * get_s_currentActiveTasks_31() const { return ___s_currentActiveTasks_31; }
inline Dictionary_2_t70161CFEB8DA3C79E19E31D0ED948D3C2925095F ** get_address_of_s_currentActiveTasks_31() { return &___s_currentActiveTasks_31; }
inline void set_s_currentActiveTasks_31(Dictionary_2_t70161CFEB8DA3C79E19E31D0ED948D3C2925095F * value)
{
___s_currentActiveTasks_31 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_currentActiveTasks_31), (void*)value);
}
inline static int32_t get_offset_of_s_activeTasksLock_32() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_activeTasksLock_32)); }
inline RuntimeObject * get_s_activeTasksLock_32() const { return ___s_activeTasksLock_32; }
inline RuntimeObject ** get_address_of_s_activeTasksLock_32() { return &___s_activeTasksLock_32; }
inline void set_s_activeTasksLock_32(RuntimeObject * value)
{
___s_activeTasksLock_32 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_activeTasksLock_32), (void*)value);
}
inline static int32_t get_offset_of_s_taskCancelCallback_34() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_taskCancelCallback_34)); }
inline Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * get_s_taskCancelCallback_34() const { return ___s_taskCancelCallback_34; }
inline Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 ** get_address_of_s_taskCancelCallback_34() { return &___s_taskCancelCallback_34; }
inline void set_s_taskCancelCallback_34(Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * value)
{
___s_taskCancelCallback_34 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_taskCancelCallback_34), (void*)value);
}
inline static int32_t get_offset_of_s_createContingentProperties_35() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_createContingentProperties_35)); }
inline Func_1_t48C2978A48CE3F2F6EB5B6DE269D00746483BB1F * get_s_createContingentProperties_35() const { return ___s_createContingentProperties_35; }
inline Func_1_t48C2978A48CE3F2F6EB5B6DE269D00746483BB1F ** get_address_of_s_createContingentProperties_35() { return &___s_createContingentProperties_35; }
inline void set_s_createContingentProperties_35(Func_1_t48C2978A48CE3F2F6EB5B6DE269D00746483BB1F * value)
{
___s_createContingentProperties_35 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_createContingentProperties_35), (void*)value);
}
inline static int32_t get_offset_of_s_completedTask_36() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_completedTask_36)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_s_completedTask_36() const { return ___s_completedTask_36; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_s_completedTask_36() { return &___s_completedTask_36; }
inline void set_s_completedTask_36(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___s_completedTask_36 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_completedTask_36), (void*)value);
}
inline static int32_t get_offset_of_s_IsExceptionObservedByParentPredicate_37() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_IsExceptionObservedByParentPredicate_37)); }
inline Predicate_1_tF4286C34BB184CE5690FDCEBA7F09FC68D229335 * get_s_IsExceptionObservedByParentPredicate_37() const { return ___s_IsExceptionObservedByParentPredicate_37; }
inline Predicate_1_tF4286C34BB184CE5690FDCEBA7F09FC68D229335 ** get_address_of_s_IsExceptionObservedByParentPredicate_37() { return &___s_IsExceptionObservedByParentPredicate_37; }
inline void set_s_IsExceptionObservedByParentPredicate_37(Predicate_1_tF4286C34BB184CE5690FDCEBA7F09FC68D229335 * value)
{
___s_IsExceptionObservedByParentPredicate_37 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_IsExceptionObservedByParentPredicate_37), (void*)value);
}
inline static int32_t get_offset_of_s_ecCallback_38() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_ecCallback_38)); }
inline ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 * get_s_ecCallback_38() const { return ___s_ecCallback_38; }
inline ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 ** get_address_of_s_ecCallback_38() { return &___s_ecCallback_38; }
inline void set_s_ecCallback_38(ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 * value)
{
___s_ecCallback_38 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_ecCallback_38), (void*)value);
}
inline static int32_t get_offset_of_s_IsTaskContinuationNullPredicate_39() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_StaticFields, ___s_IsTaskContinuationNullPredicate_39)); }
inline Predicate_1_t4AA10EFD4C5497CA1CD0FE35A6AF5990FF5D0979 * get_s_IsTaskContinuationNullPredicate_39() const { return ___s_IsTaskContinuationNullPredicate_39; }
inline Predicate_1_t4AA10EFD4C5497CA1CD0FE35A6AF5990FF5D0979 ** get_address_of_s_IsTaskContinuationNullPredicate_39() { return &___s_IsTaskContinuationNullPredicate_39; }
inline void set_s_IsTaskContinuationNullPredicate_39(Predicate_1_t4AA10EFD4C5497CA1CD0FE35A6AF5990FF5D0979 * value)
{
___s_IsTaskContinuationNullPredicate_39 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_IsTaskContinuationNullPredicate_39), (void*)value);
}
};
struct Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_ThreadStaticFields
{
public:
// System.Threading.Tasks.Task System.Threading.Tasks.Task::t_currentTask
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___t_currentTask_0;
// System.Threading.Tasks.StackGuard System.Threading.Tasks.Task::t_stackGuard
StackGuard_tE431ED3BBD1A18705FEE6F948EBF7FA2E99D64A9 * ___t_stackGuard_1;
public:
inline static int32_t get_offset_of_t_currentTask_0() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_ThreadStaticFields, ___t_currentTask_0)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_t_currentTask_0() const { return ___t_currentTask_0; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_t_currentTask_0() { return &___t_currentTask_0; }
inline void set_t_currentTask_0(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___t_currentTask_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___t_currentTask_0), (void*)value);
}
inline static int32_t get_offset_of_t_stackGuard_1() { return static_cast<int32_t>(offsetof(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_ThreadStaticFields, ___t_stackGuard_1)); }
inline StackGuard_tE431ED3BBD1A18705FEE6F948EBF7FA2E99D64A9 * get_t_stackGuard_1() const { return ___t_stackGuard_1; }
inline StackGuard_tE431ED3BBD1A18705FEE6F948EBF7FA2E99D64A9 ** get_address_of_t_stackGuard_1() { return &___t_stackGuard_1; }
inline void set_t_stackGuard_1(StackGuard_tE431ED3BBD1A18705FEE6F948EBF7FA2E99D64A9 * value)
{
___t_stackGuard_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___t_stackGuard_1), (void*)value);
}
};
// System.MulticastDelegate
struct MulticastDelegate_t : public Delegate_t
{
public:
// System.Delegate[] System.MulticastDelegate::delegates
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* ___delegates_11;
public:
inline static int32_t get_offset_of_delegates_11() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___delegates_11)); }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* get_delegates_11() const { return ___delegates_11; }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86** get_address_of_delegates_11() { return &___delegates_11; }
inline void set_delegates_11(DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* value)
{
___delegates_11 = value;
Il2CppCodeGenWriteBarrier((void**)(&___delegates_11), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_pinvoke : public Delegate_t_marshaled_pinvoke
{
Delegate_t_marshaled_pinvoke** ___delegates_11;
};
// Native definition for COM marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_com : public Delegate_t_marshaled_com
{
Delegate_t_marshaled_com** ___delegates_11;
};
// System.Runtime.CompilerServices.AsyncTaskMethodBuilder
struct AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487
{
public:
// System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Threading.Tasks.VoidTaskResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder::m_builder
AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 ___m_builder_1;
public:
inline static int32_t get_offset_of_m_builder_1() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487, ___m_builder_1)); }
inline AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 get_m_builder_1() const { return ___m_builder_1; }
inline AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 * get_address_of_m_builder_1() { return &___m_builder_1; }
inline void set_m_builder_1(AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 value)
{
___m_builder_1 = value;
Il2CppCodeGenWriteBarrier((void**)&((&(((&___m_builder_1))->___m_coreState_1))->___m_stateMachine_0), (void*)NULL);
#if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS
Il2CppCodeGenWriteBarrier((void**)&((&(((&___m_builder_1))->___m_coreState_1))->___m_defaultContextAction_1), (void*)NULL);
#endif
#if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS
Il2CppCodeGenWriteBarrier((void**)&(((&___m_builder_1))->___m_task_2), (void*)NULL);
#endif
}
};
struct AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_StaticFields
{
public:
// System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder::s_cachedCompleted
Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * ___s_cachedCompleted_0;
public:
inline static int32_t get_offset_of_s_cachedCompleted_0() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_StaticFields, ___s_cachedCompleted_0)); }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * get_s_cachedCompleted_0() const { return ___s_cachedCompleted_0; }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 ** get_address_of_s_cachedCompleted_0() { return &___s_cachedCompleted_0; }
inline void set_s_cachedCompleted_0(Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * value)
{
___s_cachedCompleted_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_cachedCompleted_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.AsyncTaskMethodBuilder
struct AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_marshaled_pinvoke
{
AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 ___m_builder_1;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.AsyncTaskMethodBuilder
struct AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_marshaled_com
{
AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 ___m_builder_1;
};
// System.SystemException
struct SystemException_t5380468142AA850BE4A341D7AF3EAB9C78746782 : public Exception_t
{
public:
public:
};
// System.Type
struct Type_t : public MemberInfo_t
{
public:
// System.RuntimeTypeHandle System.Type::_impl
RuntimeTypeHandle_t7B542280A22F0EC4EAC2061C29178845847A8B2D ____impl_9;
public:
inline static int32_t get_offset_of__impl_9() { return static_cast<int32_t>(offsetof(Type_t, ____impl_9)); }
inline RuntimeTypeHandle_t7B542280A22F0EC4EAC2061C29178845847A8B2D get__impl_9() const { return ____impl_9; }
inline RuntimeTypeHandle_t7B542280A22F0EC4EAC2061C29178845847A8B2D * get_address_of__impl_9() { return &____impl_9; }
inline void set__impl_9(RuntimeTypeHandle_t7B542280A22F0EC4EAC2061C29178845847A8B2D value)
{
____impl_9 = value;
}
};
struct Type_t_StaticFields
{
public:
// System.Reflection.MemberFilter System.Type::FilterAttribute
MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 * ___FilterAttribute_0;
// System.Reflection.MemberFilter System.Type::FilterName
MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 * ___FilterName_1;
// System.Reflection.MemberFilter System.Type::FilterNameIgnoreCase
MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 * ___FilterNameIgnoreCase_2;
// System.Object System.Type::Missing
RuntimeObject * ___Missing_3;
// System.Char System.Type::Delimiter
Il2CppChar ___Delimiter_4;
// System.Type[] System.Type::EmptyTypes
TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* ___EmptyTypes_5;
// System.Reflection.Binder System.Type::defaultBinder
Binder_t4D5CB06963501D32847C057B57157D6DC49CA759 * ___defaultBinder_6;
public:
inline static int32_t get_offset_of_FilterAttribute_0() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___FilterAttribute_0)); }
inline MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 * get_FilterAttribute_0() const { return ___FilterAttribute_0; }
inline MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 ** get_address_of_FilterAttribute_0() { return &___FilterAttribute_0; }
inline void set_FilterAttribute_0(MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 * value)
{
___FilterAttribute_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FilterAttribute_0), (void*)value);
}
inline static int32_t get_offset_of_FilterName_1() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___FilterName_1)); }
inline MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 * get_FilterName_1() const { return ___FilterName_1; }
inline MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 ** get_address_of_FilterName_1() { return &___FilterName_1; }
inline void set_FilterName_1(MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 * value)
{
___FilterName_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FilterName_1), (void*)value);
}
inline static int32_t get_offset_of_FilterNameIgnoreCase_2() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___FilterNameIgnoreCase_2)); }
inline MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 * get_FilterNameIgnoreCase_2() const { return ___FilterNameIgnoreCase_2; }
inline MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 ** get_address_of_FilterNameIgnoreCase_2() { return &___FilterNameIgnoreCase_2; }
inline void set_FilterNameIgnoreCase_2(MemberFilter_t25C1BD92C42BE94426E300787C13C452CB89B381 * value)
{
___FilterNameIgnoreCase_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FilterNameIgnoreCase_2), (void*)value);
}
inline static int32_t get_offset_of_Missing_3() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___Missing_3)); }
inline RuntimeObject * get_Missing_3() const { return ___Missing_3; }
inline RuntimeObject ** get_address_of_Missing_3() { return &___Missing_3; }
inline void set_Missing_3(RuntimeObject * value)
{
___Missing_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___Missing_3), (void*)value);
}
inline static int32_t get_offset_of_Delimiter_4() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___Delimiter_4)); }
inline Il2CppChar get_Delimiter_4() const { return ___Delimiter_4; }
inline Il2CppChar* get_address_of_Delimiter_4() { return &___Delimiter_4; }
inline void set_Delimiter_4(Il2CppChar value)
{
___Delimiter_4 = value;
}
inline static int32_t get_offset_of_EmptyTypes_5() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___EmptyTypes_5)); }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* get_EmptyTypes_5() const { return ___EmptyTypes_5; }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F** get_address_of_EmptyTypes_5() { return &___EmptyTypes_5; }
inline void set_EmptyTypes_5(TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* value)
{
___EmptyTypes_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___EmptyTypes_5), (void*)value);
}
inline static int32_t get_offset_of_defaultBinder_6() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___defaultBinder_6)); }
inline Binder_t4D5CB06963501D32847C057B57157D6DC49CA759 * get_defaultBinder_6() const { return ___defaultBinder_6; }
inline Binder_t4D5CB06963501D32847C057B57157D6DC49CA759 ** get_address_of_defaultBinder_6() { return &___defaultBinder_6; }
inline void set_defaultBinder_6(Binder_t4D5CB06963501D32847C057B57157D6DC49CA759 * value)
{
___defaultBinder_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___defaultBinder_6), (void*)value);
}
};
// System.Action
struct Action_t591D2A86165F896B4B800BB5C25CE18672A55579 : public MulticastDelegate_t
{
public:
public:
};
// System.Action`1<System.Object>
struct Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 : public MulticastDelegate_t
{
public:
public:
};
// System.ArgumentException
struct ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1 : public SystemException_t5380468142AA850BE4A341D7AF3EAB9C78746782
{
public:
// System.String System.ArgumentException::m_paramName
String_t* ___m_paramName_17;
public:
inline static int32_t get_offset_of_m_paramName_17() { return static_cast<int32_t>(offsetof(ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1, ___m_paramName_17)); }
inline String_t* get_m_paramName_17() const { return ___m_paramName_17; }
inline String_t** get_address_of_m_paramName_17() { return &___m_paramName_17; }
inline void set_m_paramName_17(String_t* value)
{
___m_paramName_17 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_paramName_17), (void*)value);
}
};
// System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder
struct AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582
{
public:
// System.Runtime.CompilerServices.AsyncTaskMethodBuilder System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::_methodBuilder
AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 ____methodBuilder_0;
// System.Boolean System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::_haveResult
bool ____haveResult_1;
// System.Boolean System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::_useBuilder
bool ____useBuilder_2;
public:
inline static int32_t get_offset_of__methodBuilder_0() { return static_cast<int32_t>(offsetof(AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582, ____methodBuilder_0)); }
inline AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 get__methodBuilder_0() const { return ____methodBuilder_0; }
inline AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 * get_address_of__methodBuilder_0() { return &____methodBuilder_0; }
inline void set__methodBuilder_0(AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 value)
{
____methodBuilder_0 = value;
Il2CppCodeGenWriteBarrier((void**)&((&((&(((&____methodBuilder_0))->___m_builder_1))->___m_coreState_1))->___m_stateMachine_0), (void*)NULL);
#if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS
Il2CppCodeGenWriteBarrier((void**)&((&((&(((&____methodBuilder_0))->___m_builder_1))->___m_coreState_1))->___m_defaultContextAction_1), (void*)NULL);
#endif
#if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS
Il2CppCodeGenWriteBarrier((void**)&((&(((&____methodBuilder_0))->___m_builder_1))->___m_task_2), (void*)NULL);
#endif
}
inline static int32_t get_offset_of__haveResult_1() { return static_cast<int32_t>(offsetof(AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582, ____haveResult_1)); }
inline bool get__haveResult_1() const { return ____haveResult_1; }
inline bool* get_address_of__haveResult_1() { return &____haveResult_1; }
inline void set__haveResult_1(bool value)
{
____haveResult_1 = value;
}
inline static int32_t get_offset_of__useBuilder_2() { return static_cast<int32_t>(offsetof(AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582, ____useBuilder_2)); }
inline bool get__useBuilder_2() const { return ____useBuilder_2; }
inline bool* get_address_of__useBuilder_2() { return &____useBuilder_2; }
inline void set__useBuilder_2(bool value)
{
____useBuilder_2 = value;
}
};
// System.ArgumentNullException
struct ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD : public ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1
{
public:
public:
};
// System.ArgumentOutOfRangeException
struct ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA : public ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1
{
public:
// System.Object System.ArgumentOutOfRangeException::m_actualValue
RuntimeObject * ___m_actualValue_19;
public:
inline static int32_t get_offset_of_m_actualValue_19() { return static_cast<int32_t>(offsetof(ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA, ___m_actualValue_19)); }
inline RuntimeObject * get_m_actualValue_19() const { return ___m_actualValue_19; }
inline RuntimeObject ** get_address_of_m_actualValue_19() { return &___m_actualValue_19; }
inline void set_m_actualValue_19(RuntimeObject * value)
{
___m_actualValue_19 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_actualValue_19), (void*)value);
}
};
struct ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA_StaticFields
{
public:
// System.String modreq(System.Runtime.CompilerServices.IsVolatile) System.ArgumentOutOfRangeException::_rangeMessage
String_t* ____rangeMessage_18;
public:
inline static int32_t get_offset_of__rangeMessage_18() { return static_cast<int32_t>(offsetof(ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA_StaticFields, ____rangeMessage_18)); }
inline String_t* get__rangeMessage_18() const { return ____rangeMessage_18; }
inline String_t** get_address_of__rangeMessage_18() { return &____rangeMessage_18; }
inline void set__rangeMessage_18(String_t* value)
{
____rangeMessage_18 = value;
Il2CppCodeGenWriteBarrier((void**)(&____rangeMessage_18), (void*)value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// !!0 System.Runtime.CompilerServices.Unsafe::As<System.Object>(System.Object)
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR RuntimeObject * Unsafe_As_TisRuntimeObject_m3FB128D6DA79B4CC3E3E5A48FC6401A54C943FE3_gshared_inline (RuntimeObject * ___o0, const RuntimeMethod* method);
// System.Void System.Action`1<System.Object>::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Action_1__ctor_mAFC7442D9D3CEC6701C3C5599F8CF12476095510_gshared (Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method);
// System.Void System.Attribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Attribute__ctor_m45CAD4B01265CC84CC5A84F62EE2DBE85DE89EC0 (Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74 * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncTaskMethodBuilder_SetStateMachine_mB5DD68F7C49EA6D452AEBA02B1B98AED898C3C25 (AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 * __this, RuntimeObject* ___stateMachine0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncValueTaskMethodBuilder_SetStateMachine_mECC5684E2489B751EEB4406987E2F885276EF945 (AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * __this, RuntimeObject* ___stateMachine0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetResult()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncTaskMethodBuilder_SetResult_m151016FB698F3BB34A73BAE693A97513A7E4C838 (AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::SetResult()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncValueTaskMethodBuilder_SetResult_m1C761283FC6E934664CD7C11D721946150C9B77D (AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetException(System.Exception)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncTaskMethodBuilder_SetException_m370C484922A63A6EF96E241D1370B8814F1F2D6B (AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 * __this, Exception_t * ___exception0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::SetException(System.Exception)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncValueTaskMethodBuilder_SetException_mA66170EFA86BDF3E3773AC7F72CBDFF78B4B5692 (AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * __this, Exception_t * ___exception0, const RuntimeMethod* method);
// System.Threading.Tasks.Task System.Runtime.CompilerServices.AsyncTaskMethodBuilder::get_Task()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * AsyncTaskMethodBuilder_get_Task_m3E45BC00F7D224FEA04AB9BF26DB52E131D33022 (AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 * __this, const RuntimeMethod* method);
// System.Void System.Threading.Tasks.ValueTask::.ctor(System.Threading.Tasks.Task)
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ValueTask__ctor_m2D1B53DB3E4B9479B99045F1E3A008AD4C6FABF0_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___task0, const RuntimeMethod* method);
// System.Threading.Tasks.ValueTask System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::get_Task()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 AsyncValueTaskMethodBuilder_get_Task_m5B9D17533E06E43D97E8327A0A22B1970DF16C02 (AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable::.ctor(System.Threading.Tasks.ValueTask)
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaitable__ctor_m9ABACE38D59514F98DE2D5B4120EFC255FE483A0_inline (ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___value0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable/ConfiguredValueTaskAwaiter::.ctor(System.Threading.Tasks.ValueTask)
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter__ctor_m825BD4B673180D001A6B85D40CEE741A3D6F784C_inline (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___value0, const RuntimeMethod* method);
// System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable/ConfiguredValueTaskAwaiter System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable::GetAwaiter()
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE ConfiguredValueTaskAwaitable_GetAwaiter_m7ED1F5FD3514FFCB669AFC067546697CCBAED3A8_inline (ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 * __this, const RuntimeMethod* method);
// System.Boolean System.Threading.Tasks.ValueTask::get_IsCompleted()
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR bool ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, const RuntimeMethod* method);
// System.Boolean System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable/ConfiguredValueTaskAwaiter::get_IsCompleted()
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR bool ConfiguredValueTaskAwaiter_get_IsCompleted_m1BF68CFD9CA68CFF23929E10187C40C043C6F887_inline (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, const RuntimeMethod* method);
// System.Void System.Threading.Tasks.ValueTask::ThrowIfCompletedUnsuccessfully()
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643C_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable/ConfiguredValueTaskAwaiter::GetResult()
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter_GetResult_m91DBF8595C0BD70F2C8F92B5690C16EDC68D3698_inline (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, const RuntimeMethod* method);
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable System.Threading.Tasks.Task::ConfigureAwait(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 Task_ConfigureAwait_m2FB91172F9031B0CC520D9D09B658ACC5FD6CE02 (Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * __this, bool ___continueOnCapturedContext0, const RuntimeMethod* method);
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter System.Runtime.CompilerServices.ConfiguredTaskAwaitable::GetAwaiter()
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 ConfiguredTaskAwaitable_GetAwaiter_m1EF40F198D32924E2D0F41E20B99CADBF5DDD303_inline (ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter::OnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConfiguredTaskAwaiter_OnCompleted_m847B280BD99B29C570B6EC0993E6BC8977871872 (ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method);
// !!0 System.Runtime.CompilerServices.Unsafe::As<System.Threading.Tasks.Sources.IValueTaskSource>(System.Object)
inline RuntimeObject* Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_inline (RuntimeObject * ___o0, const RuntimeMethod* method)
{
return (( RuntimeObject* (*) (RuntimeObject *, const RuntimeMethod*))Unsafe_As_TisRuntimeObject_m3FB128D6DA79B4CC3E3E5A48FC6401A54C943FE3_gshared_inline)(___o0, method);
}
// System.Threading.Tasks.Task System.Threading.Tasks.ValueTask::get_CompletedTask()
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AE_inline (const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable/ConfiguredValueTaskAwaiter::OnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter_OnCompleted_m3383D45694A5326B01E5EF1EF09A72AE88D54A88 (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter::UnsafeOnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConfiguredTaskAwaiter_UnsafeOnCompleted_mE7338A955A4B573FED1F1271B7BEB567BDFC9C81 (ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable/ConfiguredValueTaskAwaiter::UnsafeOnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter_UnsafeOnCompleted_mC7380318BD43B545EDEF1CE153DC118DFB396A14 (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method);
// System.Runtime.CompilerServices.TaskAwaiter System.Threading.Tasks.Task::GetAwaiter()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F Task_GetAwaiter_m73027D5E4C16E961C658B83526BED8E32FD2AC6C (Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.TaskAwaiter::OnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TaskAwaiter_OnCompleted_mE04C56A773876AE128C040BC6B22DD79BF7857C2 (TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ValueTaskAwaiter::OnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ValueTaskAwaiter_OnCompleted_m0216EBC6CD5945B8AC974A84AE311F917E92929B (ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2 * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.TaskAwaiter::UnsafeOnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TaskAwaiter_UnsafeOnCompleted_mE7225A8038BD7F4A0BEED46F45FC83EA784D4AE4 (TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ValueTaskAwaiter::UnsafeOnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ValueTaskAwaiter_UnsafeOnCompleted_mDFDFE4DD17CC048418089BB5BAB89151943C77D4 (ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2 * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method);
// System.Void System.Action`1<System.Object>::.ctor(System.Object,System.IntPtr)
inline void Action_1__ctor_mAFC7442D9D3CEC6701C3C5599F8CF12476095510 (Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method)
{
(( void (*) (Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 *, RuntimeObject *, intptr_t, const RuntimeMethod*))Action_1__ctor_mAFC7442D9D3CEC6701C3C5599F8CF12476095510_gshared)(__this, ___object0, ___method1, method);
}
// System.Void System.Runtime.CompilerServices.ValueTaskAwaiter/<>c::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec__ctor_mF5ACB0D5E6A133FC2A07646156453F1289C42493 (U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 * __this, const RuntimeMethod* method);
// System.Void System.Object::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object__ctor_m925ECA5E85CA100E3FB86A4F9E15C120E9A184C0 (RuntimeObject * __this, const RuntimeMethod* method);
// System.Void System.ThrowHelper::ThrowArgumentOutOfRangeException(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ThrowHelper_ThrowArgumentOutOfRangeException_mE8298DEB8A561B73850C8AAFDE78F0C7D16849F7 (int32_t ___argument0, const RuntimeMethod* method);
// System.Void System.Action::Invoke()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Action_Invoke_mC8D676E5DDF967EC5D23DD0E96FB52AA499817FD (Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * __this, const RuntimeMethod* method);
// System.Void System.ThrowHelper::ThrowArgumentNullException(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ThrowHelper_ThrowArgumentNullException_mC5A28A568922C2B81B27E6552EA9B8C4F175B75E (int32_t ___argument0, const RuntimeMethod* method);
// System.Void System.Threading.Tasks.ValueTask::.ctor(System.Object,System.Int16,System.Boolean)
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ValueTask__ctor_mC747E2D490247F8845D7EE4906FFEAAF3EC785C2_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, RuntimeObject * ___obj0, int16_t ___token1, bool ___continueOnCapturedContext2, const RuntimeMethod* method);
// System.Int32 System.Threading.Tasks.ValueTask::GetHashCode()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t ValueTask_GetHashCode_m4D8D18790BFDA913684D993B491524A03A7FC2A5 (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, const RuntimeMethod* method);
// System.Boolean System.Threading.Tasks.ValueTask::Equals(System.Threading.Tasks.ValueTask)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ValueTask_Equals_m7A4A016C7C23B7249DD4B665BAC9CFA862F529D6 (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___other0, const RuntimeMethod* method);
// System.Boolean System.Threading.Tasks.ValueTask::Equals(System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ValueTask_Equals_m3D17AA6F653005E4575821F43FF29BB4EB9D559D (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method);
// System.Boolean System.Threading.Tasks.Task::get_IsCompleted()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Task_get_IsCompleted_mA675F47CE1DBD1948BDC9215DCAE93F07FC32E19 (Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.TaskAwaiter::GetResult()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TaskAwaiter_GetResult_m89868C01592AC2B06CE1FD42D9B9C187C6FD928A (TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F * __this, const RuntimeMethod* method);
// System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable System.Threading.Tasks.ValueTask::ConfigureAwait(System.Boolean)
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 ValueTask_ConfigureAwait_m9B959697968FB042E367767086622FF60CCABA45_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, bool ___continueOnCapturedContext0, const RuntimeMethod* method);
// System.Void System.Threading.CancellationToken::.ctor(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void CancellationToken__ctor_mEEC34A64046AD7A84BEA348A2F1AE72C9F483C7E (CancellationToken_t9E956952F7F20908F2AE72EDF36D97E6C7DB63AB * __this, bool ___canceled0, const RuntimeMethod* method);
// System.Threading.Tasks.Task System.Threading.Tasks.Task::Delay(System.Int32,System.Threading.CancellationToken)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * Task_Delay_mE765C93596171D57A356BCCCEFE49392CA925AFA (int32_t ___millisecondsDelay0, CancellationToken_t9E956952F7F20908F2AE72EDF36D97E6C7DB63AB ___cancellationToken1, const RuntimeMethod* method);
// System.Threading.Tasks.Task System.Threading.Tasks.Task::Delay(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * Task_Delay_m193E6692B81A2A6C45F5FAE08CF79FA06FC7DA60 (int32_t ___millisecondsDelay0, const RuntimeMethod* method);
// System.ArgumentNullException System.ThrowHelper::GetArgumentNullException(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD * ThrowHelper_GetArgumentNullException_m064A0F1715A8BA3C28E35555C1B860B4AD5A4174 (int32_t ___argument0, const RuntimeMethod* method);
// System.ArgumentOutOfRangeException System.ThrowHelper::GetArgumentOutOfRangeException(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA * ThrowHelper_GetArgumentOutOfRangeException_mB8C2EAAEEACB1B6B181B747BE5BF61D08FC096A4 (int32_t ___argument0, const RuntimeMethod* method);
// System.String System.ThrowHelper::GetArgumentName(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_NO_INLINE IL2CPP_METHOD_ATTR String_t* ThrowHelper_GetArgumentName_m4636389F5A3A103B7F4BB4A13FDB503DC87EBD86 (int32_t ___argument0, const RuntimeMethod* method);
// System.Void System.ArgumentNullException::.ctor(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ArgumentNullException__ctor_mEE0C0D6FCB2D08CD7967DBB1329A0854BBED49ED (ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD * __this, String_t* ___paramName0, const RuntimeMethod* method);
// System.Void System.ArgumentOutOfRangeException::.ctor(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ArgumentOutOfRangeException__ctor_m6B36E60C989DC798A8B44556DB35960282B133A6 (ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA * __this, String_t* ___paramName0, const RuntimeMethod* method);
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void Microsoft.CodeAnalysis.EmbeddedAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void EmbeddedAttribute__ctor_mE4A4C706AE8E23B43A079494245B8D62015C4414 (EmbeddedAttribute_tB6F2FE3275C0DB63CD5EB503DCB9CA5FE2089788 * __this, const RuntimeMethod* method)
{
{
Attribute__ctor_m45CAD4B01265CC84CC5A84F62EE2DBE85DE89EC0(__this, /*hidden argument*/NULL);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void System.Diagnostics.StackTraceHiddenAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StackTraceHiddenAttribute__ctor_m0AA6C37D2CABC6A177BE7A593338955E7193AF26 (StackTraceHiddenAttribute_tE55311D63F46448977EBB73FBADC0ADC60BA48BC * __this, const RuntimeMethod* method)
{
{
Attribute__ctor_m45CAD4B01265CC84CC5A84F62EE2DBE85DE89EC0(__this, /*hidden argument*/NULL);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void System.Runtime.CompilerServices.AsyncMethodBuilderAttribute::.ctor(System.Type)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncMethodBuilderAttribute__ctor_m178699E81CB7C0BAEB901EB2613B7FC6E5466EBA (AsyncMethodBuilderAttribute_t45DF90A1F4957B1916C0DF08E1869FE7788B7F65 * __this, Type_t * ___builderType0, const RuntimeMethod* method)
{
{
Attribute__ctor_m45CAD4B01265CC84CC5A84F62EE2DBE85DE89EC0(__this, /*hidden argument*/NULL);
Type_t * L_0 = ___builderType0;
__this->set_U3CBuilderTypeU3Ek__BackingField_0(L_0);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::Create()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 AsyncValueTaskMethodBuilder_Create_mBFCFAF8F9F7ECAE56BC85691C61622A593585355 (const RuntimeMethod* method)
{
AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 V_0;
memset((&V_0), 0, sizeof(V_0));
{
il2cpp_codegen_initobj((&V_0), sizeof(AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 ));
AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 L_0 = V_0;
return L_0;
}
}
// System.Void System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncValueTaskMethodBuilder_SetStateMachine_mECC5684E2489B751EEB4406987E2F885276EF945 (AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * __this, RuntimeObject* ___stateMachine0, const RuntimeMethod* method)
{
{
AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 * L_0 = __this->get_address_of__methodBuilder_0();
RuntimeObject* L_1 = ___stateMachine0;
AsyncTaskMethodBuilder_SetStateMachine_mB5DD68F7C49EA6D452AEBA02B1B98AED898C3C25((AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 *)L_0, L_1, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C void AsyncValueTaskMethodBuilder_SetStateMachine_mECC5684E2489B751EEB4406987E2F885276EF945_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___stateMachine0, const RuntimeMethod* method)
{
AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * _thisAdjusted = reinterpret_cast<AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 *>(__this + 1);
AsyncValueTaskMethodBuilder_SetStateMachine_mECC5684E2489B751EEB4406987E2F885276EF945(_thisAdjusted, ___stateMachine0, method);
}
// System.Void System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::SetResult()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncValueTaskMethodBuilder_SetResult_m1C761283FC6E934664CD7C11D721946150C9B77D (AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * __this, const RuntimeMethod* method)
{
{
bool L_0 = __this->get__useBuilder_2();
if (!L_0)
{
goto IL_0014;
}
}
{
AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 * L_1 = __this->get_address_of__methodBuilder_0();
AsyncTaskMethodBuilder_SetResult_m151016FB698F3BB34A73BAE693A97513A7E4C838((AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 *)L_1, /*hidden argument*/NULL);
return;
}
IL_0014:
{
__this->set__haveResult_1((bool)1);
return;
}
}
IL2CPP_EXTERN_C void AsyncValueTaskMethodBuilder_SetResult_m1C761283FC6E934664CD7C11D721946150C9B77D_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * _thisAdjusted = reinterpret_cast<AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 *>(__this + 1);
AsyncValueTaskMethodBuilder_SetResult_m1C761283FC6E934664CD7C11D721946150C9B77D(_thisAdjusted, method);
}
// System.Void System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::SetException(System.Exception)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AsyncValueTaskMethodBuilder_SetException_mA66170EFA86BDF3E3773AC7F72CBDFF78B4B5692 (AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * __this, Exception_t * ___exception0, const RuntimeMethod* method)
{
{
AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 * L_0 = __this->get_address_of__methodBuilder_0();
Exception_t * L_1 = ___exception0;
AsyncTaskMethodBuilder_SetException_m370C484922A63A6EF96E241D1370B8814F1F2D6B((AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 *)L_0, L_1, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C void AsyncValueTaskMethodBuilder_SetException_mA66170EFA86BDF3E3773AC7F72CBDFF78B4B5692_AdjustorThunk (RuntimeObject * __this, Exception_t * ___exception0, const RuntimeMethod* method)
{
AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * _thisAdjusted = reinterpret_cast<AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 *>(__this + 1);
AsyncValueTaskMethodBuilder_SetException_mA66170EFA86BDF3E3773AC7F72CBDFF78B4B5692(_thisAdjusted, ___exception0, method);
}
// System.Threading.Tasks.ValueTask System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder::get_Task()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 AsyncValueTaskMethodBuilder_get_Task_m5B9D17533E06E43D97E8327A0A22B1970DF16C02 (AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * __this, const RuntimeMethod* method)
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 V_0;
memset((&V_0), 0, sizeof(V_0));
{
bool L_0 = __this->get__haveResult_1();
if (!L_0)
{
goto IL_0012;
}
}
{
il2cpp_codegen_initobj((&V_0), sizeof(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ));
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_1 = V_0;
return L_1;
}
IL_0012:
{
__this->set__useBuilder_2((bool)1);
AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 * L_2 = __this->get_address_of__methodBuilder_0();
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_3 = AsyncTaskMethodBuilder_get_Task_m3E45BC00F7D224FEA04AB9BF26DB52E131D33022((AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487 *)L_2, /*hidden argument*/NULL);
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_4;
memset((&L_4), 0, sizeof(L_4));
ValueTask__ctor_m2D1B53DB3E4B9479B99045F1E3A008AD4C6FABF0_inline((&L_4), L_3, /*hidden argument*/NULL);
return L_4;
}
}
IL2CPP_EXTERN_C ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 AsyncValueTaskMethodBuilder_get_Task_m5B9D17533E06E43D97E8327A0A22B1970DF16C02_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 * _thisAdjusted = reinterpret_cast<AsyncValueTaskMethodBuilder_t3078E08FC39C92B9B8029F57F703F290BDE29582 *>(__this + 1);
return AsyncValueTaskMethodBuilder_get_Task_m5B9D17533E06E43D97E8327A0A22B1970DF16C02(_thisAdjusted, method);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable::.ctor(System.Threading.Tasks.ValueTask)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaitable__ctor_m9ABACE38D59514F98DE2D5B4120EFC255FE483A0 (ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___value0, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_0 = ___value0;
__this->set__value_0(L_0);
return;
}
}
IL2CPP_EXTERN_C void ConfiguredValueTaskAwaitable__ctor_m9ABACE38D59514F98DE2D5B4120EFC255FE483A0_AdjustorThunk (RuntimeObject * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___value0, const RuntimeMethod* method)
{
ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 * _thisAdjusted = reinterpret_cast<ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 *>(__this + 1);
ConfiguredValueTaskAwaitable__ctor_m9ABACE38D59514F98DE2D5B4120EFC255FE483A0_inline(_thisAdjusted, ___value0, method);
}
// System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable_ConfiguredValueTaskAwaiter System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable::GetAwaiter()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE ConfiguredValueTaskAwaitable_GetAwaiter_m7ED1F5FD3514FFCB669AFC067546697CCBAED3A8 (ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 * __this, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_0 = __this->get__value_0();
ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE L_1;
memset((&L_1), 0, sizeof(L_1));
ConfiguredValueTaskAwaiter__ctor_m825BD4B673180D001A6B85D40CEE741A3D6F784C_inline((&L_1), L_0, /*hidden argument*/NULL);
return L_1;
}
}
IL2CPP_EXTERN_C ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE ConfiguredValueTaskAwaitable_GetAwaiter_m7ED1F5FD3514FFCB669AFC067546697CCBAED3A8_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 * _thisAdjusted = reinterpret_cast<ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 *>(__this + 1);
return ConfiguredValueTaskAwaitable_GetAwaiter_m7ED1F5FD3514FFCB669AFC067546697CCBAED3A8_inline(_thisAdjusted, method);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable_ConfiguredValueTaskAwaiter::.ctor(System.Threading.Tasks.ValueTask)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter__ctor_m825BD4B673180D001A6B85D40CEE741A3D6F784C (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___value0, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_0 = ___value0;
__this->set__value_0(L_0);
return;
}
}
IL2CPP_EXTERN_C void ConfiguredValueTaskAwaiter__ctor_m825BD4B673180D001A6B85D40CEE741A3D6F784C_AdjustorThunk (RuntimeObject * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___value0, const RuntimeMethod* method)
{
ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * _thisAdjusted = reinterpret_cast<ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE *>(__this + 1);
ConfiguredValueTaskAwaiter__ctor_m825BD4B673180D001A6B85D40CEE741A3D6F784C_inline(_thisAdjusted, ___value0, method);
}
// System.Boolean System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable_ConfiguredValueTaskAwaiter::get_IsCompleted()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ConfiguredValueTaskAwaiter_get_IsCompleted_m1BF68CFD9CA68CFF23929E10187C40C043C6F887 (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_0 = __this->get_address_of__value_0();
bool L_1 = ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50_inline((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *)L_0, /*hidden argument*/NULL);
return L_1;
}
}
IL2CPP_EXTERN_C bool ConfiguredValueTaskAwaiter_get_IsCompleted_m1BF68CFD9CA68CFF23929E10187C40C043C6F887_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * _thisAdjusted = reinterpret_cast<ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE *>(__this + 1);
return ConfiguredValueTaskAwaiter_get_IsCompleted_m1BF68CFD9CA68CFF23929E10187C40C043C6F887_inline(_thisAdjusted, method);
}
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable_ConfiguredValueTaskAwaiter::GetResult()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter_GetResult_m91DBF8595C0BD70F2C8F92B5690C16EDC68D3698 (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_0 = __this->get_address_of__value_0();
ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643C_inline((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *)L_0, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C void ConfiguredValueTaskAwaiter_GetResult_m91DBF8595C0BD70F2C8F92B5690C16EDC68D3698_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * _thisAdjusted = reinterpret_cast<ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE *>(__this + 1);
ConfiguredValueTaskAwaiter_GetResult_m91DBF8595C0BD70F2C8F92B5690C16EDC68D3698_inline(_thisAdjusted, method);
}
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable_ConfiguredValueTaskAwaiter::OnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter_OnCompleted_m3383D45694A5326B01E5EF1EF09A72AE88D54A88 (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ConfiguredValueTaskAwaiter_OnCompleted_m3383D45694A5326B01E5EF1EF09A72AE88D54A88_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
RuntimeObject * V_0 = NULL;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * V_1 = NULL;
ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 V_2;
memset((&V_2), 0, sizeof(V_2));
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 V_3;
memset((&V_3), 0, sizeof(V_3));
int32_t G_B5_0 = 0;
int16_t G_B5_1 = 0;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * G_B5_2 = NULL;
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * G_B5_3 = NULL;
RuntimeObject* G_B5_4 = NULL;
int32_t G_B4_0 = 0;
int16_t G_B4_1 = 0;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * G_B4_2 = NULL;
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * G_B4_3 = NULL;
RuntimeObject* G_B4_4 = NULL;
int32_t G_B6_0 = 0;
int32_t G_B6_1 = 0;
int16_t G_B6_2 = 0;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * G_B6_3 = NULL;
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * G_B6_4 = NULL;
RuntimeObject* G_B6_5 = NULL;
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_0 = __this->get_address_of__value_0();
RuntimeObject * L_1 = L_0->get__obj_2();
V_0 = L_1;
RuntimeObject * L_2 = V_0;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_3 = ((Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 *)IsInstClass((RuntimeObject*)L_2, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var));
V_1 = L_3;
if (!L_3)
{
goto IL_0039;
}
}
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_4 = V_1;
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_5 = __this->get_address_of__value_0();
bool L_6 = L_5->get__continueOnCapturedContext_4();
NullCheck(L_4);
ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 L_7 = Task_ConfigureAwait_m2FB91172F9031B0CC520D9D09B658ACC5FD6CE02(L_4, L_6, /*hidden argument*/NULL);
V_2 = L_7;
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 L_8 = ConfiguredTaskAwaitable_GetAwaiter_m1EF40F198D32924E2D0F41E20B99CADBF5DDD303_inline((ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 *)(&V_2), /*hidden argument*/NULL);
V_3 = L_8;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_9 = ___continuation0;
ConfiguredTaskAwaiter_OnCompleted_m847B280BD99B29C570B6EC0993E6BC8977871872((ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 *)(&V_3), L_9, /*hidden argument*/NULL);
return;
}
IL_0039:
{
RuntimeObject * L_10 = V_0;
if (!L_10)
{
goto IL_006c;
}
}
{
RuntimeObject * L_11 = V_0;
RuntimeObject* L_12 = Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_inline(L_11, /*hidden argument*/Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_RuntimeMethod_var);
IL2CPP_RUNTIME_CLASS_INIT(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var);
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * L_13 = ((ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_StaticFields*)il2cpp_codegen_static_fields_for(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var))->get_s_invokeActionDelegate_0();
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_14 = ___continuation0;
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_15 = __this->get_address_of__value_0();
int16_t L_16 = L_15->get__token_3();
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_17 = __this->get_address_of__value_0();
bool L_18 = L_17->get__continueOnCapturedContext_4();
G_B4_0 = 2;
G_B4_1 = L_16;
G_B4_2 = L_14;
G_B4_3 = L_13;
G_B4_4 = L_12;
if (L_18)
{
G_B5_0 = 2;
G_B5_1 = L_16;
G_B5_2 = L_14;
G_B5_3 = L_13;
G_B5_4 = L_12;
goto IL_0064;
}
}
{
G_B6_0 = 0;
G_B6_1 = G_B4_0;
G_B6_2 = G_B4_1;
G_B6_3 = G_B4_2;
G_B6_4 = G_B4_3;
G_B6_5 = G_B4_4;
goto IL_0065;
}
IL_0064:
{
G_B6_0 = 1;
G_B6_1 = G_B5_0;
G_B6_2 = G_B5_1;
G_B6_3 = G_B5_2;
G_B6_4 = G_B5_3;
G_B6_5 = G_B5_4;
}
IL_0065:
{
NullCheck(G_B6_5);
InterfaceActionInvoker4< Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 *, RuntimeObject *, int16_t, int32_t >::Invoke(1 /* System.Void System.Threading.Tasks.Sources.IValueTaskSource::OnCompleted(System.Action`1<System.Object>,System.Object,System.Int16,System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags) */, IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_il2cpp_TypeInfo_var, G_B6_5, G_B6_4, G_B6_3, G_B6_2, ((int32_t)((int32_t)G_B6_1|(int32_t)G_B6_0)));
return;
}
IL_006c:
{
IL2CPP_RUNTIME_CLASS_INIT(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var);
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_19 = ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AE_inline(/*hidden argument*/NULL);
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_20 = __this->get_address_of__value_0();
bool L_21 = L_20->get__continueOnCapturedContext_4();
NullCheck(L_19);
ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 L_22 = Task_ConfigureAwait_m2FB91172F9031B0CC520D9D09B658ACC5FD6CE02(L_19, L_21, /*hidden argument*/NULL);
V_2 = L_22;
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 L_23 = ConfiguredTaskAwaitable_GetAwaiter_m1EF40F198D32924E2D0F41E20B99CADBF5DDD303_inline((ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 *)(&V_2), /*hidden argument*/NULL);
V_3 = L_23;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_24 = ___continuation0;
ConfiguredTaskAwaiter_OnCompleted_m847B280BD99B29C570B6EC0993E6BC8977871872((ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 *)(&V_3), L_24, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C void ConfiguredValueTaskAwaiter_OnCompleted_m3383D45694A5326B01E5EF1EF09A72AE88D54A88_AdjustorThunk (RuntimeObject * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method)
{
ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * _thisAdjusted = reinterpret_cast<ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE *>(__this + 1);
ConfiguredValueTaskAwaiter_OnCompleted_m3383D45694A5326B01E5EF1EF09A72AE88D54A88(_thisAdjusted, ___continuation0, method);
}
// System.Void System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable_ConfiguredValueTaskAwaiter::UnsafeOnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter_UnsafeOnCompleted_mC7380318BD43B545EDEF1CE153DC118DFB396A14 (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ConfiguredValueTaskAwaiter_UnsafeOnCompleted_mC7380318BD43B545EDEF1CE153DC118DFB396A14_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
RuntimeObject * V_0 = NULL;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * V_1 = NULL;
ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 V_2;
memset((&V_2), 0, sizeof(V_2));
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 V_3;
memset((&V_3), 0, sizeof(V_3));
int16_t G_B5_0 = 0;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * G_B5_1 = NULL;
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * G_B5_2 = NULL;
RuntimeObject* G_B5_3 = NULL;
int16_t G_B4_0 = 0;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * G_B4_1 = NULL;
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * G_B4_2 = NULL;
RuntimeObject* G_B4_3 = NULL;
int32_t G_B6_0 = 0;
int16_t G_B6_1 = 0;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * G_B6_2 = NULL;
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * G_B6_3 = NULL;
RuntimeObject* G_B6_4 = NULL;
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_0 = __this->get_address_of__value_0();
RuntimeObject * L_1 = L_0->get__obj_2();
V_0 = L_1;
RuntimeObject * L_2 = V_0;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_3 = ((Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 *)IsInstClass((RuntimeObject*)L_2, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var));
V_1 = L_3;
if (!L_3)
{
goto IL_0039;
}
}
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_4 = V_1;
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_5 = __this->get_address_of__value_0();
bool L_6 = L_5->get__continueOnCapturedContext_4();
NullCheck(L_4);
ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 L_7 = Task_ConfigureAwait_m2FB91172F9031B0CC520D9D09B658ACC5FD6CE02(L_4, L_6, /*hidden argument*/NULL);
V_2 = L_7;
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 L_8 = ConfiguredTaskAwaitable_GetAwaiter_m1EF40F198D32924E2D0F41E20B99CADBF5DDD303_inline((ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 *)(&V_2), /*hidden argument*/NULL);
V_3 = L_8;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_9 = ___continuation0;
ConfiguredTaskAwaiter_UnsafeOnCompleted_mE7338A955A4B573FED1F1271B7BEB567BDFC9C81((ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 *)(&V_3), L_9, /*hidden argument*/NULL);
return;
}
IL_0039:
{
RuntimeObject * L_10 = V_0;
if (!L_10)
{
goto IL_006a;
}
}
{
RuntimeObject * L_11 = V_0;
RuntimeObject* L_12 = Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_inline(L_11, /*hidden argument*/Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_RuntimeMethod_var);
IL2CPP_RUNTIME_CLASS_INIT(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var);
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * L_13 = ((ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_StaticFields*)il2cpp_codegen_static_fields_for(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var))->get_s_invokeActionDelegate_0();
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_14 = ___continuation0;
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_15 = __this->get_address_of__value_0();
int16_t L_16 = L_15->get__token_3();
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_17 = __this->get_address_of__value_0();
bool L_18 = L_17->get__continueOnCapturedContext_4();
G_B4_0 = L_16;
G_B4_1 = L_14;
G_B4_2 = L_13;
G_B4_3 = L_12;
if (L_18)
{
G_B5_0 = L_16;
G_B5_1 = L_14;
G_B5_2 = L_13;
G_B5_3 = L_12;
goto IL_0063;
}
}
{
G_B6_0 = 0;
G_B6_1 = G_B4_0;
G_B6_2 = G_B4_1;
G_B6_3 = G_B4_2;
G_B6_4 = G_B4_3;
goto IL_0064;
}
IL_0063:
{
G_B6_0 = 1;
G_B6_1 = G_B5_0;
G_B6_2 = G_B5_1;
G_B6_3 = G_B5_2;
G_B6_4 = G_B5_3;
}
IL_0064:
{
NullCheck(G_B6_4);
InterfaceActionInvoker4< Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 *, RuntimeObject *, int16_t, int32_t >::Invoke(1 /* System.Void System.Threading.Tasks.Sources.IValueTaskSource::OnCompleted(System.Action`1<System.Object>,System.Object,System.Int16,System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags) */, IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_il2cpp_TypeInfo_var, G_B6_4, G_B6_3, G_B6_2, G_B6_1, G_B6_0);
return;
}
IL_006a:
{
IL2CPP_RUNTIME_CLASS_INIT(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var);
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_19 = ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AE_inline(/*hidden argument*/NULL);
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_20 = __this->get_address_of__value_0();
bool L_21 = L_20->get__continueOnCapturedContext_4();
NullCheck(L_19);
ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 L_22 = Task_ConfigureAwait_m2FB91172F9031B0CC520D9D09B658ACC5FD6CE02(L_19, L_21, /*hidden argument*/NULL);
V_2 = L_22;
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 L_23 = ConfiguredTaskAwaitable_GetAwaiter_m1EF40F198D32924E2D0F41E20B99CADBF5DDD303_inline((ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 *)(&V_2), /*hidden argument*/NULL);
V_3 = L_23;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_24 = ___continuation0;
ConfiguredTaskAwaiter_UnsafeOnCompleted_mE7338A955A4B573FED1F1271B7BEB567BDFC9C81((ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 *)(&V_3), L_24, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C void ConfiguredValueTaskAwaiter_UnsafeOnCompleted_mC7380318BD43B545EDEF1CE153DC118DFB396A14_AdjustorThunk (RuntimeObject * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method)
{
ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * _thisAdjusted = reinterpret_cast<ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE *>(__this + 1);
ConfiguredValueTaskAwaiter_UnsafeOnCompleted_mC7380318BD43B545EDEF1CE153DC118DFB396A14(_thisAdjusted, ___continuation0, method);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void IsReadOnlyAttribute__ctor_mDD1F71010ED5D89E804B89A4878BA491AD610F2D (IsReadOnlyAttribute_t2B73995DD5F32F7E75B5708BBC333B9F61C44FE7 * __this, const RuntimeMethod* method)
{
{
Attribute__ctor_m45CAD4B01265CC84CC5A84F62EE2DBE85DE89EC0(__this, /*hidden argument*/NULL);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Conversion methods for marshalling of: System.Runtime.CompilerServices.ValueTaskAwaiter
IL2CPP_EXTERN_C void ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshal_pinvoke(const ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2& unmarshaled, ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshaled_pinvoke& marshaled)
{
Exception_t* ____value_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field '_value' of type 'ValueTaskAwaiter'.");
IL2CPP_RAISE_MANAGED_EXCEPTION(____value_1Exception, NULL, NULL);
}
IL2CPP_EXTERN_C void ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshal_pinvoke_back(const ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshaled_pinvoke& marshaled, ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2& unmarshaled)
{
Exception_t* ____value_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field '_value' of type 'ValueTaskAwaiter'.");
IL2CPP_RAISE_MANAGED_EXCEPTION(____value_1Exception, NULL, NULL);
}
// Conversion method for clean up from marshalling of: System.Runtime.CompilerServices.ValueTaskAwaiter
IL2CPP_EXTERN_C void ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshal_pinvoke_cleanup(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshaled_pinvoke& marshaled)
{
}
// Conversion methods for marshalling of: System.Runtime.CompilerServices.ValueTaskAwaiter
IL2CPP_EXTERN_C void ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshal_com(const ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2& unmarshaled, ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshaled_com& marshaled)
{
Exception_t* ____value_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field '_value' of type 'ValueTaskAwaiter'.");
IL2CPP_RAISE_MANAGED_EXCEPTION(____value_1Exception, NULL, NULL);
}
IL2CPP_EXTERN_C void ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshal_com_back(const ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshaled_com& marshaled, ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2& unmarshaled)
{
Exception_t* ____value_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field '_value' of type 'ValueTaskAwaiter'.");
IL2CPP_RAISE_MANAGED_EXCEPTION(____value_1Exception, NULL, NULL);
}
// Conversion method for clean up from marshalling of: System.Runtime.CompilerServices.ValueTaskAwaiter
IL2CPP_EXTERN_C void ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshal_com_cleanup(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_marshaled_com& marshaled)
{
}
// System.Void System.Runtime.CompilerServices.ValueTaskAwaiter::OnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ValueTaskAwaiter_OnCompleted_m0216EBC6CD5945B8AC974A84AE311F917E92929B (ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2 * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTaskAwaiter_OnCompleted_m0216EBC6CD5945B8AC974A84AE311F917E92929B_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
RuntimeObject * V_0 = NULL;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * V_1 = NULL;
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F V_2;
memset((&V_2), 0, sizeof(V_2));
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_0 = __this->get_address_of__value_1();
RuntimeObject * L_1 = L_0->get__obj_2();
V_0 = L_1;
RuntimeObject * L_2 = V_0;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_3 = ((Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 *)IsInstClass((RuntimeObject*)L_2, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var));
V_1 = L_3;
if (!L_3)
{
goto IL_0026;
}
}
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_4 = V_1;
NullCheck(L_4);
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F L_5 = Task_GetAwaiter_m73027D5E4C16E961C658B83526BED8E32FD2AC6C(L_4, /*hidden argument*/NULL);
V_2 = L_5;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_6 = ___continuation0;
TaskAwaiter_OnCompleted_mE04C56A773876AE128C040BC6B22DD79BF7857C2((TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F *)(&V_2), L_6, /*hidden argument*/NULL);
return;
}
IL_0026:
{
RuntimeObject * L_7 = V_0;
if (!L_7)
{
goto IL_0047;
}
}
{
RuntimeObject * L_8 = V_0;
RuntimeObject* L_9 = Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_inline(L_8, /*hidden argument*/Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_RuntimeMethod_var);
IL2CPP_RUNTIME_CLASS_INIT(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var);
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * L_10 = ((ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_StaticFields*)il2cpp_codegen_static_fields_for(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var))->get_s_invokeActionDelegate_0();
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_11 = ___continuation0;
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_12 = __this->get_address_of__value_1();
int16_t L_13 = L_12->get__token_3();
NullCheck(L_9);
InterfaceActionInvoker4< Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 *, RuntimeObject *, int16_t, int32_t >::Invoke(1 /* System.Void System.Threading.Tasks.Sources.IValueTaskSource::OnCompleted(System.Action`1<System.Object>,System.Object,System.Int16,System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags) */, IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_il2cpp_TypeInfo_var, L_9, L_10, L_11, L_13, 3);
return;
}
IL_0047:
{
IL2CPP_RUNTIME_CLASS_INIT(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var);
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_14 = ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AE_inline(/*hidden argument*/NULL);
NullCheck(L_14);
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F L_15 = Task_GetAwaiter_m73027D5E4C16E961C658B83526BED8E32FD2AC6C(L_14, /*hidden argument*/NULL);
V_2 = L_15;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_16 = ___continuation0;
TaskAwaiter_OnCompleted_mE04C56A773876AE128C040BC6B22DD79BF7857C2((TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F *)(&V_2), L_16, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C void ValueTaskAwaiter_OnCompleted_m0216EBC6CD5945B8AC974A84AE311F917E92929B_AdjustorThunk (RuntimeObject * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method)
{
ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2 * _thisAdjusted = reinterpret_cast<ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2 *>(__this + 1);
ValueTaskAwaiter_OnCompleted_m0216EBC6CD5945B8AC974A84AE311F917E92929B(_thisAdjusted, ___continuation0, method);
}
// System.Void System.Runtime.CompilerServices.ValueTaskAwaiter::UnsafeOnCompleted(System.Action)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ValueTaskAwaiter_UnsafeOnCompleted_mDFDFE4DD17CC048418089BB5BAB89151943C77D4 (ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2 * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTaskAwaiter_UnsafeOnCompleted_mDFDFE4DD17CC048418089BB5BAB89151943C77D4_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
RuntimeObject * V_0 = NULL;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * V_1 = NULL;
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F V_2;
memset((&V_2), 0, sizeof(V_2));
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_0 = __this->get_address_of__value_1();
RuntimeObject * L_1 = L_0->get__obj_2();
V_0 = L_1;
RuntimeObject * L_2 = V_0;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_3 = ((Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 *)IsInstClass((RuntimeObject*)L_2, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var));
V_1 = L_3;
if (!L_3)
{
goto IL_0026;
}
}
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_4 = V_1;
NullCheck(L_4);
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F L_5 = Task_GetAwaiter_m73027D5E4C16E961C658B83526BED8E32FD2AC6C(L_4, /*hidden argument*/NULL);
V_2 = L_5;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_6 = ___continuation0;
TaskAwaiter_UnsafeOnCompleted_mE7225A8038BD7F4A0BEED46F45FC83EA784D4AE4((TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F *)(&V_2), L_6, /*hidden argument*/NULL);
return;
}
IL_0026:
{
RuntimeObject * L_7 = V_0;
if (!L_7)
{
goto IL_0047;
}
}
{
RuntimeObject * L_8 = V_0;
RuntimeObject* L_9 = Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_inline(L_8, /*hidden argument*/Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_RuntimeMethod_var);
IL2CPP_RUNTIME_CLASS_INIT(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var);
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * L_10 = ((ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_StaticFields*)il2cpp_codegen_static_fields_for(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var))->get_s_invokeActionDelegate_0();
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_11 = ___continuation0;
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_12 = __this->get_address_of__value_1();
int16_t L_13 = L_12->get__token_3();
NullCheck(L_9);
InterfaceActionInvoker4< Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 *, RuntimeObject *, int16_t, int32_t >::Invoke(1 /* System.Void System.Threading.Tasks.Sources.IValueTaskSource::OnCompleted(System.Action`1<System.Object>,System.Object,System.Int16,System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags) */, IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_il2cpp_TypeInfo_var, L_9, L_10, L_11, L_13, 1);
return;
}
IL_0047:
{
IL2CPP_RUNTIME_CLASS_INIT(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var);
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_14 = ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AE_inline(/*hidden argument*/NULL);
NullCheck(L_14);
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F L_15 = Task_GetAwaiter_m73027D5E4C16E961C658B83526BED8E32FD2AC6C(L_14, /*hidden argument*/NULL);
V_2 = L_15;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_16 = ___continuation0;
TaskAwaiter_UnsafeOnCompleted_mE7225A8038BD7F4A0BEED46F45FC83EA784D4AE4((TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F *)(&V_2), L_16, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C void ValueTaskAwaiter_UnsafeOnCompleted_mDFDFE4DD17CC048418089BB5BAB89151943C77D4_AdjustorThunk (RuntimeObject * __this, Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation0, const RuntimeMethod* method)
{
ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2 * _thisAdjusted = reinterpret_cast<ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2 *>(__this + 1);
ValueTaskAwaiter_UnsafeOnCompleted_mDFDFE4DD17CC048418089BB5BAB89151943C77D4(_thisAdjusted, ___continuation0, method);
}
// System.Void System.Runtime.CompilerServices.ValueTaskAwaiter::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ValueTaskAwaiter__cctor_m134A4F78CDAD63709C92C2F6E89A0ACA64339F19 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTaskAwaiter__cctor_m134A4F78CDAD63709C92C2F6E89A0ACA64339F19_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259_il2cpp_TypeInfo_var);
U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 * L_0 = ((U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259_StaticFields*)il2cpp_codegen_static_fields_for(U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259_il2cpp_TypeInfo_var))->get_U3CU3E9_0();
Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * L_1 = (Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 *)il2cpp_codegen_object_new(Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0_il2cpp_TypeInfo_var);
Action_1__ctor_mAFC7442D9D3CEC6701C3C5599F8CF12476095510(L_1, L_0, (intptr_t)((intptr_t)U3CU3Ec_U3C_cctorU3Eb__9_0_m8C067F60B6C8FAAC024A9F64AAF8B06BC31C6D98_RuntimeMethod_var), /*hidden argument*/Action_1__ctor_mAFC7442D9D3CEC6701C3C5599F8CF12476095510_RuntimeMethod_var);
((ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_StaticFields*)il2cpp_codegen_static_fields_for(ValueTaskAwaiter_tFC2D0FEFE136A17BBA81FFDACACBCB409B9419A2_il2cpp_TypeInfo_var))->set_s_invokeActionDelegate_0(L_1);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void System.Runtime.CompilerServices.ValueTaskAwaiter_<>c::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec__cctor_m957A3C5E59D561F2742499F08B26E8B647B8C5B3 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (U3CU3Ec__cctor_m957A3C5E59D561F2742499F08B26E8B647B8C5B3_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 * L_0 = (U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 *)il2cpp_codegen_object_new(U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259_il2cpp_TypeInfo_var);
U3CU3Ec__ctor_mF5ACB0D5E6A133FC2A07646156453F1289C42493(L_0, /*hidden argument*/NULL);
((U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259_StaticFields*)il2cpp_codegen_static_fields_for(U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259_il2cpp_TypeInfo_var))->set_U3CU3E9_0(L_0);
return;
}
}
// System.Void System.Runtime.CompilerServices.ValueTaskAwaiter_<>c::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec__ctor_mF5ACB0D5E6A133FC2A07646156453F1289C42493 (U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 * __this, const RuntimeMethod* method)
{
{
Object__ctor_m925ECA5E85CA100E3FB86A4F9E15C120E9A184C0(__this, /*hidden argument*/NULL);
return;
}
}
// System.Void System.Runtime.CompilerServices.ValueTaskAwaiter_<>c::<.cctor>b__9_0(System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec_U3C_cctorU3Eb__9_0_m8C067F60B6C8FAAC024A9F64AAF8B06BC31C6D98 (U3CU3Ec_t2609527AB57FACEEC13913D8EB64DDD75ACB7259 * __this, RuntimeObject * ___state0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (U3CU3Ec_U3C_cctorU3Eb__9_0_m8C067F60B6C8FAAC024A9F64AAF8B06BC31C6D98_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * V_0 = NULL;
{
RuntimeObject * L_0 = ___state0;
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_1 = ((Action_t591D2A86165F896B4B800BB5C25CE18672A55579 *)IsInstSealed((RuntimeObject*)L_0, Action_t591D2A86165F896B4B800BB5C25CE18672A55579_il2cpp_TypeInfo_var));
V_0 = L_1;
if (L_1)
{
goto IL_0011;
}
}
{
ThrowHelper_ThrowArgumentOutOfRangeException_mE8298DEB8A561B73850C8AAFDE78F0C7D16849F7(2, /*hidden argument*/NULL);
return;
}
IL_0011:
{
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * L_2 = V_0;
NullCheck(L_2);
Action_Invoke_mC8D676E5DDF967EC5D23DD0E96FB52AA499817FD(L_2, /*hidden argument*/NULL);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.Tasks.Task System.Threading.Tasks.ValueTask::get_CompletedTask()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AE (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AE_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var);
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_0 = ((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_StaticFields*)il2cpp_codegen_static_fields_for(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var))->get_U3CCompletedTaskU3Ek__BackingField_1();
return L_0;
}
}
// System.Void System.Threading.Tasks.ValueTask::.ctor(System.Threading.Tasks.Task)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ValueTask__ctor_m2D1B53DB3E4B9479B99045F1E3A008AD4C6FABF0 (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___task0, const RuntimeMethod* method)
{
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_0 = ___task0;
if (L_0)
{
goto IL_0009;
}
}
{
ThrowHelper_ThrowArgumentNullException_mC5A28A568922C2B81B27E6552EA9B8C4F175B75E(0, /*hidden argument*/NULL);
}
IL_0009:
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_1 = ___task0;
__this->set__obj_2(L_1);
__this->set__continueOnCapturedContext_4((bool)1);
__this->set__token_3((int16_t)0);
return;
}
}
IL2CPP_EXTERN_C void ValueTask__ctor_m2D1B53DB3E4B9479B99045F1E3A008AD4C6FABF0_AdjustorThunk (RuntimeObject * __this, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___task0, const RuntimeMethod* method)
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * _thisAdjusted = reinterpret_cast<ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *>(__this + 1);
ValueTask__ctor_m2D1B53DB3E4B9479B99045F1E3A008AD4C6FABF0_inline(_thisAdjusted, ___task0, method);
}
// System.Void System.Threading.Tasks.ValueTask::.ctor(System.Object,System.Int16,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ValueTask__ctor_mC747E2D490247F8845D7EE4906FFEAAF3EC785C2 (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, RuntimeObject * ___obj0, int16_t ___token1, bool ___continueOnCapturedContext2, const RuntimeMethod* method)
{
{
RuntimeObject * L_0 = ___obj0;
__this->set__obj_2(L_0);
int16_t L_1 = ___token1;
__this->set__token_3(L_1);
bool L_2 = ___continueOnCapturedContext2;
__this->set__continueOnCapturedContext_4(L_2);
return;
}
}
IL2CPP_EXTERN_C void ValueTask__ctor_mC747E2D490247F8845D7EE4906FFEAAF3EC785C2_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___obj0, int16_t ___token1, bool ___continueOnCapturedContext2, const RuntimeMethod* method)
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * _thisAdjusted = reinterpret_cast<ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *>(__this + 1);
ValueTask__ctor_mC747E2D490247F8845D7EE4906FFEAAF3EC785C2_inline(_thisAdjusted, ___obj0, ___token1, ___continueOnCapturedContext2, method);
}
// System.Int32 System.Threading.Tasks.ValueTask::GetHashCode()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t ValueTask_GetHashCode_m4D8D18790BFDA913684D993B491524A03A7FC2A5 (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, const RuntimeMethod* method)
{
RuntimeObject * G_B2_0 = NULL;
RuntimeObject * G_B1_0 = NULL;
{
RuntimeObject * L_0 = __this->get__obj_2();
RuntimeObject * L_1 = L_0;
G_B1_0 = L_1;
if (L_1)
{
G_B2_0 = L_1;
goto IL_000c;
}
}
{
return 0;
}
IL_000c:
{
NullCheck(G_B2_0);
int32_t L_2 = VirtFuncInvoker0< int32_t >::Invoke(2 /* System.Int32 System.Object::GetHashCode() */, G_B2_0);
return L_2;
}
}
IL2CPP_EXTERN_C int32_t ValueTask_GetHashCode_m4D8D18790BFDA913684D993B491524A03A7FC2A5_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * _thisAdjusted = reinterpret_cast<ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *>(__this + 1);
return ValueTask_GetHashCode_m4D8D18790BFDA913684D993B491524A03A7FC2A5(_thisAdjusted, method);
}
// System.Boolean System.Threading.Tasks.ValueTask::Equals(System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ValueTask_Equals_m3D17AA6F653005E4575821F43FF29BB4EB9D559D (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTask_Equals_m3D17AA6F653005E4575821F43FF29BB4EB9D559D_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
RuntimeObject * L_0 = ___obj0;
if (!((RuntimeObject *)IsInstSealed((RuntimeObject*)L_0, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var)))
{
goto IL_0015;
}
}
{
RuntimeObject * L_1 = ___obj0;
bool L_2 = ValueTask_Equals_m7A4A016C7C23B7249DD4B665BAC9CFA862F529D6((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *)__this, ((*(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *)((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *)UnBox(L_1, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL);
return L_2;
}
IL_0015:
{
return (bool)0;
}
}
IL2CPP_EXTERN_C bool ValueTask_Equals_m3D17AA6F653005E4575821F43FF29BB4EB9D559D_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___obj0, const RuntimeMethod* method)
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * _thisAdjusted = reinterpret_cast<ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *>(__this + 1);
return ValueTask_Equals_m3D17AA6F653005E4575821F43FF29BB4EB9D559D(_thisAdjusted, ___obj0, method);
}
// System.Boolean System.Threading.Tasks.ValueTask::Equals(System.Threading.Tasks.ValueTask)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ValueTask_Equals_m7A4A016C7C23B7249DD4B665BAC9CFA862F529D6 (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___other0, const RuntimeMethod* method)
{
{
RuntimeObject * L_0 = __this->get__obj_2();
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_1 = ___other0;
RuntimeObject * L_2 = L_1.get__obj_2();
if ((!(((RuntimeObject*)(RuntimeObject *)L_0) == ((RuntimeObject*)(RuntimeObject *)L_2))))
{
goto IL_001d;
}
}
{
int16_t L_3 = __this->get__token_3();
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_4 = ___other0;
int16_t L_5 = L_4.get__token_3();
return (bool)((((int32_t)L_3) == ((int32_t)L_5))? 1 : 0);
}
IL_001d:
{
return (bool)0;
}
}
IL2CPP_EXTERN_C bool ValueTask_Equals_m7A4A016C7C23B7249DD4B665BAC9CFA862F529D6_AdjustorThunk (RuntimeObject * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___other0, const RuntimeMethod* method)
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * _thisAdjusted = reinterpret_cast<ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *>(__this + 1);
return ValueTask_Equals_m7A4A016C7C23B7249DD4B665BAC9CFA862F529D6(_thisAdjusted, ___other0, method);
}
// System.Boolean System.Threading.Tasks.ValueTask::get_IsCompleted()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50 (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
RuntimeObject * V_0 = NULL;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * V_1 = NULL;
{
RuntimeObject * L_0 = __this->get__obj_2();
V_0 = L_0;
RuntimeObject * L_1 = V_0;
if (L_1)
{
goto IL_000c;
}
}
{
return (bool)1;
}
IL_000c:
{
RuntimeObject * L_2 = V_0;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_3 = ((Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 *)IsInstClass((RuntimeObject*)L_2, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var));
V_1 = L_3;
if (!L_3)
{
goto IL_001d;
}
}
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_4 = V_1;
NullCheck(L_4);
bool L_5 = Task_get_IsCompleted_mA675F47CE1DBD1948BDC9215DCAE93F07FC32E19(L_4, /*hidden argument*/NULL);
return L_5;
}
IL_001d:
{
RuntimeObject * L_6 = V_0;
RuntimeObject* L_7 = Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_inline(L_6, /*hidden argument*/Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_RuntimeMethod_var);
int16_t L_8 = __this->get__token_3();
NullCheck(L_7);
int32_t L_9 = InterfaceFuncInvoker1< int32_t, int16_t >::Invoke(0 /* System.Threading.Tasks.Sources.ValueTaskSourceStatus System.Threading.Tasks.Sources.IValueTaskSource::GetStatus(System.Int16) */, IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_il2cpp_TypeInfo_var, L_7, L_8);
return (bool)((!(((uint32_t)L_9) <= ((uint32_t)0)))? 1 : 0);
}
}
IL2CPP_EXTERN_C bool ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * _thisAdjusted = reinterpret_cast<ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *>(__this + 1);
return ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50_inline(_thisAdjusted, method);
}
// System.Void System.Threading.Tasks.ValueTask::ThrowIfCompletedUnsuccessfully()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643C (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643C_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
RuntimeObject * V_0 = NULL;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * V_1 = NULL;
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F V_2;
memset((&V_2), 0, sizeof(V_2));
{
RuntimeObject * L_0 = __this->get__obj_2();
V_0 = L_0;
RuntimeObject * L_1 = V_0;
if (!L_1)
{
goto IL_0034;
}
}
{
RuntimeObject * L_2 = V_0;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_3 = ((Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 *)IsInstClass((RuntimeObject*)L_2, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var));
V_1 = L_3;
if (!L_3)
{
goto IL_0023;
}
}
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_4 = V_1;
NullCheck(L_4);
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F L_5 = Task_GetAwaiter_m73027D5E4C16E961C658B83526BED8E32FD2AC6C(L_4, /*hidden argument*/NULL);
V_2 = L_5;
TaskAwaiter_GetResult_m89868C01592AC2B06CE1FD42D9B9C187C6FD928A((TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F *)(&V_2), /*hidden argument*/NULL);
return;
}
IL_0023:
{
RuntimeObject * L_6 = V_0;
RuntimeObject* L_7 = Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_inline(L_6, /*hidden argument*/Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_RuntimeMethod_var);
int16_t L_8 = __this->get__token_3();
NullCheck(L_7);
InterfaceActionInvoker1< int16_t >::Invoke(2 /* System.Void System.Threading.Tasks.Sources.IValueTaskSource::GetResult(System.Int16) */, IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_il2cpp_TypeInfo_var, L_7, L_8);
}
IL_0034:
{
return;
}
}
IL2CPP_EXTERN_C void ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643C_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * _thisAdjusted = reinterpret_cast<ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *>(__this + 1);
ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643C_inline(_thisAdjusted, method);
}
// System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable System.Threading.Tasks.ValueTask::ConfigureAwait(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 ValueTask_ConfigureAwait_m9B959697968FB042E367767086622FF60CCABA45 (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, bool ___continueOnCapturedContext0, const RuntimeMethod* method)
{
{
RuntimeObject * L_0 = __this->get__obj_2();
int16_t L_1 = __this->get__token_3();
bool L_2 = ___continueOnCapturedContext0;
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_3;
memset((&L_3), 0, sizeof(L_3));
ValueTask__ctor_mC747E2D490247F8845D7EE4906FFEAAF3EC785C2_inline((&L_3), L_0, L_1, L_2, /*hidden argument*/NULL);
ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 L_4;
memset((&L_4), 0, sizeof(L_4));
ConfiguredValueTaskAwaitable__ctor_m9ABACE38D59514F98DE2D5B4120EFC255FE483A0_inline((&L_4), L_3, /*hidden argument*/NULL);
return L_4;
}
}
IL2CPP_EXTERN_C ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 ValueTask_ConfigureAwait_m9B959697968FB042E367767086622FF60CCABA45_AdjustorThunk (RuntimeObject * __this, bool ___continueOnCapturedContext0, const RuntimeMethod* method)
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * _thisAdjusted = reinterpret_cast<ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *>(__this + 1);
return ValueTask_ConfigureAwait_m9B959697968FB042E367767086622FF60CCABA45_inline(_thisAdjusted, ___continueOnCapturedContext0, method);
}
// System.Void System.Threading.Tasks.ValueTask::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ValueTask__cctor_mDB62201495B07CA8C28557A015BA14E5CADB22B3 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTask__cctor_mDB62201495B07CA8C28557A015BA14E5CADB22B3_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
CancellationToken_t9E956952F7F20908F2AE72EDF36D97E6C7DB63AB L_0;
memset((&L_0), 0, sizeof(L_0));
CancellationToken__ctor_mEEC34A64046AD7A84BEA348A2F1AE72C9F483C7E((&L_0), (bool)1, /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var);
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_1 = Task_Delay_mE765C93596171D57A356BCCCEFE49392CA925AFA((-1), L_0, /*hidden argument*/NULL);
((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_StaticFields*)il2cpp_codegen_static_fields_for(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var))->set_s_canceledTask_0(L_1);
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_2 = Task_Delay_m193E6692B81A2A6C45F5FAE08CF79FA06FC7DA60(0, /*hidden argument*/NULL);
((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_StaticFields*)il2cpp_codegen_static_fields_for(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var))->set_U3CCompletedTaskU3Ek__BackingField_1(L_2);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void System.ThrowHelper::ThrowArgumentNullException(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ThrowHelper_ThrowArgumentNullException_mC5A28A568922C2B81B27E6552EA9B8C4F175B75E (int32_t ___argument0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ThrowHelper_ThrowArgumentNullException_mC5A28A568922C2B81B27E6552EA9B8C4F175B75E_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
int32_t L_0 = ___argument0;
ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD * L_1 = ThrowHelper_GetArgumentNullException_m064A0F1715A8BA3C28E35555C1B860B4AD5A4174(L_0, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_1, NULL, ThrowHelper_ThrowArgumentNullException_mC5A28A568922C2B81B27E6552EA9B8C4F175B75E_RuntimeMethod_var);
}
}
// System.Void System.ThrowHelper::ThrowArgumentOutOfRangeException(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ThrowHelper_ThrowArgumentOutOfRangeException_mE8298DEB8A561B73850C8AAFDE78F0C7D16849F7 (int32_t ___argument0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ThrowHelper_ThrowArgumentOutOfRangeException_mE8298DEB8A561B73850C8AAFDE78F0C7D16849F7_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
int32_t L_0 = ___argument0;
ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA * L_1 = ThrowHelper_GetArgumentOutOfRangeException_mB8C2EAAEEACB1B6B181B747BE5BF61D08FC096A4(L_0, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_1, NULL, ThrowHelper_ThrowArgumentOutOfRangeException_mE8298DEB8A561B73850C8AAFDE78F0C7D16849F7_RuntimeMethod_var);
}
}
// System.ArgumentNullException System.ThrowHelper::GetArgumentNullException(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD * ThrowHelper_GetArgumentNullException_m064A0F1715A8BA3C28E35555C1B860B4AD5A4174 (int32_t ___argument0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ThrowHelper_GetArgumentNullException_m064A0F1715A8BA3C28E35555C1B860B4AD5A4174_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
int32_t L_0 = ___argument0;
String_t* L_1 = ThrowHelper_GetArgumentName_m4636389F5A3A103B7F4BB4A13FDB503DC87EBD86(L_0, /*hidden argument*/NULL);
ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD * L_2 = (ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD *)il2cpp_codegen_object_new(ArgumentNullException_t581DF992B1F3E0EC6EFB30CC5DC43519A79B27AD_il2cpp_TypeInfo_var);
ArgumentNullException__ctor_mEE0C0D6FCB2D08CD7967DBB1329A0854BBED49ED(L_2, L_1, /*hidden argument*/NULL);
return L_2;
}
}
// System.ArgumentOutOfRangeException System.ThrowHelper::GetArgumentOutOfRangeException(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA * ThrowHelper_GetArgumentOutOfRangeException_mB8C2EAAEEACB1B6B181B747BE5BF61D08FC096A4 (int32_t ___argument0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ThrowHelper_GetArgumentOutOfRangeException_mB8C2EAAEEACB1B6B181B747BE5BF61D08FC096A4_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
int32_t L_0 = ___argument0;
String_t* L_1 = ThrowHelper_GetArgumentName_m4636389F5A3A103B7F4BB4A13FDB503DC87EBD86(L_0, /*hidden argument*/NULL);
ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA * L_2 = (ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t94D19DF918A54511AEDF4784C9A08741BAD1DEDA_il2cpp_TypeInfo_var);
ArgumentOutOfRangeException__ctor_m6B36E60C989DC798A8B44556DB35960282B133A6(L_2, L_1, /*hidden argument*/NULL);
return L_2;
}
}
// System.String System.ThrowHelper::GetArgumentName(System.ExceptionArgument)
IL2CPP_EXTERN_C IL2CPP_NO_INLINE IL2CPP_METHOD_ATTR String_t* ThrowHelper_GetArgumentName_m4636389F5A3A103B7F4BB4A13FDB503DC87EBD86 (int32_t ___argument0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ThrowHelper_GetArgumentName_m4636389F5A3A103B7F4BB4A13FDB503DC87EBD86_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
RuntimeObject * L_0 = Box(ExceptionArgument_t5D17391F46656FD2533C34295444FDAA6AA993DD_il2cpp_TypeInfo_var, (&___argument0));
NullCheck(L_0);
String_t* L_1 = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, L_0);
___argument0 = *(int32_t*)UnBox(L_0);
return L_1;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ValueTask__ctor_m2D1B53DB3E4B9479B99045F1E3A008AD4C6FABF0_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___task0, const RuntimeMethod* method)
{
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_0 = ___task0;
if (L_0)
{
goto IL_0009;
}
}
{
ThrowHelper_ThrowArgumentNullException_mC5A28A568922C2B81B27E6552EA9B8C4F175B75E(0, /*hidden argument*/NULL);
}
IL_0009:
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_1 = ___task0;
__this->set__obj_2(L_1);
__this->set__continueOnCapturedContext_4((bool)1);
__this->set__token_3((int16_t)0);
return;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaitable__ctor_m9ABACE38D59514F98DE2D5B4120EFC255FE483A0_inline (ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___value0, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_0 = ___value0;
__this->set__value_0(L_0);
return;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter__ctor_m825BD4B673180D001A6B85D40CEE741A3D6F784C_inline (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 ___value0, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_0 = ___value0;
__this->set__value_0(L_0);
return;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE ConfiguredValueTaskAwaitable_GetAwaiter_m7ED1F5FD3514FFCB669AFC067546697CCBAED3A8_inline (ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 * __this, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_0 = __this->get__value_0();
ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE L_1;
memset((&L_1), 0, sizeof(L_1));
ConfiguredValueTaskAwaiter__ctor_m825BD4B673180D001A6B85D40CEE741A3D6F784C_inline((&L_1), L_0, /*hidden argument*/NULL);
return L_1;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR bool ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50System_Threading_Tasks_Extensions_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
RuntimeObject * V_0 = NULL;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * V_1 = NULL;
{
RuntimeObject * L_0 = __this->get__obj_2();
V_0 = L_0;
RuntimeObject * L_1 = V_0;
if (L_1)
{
goto IL_000c;
}
}
{
return (bool)1;
}
IL_000c:
{
RuntimeObject * L_2 = V_0;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_3 = ((Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 *)IsInstClass((RuntimeObject*)L_2, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var));
V_1 = L_3;
if (!L_3)
{
goto IL_001d;
}
}
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_4 = V_1;
NullCheck(L_4);
bool L_5 = Task_get_IsCompleted_mA675F47CE1DBD1948BDC9215DCAE93F07FC32E19(L_4, /*hidden argument*/NULL);
return L_5;
}
IL_001d:
{
RuntimeObject * L_6 = V_0;
RuntimeObject* L_7 = Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_inline(L_6, /*hidden argument*/Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_RuntimeMethod_var);
int16_t L_8 = __this->get__token_3();
NullCheck(L_7);
int32_t L_9 = InterfaceFuncInvoker1< int32_t, int16_t >::Invoke(0 /* System.Threading.Tasks.Sources.ValueTaskSourceStatus System.Threading.Tasks.Sources.IValueTaskSource::GetStatus(System.Int16) */, IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_il2cpp_TypeInfo_var, L_7, L_8);
return (bool)((!(((uint32_t)L_9) <= ((uint32_t)0)))? 1 : 0);
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR bool ConfiguredValueTaskAwaiter_get_IsCompleted_m1BF68CFD9CA68CFF23929E10187C40C043C6F887_inline (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_0 = __this->get_address_of__value_0();
bool L_1 = ValueTask_get_IsCompleted_m45A1573F34B3C8CF18FDBD089537FEA8CEB27E50_inline((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *)L_0, /*hidden argument*/NULL);
return L_1;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643C_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643CSystem_Threading_Tasks_Extensions_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
RuntimeObject * V_0 = NULL;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * V_1 = NULL;
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F V_2;
memset((&V_2), 0, sizeof(V_2));
{
RuntimeObject * L_0 = __this->get__obj_2();
V_0 = L_0;
RuntimeObject * L_1 = V_0;
if (!L_1)
{
goto IL_0034;
}
}
{
RuntimeObject * L_2 = V_0;
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_3 = ((Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 *)IsInstClass((RuntimeObject*)L_2, Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2_il2cpp_TypeInfo_var));
V_1 = L_3;
if (!L_3)
{
goto IL_0023;
}
}
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_4 = V_1;
NullCheck(L_4);
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F L_5 = Task_GetAwaiter_m73027D5E4C16E961C658B83526BED8E32FD2AC6C(L_4, /*hidden argument*/NULL);
V_2 = L_5;
TaskAwaiter_GetResult_m89868C01592AC2B06CE1FD42D9B9C187C6FD928A((TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F *)(&V_2), /*hidden argument*/NULL);
return;
}
IL_0023:
{
RuntimeObject * L_6 = V_0;
RuntimeObject* L_7 = Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_inline(L_6, /*hidden argument*/Unsafe_As_TisIValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_m9DD9F5159CE40E061564943BF6125D36271064F1_RuntimeMethod_var);
int16_t L_8 = __this->get__token_3();
NullCheck(L_7);
InterfaceActionInvoker1< int16_t >::Invoke(2 /* System.Void System.Threading.Tasks.Sources.IValueTaskSource::GetResult(System.Int16) */, IValueTaskSource_tAC3595531B59649DCA1428DEFD6B543C5EE818D2_il2cpp_TypeInfo_var, L_7, L_8);
}
IL_0034:
{
return;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ConfiguredValueTaskAwaiter_GetResult_m91DBF8595C0BD70F2C8F92B5690C16EDC68D3698_inline (ConfiguredValueTaskAwaiter_t471DEC1F29C424A8B92A487D14D75263D4F356FE * __this, const RuntimeMethod* method)
{
{
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * L_0 = __this->get_address_of__value_0();
ValueTask_ThrowIfCompletedUnsuccessfully_m5CC5D3AA7774374FFEB16E9713D2B93357C1643C_inline((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 *)L_0, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 ConfiguredTaskAwaitable_GetAwaiter_m1EF40F198D32924E2D0F41E20B99CADBF5DDD303_inline (ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9 * __this, const RuntimeMethod* method)
{
{
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 L_0 = __this->get_m_configuredTaskAwaiter_0();
return L_0;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AE_inline (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ValueTask_get_CompletedTask_m668CC12EE845AB022835A5C89B3F2FF6C32722AESystem_Threading_Tasks_Extensions_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var);
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_0 = ((ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_StaticFields*)il2cpp_codegen_static_fields_for(ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13_il2cpp_TypeInfo_var))->get_U3CCompletedTaskU3Ek__BackingField_1();
return L_0;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void ValueTask__ctor_mC747E2D490247F8845D7EE4906FFEAAF3EC785C2_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, RuntimeObject * ___obj0, int16_t ___token1, bool ___continueOnCapturedContext2, const RuntimeMethod* method)
{
{
RuntimeObject * L_0 = ___obj0;
__this->set__obj_2(L_0);
int16_t L_1 = ___token1;
__this->set__token_3(L_1);
bool L_2 = ___continueOnCapturedContext2;
__this->set__continueOnCapturedContext_4(L_2);
return;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 ValueTask_ConfigureAwait_m9B959697968FB042E367767086622FF60CCABA45_inline (ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 * __this, bool ___continueOnCapturedContext0, const RuntimeMethod* method)
{
{
RuntimeObject * L_0 = __this->get__obj_2();
int16_t L_1 = __this->get__token_3();
bool L_2 = ___continueOnCapturedContext0;
ValueTask_t1EAF660DA8AEF12DF7F5E25651161ABE03540F13 L_3;
memset((&L_3), 0, sizeof(L_3));
ValueTask__ctor_mC747E2D490247F8845D7EE4906FFEAAF3EC785C2_inline((&L_3), L_0, L_1, L_2, /*hidden argument*/NULL);
ConfiguredValueTaskAwaitable_tA626ACF43AC7820C81C987BC6EA5974860732C10 L_4;
memset((&L_4), 0, sizeof(L_4));
ConfiguredValueTaskAwaitable__ctor_m9ABACE38D59514F98DE2D5B4120EFC255FE483A0_inline((&L_4), L_3, /*hidden argument*/NULL);
return L_4;
}
}
IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR RuntimeObject * Unsafe_As_TisRuntimeObject_m3FB128D6DA79B4CC3E3E5A48FC6401A54C943FE3_gshared_inline (RuntimeObject * ___o0, const RuntimeMethod* method)
{
{
RuntimeObject * L_0 = ___o0;
return L_0;
}
}
| [
"59504534+Veydron@users.noreply.github.com"
] | 59504534+Veydron@users.noreply.github.com |
5900d9cb14824a6392bfed8d17a2f05e74cbba7f | ee083d3ae978e770ee403d452aa9fdfb50e9f3ef | /vc/第4章 STLの極意/stl419.cpp | da46de2ca349e3af4f9bd66ca48610bff25059ac | [] | no_license | moonmile/gyakubiki-cpp | be0b0c704cf2592564fb37b596e86ca74e51b52f | b18ea7628e388a7a36cabda1a5b7af642b1b3967 | refs/heads/master | 2020-03-21T04:46:33.673723 | 2018-06-21T06:07:35 | 2018-06-21T06:07:35 | 138,126,465 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 326 | cpp | #include <iostream>
#include <map>
#include <string>
using namespace std;
void main( void )
{
map <char, int> m1, m2;
m1['A'] = 1; m1['B'] = 2; m1['C'] = 3;
m2['A'] = 1; m2['B'] = 2; m2['C'] = 3;
if ( m1 == m2 ) {
cout << "m1 と m2 は等しい" << endl;
} else {
cout << "m1 と m2 は異なる" << endl;
}
}
| [
"masuda@moonmile.net"
] | masuda@moonmile.net |
372c6efffa39a0088e0db185e14f01c94ae9a7cf | 21837f58bd4bbdd56ff69d6ab7bb4c05735cdf67 | /src/qt/test/rpcnestedtests.cpp | af5456db4de59e796bcb34fe83213ee40e82c787 | [
"MIT"
] | permissive | mldmix/matcoin | f1f90053edf7936b8d09063061ea5730da5bd60b | 11369ef1e4397b0beeab2603458571b59655c673 | refs/heads/master | 2020-04-23T21:22:32.168079 | 2019-02-21T14:26:48 | 2019-02-21T14:26:48 | 171,468,673 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,542 | cpp | // Copyright (c) 2016-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <qt/test/rpcnestedtests.h>
#include <chainparams.h>
#include <consensus/validation.h>
#include <fs.h>
#include <interfaces/node.h>
#include <validation.h>
#include <rpc/register.h>
#include <rpc/server.h>
#include <qt/rpcconsole.h>
#include <test/test_matcoin.h>
#include <univalue.h>
#include <util/system.h>
#include <QDir>
#include <QtGlobal>
static UniValue rpcNestedTest_rpc(const JSONRPCRequest& request)
{
if (request.fHelp) {
return "help message";
}
return request.params.write(0, 0);
}
static const CRPCCommand vRPCCommands[] =
{
{ "test", "rpcNestedTest", &rpcNestedTest_rpc, {} },
};
void RPCNestedTests::rpcNestedTests()
{
// do some test setup
// could be moved to a more generic place when we add more tests on QT level
tableRPC.appendCommand("rpcNestedTest", &vRPCCommands[0]);
//mempool.setSanityCheck(1.0);
TestingSetup test;
if (RPCIsInWarmup(nullptr)) SetRPCWarmupFinished();
std::string result;
std::string result2;
std::string filtered;
auto node = interfaces::MakeNode();
RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo()[chain]", &filtered); //simple result filtering with path
QVERIFY(result=="main");
QVERIFY(filtered == "getblockchaininfo()[chain]");
RPCConsole::RPCExecuteCommandLine(*node, result, "getblock(getbestblockhash())"); //simple 2 level nesting
RPCConsole::RPCExecuteCommandLine(*node, result, "getblock(getblock(getbestblockhash())[hash], true)");
RPCConsole::RPCExecuteCommandLine(*node, result, "getblock( getblock( getblock(getbestblockhash())[hash] )[hash], true)"); //4 level nesting with whitespace, filtering path and boolean parameter
RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo");
QVERIFY(result.substr(0,1) == "{");
RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo()");
QVERIFY(result.substr(0,1) == "{");
RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo "); //whitespace at the end will be tolerated
QVERIFY(result.substr(0,1) == "{");
(RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo()[\"chain\"]")); //Quote path identifier are allowed, but look after a child containing the quotes in the key
QVERIFY(result == "null");
(RPCConsole::RPCExecuteCommandLine(*node, result, "createrawtransaction [] {} 0")); //parameter not in brackets are allowed
(RPCConsole::RPCExecuteCommandLine(*node, result2, "createrawtransaction([],{},0)")); //parameter in brackets are allowed
QVERIFY(result == result2);
(RPCConsole::RPCExecuteCommandLine(*node, result2, "createrawtransaction( [], {} , 0 )")); //whitespace between parameters is allowed
QVERIFY(result == result2);
RPCConsole::RPCExecuteCommandLine(*node, result, "getblock(getbestblockhash())[tx][0]", &filtered);
QVERIFY(result == "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b");
QVERIFY(filtered == "getblock(getbestblockhash())[tx][0]");
RPCConsole::RPCParseCommandLine(nullptr, result, "importprivkey", false, &filtered);
QVERIFY(filtered == "importprivkey(…)");
RPCConsole::RPCParseCommandLine(nullptr, result, "signmessagewithprivkey abc", false, &filtered);
QVERIFY(filtered == "signmessagewithprivkey(…)");
RPCConsole::RPCParseCommandLine(nullptr, result, "signmessagewithprivkey abc,def", false, &filtered);
QVERIFY(filtered == "signmessagewithprivkey(…)");
RPCConsole::RPCParseCommandLine(nullptr, result, "signrawtransactionwithkey(abc)", false, &filtered);
QVERIFY(filtered == "signrawtransactionwithkey(…)");
RPCConsole::RPCParseCommandLine(nullptr, result, "walletpassphrase(help())", false, &filtered);
QVERIFY(filtered == "walletpassphrase(…)");
RPCConsole::RPCParseCommandLine(nullptr, result, "walletpassphrasechange(help(walletpassphrasechange(abc)))", false, &filtered);
QVERIFY(filtered == "walletpassphrasechange(…)");
RPCConsole::RPCParseCommandLine(nullptr, result, "help(encryptwallet(abc, def))", false, &filtered);
QVERIFY(filtered == "help(encryptwallet(…))");
RPCConsole::RPCParseCommandLine(nullptr, result, "help(importprivkey())", false, &filtered);
QVERIFY(filtered == "help(importprivkey(…))");
RPCConsole::RPCParseCommandLine(nullptr, result, "help(importprivkey(help()))", false, &filtered);
QVERIFY(filtered == "help(importprivkey(…))");
RPCConsole::RPCParseCommandLine(nullptr, result, "help(importprivkey(abc), walletpassphrase(def))", false, &filtered);
QVERIFY(filtered == "help(importprivkey(…), walletpassphrase(…))");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest");
QVERIFY(result == "[]");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest ''");
QVERIFY(result == "[\"\"]");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest \"\"");
QVERIFY(result == "[\"\"]");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest '' abc");
QVERIFY(result == "[\"\",\"abc\"]");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest abc '' abc");
QVERIFY(result == "[\"abc\",\"\",\"abc\"]");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest abc abc");
QVERIFY(result == "[\"abc\",\"abc\"]");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest abc\t\tabc");
QVERIFY(result == "[\"abc\",\"abc\"]");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest(abc )");
QVERIFY(result == "[\"abc\"]");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest( abc )");
QVERIFY(result == "[\"abc\"]");
RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest( abc , cba )");
QVERIFY(result == "[\"abc\",\"cba\"]");
#if QT_VERSION >= 0x050300
// do the QVERIFY_EXCEPTION_THROWN checks only with Qt5.3 and higher (QVERIFY_EXCEPTION_THROWN was introduced in Qt5.3)
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo() .\n"), std::runtime_error); //invalid syntax
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo() getblockchaininfo()"), std::runtime_error); //invalid syntax
(RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo(")); //tolerate non closing brackets if we have no arguments
(RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo()()()")); //tolerate non command brackts
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(*node, result, "getblockchaininfo(True)"), UniValue); //invalid argument
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(*node, result, "a(getblockchaininfo(True))"), UniValue); //method not found
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest abc,,abc"), std::runtime_error); //don't tollerate empty arguments when using ,
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest(abc,,abc)"), std::runtime_error); //don't tollerate empty arguments when using ,
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(*node, result, "rpcNestedTest(abc,,)"), std::runtime_error); //don't tollerate empty arguments when using ,
#endif
}
| [
"miloudaouissi@gmail.com"
] | miloudaouissi@gmail.com |
63bf797c974bdcdc8d12ce98810f702843959fbe | 75ce4c501bacbd3ad16a59d98d128f7cb120074e | /SnakeGame/Fruit.cpp | 159e60356dc8ff7995d4c900131b4db8a971650c | [] | no_license | Shumaherr/cpp_games_snake | dbefb77e17739b000179d039eb902dfcd5cc4749 | 81274a3c50321fe4e2e0bf9beb3bf7228c194824 | refs/heads/master | 2023-03-04T06:06:19.503669 | 2021-02-15T00:23:54 | 2021-02-15T00:23:54 | 318,923,313 | 0 | 1 | null | 2021-01-27T15:21:22 | 2020-12-06T01:08:58 | C | UTF-8 | C++ | false | false | 165 | cpp | #include "Fruit.h"
Fruits Fruit::GetFruitType()
{
return type;
}
int Fruit::GetFruitRadius()
{
return radius;
}
bool Fruit::CanCollide()
{
return canColide;
}
| [
"shumaherr@gmail.com"
] | shumaherr@gmail.com |
2d8ccb8cb33b86b1360d27207553cbb176c37e2b | 58febce6be896835382f03b21162f0090b3fcb0a | /leetcode/daily/2020_7_July/day18.cpp | 09455c572d8dd42af8abed9f8dc7fe6ab95a0489 | [
"Apache-2.0"
] | permissive | bvbasavaraju/competitive_programming | 5e63c0710b02476ecb499b2087ddec674fdb049f | bc17ec49b601aac62fa94449927fd64b620352d7 | refs/heads/master | 2022-10-31T15:17:00.151024 | 2022-10-23T09:14:52 | 2022-10-23T09:14:52 | 216,365,719 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,411 | cpp | /****************************************************
Date: July 18th
link: https://leetcode.com/explore/challenge/card/july-leetcoding-challenge/546/week-3-july-15th-july-21st/3393/
****************************************************/
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <limits.h>
using namespace std;
/*
Q: Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n-1.
Some courses may have prerequisites, for example to take course 0 you have to first take course 1,
which is expressed as a pair: [0,1] Given the total number of courses and a list of prerequisite pairs,
return the ordering of courses you should take to finish all courses.
There may be multiple correct orders, you just need to return one of them.
If it is impossible to finish all courses, return an empty array.
Example 1:
Input: 2, [[1,0]]
Output: [0,1]
Explanation: There are a total of 2 courses to take. To take course 1 you should have finished
course 0. So the correct course order is [0,1] .
Example 2:
Input: 4, [[1,0],[2,0],[3,1],[3,2]]
Output: [0,1,2,3] or [0,2,1,3]
Explanation: There are a total of 4 courses to take. To take course 3 you should have finished both
courses 1 and 2. Both courses 1 and 2 should be taken after you finished course 0.
So one correct course order is [0,1,2,3]. Another correct ordering is [0,2,1,3] .
Note:
The input prerequisites is a graph represented by a list of edges, not adjacency matrices. Read more about how a graph is represented.
You may assume that there are no duplicate edges in the input prerequisites.
Hide Hint #1
This problem is equivalent to finding the topological order in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses.
Hide Hint #2
Topological Sort via DFS - A great video tutorial (21 minutes) on Coursera explaining the basic concepts of Topological Sort.
Hide Hint #3
Topological sort could also be done via BFS.
*/
class Solution
{
public:
vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites)
{
}
}; | [
"bv.basavaraju@gmail.com"
] | bv.basavaraju@gmail.com |
2d7d64f421d13b31d7e85d1e0ad4c385330b2714 | 18b9caa8b731503a988f3391a622d411ab237cd7 | /Cantera/src/thermo/WaterPropsIAPWSphi.h | 0116447e5aadb2ae889cd4cf59e38f6615801b92 | [] | no_license | calbaker/Cantera | 89d4ab713939ab9b8e50c2cfbfa5bb2fd1500d76 | d379df3f5aa17247dea30c12def0ef601991660a | refs/heads/master | 2021-01-02T08:45:18.177140 | 2011-12-06T17:56:16 | 2011-12-06T17:56:16 | 2,870,146 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,648 | h | /**
* @file WaterPropsIAPWSphi.h
* Header for Lowest level of the classes which support a real water model
* (see class \link Cantera::WaterPropsIAPWS WaterPropsIAPWS\endlink and class \link WaterPropsIAPWSphi WaterPropsIAPWSphi\endlink).
*
* This class calculates dimensionless quantitites.
*/
/*
* Copywrite (2006) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Id: WaterPropsIAPWSphi.h 387 2010-01-17 18:17:55Z hkmoffa $
*/
#ifndef WATERPROPSIAPWSPHI_H
#define WATERPROPSIAPWSPHI_H
#include "config.h"
/*!
* the WaterPropsIAPSWSphi class support low level calls for
* the real description of water.
*
* The reference is W. Wagner, A. Prub, "The IAPWS Formulation 1995 for the Themodynamic
* Properties of Ordinary Water Substance for General and Scientific Use,"
* J. Phys. Chem. Ref. Dat, 31, 387, 2002.
*
* Units Note: This class works with reduced units exclusively.
*/
class WaterPropsIAPWSphi {
public:
//! Base constructor
WaterPropsIAPWSphi();
//! Calculate the Phi function, which is the base function
/*!
* The phi functino is basically the helmholtz free energy
* Eqn. (6.4)
* All internal polynomials are recalculated.
*
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*/
doublereal phi(doublereal tau, doublereal delta);
//! Delta derivative of phi
/*!
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*/
doublereal phi_d(doublereal tau, doublereal delta);
//! 2nd derivative of phi wrt delta
/*!
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*/
doublereal phi_dd(doublereal tau, doublereal delta);
//! First derivative of phi wrt tau
/*!
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*/
doublereal phi_t(doublereal tau, doublereal delta);
//! Second derivative of phi wrt tau
/*!
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*/
doublereal phi_tt(doublereal tau, doublereal delta);
//! Internal check # 1
void check1();
//! Internal check # 2
void check2();
//! Calculate the dimensionless pressure at tau and delta;
/*!
*
* pM/(rhoRT) = delta * phi_d() = 1.0 + delta phiR_d()
*
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*
* note: this is done so much, we have a seperate routine.
*/
doublereal pressureM_rhoRT(doublereal tau, doublereal delta);
//! Dimensionless derivative of p wrt rho at constant T
/*!
* dp/drho * 1/RT = (2. delta phi_d() + delta**2 phi_dd())
* (1.0 + 2. delta phiR_d() + delta**2 phiR_dd())
*
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*/
doublereal dimdpdrho(doublereal tau, doublereal delta);
//! Dimensionless derivative of p wrt T at constant rho
/*!
* dp/dT * M/(Rho R) = (1.0 + delta phiR_d()
* - tau delta (phiR_dt())
*
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*/
doublereal dimdpdT(doublereal tau, doublereal delta);
/**
* This program computes the reduced density, given the reduced pressure
* and the reduced temperature, tau. It takes an initial guess, deltaGuess.
* DeltaGuess is important as this is a multivalued function below the
* critical point.
*
* @param p_red Value of the dimensionless pressure
* @param tau Dimensionless temperature = T_c/T
* @param deltaGuess Initial guess for the dimensionless density
*
* @return
* Returns the dimensionless density.
*/
doublereal dfind(doublereal p_red, doublereal tau, doublereal deltaGuess);
/**
* Calculate the dimensionless gibbs free energy
*/
doublereal gibbs_RT() const;
/**
* Calculate the dimensionless enthalpy, h/RT
*/
doublereal enthalpy_RT() const;
/**
* Calculate the dimensionless entropy, s/R
*/
doublereal entropy_R() const;
/**
* Calculate the dimensionless internal energy, u/RT
*/
doublereal intEnergy_RT() const;
/**
* Calculate the dimensionless constant volume heat capacity, Cv/R
*/
doublereal cv_R() const;
/**
* Calculate the dimensionless constant pressure heat capacity, Cv/R
*/
doublereal cp_R() const;
//! Calculates internal polynomials in tau and delta.
/*!
* This routine is used to store the internal state of tau and delta
* for later use by the other routines in the class.
*
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*/
void tdpolycalc(doublereal tau, doublereal delta);
//! Return the value of phiR(), res
doublereal phiR() const;
private:
//! nau calculation
doublereal phi0() const;
//! calculation of d_phiR/d_d
doublereal phiR_d() const;
//! calculation of d_nau/d_d
doublereal phi0_d() const;
//! calculation of d2_res/d_dd
doublereal phiR_dd() const;
//! calculation of d2_nau/d_dd
doublereal phi0_dd() const;
//! calculation of d_nau/d_t
doublereal phi0_t() const;
//! calculation of d_res/d_t
doublereal phiR_t() const;
//! calculation of d2_res/d_tt
doublereal phiR_tt() const;
//! calculation of d2_nau/d_tt
doublereal phi0_tt() const;
//! calculation of d2_res/d_dt
doublereal phiR_dt() const;
//! calculation of d2_nau/d_dt
doublereal phi0_dt() const;
/**
* intCheck() calculates all of the functions at a one point and
* prints out the result. It's used for conducting the internal
* check.
*
* @param tau Dimensionless temperature = T_c/T
* @param delta Dimensionless density = delta = rho / Rho_c
*/
void intCheck(doublereal tau, doublereal delta);
private:
//! Value of internally calculated polynomials of powers of TAU
doublereal TAUp[52];
//! Value of internally calculated polynomials of powers of delta
doublereal DELTAp[16];
//! Last tau that was used to calculate polynomials
doublereal TAUsave;
//! sqrt of TAU
doublereal TAUsqrt;
//! Last delta that was used to calculate polynomials
doublereal DELTAsave;
};
#endif
| [
"calbaker@gmail.com"
] | calbaker@gmail.com |
fd5e57a24517635b92430c4a6089bdb0999cc4d2 | 91643b30c4dd6d4f6b17cb3e2cfeac389ad5d003 | /FinalExam/src/AbstractEmployee.h | 3c3c5043f7c5ace04c1dcd64ad30d628e63a3d20 | [] | no_license | chenzhe1239/C-CourseStuff | 3ba699e4efd332f87644b8b7797709a678c40dae | 0df636358e505a74f0edc49311f5be7ef99e1f76 | refs/heads/master | 2020-04-12T17:03:31.396765 | 2018-12-20T21:35:07 | 2018-12-20T21:35:07 | 162,633,266 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 300 | h | //
// Created by chenz on 12/11/2018.
//
#ifndef FINALS_ABSTRACTEMPLOYEE_H
#define FINALS_ABSTRACTEMPLOYEE_H
#include "Person.h"
class AbstractEmployee : public Person {
public:
virtual double getWage() = 0;
virtual void setWage(double wage) = 0;
};
#endif //FINALS_ABSTRACTEMPLOYEE_H
| [
"chen.zhe6@northeastern.edu"
] | chen.zhe6@northeastern.edu |
ee7486b06a1abab385a6566a610de6988f5c7f48 | ed24aef6a0ec43c1f6c731b21eeda02d38fa1e5c | /messagewelcome.h | 350f6b41669c9dc760e5de9eb801431f70a02f7a | [] | no_license | wushaopeng/SchoolStore | 3f642674d5b820a7a815beeb0149ab3c093da452 | 707184b30a15f8f3169ad2b8d1bf281f4d9c30f5 | refs/heads/master | 2020-03-26T08:00:26.122217 | 2018-06-22T09:46:05 | 2018-06-22T09:46:05 | 144,681,705 | 1 | 0 | null | 2018-08-14T07:01:28 | 2018-08-14T07:01:28 | null | UTF-8 | C++ | false | false | 315 | h | #ifndef MESSAGEWELCOME_H
#define MESSAGEWELCOME_H
#include <QDialog>
namespace Ui {
class MessageWelcome;
}
class MessageWelcome : public QDialog
{
Q_OBJECT
public:
explicit MessageWelcome(QWidget *parent = 0);
~MessageWelcome();
private:
Ui::MessageWelcome *ui;
};
#endif // MESSAGEWELCOME_H
| [
"hcf@halihuruideMacBook-Pro.local"
] | hcf@halihuruideMacBook-Pro.local |
b2b5bcd1edf6d5cd0491c6f1f4444e5d78218f47 | 65aaba4d24cfbddb05acc0b0ad814632e3b52837 | /src/osrm.net/libosrm/osrm-deps/boost/include/boost-1_62/boost/hana/at.hpp | 5633c3ce6d79af8273f71a3ca1ef4451a8bc7b10 | [
"MIT"
] | permissive | tstaa/osrmnet | 3599eb01383ee99dc6207ad39eda13a245e7764f | 891e66e0d91e76ee571f69ef52536c1153f91b10 | refs/heads/master | 2021-01-21T07:03:22.508378 | 2017-02-26T04:59:50 | 2017-02-26T04:59:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 129 | hpp | version https://git-lfs.github.com/spec/v1
oid sha256:a130166af9c6fd9ffb9cc752389b5875888d61223dde6b1786bbf6fc37d95449
size 1714
| [
"ssuluh@yahoo.com"
] | ssuluh@yahoo.com |
e6e258fde9b3cccca992c2a5c3b38dcbbe47e307 | cef9e617becd984bc1b4a88f7361a1ce13057bf2 | /Utils/detail/atomic.hh | 57fdea9566c4dd7572b60edb9c2215809e5de3b3 | [] | no_license | ttrebuchon/BareBonesOS | 36b69427617b465c9ef642559f68ccc2020e5e84 | 34cc2dc75669ed94957af6b26db838957f2e4625 | refs/heads/master | 2021-03-22T02:55:18.690747 | 2018-10-21T21:28:37 | 2018-10-21T21:28:37 | 119,048,649 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,338 | hh | #ifndef INCLUDED_ATOMIC_HH
#define INCLUDED_ATOMIC_HH
#include "type_traits.hh"
#include "enable_if.hh"
namespace Utils
{
#define MEM_ORD_APP(X) memory_order_##X
#if __cplusplus >= 201703L
#define MEM_ORD_DEF(X) X
enum class memory_order
#else
#define MEM_ORD_DEF(X) MEM_ORD_APP(X)
enum memory_order
#endif
{
MEM_ORD_DEF(relaxed),
MEM_ORD_DEF(consume),
MEM_ORD_DEF(acquire),
MEM_ORD_DEF(release),
MEM_ORD_DEF(acq_rel),
MEM_ORD_DEF(seq_cst),
};
#undef MEM_ORD_DEF
#if __cplusplus >= 201703L
#define VAR_DEF(X) \
inline constexpr memory_order MEM_ORD_APP(X) = memory_order:: X
VAR_DEF(relaxed);
VAR_DEF(consume);
VAR_DEF(acquire);
VAR_DEF(release);
VAR_DEF(acq_rel);
VAR_DEF(seq_cst);
#undef VAR_DEF
#endif
#undef MEM_ORDER_APP
namespace detail
{
template <class T>
struct atomic_base
{
private:
T _val;
public:
constexpr atomic_base() noexcept;
constexpr atomic_base(T desired) noexcept;
atomic_base(const atomic_base&) = delete;
void store(T desired, memory_order = memory_order_seq_cst) noexcept;
void store(T desired, memory_order = memory_order_seq_cst) volatile noexcept;
T load(memory_order = memory_order_seq_cst) const noexcept;
T load(memory_order = memory_order_seq_cst) const volatile noexcept;
T exchange(T desired, memory_order = memory_order_seq_cst) noexcept;
T exchange(T desired, memory_order = memory_order_seq_cst) volatile noexcept;
inline operator T() const noexcept
{
return load();
}
inline operator T() const volatile noexcept
{
return load();
}
bool compare_exchange_weak(T& expected, T desired, memory_order success, memory_order failure) noexcept;
bool compare_exchange_weak(T& expected, T desired, memory_order success, memory_order failure) volatile noexcept;
bool compare_exchange_weak(T& expected, T desired, memory_order order = memory_order_seq_cst) noexcept;
bool compare_exchange_weak(T& expected, T desired, memory_order order = memory_order_seq_cst) volatile noexcept;
bool compare_exchange_strong(T& expected, T desired, memory_order success, memory_order failure) noexcept;
bool compare_exchange_strong(T& expected, T desired, memory_order success, memory_order failure) volatile noexcept;
bool compare_exchange_strong(T& expected, T desired, memory_order order = memory_order_seq_cst) noexcept;
bool compare_exchange_strong(T& expected, T desired, memory_order order = memory_order_seq_cst) volatile noexcept;
template <class, class, bool>
friend class atomic_arithmetic;
};
template <class, class, bool>
struct atomic_arithmetic;
template <class T, class G>
struct atomic_arithmetic<T, G, false> { };
template <class T, class G>
struct atomic_arithmetic<T, G, true>
{
constexpr atomic_arithmetic() noexcept = default;
T fetch_add(G arg, memory_order = memory_order_seq_cst) noexcept;
T fetch_add(G arg, memory_order = memory_order_seq_cst) volatile noexcept;
T fetch_sub(G arg, memory_order = memory_order_seq_cst) noexcept;
T fetch_sub(G arg, memory_order = memory_order_seq_cst) volatile noexcept;
};
template <class, bool>
struct atomic_integral;
template <class T>
struct atomic_integral<T, false> //: public atomic_arithmetic<T, T, is_arithmetic<T>::value>
{ };
template <class T>
struct atomic_integral<T, true> : public atomic_arithmetic<T, T, is_arithmetic<T>::value>
{
constexpr atomic_integral() noexcept = default;
T operator++() noexcept;
T operator++() volatile noexcept;
T operator--() noexcept;
T operator--() volatile noexcept;
T operator++(int) noexcept;
T operator++(int) volatile noexcept;
T operator--(int) noexcept;
T operator--(int) volatile noexcept;
T fetch_and(T arg, memory_order = memory_order_seq_cst) noexcept;
T fetch_and(T arg, memory_order = memory_order_seq_cst) volatile noexcept;
T fetch_or(T arg, memory_order = memory_order_seq_cst) noexcept;
T fetch_or(T arg, memory_order = memory_order_seq_cst) volatile noexcept;
T fetch_xor(T arg, memory_order = memory_order_seq_cst) noexcept;
T fetch_xor(T arg, memory_order = memory_order_seq_cst) volatile noexcept;
};
template <class T>
struct atomic_integral<T*, false> : public atomic_arithmetic<T*, ptrdiff_t, true>
{
constexpr atomic_integral() noexcept = default;
T* operator++() noexcept;
T* operator++() volatile noexcept;
T* operator--() noexcept;
T* operator--() volatile noexcept;
T* operator++(int) noexcept;
T* operator++(int) volatile noexcept;
T* operator--(int) noexcept;
T* operator--(int) volatile noexcept;
};
}
template <class T>
struct atomic :
public detail::atomic_base<T>,
public detail::atomic_integral<T, is_integral<T>::value>
{
private:
typedef detail::atomic_base<T> _base;
typedef detail::atomic_integral<T, is_integral<T>::value> _int_base;
public:
constexpr atomic() noexcept {} //= default;
constexpr atomic(T desired) noexcept : _base(desired), _int_base() { }
atomic(const atomic&) = delete;
};
static_assert(is_integral<int>::value);
static_assert(is_integral<bool>::value);
static_assert(is_integral<long>::value);
typedef atomic<int> atomic_int;
typedef atomic<bool> atomic_bool;
typedef atomic<long> atomic_long;
typedef atomic<float> atomic_float;
}
#endif | [
"ttrebuchon@live.com"
] | ttrebuchon@live.com |
080399033d9fad65191713238ffe20b38e5718e5 | 679443a00d0415b3727dcfd53c37fd0937f924ee | /RB_TreeNode.h | ccc5682ce66ee6b11f5870be754f4d5fe8abc4b3 | [] | no_license | ForbesNDU/RB_Tree | 46f1e68288f404ab34d344a4bf98be21825f7951 | 7594bfd387d06bece23948a790c4a112a16eb658 | refs/heads/master | 2021-01-10T17:20:53.294697 | 2016-01-26T05:07:01 | 2016-01-26T05:07:01 | 46,810,828 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,982 | h | // To use this class, template types are forced to declare an ordering (<,>,==)
#ifndef RB_TREENODE_H
#define RB_TREENODE_H
////////// INTERFACE //////////
template <class T>
class RB_TreeNode {
public:
RB_TreeNode(const T&);
RB_TreeNode(const T&, RB_TreeNode<T>* parent);
~RB_TreeNode();
void setBlack();
void setRed();
bool isBlack();
bool isRed();
const T& getData();
RB_TreeNode<T>* getRightChild();
RB_TreeNode<T>* getLeftChild();
RB_TreeNode<T>* getParent();
void setRightChild(RB_TreeNode<T>*);
void setLeftChild(RB_TreeNode<T>*);
void setParent(RB_TreeNode<T>*);
bool operator<(const RB_TreeNode<T>&);
bool operator>(const RB_TreeNode<T>&);
bool operator==(const RB_TreeNode<T>&);
private:
const T& dataElement;
bool nodeColor; // red = 0, black = 1
RB_TreeNode<T>* rightChild;
RB_TreeNode<T>* leftChild;
RB_TreeNode<T>* parent;
};
////////// PUBLIC IMPLEMENTATION //////////
template <class T>
RB_TreeNode<T>::RB_TreeNode( const T& data ):
dataElement(data),
nodeColor(0), // nodes pushed to the tree start out red during inserts
rightChild(NULL),
leftChild(NULL),
parent(NULL) {
}
template <class T>
RB_TreeNode<T>::RB_TreeNode( const T& data, RB_TreeNode<T>* nodeParent ):
dataElement(data),
nodeColor(0),
rightChild(NULL),
leftChild(NULL),
parent(nodeParent) {
}
template <class T>
RB_TreeNode<T>::~RB_TreeNode() {
}
template <class T>
void RB_TreeNode<T>::setBlack() {
nodeColor = 1;
}
template <class T>
void RB_TreeNode<T>::setRed() {
nodeColor = 0;
}
template <class T>
bool RB_TreeNode<T>::isBlack() {
if(nodeColor == 1) {
return true;
} else {
return false;
}
}
template <class T>
bool RB_TreeNode<T>::isRed() {
if(nodeColor == 0) {
return true;
} else {
return false;
}
}
template <class T>
const T& RB_TreeNode<T>::getData() {
return dataElement;
}
template <class T>
RB_TreeNode<T>* RB_TreeNode<T>::getRightChild() {
return rightChild;
}
template<class T>
RB_TreeNode<T>* RB_TreeNode<T>::getLeftChild() {
return leftChild;
}
template <class T>
RB_TreeNode<T>* RB_TreeNode<T>::getParent() {
return parent;
}
template <class T>
void RB_TreeNode<T>::setRightChild(RB_TreeNode<T>* newChild) {
rightChild = newChild;
}
template <class T>
void RB_TreeNode<T>::setLeftChild(RB_TreeNode<T>* newChild) {
leftChild = newChild;
}
template <class T>
void RB_TreeNode<T>::setParent(RB_TreeNode<T>* newParent) {
parent = newParent;
}
template <class T>
bool RB_TreeNode<T>::operator<( const RB_TreeNode<T>& n ) {
if(this.dataElement < n.dataElement) {
return true;
} else {
return false;
}
}
template <class T>
bool RB_TreeNode<T>::operator>( const RB_TreeNode<T>& n ) {
if(this.dataElement > n.dataElement) {
return true;
} else {
return false;
}
}
template <class T>
bool RB_TreeNode<T>::operator==( const RB_TreeNode<T>& n ) {
if(this.dataElement == n.dataElement) {
return true;
} else {
return false;
}
}
#endif
| [
"pforbes@nd.edu"
] | pforbes@nd.edu |
8e476013a75053ac0af0da8b54b8d11b407b7c4b | adfcdbdd2c374d7df3596bcf40eb9a5c0c973119 | /_temp/bluetooth/bluetooth.cpp | 17cce7856a6a3e4e72c836e843a75bbfa9983f2e | [] | no_license | ppisljar/esp32ctrl | 05663d0740827139a234a403ea323b5298e5536c | a8ea6a5ba9d5dcccd473cc50a7ec43fb5a4f6ada | refs/heads/master | 2023-03-10T04:53:50.327948 | 2022-05-12T05:31:31 | 2022-05-12T05:31:31 | 171,812,109 | 0 | 2 | null | 2023-01-23T22:29:13 | 2019-02-21T06:18:32 | C | UTF-8 | C++ | false | false | 19,248 | cpp | #include "bluetooth.h"
#define GATTC_TAG "gattc"
const uint32_t scan_duration = 10; // seconds ?
bool scan_complete = false;
///Declare static functions
static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param);
static esp_ble_scan_params_t ble_scan_params = {
.scan_type = BLE_SCAN_TYPE_ACTIVE,
.own_addr_type = BLE_ADDR_TYPE_PUBLIC,
.scan_filter_policy = BLE_SCAN_FILTER_ALLOW_ALL,
.scan_interval = 0x50,
.scan_window = 0x30,
.scan_duplicate = BLE_SCAN_DUPLICATE_DISABLE
};
static esp_gatt_srvc_id_t search_service_id = {
.id = {
.uuid = {
.len = ESP_UUID_LEN_16,
.uuid = {.uuid16 = 0x1811,},
},
.inst_id = 0,
},
.is_primary = true,
};
static esp_gatt_id_t write_charracteristic_id = {
.uuid = {
.len = ESP_UUID_LEN_16,
.uuid = {.uuid16 = ESP_GATT_UUID_CHAR_CLIENT_CONFIG,},
},
.inst_id = 0,
};
struct ble_connected_devices {
uint8_t mac[6];
uint16_t service_id;
uint16_t characteristic_id;
void (*format_data)(char* data, uint8_t R, uint8_t G, uint8_t B, uint8_t W);
uint8_t data_length;
uint16_t speaker_id;
uint8_t device_type;
uint16_t conn_id;
} ble_connected_devices;
struct ble_device {
char name[20];
uint8_t mac[6];
} ble_device;
struct ble_service {
uint16_t id;
} ble_service;
struct ble_charracteristics {
uint16_t id;
} ble_charracteristics;
struct ble_device devices[15];
struct ble_service services[20];
struct ble_charracteristics charracteristics[20];
struct ble_connected_devices connected_devices[5];
int8_t services_found = 0;
int8_t charracteristics_found = 0;
int8_t devices_found = 0;
int8_t find_device(uint8_t* mac) {
for (uint8_t i = 0; i < devices_found; i++) {
if (memcmp(mac, devices[i].mac, 6) == 0) {
return i;
}
}
return -1;
}
int8_t find_connected_device(uint8_t* mac) {
for (uint8_t i = 0; i < 5; i++) {
if (memcmp(mac, connected_devices[i].mac, 6) == 0) {
return i;
}
}
return -1;
}
esp_gatt_if_t gatt_if = 0;
void format_data_1(char* data, uint8_t R, uint8_t G, uint8_t B, uint8_t W) {
memcpy(data, "\x01\xfe\x00\x00\x53\x83\x10\x00RGB\x00\x50W\x00\x00", 16);
data[8] = R;
data[9] = G;
data[10] = B;
data[13] = W;
}
void format_data_2(char* data, uint8_t R, uint8_t G, uint8_t B, uint8_t W) {
memcpy(data, "\x7e\xfe\xff\xff\xff\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\xfc\x00\x7e", 20);
data[15] = W ? 0 : 1;
data[17] = (data[17] + data[15]);
}
void load_preset_devices() {
memcpy(connected_devices[1].mac, "\xf4\x4e\xfd\x12\x5a\xb8", 6);
connected_devices[1].service_id = 0x7777;
connected_devices[1].characteristic_id = 0x8877;
connected_devices[1].format_data = format_data_1;
connected_devices[1].data_length = 16;
connected_devices[1].speaker_id = 0;
memcpy(connected_devices[2].mac, "\x08\x7c\xbe\x2f\xe7\x64", 6);
connected_devices[2].service_id = 0xcc02;
connected_devices[2].characteristic_id = 0xee03;
connected_devices[2].format_data = format_data_2;
connected_devices[2].data_length = 20;
connected_devices[2].speaker_id = 0;
esp_ble_gattc_open(gatt_if, connected_devices[1].mac, (esp_ble_addr_type_t)0, true);
esp_ble_gattc_open(gatt_if, connected_devices[2].mac, (esp_ble_addr_type_t)0, true);
//esp_err_t resp = esp_a2d_sink_connect(connected_devices[0].mac);
//printf("sink_connect status: %d\n", resp);
}
static void esp_gattc_cb(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param)
{
ESP_LOGI(GATTC_TAG, "EVT %d, gattc if %d\n", event, gattc_if);
esp_ble_gattc_cb_param_t *p_data = (esp_ble_gattc_cb_param_t *)param;
uint8_t did;
switch (event) {
case ESP_GATTC_REG_EVT:
// this happens when we call APP register
ESP_LOGI(GATTC_TAG, "REG_EVT\n");
if (param->reg.status == ESP_GATT_OK) {
gatt_if = gattc_if;
} else {
ESP_LOGI(GATTC_TAG, "Reg app failed, app_id %04x, status %d\n",
param->reg.app_id,
param->reg.status);
}
break;
case ESP_GATTC_UNREG_EVT:
break;
case ESP_GATTC_OPEN_EVT: {
// this happens when we open a connection (esp_ble_gattc_open)
ESP_LOGI(GATTC_TAG, "ESP_GATTC_OPEN_EVT conn_id %d, if %d, status %d, mtu %d\n", p_data->open.conn_id, gattc_if, p_data->open.status, p_data->open.mtu);
ESP_LOGI(GATTC_TAG, "REMOTE BDA %02x:%02x:%02x:%02x:%02x:%02x\n",
p_data->open.remote_bda[0], p_data->open.remote_bda[1],
p_data->open.remote_bda[2], p_data->open.remote_bda[3],
p_data->open.remote_bda[4], p_data->open.remote_bda[5]
);
if (p_data->open.status != ESP_OK) {
ESP_LOGE(GATTC_TAG, "ESP_GATTC_OPEN_EVT connection failed!");
esp_ble_gattc_open(gattc_if, p_data->open.remote_bda, (esp_ble_addr_type_t)0, true);
break;
}
// check if device is on connection list
if (find_connected_device(p_data->open.remote_bda) == -1) {
memcpy(connected_devices[0].mac, p_data->open.remote_bda, sizeof(esp_bd_addr_t));
}
did = find_connected_device(p_data->open.remote_bda);
connected_devices[did].conn_id = p_data->open.conn_id;
esp_err_t mtu_ret = esp_ble_gattc_send_mtu_req (gattc_if, p_data->open.conn_id);
if (mtu_ret){
ESP_LOGE(GATTC_TAG, "config MTU error, error code = %x", mtu_ret);
}
break;
} case ESP_GATTC_CFG_MTU_EVT:
if (param->cfg_mtu.status != ESP_GATT_OK){
ESP_LOGE(GATTC_TAG,"Config mtu failed");
}
ESP_LOGI(GATTC_TAG, "Status %d, MTU %d, conn_id %d", param->cfg_mtu.status, param->cfg_mtu.mtu, param->cfg_mtu.conn_id);
//esp_ble_gattc_search_service(gattc_if, param->cfg_mtu.conn_id, &remote_filter_service_uuid);
break;
case ESP_GATTC_CLOSE_EVT:
// connection closed ...
ESP_LOGI(GATTC_TAG, "ESP_GATTC_CLOSE_EVT conn_id %d, if %d, status %d\n", p_data->close.conn_id, gattc_if, p_data->close.status);
if (find_connected_device(p_data->close.remote_bda) != -1) {
// device is still listed in the connected list ... reconnect
printf("reopening ...\n");
esp_ble_gattc_open(gattc_if, p_data->close.remote_bda, (esp_ble_addr_type_t)0, true);
}
break;
case ESP_GATTC_SEARCH_RES_EVT: {
esp_gatt_id_t *srvc_id = &p_data->search_res.srvc_id;
ESP_LOGI(GATTC_TAG, "SEARCH RES: conn_id = %x is primary service %d", p_data->search_res.conn_id, p_data->search_res.is_primary);
ESP_LOGI(GATTC_TAG, "start handle %d end handle %d current handle value %d", p_data->search_res.start_handle, p_data->search_res.end_handle, p_data->search_res.srvc_id.inst_id);
if (srvc_id->uuid.len == ESP_UUID_LEN_16) {
ESP_LOGI(GATTC_TAG, "UUID16: %x\n", srvc_id->uuid.uuid.uuid16);
services[services_found++].id = srvc_id->uuid.uuid.uuid16;
} else if (srvc_id->uuid.len == ESP_UUID_LEN_32) {
ESP_LOGI(GATTC_TAG, "UUID32: %x\n", srvc_id->uuid.uuid.uuid32);
} else if (srvc_id->uuid.len == ESP_UUID_LEN_128) {
ESP_LOGI(GATTC_TAG, "UUID128: %x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n", srvc_id->uuid.uuid.uuid128[0],
srvc_id->uuid.uuid.uuid128[1], srvc_id->uuid.uuid.uuid128[2], srvc_id->uuid.uuid.uuid128[3],
srvc_id->uuid.uuid.uuid128[4], srvc_id->uuid.uuid.uuid128[5], srvc_id->uuid.uuid.uuid128[6],
srvc_id->uuid.uuid.uuid128[7], srvc_id->uuid.uuid.uuid128[8], srvc_id->uuid.uuid.uuid128[9],
srvc_id->uuid.uuid.uuid128[10], srvc_id->uuid.uuid.uuid128[11], srvc_id->uuid.uuid.uuid128[12],
srvc_id->uuid.uuid.uuid128[13], srvc_id->uuid.uuid.uuid128[14], srvc_id->uuid.uuid.uuid128[15]);
} else {
ESP_LOGE(GATTC_TAG, "UNKNOWN LEN %d\n", srvc_id->uuid.len);
}
break;
}
case ESP_GATTC_SEARCH_CMPL_EVT:
ESP_LOGI(GATTC_TAG, "SEARCH_CMPL: conn_id = %x, status %d\n", p_data->search_cmpl.conn_id, p_data->search_cmpl.status);
scan_complete = true;
break;
case ESP_GATTC_READ_CHAR_EVT:
if (p_data->read.status != ESP_GATT_OK) {
printf("get char something wrong: %i", p_data->read.status);
scan_complete = true;
break;
}
ESP_LOGI(GATTC_TAG, "GET CHAR: conn_id = %x, status %d\n", p_data->read.conn_id, p_data->read.status);
// ESP_LOGI(GATTC_TAG, "GET CHAR: srvc_id = %04x, char_id = %04x\n", p_data->read.srvc_id.id.uuid.uuid.uuid16, p_data->read.char_id.uuid.uuid.uuid16);
// charracteristics[charracteristics_found++].id = p_data->read.char_id.uuid.uuid.uuid16;
// esp_ble_gattc_get_characteristic(gattc_if, p_data->read.conn_id, &search_service_id, &p_data->read.char_id);
break;
case ESP_GATTC_WRITE_DESCR_EVT:
ESP_LOGI(GATTC_TAG, "WRITE: status %d\n", p_data->write.status);
break;
case ESP_GATTC_WRITE_CHAR_EVT:
ESP_LOGI(GATTC_TAG, "WRITE: status %d , conn_id: %x\n", p_data->write.status, p_data->write.conn_id);
break;
default:
ESP_LOGI(GATTC_TAG, "unhandled event %d\n", event);
break;
}
}
// can i scan while i am connected ?
static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) {
switch (event) {
case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT:
printf("scan param set complete, scanning...\n");
devices_found = 0;
scan_complete = false;
break;
case ESP_GAP_BLE_SCAN_RESULT_EVT: {
esp_ble_gap_cb_param_t *scan_result = (esp_ble_gap_cb_param_t *)param;
if (scan_result->scan_rst.search_evt == ESP_GAP_SEARCH_INQ_RES_EVT) {
// forward beacon to MQTT
uint8_t *addr = scan_result->scan_rst.bda;
if (find_device(addr) == -1) {
char mac[18];
sprintf(mac, "%02X:%02X:%02X:%02X:%02X:%02X", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
int rssi = scan_result->scan_rst.rssi;
uint8_t *adv_name = NULL;
uint8_t adv_name_len = 0;
adv_name = esp_ble_resolve_adv_data(scan_result->scan_rst.ble_adv, ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len);
char name[50];
printf("\n\n%i\n\n", adv_name_len);
strncpy(name, (const char*)adv_name, adv_name_len);
name[adv_name_len] = 0;
printf("Device '%s' : %s, RSSI=%i\n", name, mac, rssi);
memcpy(devices[devices_found].mac, addr, 6);
strcpy(devices[devices_found++].name, name);
}
} else if (scan_result->scan_rst.search_evt == ESP_GAP_SEARCH_INQ_CMPL_EVT) {
// scan params must be reset before starting another scan
scan_complete = true;
printf("scan completed...\n");
printf("found %i devices\n", devices_found);
}
break;
}
default:
break;
}
}
void ble_client_appRegister(void)
{
esp_err_t status;
printf("register callback\n");
// register the scan callback function to the gap module
if ((status = esp_ble_gap_register_callback(esp_gap_cb)) != ESP_OK) {
printf("ERROR: gap register error, error code = %x\n", status);
return;
}
if ((status = esp_ble_gattc_register_callback(esp_gattc_cb)) != ESP_OK) {
ESP_LOGE(GATTC_TAG, "gattc register error, error code = %x\n", status);
return;
}
esp_ble_gap_set_scan_params(&ble_scan_params);
// what are this app ids for ? what happens if i register multiple ?
esp_ble_gattc_app_register(1);
}
BlueTooth::BlueTooth() {
}
bool btStart(){
esp_bt_controller_config_t cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){
return true;
}
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){
esp_bt_controller_init(&cfg);
while(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){}
}
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){
if (esp_bt_controller_enable(ESP_BT_MODE_BTDM)) {
ESP_LOGE(GATTC_TAG, "BT Enable failed");
return false;
}
}
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){
return true;
}
ESP_LOGE(GATTC_TAG, "BT Start failed");
return false;
}
void BlueTooth::init() {
ESP_LOGI(GATTC_TAG, "init bluetooth");
if (!btStart()) {
return;
}
esp_bluedroid_init();
esp_bluedroid_enable();
ble_client_appRegister();
vTaskDelay(5000 / portTICK_PERIOD_MS);
load_preset_devices();
}
void BlueTooth::deinit() {
}
void (*scan_complete_func)(uint16_t packet_id, void* data, uint16_t data_len);
uint8_t scan_type = 0;
uint16_t scan_packet_id = 0;
xTaskHandle wait_for_scan_complete_task_handle;
void wait_for_scan_complete(void* pvParameterspvParameters) {
while(!scan_complete) {
vTaskDelay(1000 / portTICK_PERIOD_MS);
};
printf("scan complete yey %i\n", sizeof(devices));
switch (scan_type) {
case 1:
scan_complete_func(scan_packet_id, (void*)devices, sizeof(ble_device)*devices_found);
break;
case 2:
scan_complete_func(scan_packet_id, (void*)services, sizeof(ble_service)*services_found);
break;
case 3:
scan_complete_func(scan_packet_id, (void*)charracteristics, sizeof(ble_charracteristics)*charracteristics_found);
break;
}
scan_type = 0;
vTaskDelete(NULL);
}
void BlueTooth::getDevices(void(* func)(uint16_t packet_id, void* devices, uint16_t data_len), uint16_t packet_id) {
printf("starting scan for bluetooth devices ...\n");
esp_ble_gap_start_scanning(8);
scan_type = 1;
scan_packet_id = packet_id;
scan_complete_func = func;
scan_complete = false;
xTaskCreate(&wait_for_scan_complete, "wait_for_scan_complete", 2048, NULL, 5, NULL);
}
void BlueTooth::getServices(uint8_t mac[6], void(* func)(uint16_t packet_id, void* devices, uint16_t data_len), uint16_t packet_id) {
printf("starting scan for bluetooth services on %x:%x:%x:%x:%x:%x... [gattc_if: %i] \n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], gatt_if);
esp_ble_gattc_open(gatt_if, mac, (esp_ble_addr_type_t)0, true);
if (!find_connected_device(mac)) esp_ble_gattc_open(gatt_if, mac, (esp_ble_addr_type_t)0, true);
uint8_t i = find_connected_device(mac);
uint16_t conn_id = connected_devices[i].conn_id;
esp_ble_gattc_search_service(gatt_if, conn_id, NULL);
scan_type = 2;
scan_packet_id = packet_id;
scan_complete_func = func;
scan_complete = false;
xTaskCreate(&wait_for_scan_complete, "wait_for_scan_complete", 2048, NULL, 5, NULL);
}
void BlueTooth::getCharracteristics(uint8_t mac[6], uint16_t service, void(* func)(uint16_t packet_id, void* devices, uint16_t data_len), uint16_t packet_id) {
printf("starting scan for bluetooth charracteristics ... %x\n", service);
search_service_id.id.uuid.uuid.uuid16 = service;
if (!find_connected_device(mac)) esp_ble_gattc_open(gatt_if, mac, (esp_ble_addr_type_t)0, true);
uint8_t i = find_connected_device(mac);
uint16_t conn_id = connected_devices[i].conn_id;
//esp_ble_gattc_get_characteristic(gatt_if, conn_id, &search_service_id, NULL);
scan_complete = false;
xTaskCreate(&wait_for_scan_complete, "wait_for_scan_complete", 2048, NULL, 5, NULL);
}
void BlueTooth::setValue(uint8_t mac[6], uint16_t service, uint16_t charracteristic, uint8_t* data, uint8_t data_len) {
printf("writing value to ... %x:%x ::", service, charracteristic);
for (int i = 0; i < data_len; i++) printf(":%x", data[i]);
printf("\n");
search_service_id.id.uuid.uuid.uuid16 = service;
write_charracteristic_id.uuid.uuid.uuid16 = charracteristic;
if (!find_connected_device(mac)) esp_ble_gattc_open(gatt_if, mac, (esp_ble_addr_type_t)0, true);
uint8_t i = find_connected_device(mac);
uint16_t conn_id = connected_devices[i].conn_id;
esp_ble_gattc_write_char(
gatt_if,
conn_id,
charracteristic,
data_len,
(uint8_t *)data,
ESP_GATT_WRITE_TYPE_RSP,
ESP_GATT_AUTH_REQ_NONE);
}
/*bool BlueTooth::addDevice(uint8_t mac[6], uint16_t service, uint16_t charracteristic, char* format) {
for (int i = 0; i < sizeof(connected_devices); i++) {
if (memcmp(connected_devices[i].mac, "\x00\x00\x00\x00\x00\x00", 6)) {
memcpy(connected_devices[i].mac, mac, 6);
strncpy(connected_devices[i].data_format, format, 20);
connected_devices[i].service_id = service;
connected_devices[i].characteristic_id = charracteristic;
esp_ble_gattc_open(gatt_if, mac, true);
return true;
}
}
return false;
}
void BlueTooth::removeDevice(uint8_t mac[6]) {
int i = find_connected_device(mac);
esp_ble_gattc_close(gatt_if, connected_devices[i].conn_id);
connected_devices[i].mac[0] = 0;
connected_devices[i].mac[1] = 0;
connected_devices[i].mac[2] = 0;
connected_devices[i].mac[3] = 0;
connected_devices[i].mac[4] = 0;
connected_devices[i].mac[5] = 0;
}*/
void replacechar(char *str, uint8_t len, char orig, char rep) {
char *ix = str;
for(int i = 0; i < len; i++) {
if (str[i] == orig) {
str[i] = rep;
}
}
}
char sum(char *str, uint8_t start, uint8_t end) {
char sum = 0;
for (uint8_t i = start; i < end; i++) {
sum = (sum + str[i]) & 0xff ;
}
return sum;
}
void BlueTooth::bt_light_on() {
printf("$");
for (int i = 0; i < 5; i++) {
char command[30];
if (connected_devices[i].service_id == 0) continue;
connected_devices[i].format_data(command, 255, 255, 255, 255);
setValue(connected_devices[i].mac, connected_devices[i].service_id, connected_devices[i].characteristic_id, (uint8_t*)command, connected_devices[i].data_length);
//vTaskDelay(10 / portTICK_PERIOD_MS);
}
}
void BlueTooth::bt_light_off() {
printf("#");
for (int i = 0; i < 5; i++) {
char command[30];
if (connected_devices[i].service_id == 0) continue;
connected_devices[i].format_data(command, 0, 0, 0, 0);
setValue(connected_devices[i].mac, connected_devices[i].service_id, connected_devices[i].characteristic_id, (uint8_t*)command, connected_devices[i].data_length);
//vTaskDelay(10 / portTICK_PERIOD_MS);
}
}
void BlueTooth::bt_light_level(uint8_t level) {
/*for (int i = 0; i < 5; i++) {
char command[30];
if (connected_devices[i].service_id == 0) break;
memcpy(command, connected_devices[i].data_format, 16);
replacechar(command, 16, 'R', 0);
replacechar(command, 16, 'G', 0);
replacechar(command, 16, 'B', 0);
replacechar(command, 16, 'W', level);
setValue(connected_devices[i].mac, connected_devices[i].service_id, connected_devices[i].characteristic_id, (uint8_t*)command, 16);
}*/
}
| [
"peter.pisljar@gmail.com"
] | peter.pisljar@gmail.com |
35bd8b6183034f0fb001595d45ea3e94f2b5d056 | b7139acb3448d39dbeb8597c7f65d4a378ddc330 | /2015/chapter_8/examples/8_7.cpp | e1992139b2b00f75aef4bb7b52012947d2b28bae | [] | no_license | linsallyzhao/earlyobjects-exercises | 3f88e2d48674fdd431ecfd7e57c0fe2fa30c93f8 | 746a2489eb135fee8c04c74e3e763b07853e6796 | refs/heads/master | 2021-08-24T13:27:43.256219 | 2017-12-10T00:38:56 | 2017-12-10T00:38:56 | 113,711,078 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 843 | cpp | #include <iostream>
#include <iomanip>
#include <string>
int main()
{
const int NUM_MONTHS = 12;
int choice;
std::string name[NUM_MONTHS] =
{"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"};
int days[NUM_MONTHS] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
std::cout << "This program will tell you how many days are "
<< "in any month.\n\n";
for (int month = 1; month <= NUM_MONTHS; month++)
{
std::cout << std::setw(2) << month << " " << name[month-1] << std::endl;
}
std::cout << "Enter the number of the month you want: ";
std::cin >> choice;
std::cout << "The month of " << name[choice-1] << " has "
<< days[choice-1] << " days. \n";
return 0;
}
| [
"lin.sally.zhao@gmail.com"
] | lin.sally.zhao@gmail.com |
733aa824620ed6949850017fa472feafb9cfb1f1 | 1dbf007249acad6038d2aaa1751cbde7e7842c53 | /ims/include/huaweicloud/ims/v2/model/AddImageTagRequest.h | 9ca1c3c2eff5c47d3476266c70f2fe8636f65c5c | [] | permissive | huaweicloud/huaweicloud-sdk-cpp-v3 | 24fc8d93c922598376bdb7d009e12378dff5dd20 | 71674f4afbb0cd5950f880ec516cfabcde71afe4 | refs/heads/master | 2023-08-04T19:37:47.187698 | 2023-08-03T08:25:43 | 2023-08-03T08:25:43 | 324,328,641 | 11 | 10 | Apache-2.0 | 2021-06-24T07:25:26 | 2020-12-25T09:11:43 | C++ | UTF-8 | C++ | false | false | 1,779 | h |
#ifndef HUAWEICLOUD_SDK_IMS_V2_MODEL_AddImageTagRequest_H_
#define HUAWEICLOUD_SDK_IMS_V2_MODEL_AddImageTagRequest_H_
#include <huaweicloud/ims/v2/ImsExport.h>
#include <huaweicloud/core/utils/ModelBase.h>
#include <huaweicloud/core/http/HttpResponse.h>
#include <string>
#include <huaweicloud/ims/v2/model/AddImageTagRequestBody.h>
namespace HuaweiCloud {
namespace Sdk {
namespace Ims {
namespace V2 {
namespace Model {
using namespace HuaweiCloud::Sdk::Core::Utils;
using namespace HuaweiCloud::Sdk::Core::Http;
/// <summary>
/// Request Object
/// </summary>
class HUAWEICLOUD_IMS_V2_EXPORT AddImageTagRequest
: public ModelBase
{
public:
AddImageTagRequest();
virtual ~AddImageTagRequest();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
bool fromJson(const web::json::value& json) override;
/////////////////////////////////////////////
/// AddImageTagRequest members
/// <summary>
/// 镜像ID。
/// </summary>
std::string getImageId() const;
bool imageIdIsSet() const;
void unsetimageId();
void setImageId(const std::string& value);
/// <summary>
///
/// </summary>
AddImageTagRequestBody getBody() const;
bool bodyIsSet() const;
void unsetbody();
void setBody(const AddImageTagRequestBody& value);
protected:
std::string imageId_;
bool imageIdIsSet_;
AddImageTagRequestBody body_;
bool bodyIsSet_;
#ifdef RTTR_FLAG
RTTR_ENABLE()
public:
AddImageTagRequest& dereference_from_shared_ptr(std::shared_ptr<AddImageTagRequest> ptr) {
return *ptr;
}
#endif
};
}
}
}
}
}
#endif // HUAWEICLOUD_SDK_IMS_V2_MODEL_AddImageTagRequest_H_
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
f2b3447f7fe92656bf118f1575a18fa4514f1d47 | e86e110f97f2eece465c2ae45fb73663d9d93e58 | /Qt/queqiao/alimamalogin.cpp | 58bdf3a02976af81da71b1ca34541c36affb787f | [] | no_license | CollectionProject/cpp | 87da66bb44846ffede034a48529b3896108cbfbf | 148747ffdc27835b3a1c5a7af545f6f9e6fbefaf | refs/heads/master | 2020-04-26T05:00:20.711726 | 2018-03-18T15:00:22 | 2018-03-18T15:00:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,514 | cpp | #include "alimamalogin.h"
#include "ui_alimamalogin.h"
#include "networkcookie.h"
#include <QUrl>
#include <QSettings>
#include <QWebFrame>
#include <QWebElement>
#include <QMessageBox>
#include <QNetworkCookie>
#include <QList>
#include <QNetworkCookieJar>
#include <autoclose.h>
AlimamaLogin::AlimamaLogin(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::AlimamaLogin),
m_name(),
m_alimama_tb_token(),
cookielist(),
user_map()
{
ui->setupUi(this);
QSettings settings("user.ini",QSettings::IniFormat);
QMap<QString,QVariant>map=settings.value("user").toMap();
for(auto i=map.cbegin();i!=map.cend();++i)
{
if(i.key().size()>1)
{
user_map.insert(i.key(),i.value().toString());
ui->select->addItem(i.key());
}
}
ui->name->setText(ui->select->currentText());
ui->pwd->setText(user_map[ui->select->currentText()]);
ui->login->setFocus();
ui->login->setDefault(true);
ui->login->setShortcut(Qt::Key_Enter);
ui->login->setShortcut(Qt::Key_Return);
ui->login->setToolTip("点击登录");
ui->select->setToolTip("选择账户");
ui->select_s->setToolTip("选择账户");
ui->pwd->setToolTip("密码");
ui->pwd_s->setToolTip("密码");
ui->name->setToolTip("用户名");
ui->name_s->setToolTip("用户名");
ui->refresh->setToolTip("点击刷新页面");
}
AlimamaLogin::~AlimamaLogin()
{
QSettings settings("user.ini",QSettings::IniFormat);
QMap<QString,QVariant>m;
if(ui->pwd->text().size()>5)
user_map.insert(ui->name->text(),ui->pwd->text());
for(auto i=user_map.cbegin();i!=user_map.cend();++i)
{
if(i.key().size()>5)
m.insert(i.key(),i.value());
}
settings.setValue("user",m);
delete ui;
}
void AlimamaLogin::on_webView_loadFinished(bool arg1)
{
QString url=ui->webView->url().toString();
if((url.indexOf("http://www.alimama.com/index.htm"))!=-1)
{//登录成功
m_name=ui->webView->page()->mainFrame()->findFirstElement(".menu-username").evaluateJavaScript("this.innerText").toString();
qDebug()<<m_name;
if((m_name.indexOf("你好,"))!=-1)
{
m_name=m_name.right(m_name.size()-3);
if(m_name[m_name.size()-1]=='\n')
{
m_name=m_name.left(m_name.size()-1);
}
qDebug()<<m_name;
}
NetworkCookie*cookieJar;
cookieJar=(NetworkCookie*)ui->webView->page()->networkAccessManager()->cookieJar();
cookielist=cookieJar->getCookies("http://www.alimama.com/index.htm");
QString cookie;
for(auto i:cookielist)
{
cookie+=i.name()+"="+i.value()+";";
if(i.name()=="_tb_token_")//这个网站的_tb_token_有两个,要第二个
{
m_alimama_tb_token=i.value();
}
}
//qDebug()<<"获取信息成功";
//qDebug()<<"cookie"<<cookie;
//qDebug()<<"alimama_tb_token"<<m_alimama_tb_token;
//qDebug()<<"taobao_tb_token"<<m_taobao_tb_token;
//qDebug()<<"num_id"<<m_user_num_id;
ui->webView->load(QUrl("http://pub.alimama.com/myunion.htm#!/promo/act/activity?toPage=1&eventStatus=5"));
}
else if(url=="http://pub.alimama.com/myunion.htm#!/promo/act/activity?toPage=1&eventStatus=5")
{//获取cookie
qDebug()<<"name:"<<m_name;
//qDebug()<<"alimama_tb_token"<<m_alimama_tb_token;
//qDebug()<<"num_id"<<m_user_num_id;
qDebug()<<m_name.size()<<cookielist.size()<<m_alimama_tb_token.size();
if(m_name.size()>0&&cookielist.size()>0&&m_alimama_tb_token.size()>0)
{
this->hide();
emit alimama_login_flag(m_name,m_alimama_tb_token,cookielist);
}
else
{
QMessageBox(QMessageBox::NoIcon,"错误","未获取到相应信息,登录失败!").exec();
qDebug()<<"获取登录信息失败!";
}
}
else if(url=="http://www.alimama.com/about.htm")
{
ui->webView->load(QUrl("https://login.taobao.com/member/login.jhtml?style=minisimple&from=alimama&redirectURL=http%3A%2F%2Flogin.taobao.com%2Fmember%2Ftaobaoke%2Flogin.htm%3Fis_login%3d1&full_redirect=true&disableQuickLogin=true"));
//this->show();
}
}
void AlimamaLogin::on_alimama_need_login()
{
this->show();
ui->webView->load(QUrl("http://www.alimama.com/member/logout.htm?forward=http%3A%2F%2Fwww.alimama.com%2Fabout.htm"));
QWebSettings::clearMemoryCaches();
}
void AlimamaLogin::on_login_clicked()
{
QString name(ui->name->text());
QString pwd(ui->pwd->text());
auto i=user_map.find(name);
if(i!=user_map.end())
{//找到
;
}
else
ui->select->addItem(name);
ui->webView->page()->mainFrame()->findFirstElement("#TPL_username_1").evaluateJavaScript("this.value='"+name+"'");
ui->webView->page()->mainFrame()->findFirstElement("#TPL_password_1").evaluateJavaScript("this.value='"+pwd+"'");
ui->webView->page()->mainFrame()->findFirstElement("#J_SubmitStatic").evaluateJavaScript("this.click()");
}
void AlimamaLogin::on_refresh_clicked()
{
ui->webView->load(QUrl("http://www.alimama.com/member/logout.htm?forward=http%3A%2F%2Fwww.alimama.com%2Fabout.htm"));
QWebSettings::clearMemoryCaches();
}
void AlimamaLogin::on_select_currentIndexChanged(const QString &arg1)
{
ui->name->setText(arg1);
ui->pwd->setText(user_map[arg1]);
}
| [
"1325989310@qq.com"
] | 1325989310@qq.com |
8a3a8661260fcaca59246d45c8076376eeb43a02 | 089ece2141d4f14437cfdc56839de0d8bfeeea11 | /bin/media/signal_generator/signal_generator.cc | 068a53748b9f3fc4f9823dec3c06852b2c03d080 | [
"BSD-3-Clause"
] | permissive | OpenTrustGroup/garnet | e2e8564ec0bf85bd600512de837b966c7dd67c54 | 609c727895e477ac086db38c1cee654dc10f2008 | refs/heads/master | 2021-06-07T14:09:17.785279 | 2018-10-18T03:49:35 | 2018-10-18T03:49:35 | 116,278,983 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 15,078 | cc | // Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "garnet/bin/media/signal_generator/signal_generator.h"
#include <fbl/algorithm.h>
#include <lib/async-loop/loop.h>
#include <lib/async/default.h>
#include <zircon/syscalls.h>
#include "lib/fidl/cpp/synchronous_interface_ptr.h"
#include "lib/fxl/logging.h"
namespace media {
namespace tools {
MediaApp::MediaApp(fit::closure quit_callback)
: quit_callback_(std::move(quit_callback)) {
FXL_DCHECK(quit_callback_);
}
// Prepare for playback, submit initial data, start the presentation timeline.
void MediaApp::Run(component::StartupContext* app_context) {
if (!ParameterRangeChecks()) {
Shutdown();
return;
}
SetupPayloadCoefficients();
DisplayConfigurationSettings();
AcquireAudioRenderer(app_context);
SetStreamType();
if (CreateMemoryMapping() != ZX_OK) {
Shutdown();
return;
}
// 24-bit buffers use 32-bit samples (lowest byte zero), and when this
// particular utility saves to .wav file, we save the entire 32 bits.
if (save_to_file_) {
if (!wav_writer_.Initialize(
file_name_.c_str(),
use_int24_
? fuchsia::media::AudioSampleFormat::SIGNED_24_IN_32
: (use_int16_ ? fuchsia::media::AudioSampleFormat::SIGNED_16
: fuchsia::media::AudioSampleFormat::FLOAT),
num_channels_, frame_rate_, sample_size_ * 8)) {
FXL_LOG(ERROR) << "WavWriter::Initialize() failed";
} else {
wav_writer_is_initialized_ = true;
}
}
if (num_packets_to_send_ > 0) {
uint32_t num_payloads_to_prime =
fbl::min<uint64_t>(payloads_per_total_mapping_, num_packets_to_send_);
for (uint32_t payload_num = 0; payload_num < num_payloads_to_prime;
++payload_num) {
SendPacket(payload_num);
}
audio_renderer_->PlayNoReply(fuchsia::media::NO_TIMESTAMP,
fuchsia::media::NO_TIMESTAMP);
} else {
Shutdown();
}
}
bool MediaApp::ParameterRangeChecks() {
bool ret_val = true;
if (num_channels_ < fuchsia::media::MIN_PCM_CHANNEL_COUNT) {
FXL_LOG(ERROR) << "Number of channels must be at least "
<< fuchsia::media::MIN_PCM_CHANNEL_COUNT;
ret_val = false;
}
if (num_channels_ > fuchsia::media::MAX_PCM_CHANNEL_COUNT) {
FXL_LOG(ERROR) << "Number of channels must be no greater than "
<< fuchsia::media::MAX_PCM_CHANNEL_COUNT;
ret_val = false;
}
if (frame_rate_ < fuchsia::media::MIN_PCM_FRAMES_PER_SECOND) {
FXL_LOG(ERROR) << "Frame rate must be at least "
<< fuchsia::media::MIN_PCM_FRAMES_PER_SECOND;
ret_val = false;
}
if (frame_rate_ > fuchsia::media::MAX_PCM_FRAMES_PER_SECOND) {
FXL_LOG(ERROR) << "Frame rate must be no greater than "
<< fuchsia::media::MAX_PCM_FRAMES_PER_SECOND;
ret_val = false;
}
if (frequency_ < 0.0) {
FXL_LOG(ERROR) << "Frequency cannot be negative";
ret_val = false;
}
if (amplitude_ > 1.0) {
FXL_LOG(ERROR) << "Amplitude must be no greater than 1.0";
ret_val = false;
}
if (amplitude_ < -1.0) {
FXL_LOG(ERROR) << "Amplitude must be no less than -1.0";
ret_val = false;
}
if (duration_secs_ < 0.0) {
FXL_LOG(ERROR) << "Duration cannot be negative";
ret_val = false;
}
if (frames_per_payload_ > frame_rate_ / 2) {
FXL_LOG(ERROR) << "Payload size must be 500 milliseconds or less.";
ret_val = false;
}
if (frames_per_payload_ < frame_rate_ / 1000) {
FXL_LOG(ERROR) << "Payload size must be 1 millisecond or more.";
ret_val = false;
}
stream_gain_db_ =
fbl::clamp<float>(stream_gain_db_, fuchsia::media::MUTED_GAIN_DB,
fuchsia::media::MAX_GAIN_DB);
system_gain_db_ =
fbl::clamp<float>(system_gain_db_, fuchsia::media::MUTED_GAIN_DB, 0.0f);
return ret_val;
}
// Based on the user-specified values for signal frequency and milliseconds per
// payload, calculate the other related coefficients needed for our mapped
// memory section, and for our series of payloads that reference that section.
//
// We share a memory section with our AudioRenderer, divided into equally-sized
// payloads (size specified by the user). For now, we trim the end of the memory
// section, rather than handle the occasional irregularly-sized packet.
// TODO(mpuryear): handle end-of-buffer wraparound; make it a true ring buffer.
void MediaApp::SetupPayloadCoefficients() {
total_frames_to_send_ = duration_secs_ * frame_rate_;
num_packets_to_send_ = total_frames_to_send_ / frames_per_payload_;
if (num_packets_to_send_ * frames_per_payload_ < total_frames_to_send_) {
++num_packets_to_send_;
}
// Number of frames in each period of the recurring signal.
frames_per_period_ = frame_rate_ / frequency_;
amplitude_scalar_ = amplitude_;
if (use_int24_) {
amplitude_scalar_ *= (std::numeric_limits<int32_t>::max() & 0xFFFFFF00);
} else if (use_int16_) {
amplitude_scalar_ *= std::numeric_limits<int16_t>::max();
}
// As mentioned above, for 24-bit audio we use 32-bit samples (low byte 0).
sample_size_ = use_int24_ ? sizeof(int32_t)
: (use_int16_ ? sizeof(int16_t) : sizeof(float));
frame_size_ = num_channels_ * sample_size_;
payload_size_ = frames_per_payload_ * frame_size_;
// First, assume one second of audio, then determine how many payloads will
// fit, then trim the mapping down to an amount that will actually be used.
total_mapping_size_ = frame_rate_ * frame_size_;
payloads_per_total_mapping_ = total_mapping_size_ / payload_size_;
total_mapping_size_ = payloads_per_total_mapping_ * payload_size_;
}
void MediaApp::DisplayConfigurationSettings() {
printf("\nAudioRenderer configured for %d-channel %s at %u Hz.\nContent is ",
num_channels_,
(use_int24_ ? "int24" : (use_int16_ ? "int16" : "float32")),
frame_rate_);
if (output_signal_type_ == kOutputTypeNoise) {
printf("white noise");
} else {
printf("a %f Hz %s wave", frequency_,
(output_signal_type_ == kOutputTypeSquare)
? "square"
: (output_signal_type_ == kOutputTypeSawtooth) ? "triangle"
: "sine");
}
printf(" (amplitude %f", amplitude_);
if (set_stream_gain_) {
printf(", setting stream gain %.2f dB", stream_gain_db_);
}
printf(").\nSignal will play for %.2f seconds, using %u buffers of %u frames",
duration_secs_, payloads_per_total_mapping_, frames_per_payload_);
if (set_system_gain_ || set_system_mute_ || set_system_unmute_) {
printf(", after setting ");
}
if (set_system_gain_) {
printf("System Gain to %.3fdB", system_gain_db_);
if (set_system_mute_ || set_system_unmute_) {
printf(" and ");
}
}
if (set_system_mute_ || set_system_unmute_) {
printf("System Mute to %s", set_system_mute_ ? "TRUE" : "FALSE");
}
printf(".\n\n");
}
// Use StartupContext to acquire AudioPtr; use that to acquire AudioRendererPtr
// in turn. Set AudioRenderer error handler, in case of channel closure.
void MediaApp::AcquireAudioRenderer(component::StartupContext* app_context) {
// The Audio interface is only needed to create AudioRenderer, set routing
// policy and set system gain/mute. Use the synchronous proxy, for simplicity.
fuchsia::media::AudioSyncPtr audio;
app_context->ConnectToEnvironmentService(audio.NewRequest());
if (set_system_gain_) {
audio->SetSystemGain(system_gain_db_);
}
if (set_system_mute_) {
audio->SetSystemMute(true);
} else if (set_system_unmute_) {
audio->SetSystemMute(false);
}
if (set_policy_) {
audio->SetRoutingPolicy(audio_policy_);
}
audio->CreateAudioRenderer(audio_renderer_.NewRequest());
audio_renderer_->BindGainControl(gain_control_.NewRequest());
audio_renderer_.set_error_handler([this]() {
FXL_LOG(ERROR)
<< "fuchsia::media::AudioRenderer connection lost. Quitting.";
Shutdown();
});
gain_control_.set_error_handler([this]() {
FXL_LOG(ERROR) << "fuchsia::media::GainControl connection lost. Quitting.";
Shutdown();
});
}
// Set the AudioRenderer's audio format to stereo 48kHz 16-bit (LPCM).
void MediaApp::SetStreamType() {
FXL_DCHECK(audio_renderer_);
fuchsia::media::AudioStreamType format;
format.sample_format =
(use_int24_ ? fuchsia::media::AudioSampleFormat::SIGNED_24_IN_32
: (use_int16_ ? fuchsia::media::AudioSampleFormat::SIGNED_16
: fuchsia::media::AudioSampleFormat::FLOAT));
format.channels = num_channels_;
format.frames_per_second = frame_rate_;
audio_renderer_->SetPcmStreamType(std::move(format));
if (set_stream_gain_) {
// Set stream gain, and clear the mute status.
gain_control_->SetGain(stream_gain_db_);
gain_control_->SetMute(false);
}
}
// Create one Virtual Memory Object and map enough memory for 1 second of audio.
// Reduce rights and send handle to AudioRenderer: this is our shared buffer.
zx_status_t MediaApp::CreateMemoryMapping() {
zx::vmo payload_vmo;
zx_status_t status = payload_buffer_.CreateAndMap(
total_mapping_size_, ZX_VM_PERM_READ | ZX_VM_PERM_WRITE, nullptr,
&payload_vmo, ZX_RIGHT_READ | ZX_RIGHT_MAP | ZX_RIGHT_TRANSFER);
if (status != ZX_OK) {
FXL_LOG(ERROR) << "VmoMapper:::CreateAndMap failed - " << status;
return status;
}
audio_renderer_->AddPayloadBuffer(0, std::move(payload_vmo));
return ZX_OK;
}
// We divided our cross-proc buffer into different zones, called payloads.
// Create a packet corresponding to this particular payload.
fuchsia::media::StreamPacket MediaApp::CreateAudioPacket(uint64_t payload_num) {
fuchsia::media::StreamPacket packet;
packet.payload_offset =
(payload_num % payloads_per_total_mapping_) * payload_size_;
// If last payload, send exactly what remains (otherwise send a full payload).
packet.payload_size =
(payload_num + 1 == num_packets_to_send_)
? (total_frames_to_send_ - (payload_num * frames_per_payload_)) *
frame_size_
: payload_size_;
return packet;
}
void MediaApp::GenerateAudioForPacket(fuchsia::media::StreamPacket packet,
uint64_t payload_num) {
auto audio_buff = reinterpret_cast<uint8_t*>(payload_buffer_.start()) +
packet.payload_offset;
// Recompute payload_frames each time, since the final packet may be
// 'short'.
//
// TODO(mpuryear): don't recompute this every time; use payload_frames_ (and
// pre-compute this) except for last packet, which we either check for here
// or pass in as a boolean parameter.
uint32_t payload_frames = packet.payload_size / frame_size_;
if (use_int24_) {
WriteAudioIntoBuffer<int32_t>(
reinterpret_cast<int32_t*>(audio_buff), payload_frames,
frames_per_payload_ * payload_num, output_signal_type_, num_channels_,
frames_per_period_, amplitude_scalar_);
} else if (use_int16_) {
WriteAudioIntoBuffer<int16_t>(
reinterpret_cast<int16_t*>(audio_buff), payload_frames,
frames_per_payload_ * payload_num, output_signal_type_, num_channels_,
frames_per_period_, amplitude_scalar_);
} else {
WriteAudioIntoBuffer<float>(
reinterpret_cast<float*>(audio_buff), payload_frames,
frames_per_payload_ * payload_num, output_signal_type_, num_channels_,
frames_per_period_, amplitude_scalar_);
}
}
// Write signal into the next section of our buffer. Track how many total
// frames since playback started, to handle arbitrary frequencies of type
// double.
template <typename SampleType>
void MediaApp::WriteAudioIntoBuffer(
SampleType* audio_buffer, uint32_t num_frames, uint64_t frames_since_start,
OutputSignalType signal_type, uint32_t num_chans, double frames_per_period,
double amp_scalar) {
double raw_val; // Generated signal val, before applying amplitude scaling.
double rads_per_frame = 2.0 * M_PI / frames_per_period; // Radians/Frame.
for (uint32_t frame = 0; frame < num_frames; ++frame, ++frames_since_start) {
switch (signal_type) {
case kOutputTypeSine:
raw_val = sin(rads_per_frame * frames_since_start);
break;
case kOutputTypeSquare:
raw_val = (fmod(frames_since_start, frames_per_period) >=
frames_per_period / 2)
? -1.0
: 1.0;
break;
case kOutputTypeSawtooth:
raw_val =
(fmod(frames_since_start / frames_per_period, 1.0) * 2.0) - 1.0;
break;
case kOutputTypeNoise:
// TODO(mpuryear): consider making the white noise generator even more
// truly random, with multiple rand() calls at different frequencies.
raw_val = static_cast<double>(rand()) / RAND_MAX * 2.0 - 1.0;
break;
}
SampleType val = raw_val * amp_scalar;
// If generating a 24-in-32 signal, clear the unused bottom 8 bits.
if (std::is_same<SampleType, int32_t>::value) {
val = static_cast<int32_t>(val) & 0xFFFFFF00;
}
// Put the same content into all channels (even white noise)
// TODO(mpuryear): for white noise, treat each channel independently.
for (uint32_t chan_num = 0; chan_num < num_chans; ++chan_num) {
audio_buffer[frame * num_chans + chan_num] = val;
}
}
}
// Submit a packet, incrementing our count of packets sent. When it returns:
// a. if there are more packets to send, create and send the next packet;
// b. if all expected packets have completed, begin closing down the system.
void MediaApp::SendPacket(uint64_t payload_num) {
fuchsia::media::StreamPacket packet = CreateAudioPacket(payload_num);
GenerateAudioForPacket(packet, payload_num);
if (save_to_file_) {
if (!wav_writer_.Write(reinterpret_cast<char*>(payload_buffer_.start()) +
packet.payload_offset,
packet.payload_size)) {
FXL_LOG(ERROR) << "WavWriter::Write() failed";
}
}
++num_packets_sent_;
audio_renderer_->SendPacket(std::move(packet),
[this]() { OnSendPacketComplete(); });
}
void MediaApp::OnSendPacketComplete() {
++num_packets_completed_;
FXL_DCHECK(num_packets_completed_ <= num_packets_to_send_);
if (num_packets_sent_ < num_packets_to_send_) {
SendPacket(num_packets_sent_);
} else if (num_packets_completed_ >= num_packets_to_send_) {
Shutdown();
}
}
// Unmap memory, quit message loop (FIDL interfaces auto-delete upon
// ~MediaApp).
void MediaApp::Shutdown() {
if (wav_writer_is_initialized_) {
if (!wav_writer_.Close()) {
FXL_LOG(ERROR) << "WavWriter::Close() failed";
}
}
payload_buffer_.Unmap();
quit_callback_();
}
} // namespace tools
} // namespace media
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
6a76760357c066886a6d7781beda4d53c1a56054 | b630210dd141bb3d7d0c91017c6764eff5c6fa90 | /alidns/include/alibabacloud/alidns/model/DescribeGtmRecoveryPlansRequest.h | 916f849247a7aaba2bb413dea504caaf7cbbab69 | [
"Apache-2.0"
] | permissive | howtosigna/aliyun-openapi-cpp-sdk | 37da0db186cb2a547d3c82b4e1b5d18a00e0b529 | cb3390b9f5c46cdaa0ec2cc4fc5d435da6329175 | refs/heads/master | 2020-09-05T17:50:13.666225 | 2019-11-05T11:16:27 | 2019-11-05T11:16:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,780 | h | /*
* Copyright 2009-2017 Alibaba Cloud 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 ALIBABACLOUD_ALIDNS_MODEL_DESCRIBEGTMRECOVERYPLANSREQUEST_H_
#define ALIBABACLOUD_ALIDNS_MODEL_DESCRIBEGTMRECOVERYPLANSREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/alidns/AlidnsExport.h>
namespace AlibabaCloud
{
namespace Alidns
{
namespace Model
{
class ALIBABACLOUD_ALIDNS_EXPORT DescribeGtmRecoveryPlansRequest : public RpcServiceRequest
{
public:
DescribeGtmRecoveryPlansRequest();
~DescribeGtmRecoveryPlansRequest();
int getPageNumber()const;
void setPageNumber(int pageNumber);
std::string getUserClientIp()const;
void setUserClientIp(const std::string& userClientIp);
int getPageSize()const;
void setPageSize(int pageSize);
std::string getLang()const;
void setLang(const std::string& lang);
std::string getKeyword()const;
void setKeyword(const std::string& keyword);
private:
int pageNumber_;
std::string userClientIp_;
int pageSize_;
std::string lang_;
std::string keyword_;
};
}
}
}
#endif // !ALIBABACLOUD_ALIDNS_MODEL_DESCRIBEGTMRECOVERYPLANSREQUEST_H_ | [
"wb-hx510875@alibaba-inc.com"
] | wb-hx510875@alibaba-inc.com |
0dc783ecd6d9bef4e44132210751c24b6d810040 | 54f352a242a8ad6ff5516703e91da61e08d9a9e6 | /Source Codes/AtCoder/abc096/A/3096958.cpp | 601d16bbc0df55a72fbdfff7cefe6c6541282a96 | [] | no_license | Kawser-nerd/CLCDSA | 5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb | aee32551795763b54acb26856ab239370cac4e75 | refs/heads/master | 2022-02-09T11:08:56.588303 | 2022-01-26T18:53:40 | 2022-01-26T18:53:40 | 211,783,197 | 23 | 9 | null | null | null | null | UTF-8 | C++ | false | false | 164 | cpp | #include <iostream>
using namespace std;
int main() {
int a, b;
int t;
cin >> a >> b;
t = (a > b) ? a-1 : a;
cout << t << endl;
return 0;
} | [
"kwnafi@yahoo.com"
] | kwnafi@yahoo.com |
44c0346de08db85c6c5935337a0ee78eb198d17a | c9796a20cf56aa01ecbc2ff3985703b17bfb51fe | /leetcode2/DefusetheBomb/a.cpp | 7e05c2a4ce5853069105bfc64e8e3c870301ec79 | [] | no_license | iamslash/learntocode | a62329710d36b21f8025961c0ad9b333c10e973a | 63faf361cd4eefe0f6f1e50c49ea22577a75ea74 | refs/heads/master | 2023-08-31T08:20:08.608771 | 2023-08-31T00:05:06 | 2023-08-31T00:05:06 | 52,074,001 | 7 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,260 | cpp | /* Copyright (C) 2020 by iamslash */
#include <cstdio>
#include <vector>
using namespace std;
// k: 3
// i
// code: 5 7 1 4
// j
// sum:
// 4ms 100.00% 8.7MB 100.00%
// brute force
// O(N^2) O(N)
class Solution {
public:
vector<int> decrypt(vector<int>& code, int k) {
int n = code.size();
vector<int> ans = vector<int>(n);
if (k > 0) {
for (int i = 0; i < n; ++i) {
for (int j = i+1, m = 0; m < k; ++j, ++m) {
int jj = j % n;
ans[i] += code[jj];
}
}
} else if (k < 0) {
for (int i = 0; i < n; ++i) {
for (int m = 0, j = i-1; m > k; --m, --j) {
int jj = (j + n) % n;
ans[i] += code[jj];
}
}
}
return ans;
}
};
// 4ms 100.00% 8.6MB 100.00%
// brute force
// O(N^2) O(N)
class Solution {
public:
vector<int> decrypt(vector<int>& code, int k) {
int n = code.size();
vector<int> ans = vector<int>(n);
for (int i = 0; i < n && k; ++i) {
int sum = 0;
for (int j = min(1, k); j <= max(k, -1); ++j) {
sum += code[(i + j + n) % n];
}
ans[i] = sum;
}
return ans;
}
};
| [
"iamslash@gmail.com"
] | iamslash@gmail.com |
a116b0ecf4f76930609b964cf4ba746ff578f95c | 75ca00902ed967e70460cc549386821c80d36cd4 | /Codeforces 110A/src/Codeforces 110A.cpp | 3b32a810ea1454b9bb0bfaeed3d218b786023c8a | [] | no_license | harshk360/Codeforces | e7ddbe4a841fe88871ca7d247c72b28da0e10c80 | 81450fd70934c67d29357fcf5e9e4c9adeed9ea1 | refs/heads/master | 2021-01-10T00:54:03.932790 | 2014-07-07T17:08:32 | 2014-07-07T17:08:32 | 21,459,792 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 658 | cpp | //============================================================================
// Name : Codeforces 110A.cpp
// Author : Harshit Kumar
// Version : 1.0
// Description : 30 ms, 00 kb
//============================================================================
#include <iostream>
using namespace std;
int main()
{
long long n;
cin >> n;
int count = 0;
while (n != 0)
{
if (n % 10 == 4 || n % 10 == 7)
{
count += 1;
}
n /= 10;
}
if (count == 4 || count == 7)
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
return 0;
}
| [
"harshk360@gmail.com"
] | harshk360@gmail.com |
f774ee0fa14e8c4971655ac74dda9da5dc9d4e22 | 10d57ce051ca936f6822724a4e996d35f7cd269c | /base/profiler/module_cache.cc | 72fd1c5f14d84a108e7f522c3cb84653ce5e878f | [
"BSD-3-Clause"
] | permissive | billti/chromium | aea73afa192266460538df692e80dd3f749d2751 | 94fde1ddc4a9db7488fd646443688a88c178c158 | refs/heads/master | 2023-02-02T05:00:23.474800 | 2020-09-24T16:57:28 | 2020-09-24T16:57:28 | 298,350,654 | 0 | 0 | BSD-3-Clause | 2020-09-24T17:37:58 | 2020-09-24T17:37:57 | null | UTF-8 | C++ | false | false | 5,986 | cc | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/profiler/module_cache.h"
#include <algorithm>
#include <iterator>
#include <utility>
namespace base {
namespace {
// Supports heterogeneous comparisons on modules and addresses, for use in
// binary searching modules sorted by range for a contained address.
struct ModuleAddressCompare {
bool operator()(const std::unique_ptr<const ModuleCache::Module>& module,
uintptr_t address) const {
return module->GetBaseAddress() + module->GetSize() <= address;
}
bool operator()(
uintptr_t address,
const std::unique_ptr<const ModuleCache::Module>& module) const {
return address < module->GetBaseAddress();
}
};
} // namespace
ModuleCache::ModuleCache() = default;
ModuleCache::~ModuleCache() = default;
const ModuleCache::Module* ModuleCache::GetModuleForAddress(uintptr_t address) {
if (const ModuleCache::Module* module = GetExistingModuleForAddress(address))
return module;
std::unique_ptr<const Module> new_module = CreateModuleForAddress(address);
if (!new_module)
return nullptr;
const auto result = native_modules_.insert(std::move(new_module));
// Ensure that the new module was inserted an isn't equivalent to an existing
// module.
DCHECK(result.second);
return result.first->get();
}
std::vector<const ModuleCache::Module*> ModuleCache::GetModules() const {
std::vector<const Module*> result;
result.reserve(native_modules_.size());
for (const std::unique_ptr<const Module>& module : native_modules_)
result.push_back(module.get());
for (const std::unique_ptr<const Module>& module : non_native_modules_)
result.push_back(module.get());
return result;
}
void ModuleCache::UpdateNonNativeModules(
const std::vector<const Module*>& defunct_modules,
std::vector<std::unique_ptr<const Module>> new_modules) {
// Insert the modules to remove into a set to support O(log(n)) lookup below.
flat_set<const Module*> defunct_modules_set(defunct_modules.begin(),
defunct_modules.end());
// Reorder the modules to be removed to the last slots in the set, then move
// them to the inactive modules, then erase the moved-from modules from the
// set. This is a variation on the standard erase-remove idiom, which is
// explicitly endorsed for implementing erase behavior on flat_sets.
//
// stable_partition is O(m*log(r)) where m is the number of current modules
// and r is the number of modules to remove. insert and erase are both O(r).
auto first_module_defunct_modules = std::stable_partition(
non_native_modules_.begin(), non_native_modules_.end(),
[&defunct_modules_set](const std::unique_ptr<const Module>& module) {
return defunct_modules_set.find(module.get()) ==
defunct_modules_set.end();
});
// All modules requested to be removed should have been found.
DCHECK_EQ(
static_cast<ptrdiff_t>(defunct_modules.size()),
std::distance(first_module_defunct_modules, non_native_modules_.end()));
inactive_non_native_modules_.insert(
inactive_non_native_modules_.end(),
std::make_move_iterator(first_module_defunct_modules),
std::make_move_iterator(non_native_modules_.end()));
non_native_modules_.erase(first_module_defunct_modules,
non_native_modules_.end());
// Insert the modules to be added. This operation is O((m + a) + a*log(a))
// where m is the number of current modules and a is the number of modules to
// be added.
const size_t prior_non_native_modules_size = non_native_modules_.size();
non_native_modules_.insert(std::make_move_iterator(new_modules.begin()),
std::make_move_iterator(new_modules.end()));
// Every module in |new_modules| should have been moved into
// |non_native_modules_|. This guards against use-after-frees if |new_modules|
// were to contain any modules equivalent to what's already in
// |non_native_modules_|, in which case the module would remain in
// |new_modules| and be deleted on return from the function. While this
// scenario would be a violation of the API contract, it would present a
// difficult-to-track-down crash scenario.
CHECK_EQ(prior_non_native_modules_size + new_modules.size(),
non_native_modules_.size());
}
void ModuleCache::AddCustomNativeModule(std::unique_ptr<const Module> module) {
const bool was_inserted = native_modules_.insert(std::move(module)).second;
// |module| should have been inserted into |native_modules_|, indicating that
// there was no equivalent module already present. While this scenario would
// be a violation of the API contract, it would present a
// difficult-to-track-down crash scenario.
CHECK(was_inserted);
}
const ModuleCache::Module* ModuleCache::GetExistingModuleForAddress(
uintptr_t address) const {
const auto non_native_module_loc = non_native_modules_.find(address);
if (non_native_module_loc != non_native_modules_.end())
return non_native_module_loc->get();
const auto native_module_loc = native_modules_.find(address);
if (native_module_loc != native_modules_.end())
return native_module_loc->get();
return nullptr;
}
bool ModuleCache::ModuleAndAddressCompare::operator()(
const std::unique_ptr<const Module>& m1,
const std::unique_ptr<const Module>& m2) const {
return m1->GetBaseAddress() < m2->GetBaseAddress();
}
bool ModuleCache::ModuleAndAddressCompare::operator()(
const std::unique_ptr<const Module>& m1,
uintptr_t address) const {
return m1->GetBaseAddress() + m1->GetSize() <= address;
}
bool ModuleCache::ModuleAndAddressCompare::operator()(
uintptr_t address,
const std::unique_ptr<const Module>& m2) const {
return address < m2->GetBaseAddress();
}
} // namespace base
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
c698988cb37e390eb52ccdb9ecb4359b8cea6f9b | d2b4f652eb8528cab23a8e86707f30dcb2024b2a | /vtr/small/layers/tdf7/r16_o2/tdf7.cpp | 66984d0194069799cc158c9677d064ba01b72440 | [
"MIT"
] | permissive | UT-LCA/scale-cnn | dc091951f9b6b033412a7d3b4bbf06c78d518d74 | 193b2588c43ef4eb17420c69d97b4e10f6975db6 | refs/heads/main | 2023-04-29T00:29:31.712703 | 2021-04-30T17:33:39 | 2021-04-30T17:33:39 | 318,966,669 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,240 | cpp | #include "global_defines.h"
#include "tdf7_impl_defines.h"
#include <stdbool.h>
#include <assert.h>
#include "tdf7_conv_stages.h"
// Multiplies the intermediate feature maps with the second-layer
// filters. OCHAN_SCALE_FACTOR is an integer factor of the number
// of input channels. The k parameter tells us which group of L2
// input channels we're currently dealing with.
void tdf7_l2_multiply (
data_t intermediate_fmaps[OCHAN_SCALE_FACTOR],
data_t l2_filter_data[OUTPUT_CHANS][L1_OUTPUT_CHANS],
data_t l2_products[OCHAN_SCALE_FACTOR][OUTPUT_CHANS],
uint16_t k
) {
// Ideally this would be two separate loops but for some reason the tool isn't able to
// flatten them. So manually flatten it in the code. The divide and modulo operations will
// be cheap because for the conv-conv layers in Tiny Darknet, OUTPUT_CHANS is always a power of 2.
L2_MUL: for (uint16_t i = 0; i < OUTPUT_CHANS * OCHAN_SCALE_FACTOR; i++) {
#pragma HLS pipeline
#pragma HLS unroll factor=4
uint16_t l2_i = i / OUTPUT_CHANS;
uint16_t l2_o = i % OUTPUT_CHANS;
uint16_t l2_ichan = k*OCHAN_SCALE_FACTOR + l2_i;
assert(l2_ichan < L1_OUTPUT_CHANS);
assert(l2_i < OCHAN_SCALE_FACTOR);
assert(l2_o < OUTPUT_CHANS);
l2_products[l2_i][l2_o] = intermediate_fmaps[l2_i] * l2_filter_data[l2_o][l2_ichan];
}
}
#if 2 > 1
// Reduces OUTPUT_CHANS groups of OCHAN_SCALE_FACTOR products into
// partial sums, one per group. This is skipped if OCHAN_SCALE_FACTOR=1
void tdf7_l2_accum (
data_t l2_products[OCHAN_SCALE_FACTOR][OUTPUT_CHANS],
data_t l2_partial_sums[OUTPUT_CHANS]
) {
L2_ACC_1: for (uint16_t group = 0; group < OUTPUT_CHANS/8; group++) {
// Need to explicitly tell tool to not pipeline these loops
#pragma HLS pipeline off
data_t sums[8];
#pragma HLS array_partition variable=sums complete
L2_ACC_2: for (uint16_t i = 0; i < OCHAN_SCALE_FACTOR; i++) {
#pragma HLS pipeline off
L2_ACC_3: for (uint8_t s = 0; s < 8; s++) {
// Unroll this inner-most loop, but do not pipeline. Running sum accumulations
// cannot be pipelined.
#pragma HLS pipeline off
#pragma HLS unroll factor=8
uint16_t out_idx = group*8 + s;
assert(out_idx < OUTPUT_CHANS);
sums[s] += l2_products[i][out_idx];
}
}
for (uint8_t s = 0; s < 8; s++) {
// This as well should be fully unrolled so that all writes occur in parallel.
#pragma HLS pipeline off
#pragma HLS unroll factor=8
uint16_t out_idx = group*8 + s;
assert(out_idx < OUTPUT_CHANS);
l2_partial_sums[out_idx] = sums[s];
}
}
}
#endif
// Final stage in conv-conv layer pipeline.
// This stage holds an array of running sums. It receives one partial sum for each
// output channel each time it is called, pertaining to a subset of the L2 input channels.
// Once all L2 input channels have been processed, the running sums will be the final
// complete sums that can be adjusted and then written to the output URAMs. This is
// indicated by the "write" input.
void tdf7_l2_writeOutputs (
uint16_t i_int, uint16_t j_int, bool write,
data_t l2_partial_sums[OUTPUT_CHANS],
data_t out_data[OUTPUT_HEIGHT][OUTPUT_WIDTH][OUTPUT_CHANS],
data_t l2_adjustments[OUTPUT_CHANS][4]
) {
static data_t running_sums[OUTPUT_CHANS];
#pragma HLS bind_storage variable=running_sums type=ram_t2p impl=bram
data_t quad[4];
#pragma HLS array_partition variable=quad complete
for(uint16_t ochan = 0; ochan < OUTPUT_CHANS; ochan++) {
#pragma HLS pipeline
#pragma HLS dependence variable=out_data inter RAW false
data_t val = l2_partial_sums[ochan];
data_t sum = running_sums[ochan] + val;
// Either save the sum to accumulate a running sum, or reset to 0 when
// we have received the final set of partial sums for these outputs.
running_sums[ochan] = write ? (data_t)0 : sum;
// Read the adjustments for this output channel
data_t mean = l2_adjustments[ochan][0];
data_t inv_sqrt_var = l2_adjustments[ochan][1];
data_t bias = l2_adjustments[ochan][2];
// Send the sum through the adjustment pipeline.
quad[ochan % 4] = tdf7_adjust_value(sum, mean, inv_sqrt_var, bias);
// Every four iterations, write four values to the output all at once
// We do it this way because the output data is stored in UltraRAMs where
// four words are packed into a single URAM row.
if (write && (ochan % 4 == 3)) {
for (int q = 0; q < 4; q++) { // will be automatically unrolled
uint16_t ochan_idx = ((ochan/4)*4) + q;
assert(i_int < OUTPUT_HEIGHT);
assert(j_int < OUTPUT_WIDTH);
assert(ochan_idx < OUTPUT_CHANS);
out_data[i_int][j_int][ochan_idx] = quad[q];
}
}
}
}
//////////////////////////////////////////////////////////////
// ACCUMULATION FUNCTIONS
//////////////////////////////////////////////////////////////
// Accumulation stage 1
// This is a pipelined tree accumulation stage
// It reduces 288 inputs to 9 outputs.
// The estimated latency is 25 cycles.
void tdf7_accum_1(
data_t accum_in[288],
data_t accum_out[9]
) {
uint16_t out_idx = 0;
IL_LOOP: for (uint16_t i1 = 0; i1 < 9; i1++) {
uint16_t i = i1 * 32;
#pragma HLS pipeline
data_t vals[32];
#pragma HLS array_partition variable=vals complete
// This loop will be automatically unrolled and ideally all
// iterations of it must be scheduled in the same cycle.
WRPC_LOOP: for (uint16_t w = 0; w < 32; w++) {
// Need this bounds check because input length is not necessarily
// a multiple of words read per cycle.
vals[w] = (i+w < 288) ? accum_in[i+w] : (data_t)0;
}
data_t sum0 = vals[31] + vals[30];
data_t sum1 = vals[29] + vals[28];
data_t sum2 = vals[27] + vals[26];
data_t sum3 = vals[25] + vals[24];
data_t sum4 = vals[23] + vals[22];
data_t sum5 = vals[21] + vals[20];
data_t sum6 = vals[19] + vals[18];
data_t sum7 = vals[17] + vals[16];
data_t sum8 = vals[15] + vals[14];
data_t sum9 = vals[13] + vals[12];
data_t sum10 = vals[11] + vals[10];
data_t sum11 = vals[9] + vals[8];
data_t sum12 = vals[7] + vals[6];
data_t sum13 = vals[5] + vals[4];
data_t sum14 = vals[3] + vals[2];
data_t sum15 = vals[1] + vals[0];
data_t sum16 = sum0 + sum1;
data_t sum17 = sum2 + sum3;
data_t sum18 = sum4 + sum5;
data_t sum19 = sum6 + sum7;
data_t sum20 = sum8 + sum9;
data_t sum21 = sum10 + sum11;
data_t sum22 = sum12 + sum13;
data_t sum23 = sum14 + sum15;
data_t sum24 = sum16 + sum17;
data_t sum25 = sum18 + sum19;
data_t sum26 = sum20 + sum21;
data_t sum27 = sum22 + sum23;
data_t sum28 = sum24 + sum25;
data_t sum29 = sum26 + sum27;
data_t sum30 = sum28 + sum29;
accum_out[out_idx+0] = sum30;
out_idx += 1;
}
}
// Accumulation stage 2
// This is a "simple" accumulation stage.
// It reduces 9 inputs to 1 output.
// The estimated latency is 28 cycles.
data_t tdf7_accum_2(data_t accum_in[9]) {
data_t sum = 0.0;
for (int i = 0; i < 9; i++) sum += accum_in[i];
return sum;
}
// Function that keeps track of indices i,j,k for the top loop
// i and j are the output row and column coordinates, respectively
// k represents the output channel, but not directly. It actually
// represents the group of output channels, since we can parallelize
// mutliple output channels for the same output XY coordinate.
// For example, if OCHAN_SCALE_FACTOR = 4 (meaning we process 4 output channels
// at the same time), then k = 1 represents output channels 4,5,6,7.
// NOTE: For the fused conv-conv layers, OCHAN_SCALE_FACTOR pertains to the
// "middle channels" of the feature maps between the two layers fused together.
void tdf7_get_next_ijk (uint16_t indices[3], bool *write) {
static uint16_t i = 0;
static uint16_t j = 0;
static uint16_t k = 0;
indices[0] = i;
indices[1] = j;
indices[2] = k;
*write = (k == (L1_OUTPUT_CHANS / OCHAN_SCALE_FACTOR) - 1);
k++;
if (k == L1_OUTPUT_CHANS / OCHAN_SCALE_FACTOR) {
k = 0;
j++;
if (j == OUTPUT_WIDTH) {
j = 0;
i++;
if (i == OUTPUT_HEIGHT) {
i = 0;
}
}
}
}
void tdf7 (
data_t in_data[INPUT_HEIGHT][INPUT_WIDTH][INPUT_CHANS_PADDED],
data_t out_data[OUTPUT_HEIGHT][OUTPUT_WIDTH][OUTPUT_CHANS],
data_t l1_filter_data[L1_OUTPUT_CHANS][FILTER_SIZE][FILTER_SIZE][INPUT_CHANS],
data_t l2_filter_data[OUTPUT_CHANS][L1_OUTPUT_CHANS],
data_t l1_adjustments[L1_OUTPUT_CHANS][4],
data_t l2_adjustments[OUTPUT_CHANS][4]
) {
// Ideally, this single for loop would be split into three nested loops like this,
// where the dataflow directive would be applied to L3:
//
// L1: for (int i = 0; i < OUTPUT_HEIGHT; i++) {
// L2: for (int j = 0; j < OUTPUT_WIDTH; j++) {
// L3: for (int k = 0; k < OUTPUT_CHANS / OCHAN_SCALE_FACTOR; k++) {
// (loop body)
// }
// }
// }
//
// While this does technically work with the dataflow optimization, the synthesizer
// is unable to properly flatten the three loops such that all calls to the dataflow
// pipeline occur in one single contiguous stream. Instead, only (L3 trip count) calls
// are made in a row, and then L2 cannot begin its next iteration until the dataflow
// pipeline is completely empty. Telling the synthesizer to explicitly flatten the loops
// only makes the problem worse and causes the dataflow optimization to fail entirely.
//
// So instead, we must explicitly flatten the loops in the C code itself. The "get_next_ijk"
// function will keep track of what the values of i,j,k would be if the loops were written
// as shown above.
//
// TODO: Figure out if this is fixed in Vitis.
TOP_LOOP: for (int f = 0; f < TOP_LOOP_ITERATIONS; f++) {
#pragma HLS stable variable=l1_filter_data
#pragma HLS stable variable=l2_filter_data
#pragma HLS stable variable=l1_adjustments
#pragma HLS stable variable=l2_adjustments
data_t ifmap_vec[FILTER_SIZE][FILTER_SIZE][INPUT_CHANS];
data_t weight_vecs[OCHAN_SCALE_FACTOR][FILTER_SIZE][FILTER_SIZE][INPUT_CHANS];
data_t products[OCHAN_SCALE_FACTOR][VECTOR_SIZE];
data_t sums[OCHAN_SCALE_FACTOR];
data_t intermediate_fmaps[OCHAN_SCALE_FACTOR];
#pragma HLS array_partition variable=sums complete
#pragma HLS array_partition variable=intermediate_fmaps complete
uint16_t indices[3];
bool write;
#pragma HLS array_partition variable=indices complete
tdf7_get_next_ijk(indices, &write);
uint16_t i_int = indices[0];
uint16_t j_int = indices[1];
uint16_t k_int = indices[2];
// FOR EACH OUTPUT ELEMENT:
// For the L1 part of the layer:
// - Read the convolution window of inputs
// - Read the filters
// - Perform element-wise multiplication of the inputs and weights
// - Accumulate the results
// - Write the outputs.
//
// Note that we can process multiple filters / output channels at the same time.
//
// For the L2 part of the layer:
// - Multiply the intermediate fmaps by the L2 filter data to get OCHAN_SCALE_FACTOR * OUTPUT_CHANS products
// - Accumulate each group of OCHAN_SCALE_FACTOR products to get OUTPUT_CHANS partial sums
// - Add these partial sums to OUTPUT_CHANS running sums
// - After L1_OUTPUT_CHANS/OCHAN_SCALE_FACTOR iterations of accumulating the running sums, we have the final
// 1x1xOUTPUT_CHANS data to write to the output URAMs.
tdf7_readInputs(in_data, i_int, j_int, ifmap_vec);
tdf7_readFilters(l1_filter_data, k_int, weight_vecs);
tdf7_dot_product(ifmap_vec, weight_vecs, products);
data_t accum1_out_0[9];
data_t accum1_out_1[9];
tdf7_accum_1(products[0], accum1_out_0);
tdf7_accum_1(products[1], accum1_out_1);
sums[0] = tdf7_accum_2(accum1_out_0);
sums[1] = tdf7_accum_2(accum1_out_1);
tdf7_adjust(sums, intermediate_fmaps, l1_adjustments, k_int);
data_t l2_products[OCHAN_SCALE_FACTOR][OUTPUT_CHANS];
#pragma HLS bind_storage variable=l2_products type=RAM_T2P impl=bram
#pragma HLS array_partition variable=l2_products cyclic factor=4 dim=2
tdf7_l2_multiply(intermediate_fmaps, l2_filter_data, l2_products, k_int);
#if 2 > 1
data_t l2_partial_sums[OUTPUT_CHANS];
#pragma HLS bind_storage variable=l2_partial_sums type=RAM_T2P impl=bram
#pragma HLS array_partition variable=l2_partial_sums cyclic factor=4
tdf7_l2_accum(l2_products, l2_partial_sums);
tdf7_l2_writeOutputs(i_int, j_int, write, l2_partial_sums, out_data, l2_adjustments);
#else
tdf7_l2_writeOutputs(i_int, j_int, write, l2_products[0], out_data, l2_adjustments);
#endif
}
}
// Top-level wrapper function for tdf7
// The output data is a port so that when we calculate cost, we don't double-count
// the UltraRAMs (since output of one layer is input to the next one).
void tdf7_top(data_t dummy_val, data_t out_data[OUTPUT_HEIGHT][OUTPUT_WIDTH][OUTPUT_CHANS]) {
data_t in_data[INPUT_HEIGHT][INPUT_WIDTH][INPUT_CHANS_PADDED];
data_t l1_filter_data[L1_OUTPUT_CHANS][FILTER_SIZE][FILTER_SIZE][INPUT_CHANS];
data_t l2_filter_data[OUTPUT_CHANS][L1_OUTPUT_CHANS];
data_t l1_adjustments[L1_OUTPUT_CHANS][4];
data_t l2_adjustments[OUTPUT_CHANS][4];
// Write one element to filters and adjustments to prevent tools from optimizing
// them out. This is just to make sure the resource estimates are accurate.
l1_filter_data[0][0][0][0] = dummy_val;
l2_filter_data[0][0] = dummy_val;
l1_adjustments[0][0] = dummy_val;
l2_adjustments[0][0] = dummy_val;
tdf7(in_data, out_data, l1_filter_data, l2_filter_data, l1_adjustments, l2_adjustments);
}
| [
"drauch@yoshi.ece.utexas.edu"
] | drauch@yoshi.ece.utexas.edu |
1801dee3bf81865271d22e27f8b93da6e0b643c5 | 1688e010017cf40b51e89c2dd5f028860e9a12d6 | /packages/core/std_tools/src/DataLogger.cpp | 8d7efc1eb310ed973badfe5a1729b7b2263574ec | [] | no_license | epfl-lasa/robot-toolkit | 1153b47bd3adc28e2b489f4d176c3e833b125299 | bcdc6cd4b4f5ea5b85ea3bf9a50d0da6861c3afe | refs/heads/master | 2020-04-14T14:59:07.985080 | 2017-11-03T08:55:49 | 2017-11-03T08:55:49 | 42,184,371 | 21 | 10 | null | 2016-06-21T11:26:15 | 2015-09-09T14:40:19 | C++ | UTF-8 | C++ | false | false | 652 | cpp | /*
* Copyright (C) 2010 Learning Algorithms and Systems Laboratory, EPFL, Switzerland
* Author: Eric Sauser
* email: eric.sauser@a3.epf.ch
* website: lasa.epfl.ch
*
* Permission is granted to copy, distribute, and/or modify this program
* under the terms of the GNU General Public License, version 2 or any
* later version published by the Free Software Foundation.
*
* 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
*/
#include "DataLogger.h"
| [
"klas.kronander@epfl.ch"
] | klas.kronander@epfl.ch |
14b2e386a17afb2909cf538ca58698f2e794dfea | 9ec244d896c57e649758820bc1126245e01f361f | /Benchmarks/BenchmarkNetworkServer.cpp | 97b58f7abd896ae1916478f8a51dcfb4b834dcb6 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | kirill-pinigin/Wuild | 4899141c4a9d337bac72dc3f820506708742c057 | 1524c1d8a054f6455941538d5b824613fc028894 | refs/heads/master | 2020-06-06T20:44:44.986925 | 2018-09-05T04:51:13 | 2018-09-05T04:51:29 | 192,848,561 | 1 | 0 | Apache-2.0 | 2019-06-20T04:30:05 | 2019-06-20T04:30:05 | null | UTF-8 | C++ | false | false | 879 | cpp | /*
* Copyright (C) 2018 Smirnov Vladimir mapron1@gmail.com
* Source code 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 or in file COPYING-APACHE-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.h
*/
#include "BenchmarkUtils.h"
int main(int argc, char** argv)
{
using namespace Wuild;
ConfiguredApplication app(argc, argv, "BenchmarkNetworking");
TestService service;
service.startServer();
return ExecAppLoop();
}
| [
"mapron1@gmail.com"
] | mapron1@gmail.com |
a55af7d289f5859667c394cd5a8eae37044596d3 | d8a857b30225ec802a3dfc5e044ffeb098dc7f42 | /test/test_roscpp/test/src/params.cpp | 04b2b77b172fd621fbc038030d0cd2e2f9e855c0 | [] | no_license | OSUrobotics/palantir_backup | 0dd066b63a1881d0cb7b1d3c3b6ee1cad54e4285 | 8310ddcbc32b26a59fdf1f0fce69653f56e3dee3 | refs/heads/master | 2021-03-12T19:38:55.205324 | 2014-05-23T22:37:46 | 2014-05-23T22:37:46 | 19,359,272 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 14,023 | cpp | /*
* Copyright (c) 2008, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, 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.
*/
/* Author: Josh Faust */
/*
* Test parameters
*/
#include <string>
#include <sstream>
#include <fstream>
#include <gtest/gtest.h>
#include <time.h>
#include <stdlib.h>
#include "ros/ros.h"
#include <ros/param.h>
using namespace ros;
TEST(Params, allParamTypes)
{
std::string string_param;
EXPECT_TRUE( param::get( "string", string_param ) );
EXPECT_TRUE( string_param == "test" );
int int_param = 0;
EXPECT_TRUE( param::get( "int", int_param ) );
EXPECT_TRUE( int_param == 10 );
double double_param = 0.0;
EXPECT_TRUE( param::get( "double", double_param ) );
EXPECT_DOUBLE_EQ( double_param, 10.5 );
bool bool_param = true;
EXPECT_TRUE( param::get( "bool", bool_param ) );
EXPECT_FALSE( bool_param );
}
TEST(Params, setThenGetString)
{
param::set( "test_set_param", std::string("asdf") );
std::string param;
ASSERT_TRUE( param::get( "test_set_param", param ) );
ASSERT_STREQ( "asdf", param.c_str() );
XmlRpc::XmlRpcValue v;
param::get("test_set_param", v);
ASSERT_EQ(v.getType(), XmlRpc::XmlRpcValue::TypeString);
}
TEST(Params, setThenGetStringCached)
{
std::string param;
ASSERT_FALSE( param::getCached( "test_set_param_setThenGetStringCached", param) );
param::set( "test_set_param_setThenGetStringCached", std::string("asdf") );
ASSERT_TRUE( param::getCached( "test_set_param_setThenGetStringCached", param) );
ASSERT_STREQ( "asdf", param.c_str() );
}
TEST(Params, setThenGetStringCachedNodeHandle)
{
NodeHandle nh;
std::string param;
ASSERT_FALSE( nh.getParamCached( "test_set_param_setThenGetStringCachedNodeHandle", param) );
nh.setParam( "test_set_param_setThenGetStringCachedNodeHandle", std::string("asdf") );
ASSERT_TRUE( nh.getParamCached( "test_set_param_setThenGetStringCachedNodeHandle", param) );
ASSERT_STREQ( "asdf", param.c_str() );
}
TEST(Params, setThenGetCString)
{
param::set( "test_set_param", "asdf" );
std::string param;
ASSERT_TRUE( param::get( "test_set_param", param ) );
ASSERT_STREQ( "asdf", param.c_str() );
}
TEST(Params, setThenGetInt)
{
param::set( "test_set_param", 42);
int param;
ASSERT_TRUE( param::get( "test_set_param", param ) );
ASSERT_EQ( 42, param );
XmlRpc::XmlRpcValue v;
param::get("test_set_param", v);
ASSERT_EQ(v.getType(), XmlRpc::XmlRpcValue::TypeInt);
}
TEST(Params, unknownParam)
{
std::string param;
ASSERT_FALSE( param::get( "this_param_really_should_not_exist", param ) );
}
TEST(Params, deleteParam)
{
param::set( "test_delete_param", "asdf" );
param::del( "test_delete_param" );
std::string param;
ASSERT_FALSE( param::get( "test_delete_param", param ) );
}
TEST(Params, hasParam)
{
ASSERT_TRUE( param::has( "string" ) );
}
TEST(Params, setIntDoubleGetInt)
{
param::set("test_set_int_as_double", 1);
param::set("test_set_int_as_double", 3.0f);
int i = -1;
ASSERT_TRUE(param::get("test_set_int_as_double", i));
ASSERT_EQ(3, i);
double d = 0.0f;
ASSERT_TRUE(param::get("test_set_int_as_double", d));
ASSERT_EQ(3.0, d);
}
TEST(Params, getIntAsDouble)
{
param::set("int_param", 1);
double d = 0.0;
ASSERT_TRUE(param::get("int_param", d));
ASSERT_EQ(1.0, d);
}
TEST(Params, getDoubleAsInt)
{
param::set("double_param", 2.3);
int i = -1;
ASSERT_TRUE(param::get("double_param", i));
ASSERT_EQ(2, i);
param::set("double_param", 3.8);
i = -1;
ASSERT_TRUE(param::get("double_param", i));
ASSERT_EQ(4, i);
}
TEST(Params, searchParam)
{
std::string ns = "/a/b/c/d/e/f";
std::string result;
param::set("/s_i", 1);
ASSERT_TRUE(param::search(ns, "s_i", result));
ASSERT_STREQ(result.c_str(), "/s_i");
param::del("/s_i");
param::set("/a/b/s_i", 1);
ASSERT_TRUE(param::search(ns, "s_i", result));
ASSERT_STREQ(result.c_str(), "/a/b/s_i");
param::del("/a/b/s_i");
param::set("/a/b/c/d/e/f/s_i", 1);
ASSERT_TRUE(param::search(ns, "s_i", result));
ASSERT_STREQ(result.c_str(), "/a/b/c/d/e/f/s_i");
param::del("/a/b/c/d/e/f/s_i");
bool cont = true;
while (!cont)
{
ros::WallDuration(0.1).sleep();
}
ASSERT_FALSE(param::search(ns, "s_j", result));
}
TEST(Params, searchParamNodeHandle)
{
NodeHandle n("/a/b/c/d/e/f");
std::string result;
n.setParam("/s_i", 1);
ASSERT_TRUE(n.searchParam("s_i", result));
ASSERT_STREQ(result.c_str(), "/s_i");
n.deleteParam("/s_i");
n.setParam("/a/b/s_i", 1);
ASSERT_TRUE(n.searchParam("s_i", result));
ASSERT_STREQ(result.c_str(), "/a/b/s_i");
n.deleteParam("/a/b/s_i");
n.setParam("/a/b/c/d/e/f/s_i", 1);
ASSERT_TRUE(n.searchParam("s_i", result));
ASSERT_STREQ(result.c_str(), "/a/b/c/d/e/f/s_i");
n.deleteParam("/a/b/c/d/e/f/s_i");
ASSERT_FALSE(n.searchParam("s_j", result));
}
TEST(Params, searchParamNodeHandleWithRemapping)
{
M_string remappings;
remappings["s_c"] = "s_b";
NodeHandle n("/a/b/c/d/e/f", remappings);
std::string result;
n.setParam("/s_c", 1);
ASSERT_FALSE(n.searchParam("s_c", result));
n.setParam("/s_b", 1);
ASSERT_TRUE(n.searchParam("s_c", result));
}
// See ROS ticket #2381
TEST(Params, getMissingXmlRpcValueParameterCachedTwice)
{
XmlRpc::XmlRpcValue v;
ASSERT_FALSE(ros::param::getCached("invalid_xmlrpcvalue_param", v));
ASSERT_FALSE(ros::param::getCached("invalid_xmlrpcvalue_param", v));
}
// See ROS ticket #2353
TEST(Params, doublePrecision)
{
ros::param::set("bar", 0.123456789123456789);
double d;
ASSERT_TRUE(ros::param::get("bar", d));
EXPECT_DOUBLE_EQ(d, 0.12345678912345678);
}
std::vector<std::string> vec_s, vec_s2;
std::vector<double> vec_d, vec_d2;
std::vector<float> vec_f, vec_f2;
std::vector<int> vec_i, vec_i2;
std::vector<bool> vec_b, vec_b2;
TEST(Params, vectorStringParam)
{
const std::string param_name = "vec_str_param";
vec_s.clear();
vec_s.push_back("foo");
vec_s.push_back("bar");
vec_s.push_back("baz");
ros::param::set(param_name, vec_s);
ASSERT_FALSE(ros::param::get(param_name, vec_d));
ASSERT_FALSE(ros::param::get(param_name, vec_f));
ASSERT_FALSE(ros::param::get(param_name, vec_i));
ASSERT_FALSE(ros::param::get(param_name, vec_b));
ASSERT_TRUE(ros::param::get(param_name, vec_s2));
ASSERT_EQ(vec_s.size(), vec_s2.size());
ASSERT_TRUE(std::equal(vec_s.begin(), vec_s.end(), vec_s2.begin()));
// Test empty vector
vec_s.clear();
ros::param::set(param_name, vec_s);
ASSERT_TRUE(ros::param::get(param_name, vec_s2));
ASSERT_EQ(vec_s.size(), vec_s2.size());
}
TEST(Params, vectorDoubleParam)
{
const std::string param_name = "vec_double_param";
vec_d.clear();
vec_d.push_back(-0.123456789);
vec_d.push_back(3);
vec_d.push_back(3.01);
vec_d.push_back(7.01);
ros::param::set(param_name, vec_d);
ASSERT_FALSE(ros::param::get(param_name, vec_s));
ASSERT_TRUE(ros::param::get(param_name, vec_i));
ASSERT_TRUE(ros::param::get(param_name, vec_b));
ASSERT_TRUE(ros::param::get(param_name, vec_f));
ASSERT_TRUE(ros::param::get(param_name, vec_d2));
ASSERT_EQ(vec_d.size(), vec_d2.size());
ASSERT_TRUE(std::equal(vec_d.begin(), vec_d.end(), vec_d2.begin()));
}
TEST(Params, vectorFloatParam)
{
const std::string param_name = "vec_float_param";
vec_f.clear();
vec_f.push_back(-0.123456789);
vec_f.push_back(0.0);
vec_f.push_back(3);
vec_f.push_back(3.01);
ros::param::set(param_name, vec_f);
ASSERT_FALSE(ros::param::get(param_name, vec_s));
ASSERT_TRUE(ros::param::get(param_name, vec_i));
ASSERT_TRUE(ros::param::get(param_name, vec_b));
ASSERT_TRUE(ros::param::get(param_name, vec_d));
ASSERT_EQ(vec_b[0],true);
ASSERT_EQ(vec_b[1],false);
ASSERT_TRUE(ros::param::get(param_name, vec_f2));
ASSERT_EQ(vec_f.size(), vec_f2.size());
ASSERT_TRUE(std::equal(vec_f.begin(), vec_f.end(), vec_f2.begin()));
}
TEST(Params, vectorIntParam)
{
const std::string param_name = "vec_int_param";
vec_i.clear();
vec_i.push_back(-1);
vec_i.push_back(0);
vec_i.push_back(1337);
vec_i.push_back(2);
ros::param::set(param_name, vec_i);
ASSERT_FALSE(ros::param::get(param_name, vec_s));
ASSERT_TRUE(ros::param::get(param_name, vec_d));
ASSERT_TRUE(ros::param::get(param_name, vec_f));
ASSERT_TRUE(ros::param::get(param_name, vec_b));
ASSERT_EQ(vec_b[0],true);
ASSERT_EQ(vec_b[1],false);
ASSERT_TRUE(ros::param::get(param_name, vec_i2));
ASSERT_EQ(vec_i.size(), vec_i2.size());
ASSERT_TRUE(std::equal(vec_i.begin(), vec_i.end(), vec_i2.begin()));
}
TEST(Params, vectorBoolParam)
{
const std::string param_name = "vec_bool_param";
vec_b.clear();
vec_b.push_back(true);
vec_b.push_back(false);
vec_b.push_back(true);
vec_b.push_back(true);
ros::param::set(param_name, vec_b);
ASSERT_FALSE(ros::param::get(param_name, vec_s));
ASSERT_TRUE(ros::param::get(param_name, vec_d));
ASSERT_TRUE(ros::param::get(param_name, vec_f));
ASSERT_TRUE(ros::param::get(param_name, vec_i));
ASSERT_EQ(vec_i[0],1);
ASSERT_EQ(vec_i[1],0);
ASSERT_TRUE(ros::param::get(param_name, vec_b2));
ASSERT_EQ(vec_b.size(), vec_b2.size());
ASSERT_TRUE(std::equal(vec_b.begin(), vec_b.end(), vec_b2.begin()));
}
std::map<std::string,std::string> map_s, map_s2;
std::map<std::string,double> map_d, map_d2;
std::map<std::string,float> map_f, map_f2;
std::map<std::string,int> map_i, map_i2;
std::map<std::string,bool> map_b, map_b2;
TEST(Params, mapStringParam)
{
const std::string param_name = "map_str_param";
map_s.clear();
map_s["a"] = "apple";
map_s["b"] = "blueberry";
map_s["c"] = "carrot";
ros::param::set(param_name, map_s);
ASSERT_FALSE(ros::param::get(param_name, map_d));
ASSERT_FALSE(ros::param::get(param_name, map_f));
ASSERT_FALSE(ros::param::get(param_name, map_i));
ASSERT_FALSE(ros::param::get(param_name, map_b));
ASSERT_TRUE(ros::param::get(param_name, map_s2));
ASSERT_EQ(map_s.size(), map_s2.size());
ASSERT_TRUE(std::equal(map_s.begin(), map_s.end(), map_s2.begin()));
}
TEST(Params, mapDoubleParam)
{
const std::string param_name = "map_double_param";
map_d.clear();
map_d["a"] = 0.0;
map_d["b"] = -0.123456789;
map_d["c"] = 123456789;
ros::param::set(param_name, map_d);
ASSERT_FALSE(ros::param::get(param_name, map_s));
ASSERT_TRUE(ros::param::get(param_name, map_f));
ASSERT_TRUE(ros::param::get(param_name, map_i));
ASSERT_TRUE(ros::param::get(param_name, map_b));
ASSERT_TRUE(ros::param::get(param_name, map_d2));
ASSERT_EQ(map_d.size(), map_d2.size());
ASSERT_TRUE(std::equal(map_d.begin(), map_d.end(), map_d2.begin()));
}
TEST(Params, mapFloatParam)
{
const std::string param_name = "map_float_param";
map_f.clear();
map_f["a"] = 0.0;
map_f["b"] = -0.123456789;
map_f["c"] = 123456789;
ros::param::set(param_name, map_f);
ASSERT_FALSE(ros::param::get(param_name, map_s));
ASSERT_TRUE(ros::param::get(param_name, map_d));
ASSERT_TRUE(ros::param::get(param_name, map_i));
ASSERT_TRUE(ros::param::get(param_name, map_b));
ASSERT_TRUE(ros::param::get(param_name, map_f2));
ASSERT_EQ(map_f.size(), map_f2.size());
ASSERT_TRUE(std::equal(map_f.begin(), map_f.end(), map_f2.begin()));
}
TEST(Params, mapIntParam)
{
const std::string param_name = "map_int_param";
map_i.clear();
map_i["a"] = 0;
map_i["b"] = -1;
map_i["c"] = 1337;
ros::param::set(param_name, map_i);
ASSERT_FALSE(ros::param::get(param_name, map_s));
ASSERT_TRUE(ros::param::get(param_name, map_d));
ASSERT_TRUE(ros::param::get(param_name, map_f));
ASSERT_TRUE(ros::param::get(param_name, map_b));
ASSERT_TRUE(ros::param::get(param_name, map_i2));
ASSERT_EQ(map_i.size(), map_i2.size());
ASSERT_TRUE(std::equal(map_i.begin(), map_i.end(), map_i2.begin()));
}
TEST(Params, mapBoolParam)
{
const std::string param_name = "map_bool_param";
map_b.clear();
map_b["a"] = true;
map_b["b"] = false;
map_b["c"] = true;
ros::param::set(param_name, map_b);
ASSERT_FALSE(ros::param::get(param_name, map_s));
ASSERT_TRUE(ros::param::get(param_name, map_d));
ASSERT_TRUE(ros::param::get(param_name, map_f));
ASSERT_TRUE(ros::param::get(param_name, map_i));
ASSERT_EQ(map_i["a"],1);
ASSERT_EQ(map_i["b"],0);
ASSERT_TRUE(ros::param::get(param_name, map_b2));
ASSERT_EQ(map_b.size(), map_b2.size());
ASSERT_TRUE(std::equal(map_b.begin(), map_b.end(), map_b2.begin()));
}
int
main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
ros::init( argc, argv, "params" );
// ros::NodeHandle nh;
return RUN_ALL_TESTS();
}
| [
"curranw@onid.orst.edu"
] | curranw@onid.orst.edu |
3588d7f9245d846efea3b4a26f93d6ad4629d06a | d2553f5fe10590ab00da55b538e683bfb35b395a | /smallSort2/smallSort2.cpp | 24f9d32483125848f7c9cee3f0aa82307d75399b | [] | no_license | dominickdechristofaro/CPlusPlus | cb3209d22df82786cebc36c2ccf0fc194993ac16 | b794db8e891d3e39f20ce068346ab429de0aa14b | refs/heads/master | 2020-06-08T04:46:03.758209 | 2019-06-21T21:18:04 | 2019-06-21T21:18:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,564 | cpp | /******************************************************************************
** Author: Dominick DeChristofaro
** Date: 05/22/2019
** Title: smallSort2.cpp
** Description: The smallSort function takes in 3 arguments by address and
sorts the numbers at those adresses in ascending order.
******************************************************************************/
// Takes in 3 integers by address and sorts the numbers in ascending order
void smallSort2(int* refNum1, int* refNum2, int* refNum3)
{
// 3 temporary variables used for reassigning values
int smallest = 0, // the smallest reference number
middle = 0, // the middle reference number
largest = 0; // the largest refernce number
// Case #1: All integers are different
if(*refNum1 > *refNum2)
{
if(*refNum1 > *refNum3)
{
if(*refNum2 > *refNum3) // Case 1.1: refNum1>refNum2>refNum3
{
largest = *refNum1;
middle = *refNum2;
smallest = *refNum3;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
else if(*refNum2 < *refNum3) // Case 1.2: refNum1>refNum3>refNum2
{
largest = *refNum1;
middle = *refNum3;
smallest = *refNum2;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
}
else if(*refNum1 < *refNum3) // Case 1.3: refNum3>refNum1>refNum2
{
largest = *refNum3;
middle = *refNum1;
smallest = *refNum2;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
}
else if(*refNum1 < *refNum2)
{
if(*refNum1 > *refNum3) // Case 1.4: refNum2>refNum1>refNum3
{
largest = *refNum2;
middle = *refNum1;
smallest = *refNum3;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
else if(*refNum1 < *refNum3)
{
if(*refNum2 > *refNum3) // Case 1.5: refNum2>refNum3>refNum1
{
largest = *refNum2;
middle = *refNum3;
smallest = *refNum1;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
else if(*refNum2 < *refNum3) // Case 1.6: refNum3>refNum2>refNum1
{
largest = *refNum3;
middle = *refNum2;
smallest = *refNum1;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
}
}
// Case#2: 2 integers are the same
if(*refNum1 == *refNum2)
{
if(*refNum1 > *refNum3) // Case 2.1: (A=B)>C
{
largest = *refNum1;
middle = *refNum2;
smallest = *refNum3;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
else if(*refNum1 < *refNum3) // Case 2.2: (A=B)<C
{
largest = *refNum3;
middle = *refNum2;
smallest = *refNum1;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
}
else if(*refNum1 == *refNum3)
{
if(*refNum1 > *refNum2) // Case 2.3: (A=C)>B
{
largest = *refNum1;
middle = *refNum3;
smallest = *refNum2;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
else if(*refNum1 < *refNum2) // Case 2.4: (A=C)<B
{
largest = *refNum2;
middle = *refNum1;
smallest = *refNum3;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
}
else if(*refNum2 == *refNum3)
{
if(*refNum2 > *refNum1) // Case 2.5: (B=C)>A
{
largest = *refNum2;
middle = *refNum3;
smallest = *refNum1;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
else if(*refNum2 < *refNum1) // Case 2.6: (B=C)<A
{
largest = *refNum1;
middle = *refNum2;
smallest = *refNum3;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
}
// Case #3: All integers are the same
if(*refNum1 == *refNum2 && *refNum1 == *refNum3 && *refNum2 == *refNum3)
{
largest = *refNum1;
middle = *refNum2;
smallest = *refNum3;
*refNum1 = smallest;
*refNum2 = middle;
*refNum3 = largest;
}
}
| [
"dominick.dechristofaro@gmail.com"
] | dominick.dechristofaro@gmail.com |
8c0f98fbc2f18509f0ab904408658aa4dc03a58d | 55b1b637b6ae8287379877b6301b4c1e4cfa226c | /sampler/randomSampler.cpp | 41d1cac52064d5786582cf8b2b1380153f42b4f2 | [] | no_license | mmoactrpg/RayTracer | 61119f79a9817ad9404923c0e952a47db131d586 | 5f75c0d05cba7f5beeae7ddd1d4b3ebe85da8fd8 | refs/heads/master | 2021-01-22T03:13:03.975235 | 2016-08-10T08:05:41 | 2016-08-10T08:05:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,234 | cpp | /*
* RandomSampler.cpp
*
* Created on: 2016年7月3日
* Author: zhuqian
*/
#include "memory.h"
#include "randomSampler.h"
#include "random.h"
RandomSampler::RandomSampler(int xStart, int xEnd, int yStart, int yEnd,
int spp) :
Sampler(xStart, xEnd, yStart, yEnd, spp) {
xPos = xStart;
yPos = yStart;
nSamples = spp;
imageSamples = AllocAligned<float>(4 * nSamples); //为一个像素的所有采样点分配空间 2->image 2->lens
lensSamples = imageSamples + 2 * nSamples;
Random rand(xStart + yStart * (xEnd - xStart));
for (int i = 0; i < 4 * nSamples; ++i) {
imageSamples[i] = rand.RandomFloat();
}
//偏移image像素的位置
for (int j = 0; j < 2 * nSamples; j += 2) {
imageSamples[j] += xPos;
imageSamples[j + 1] += yPos;
}
samplePos = 0;
}
int RandomSampler::GetMoreSamples(Sample *sample, Random &rng) {
if (samplePos == nSamples) { //1个像素内需要生成的采样点全部生成后,开始下个像素
if (xPixelStart == xPixelEnd || yPixelStart == yPixelEnd) //不需要采样的情况
return 0;
if (++xPos == xPixelEnd) {
xPos = xPixelStart;
++yPos;
}
if (yPos == yPixelEnd)
return 0;
for (int i = 0; i < 4 * nSamples; ++i)
imageSamples[i] = rng.RandomFloat();
for (int j = 0; j < 2 * nSamples; j += 2) {
imageSamples[j] += xPos;
imageSamples[j + 1] += yPos;
}
samplePos = 0;
}
sample->imageX = imageSamples[2 * samplePos];
sample->imageY = imageSamples[2 * samplePos + 1];
sample->lensU = lensSamples[2 * samplePos];
sample->lensV = lensSamples[2 * samplePos + 1];
//生成额外的1维采样点
for (unsigned int i = 0; i < sample->n1D.size(); ++i)
for (unsigned int j = 0; j < sample->n1D[i]; ++j)
sample->oneD[i][j] = rng.RandomFloat();
//生成额外的2维采样点
for (unsigned int i = 0; i < sample->n2D.size(); ++i)
for (unsigned int j = 0; j < 2 * sample->n2D[i]; ++j)
sample->twoD[i][j] = rng.RandomFloat();
++samplePos;
return 1;
}
Sampler* RandomSampler::GetSubSampler(int num, int count) {
int x0, x1, y0, y1;
ComputeSubWindow(num, count, &x0, &x1, &y0, &y1);
if (x0 == x1 || y0 == y1)
return nullptr;
return new RandomSampler(x0, x1, y0, y1, nSamples);
}
RandomSampler::~RandomSampler() {
}
| [
"zq317157782@163.com"
] | zq317157782@163.com |
44255a07a246866aa6501d0c45c45c4e257dfa75 | 5a44f67f17f505dda1a500a07f11fe7428745ef7 | /BFS/bfs.cpp | c0d9656f91d08470766dac1553aea5c0e04d912b | [] | no_license | cristian-rita/Algorithms | 67df77a7b6a8432d18c9426e03f428ed2ee228cc | acf360fb545aeb4194695b6f9a5b2964b20fd49a | refs/heads/master | 2021-01-10T12:41:46.870657 | 2016-03-19T03:21:26 | 2016-03-19T03:21:26 | 54,244,279 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,065 | cpp | #include<vector>
#include<queue>
#include<fstream>
#include<bitset>
#define maxn 1000100
using namespace std;
bitset<maxn> inQueue;
queue<int> Q;
vector<int> neighbours[maxn];
int n,m,source;
int dist[maxn];
void bfs(int source) {
Q.push(source);
dist[source] = 0;
inQueue[source] = 1;
while(!Q.empty()) {
int node = Q.front();
Q.pop();
for(int i = 0; i < neighbours[node].size(); i++) {
int neighbour = neighbours[node][i];
if(dist[neighbour] == -1)
dist[neighbour] = dist[node] + 1;
if(!inQueue[neighbour]) {
Q.push(neighbour);
inQueue[neighbour] = 1;
}
}
}
}
int main() {
ifstream in("bfs.in");
ofstream out("bfs.out");
for(int i = 0; i < maxn; i++)
dist[i] = -1;
in>>n>>m>>source;
int x,y;
for(int i = 0 ;i <= m;i++) {
in>>x>>y;
neighbours[x].push_back(y);
}
bfs(source);
for(int i = 1;i <= n; i++)
out<<dist[i] << " ";
return 0;
}
| [
"cristian.rita@vivacredit.ro"
] | cristian.rita@vivacredit.ro |
888f0a93fa2808ebf838f9d4b2c76b9b871b9f5b | 6ced41da926682548df646099662e79d7a6022c5 | /aws-cpp-sdk-iotwireless/include/aws/iotwireless/model/GetPositionRequest.h | 4ea75f29f8a64261315727244e180e5abec10339 | [
"Apache-2.0",
"MIT",
"JSON"
] | permissive | irods/aws-sdk-cpp | 139104843de529f615defa4f6b8e20bc95a6be05 | 2c7fb1a048c96713a28b730e1f48096bd231e932 | refs/heads/main | 2023-07-25T12:12:04.363757 | 2022-08-26T15:33:31 | 2022-08-26T15:33:31 | 141,315,346 | 0 | 1 | Apache-2.0 | 2022-08-26T17:45:09 | 2018-07-17T16:24:06 | C++ | UTF-8 | C++ | false | false | 4,509 | h | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/iotwireless/IoTWireless_EXPORTS.h>
#include <aws/iotwireless/IoTWirelessRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/iotwireless/model/PositionResourceType.h>
#include <utility>
namespace Aws
{
namespace Http
{
class URI;
} //namespace Http
namespace IoTWireless
{
namespace Model
{
/**
*/
class AWS_IOTWIRELESS_API GetPositionRequest : public IoTWirelessRequest
{
public:
GetPositionRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "GetPosition"; }
Aws::String SerializePayload() const override;
void AddQueryStringParameters(Aws::Http::URI& uri) const override;
/**
* <p>Resource identifier used to retrieve the position information.</p>
*/
inline const Aws::String& GetResourceIdentifier() const{ return m_resourceIdentifier; }
/**
* <p>Resource identifier used to retrieve the position information.</p>
*/
inline bool ResourceIdentifierHasBeenSet() const { return m_resourceIdentifierHasBeenSet; }
/**
* <p>Resource identifier used to retrieve the position information.</p>
*/
inline void SetResourceIdentifier(const Aws::String& value) { m_resourceIdentifierHasBeenSet = true; m_resourceIdentifier = value; }
/**
* <p>Resource identifier used to retrieve the position information.</p>
*/
inline void SetResourceIdentifier(Aws::String&& value) { m_resourceIdentifierHasBeenSet = true; m_resourceIdentifier = std::move(value); }
/**
* <p>Resource identifier used to retrieve the position information.</p>
*/
inline void SetResourceIdentifier(const char* value) { m_resourceIdentifierHasBeenSet = true; m_resourceIdentifier.assign(value); }
/**
* <p>Resource identifier used to retrieve the position information.</p>
*/
inline GetPositionRequest& WithResourceIdentifier(const Aws::String& value) { SetResourceIdentifier(value); return *this;}
/**
* <p>Resource identifier used to retrieve the position information.</p>
*/
inline GetPositionRequest& WithResourceIdentifier(Aws::String&& value) { SetResourceIdentifier(std::move(value)); return *this;}
/**
* <p>Resource identifier used to retrieve the position information.</p>
*/
inline GetPositionRequest& WithResourceIdentifier(const char* value) { SetResourceIdentifier(value); return *this;}
/**
* <p>Resource type of the resource for which position information is
* retrieved.</p>
*/
inline const PositionResourceType& GetResourceType() const{ return m_resourceType; }
/**
* <p>Resource type of the resource for which position information is
* retrieved.</p>
*/
inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; }
/**
* <p>Resource type of the resource for which position information is
* retrieved.</p>
*/
inline void SetResourceType(const PositionResourceType& value) { m_resourceTypeHasBeenSet = true; m_resourceType = value; }
/**
* <p>Resource type of the resource for which position information is
* retrieved.</p>
*/
inline void SetResourceType(PositionResourceType&& value) { m_resourceTypeHasBeenSet = true; m_resourceType = std::move(value); }
/**
* <p>Resource type of the resource for which position information is
* retrieved.</p>
*/
inline GetPositionRequest& WithResourceType(const PositionResourceType& value) { SetResourceType(value); return *this;}
/**
* <p>Resource type of the resource for which position information is
* retrieved.</p>
*/
inline GetPositionRequest& WithResourceType(PositionResourceType&& value) { SetResourceType(std::move(value)); return *this;}
private:
Aws::String m_resourceIdentifier;
bool m_resourceIdentifierHasBeenSet;
PositionResourceType m_resourceType;
bool m_resourceTypeHasBeenSet;
};
} // namespace Model
} // namespace IoTWireless
} // namespace Aws
| [
"aws-sdk-cpp-automation@github.com"
] | aws-sdk-cpp-automation@github.com |
d441b682adc4850faaa0fba4b26886f0aa8e89ec | b125623276da54715131aa62c5f74f033a933e43 | /src/old/editing.cpp | fa6f23f3c8a98ea5ce7c0be4902dd23149d7a45a | [] | no_license | wibbe/simple-rts | 9e2520be3224b7e49245cb42cb7b66a6c0b5b2ee | 9e418d84cf5a9a055006e3ac38e490583bf3310d | refs/heads/master | 2020-06-02T10:18:10.187309 | 2013-08-16T11:49:52 | 2013-08-16T11:49:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,149 | cpp | // editing.cpp: most map editing commands go here, entity editing commands are in world.cpp
#include "cube.h"
bool editmode = false;
// the current selection, used by almost all editing commands
// invariant: all code assumes that these are kept inside MINBORD distance of the edge of the map
block sel =
{
variable("selx", 0, 0, 4096, &sel.x, NULL, false),
variable("sely", 0, 0, 4096, &sel.y, NULL, false),
variable("selxs", 0, 0, 4096, &sel.xs, NULL, false),
variable("selys", 0, 0, 4096, &sel.ys, NULL, false),
};
int selh = 0;
bool selset = false;
#define loopselxy(b) { makeundo(); loop(x,sel.xs) loop(y,sel.ys) { sqr *s = S(sel.x+x, sel.y+y); b; }; remip(sel); }
int cx, cy, ch;
int curedittex[] = { -1, -1, -1 };
bool dragging = false;
int lastx, lasty, lasth;
int lasttype = 0, lasttex = 0;
sqr rtex;
VAR(editing,0,0,1);
void toggleedit()
{
if(player1->state==CS_DEAD) return; // do not allow dead players to edit to avoid state confusion
if(!editmode && !allowedittoggle()) return; // not in most multiplayer modes
if(!(editmode = !editmode))
{
settagareas(); // reset triggers to allow quick playtesting
entinmap(player1); // find spawn closest to current floating pos
}
else
{
resettagareas(); // clear trigger areas to allow them to be edited
player1->health = 100;
if(m_classicsp) monsterclear(); // all monsters back at their spawns for editing
projreset();
};
keyrepeat(editmode);
selset = false;
editing = editmode;
};
COMMANDN(edittoggle, toggleedit, ARG_NONE);
void correctsel() // ensures above invariant
{
selset = !OUTBORD(sel.x, sel.y);
int bsize = ssize-MINBORD;
if(sel.xs+sel.x>bsize) sel.xs = bsize-sel.x;
if(sel.ys+sel.y>bsize) sel.ys = bsize-sel.y;
if(sel.xs<=0 || sel.ys<=0) selset = false;
};
bool noteditmode()
{
correctsel();
if(!editmode) conoutf("this function is only allowed in edit mode");
return !editmode;
};
bool noselection()
{
if(!selset) conoutf("no selection");
return !selset;
};
#define EDITSEL if(noteditmode() || noselection()) return;
#define EDITSELMP if(noteditmode() || noselection() || multiplayer()) return;
#define EDITMP if(noteditmode() || multiplayer()) return;
void selectpos(int x, int y, int xs, int ys)
{
block s = { x, y, xs, ys };
sel = s;
selh = 0;
correctsel();
};
void makesel()
{
block s = { min(lastx,cx), min(lasty,cy), abs(lastx-cx)+1, abs(lasty-cy)+1 };
sel = s;
selh = max(lasth,ch);
correctsel();
if(selset) rtex = *S(sel.x, sel.y);
};
VAR(flrceil,0,0,2);
float sheight(sqr *s, sqr *t, float z) // finds out z height when cursor points at wall
{
return !flrceil //z-s->floor<s->ceil-z
? (s->type==FHF ? s->floor-t->vdelta/4.0f : (float)s->floor)
: (s->type==CHF ? s->ceil+t->vdelta/4.0f : (float)s->ceil);
};
void cursorupdate() // called every frame from hud
{
flrceil = 0; //((int)(player1->pitch>=0))*2;
volatile float x = worldpos.x; // volatile needed to prevent msvc7 optimizer bug?
volatile float y = worldpos.y;
volatile float z = worldpos.z;
cx = (int)x;
cy = (int)y;
if(OUTBORD(cx, cy)) return;
sqr *s = S(cx,cy);
if(fabs(sheight(s,s,z)-z)>1) // selected wall
{
x += x>player1->o.x ? 0.5f : -0.5f; // find right wall cube
y += y>player1->o.y ? 0.5f : -0.5f;
cx = (int)x;
cy = (int)y;
if(OUTBORD(cx, cy)) return;
};
if(dragging) makesel();
const int GRIDSIZE = 5;
const float GRIDW = 0.5f;
const float GRID8 = 2.0f;
const float GRIDS = 2.0f;
const int GRIDM = 0x7;
// render editing grid
for(int ix = cx-GRIDSIZE; ix<=cx+GRIDSIZE; ix++) for(int iy = cy-GRIDSIZE; iy<=cy+GRIDSIZE; iy++)
{
if(OUTBORD(ix, iy)) continue;
sqr *s = S(ix,iy);
if(SOLID(s)) continue;
float h1 = sheight(s, s, z);
float h2 = sheight(s, SWS(s,1,0,ssize), z);
float h3 = sheight(s, SWS(s,1,1,ssize), z);
float h4 = sheight(s, SWS(s,0,1,ssize), z);
if(s->tag) linestyle(GRIDW, 0xFF, 0x40, 0x40);
else if(s->type==FHF || s->type==CHF) linestyle(GRIDW, 0x80, 0xFF, 0x80);
else linestyle(GRIDW, 0x80, 0x80, 0x80);
block b = { ix, iy, 1, 1 };
box(b, h1, h2, h3, h4);
linestyle(GRID8, 0x40, 0x40, 0xFF);
if(!(ix&GRIDM)) line(ix, iy, h1, ix, iy+1, h4);
if(!(ix+1&GRIDM)) line(ix+1, iy, h2, ix+1, iy+1, h3);
if(!(iy&GRIDM)) line(ix, iy, h1, ix+1, iy, h2);
if(!(iy+1&GRIDM)) line(ix, iy+1, h4, ix+1, iy+1, h3);
};
if(!SOLID(s))
{
float ih = sheight(s, s, z);
linestyle(GRIDS, 0xFF, 0xFF, 0xFF);
block b = { cx, cy, 1, 1 };
box(b, ih, sheight(s, SWS(s,1,0,ssize), z), sheight(s, SWS(s,1,1,ssize), z), sheight(s, SWS(s,0,1,ssize), z));
linestyle(GRIDS, 0xFF, 0x00, 0x00);
dot(cx, cy, ih);
ch = (int)ih;
};
if(selset)
{
linestyle(GRIDS, 0xFF, 0x40, 0x40);
box(sel, (float)selh, (float)selh, (float)selh, (float)selh);
};
};
vector<block *> undos; // unlimited undo
VARP(undomegs, 0, 1, 10); // bounded by n megs
void pruneundos(int maxremain) // bound memory
{
int t = 0;
loopvrev(undos)
{
t += undos[i]->xs*undos[i]->ys*sizeof(sqr);
if(t>maxremain) free(undos.remove(i));
};
};
void makeundo()
{
undos.add(blockcopy(sel));
pruneundos(undomegs<<20);
};
void editundo()
{
EDITMP;
if(undos.empty()) { conoutf("nothing more to undo"); return; };
block *p = undos.pop();
blockpaste(*p);
free(p);
};
block *copybuf = NULL;
void copy()
{
EDITSELMP;
if(copybuf) free(copybuf);
copybuf = blockcopy(sel);
};
void paste()
{
EDITMP;
if(!copybuf) { conoutf("nothing to paste"); return; };
sel.xs = copybuf->xs;
sel.ys = copybuf->ys;
correctsel();
if(!selset || sel.xs!=copybuf->xs || sel.ys!=copybuf->ys) { conoutf("incorrect selection"); return; };
makeundo();
copybuf->x = sel.x;
copybuf->y = sel.y;
blockpaste(*copybuf);
};
void tofronttex() // maintain most recently used of the texture lists when applying texture
{
loopi(3)
{
int c = curedittex[i];
if(c>=0)
{
uchar *p = hdr.texlists[i];
int t = p[c];
for(int a = c-1; a>=0; a--) p[a+1] = p[a];
p[0] = t;
curedittex[i] = -1;
};
};
};
void editdrag(bool isdown)
{
if(dragging = isdown)
{
lastx = cx;
lasty = cy;
lasth = ch;
selset = false;
tofronttex();
};
makesel();
};
// the core editing function. all the *xy functions perform the core operations
// and are also called directly from the network, the function below it is strictly
// triggered locally. They all have very similar structure.
void editheightxy(bool isfloor, int amount, block &sel)
{
loopselxy(if(isfloor)
{
s->floor += amount;
if(s->floor>=s->ceil) s->floor = s->ceil-1;
}
else
{
s->ceil += amount;
if(s->ceil<=s->floor) s->ceil = s->floor+1;
});
};
void editheight(int flr, int amount)
{
EDITSEL;
bool isfloor = flr==0;
editheightxy(isfloor, amount, sel);
addmsg(1, 7, SV_EDITH, sel.x, sel.y, sel.xs, sel.ys, isfloor, amount);
};
COMMAND(editheight, ARG_2INT);
void edittexxy(int type, int t, block &sel)
{
loopselxy(switch(type)
{
case 0: s->ftex = t; break;
case 1: s->wtex = t; break;
case 2: s->ctex = t; break;
case 3: s->utex = t; break;
});
conoutf("changed tex to %d", t);
};
void edittex(int type, int dir)
{
EDITSEL;
if(type<0 || type>3) return;
if(type!=lasttype) { tofronttex(); lasttype = type; };
int atype = type==3 ? 1 : type;
int i = curedittex[atype];
i = i<0 ? 0 : i+dir;
curedittex[atype] = i = min(max(i, 0), 255);
int t = lasttex = hdr.texlists[atype][i];
edittexxy(type, t, sel);
addmsg(1, 7, SV_EDITT, sel.x, sel.y, sel.xs, sel.ys, type, t);
};
void replace()
{
EDITSELMP;
loop(x,ssize) loop(y,ssize)
{
sqr *s = S(x, y);
switch(lasttype)
{
case 0: if(s->ftex == rtex.ftex) s->ftex = lasttex; break;
case 1: if(s->wtex == rtex.wtex) s->wtex = lasttex; break;
case 2: if(s->ctex == rtex.ctex) s->ctex = lasttex; break;
case 3: if(s->utex == rtex.utex) s->utex = lasttex; break;
};
};
block b = { 0, 0, ssize, ssize };
remip(b);
};
void edittypexy(int type, block &sel)
{
loopselxy(s->type = type);
};
void edittype(int type)
{
EDITSEL;
if(type==CORNER && (sel.xs!=sel.ys || sel.xs==3 || sel.xs>4 && sel.xs!=8
|| sel.x&~-sel.xs || sel.y&~-sel.ys))
{ conoutf("corner selection must be power of 2 aligned"); return; };
edittypexy(type, sel);
addmsg(1, 6, SV_EDITS, sel.x, sel.y, sel.xs, sel.ys, type);
};
void heightfield(int t) { edittype(t==0 ? FHF : CHF); };
void solid(int t) { edittype(t==0 ? SPACE : SOLID); };
void corner() { edittype(CORNER); };
COMMAND(heightfield, ARG_1INT);
COMMAND(solid, ARG_1INT);
COMMAND(corner, ARG_NONE);
void editequalisexy(bool isfloor, block &sel)
{
int low = 127, hi = -128;
loopselxy(
{
if(s->floor<low) low = s->floor;
if(s->ceil>hi) hi = s->ceil;
});
loopselxy(
{
if(isfloor) s->floor = low; else s->ceil = hi;
if(s->floor>=s->ceil) s->floor = s->ceil-1;
});
};
void equalize(int flr)
{
bool isfloor = flr==0;
EDITSEL;
editequalisexy(isfloor, sel);
addmsg(1, 6, SV_EDITE, sel.x, sel.y, sel.xs, sel.ys, isfloor);
};
COMMAND(equalize, ARG_1INT);
void setvdeltaxy(int delta, block &sel)
{
loopselxy(s->vdelta = max(s->vdelta+delta, 0));
remipmore(sel);
};
void setvdelta(int delta)
{
EDITSEL;
setvdeltaxy(delta, sel);
addmsg(1, 6, SV_EDITD, sel.x, sel.y, sel.xs, sel.ys, delta);
};
const int MAXARCHVERT = 50;
int archverts[MAXARCHVERT][MAXARCHVERT];
bool archvinit = false;
void archvertex(int span, int vert, int delta)
{
if(!archvinit)
{
archvinit = true;
loop(s,MAXARCHVERT) loop(v,MAXARCHVERT) archverts[s][v] = 0;
};
if(span>=MAXARCHVERT || vert>=MAXARCHVERT || span<0 || vert<0) return;
archverts[span][vert] = delta;
};
void arch(int sidedelta, int _a)
{
EDITSELMP;
sel.xs++;
sel.ys++;
if(sel.xs>MAXARCHVERT) sel.xs = MAXARCHVERT;
if(sel.ys>MAXARCHVERT) sel.ys = MAXARCHVERT;
loopselxy(s->vdelta =
sel.xs>sel.ys
? (archverts[sel.xs-1][x] + (y==0 || y==sel.ys-1 ? sidedelta : 0))
: (archverts[sel.ys-1][y] + (x==0 || x==sel.xs-1 ? sidedelta : 0)));
remipmore(sel);
};
void slope(int xd, int yd)
{
EDITSELMP;
int off = 0;
if(xd<0) off -= xd*sel.xs;
if(yd<0) off -= yd*sel.ys;
sel.xs++;
sel.ys++;
loopselxy(s->vdelta = xd*x+yd*y+off);
remipmore(sel);
};
void perlin(int scale, int seed, int psize)
{
EDITSELMP;
sel.xs++;
sel.ys++;
makeundo();
sel.xs--;
sel.ys--;
perlinarea(sel, scale, seed, psize);
sel.xs++;
sel.ys++;
remipmore(sel);
sel.xs--;
sel.ys--;
};
VARF(fullbright, 0, 0, 1,
if(fullbright)
{
if(noteditmode()) return;
loopi(mipsize) world[i].r = world[i].g = world[i].b = 176;
};
);
void edittag(int tag)
{
EDITSELMP;
loopselxy(s->tag = tag);
};
void newent(char *what, char *a1, char *a2, char *a3, char *a4)
{
EDITSEL;
newentity(sel.x, sel.y, (int)player1->o.z, what, ATOI(a1), ATOI(a2), ATOI(a3), ATOI(a4));
};
COMMANDN(select, selectpos, ARG_4INT);
COMMAND(edittag, ARG_1INT);
COMMAND(replace, ARG_NONE);
COMMAND(archvertex, ARG_3INT);
COMMAND(arch, ARG_2INT);
COMMAND(slope, ARG_2INT);
COMMANDN(vdelta, setvdelta, ARG_1INT);
COMMANDN(undo, editundo, ARG_NONE);
COMMAND(copy, ARG_NONE);
COMMAND(paste, ARG_NONE);
COMMAND(edittex, ARG_2INT);
COMMAND(newent, ARG_5STR);
COMMAND(perlin, ARG_3INT);
| [
"daniel.wiberg@oryx.se"
] | daniel.wiberg@oryx.se |
fd8d8d1704be1a29948db54498818e9ae28a7518 | 3a46dab9239a93d0512aad9e37a1d98477b1089b | /GFA Foundation (Week 1-5)/Week-1/Day-3/1HelloMe/main.cpp | 4ccc0566b53fe818d20c438f3e76b418566c3395 | [] | no_license | green-fox-academy/ithomas91-1.0 | 3a27f4a12d084d1b2f2c67a928bf0a42444d5613 | 32d762b7bbc2860de20592c50f538e31e96b9b0a | refs/heads/master | 2020-04-16T19:50:07.652139 | 2019-07-11T17:52:04 | 2019-07-11T17:52:04 | 165,876,260 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 96 | cpp | #include <iostream>
int main() {
std::cout << "Hello, Tamas!" << std::endl;
return 0;
} | [
"ithomas.nemeth@gmail.com"
] | ithomas.nemeth@gmail.com |
58aeab5155a3ddd386a5fb7790c1a30acc642a9b | 47059855ff82289a5e2ab1573304a25562968c41 | /Assignment 3/20100275/linearProbing.cpp | a69d084f3e79ea614be9eda915dfb0f4ae3e91f1 | [] | no_license | hamzahbaig/Course-Data-Strcutures | 0ab0d040e269ca8d9b2378abdd8d4a36e4564e07 | 057a6d39047d1423e14e13dc7f89867929eb5075 | refs/heads/master | 2020-09-01T01:24:00.679313 | 2019-10-31T19:19:12 | 2019-10-31T19:19:12 | 218,840,925 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,138 | cpp | #ifndef LINEARPROBING_CPP
#define LINEARPROBING_CPP
#include "linearProbing.h"
#include "hashfunctions.cpp"
HashL::HashL(){
tableSize = 1000; // you cant change this
hashTable = new block*[tableSize];
for (int i=0; i<tableSize; i++)
{
hashTable[i] = NULL;
}
}
HashL::~HashL(){
for (int i=0; i<tableSize; i++)
{
delete (hashTable[i]);
}
}
unsigned long HashL :: hash(string value){
int Hash= divCompression(bitHash(value),tableSize);
return Hash;
}
void HashL::resizeTable(){
int tempTableSize = tableSize;
tableSize = 2* tableSize;
block** temp = new block*[tableSize];
for(int i=0;i<tableSize;i++)
{
temp[i] = NULL;
}
count = 0;
int index;
for(int i =0 ;i < tempTableSize ;i++)
{
if(hashTable[i]!=NULL)
{
if(hashTable[i]->value != "MyMarker")
{
index = hash(hashTable[i]->value);
while(1)
{
if(temp[index] == NULL)
{
temp[index] = new block(index,hashTable[i]->value);
count++;
break;
}
if(index==tableSize-1)
{
index=0;
}
else
{
index++;
}
}
}
}
}
hashTable = temp;
return;
}
void HashL::insert(string value){
int index = hash(value);
while(1)
{
if(hashTable[index] == NULL || hashTable[index]->value == "MyMarker" )
{
hashTable[index] = new block(index,value);
count++;
if((double) count/tableSize >= 0.25)
{
resizeTable();
}
break;
}
if(index==tableSize-1)
{
index=0;
}
else
{
index++;
}
}
return;
}
void HashL::deleteWord(string value){
int index = hash(value);
while(1)
{
if(hashTable[index] == NULL)
{
break;
}
else if(hashTable[index]->value == value && hashTable[index]->key == index)
{
hashTable[index]->value = "MyMarker";
hashTable[index]->key = -1;
count--;
}
index++;
}
return;
}
block* HashL::lookup(string value){
int index = hash(value);
while(1)
{
if (hashTable[index] == NULL)
{
break;
}
else if(hashTable[index]->value == value && hashTable[index]->key == index)
{
return hashTable[index];
}
index ++;
}
return NULL;
}
void HashL::print()
{
for(int i=0;i<tableSize;i++)
{
if(hashTable[i] != NULL)
cout << i << "- Value->" <<hashTable[i]->value << " Key->" << hashTable[i]->key << endl;
}
}
// int main()
// {
// HashL* map = new HashL();
// for(int i=0;i<2000;i++)
// {
// map->insert("ADIL");
// }
// map->print();
// cout << "TABLESIZE: " << map->tableSize << endl;
// cout << "ENTRIES FILLED: " << map->count;
// }
#endif
| [
"48963915+Venom12345672@users.noreply.github.com"
] | 48963915+Venom12345672@users.noreply.github.com |
280feb7c13ce71a0e2845555128adb9f5a285ea9 | 376d167373b445198d17c379f03fce251c3249b0 | /practicas/monitores/modificado mio/3.prodcons2_sc_FIFO.cpp | 094852ac074cc977fa030d7c56b7b4b6e35231d3 | [] | no_license | antOnioOnio/SCD | 838544610cb78a8954add50be627a61659383089 | 3591981602ca6c4095a397b2bef4e0b82ff5c961 | refs/heads/master | 2020-04-21T03:10:51.630099 | 2019-02-05T16:52:41 | 2019-02-05T16:52:41 | 169,276,505 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,683 | cpp | // -----------------------------------------------------------------------------
//
// Sistemas concurrentes y Distribuidos.
// Seminario 2. Introducción a los monitores en C++11.
//
// archivo: prodcons_2_sc_FIFO.cpp
// Ejemplo de un monitor en C++11 con semántica SC, para el problema
// del productor/consumidor, con multiples consumidores y producotores
//
//
// Historial:
// Creado en Octubre de 2017
// Antonio Garcia Castillo
// -----------------------------------------------------------------------------
#include <iostream>
#include <iomanip>
#include <cassert>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <random>
using namespace std ;
constexpr int
num_items = 40 , // número de items a producir/consumir
num_hebras_consumidoras = 10,
num_hebras_productoras = 10,
items_productor = num_items/num_hebras_productoras,
items_consumidor = num_items/num_hebras_consumidoras;
int array_compartido[num_hebras_productoras]={0};
mutex
mtx ; // mutex de escritura en pantalla
unsigned
cont_prod[num_items], // contadores de verificación: producidos
cont_cons[num_items]; // contadores de verificación: consumidos
//**********************************************************************
// plantilla de función para generar un entero aleatorio uniformemente
// distribuido entre dos valores enteros, ambos incluidos
// (ambos tienen que ser dos constantes, conocidas en tiempo de compilación)
//----------------------------------------------------------------------
template< int min, int max > int aleatorio()
{
static default_random_engine generador( (random_device())() );
static uniform_int_distribution<int> distribucion_uniforme( min, max ) ;
return distribucion_uniforme( generador );
}
//**********************************************************************
// FUNCIONES PRODUCTORAS Y CONSUMIDORAS
//----------------------------------------------------------------------
int producir_dato(int hebra)
{
// Ganamos exclusion mutua, pues no queremos alterar datos del array compartido
this_thread::sleep_for( chrono::milliseconds( aleatorio<20,100>() ));
// inicializamos las posiciones de nuestro vector
if (array_compartido[hebra]==0){
array_compartido[hebra]=hebra*items_productor;
}
int contador = array_compartido[hebra];
mtx.lock();
cout << "Hebra "<<hebra << " produce: " << contador << endl << flush ;
array_compartido[hebra]++;
mtx.unlock();
cont_prod[contador] ++ ;
return contador;
}
//----------------------------------------------------------------------
void consumir_dato( unsigned dato )
{
if ( num_items <= dato )
{
cout << " dato === " << dato << ", num_items == " << num_items << endl ;
assert( dato < num_items );
}
cont_cons[dato] ++ ;
this_thread::sleep_for( chrono::milliseconds( aleatorio<20,100>() ));
mtx.lock();
cout << " consumido: " << dato << endl ;
mtx.unlock();
}
//----------------------------------------------------------------------
void ini_contadores()
{
for( unsigned i = 0 ; i < num_items ; i++ )
{ cont_prod[i] = 0 ;
cont_cons[i] = 0 ;
}
}
//----------------------------------------------------------------------
void test_contadores()
{
bool ok = true ;
cout << "comprobando contadores ...." << flush ;
for( unsigned i = 0 ; i < num_items ; i++ )
{
if ( cont_prod[i] != 1 )
{
cout << "error: valor " << i << " producido " << cont_prod[i] << " veces." << endl ;
ok = false ;
}
if ( cont_cons[i] != 1 )
{
cout << "error: valor " << i << " consumido " << cont_cons[i] << " veces" << endl ;
ok = false ;
}
}
if (ok)
cout << endl << flush << "solución (aparentemente) correcta." << endl << flush ;
}
// *****************************************************************************
// clase para monitor buffer, version FIFO, semántica SC, multiples prod. y cons.
class ProdCons1SC
{
private:
static const int // constantes:
num_celdas_total = 10; // núm. de entradas del buffer
int // variables permanentes
buffer[num_celdas_total], // buffer de tamaño fijo, con los datos
posicion_leer , // indice de celda de la próxima inserción
posicion_escribir,
usados;
mutex
cerrojo_monitor ; // cerrojo del monitor
condition_variable // colas condicion:
ocupadas, // cola donde espera el consumidor (posiscion_escribir != posicion_leer)
libres ; // cola donde espera el productor (posicion_escribir+1 != posicion_leer)
public: // constructor y métodos públicos
ProdCons1SC( ) ; // constructor
int leer(); // extraer un valor (sentencia L) (consumidor)
void escribir( int valor ); // insertar un valor (sentencia E) (productor)
} ;
// -----------------------------------------------------------------------------
ProdCons1SC::ProdCons1SC( )
{
posicion_leer = 0 ;
posicion_escribir = 0;
usados = 0;
}
// -----------------------------------------------------------------------------
// función llamada por el consumidor para extraer un dato
int ProdCons1SC::leer( )
{
// ganar la exclusión mutua del monitor con una guarda
unique_lock<mutex> guarda( cerrojo_monitor );
// esperar bloqueado hasta que haya escritos
// tambien nos sirve para que no se lea una posicion antes de ser escrita
while( usados == 0){
ocupadas.wait(guarda);
}
// hacer la operación de lectura
const int valor = buffer[posicion_leer] ;
// aumentamos posicion de lectura
posicion_leer++ ;
// Nos aseguramos de que no se salga de nuestro buffer
posicion_leer = posicion_leer%num_celdas_total;
usados--;
// señalar al productor que puede escribir sobre la siguiente celda
libres.notify_one();
// devolver valor
return valor ;
}
// -----------------------------------------------------------------------------
void ProdCons1SC::escribir( int valor )
{
// ganar la exclusión mutua del monitor con una guarda
unique_lock<mutex> guarda( cerrojo_monitor );
// Como no podemos hacer suposiciones de velocidad, tenemos que asegurarnos de que la posicion
// de escritura no coja nunca a la posicion de lectura en el caso de que esta la doble.
while (usados == num_celdas_total){
libres.wait(guarda);
}
// operacion de inserccion
buffer[posicion_escribir] = valor ;
// Aumentamos y nos aseguramos de no salirnos del vector
posicion_escribir++;
posicion_escribir = posicion_escribir%num_celdas_total;
usados++;
// señalar al consumidor que ya hay una celda ocupada (por si esta esperando)
ocupadas.notify_one();
}
// *****************************************************************************
// funciones de hebras
void funcion_hebra_productora( ProdCons1SC * monitor, int num_hebra )
{
for( unsigned i = 0 ; i < items_productor ; i++ )
{
int valor = producir_dato(num_hebra) ;
monitor->escribir( valor );
}
}
// -----------------------------------------------------------------------------
void funcion_hebra_consumidora( ProdCons1SC * monitor, int num_hebra )
{
for( unsigned i = 0 ; i < items_consumidor ; i++ )
{
int valor = monitor->leer();
consumir_dato( valor ) ;
}
}
// -----------------------------------------------------------------------------
int main()
{
cout << "-------------------------------------------------------------------------------" << endl
<< "Problema de los productores-consumidores (mult. prod/cons, Monitor SC, buffer FIFO). " << endl
<< "-------------------------------------------------------------------------------" << endl
<< flush ;
ProdCons1SC monitor ;
thread hebras_con[num_hebras_consumidoras],
hebras_pro[num_hebras_productoras];
for ( int i = 0 ; i < num_hebras_productoras ;i++){
hebras_pro[i]= thread(funcion_hebra_productora, &monitor, i);
}
for ( int i = 0 ; i< num_hebras_consumidoras ; i++){
hebras_con[i] = thread(funcion_hebra_consumidora, &monitor, i);
}
for ( int i = 0 ; i <num_hebras_productoras; i ++){
hebras_pro[i].join();
}
for ( int i = 0 ; i<num_hebras_consumidoras; i++){
hebras_con[i].join();
}
// comprobar que cada item se ha producido y consumido exactamente una vez
test_contadores() ;
}
| [
"anthoniusstanfield@gmail.com"
] | anthoniusstanfield@gmail.com |
878a80b947680216c0d9c410aa53b79161a01486 | 801cb1fb8fff6566c8aa2faed53d6892f616e84b | /clientmanager/clientthread.h | 8d7633ffec3384ab67fe955d86df83c90cd29a86 | [] | no_license | fanout/scaledemo | 1b216493570293127cd87d8a46c4af0ee806f4a8 | 4b5fa66067277196201a9339b25b079896c44940 | refs/heads/master | 2021-01-19T21:58:08.885585 | 2013-10-20T04:02:04 | 2013-10-20T04:02:04 | 12,533,685 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,439 | h | /*
* Copyright (C) 2013 Fanout, Inc.
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CLIENTTHREAD_H
#define CLIENTTHREAD_H
#include <QThread>
class QUrl;
class Client;
class ClientThread : public QThread
{
Q_OBJECT
public:
class Stats
{
public:
int total;
int started;
int received;
int errored;
int id;
QString body;
int latency;
Stats() :
total(0),
started(0),
received(0),
errored(0),
id(-1),
latency(0)
{
}
};
ClientThread(QObject *parent = 0);
~ClientThread();
void start();
void stop();
void setupClients(const QUrl &baseUri, int count, const QString &connectHost);
signals:
void statsChanged(const ClientThread::Stats &stats);
private slots:
void worker_statsChanged(const ClientThread::Stats &stats);
private:
class Worker;
Worker *worker;
};
#endif
| [
"justin@affinix.com"
] | justin@affinix.com |
dda0ce6ae07840cd55d539189890c435e59eddae | 49e125a9e43d22706cea8f304e88c96dd20197ae | /SPOJ/special string.cpp | b7f6e8d2c97a745f0ac41185021a0e905b8b5208 | [] | no_license | tahsinsoha/Problem-solving- | b0382b7afa539715dafb1fbc40666e4051b5f7db | 7049dcc7ab9e4a59977787c2e9052055bff560a8 | refs/heads/master | 2023-01-06T02:35:56.822736 | 2020-11-04T12:15:43 | 2020-11-04T12:15:43 | 280,789,760 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,044 | cpp | #include<bits/stdc++.h>
using namespace std;
long long dp[35][4][4];
int vis[35][4][4];
int n,p;
long long rec(int i, int p1, int p2)
{
if(i>=n)
return 1LL;
if(vis[i][p1][p2]==p)
{
return dp[i][p1][p2];
}
long long t =0;
if(p1!=p2)
{
if(p1+p2==3 && p1 && p2 )
{
t+= rec(i+1,1,p1);
t+=rec(i+1,2,p1);
}
else if(p1+p2==4 )
{
t+= rec(i+1,3,p1);
t+=rec(i+1,1,p1);
}
else if(p1+p2==5 )
{
t+= rec(i+1,3,p1);
t+=rec(i+1,2,p1);
}
else
{
t+= rec(i+1,1,p1);
t+=rec(i+1,2,p1);
t+=rec(i+1,3,p1);
}
}
else
{
t+= rec(i+1,1,p1);
t+=rec(i+1,2,p1);
t+=rec(i+1,3,p1);
}
vis[i][p1][p2]=p;
return dp[i][p1][p2]=t;
}
int main()
{
int tc;
cin>>tc;
while(tc--)
{
p++;
cin>>n;
cout<<rec(0,0,0)<<endl;
}
return 0;
}
| [
"soha97368@gmail.com"
] | soha97368@gmail.com |
e492236418925994e6a0e17d0123cb73189a2702 | 36006487fbed2c19a2367e968afc11e76a55bb95 | /Codeforces/1005D.cpp | 8c3e2b5cc64f513067cf3ecbe22e43963df60441 | [] | no_license | AkVaya/CP_Solutions | 99bd280470997f048ca2ee9b9dda83488d19ca7e | 60fd900aad28caf34b15b75ce736141dbc074d9f | refs/heads/master | 2021-09-27T13:57:38.897747 | 2021-09-16T16:43:55 | 2021-09-16T16:43:55 | 232,780,223 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,420 | cpp | #include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<stdio.h>
#include<iomanip>
#include<algorithm>
#include<map>
#include<math.h>
#include<string.h>
#include<ctime>
#include<cmath>
#define ll long long
#define eb emplace_back
#define pb push_back
#define ins insert
#define mp make_pair
#define max3(a,b,c) max(c,max(a,b))
#define min3(a,b,c) min(c,min(a,b))
#define inf 1000000000000000000
using namespace std;
const ll M =1e9+7;
const ll nax=200001;
ll dp[nax][3],n;
string s;
ll fun(ll ind,ll remainder){
if(ind==n){
if(remainder==0)
return 1;
else return 0;
}
if(dp[ind][remainder]!=-1)
return dp[ind][remainder];
ll x=s[ind]-'0';
ll temp=0;
if(remainder==0)
temp=max(temp,1+fun(ind+1,x%3));
else
temp=max3(temp,fun(ind+1,(x+remainder)%3),fun(ind+1,x%3));
dp[ind][remainder]=temp;
return temp;
}
void solve(){
cin>>s;
n=s.length();
for (int i = 0; i < n; ++i)
{
dp[i][0]=-1;
dp[i][1]=-1;
dp[i][2]=-1;
}
cout<<fun(1,(s[0]-'0')%3)<<endl;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll t=1,t1=1;
//cin>>t;
//clock_t t3 = clock();
while(t--){
//cout<<"Case #"<<t1++<<": ";
solve();
}
//clock_t t2 = clock();
// cout << "Time-Taken: " << ((t2 - t3) / (double)CLOCKS_PER_SEC) << endl;
// cout << CLOCKS_PER_SEC << endl;
return 0 ;
} | [
"akshat.18je0072@am.iitism.ac.in"
] | akshat.18je0072@am.iitism.ac.in |
6a6400967d7f701cc1e1d82df588641a3392f621 | e434ff063b6e849e0b6b8d58cf6537336bc9ef09 | /src/other_helpers.hpp | 039132731b8d38d880f625466fc263dad7b1c4d0 | [
"BSD-2-Clause"
] | permissive | brucelai/isotree | 21a3bf8df7b5aa58166008c7093210150f4c3688 | 2e6d5bd35ef4359187fe65a5b4080c09725695c2 | refs/heads/master | 2023-06-12T07:45:31.842514 | 2021-07-05T19:55:08 | 2021-07-05T19:55:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,960 | hpp | /* Isolation forests and variations thereof, with adjustments for incorporation
* of categorical variables and missing values.
* Writen for C++11 standard and aimed at being used in R and Python.
*
* This library is based on the following works:
* [1] Liu, Fei Tony, Kai Ming Ting, and Zhi-Hua Zhou.
* "Isolation forest."
* 2008 Eighth IEEE International Conference on Data Mining. IEEE, 2008.
* [2] Liu, Fei Tony, Kai Ming Ting, and Zhi-Hua Zhou.
* "Isolation-based anomaly detection."
* ACM Transactions on Knowledge Discovery from Data (TKDD) 6.1 (2012): 3.
* [3] Hariri, Sahand, Matias Carrasco Kind, and Robert J. Brunner.
* "Extended Isolation Forest."
* arXiv preprint arXiv:1811.02141 (2018).
* [4] Liu, Fei Tony, Kai Ming Ting, and Zhi-Hua Zhou.
* "On detecting clustered anomalies using SCiForest."
* Joint European Conference on Machine Learning and Knowledge Discovery in Databases. Springer, Berlin, Heidelberg, 2010.
* [5] https://sourceforge.net/projects/iforest/
* [6] https://math.stackexchange.com/questions/3388518/expected-number-of-paths-required-to-separate-elements-in-a-binary-tree
* [7] Quinlan, J. Ross. C4. 5: programs for machine learning. Elsevier, 2014.
* [8] Cortes, David. "Distance approximation using Isolation Forests." arXiv preprint arXiv:1910.12362 (2019).
* [9] Cortes, David. "Imputing missing values with unsupervised random trees." arXiv preprint arXiv:1911.06646 (2019).
*
* BSD 2-Clause License
* Copyright (c) 2019-2021, David Cortes
* 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.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "isotree.hpp"
template <class sparse_ix__>
bool check_indices_are_sorted(sparse_ix__ indices[], size_t n)
{
if (n <= 1)
return true;
if (indices[n-1] < indices[0])
return false;
for (size_t ix = 1; ix < n; ix++)
if (indices[ix] < indices[ix-1])
return false;
return true;
}
template <class real_t__, class sparse_ix__>
void sort_csc_indices(real_t__ *restrict Xc, sparse_ix__ *restrict Xc_ind, sparse_ix__ *restrict Xc_indptr, size_t ncols_numeric)
{
std::vector<double> buffer_sorted_vals;
std::vector<sparse_ix__> buffer_sorted_ix;
std::vector<size_t> argsorted;
size_t n_this;
size_t ix1, ix2;
for (size_t col = 0; col < ncols_numeric; col++)
{
ix1 = Xc_indptr[col];
ix2 = Xc_indptr[col+1];
n_this = ix2 - ix1;
if (n_this && !check_indices_are_sorted(Xc_ind + ix1, n_this))
{
if (buffer_sorted_vals.size() < n_this)
{
buffer_sorted_vals.resize(n_this);
buffer_sorted_ix.resize(n_this);
argsorted.resize(n_this);
}
std::iota(argsorted.begin(), argsorted.begin() + n_this, ix1);
std::sort(argsorted.begin(), argsorted.begin() + n_this,
[&Xc_ind](const size_t a, const size_t b){return Xc_ind[a] < Xc_ind[b];});
for (size_t ix = 0; ix < n_this; ix++)
buffer_sorted_ix[ix] = Xc_ind[argsorted[ix]];
std::copy(buffer_sorted_ix.begin(), buffer_sorted_ix.begin() + n_this, Xc_ind + ix1);
for (size_t ix = 0; ix < n_this; ix++)
buffer_sorted_vals[ix] = Xc[argsorted[ix]];
std::copy(buffer_sorted_vals.begin(), buffer_sorted_vals.begin() + n_this, Xc + ix1);
}
}
}
template <class real_t__, class sparse_ix__>
void reconstruct_csr_sliced
(
real_t__ *restrict orig_Xr, sparse_ix__ *restrict orig_Xr_indptr,
real_t__ *restrict rec_Xr, sparse_ix__ *restrict rec_Xr_indptr,
size_t nrows
)
{
for (size_t row = 0; row < nrows; row++)
std::copy(rec_Xr + rec_Xr_indptr[row],
rec_Xr + rec_Xr_indptr[row+(size_t)1],
orig_Xr + orig_Xr_indptr[row]);
}
#define is_in_set(vv, ss) ((ss).find((vv)) != (ss).end())
template <class real_t__, class sparse_ix__, class size_t_>
void reconstruct_csr_with_categ
(
real_t__ *restrict orig_Xr, sparse_ix__ *restrict orig_Xr_ind, sparse_ix__ *restrict orig_Xr_indptr,
real_t__ *restrict rec_Xr, sparse_ix__ *restrict rec_Xr_ind, sparse_ix__ *restrict rec_Xr_indptr,
int *restrict rec_X_cat, bool is_col_major,
size_t_ *restrict cols_numeric, size_t_ *restrict cols_categ,
size_t nrows, size_t ncols, size_t ncols_numeric, size_t ncols_categ
)
{
/* Check if the numeric columns go first and in the original order */
bool num_is_seq = false;
if (ncols_numeric > 0 && check_indices_are_sorted(cols_numeric, ncols_numeric)) {
if (cols_numeric[0] == 0 && cols_numeric[ncols_numeric-1] == ncols_numeric-1)
num_is_seq = true;
}
std::unordered_set<size_t> cols_numeric_set;
std::unordered_set<size_t> cols_categ_set(cols_categ, cols_categ + ncols_categ);
std::unordered_map<size_t, sparse_ix__> orig_to_rec_num;
std::unordered_map<size_t, size_t> orig_to_rec_cat;
sparse_ix__ col_orig;
sparse_ix__ col_ind;
sparse_ix__ *restrict col_ptr;
if (num_is_seq)
{
reconstruct_csr_sliced(
orig_Xr, orig_Xr_indptr,
rec_Xr, rec_Xr_indptr,
nrows
);
}
else
{
if (ncols_numeric)
cols_numeric_set = std::unordered_set<size_t>(cols_numeric, cols_numeric + ncols_numeric);
for (size_t col = 0; col < ncols_numeric; col++)
orig_to_rec_num[cols_numeric[col]] = col;
}
for (size_t col = 0; col < ncols_categ; col++)
orig_to_rec_cat[cols_categ[col]] = col;
for (size_t row = 0; row < nrows; row++)
{
for (size_t col = orig_Xr_indptr[row]; col < orig_Xr_indptr[row+1]; col++)
{
if (isnan(orig_Xr[col]))
{
col_orig = orig_Xr_ind[col];
if (is_in_set(col_orig, cols_numeric_set)) {
col_ptr = std::lower_bound(rec_Xr_ind + rec_Xr_indptr[row],
rec_Xr_ind + rec_Xr_indptr[row+1],
col_orig);
orig_Xr[col] = rec_Xr[std::distance(rec_Xr_ind, col_ptr)];
}
else if (is_in_set((size_t)col_orig, cols_categ_set)) {
orig_Xr[col] = rec_X_cat[is_col_major?
(row + nrows*orig_to_rec_cat[col_orig])
:
(orig_to_rec_cat[col_orig] + row*ncols_categ)];
#ifndef _FOR_R
orig_Xr[col] = (orig_Xr[col] < 0)? NAN : orig_Xr[col];
#else
orig_Xr[col] = (orig_Xr[col] < 0)? NA_REAL : orig_Xr[col];
#endif
}
}
else if (orig_Xr[col] < 0)
{
col_orig = orig_Xr_ind[col];
if (is_in_set((size_t)col_orig, cols_categ_set)) {
orig_Xr[col] = rec_X_cat[is_col_major?
(row + nrows*orig_to_rec_cat[col_orig])
:
(orig_to_rec_cat[col_orig] + row*ncols_categ)];
#ifndef _FOR_R
orig_Xr[col] = (orig_Xr[col] < 0)? NAN : orig_Xr[col];
#else
orig_Xr[col] = (orig_Xr[col] < 0)? NA_REAL : orig_Xr[col];
#endif
}
}
}
}
}
| [
"david.cortes.rivera@gmail.com"
] | david.cortes.rivera@gmail.com |
64d47c78e13b4fb61408bbd708915b9935a945c9 | fa5eded7cdeb33fa9627fa57eddd66db1243859f | /examples/LCDI2C/LCDI2C.ino | 7dd38dca5a7d4a070dbae4978a1d4363a4c5a432 | [
"MIT"
] | permissive | sstaub/LCDi2c | 993f42ea36a826ddcdc71cd790cf51de4165590e | 843f10febf1097ea37d58939fd87cf1a25c9c872 | refs/heads/master | 2022-12-25T21:14:22.985401 | 2020-09-28T19:03:07 | 2020-09-28T19:03:07 | 298,745,831 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,897 | ino | #include "Arduino.h"
#include <LCDi2c.h>
#define LCD_CHARS 16
#define LCD_LINES 2
// special chars
uint8_t upArrow[8] = {
0b00100,
0b01010,
0b10001,
0b00100,
0b00100,
0b00100,
0b00000,
};
uint8_t downArrow[8] = {
0b00000,
0b00100,
0b00100,
0b00100,
0b10001,
0b01010,
0b00100,
};
uint8_t rightArrow[8] = {
0b00000,
0b00100,
0b00010,
0b11001,
0b00010,
0b00100,
0b00000,
};
uint8_t leftArrow[8] = {
0b00000,
0b00100,
0b01000,
0b10011,
0b01000,
0b00100,
0b00000,
};
float data = 0.1f;
LCDi2c lcd(0x27); // I2C address
void setup() {
lcd.begin(LCD_CHARS, LCD_LINES);
lcd.create(0, downArrow);
lcd.create(1, upArrow);
lcd.create(2, rightArrow);
lcd.create(3, leftArrow);
lcd.cls();
lcd.locate(0, 0);
lcd.printf("hello world %f", data);
// print user chars
lcd.character(0, 1, 0);
lcd.character(2, 1, 1);
lcd.character(4, 1, 2);
lcd.character(6, 1, 3);
delay(2000);
lcd.display(DISPLAY_OFF);
delay(2000);
lcd.display(DISPLAY_ON);
delay(2000);
lcd.display(BACKLIGHT_OFF);
delay(2000);
lcd.display(BACKLIGHT_ON);
delay(2000);
lcd.display(CURSOR_ON);
delay(2000);
lcd.display(BLINK_ON);
delay(2000);
lcd.display(BLINK_OFF);
delay(2000);
lcd.display(CURSOR_OFF);
delay(2000);
}
void loop() {
for (uint8_t pos = 0; pos < 13; pos++) {
// scroll one position to left
lcd.display(SCROLL_LEFT);
// step time
delay(500);
}
// scroll 29 positions (string length + display length) to the right
// to move it offscreen right
for (uint8_t pos = 0; pos < 29; pos++) {
// scroll one position to right
lcd.display(SCROLL_RIGHT);
// step time
delay(500);
}
// scroll 16 positions (display length + string length) to the left
// to move it back to center
for (uint8_t pos = 0; pos < 16; pos++) {
// scroll one position to left
lcd.display(SCROLL_LEFT);
// step time
delay(500);
}
delay(1000);
}
| [
"sstaub@users.noreply.github.com"
] | sstaub@users.noreply.github.com |
75d4c1a61e6f910cbaa8676476aa46f56dc4b12f | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/squid/gumtree/squid_new_hunk_37.cpp | 0f0da7a4b07ed9174f2b560227a02bd363610117 | [] | 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 | 866 | cpp | proxyingAb = opComplete;
}
void
Adaptation::Ecap::XactionRep::noteMoreBodyDataAvailable(RefCount<BodyPipe> bp)
{
Must(makingVb == opOn); // or we would not be registered as a consumer
Must(theMaster);
theMaster->noteVbContentAvailable();
}
void
Adaptation::Ecap::XactionRep::noteBodyProductionEnded(RefCount<BodyPipe> bp)
{
Must(makingVb == opOn); // or we would not be registered as a consumer
Must(theMaster);
theMaster->noteVbContentDone(true);
vbProductionFinished = true;
}
void
Adaptation::Ecap::XactionRep::noteBodyProducerAborted(RefCount<BodyPipe> bp)
{
Must(makingVb == opOn); // or we would not be registered as a consumer
Must(theMaster);
theMaster->noteVbContentDone(false);
vbProductionFinished = true;
}
void
Adaptation::Ecap::XactionRep::noteInitiatorAborted()
{
mustStop("initiator aborted");
| [
"993273596@qq.com"
] | 993273596@qq.com |
fc1c3e6c7a2c82f7c43dc9301c5cdaf3d22e242f | 30ab1090ba15c433f08bbff0a795bcca5817c023 | /jni/engine/AccelerateAction.cpp | 1555fb10c3f88ee59d9d7d06b2554afa745d78c2 | [] | no_license | dnuffer/redneckracer | 0c8e2efea148057bfbb81c689f0c81f5f430526b | f298e0fcda169829ffc7002165d38613eafc6ee8 | refs/heads/master | 2021-01-01T06:11:42.520020 | 2012-07-06T04:42:21 | 2012-07-06T04:42:21 | 4,918,963 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,684 | cpp | // Copyright 2011 Nuffer Brothers Software LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "EngineConfig.hpp"
#include "AccelerateAction.hpp"
namespace engine
{
void AccelerateAction::apply(const DrawablePtr& target, const DateTime& thisFrameStartTime, const TimeDuration& deltaTime)
{
// basic physics
// v = a t
// d = v t
// d = 1/2 a t^2
// delta_d = 1/2 a t^2 - 1/2 a (t-delta_t)^2 : 6 *, 2 -
// alternate forms (thanks to wolfram alpha)
// delta_d = -1/2 a delta_t (delta_t - 2 t) : 4 *, 1 - (using this one)
// delta_d = a delta_t t - (a delta_t^2)/2 : 4 *, 1 /, 1 -
// delta_d = 1/2 a delta_t (2 t - delta_t) : 4 *, 1 -
elapsedTime += deltaTime;
double delta_t = deltaTime.realSeconds();
double t = elapsedTime.realSeconds();
Point position = target->position();
currentSpeed = t * yPixelsPerSecondSquared;
if( (useMaxSpeed && (currentSpeed <= maxSpd)) || (!useMaxSpeed))
{
position.y() += -.5 * yPixelsPerSecondSquared * delta_t * (delta_t - 2 * t);
}
else
{
position.y() += maxSpd *delta_t;
}
position.x() += -.5 * xPixelsPerSecondSquared * delta_t * (delta_t - 2 * t);
target->setPosition(position);
}
}
| [
"danielnuffer@gmail.com"
] | danielnuffer@gmail.com |
71ea5092f6ac0893e089ee3bc23b3d144ccf74d0 | 3127c48bf60d367219df2b2901804a57db37e37e | /Ackerman.cpp | 6974fa96a65a313b11b5d6868893754c108a4b61 | [] | no_license | Maxrod98/Buddy-Allocator | 466566e2dfe7549fcbfe1f599bc7157358ced94e | 5047649ca27c40af83303eed7b2e5b1d2eb78422 | refs/heads/master | 2022-04-20T01:33:05.239771 | 2020-04-10T23:17:23 | 2020-04-10T23:17:23 | 254,752,867 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,040 | cpp | #include<iostream>
#include<sys/time.h>
#include<assert.h>
#include "Ackerman.h"
#include <string>
#include <cstring>
#include <sstream>
#include <stdlib.h>
using namespace std;
string Ackerman::get_time_diff(struct timeval * tp1, struct timeval * tp2) {
/* Returns a string containing the difference, in seconds and micro seconds, between two timevals. */
long sec = tp2->tv_sec - tp1->tv_sec;
long musec = tp2->tv_usec - tp1->tv_usec;
if (musec < 0) {
musec += (int)1e6;
sec--;
}
stringstream ss;
ss<< " [sec = "<< sec <<", musec = "<<musec<< "]";
return ss.str();
}
void Ackerman::test(BuddyAllocator *_ba) {
/* This is function repeatedly asks the user for the two parameters "n" and "m" to pass to the ackerman function, and invokes the function.
Before and after the invocation of the ackerman function, the value of the wallclock is taken, and the elapsed time for the computation
of the ackerman function is output.
*/
ba = _ba;
while (true) {
this->num_allocations = 0;
cout<<"====================================================================="<<endl;
cout<<"Please enter parameters n (<=3) and m (<=8) to ackerman function"<<endl;
cout<<"Enter 0 for either n or m in order to exit."<<endl<<endl;
int n, m;
cout <<" n = "; cin>>n;
cout<<" m = "; cin>>m;
if (!n || !m)
break;
struct timeval tp_start, tp_end; /* Used to compute elapsed time. */
gettimeofday(&tp_start, 0); // start timer
int result = Recurse(n, m); // compute ackerman value
gettimeofday(&tp_end, 0); // stop timer
cout<<"Ackerman("<<n<<", "<<m<<"): "<<result<<endl;
cout<<"Time taken: "<< get_time_diff(&tp_start, &tp_end) << endl;
cout<<"Number of allocate/free cycles: "<<this->num_allocations<<endl<<endl;
}
}
int Ackerman::Recurse(int a, int b) {
/* This is the implementation of the Ackerman function. The function itself is very function is very simple (just two recursive calls). We use it to exercise the
memory allocator (see "my_alloc" and "my_free"). For this, there are additional calls to "gettimeofday" to measure the elapsed time.
*/
/* The size "to_alloc" of the region to allocate is computed randomly: */
int to_alloc = ((2 << (rand() % 19)) * (rand() % 100)) / 100;
if (to_alloc < 4) to_alloc = 4;
int result = 0;
void* mem = ba->alloc(to_alloc); // request memory
num_allocations++;
if (mem != NULL) {
// testing the allocated memory
// generate a random byte to fill the allocated block of memory
char c = rand() % 128;
memset(mem, c, to_alloc * sizeof(char));
if (a == 0)
result = b + 1;
else if (b == 0)
result = Recurse(a - 1, 1);
else
result = Recurse(a - 1, Recurse(a, b - 1) );
// check memory value before deleting
for (int i = 0; i < to_alloc; i++) {
if (((char*)mem)[i] != c) {
cout <<"Memory checking error!"<< endl;
break;
}
}
ba->free(mem);
}
return result;
}
| [
"30735864+Maxrod98@users.noreply.github.com"
] | 30735864+Maxrod98@users.noreply.github.com |
dd89cc225659186b5b5c97c06d2991bfb8db7922 | 6e9b20902f4e232d12e865f192ea5128ae253ba7 | /Fluid/8.1/p | 672a052b749fc88d53adb0849983c935a13e9888 | [] | no_license | abarcaortega/FSI_3 | 1de5ed06ca7731016e5136820aecdc0a74042723 | 016638757f56e7b8b33af4a1af8e0635b88ffbbc | refs/heads/master | 2020-08-03T22:28:04.707884 | 2019-09-30T16:33:31 | 2019-09-30T16:33:31 | 211,905,379 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 24,852 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "8.1";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField nonuniform List<scalar>
2790
(
146.732
146.64
146.907
147.478
148.258
149.215
150.348
151.654
153.131
154.772
156.571
158.522
160.616
162.841
165.182
167.618
170.122
172.661
175.193
177.667
180.025
182.203
184.133
185.754
187.013
187.887
188.323
188.379
188.43
188.642
146.53
146.547
146.839
147.408
148.184
149.138
150.266
151.567
153.036
154.668
156.459
158.399
160.482
162.696
165.026
167.451
169.947
172.481
175.011
177.489
179.857
182.052
184.007
185.655
186.94
187.814
188.211
188.265
188.398
188.683
146.331
146.418
146.73
147.288
148.051
148.992
150.105
151.388
152.835
154.443
156.206
158.115
160.163
162.338
164.627
167.009
169.461
171.952
174.444
176.891
179.241
181.434
183.406
185.096
186.447
187.422
188.015
188.371
188.686
188.985
146.106
146.224
146.548
147.097
147.846
148.771
149.864
151.123
152.542
154.116
155.84
157.705
159.704
161.825
164.053
166.371
168.755
171.178
173.606
175.996
178.303
180.475
182.457
184.196
185.651
186.803
187.671
188.341
188.894
189.413
145.845
145.978
146.31
146.852
147.584
148.488
149.555
150.782
152.164
153.695
155.37
157.179
159.115
161.165
163.317
165.553
167.851
170.186
172.528
174.841
177.086
179.221
181.204
182.994
184.564
185.907
187.037
187.999
188.81
189.557
145.544
145.682
146.017
146.549
147.261
148.139
149.175
150.364
151.701
153.181
154.796
156.539
158.4
160.368
162.429
164.567
166.762
168.991
171.228
173.444
175.606
177.684
179.646
181.466
183.13
184.631
185.977
187.183
188.203
189.121
145.202
145.341
145.672
146.191
146.88
147.728
148.727
149.873
151.158
152.578
154.125
155.791
157.566
159.439
161.396
163.422
165.498
167.604
169.717
171.813
173.868
175.859
177.767
179.577
181.283
182.884
184.378
185.757
186.921
187.968
144.817
144.954
145.278
145.781
146.444
147.258
148.215
149.311
150.539
151.892
153.362
154.942
156.62
158.386
160.226
162.126
164.067
166.031
167.999
169.951
171.868
173.736
175.543
177.285
178.964
180.583
182.138
183.61
184.86
186.01
144.391
144.524
144.838
145.321
145.955
146.731
147.642
148.683
149.846
151.125
152.511
153.996
155.568
157.216
158.927
160.686
162.475
164.279
166.078
167.857
169.601
171.299
172.947
174.547
176.109
177.644
179.153
180.623
181.895
183.133
143.924
144.052
144.353
144.813
145.416
146.151
147.012
147.992
149.086
150.285
151.579
152.961
154.418
155.938
157.508
159.112
160.733
162.355
163.962
165.535
167.064
168.538
169.956
171.325
172.658
173.977
175.297
176.635
177.836
179.14
143.419
143.541
143.826
144.261
144.829
145.52
146.327
147.244
148.263
149.375
150.573
151.844
153.177
154.56
155.977
157.413
158.851
160.272
161.659
162.994
164.262
165.452
166.559
167.588
168.552
169.481
170.412
171.411
172.374
173.692
142.877
142.991
143.259
143.668
144.199
144.842
145.592
146.441
147.381
148.404
149.498
150.652
151.855
153.092
154.348
155.604
156.843
158.044
159.186
160.248
161.21
162.052
162.761
163.327
163.754
164.065
164.309
164.618
165.001
166.174
142.3
142.407
142.656
143.036
143.528
144.122
144.812
145.59
146.448
147.375
148.362
149.395
150.462
151.546
152.631
153.698
154.725
155.688
156.564
157.323
157.936
158.371
158.593
158.569
158.266
157.67
156.797
155.807
154.862
155.368
141.691
141.789
142.019
142.368
142.819
143.362
143.99
144.695
145.468
146.297
147.173
148.081
149.006
149.933
150.841
151.71
152.516
153.23
153.821
154.253
154.483
154.46
154.122
153.391
152.169
150.341
147.781
144.484
140.542
138.512
141.051
141.141
141.351
141.669
142.078
142.568
143.132
143.761
144.446
145.176
145.938
146.718
147.499
148.265
148.993
149.659
150.237
150.693
150.989
151.079
150.906
150.396
149.451
147.937
145.659
142.329
137.49
130.481
120.034
107.835
0.646607
0.626833
0.557911
0.462455
0.363526
0.273167
0.196156
0.133862
0.0859395
0.0508341
0.0272
0.0126476
0.00483482
0.00183846
0.0020236
0.00397946
0.00653988
0.00883321
0.0102866
0.0106133
0.00980126
0.00808254
0.0058619
0.00359151
0.0016507
0.000238533
-0.000623981
-0.00102271
-0.00106182
-0.000794237
0.598445
0.576102
0.511248
0.423234
0.332052
0.248288
0.176463
0.118165
0.073512
0.0419276
0.0208867
0.0081072
0.00168216
-0.000179252
0.000934258
0.00362171
0.00670518
0.00931686
0.0108997
0.0111963
0.010243
0.00833219
0.00592652
0.00352122
0.00152255
0.000112024
-0.00072026
-0.00108772
-0.00110442
-0.00058304
0.544577
0.517883
0.455599
0.374591
0.291733
0.21557
0.150134
0.0971042
0.0566801
0.0278898
0.00962188
-0.000597918
-0.00459706
-0.004269
-0.00120835
0.00313247
0.00751844
0.0110262
0.013064
0.013386
0.0121083
0.00966311
0.0067085
0.00385774
0.00161094
0.000102743
-0.00074138
-0.00108059
-0.00108287
-0.000463388
0.491851
0.460725
0.400175
0.325144
0.250017
0.181133
0.122002
0.0743051
0.0383748
0.0133833
-0.00243787
-0.0102101
-0.0118275
-0.00920126
-0.00399734
0.00217826
0.00799854
0.0124886
0.0150099
0.0153318
0.0136892
0.0106591
0.00700011
0.00360786
0.00109938
-0.000451685
-0.00123768
-0.00156506
-0.00149834
-0.000990816
0.453706
0.418424
0.359442
0.288702
0.219215
0.155508
0.100872
0.0569994
0.0243629
0.00225189
-0.0111756
-0.0174342
-0.0178431
-0.0137611
-0.00695509
0.000700315
0.0077443
0.0131232
0.0161092
0.0164436
0.0144498
0.0108351
0.00673343
0.00316449
0.000666818
-0.000704081
-0.00129096
-0.00149743
-0.00144476
-0.0011046
0.442401
0.402001
0.344124
0.274939
0.20763
0.145664
0.0924766
0.0497965
0.0182151
-0.0030958
-0.0165584
-0.0227631
-0.0223365
-0.0173239
-0.00958946
-0.00103354
0.00690162
0.0131019
0.0166156
0.0171274
0.0150614
0.0111647
0.00659644
0.00258125
-0.000170593
-0.00151814
-0.00192724
-0.00198427
-0.00193748
-0.00129439
0.468736
0.420486
0.361521
0.28958
0.219353
0.154677
0.0991391
0.0545852
0.0216647
-0.000334745
-0.0137808
-0.0218474
-0.0237805
-0.0194084
-0.0118397
-0.0032609
0.00482284
0.0112283
0.0150224
0.0158893
0.0141241
0.0104964
0.00610831
0.00217762
-0.000523934
-0.00185375
-0.00227368
-0.00245948
-0.00262728
-0.00152871
0.537112
0.480084
0.412192
0.331556
0.252767
0.181105
0.120082
0.0712428
0.0346163
0.00888245
-0.00857767
-0.0187909
-0.0218948
-0.0193382
-0.0131931
-0.00552278
0.00207697
0.00837175
0.0124129
0.0137313
0.0124191
0.0091179
0.00490248
0.00100735
-0.00166609
-0.00290393
-0.00323924
-0.00350691
-0.0037042
-0.00180338
0.648362
0.573319
0.486863
0.390279
0.297959
0.215771
0.147067
0.092714
0.0511046
0.0201889
-0.00096677
-0.0134637
-0.0186609
-0.0181204
-0.0138182
-0.00764559
-0.001084
0.00471831
0.00881145
0.0105254
0.00965524
0.00662645
0.0024958
-0.00135808
-0.00385276
-0.00475182
-0.00476793
-0.00489866
-0.00483905
-0.00208368
0.786209
0.680299
0.564681
0.44678
0.339873
0.247415
0.169923
0.108453
0.0622092
0.0288035
0.00561839
-0.00873877
-0.0156399
-0.0168076
-0.014276
-0.00981754
-0.00462618
0.000450932
0.00452762
0.00663818
0.00611461
0.00307679
-0.00135606
-0.00542989
-0.00768417
-0.0078744
-0.00708963
-0.00662084
-0.00593976
-0.0023525
0.919063
0.770181
0.627241
0.485067
0.361226
0.259661
0.178914
0.11577
0.0680004
0.0331786
0.00881762
-0.00659104
-0.0143504
-0.0164193
-0.0151848
-0.0124282
-0.00883355
-0.00459525
-0.000395188
0.00233329
0.00215342
-0.00128651
-0.00667639
-0.0115056
-0.0135696
-0.0125764
-0.0102978
-0.00862221
-0.00696999
-0.00260193
1.03023
0.826697
0.64518
0.485746
0.354453
0.2504
0.169791
0.10844
0.0630804
0.0300775
0.00649447
-0.00867614
-0.0159967
-0.0176215
-0.0168235
-0.015689
-0.0140352
-0.0107616
-0.0060608
-0.00214814
-0.00179482
-0.00613335
-0.0134804
-0.0199712
-0.022024
-0.0191743
-0.0144007
-0.0107914
-0.00789982
-0.00282585
1.05983
0.78741
0.578305
0.415539
0.293325
0.202998
0.13422
0.0819545
0.044646
0.0178875
-0.00249781
-0.0162608
-0.021657
-0.0208229
-0.0190861
-0.01957
-0.0206247
-0.0186359
-0.012729
-0.00648121
-0.00505008
-0.0109015
-0.021708
-0.0313325
-0.0337629
-0.028064
-0.0193057
-0.0129024
-0.00869156
-0.00301983
0.844017
0.494589
0.340095
0.2394
0.160118
0.109707
0.0700964
0.0351546
0.0120341
-0.00303252
-0.0179801
-0.0303474
-0.0324682
-0.0259411
-0.0208829
-0.0232445
-0.0288061
-0.0290437
-0.0208273
-0.0101478
-0.00651728
-0.0146793
-0.0312016
-0.0463008
-0.0498528
-0.0398093
-0.0247541
-0.0144886
-0.00927066
-0.00318121
0.175937
-0.243616
-0.173048
-0.0647779
-0.0568795
-0.0226029
-0.0100763
-0.0301396
-0.0386536
-0.0331939
-0.038508
-0.0510803
-0.0492919
-0.0322076
-0.0199442
-0.0254323
-0.0395501
-0.044253
-0.0318476
-0.0127928
-0.00470719
-0.0161577
-0.0416966
-0.06589
-0.0719163
-0.0552872
-0.0302202
-0.014627
-0.00946277
-0.0033087
140.372
140.453
140.641
140.926
141.291
141.726
142.224
142.775
143.371
143.997
144.642
145.29
145.924
146.523
147.066
147.525
147.868
148.06
148.054
147.793
147.207
146.198
144.634
142.32
138.959
134.054
126.687
114.946
92.8113
33.1245
139.645
139.716
139.882
140.132
140.451
140.829
141.258
141.729
142.231
142.751
143.275
143.787
144.269
144.698
145.051
145.298
145.404
145.327
145.017
144.407
143.413
141.923
139.777
136.744
132.466
126.36
117.392
103.831
84.3095
55.8431
138.876
138.937
139.08
139.293
139.565
139.884
140.242
140.63
141.037
141.448
141.849
142.224
142.552
142.81
142.973
143.008
142.878
142.538
141.932
140.989
139.618
137.698
135.065
131.488
126.641
120.071
111.184
99.3415
85.0875
68.4207
138.065
138.116
138.235
138.412
138.635
138.894
139.18
139.484
139.794
140.095
140.373
140.61
140.784
140.873
140.848
140.676
140.319
139.727
138.845
137.599
135.897
133.622
130.623
126.703
121.614
115.062
106.751
96.3447
83.7793
68.6121
137.215
137.256
137.35
137.49
137.664
137.862
138.076
138.295
138.508
138.699
138.855
138.955
138.978
138.901
138.695
138.325
137.752
136.928
135.796
134.285
132.309
129.763
126.516
122.413
117.272
110.894
103.077
93.5776
82.227
69.2311
136.328
136.359
136.428
136.53
136.654
136.792
136.933
137.068
137.184
137.268
137.302
137.269
137.146
136.91
136.53
135.974
135.203
134.17
132.82
131.089
128.898
126.159
122.764
118.595
113.52
107.406
100.129
91.5885
81.7748
71.0998
135.407
135.427
135.472
135.536
135.611
135.688
135.757
135.809
135.831
135.808
135.726
135.563
135.301
134.913
134.372
133.646
132.696
131.48
129.947
128.04
125.691
122.828
119.368
115.223
110.306
104.538
97.8644
90.2731
81.8074
72.8029
134.455
134.465
134.485
134.512
134.538
134.555
134.554
134.524
134.454
134.329
134.134
133.849
133.455
132.926
132.238
131.358
130.252
128.88
127.199
125.159
122.704
119.777
116.317
112.265
107.566
102.181
96.0952
89.3293
81.9325
74.1775
133.476
133.475
133.471
133.462
133.44
133.398
133.328
133.22
133.061
132.839
132.536
132.137
131.62
130.963
130.141
129.127
127.887
126.388
124.592
122.458
119.942
117.001
113.592
109.677
105.226
100.225
94.6799
88.6247
82.1129
75.3724
132.473
132.462
132.435
132.389
132.321
132.223
132.087
131.904
131.661
131.346
130.943
130.437
129.808
129.036
128.097
126.966
125.616
124.017
122.137
119.944
117.404
114.487
111.164
107.413
103.221
98.5899
93.5365
88.1003
82.3345
76.4241
131.451
131.43
131.381
131.301
131.188
131.036
130.837
130.582
130.26
129.859
129.364
128.76
128.031
127.156
126.116
124.888
123.449
121.774
119.838
117.615
115.082
112.217
109.004
105.432
101.499
97.2148
92.6036
87.7044
82.5653
77.3347
130.415
130.385
130.314
130.201
130.046
129.843
129.585
129.263
128.867
128.386
127.807
127.116
126.297
125.334
124.208
122.902
121.394
119.665
117.697
115.469
112.965
110.173
107.084
103.695
100.012
96.0489
91.8317
87.3963
82.7849
78.1166
129.37
129.332
129.24
129.096
128.901
128.65
128.337
127.953
127.489
126.936
126.281
125.512
124.616
123.578
122.382
121.013
119.455
117.692
115.711
113.497
111.041
108.335
105.377
102.169
98.7221
95.0519
91.1831
87.1484
82.9837
78.785
128.323
128.276
128.165
127.993
127.76
127.464
127.1
126.659
126.134
125.516
124.794
123.958
122.996
121.895
120.642
119.226
117.634
115.854
113.876
111.691
109.294
106.683
103.857
100.825
97.5975
94.1917
90.6304
86.9421
83.1571
79.3534
127.279
127.225
127.096
126.896
126.629
126.293
125.882
125.39
124.81
124.134
123.354
122.46
121.442
120.29
118.995
117.545
115.933
114.149
112.187
110.042
107.712
105.198
102.504
99.6374
96.6118
93.4432
90.1526
86.7641
83.3035
79.834
126.245
126.183
126.038
125.814
125.515
125.142
124.689
124.151
123.523
122.797
121.966
121.024
119.961
118.769
117.442
115.97
114.349
112.572
110.636
108.539
106.28
103.864
101.296
98.5848
95.7434
92.787
89.7341
86.6056
83.4228
80.2377
125.227
125.159
124.999
124.752
124.426
124.019
123.529
122.951
122.28
121.511
120.638
119.655
118.556
117.335
115.985
114.502
112.882
111.12
109.217
107.172
104.987
102.666
100.217
97.6497
94.975
92.2075
89.3633
86.4603
83.5165
80.5744
124.232
124.158
123.985
123.719
123.367
122.931
122.408
121.795
121.087
120.282
119.374
118.359
117.233
115.99
114.626
113.14
111.528
109.788
107.922
105.932
103.819
101.591
99.2538
96.8174
94.2929
91.6929
89.0317
86.3246
83.5866
80.8529
123.268
123.189
123.004
122.72
122.346
121.884
121.333
120.689
119.951
119.116
118.18
117.14
115.993
114.736
113.366
111.883
110.284
108.571
106.746
104.81
102.768
100.627
98.3929
96.0759
93.6858
91.2341
88.7332
86.1961
83.6357
81.0811
122.341
122.258
122.062
121.763
121.37
120.886
120.31
119.641
118.878
118.018
117.06
116.001
114.84
113.575
112.204
110.729
109.149
107.465
105.68
103.798
101.824
99.7639
97.6248
95.4154
93.1451
90.8241
88.4632
86.0738
83.6667
81.2661
121.46
121.373
121.169
120.856
120.446
119.943
119.347
118.657
117.873
116.994
116.019
114.946
113.776
112.508
111.141
109.677
108.118
106.464
104.721
102.891
100.98
98.9945
96.9413
94.8283
92.6641
90.4578
88.219
85.9574
83.6825
81.4143
120.633
120.542
120.33
120.005
119.581
119.062
118.449
117.742
116.942
116.048
115.06
113.978
112.804
111.536
110.176
108.727
107.189
105.566
103.863
102.082
100.23
98.3121
96.336
94.3086
92.2377
90.1317
87.9988
85.8476
83.6864
81.5317
119.866
119.772
119.553
119.219
118.783
118.251
117.624
116.903
116.09
115.184
114.188
113.101
111.925
110.661
109.31
107.876
106.361
104.768
103.102
101.367
99.5677
97.7113
95.8036
93.8515
91.8622
89.843
87.8015
85.7451
83.681
81.6234
119.169
119.073
118.847
118.504
118.058
117.515
116.877
116.146
115.323
114.409
113.407
112.317
111.142
109.884
108.544
107.126
105.633
104.068
102.436
100.742
98.9912
97.1888
95.3411
93.4545
91.5356
89.5911
87.6277
85.652
83.6706
81.6951
118.55
118.451
118.22
117.87
117.415
116.863
116.216
115.476
114.646
113.727
112.721
111.631
110.458
109.206
107.877
106.475
105.002
103.463
101.863
100.205
98.4963
96.7408
94.9448
93.1143
91.2553
89.3739
87.4763
85.5685
83.6561
81.7492
118.018
117.917
117.68
117.322
116.86
116.301
115.648
114.902
114.066
113.143
112.136
111.046
109.878
108.633
107.315
105.926
104.473
102.957
101.383
99.7576
98.0842
96.3686
94.6162
92.8327
91.0236
89.1948
87.3517
85.5
83.6448
81.7947
117.584
117.478
117.235
116.869
116.4
115.835
115.176
114.425
113.585
112.66
111.653
110.565
109.4
108.162
106.854
105.478
104.041
102.544
100.994
99.3942
97.7503
96.0672
94.3501
92.6044
90.8355
89.0485
87.2489
85.4415
83.6313
81.8252
117.258
117.147
116.894
116.522
116.048
115.478
114.815
114.061
113.219
112.292
111.285
110.199
109.038
107.806
106.505
105.141
103.716
102.235
100.703
99.1244
97.5037
95.8462
94.1567
92.4406
90.7027
88.9484
87.1823
85.4095
83.6346
81.8636
117.056
116.921
116.651
116.273
115.797
115.225
114.559
113.803
112.96
112.033
111.027
109.943
108.786
107.558
106.264
104.907
103.492
102.022
100.502
98.9379
97.333
95.6926
94.0216
92.325
90.6078
88.8748
87.1306
85.38
83.6273
81.8775
117.037
116.839
116.541
116.156
115.677
115.102
114.433
113.675
112.831
111.905
110.899
109.817
108.662
107.438
106.149
104.797
103.389
101.927
100.416
98.8608
97.2662
95.6369
93.9777
92.2936
90.5892
88.8694
87.1387
85.4017
83.6626
81.9258
-50.5057
-30.2436
-11.1478
35.4578
27.9767
15.8674
50.8858
38.7744
27.5313
52.3199
41.885
33.8266
56.6633
48.3649
41.5965
61.0534
54.1363
48.2371
64.3317
58.4442
53.3897
66.9334
61.9039
57.5908
69.1272
64.7914
61.0796
70.9795
67.1981
63.9689
72.5374
69.2052
66.3667
73.8504
70.8866
68.367
74.959
72.3003
70.0434
75.8955
73.4918
71.4535
76.6864
74.4977
72.643
77.3536
75.3476
73.6482
77.9154
76.0656
74.4984
78.3871
76.6713
75.2171
78.7815
77.1813
75.824
79.1098
77.6092
76.3352
79.3814
77.9669
76.7644
79.6052
78.2647
77.1234
79.7876
78.5106
77.4217
79.9369
78.7138
77.6691
80.0555
78.8777
77.8702
80.1552
79.0148
78.0373
80.2273
79.1168
78.1641
80.3004
79.2126
78.2772
80.3346
79.2632
78.3417
80.4038
79.3465
78.4315
-2.98505
-2.89889
-1.44331
-0.303693
-0.26636
-0.166872
-0.107094
-0.136243
-0.119412
-0.0571844
-0.0449595
-0.0726029
-0.0763632
-0.0433571
-0.0143379
-0.0240199
-0.0534789
-0.0665808
-0.0466179
-0.0120548
0.0043953
-0.0123322
-0.0524495
-0.091789
-0.102949
-0.07635
-0.0348749
-0.0115092
-0.00878112
-0.00340547
2.08771
-0.795677
0.79807
0.274712
-1.08776
-0.835063
-0.179925
-0.153837
-0.132674
-0.0310296
-0.0521028
-0.14118
-0.156505
-0.0668308
0.0175795
-0.00194676
-0.0658247
-0.101027
-0.0724307
-0.0099795
0.0224691
-0.00261603
-0.0653834
-0.128516
-0.14873
-0.106492
-0.0370231
-0.00129223
-0.00574805
-0.0034897
13.2532
4.89255
2.07295
-0.381616
-0.686663
0.844953
1.00381
-0.386014
-0.744096
-0.373022
-0.0310003
-0.130229
-0.160402
0.00573193
0.101905
0.022727
-0.112213
-0.186315
-0.13151
-0.00055566
0.0696733
0.0285937
-0.0698915
-0.170738
-0.209348
-0.147722
-0.0334027
0.0230594
0.00316178
-0.00364309
23.0507
13.1564
7.26601
3.4965
1.78867
1.27631
0.0312235
-0.644873
-0.224923
0.946127
0.801725
-0.289539
-0.663108
-0.427944
0.0887298
0.12538
-0.109901
-0.244006
-0.149189
0.0712698
0.153647
0.0663631
-0.0900573
-0.24968
-0.321334
-0.232767
-0.0233355
0.0719088
0.0242234
-0.00413503
32.235
22.4544
15.1267
9.83831
6.21235
3.74634
1.8726
0.885369
0.637676
0.609998
0.0872475
-0.511262
-0.554389
0.466531
0.98239
0.325399
-0.261955
-0.579709
-0.510574
-0.0449636
0.245328
0.144093
-0.0832782
-0.310443
-0.415624
-0.254072
0.0173974
0.160548
0.0649786
-0.00571511
40.2251
31.2867
23.3915
16.9574
12.034
8.3957
5.72981
3.85373
2.58532
1.66962
0.900287
0.312274
0.119647
0.437798
0.437997
0.162627
-0.303604
-0.589245
-0.29515
0.505126
0.671393
0.211531
-0.132106
-0.451808
-0.676357
-0.59613
-0.0139298
0.288524
0.129218
-0.0107998
46.7469
38.9311
31.1463
24.2509
18.6262
14.172
10.654
7.90279
5.80959
4.23709
3.019
2.06877
1.44933
1.15079
0.88952
0.540899
0.0680992
-0.22339
-0.0909872
0.269063
0.403325
0.220284
-0.104986
-0.479433
-0.725243
-0.42349
0.363768
0.553371
0.206713
-0.0237937
52.0586
45.3191
38.0534
31.2185
25.3346
20.3914
16.2538
12.8342
10.068
7.85678
6.07285
4.63752
3.55063
2.78129
2.17549
1.57877
0.991763
0.590715
0.490034
0.574464
0.590285
0.381021
0.0170716
-0.349896
-0.537132
-0.312562
0.160172
0.396545
0.304267
-0.0641654
56.3916
50.5687
43.978
37.4999
31.6802
26.5692
22.1018
18.2432
14.964
12.2082
9.90082
7.98502
6.43226
5.19851
4.18103
3.28036
2.49157
1.89178
1.53123
1.33964
1.1432
0.817728
0.407954
0.0401232
-0.148516
-0.0480869
0.23506
0.391567
0.260929
-0.303075
59.9279
54.8557
48.9482
42.9596
37.4041
32.3595
27.7968
23.7117
20.1058
16.9606
14.2397
11.9052
9.9249
8.25827
6.84136
5.61388
4.5578
3.69603
3.0426
2.5474
2.10121
1.62336
1.13113
0.704342
0.433191
0.371949
0.44417
0.432287
0.172416
-0.517995
62.8324
58.3697
53.0861
47.615
42.4175
37.577
33.0806
28.94
25.1762
21.795
18.7846
16.125
13.7934
11.7614
9.99014
8.44064
7.0913
5.94072
4.98457
4.18646
3.47984
2.81125
2.17987
1.62929
1.21297
0.953762
0.790807
0.57508
0.170821
-0.593028
65.2384
61.2725
56.532
51.5512
46.7358
42.1648
37.8311
33.7521
29.9576
26.4663
23.282
20.3991
17.8066
15.4883
13.4214
11.5809
9.94854
8.51434
7.26701
6.1798
5.21065
4.32287
3.50784
2.78524
2.18176
1.70167
1.2969
0.865866
0.306736
-0.522347
67.2455
63.6887
59.412
54.8719
50.4255
46.1433
42.0193
38.0708
34.3297
30.8205
27.5559
24.5401
21.7716
19.2436
16.9447
14.8604
12.9775
11.2853
9.77163
8.41673
7.19297
6.07483
5.05121
4.12718
3.3118
2.5994
1.95253
1.30179
0.576046
-0.331554
68.9292
65.7127
61.8303
57.6772
53.5697
49.5699
45.6705
41.8864
38.2479
34.7814
31.504
28.4254
25.5505
22.8797
20.4092
18.1321
16.0404
14.1256
12.3778
10.7827
9.32155
7.97647
6.73621
5.59784
4.56033
3.61344
2.72819
1.85725
0.953522
-0.0565639
70.3474
67.4165
63.8696
60.0532
56.2494
52.5131
48.8351
45.2269
41.716
38.3283
35.0822
31.9905
29.0619
26.3013
23.7103
21.2873
19.0286
16.9291
14.9817
13.1765
11.5009
9.94196
8.48948
7.13696
5.87834
4.70196
3.58535
2.4961
1.40373
0.262707
71.5454
68.8557
65.5953
62.0707
58.5359
55.0395
51.5705
48.1369
44.7631
41.4729
38.2849
35.213
32.2678
29.4572
26.7861
24.2565
21.8682
19.6191
17.505
15.5195
13.6542
11.8998
10.2476
8.68987
7.21876
5.82269
4.48402
3.17995
1.89019
0.590787
72.5588
70.0739
67.0588
63.7871
60.4891
57.208
53.9315
50.6645
47.4278
44.2433
41.1282
38.0967
35.1602
32.328
29.6072
27.0022
24.5154
22.147
19.8954
17.757
15.7264
13.797
11.9614
10.2124
8.54174
6.93859
5.38864
3.87488
2.38236
0.902116
73.4165
71.1058
68.3014
65.2489
62.1585
59.0692
55.9674
52.8555
49.7509
46.673
43.6379
40.6588
37.7474
34.9137
32.1656
29.5094
26.9489
24.4865
22.1225
19.8553
17.6819
15.5976
13.5966
11.6724
9.81706
8.02078
6.27136
4.55489
2.85846
1.18229
74.1417
71.9798
69.3564
66.4939
63.5852
60.6655
57.7207
54.7507
51.7702
48.796
45.8426
42.9224
40.0464
37.2247
34.4657
31.7765
29.1623
26.6265
24.171
21.796
19.4999
17.2798
15.1311
13.0482
11.0238
9.04893
7.11262
5.20234
3.3053
1.4263
74.754
72.719
70.2514
67.5533
64.803
62.0327
59.2278
56.3862
53.5201
50.6441
47.7709
44.9118
42.0771
39.2763
36.5182
33.8099
31.1573
28.565
26.0357
23.5708
21.17
18.8315
16.552
14.3266
12.1487
10.0099
7.89993
5.80664
3.71638
1.63547
75.2695
73.3427
71.0088
68.4529
65.8403
63.2008
60.5195
57.793
55.0308
52.2458
49.4492
46.6507
43.8598
41.0856
38.3362
35.6191
32.9404
30.305
27.7166
25.1772
22.6876
20.2468
17.8523
15.4999
13.1837
10.8957
8.62585
6.36201
4.08938
1.81395
75.7019
73.8672
71.6479
69.2144
66.7209
64.1952
61.6225
58.9978
56.329
53.627
50.9014
48.1611
45.4143
42.6694
39.9342
37.2157
34.5201
31.8527
29.2173
26.6167
24.0521
21.5234
19.0286
16.5641
14.1244
11.7019
9.28662
6.86607
4.42454
1.96669
76.0625
74.3057
72.1842
69.8554
67.4643
65.037
62.5585
60.0231
57.4369
54.8093
52.1486
49.4625
46.7583
44.0435
41.3253
38.6105
35.9051
33.2142
30.5419
27.8914
25.2642
22.6606
20.0791
17.5167
14.9679
12.4255
9.87956
7.3172
4.72208
2.09707
76.3622
74.6708
72.632
70.3923
68.0883
65.745
63.3476
60.8893
58.3751
55.8131
53.2103
50.5735
47.9089
45.2235
42.5237
39.8157
37.1054
34.3978
31.697
29.0061
26.3271
23.6605
21.0051
18.358
15.7142
13.0665
10.4049
7.71643
4.98419
2.20884
76.6071
74.9702
73.0004
70.8352
68.6044
66.3318
64.0029
61.6103
59.1578
56.6523
54.1
51.5067
48.8779
46.2197
43.538
40.8386
38.1268
35.4076
32.6849
29.9618
27.2405
24.5215
21.8039
19.0849
16.3598
13.6212
10.8593
8.06082
5.2088
2.30158
76.8092
75.2164
73.3033
71.1995
69.0288
66.8146
64.5424
62.2043
59.8033
57.3454
54.8359
52.2799
49.6822
47.0482
44.3833
41.6928
38.9818
36.2547
33.5155
30.7673
28.012
25.2504
22.4815
19.7029
16.9096
14.0946
11.2477
8.35573
5.40152
2.3804
76.9651
75.4072
73.539
71.4837
69.3609
67.1931
64.9661
62.6717
60.3121
57.8926
55.4179
52.8924
50.3204
47.7067
45.0563
42.3741
39.6647
36.9325
34.1811
31.4136
28.6318
25.8366
23.027
20.2004
17.3521
14.4749
11.5588
8.59031
5.55245
2.4383
77.0972
75.565
73.7308
71.7125
69.6258
67.4931
65.3003
63.0392
60.7111
58.3209
55.8729
53.3709
50.8188
48.2211
45.5822
42.9068
40.1993
37.4636
34.7035
31.9217
29.1201
26.2994
23.4587
20.5955
17.705
14.7798
11.8099
8.78165
5.67784
2.4878
77.1784
75.6624
73.8506
71.8573
69.795
67.6858
65.5159
63.277
60.9701
58.5996
56.1695
53.6834
51.1449
48.558
45.9271
43.2565
40.5504
37.8127
35.0469
32.2557
29.4409
26.6032
23.7418
20.8538
17.9346
14.9767
11.9698
8.90005
5.75011
2.50772
77.2675
75.7526
73.953
71.9746
69.9261
67.8294
65.6717
63.4445
61.1486
58.7882
56.3671
53.8888
51.3567
48.7747
46.1471
43.478
40.7716
38.0317
35.2618
32.4645
29.6416
26.7938
23.9201
21.0181
18.0826
15.1064
12.0785
8.98448
5.80429
2.51412
)
;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
flap
{
type zeroGradient;
}
upperWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
| [
"aldo.abarca.ortega@gmail.com"
] | aldo.abarca.ortega@gmail.com | |
dce45f13ecd73d1365fa0d9ef508ba83ca00e697 | 53928f17c758a813bc69e05bc9a8bbef4d2804b8 | /VulkanTest/ShadowGenerator.cpp | 5c73427fa393b98b99c6ca4e1bf3201135896979 | [] | no_license | thagberg/another-vulkan | 4029318f533528a4f4db554f99f85394a21d12f1 | 0a2314e8f7f7dc2427f1fcc82c76f939961556fe | refs/heads/master | 2022-04-09T22:17:31.041995 | 2020-03-01T23:38:11 | 2020-03-01T23:38:11 | 190,081,958 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,799 | cpp | #include "ShadowGenerator.h"
#include "descriptor-util.h"
#include "pipeline-util.h"
namespace hvk
{
ShadowGenerator::ShadowGenerator(VkRenderPass renderPass, VkCommandPool commandPool) :
DrawlistGenerator(renderPass, commandPool),
mDescriptorSetLayout(VK_NULL_HANDLE),
mDescriptorPool(VK_NULL_HANDLE),
mPipeline(VK_NULL_HANDLE),
mPipelineInfo()
{
const VkDevice& device = GpuManager::getDevice();
const VmaAllocator& allocator = GpuManager::getAllocator();
// create descriptor set layout and descriptor pool
auto poolSizes = util::descriptor::createPoolSizes<VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER>(MAX_UBOS);
util::descriptor::createDescriptorPool(device, poolSizes, MAX_DESCRIPTORS, mDescriptorPool);
std::vector<VkDescriptorSetLayoutBinding> bindings = {
util::descriptor::generateUboLayoutBinding(0, 1)
};
util::descriptor::createDescriptorSetLayout(device, bindings, mDescriptorSetLayout);
// prepare pipeline
preparePipelineInfo();
// initialized
setInitialized(true);
}
ShadowGenerator::~ShadowGenerator()
{
const VkDevice& device = GpuManager::getDevice();
const VmaAllocator& allocator = GpuManager::getAllocator();
vkDestroyDescriptorSetLayout(device, mDescriptorSetLayout, nullptr);
vkDestroyDescriptorPool(device, mDescriptorPool, nullptr);
vkDestroyPipeline(device, mPipeline, nullptr);
vkDestroyPipelineLayout(device, mPipelineInfo.pipelineLayout, nullptr);
}
void ShadowGenerator::preparePipelineInfo()
{
const auto& device = GpuManager::getDevice();
VkPipelineLayoutCreateInfo layoutCreate = {
VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, // sType
nullptr, // pNext
0, // flags
1, // setLayoutCount
&mDescriptorSetLayout, // pSetLayouts
0, // pushConstantRangeCount
nullptr // pPushConstantRanges
};
assert(vkCreatePipelineLayout(device, &layoutCreate, nullptr, &mPipelineInfo.pipelineLayout) == VK_SUCCESS);
// TODO: only need vertex position attribute; should we define a new vertex type for shadows?
util::pipeline::fillVertexInfo<Vertex>(mPipelineInfo.vertexInfo);
VkPipelineColorBlendAttachmentState blendAttachment = {};
blendAttachment.blendEnable = VK_FALSE;
blendAttachment.colorWriteMask = 0;
mPipelineInfo.blendAttachments = { blendAttachment };
mPipelineInfo.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
mPipelineInfo.vertShaderFile = "shaders/compiled/shadow_vert.spv";
mPipelineInfo.fragShaderFile = "shaders/compiled/shadow_frag.spv";
mPipelineInfo.depthStencilState = util::pipeline::createDepthStencilState();
mPipelineInfo.rasterizationState = util::pipeline::createRasterizationState();
mPipeline = generatePipeline(mColorRenderPass, mPipelineInfo);
}
void ShadowGenerator::invalidate()
{
setInitialized(false);
vkDestroyPipeline(GpuManager::getDevice(), mPipeline, nullptr);
}
void ShadowGenerator::updateRenderPass(VkRenderPass renderPass)
{
mColorRenderPass = renderPass;
mPipeline = generatePipeline(mColorRenderPass, mPipelineInfo);
setInitialized(true);
}
ShadowBinding ShadowGenerator::createBinding()
{
ShadowBinding newBinding;
const auto& device = GpuManager::getDevice();
const auto& allocator = GpuManager::getAllocator();
// create UBO
uint32_t uboMemorySize = sizeof(hvk::UniformBufferObject);
VkBufferCreateInfo uboInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
uboInfo.size = uboMemorySize;
uboInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
VmaAllocationCreateInfo uniformAllocCreateInfo = {};
uniformAllocCreateInfo.usage = VMA_MEMORY_USAGE_CPU_TO_GPU;
uniformAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT;
vmaCreateBuffer(
allocator,
&uboInfo,
&uniformAllocCreateInfo,
&newBinding.ubo.memoryResource,
&newBinding.ubo.allocation,
nullptr);
// create descriptor set
VkDescriptorSetAllocateInfo dsAlloc = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO };
dsAlloc.descriptorPool = mDescriptorPool;
dsAlloc.descriptorSetCount = 1;
dsAlloc.pSetLayouts = &mDescriptorSetLayout;
assert(vkAllocateDescriptorSets(device, &dsAlloc, &newBinding.descriptorSet) == VK_SUCCESS);
// update descriptor set
std::vector<VkWriteDescriptorSet> descriptorWrites;
std::vector<VkDescriptorBufferInfo> bufferInfos = {
VkDescriptorBufferInfo {
newBinding.ubo.memoryResource,
0,
sizeof(hvk::UniformBufferObject) } };
auto bufferDescriptorWrite = util::descriptor::createDescriptorBufferWrite(bufferInfos, newBinding.descriptorSet, 0);
descriptorWrites.push_back(bufferDescriptorWrite);
vkUpdateDescriptorSets(device, static_cast<uint32_t>(descriptorWrites.size()), descriptorWrites.data(), 0, nullptr);
return newBinding;
}
} | [
"timothy.m.hagberg@gmail.com"
] | timothy.m.hagberg@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.