hexsha stringlengths 40 40 | size int64 7 1.05M | ext stringclasses 13
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 269 | max_stars_repo_name stringlengths 5 108 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 9 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 269 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 9 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 269 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 9 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 7 1.05M | avg_line_length float64 1.21 330k | max_line_length int64 6 990k | alphanum_fraction float64 0.01 0.99 | author_id stringlengths 2 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c2a4e7d339d3f1157e8c5a5277f756f65ad7fec2 | 1,817 | cpp | C++ | Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationItem.cpp | zhaomengxiao/MITK | a09fd849a4328276806008bfa92487f83a9e2437 | [
"BSD-3-Clause"
] | 1 | 2022-03-03T12:03:32.000Z | 2022-03-03T12:03:32.000Z | Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationItem.cpp | zhaomengxiao/MITK | a09fd849a4328276806008bfa92487f83a9e2437 | [
"BSD-3-Clause"
] | 1 | 2021-12-22T10:19:02.000Z | 2021-12-22T10:19:02.000Z | Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationItem.cpp | zhaomengxiao/MITK_lancet | a09fd849a4328276806008bfa92487f83a9e2437 | [
"BSD-3-Clause"
] | 1 | 2020-11-27T09:41:18.000Z | 2020-11-27T09:41:18.000Z | /*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkTimeSliceAnimationItem.h"
#include <mitkBaseRenderer.h>
QmitkTimeSliceAnimationItem::QmitkTimeSliceAnimationItem(int from, int to, bool reverse, double duration, double delay, bool startWithPrevious)
: QmitkAnimationItem("Time", duration, delay, startWithPrevious)
{
this->SetFrom(from);
this->SetTo(to);
this->SetReverse(reverse);
}
QmitkTimeSliceAnimationItem::~QmitkTimeSliceAnimationItem()
{
}
int QmitkTimeSliceAnimationItem::GetFrom() const
{
return this->data(FromRole).toInt();
}
void QmitkTimeSliceAnimationItem::SetFrom(int from)
{
this->setData(from, FromRole);
}
int QmitkTimeSliceAnimationItem::GetTo() const
{
return this->data(ToRole).toInt();
}
void QmitkTimeSliceAnimationItem::SetTo(int to)
{
this->setData(to, ToRole);
}
bool QmitkTimeSliceAnimationItem::GetReverse() const
{
return this->data(ReverseRole).toBool();
}
void QmitkTimeSliceAnimationItem::SetReverse(bool reverse)
{
this->setData(reverse, ReverseRole);
}
void QmitkTimeSliceAnimationItem::Animate(double s)
{
mitk::Stepper* stepper = mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetTime();
if (stepper == nullptr)
return;
int newPos = this->GetReverse()
? this->GetTo() - static_cast<int>((this->GetTo() - this->GetFrom()) * s)
: this->GetFrom() + static_cast<int>((this->GetTo() - this->GetFrom()) * s);
stepper->SetPos(static_cast<unsigned int>(newPos));
}
| 25.591549 | 143 | 0.679141 | zhaomengxiao |
c2a562300dc1fd0978b99a6569abd7cd6b8afb49 | 3,464 | hpp | C++ | src/thread/invoke.hpp | minijackson/IGI-3004 | 8354f40e296cce8735b188dd3ff7406e96d5878e | [
"MIT"
] | 1 | 2017-10-01T02:29:06.000Z | 2017-10-01T02:29:06.000Z | src/thread/invoke.hpp | minijackson/IGI-3004 | 8354f40e296cce8735b188dd3ff7406e96d5878e | [
"MIT"
] | null | null | null | src/thread/invoke.hpp | minijackson/IGI-3004 | 8354f40e296cce8735b188dd3ff7406e96d5878e | [
"MIT"
] | null | null | null | #pragma once
#include <utility>
#include <functional>
#include <type_traits>
// C++17 invoke utility
// http://en.cppreference.com/w/cpp/utility/functional/invoke
namespace detail {
template <class T>
struct is_reference_wrapper : std::false_type {};
template <class U>
struct is_reference_wrapper<std::reference_wrapper<U>> : std::true_type {};
template <class T>
constexpr bool is_reference_wrapper_v = is_reference_wrapper<T>::value;
template <class T>
constexpr bool is_function_v = std::is_function<T>::value;
template <class Base, class Derived>
constexpr bool is_base_of_v = std::is_base_of<Base, Derived>::value;
template <class T>
constexpr bool is_member_pointer_v = std::is_member_pointer<T>::value;
template <class Base, class T, class Derived, class... Args>
inline auto INVOKE(T Base::*pmf, Derived&& ref, Args&&... args)
-> std::enable_if_t<is_function_v<T> && is_base_of_v<Base, std::decay_t<Derived>>,
decltype((std::forward<Derived>(ref).*
pmf)(std::forward<Args>(args)...))> {
return (std::forward<Derived>(ref).*pmf)(std::forward<Args>(args)...);
}
template <class Base, class T, class RefWrap, class... Args>
inline auto INVOKE(T Base::*pmf, RefWrap&& ref, Args&&... args)
-> std::enable_if_t<is_function_v<T> && is_reference_wrapper_v<std::decay_t<RefWrap>>,
decltype((ref.get().*pmf)(std::forward<Args>(args)...))> {
return (ref.get().*pmf)(std::forward<Args>(args)...);
}
template <class Base, class T, class Pointer, class... Args>
inline auto INVOKE(T Base::*pmf, Pointer&& ptr, Args&&... args)
-> std::enable_if_t<is_function_v<T> && !is_reference_wrapper_v<std::decay_t<Pointer>> &&
!is_base_of_v<Base, std::decay_t<Pointer>>,
decltype(((*std::forward<Pointer>(ptr)).*
pmf)(std::forward<Args>(args)...))> {
return ((*std::forward<Pointer>(ptr)).*pmf)(std::forward<Args>(args)...);
}
template <class Base, class T, class Derived>
inline auto INVOKE(T Base::*pmd, Derived&& ref)
-> std::enable_if_t<!is_function_v<T> && is_base_of_v<Base, std::decay_t<Derived>>,
decltype(std::forward<Derived>(ref).*pmd)> {
return std::forward<Derived>(ref).*pmd;
}
template <class Base, class T, class RefWrap>
inline auto INVOKE(T Base::*pmd, RefWrap&& ref)
-> std::enable_if_t<!is_function_v<T> && is_reference_wrapper_v<std::decay_t<RefWrap>>,
decltype(ref.get().*pmd)> {
return ref.get().*pmd;
}
template <class Base, class T, class Pointer>
inline auto INVOKE(T Base::*pmd, Pointer&& ptr)
-> std::enable_if_t<!is_function_v<T> && !is_reference_wrapper_v<std::decay_t<Pointer>> &&
!is_base_of_v<Base, std::decay_t<Pointer>>,
decltype((*std::forward<Pointer>(ptr)).*pmd)> {
return (*std::forward<Pointer>(ptr)).*pmd;
}
template <class F, class... Args>
inline auto INVOKE(F&& f, Args&&... args)
-> std::enable_if_t<!is_member_pointer_v<std::decay_t<F>>,
decltype(std::forward<F>(f)(std::forward<Args>(args)...))> {
return std::forward<F>(f)(std::forward<Args>(args)...);
}
} // namespace detail
template <class F, class... ArgTypes>
std::result_of_t<F && (ArgTypes && ...)> invoke(F&& f, ArgTypes&&... args) {
return detail::INVOKE(std::forward<F>(f), std::forward<ArgTypes>(args)...);
}
| 39.816092 | 93 | 0.632506 | minijackson |
c2a66097fec4e896699d314e087ed3a039817cff | 4,954 | cpp | C++ | modbus/MRegExp.cpp | mirkowi/TERANiS-PLC | 2b22f1ebcaa771feb9bcab31b13ee4f6debf3e03 | [
"Apache-2.0"
] | 1 | 2020-04-14T09:59:32.000Z | 2020-04-14T09:59:32.000Z | modbus/MRegExp.cpp | mirkowi/TERANiS-PLC | 2b22f1ebcaa771feb9bcab31b13ee4f6debf3e03 | [
"Apache-2.0"
] | 2 | 2020-04-16T11:49:21.000Z | 2020-06-05T06:36:50.000Z | modbus/MRegExp.cpp | mirkowi/TERANiS-PLC | 2b22f1ebcaa771feb9bcab31b13ee4f6debf3e03 | [
"Apache-2.0"
] | null | null | null | //---------------------------------------------------------------------------
#include "MRegExp.h"
#include "platform.h"
// TException wahlweise ausblenden
#define _NO_EXEPTOBJ
#ifdef _NO_EXEPTOBJ
#define MEXCEPTION ;
#else
#include "exeptobj.h"
#endif
//---------------------------------------------------------------------------
bool TMRegExp::SetExpression(string value, int maxmatch) {
if (FExpression != value) {
FExpression = value;
#ifdef PERLREGEX
if (maxmatch==0)
{
// Das ist eine ganz einfache Methode um die Komplexitaet
// des regulaeren Ausdrucks abzuschaetzen
// Es werden auf jeden Fall mehr matches gebraucht als
// Zeichenketten am Ende zurueckgeliefert werden
// Deshalb wird einfach die doppelte Menge angenommen...
for (unsigned i=0; i<FExpression.length(); i++)
{
if (FExpression[i]=='(' || FExpression[i]==')') maxmatch++;
}
if (maxmatch<10) maxmatch=10;
}
this->maxmatch=maxmatch;
delete[] aRegMatch;
aRegMatch = new regmatch_t[maxmatch];
if (compiled) regfree(&aRegExp);
int err = regcomp(&aRegExp, FExpression.c_str(), 0);
if (!err) compiled = true;
matched=false;
// TODO: regerror
#ifndef _NO_EXEPTOBJ
if (err) MEXCEPTION(0,"Fehler beim Erzeugen des regulaeren Ausdrucks: '"+FExpression+"'","");
#endif
#endif
#ifdef STDREGEX
try {
aRegExp = std::regex(FExpression);
compiled = true;
}
catch (const std::regex_error &e) {
#ifndef _NO_EXEPTOBJ
MEXCEPTION(0,"Fehler beim Erzeugen des regulaeren Ausdrucks: '"+FExpression+"'",e.what());
#endif
compiled = false;
}
#endif
matched = false;
}
return compiled;
}
string TMRegExp::GetExpression() {
return FExpression;
}
TMRegExp::TMRegExp(int maxmatch) {
#ifdef PERLREGEX
this->maxmatch=maxmatch;
if (maxmatch>0) aRegMatch = new regmatch_t[maxmatch];
else aRegMatch = NULL;
#endif
matched = false;
compiled = false;
}
TMRegExp::TMRegExp(string Expression, int maxmatch) {
#ifdef PERLREGEX
this->maxmatch=0;
aRegMatch = NULL;
#endif
matched = false;
compiled = false;
SetExpression(Expression, maxmatch);
}
TMRegExp::~TMRegExp() {
#ifdef PERLREGEX
if (compiled) regfree(&aRegExp);
delete[] aRegMatch;
#endif
}
bool TMRegExp::Exec(string text) {
if (!compiled) return false;
matched = false;
#ifdef PERLREGEX
matched = regexec(&aRegExp, text.c_str(), maxmatch, aRegMatch, 0)==0;
#endif
#ifdef STDREGEX
matched = std::regex_search(text, aRegMatch, aRegExp);
#endif
if (matched) {
FText = text;
}
return matched;
}
bool TMRegExp::Exec(string text, vector<string> &list) {
if (!compiled) return false;
matched = Exec(text);
if (matched) GetMatches(list);
return matched;
}
bool TMRegExp::ExecExpression(string expression, string text) {
SetExpression(expression);
if (!compiled) return false;
return Exec(text);
}
void TMRegExp::GetMatches(vector<string> &list) {
if (!matched) return;
list.clear();
#ifdef PERLREGEX
for (int i = 1; i < maxmatch; i++)
{
if (aRegMatch[i].rm_so >= 0)
{
list.push_back(FText.substr(aRegMatch[i].rm_so, aRegMatch[i].rm_eo - aRegMatch[i].rm_so));
}
}
#endif
#ifdef STDREGEX
for (auto i = aRegMatch.begin() + 1; i != aRegMatch.end(); i++) {
list.push_back(*i);
}
#endif
}
string TMRegExp::GetMatch(unsigned num, unsigned &pos, unsigned &len) {
pos = 0;
if (!matched) return "";
#ifdef PERLREGEX
int n=0;
for (int i = 1; i < maxmatch; i++)
{
if (aRegMatch[i].rm_so >= 0)
{
if (num==n)
{
if (aRegMatch[i].rm_eo < aRegMatch[i].rm_so)
{
#ifndef _NO_EXEPTOBJ
MEXCEPTION(0,"Fehler beim Ermitteln einer Zeichenkette im regulaeren Ausdruck '"
+FExpression+"'. Position "+int2string(aRegMatch[i].rm_so)+" - "+int2string(aRegMatch[i].rm_eo),"");
#else
return "";
#endif
}
pos = aRegMatch[i].rm_so;
return FText.substr(pos, aRegMatch[i].rm_eo - pos);
}
n++;
}
}
#endif
#ifdef STDREGEX
num++; // auf Index 0 steht der gesamte String
if (aRegMatch.size() > num) {
pos = aRegMatch.position(num);
len = aRegMatch.length(num);
// komischerweise liefert aRegMatch[num] manchmal einen Leerstring wo keiner sein sollte
// der Substring funktioniert aber
// string s = aRegMatch[num];
return FText.substr(pos, len);
}
#endif
return "";
}
string TMRegExp::GetMatch(unsigned num, unsigned &pos) {
unsigned len;
return GetMatch(num, pos, len);
}
string TMRegExp::GetMatch(unsigned num) {
unsigned pos, len;
return GetMatch(num, pos, len);
}
| 25.937173 | 114 | 0.591643 | mirkowi |
c2af81546ea5c4f82129f47a2e7156783866a486 | 535 | cpp | C++ | Impl/post.cpp | TollisK/Forum-Simulator-OOP | 3eb9fc999ac48becdb940fbb81ae8a126addc388 | [
"MIT"
] | 1 | 2022-01-09T17:33:21.000Z | 2022-01-09T17:33:21.000Z | Impl/post.cpp | TollisK/Forum-Simulator-OOP | 3eb9fc999ac48becdb940fbb81ae8a126addc388 | [
"MIT"
] | null | null | null | Impl/post.cpp | TollisK/Forum-Simulator-OOP | 3eb9fc999ac48becdb940fbb81ae8a126addc388 | [
"MIT"
] | null | null | null | #include <string>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include "date.h"
#include "post.h"
using namespace std;
Post::~Post()
{
cout << "Post number:"<< id << " is about to be destroyed" << endl ;
}
Post::Post(string nam ,string nam2,string nam3,Date d,int idd) ////edw vazoyme ta orismata gai to Post
: date(d), id(idd),creator(nam2),title(nam),txt(nam3)
{
cout << "Post with title: "<<title<<"||creator: "<<creator<< "||text: "<<txt<<"||and id: "<<id<<" has just been created!" << endl;
}
| 26.75 | 131 | 0.613084 | TollisK |
c2b534f39e3d067d4e65f3ef89a9cb143274bf4e | 2,018 | cpp | C++ | Core/CStreamTextWriter.cpp | JamesSchumacher10980/James.Cpp | c87d7340dbbca7e86e91b30f29bb9ac0bc1c0c00 | [
"Apache-2.0"
] | null | null | null | Core/CStreamTextWriter.cpp | JamesSchumacher10980/James.Cpp | c87d7340dbbca7e86e91b30f29bb9ac0bc1c0c00 | [
"Apache-2.0"
] | null | null | null | Core/CStreamTextWriter.cpp | JamesSchumacher10980/James.Cpp | c87d7340dbbca7e86e91b30f29bb9ac0bc1c0c00 | [
"Apache-2.0"
] | null | null | null | #include "StdAfx.hpp"
#include "James.Cpp.Api.hpp"
/////////////////////////////////////////////////
//// (C) 2017 James Bernard Schumacher III
/////////////////////////////////////////////////
/*
Copyright (C) 2017 James Bernard Schumacher III
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.
*/
namespace James
{
namespace Cpp
{
// ITextWriter destructor
ITextWriter::~ITextWriter() throw()
{
}
///////////////////////////////////////////////////
/// CStreamTextWriter
///////////////////////////////////////////////////
CStreamTextWriter::CStreamTextWriter() throw() : m_pStream(nullptr), m_bOwnStream(false)
{
}
CStreamTextWriter::CStreamTextWriter(IStream * pStream, bool bOwnStream) throw(CApiError) : m_pStream(pStream),
m_bOwnStream(bOwnStream)
{
if (pStream == nullptr)
{
CApiError nullError("A null pointer was encountered as an argument. Argument \'pStream\' was null.",
__FILE__, __FUNCTION__, __LINE__, CApiError::ErrorCodes::NullPointer);
// throw the exception
throw(nullError);
}
}
CStreamTextWriter::~CStreamTextWriter() throw()
{
if (m_pStream != nullptr && m_bOwnStream == true)
{
delete m_pStream;
}
}
}
}
| 34.20339 | 120 | 0.530228 | JamesSchumacher10980 |
c2b85db92ee52f8768f77d956c0c5a21f928df9f | 6,745 | cpp | C++ | src/http/HttpHeader.cpp | wanghaEMQ/kuma | 8068bf29906556ca3a6f1fff29237ffff08a7cd1 | [
"MIT"
] | 180 | 2015-07-03T04:56:18.000Z | 2022-03-26T05:49:40.000Z | src/http/HttpHeader.cpp | wanghaEMQ/kuma | 8068bf29906556ca3a6f1fff29237ffff08a7cd1 | [
"MIT"
] | 21 | 2017-02-03T21:41:56.000Z | 2022-02-06T12:59:52.000Z | src/http/HttpHeader.cpp | Jamol/kuma | 72321dec5f0093def839152905fc0e076dc66de0 | [
"MIT"
] | 73 | 2015-12-31T04:03:21.000Z | 2022-02-25T02:15:48.000Z | /* Copyright © 2017, Fengping Bao <jamol@live.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "HttpHeader.h"
#include "libkev/src/util/util.h"
#include <sstream>
#include <algorithm>
using namespace kuma;
HttpHeader::HttpHeader(bool is_outgoing, bool is_http2)
: is_outgoing_(is_outgoing), is_http2_(is_http2)
{
}
KMError HttpHeader::addHeader(std::string name, std::string value)
{
if(name.empty()) {
return KMError::INVALID_PARAM;
}
if (kev::is_equal(name, strContentLength)) {
has_content_length_ = true;
content_length_ = std::stol(value);
if (is_outgoing_ && is_chunked_) {
return KMError::NOERR;
}
} else if (kev::is_equal(name, strTransferEncoding)) {
is_chunked_ = true;
if (!is_http2_) {
if (is_outgoing_ && has_content_length_) {
removeHeader(strContentLength);
}
} else { // is_http2_
return KMError::NOERR;
}
}
if (is_http2_) {
transform(name.begin(), name.end(), name.begin(), ::tolower);
if (name[0] == ':') { // H2 pseudo header
auto kv = std::make_pair(std::move(name), std::move(value));
header_vec_.insert(header_vec_.begin(), std::move(kv));
return KMError::NOERR;
}
}
header_vec_.emplace_back(std::move(name), std::move(value));
return KMError::NOERR;
}
KMError HttpHeader::addHeader(std::string name, uint32_t value)
{
return addHeader(std::move(name), std::to_string(value));
}
bool HttpHeader::removeHeader(const std::string &name)
{
bool removed = false;
auto it = header_vec_.begin();
while (it != header_vec_.end()) {
if (kev::is_equal(it->first, name)) {
it = header_vec_.erase(it);
removed = true;
} else {
++it;
}
}
return removed;
}
bool HttpHeader::removeHeaderValue(const std::string &name, const std::string &value)
{
bool removed = false;
auto it = header_vec_.begin();
while (it != header_vec_.end()) {
bool erased = false;
if (kev::is_equal(it->first, name)) {
if (kev::remove_token(it->second, value, ',')) {
removed = true;
if (it->second.empty()) {
it = header_vec_.erase(it);
erased = true;
}
}
}
if (!erased) {
++it;
}
}
return removed;
}
bool HttpHeader::hasHeader(const std::string &name) const
{
for (auto const &kv : header_vec_) {
if (kev::is_equal(kv.first, name)) {
return true;
}
}
return false;
}
const std::string& HttpHeader::getHeader(const std::string &name) const
{
for (auto const &kv : header_vec_) {
if (kev::is_equal(kv.first, name)) {
return kv.second;
}
}
return EmptyString;
}
bool HttpHeader::isUpgradeHeader() const
{
return hasHeader(strUpgrade) && kev::contains_token(getHeader("Connection"), strUpgrade, ',');
}
void HttpHeader::processHeader()
{
has_body_ = is_chunked_ || (has_content_length_ && content_length_ > 0);
}
void HttpHeader::processHeader(int status_code, const std::string &req_method)
{
if (kev::is_equal(req_method, "HEAD")) {
has_body_ = false;
return;
}
if (kev::is_equal(req_method, "CONNECT") && status_code >= 200 && status_code <= 299) {
has_body_ = false;
return;
}
if ((status_code >= 100 && status_code <= 199) || status_code == 204 || status_code == 304) {
has_body_ = false;
return;
}
has_body_ = !has_content_length_ || content_length_ > 0;
}
std::string HttpHeader::buildHeader(const std::string &method, const std::string &url, const std::string &ver)
{
processHeader();
std::string req = method + " " + url + " " + (!ver.empty()?ver:VersionHTTP1_1);
req += "\r\n";
for (auto &kv : header_vec_) {
req += kv.first + ": " + kv.second + "\r\n";
}
req += "\r\n";
return req;
}
std::string HttpHeader::buildHeader(int status_code, const std::string &desc, const std::string &ver, const std::string &req_method)
{
processHeader(status_code, req_method);
std::string rsp = (!ver.empty()?ver:VersionHTTP1_1) + " " + std::to_string(status_code);
if (!desc.empty()) {
rsp += " " + desc;
}
rsp += "\r\n";
for (auto &kv : header_vec_) {
rsp += kv.first + ": " + kv.second + "\r\n";
}
rsp += "\r\n";
return rsp;
}
void HttpHeader::reset()
{
has_content_length_ = false;
content_length_ = 0;
is_chunked_ = false;
has_body_ = false;
header_vec_.clear();
}
void HttpHeader::setHeaders(const HeaderVector &headers)
{
for (auto &kv : headers) {
addHeader(kv.first, kv.second);
}
}
void HttpHeader::setHeaders(HeaderVector &&headers)
{
setHeaders(headers);
}
HttpHeader& HttpHeader::operator= (const HttpHeader &other)
{
if (&other != this) {
is_chunked_ = other.is_chunked_;
has_content_length_ = other.has_content_length_;
content_length_ = other.content_length_;
has_body_ = other.has_body_;
header_vec_ = other.header_vec_;
}
return *this;
}
HttpHeader& HttpHeader::operator= (HttpHeader &&other)
{
if (&other != this) {
is_chunked_ = other.is_chunked_;
has_content_length_ = other.has_content_length_;
content_length_ = other.content_length_;
has_body_ = other.has_body_;
header_vec_ = std::move(other.header_vec_);
}
return *this;
}
| 28.459916 | 132 | 0.615864 | wanghaEMQ |
c2b892c660ce47d37db4b6e4ab8243ef95514e8a | 1,019 | cpp | C++ | deep-learning/src/pcc/utility/pcc_copa_ucalc.cpp | chengcheng8632/Aurora | 8471a7e307c360dc0d1234afb18072bde68ac2bd | [
"Apache-2.0"
] | null | null | null | deep-learning/src/pcc/utility/pcc_copa_ucalc.cpp | chengcheng8632/Aurora | 8471a7e307c360dc0d1234afb18072bde68ac2bd | [
"Apache-2.0"
] | null | null | null | deep-learning/src/pcc/utility/pcc_copa_ucalc.cpp | chengcheng8632/Aurora | 8471a7e307c360dc0d1234afb18072bde68ac2bd | [
"Apache-2.0"
] | 2 | 2019-09-05T02:16:09.000Z | 2019-09-17T10:06:27.000Z |
#include <cmath>
#include "pcc_copa_ucalc.h"
float PccCopaUtilityCalculator::CalculateUtility(PccMonitorIntervalAnalysisGroup& past_monitor_intervals,
MonitorInterval& cur_mi) {
float throughput = cur_mi.GetObsThroughput();
float rtt_inflation = cur_mi.GetObsRttInflation();
float avg_rtt = cur_mi.GetObsRtt();
float loss_rate = cur_mi.GetObsLossRate();
float throughput_contribution = 0;
float latency_contribution = 0;
if (loss_rate == 1.0) {
avg_rtt = last_avg_rtt;
} else {
last_avg_rtt = avg_rtt;
}
float utility = throughput / avg_rtt;
PccLoggableEvent event("Calculate Utility", "--log-utility-calc-lite");
event.AddValue("Utility", utility);
event.AddValue("MI Start Time", cur_mi.GetStartTime());
event.AddValue("Target Rate", cur_mi.GetTargetSendingRate());
event.AddValue("Actual Rate", cur_mi.GetObsSendingRate());
event.AddValue("Loss Rate", loss_rate);
event.AddValue("Avg RTT", avg_rtt);
logger->LogEvent(event);
return utility;
}
| 29.970588 | 105 | 0.725221 | chengcheng8632 |
c2bbd1580efe337ef413611cb6311cf6e9b93274 | 4,016 | cpp | C++ | src/GafferDelight/IECoreDelightPreview/CameraAlgo.cpp | mattigruener/gaffer | 8216ba1a884712575a0acae747c51b02f7a99a5d | [
"BSD-3-Clause"
] | null | null | null | src/GafferDelight/IECoreDelightPreview/CameraAlgo.cpp | mattigruener/gaffer | 8216ba1a884712575a0acae747c51b02f7a99a5d | [
"BSD-3-Clause"
] | 2 | 2017-08-23T21:35:45.000Z | 2018-01-29T08:59:33.000Z | src/GafferDelight/IECoreDelightPreview/CameraAlgo.cpp | mattigruener/gaffer | 8216ba1a884712575a0acae747c51b02f7a99a5d | [
"BSD-3-Clause"
] | null | null | null | //////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2017, John Haddon. 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 Image Engine Design nor the names of any
// other contributors to this software may be used to endorse or
// promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////
#include "nsi.h"
#include "IECore/SimpleTypedData.h"
#include "IECoreScene/Camera.h"
#include "GafferDelight/IECoreDelightPreview/NodeAlgo.h"
#include "GafferDelight/IECoreDelightPreview/ParameterList.h"
using namespace std;
using namespace Imath;
using namespace IECore;
using namespace IECoreScene;
using namespace IECoreDelight;
namespace
{
bool convert( const IECoreScene::Camera *camera, NSIContext_t context, const char *handle )
{
CameraPtr cameraCopy = camera->copy();
cameraCopy->addStandardParameters();
const string &projection = cameraCopy->parametersData()->member<StringData>( "projection", true )->readable();
const string nodeType = projection + "camera";
NSICreate( context, handle, nodeType.c_str(), 0, nullptr );
ParameterList parameters;
if( projection == "perspective" )
{
parameters.add( "fov", cameraCopy->parametersData()->member<FloatData>( "projection:fov", true ) );
}
const V2i &resolution = cameraCopy->parametersData()->member<V2iData>( "resolution", true )->readable();
parameters.add( { "resolution", resolution.getValue(), NSITypeInteger, 2, 1, NSIParamIsArray } );
const Box2f &screenWindow = cameraCopy->parametersData()->member<Box2fData>( "screenWindow", true )->readable();
const Box2d screenWindowD( screenWindow.min, screenWindow.max );
parameters.add( { "screenWindow", screenWindowD.min.getValue(), NSITypeDouble, 2, 2, NSIParamIsArray } );
const float pixelAspectRatio = cameraCopy->parametersData()->member<FloatData>( "pixelAspectRatio", true )->readable();
parameters.add( { "pixelaspectratio", &pixelAspectRatio, NSITypeFloat, 0, 1, 0 } );
const V2d clippingPlanes = cameraCopy->parametersData()->member<V2fData>( "clippingPlanes", true )->readable();
parameters.add( { "clippingrange", clippingPlanes.getValue(), NSITypeDouble, 0, 2, 0 } );
const V2d shutter = cameraCopy->parametersData()->member<V2fData>( "shutter", true )->readable();
parameters.add( { "shutterrange", shutter.getValue(), NSITypeDouble, 0, 2, 0 } );
/// \todo Support renderRegion
NSISetAttribute( context, handle, parameters.size(), parameters.data() );
return true;
}
NodeAlgo::ConverterDescription<Camera> g_description( convert );
} // namespace
| 42.273684 | 120 | 0.714392 | mattigruener |
c2c1197e209964918dd9fda8f427aa1f41b04c79 | 1,492 | hpp | C++ | include/icp_localization/transform/TfPublisher.hpp | ibrahimhroob/icp_localization | 271d99c59141fcd293190ec935020213783745e5 | [
"BSD-3-Clause"
] | 72 | 2021-07-06T09:05:00.000Z | 2022-03-25T08:21:07.000Z | include/icp_localization/transform/TfPublisher.hpp | ibrahimhroob/icp_localization | 271d99c59141fcd293190ec935020213783745e5 | [
"BSD-3-Clause"
] | 3 | 2021-06-09T20:06:41.000Z | 2022-02-16T09:54:42.000Z | include/icp_localization/transform/TfPublisher.hpp | ibrahimhroob/icp_localization | 271d99c59141fcd293190ec935020213783745e5 | [
"BSD-3-Clause"
] | 22 | 2021-06-23T09:18:01.000Z | 2022-03-11T03:14:10.000Z | /*
* TfPublisher.hpp
*
* Created on: Apr 27, 2021
* Author: jelavice
*/
#pragma once
#include "icp_localization/transform/RigidTransform.hpp"
#include <tf2_ros/transform_broadcaster.h>
#include <nav_msgs/Odometry.h>
#include <sensor_msgs/Imu.h>
namespace icp_loco {
class FrameTracker;
class ImuTracker;
class TfPublisher
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
TfPublisher(const ros::NodeHandle &nh, std::shared_ptr<FrameTracker> frameTracker,
std::shared_ptr<ImuTracker> imuTracker);
~TfPublisher() = default;
void setOdometryTopic(const std::string &topic);
void setImuTopic(const std::string &topic);
void initialize();
void publishMapToOdom(const Time &time) ;
void publishMapToRangeSensor(const Time &time) ;
void setIsProvideOdomFrame(bool value);
void setIsUseOdometry(bool value);
void setInitialPose(const Eigen::Vector3d &p, const Eigen::Quaterniond &q);
private:
void odometryCallback(const nav_msgs::Odometry &msg);
void imuCallback(const sensor_msgs::Imu &msg);
tf2_ros::TransformBroadcaster tfBroadcaster_;
std::string odometryTopic_;
std::string imuTopic_;
ros::NodeHandle nh_;
ros::Subscriber odomSubscriber_;
ros::Subscriber imuSubscriber_;
std::shared_ptr<FrameTracker> frameTracker_;
std::shared_ptr<ImuTracker> imuTracker_;
bool isProvideOdomFrame_ = false;
bool isUseOdometry_ = false;
Eigen::Vector3d initPosition_;
Eigen::Quaterniond initOrientation_;
};
} // namespace icp_loco
| 26.642857 | 84 | 0.756702 | ibrahimhroob |
c2c566df81e4f258fb7bfcffc85d13ccafa86055 | 185 | cpp | C++ | mia/medium/pocket-challenge-v2.cpp | CasualPokePlayer/ares | 58690cd5fc7bb6566c22935c5b80504a158cca29 | [
"BSD-3-Clause"
] | 153 | 2020-07-25T17:55:29.000Z | 2021-10-01T23:45:01.000Z | mia/medium/pocket-challenge-v2.cpp | CasualPokePlayer/ares | 58690cd5fc7bb6566c22935c5b80504a158cca29 | [
"BSD-3-Clause"
] | 245 | 2021-10-08T09:14:46.000Z | 2022-03-31T08:53:13.000Z | mia/medium/pocket-challenge-v2.cpp | CasualPokePlayer/ares | 58690cd5fc7bb6566c22935c5b80504a158cca29 | [
"BSD-3-Clause"
] | 44 | 2020-07-25T08:51:55.000Z | 2021-09-25T16:09:01.000Z | struct PocketChallengeV2 : WonderSwan {
auto name() -> string override { return "Pocket Challenge V2"; }
auto extensions() -> vector<string> override { return {"pcv2", "pc2"}; }
};
| 37 | 74 | 0.675676 | CasualPokePlayer |
c2c6d4cf258c84f49b84b7a8a794909cc48a9bf8 | 211 | cpp | C++ | chapter-6/6.35.cpp | zero4drift/Cpp-Primer-5th-Exercises | d3d0f0d228e8c2c5a3b3fe1fd03ce34e0894e93f | [
"MIT"
] | null | null | null | chapter-6/6.35.cpp | zero4drift/Cpp-Primer-5th-Exercises | d3d0f0d228e8c2c5a3b3fe1fd03ce34e0894e93f | [
"MIT"
] | null | null | null | chapter-6/6.35.cpp | zero4drift/Cpp-Primer-5th-Exercises | d3d0f0d228e8c2c5a3b3fe1fd03ce34e0894e93f | [
"MIT"
] | null | null | null | // val-- keeps a copy of the original value of val, decreases val by 1, and then return the kept copy.
// this function processing would never meet the end condition statement, exceeds the maximum stack depth.
| 52.75 | 106 | 0.767773 | zero4drift |
c2c7bc3a698c18d19e3138d96302207f0b72e0ed | 3,153 | cpp | C++ | src/tabwidget.cpp | bms/kscope | 3f3fc268574a178ea3cc94205b61ee44f2a242e3 | [
"BSD-2-Clause"
] | 1 | 2019-05-15T03:18:00.000Z | 2019-05-15T03:18:00.000Z | src/tabwidget.cpp | wanghaitang/kscope4-1.8.1 | 72dbb7e9e3b34253c8bd8b25c5d82ebbb8d68358 | [
"BSD-2-Clause"
] | null | null | null | src/tabwidget.cpp | wanghaitang/kscope4-1.8.1 | 72dbb7e9e3b34253c8bd8b25c5d82ebbb8d68358 | [
"BSD-2-Clause"
] | null | null | null | /***************************************************************************
*
* Copyright (C) 2005 Elad Lahav (elad_lahav@users.sourceforge.net)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
#include <QtGui/QToolTip>
#include <QtGui/QMenu>
#include <klocale.h>
#include "tabwidget.h"
#include "kscopepixmaps.h"
/**
* Class constructor.
* @param pParent A pointer to the parent widget
* @param szName Optional widget name
*/
TabWidget::TabWidget(QWidget* pParent, const char* szName) :
KTabWidget(pParent)
{
Q_UNUSED(szName);
// Create a popup menu
m_pMenu = new QMenu(this);
// Set the current tab based on the menu selection
connect(m_pMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotSetCurrentPage(QAction*)));
// Create a button at the top-right corner of the tab widget
m_pButton = new QToolButton(this);
m_pButton->setIcon(Pixmaps().getPixmap(KScopePixmaps::TabList));
m_pButton->setToolTip(i18n("Shows a list of all open tabs"));
m_pButton->adjustSize();
setCornerWidget(m_pButton, Qt::TopRightCorner);
// Show the popup-menu when the button is clicked
connect(m_pButton, SIGNAL(clicked()), this, SLOT(slotShowTabList()));
}
/**
* Class destructor.
*/
TabWidget::~TabWidget()
{
}
void TabWidget::slotSetCurrentPage(QAction *pAction)
{
int index;
QString text = pAction->text();
for (index = 0; index < count(); index++)
if (text == tabText(index))
setCurrentIndex(index);
}
/**
* Creates and displays a popup-menu containing all tab labels.
* This slot is connected to the clicked() signal emitted by the list button.
*/
void TabWidget::slotShowTabList()
{
int i;
// Delete the previous menu
m_pMenu->clear();
// Create and populate the menu
for (i = 0; i < count(); i++)
m_pMenu->addAction(tabText(i));
// Show the menu
m_pMenu->popup(mapToGlobal(m_pButton->pos()));
}
#include "tabwidget.moc"
| 31.53 | 89 | 0.697114 | bms |
c2c7dfd11a18f0d0d2b863aa35617dd8a663068e | 822 | cc | C++ | src/GSPH/Limiters/OspreLimiter.cc | LLNL/spheral | 282a3e6987975cd22c62c11f948da3d5db23faeb | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 19 | 2020-10-21T01:49:17.000Z | 2022-03-15T12:29:17.000Z | src/GSPH/Limiters/OspreLimiter.cc | LLNL/spheral | 282a3e6987975cd22c62c11f948da3d5db23faeb | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 41 | 2020-09-28T23:14:27.000Z | 2022-03-28T17:01:33.000Z | src/GSPH/Limiters/OspreLimiter.cc | LLNL/spheral | 282a3e6987975cd22c62c11f948da3d5db23faeb | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 5 | 2020-11-03T16:14:26.000Z | 2022-01-03T19:07:24.000Z | #include "OspreLimiter.hh"
namespace Spheral {
//========================================================
// Constructor
//========================================================
template<typename Dimension>
OspreLimiter<Dimension>::
OspreLimiter():
LimiterBase<Dimension>(true,true){
}
//========================================================
// Destructor
//========================================================
template<typename Dimension>
OspreLimiter<Dimension>::
~OspreLimiter(){}
//========================================================
// slope limiter
//========================================================
template<typename Dimension>
typename Dimension::Scalar
OspreLimiter<Dimension>::
fluxLimiter(const typename Dimension::Scalar x) const {
return 1.5 * (x*x + x) / (x*x + x + 1.0) ;
}
} | 25.6875 | 58 | 0.418491 | LLNL |
c2cd14c35492001dc919d90c6f34d5de1a70289c | 2,174 | hpp | C++ | include/boost/simd/arch/common/simd/function/genmask.hpp | nickporubsky/boost-simd-clone | b81dfcd9d6524a131ea714f1eebb5bb75adddcc7 | [
"BSL-1.0"
] | 5 | 2018-02-20T11:21:12.000Z | 2019-11-12T13:45:09.000Z | include/boost/simd/arch/common/simd/function/genmask.hpp | nickporubsky/boost-simd-clone | b81dfcd9d6524a131ea714f1eebb5bb75adddcc7 | [
"BSL-1.0"
] | null | null | null | include/boost/simd/arch/common/simd/function/genmask.hpp | nickporubsky/boost-simd-clone | b81dfcd9d6524a131ea714f1eebb5bb75adddcc7 | [
"BSL-1.0"
] | 2 | 2017-11-17T15:30:36.000Z | 2018-03-01T02:06:25.000Z | //==================================================================================================
/**
Copyright 2016 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
**/
//==================================================================================================
#ifndef BOOST_SIMD_ARCH_COMMON_SIMD_FUNCTION_GENMASK_HPP_INCLUDED
#define BOOST_SIMD_ARCH_COMMON_SIMD_FUNCTION_GENMASK_HPP_INCLUDED
#include <boost/simd/detail/overload.hpp>
#include <boost/simd/meta/as_arithmetic.hpp>
#include <boost/simd/function/if_else.hpp>
#include <boost/simd/constant/allbits.hpp>
namespace boost { namespace simd { namespace ext
{
namespace bd = boost::dispatch;
namespace bs = boost::simd;
// -----------------------------------------------------------------------------------------------
// genmask from logical
BOOST_DISPATCH_OVERLOAD_IF( genmask_
, (typename A0, typename X)
, (detail::is_native<X>)
, bd::cpu_
, bs::pack_< bs::logical_<A0>, X >
)
{
using result_t = as_arithmetic_t<A0>;
BOOST_FORCEINLINE result_t operator()( A0 const& a0 ) const BOOST_NOEXCEPT
{
return do_(a0, typename is_bitwise_logical<A0>::type{});
}
BOOST_FORCEINLINE result_t do_( A0 const& a0, std::true_type const& ) const BOOST_NOEXCEPT
{
return bitwise_cast<result_t>(a0);
}
BOOST_FORCEINLINE result_t do_( A0 const& a0, std::false_type const& ) const BOOST_NOEXCEPT
{
return if_else(a0, Allbits<result_t>(), result_t(0));
}
};
BOOST_DISPATCH_OVERLOAD_IF( genmask_
, (typename A0,typename X)
, (detail::is_native<X>)
, bd::cpu_
, bs::pack_<bd::arithmetic_<A0>,X>
)
{
BOOST_FORCEINLINE A0 operator()( const A0& a0) const BOOST_NOEXCEPT
{
return if_else(a0, Allbits<A0>(), A0(0));
}
};
} } }
#endif
| 33.96875 | 100 | 0.517939 | nickporubsky |
c2ce474d0d43dc78a843523519f923b7ff44a3d7 | 240 | hpp | C++ | DLOCRModel.Calculate/pch.hpp | Frederisk/DeepLearning-OpticalCharacterRecognition-Model | 52998e877cdf1e849cc2648e7d07dee6ae865cc1 | [
"MIT"
] | null | null | null | DLOCRModel.Calculate/pch.hpp | Frederisk/DeepLearning-OpticalCharacterRecognition-Model | 52998e877cdf1e849cc2648e7d07dee6ae865cc1 | [
"MIT"
] | 1 | 2020-12-16T03:32:56.000Z | 2020-12-16T03:32:56.000Z | DLOCRModel.Calculate/pch.hpp | Frederisk/DeepLearning-OpticalCharacterRecognition-Model | 52998e877cdf1e849cc2648e7d07dee6ae865cc1 | [
"MIT"
] | null | null | null | // pch.h: 此為先行編譯的標頭檔。
// 以下所列檔案只會編譯一次,可改善之後組建的組建效能。
// 這也會影響 IntelliSense 效能,包括程式碼完成以及許多程式碼瀏覽功能。
// 但此處所列的檔案,如果其中任一在組建之間進行了更新,即會重新編譯所有檔案。
// 請勿於此處新增會經常更新的檔案,如此將會對於效能優勢產生負面的影響。
#ifndef PCH_H
#define PCH_H
// 請於此新增您要先行編譯的標頭
#endif //PCH_H | 20 | 44 | 0.779167 | Frederisk |
c2cfc850b3bb55e583bca007ea5fce4f4e2f80d5 | 492 | cpp | C++ | codeforces/gym/2019-2020 ACM-ICPC Brazil Subregional Programming Contest/h.cpp | tysm/cpsols | 262212646203e516d1706edf962290de93762611 | [
"MIT"
] | 4 | 2020-10-05T19:24:10.000Z | 2021-07-15T00:45:43.000Z | codeforces/gym/2019-2020 ACM-ICPC Brazil Subregional Programming Contest/h.cpp | tysm/cpsols | 262212646203e516d1706edf962290de93762611 | [
"MIT"
] | null | null | null | codeforces/gym/2019-2020 ACM-ICPC Brazil Subregional Programming Contest/h.cpp | tysm/cpsols | 262212646203e516d1706edf962290de93762611 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
#define int long long
#define ii pair<int, int>
#define ff first
#define ss second
#define vi vector<int>
#define vii vector<ii>
#define pb push_back
#define MAX (int32_t(1e6)+1)
#define INF (int32_t(1e9)+1)
using namespace std;
int32_t main(){
int v, n;
cin >> v >> n;
v*=n;
for(int i=1; i<=9; ++i){
if(i-1)
cout << ' ';
int x = v*i;
cout << (int)ceil((long double)x/10);
}
cout << endl;
return 0;
}
| 18.222222 | 45 | 0.554878 | tysm |
c2d11b18eed95f8d26f7200ea60c2d9c07575670 | 4,823 | hxx | C++ | main/chart2/source/inc/RelativePositionHelper.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 679 | 2015-01-06T06:34:58.000Z | 2022-03-30T01:06:03.000Z | main/chart2/source/inc/RelativePositionHelper.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 102 | 2017-11-07T08:51:31.000Z | 2022-03-17T12:13:49.000Z | main/chart2/source/inc/RelativePositionHelper.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 331 | 2015-01-06T11:40:55.000Z | 2022-03-14T04:07:51.000Z | /**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 _CHART2_RELATIVEPOSITIONHELPER_HXX
#define _CHART2_RELATIVEPOSITIONHELPER_HXX
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/drawing/Alignment.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include "charttoolsdllapi.hxx"
//.............................................................................
namespace chart
{
//.............................................................................
//-----------------------------------------------------------------------------
/**
*/
class OOO_DLLPUBLIC_CHARTTOOLS RelativePositionHelper
{
public:
/** returns the upper left corner of an object that has size aObjectSize and
where the point indicated by aAnchor has coordinates indicated by aPoint
( e.g. if aAnchor equals BOTTOM_LEFT, aPoint describes the
coordinates of the bottom left corner of an object with size aObjectSize )
*/
static ::com::sun::star::awt::Point
getUpperLeftCornerOfAnchoredObject(
::com::sun::star::awt::Point aPoint,
::com::sun::star::awt::Size aObjectSize,
::com::sun::star::drawing::Alignment aAnchor );
/** returns the center of an object that has size aObjectSize and
where the point indicated by aAnchor has coordinates indicated by aPoint
( e.g. if aAnchor equals BOTTOM_LEFT, aPoint describes the
coordinates of the bottom left corner of an object with size aObjectSize )
*/
static ::com::sun::star::awt::Point
getCenterOfAnchoredObject(
::com::sun::star::awt::Point aPoint,
::com::sun::star::awt::Size aUnrotatedObjectSize,
::com::sun::star::drawing::Alignment aAnchor,
double fAnglePi );
/** Returns a relative position that is the same point after the anchor has
been changed to the given one. The passed object size is taken into
account for shifting the position.
*/
SAL_DLLPRIVATE static ::com::sun::star::chart2::RelativePosition
getReanchoredPosition(
const ::com::sun::star::chart2::RelativePosition & rPosition,
const ::com::sun::star::chart2::RelativeSize & rObjectSize,
::com::sun::star::drawing::Alignment aNewAnchor );
/** grows a relative size about the given amount and shifts the given
position such that the resize is relative to the former rectangle's
center.
@param bCheck If </sal_True>, the resize is only done, if after
transformation, the position and size are within the bounds [0,1].
@return </sal_True>, if changes were applied.
<p>That means, if the position's alignment is center, the position will
not change at all.</p>
*/
static bool centerGrow(
::com::sun::star::chart2::RelativePosition & rInOutPosition,
::com::sun::star::chart2::RelativeSize & rInOutSize,
double fAmountX, double fAmountY,
bool bCheck = true );
/** shifts a relative position about the given amount
@param bCheck If </sal_True>, the shift is only done, if after
transformation, the object represented by the position
rInOutPosition and its size rObjectSize the position and size are
within the bounds [0,1].
@return </sal_True>, if changes were applied.
*/
static bool moveObject(
::com::sun::star::chart2::RelativePosition & rInOutPosition,
const ::com::sun::star::chart2::RelativeSize & rObjectSize,
double fAmountX, double fAmountY,
bool bCheck = true );
};
//.............................................................................
} //namespace chart
//.............................................................................
#endif
| 41.222222 | 82 | 0.606262 | Grosskopf |
c2d146bebf552b11d604b4ef794e69bb4c8b1cdb | 2,803 | cpp | C++ | TheGame/objectlootcycle.cpp | MiKlTA/game_RPG_project | 9d460e9fb5e0449e457ba94e44a0d6fc5b491012 | [
"MIT"
] | null | null | null | TheGame/objectlootcycle.cpp | MiKlTA/game_RPG_project | 9d460e9fb5e0449e457ba94e44a0d6fc5b491012 | [
"MIT"
] | null | null | null | TheGame/objectlootcycle.cpp | MiKlTA/game_RPG_project | 9d460e9fb5e0449e457ba94e44a0d6fc5b491012 | [
"MIT"
] | null | null | null | #include "allFunctions.h"
void objectLootCycle(BasicHero *hero, BasicObject *object)
{
prepare();
printSeparator();
printBasicObject(object);
printSeparator();
if (!object->getBasicObjectInfo().wasExamined)
{
printCase(0, "Loot");
printCase(1, "Back");
printSeparator();
beginSwitch:
printInputPrecede();
switch (inputCase())
{
case '0':
{
BasicObject::ContainerItems_t items, deletedItems;
object->examine(items);
bool itemWasSuccessfullyPush = true;
for (auto i : items)
{
if (itemWasSuccessfullyPush)
{
itemWasSuccessfullyPush = hero->giveItem(i);
}
else
{
deletedItems.push_back(i);
}
}
hero->addLevel(object->getBasicObjectInfo().levelAdd);
whatWeGotAfterObjectLoot(items, deletedItems, object);
break;
}
case '1':
prepare();
return;
default:
printErrorUnknownCharacter();
goto beginSwitch;
break;
}
}
else
{
printCase(0, "Back");
printSeparator();
printInputPrecede();
inputCase();
}
prepare();
}
void whatWeGotAfterObjectLoot(const BasicObject::ContainerItems_t &loot,
const BasicObject::ContainerItems_t &deletedLoot,
BasicObject *object)
{
prepare();
printSeparator();
if (!loot.empty())
{
printWithDelayWithPauses(
"|| In "
+ object->getGameObjectInfo().name
+ " you found:$\n");
for (auto i : loot)
{
printWithDelayWithPauses(
"|| "
+ i->getGameObjectInfo().name
+ "$\n");
}
}
else
{
printWithDelayWithPauses("|| You didn't find anything :($\n");
}
printSeparator();
if (!deletedLoot.empty())
{
printWithDelayWithPauses(
"|| Due to insufficient storage capacity of the inventory,"
"you lost:$\n");
for (auto i : deletedLoot)
{
printWithDelayWithPauses(
"|| "
+ i->getGameObjectInfo().name
+ "$\n");
}
printSeparator();
}
printCase(0, "Ok");
printSeparator();
printInputPrecede();
inputCase();
prepare();
}
| 22.97541 | 79 | 0.447021 | MiKlTA |
c2d5c7b6c672bd8aa85a6b4fcde82fe1fd48c77e | 1,099 | cpp | C++ | HW3/ydogukan_Yildirim_Dogukan_hw3.cpp | ydogukan/CS204_Advanced_Programming | 015cb72d42cdaa9eaf335eb8deb0abcfc9a08c84 | [
"MIT"
] | null | null | null | HW3/ydogukan_Yildirim_Dogukan_hw3.cpp | ydogukan/CS204_Advanced_Programming | 015cb72d42cdaa9eaf335eb8deb0abcfc9a08c84 | [
"MIT"
] | null | null | null | HW3/ydogukan_Yildirim_Dogukan_hw3.cpp | ydogukan/CS204_Advanced_Programming | 015cb72d42cdaa9eaf335eb8deb0abcfc9a08c84 | [
"MIT"
] | null | null | null | #include <iostream>
#include <sstream>
#include <string>
#include "ydogukan_Yildirim_Dogukan_hw3_SubSeqsList.h"
using namespace std;
int main() {
string line;
cout << "Please enter the numbers in a line: ";
getline(cin, line);
cout << endl;
// Creating temporary stringstream and integer variable to check whether the given line is empty
// i.e. checking if the given line has no numbers
istringstream temp(line);
int tempNumber;
if (!(temp >> tempNumber)) { // if no integer could be put into the integer variable, i.e. if it was empty, print the error line
SubSeqsList tempList;
tempList.displayList();
return 0;
}
SubSeqsList list;
istringstream numbers(line);
int number;
while (numbers >> number) { // number by number from the sstream
if (number >= 0) {
if (!list.numberExistsInList(number)) {
list.insertSubSeqs(number); // insert one or more subsequences
}
}
else {
list.deleteSubSeqs(-number); // delete one or more subsequences
}
}
list.displayList(); // print the whole list
list.deleteList(); // delete the whole list
return 0;
} | 23.891304 | 129 | 0.702457 | ydogukan |
c2d7a23b4d7cbb5e51069e9b443ffacca9787fd1 | 597 | hpp | C++ | include/universal/native/native.hpp | shikharvashistha/universal | 5c20504504f067412958fa61ea3839cf86c3d6f7 | [
"MIT"
] | 254 | 2017-05-24T16:51:57.000Z | 2022-03-22T13:07:29.000Z | include/universal/native/native.hpp | jamesquinlan/universal | 3b7e6bf37cbb9123425b634d18af18a409c2eccc | [
"MIT"
] | 101 | 2017-11-09T22:57:24.000Z | 2022-03-17T12:44:59.000Z | include/universal/native/native.hpp | jamesquinlan/universal | 3b7e6bf37cbb9123425b634d18af18a409c2eccc | [
"MIT"
] | 55 | 2017-06-09T10:04:38.000Z | 2022-02-01T16:54:56.000Z | #pragma once
// native standard header aggregating all native type introspection and manipulation functionality
//
// Copyright (C) 2017-2021 Stillwater Supercomputing, Inc.
//
// This file is part of the universal numbers project, which is released under an MIT Open Source license.
#ifndef _NATIVE_
#define _NATIVE_
#include <universal/native/integers.hpp>
#include <universal/native/ieee754.hpp>
#include <universal/native/manipulators.hpp>
#include <universal/native/bit_functions.hpp>
#include <universal/native/boolean_logic_operators.hpp>
#include <universal/native/subnormal.hpp>
#endif
| 33.166667 | 106 | 0.802345 | shikharvashistha |
c2d7ec02d9a05c4a122057bf8d8f85e8f164bcf6 | 10,999 | inl | C++ | include/Vorb/Vector.inl | ChillstepCoder/Vorb | f74c0cfa3abde4fed0e9ec9d936b23c5210ba2ba | [
"MIT"
] | 65 | 2018-06-03T23:09:46.000Z | 2021-07-22T22:03:34.000Z | include/Vorb/Vector.inl | ChillstepCoder/Vorb | f74c0cfa3abde4fed0e9ec9d936b23c5210ba2ba | [
"MIT"
] | 8 | 2018-06-20T17:21:30.000Z | 2020-06-30T01:06:26.000Z | include/Vorb/Vector.inl | ChillstepCoder/Vorb | f74c0cfa3abde4fed0e9ec9d936b23c5210ba2ba | [
"MIT"
] | 34 | 2018-06-04T03:40:52.000Z | 2022-02-15T07:02:05.000Z | /* This file implements all operators for the Vector types. */
// Helper macro to add assignment operators for the currently defined vector.
#define ADD_COMPOUND_ASSIGNMENT_OPERATORS \
COMPOUND_ASSIGNMENT(+= ); \
COMPOUND_ASSIGNMENT(-= ); \
COMPOUND_ASSIGNMENT(*= ); \
COMPOUND_ASSIGNMENT(/= ); \
COMPOUND_ASSIGNMENT(%= ); \
COMPOUND_ASSIGNMENT(&= ); \
COMPOUND_ASSIGNMENT(|= ); \
COMPOUND_ASSIGNMENT(^= ); \
COMPOUND_ASSIGNMENT(<<=); \
COMPOUND_ASSIGNMENT(>>=);
// Helper macro to add global operators for the currently defined vector.
#define ADD_GLOBAL_OPERATORS \
GLOBAL_OPERATOR(+ ); \
GLOBAL_OPERATOR(- ); \
GLOBAL_OPERATOR(* ); \
GLOBAL_OPERATOR(/ ); \
GLOBAL_OPERATOR(% ); \
GLOBAL_OPERATOR(& ); \
GLOBAL_OPERATOR(| ); \
GLOBAL_OPERATOR(^ ); \
GLOBAL_OPERATOR(<<); \
GLOBAL_OPERATOR(>>);
/************************************************************************/
/* Vector2 Implementation */
/************************************************************************/
#pragma region Vector2
template<typename T>
inline T& Vector2<T>::operator[](int i) {
vorb_assert(i >= 0 && i < 2, "Index out of range");
return data[i];
}
template<typename T>
inline const T& Vector2<T>::operator[](int i) const {
vorb_assert(i >= 0 && i < 2, "Index out of range");
return data[i];
}
template<typename T>
template<typename U>
inline Vector2<T>& Vector2<T>::operator=(const Vector2<U>& rhs) {
x = static_cast<T>(rhs.x);
y = static_cast<T>(rhs.y);
return *this;
}
template<typename T>
inline bool Vector2<T>::operator==(const Vector2<T>& rhs) const {
return (x == rhs.x) && (y == rhs.y);
}
template<typename T>
inline bool Vector2<T>::operator!=(const Vector2<T>& rhs) const {
return (x != rhs.x) || (y != rhs.y);
}
// Code reduction for compound assignment operators.
#define COMPOUND_ASSIGNMENT(OP) \
template<typename T> \
template<typename U> \
inline Vector2<T>& Vector2<T>::operator##OP##(U a) { \
x OP static_cast<T>(a); \
y OP static_cast<T>(a); \
return *this; \
} \
template<typename T> \
template<typename U> \
inline Vector2<T>& Vector2<T>::operator##OP##(const Vector2<U>& v) { \
x OP static_cast<T>(v.x); \
y OP static_cast<T>(v.y); \
return *this; \
}
// Add compound assignment operator code for Vector2.
ADD_COMPOUND_ASSIGNMENT_OPERATORS;
#undef COMPOUND_ASSIGNMENT
// Code reduction for bitwise and arithmetic operators.
#define GLOBAL_OPERATOR(OP) \
template<typename T> \
inline Vector2<T> operator##OP##(const Vector2<T>& v, T a) { \
return Vector2<T>(v.x ##OP## a, v.y ##OP## a); \
} \
template<typename T> \
inline Vector2<T> operator##OP##(T a, const Vector2<T>& v) { \
return Vector2<T>(a ##OP## v.x, a ##OP## v.y); \
} \
template<typename T> \
inline Vector2<T> operator##OP##(const Vector2<T>& v1, const Vector2<T>& v2) { \
return Vector2<T>(v1.x ##OP## v2.x, v1.y ##OP## v2.y); \
}
// Add global operator code for Vector2.
ADD_GLOBAL_OPERATORS;
template<typename T>
inline Vector2<T> operator~(const Vector2<T>& v) {
return Vector2<T>(~v.x, ~v.y);
}
template<typename T>
inline Vector2<T> operator-(const Vector2<T>& v) {
return Vector2<T>(-v.x, -v.y);
}
#undef GLOBAL_OPERATOR
#pragma endregion Vector2
/************************************************************************/
/* Vector3 Implementation */
/************************************************************************/
#pragma region Vector3
/* Explicit conversions */
template<typename T>
template<typename A, typename B, typename C>
inline Vector3<T>::Vector3(A a, B b, C c) :
x(static_cast<T>(a)), y(static_cast<T>(b)), z(static_cast<T>(c)){}
template<typename T>
template<typename A, typename B>
inline Vector3<T>::Vector3(const Vector2<A>& a, B b) :
x(static_cast<T>(a.x)), y(static_cast<T>(a.y)), z(static_cast<T>(b)) {}
template<typename T>
template<typename A, typename B>
inline Vector3<T>::Vector3(A a, const Vector2<B>& b) :
x(static_cast<T>(a)), y(static_cast<T>(b.x)), z(static_cast<T>(b.y)) {}
/* Operators */
template<typename T>
inline T& Vector3<T>::operator[](int i) {
// vorb_assert(i >= 0 && i < 3, "Index out of range");
return data[i];
}
template<typename T>
inline const T& Vector3<T>::operator[](int i) const {
// vorb_assert(i >= 0 && i < 3, "Index out of range");
return data[i];
}
template<typename T>
template<typename U>
inline Vector3<T>& Vector3<T>::operator=(const Vector3<U>& rhs) {
x = static_cast<T>(rhs.x);
y = static_cast<T>(rhs.y);
z = static_cast<T>(rhs.z);
return *this;
}
template<typename T>
inline bool Vector3<T>::operator==(const Vector3<T>& rhs) const {
return (x == rhs.x) && (y == rhs.y) && (z == rhs.z);
}
template<typename T>
inline bool Vector3<T>::operator!=(const Vector3<T>& rhs) const {
return (x != rhs.x) || (y != rhs.y) || (z != rhs.z);
}
// Code reduction for compound assignment operators.
#define COMPOUND_ASSIGNMENT(OP) \
template<typename T> \
template<typename U> \
inline Vector3<T>& Vector3<T>::operator##OP##(U a) { \
x OP static_cast<T>(a); \
y OP static_cast<T>(a); \
z OP static_cast<T>(a); \
return *this; \
} \
template<typename T> \
template<typename U> \
inline Vector3<T>& Vector3<T>::operator##OP##(const Vector3<U>& v) { \
x OP static_cast<T>(v.x); \
y OP static_cast<T>(v.y); \
z OP static_cast<T>(v.z); \
return *this; \
}
// Add compound assignment operator code for Vector3.
ADD_COMPOUND_ASSIGNMENT_OPERATORS;
#undef COMPOUND_ASSIGNMENT
// Code reduction for bitwise and arithmetic operators.
#define GLOBAL_OPERATOR(OP) \
template<typename T> \
inline Vector3<T> operator##OP##(const Vector3<T>& v, T a) { \
return Vector3<T>(v.x ##OP## a, v.y ##OP## a, v.z ##OP## a); \
} \
template<typename T> \
inline Vector3<T> operator##OP##(T a, const Vector3<T>& v) { \
return Vector3<T>(a ##OP## v.x, a ##OP## v.y, a ##OP## v.z); \
} \
template<typename T> \
inline Vector3<T> operator##OP##(const Vector3<T>& v1, const Vector3<T>& v3) { \
return Vector3<T>(v1.x ##OP## v3.x, v1.y ##OP## v3.y, v1.z ##OP## v3.z); \
}
// Add global operator code for Vector3.
ADD_GLOBAL_OPERATORS;
template<typename T>
inline Vector3<T> operator~(const Vector3<T>& v) {
return Vector3<T>(~v.x, ~v.y, ~v.z);
}
template<typename T>
inline Vector3<T> operator-(const Vector3<T>& v) {
return Vector3<T>(-v.x, -v.y, -v.z);
}
#undef GLOBAL_OPERATOR
#pragma endregion Vector3
/************************************************************************/
/* Vector4 Implementation */
/************************************************************************/
#pragma region Vector4
/* Explicit conversions */
template<typename T>
template<typename A, typename B, typename C, typename D>
inline Vector4<T>::Vector4(A a, B b, C c, D d) :
x(static_cast<T>(a)), y(static_cast<T>(b)), z(static_cast<T>(c)), w(static_cast<T>(d)) {}
template<typename T>
template<typename A, typename B, typename C>
inline Vector4<T>::Vector4(const Vector2<A>& a, B b, C c) :
x(static_cast<T>(a.x)), y(static_cast<T>(a.y)), z(static_cast<T>(b)), w(static_cast<T>(c)) {}
template<typename T>
template<typename A, typename B, typename C>
inline Vector4<T>::Vector4(A a, const Vector2<B>& b, C c) :
x(static_cast<T>(a)), y(static_cast<T>(b.x)), z(static_cast<T>(b.y)), w(static_cast<T>(c)) {}
template<typename T>
template<typename A, typename B, typename C>
inline Vector4<T>::Vector4(A a, B b, const Vector2<C>& c) :
x(static_cast<T>(z)), y(static_cast<T>(b)), z(static_cast<T>(c.x)), w(static_cast<T>(c.y)) {}
template<typename T>
template<typename A, typename B>
inline Vector4<T>::Vector4(const Vector3<A>& a, B b) :
x(static_cast<T>(a.x)), y(static_cast<T>(a.y)), z(static_cast<T>(a.z)), w(static_cast<T>(b)) {}
template<typename T>
template<typename A, typename B>
inline Vector4<T>::Vector4(A a, const Vector3<B>& b) :
x(static_cast<T>(a)), y(static_cast<T>(b.x)), z(static_cast<T>(b.y)), w(static_cast<T>(b.z)) {}
template<typename T>
template<typename A, typename B>
inline Vector4<T>::Vector4(const Vector2<A>& a, const Vector2<B>& b) :
x(static_cast<T>(a.x)), y(static_cast<T>(a.y)), z(static_cast<T>(b.x)), w(static_cast<T>(b.y)) {}
/* Operators */
template<typename T>
inline T& Vector4<T>::operator[](int i) {
// vorb_assert(i >= 0 && i < 4, "Index out of range");
return data[i];
}
template<typename T>
inline const T& Vector4<T>::operator[](int i) const {
// vorb_assert(i >= 0 && i < 4, "Index out of range");
return data[i];
}
template<typename T>
template<typename U>
inline Vector4<T>& Vector4<T>::operator=(const Vector4<U>& rhs) {
x = static_cast<T>(rhs.x);
y = static_cast<T>(rhs.y);
z = static_cast<T>(rhs.z);
w = static_cast<T>(rhs.w);
return *this;
}
template<typename T>
inline bool Vector4<T>::operator==(const Vector4<T>& rhs) const {
return (x == rhs.x) && (y == rhs.y) && (z == rhs.z) && (w == rhs.w);
}
template<typename T>
inline bool Vector4<T>::operator!=(const Vector4<T>& rhs) const {
return (x != rhs.x) || (y != rhs.y) || (z != rhs.z) || (w != rhs.w);
}
// Code reduction for compound assignment operators.
#define COMPOUND_ASSIGNMENT(OP) \
template<typename T> \
template<typename U> \
inline Vector4<T>& Vector4<T>::operator##OP##(U a) { \
x OP static_cast<T>(a); \
y OP static_cast<T>(a); \
z OP static_cast<T>(a); \
w OP static_cast<T>(a); \
return *this; \
} \
template<typename T> \
template<typename U> \
inline Vector4<T>& Vector4<T>::operator##OP##(const Vector4<U>& v) { \
x OP static_cast<T>(v.x); \
y OP static_cast<T>(v.y); \
z OP static_cast<T>(v.z); \
w OP static_cast<T>(v.w); \
return *this; \
}
// Add compound assignment operator code for Vector4.
ADD_COMPOUND_ASSIGNMENT_OPERATORS;
#undef COMPOUND_ASSIGNMENT
// Code reduction for bitwise and arithmetic operators.
#define GLOBAL_OPERATOR(OP) \
template<typename T> \
inline Vector4<T> operator##OP##(const Vector4<T>& v, T a) { \
return Vector4<T>(v.x ##OP## a, v.y ##OP## a, v.z ##OP## a, v.w ##OP## a); \
} \
template<typename T> \
inline Vector4<T> operator##OP##(T a, const Vector4<T>& v) { \
return Vector4<T>(a ##OP## v.x, a ##OP## v.y, a ##OP## v.z, a ##OP## v.w); \
} \
template<typename T> \
inline Vector4<T> operator##OP##(const Vector4<T>& v1, const Vector4<T>& v4) { \
return Vector4<T>(v1.x ##OP## v4.x, v1.y ##OP## v4.y, v1.z ##OP## v4.z, v1.w ##OP## v4.w); \
}
// Add global operator code for Vector4.
ADD_GLOBAL_OPERATORS;
template<typename T>
inline Vector4<T> operator~(const Vector4<T>& v) {
return Vector4<T>(~v.x, ~v.y, ~v.z, ~v.w);
}
template<typename T>
inline Vector4<T> operator-(const Vector4<T>& v) {
return Vector4<T>(-v.x, -v.y, -v.z, -v.w);
}
#undef GLOBAL_OPERATOR
#pragma endregion Vector4
#undef ADD_COMPOUND_ASSIGNMENT_OPERATORS
#undef ADD_GLOBAL_OPERATORS
| 31.697406 | 101 | 0.613965 | ChillstepCoder |
c2dd18cee696bd36df3c87700284d7c56ddbd65a | 4,448 | hh | C++ | src/file/prob/parprobpipeline.hh | aaszodi/multovl | 00c5b74e65c7aa37cddea8b2ae277fe67fbc59a8 | [
"MIT"
] | 2 | 2018-03-06T02:36:25.000Z | 2020-01-13T10:55:35.000Z | src/file/prob/parprobpipeline.hh | aaszodi/multovl | 00c5b74e65c7aa37cddea8b2ae277fe67fbc59a8 | [
"MIT"
] | null | null | null | src/file/prob/parprobpipeline.hh | aaszodi/multovl | 00c5b74e65c7aa37cddea8b2ae277fe67fbc59a8 | [
"MIT"
] | null | null | null | /* <LICENSE>
License for the MULTOVL multiple genomic overlap tools
Copyright (c) 2007-2012, Dr Andras Aszodi,
Campus Science Support Facilities GmbH (CSF),
Dr-Bohr-Gasse 3, A-1030 Vienna, Austria, Europe.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Campus Science Support Facilities GmbH
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.
</LICENSE> */
#ifndef MULTOVL_PROB_PARPIPELINE_HEADER
#define MULTOVL_PROB_PARPIPELINE_HEADER
// == Header parprobpipeline.hh ==
// -- Own headers --
#include "probpipeline.hh"
#include "parprobopts.hh"
// -- Boost headers --
#include "boost/thread.hpp"
#include "boost/progress.hpp"
namespace multovl {
namespace prob {
// -- Classes --
/// The ParProbPipeline implements the parallel version of the MULTOVL probability pipeline.
/// The inputs are files (text or binary),
/// the overlap calculations are serial/single core,
/// the repetitions after reshuffling (some) tracks to estimate the probability
/// of overlaps by chance are done in parallel.
class ParProbPipeline: public ProbPipeline
{
public:
/// Inits the pipeline with the command-line arguments.
/// These will be parsed inside and the program exits with an error message
/// if parsing goes wrong.
ParProbPipeline(int argc, char* argv[]);
~ParProbPipeline();
protected:
/// Detects overlaps.
/// First the overlaps without shuffling are calculated. Then the shufflable tracks
/// are permuted and the number of overlaps counted again and again which will provide
/// an estimate of the null distribution (ie. the extent of overlaps by chance).
/// The reshufflings are done in parallel.
/// \return the total number of overlaps found in the unpermuted case.
virtual
unsigned int detect_overlaps();
/// \return access to the option-handling object
virtual
ParProbOpts* opt_ptr() { return dynamic_cast<ParProbOpts*>(opt_pimpl()); }
/// \return thread-safe non-const access to the statistics collector object
virtual
Stat& stat()
{
boost::lock_guard<boost::mutex> lock(_stat_mutex); // 1 thread only
return ProbPipeline::stat();
}
private:
void shuffle(
unsigned int rndseed,
boost::progress_display* progressptr
);
/// Before a worker thread starts a shuffle, the shuffle counter will be checked.
/// If it is >0, then this means there are still jobs to do. The counter will be
/// decremented and the worker performs one reshuffling. If it is 0, then the
/// worker knows that it can stop, there are no more shuffling jobs.
/// \param progressptr if not NULL then the global progress object is updated
/// \return the number of remaining shuffles, 0 indicates the thread may stop
unsigned int check_update_shufflecounter(boost::progress_display* progressptr=NULL);
unsigned int _shufflecounter;
boost::mutex _shufflecounter_mutex, _stat_mutex;
};
} // namespace prob
} // namespace multovl
#endif // MULTOVL_PROB_PARPIPELINE_HEADER
| 37.378151 | 92 | 0.73696 | aaszodi |
c2dfc180cd8f9f7efda4b8623141406eec712921 | 8,956 | cc | C++ | src/dwarf/line_info.cc | warmchang/bloaty | f01ea59bdda11708d74a3826c23d6e2db6c996f0 | [
"Apache-2.0"
] | 3,807 | 2016-11-07T21:30:07.000Z | 2022-03-31T18:24:15.000Z | src/dwarf/line_info.cc | warmchang/bloaty | f01ea59bdda11708d74a3826c23d6e2db6c996f0 | [
"Apache-2.0"
] | 179 | 2016-11-08T08:43:01.000Z | 2022-03-19T19:07:49.000Z | src/dwarf/line_info.cc | warmchang/bloaty | f01ea59bdda11708d74a3826c23d6e2db6c996f0 | [
"Apache-2.0"
] | 321 | 2016-11-08T00:51:12.000Z | 2022-03-25T01:04:43.000Z | // Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "dwarf/line_info.h"
#include "dwarf/dwarf_util.h"
#include "dwarf_constants.h"
using namespace dwarf2reader;
using absl::string_view;
namespace bloaty {
extern int verbose_level;
namespace dwarf {
const std::string& LineInfoReader::GetExpandedFilename(size_t index) {
if (index >= filenames_.size()) {
THROW("filename index out of range");
}
// Generate these lazily.
if (expanded_filenames_.size() <= index) {
expanded_filenames_.resize(filenames_.size());
}
std::string& ret = expanded_filenames_[index];
if (ret.empty()) {
const FileName& filename = filenames_[index];
absl::string_view directory = include_directories_[filename.directory_index];
ret = std::string(directory);
if (!ret.empty()) {
ret += "/";
}
ret += std::string(filename.name);
}
return ret;
}
void LineInfoReader::Advance(uint64_t amount) {
if (params_.maximum_operations_per_instruction == 1) {
// This is by far the common case (only false on VLIW architectuers),
// and this inlining/specialization avoids a costly division.
DoAdvance(amount, 1);
} else {
DoAdvance(amount, params_.maximum_operations_per_instruction);
}
}
void LineInfoReader::DoAdvance(uint64_t advance, uint8_t max_per_instr) {
info_.address += params_.minimum_instruction_length *
((info_.op_index + advance) / max_per_instr);
info_.op_index = (info_.op_index + advance) % max_per_instr;
}
void LineInfoReader::SpecialOpcodeAdvance(uint8_t op) {
Advance(AdjustedOpcode(op) / params_.line_range);
}
uint8_t LineInfoReader::AdjustedOpcode(uint8_t op) {
return op - params_.opcode_base;
}
void LineInfoReader::SeekToOffset(uint64_t offset, uint8_t address_size) {
string_view data = file_.debug_line;
SkipBytes(offset, &data);
sizes_.SetAddressSize(address_size);
data = sizes_.ReadInitialLength(&data);
sizes_.ReadDWARFVersion(&data);
uint64_t header_length = sizes_.ReadDWARFOffset(&data);
string_view program = data;
SkipBytes(header_length, &program);
params_.minimum_instruction_length = ReadFixed<uint8_t>(&data);
if (sizes_.dwarf_version() == 4) {
params_.maximum_operations_per_instruction = ReadFixed<uint8_t>(&data);
if (params_.maximum_operations_per_instruction == 0) {
THROW("DWARF line info had maximum_operations_per_instruction=0");
}
} else {
params_.maximum_operations_per_instruction = 1;
}
params_.default_is_stmt = ReadFixed<uint8_t>(&data);
params_.line_base = ReadFixed<int8_t>(&data);
params_.line_range = ReadFixed<uint8_t>(&data);
params_.opcode_base = ReadFixed<uint8_t>(&data);
if (params_.line_range == 0) {
THROW("line_range of zero will cause divide by zero");
}
standard_opcode_lengths_.resize(params_.opcode_base);
for (size_t i = 1; i < params_.opcode_base; i++) {
standard_opcode_lengths_[i] = ReadFixed<uint8_t>(&data);
}
// Read include_directories.
include_directories_.clear();
// Implicit current directory entry.
include_directories_.push_back(string_view());
while (true) {
string_view dir = ReadNullTerminated(&data);
if (dir.empty()) {
break;
}
include_directories_.push_back(dir);
}
// Read file_names.
filenames_.clear();
expanded_filenames_.clear();
// Filename 0 is unused.
filenames_.push_back(FileName());
while (true) {
FileName file_name;
file_name.name = ReadNullTerminated(&data);
if (file_name.name.empty()) {
break;
}
file_name.directory_index = ReadLEB128<uint32_t>(&data);
file_name.modified_time = ReadLEB128<uint64_t>(&data);
file_name.file_size = ReadLEB128<uint64_t>(&data);
if (file_name.directory_index >= include_directories_.size()) {
THROW("directory index out of range");
}
filenames_.push_back(file_name);
}
info_ = LineInfo(params_.default_is_stmt);
remaining_ = program;
shadow_ = false;
}
bool LineInfoReader::ReadLineInfo() {
// Final step of last DW_LNS_copy / special opcode.
info_.discriminator = 0;
info_.basic_block = false;
info_.prologue_end = false;
info_.epilogue_begin = false;
// Final step of DW_LNE_end_sequence.
info_.end_sequence = false;
string_view data = remaining_;
while (true) {
if (data.empty()) {
remaining_ = data;
return false;
}
uint8_t op = ReadFixed<uint8_t>(&data);
if (op >= params_.opcode_base) {
SpecialOpcodeAdvance(op);
info_.line +=
params_.line_base + (AdjustedOpcode(op) % params_.line_range);
if (!shadow_) {
remaining_ = data;
return true;
}
} else {
switch (op) {
case DW_LNS_extended_op: {
uint16_t len = ReadLEB128<uint16_t>(&data);
uint8_t extended_op = ReadFixed<uint8_t>(&data);
switch (extended_op) {
case DW_LNE_end_sequence: {
// Preserve address and set end_sequence, but reset everything
// else.
uint64_t addr = info_.address;
info_ = LineInfo(params_.default_is_stmt);
info_.address = addr;
info_.end_sequence = true;
if (!shadow_) {
remaining_ = data;
return true;
}
break;
}
case DW_LNE_set_address:
info_.address = sizes_.ReadAddress(&data);
info_.op_index = 0;
shadow_ = (info_.address == 0);
break;
case DW_LNE_define_file: {
FileName file_name;
file_name.name = ReadNullTerminated(&data);
file_name.directory_index = ReadLEB128<uint32_t>(&data);
file_name.modified_time = ReadLEB128<uint64_t>(&data);
file_name.file_size = ReadLEB128<uint64_t>(&data);
if (file_name.directory_index >= include_directories_.size()) {
THROW("directory index out of range");
}
filenames_.push_back(file_name);
break;
}
case DW_LNE_set_discriminator:
info_.discriminator = ReadLEB128<uint32_t>(&data);
break;
default:
// We don't understand this opcode, skip it.
SkipBytes(len, &data);
if (verbose_level > 0) {
fprintf(stderr,
"bloaty: warning: unknown DWARF line table extended "
"opcode: %d\n",
extended_op);
}
break;
}
break;
}
case DW_LNS_copy:
if (!shadow_) {
remaining_ = data;
return true;
}
break;
case DW_LNS_advance_pc:
Advance(ReadLEB128<uint64_t>(&data));
break;
case DW_LNS_advance_line:
info_.line += ReadLEB128<int32_t>(&data);
break;
case DW_LNS_set_file:
info_.file = ReadLEB128<uint32_t>(&data);
if (info_.file >= filenames_.size()) {
THROW("filename index too big");
}
break;
case DW_LNS_set_column:
info_.column = ReadLEB128<uint32_t>(&data);
break;
case DW_LNS_negate_stmt:
info_.is_stmt = !info_.is_stmt;
break;
case DW_LNS_set_basic_block:
info_.basic_block = true;
break;
case DW_LNS_const_add_pc:
SpecialOpcodeAdvance(255);
break;
case DW_LNS_fixed_advance_pc:
info_.address += ReadFixed<uint16_t>(&data);
info_.op_index = 0;
break;
case DW_LNS_set_prologue_end:
info_.prologue_end = true;
break;
case DW_LNS_set_epilogue_begin:
info_.epilogue_begin = true;
break;
case DW_LNS_set_isa:
info_.isa = ReadLEB128<uint8_t>(&data);
break;
default:
// Unknown opcode, but we know its length so can skip it.
SkipBytes(standard_opcode_lengths_[op], &data);
if (verbose_level > 0) {
fprintf(stderr,
"bloaty: warning: unknown DWARF line table opcode: %d\n",
op);
}
break;
}
}
}
}
} // namespace dwarf
} // namespace bloaty
| 30.989619 | 81 | 0.622711 | warmchang |
123c985f03fd81575fdcbc2136acde38728375b4 | 3,387 | cc | C++ | ion/portgfx/asmjscontext.cc | isabella232/ion-1 | ef47f3b824050499ce5c6f774b366f6c4dbce0af | [
"Apache-2.0"
] | 1 | 2020-03-12T12:49:31.000Z | 2020-03-12T12:49:31.000Z | ion/portgfx/asmjscontext.cc | isabella232/ion-1 | ef47f3b824050499ce5c6f774b366f6c4dbce0af | [
"Apache-2.0"
] | null | null | null | ion/portgfx/asmjscontext.cc | isabella232/ion-1 | ef47f3b824050499ce5c6f774b366f6c4dbce0af | [
"Apache-2.0"
] | null | null | null | /**
Copyright 2017 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include <EGL/egl.h>
#include <emscripten.h>
#include <string>
#include "ion/base/sharedptr.h"
#include "ion/portgfx/eglcontextbase.h"
#include "ion/portgfx/glcontext.h"
#include "ion/portgfx/glheaders.h"
namespace ion {
namespace portgfx {
namespace {
// Emscripten does not permit the creation of multiple EGL contexts, so
// we use 1 as a placeholder for the one and only valid context.
static const uintptr_t kInvalidContext = 0;
static const uintptr_t kValidContext = 1ull;
// This class wraps an asm.js EGL context in an ion::portgfx::GlContext
// implementation.
class AsmjsContext : public EglContextBase {
public:
explicit AsmjsContext(bool is_is_owned_context)
: EglContextBase(is_is_owned_context) {}
// GlContext implementation.
void* GetProcAddress(const char* proc_name, uint32_t flags) const override {
return reinterpret_cast<void*>(eglGetProcAddress(proc_name));
}
GlContextPtr CreateGlContextInShareGroupImpl(
const GlContextSpec& spec) override {
// Currently this platform only supports the default GlContextSpec.
DCHECK(spec.backbuffer_width == 1 && spec.backbuffer_height == 1);
base::SharedPtr<AsmjsContext> context(new AsmjsContext(true));
if (!context->InitOwned(this, spec)) {
context.Reset();
}
return context;
}
// EglContextBase implementation.
EGLSurface EglCreateSurface(EGLDisplay display, EGLConfig config,
const GlContextSpec& spec) const override {
if (spec.native_window) {
auto window = reinterpret_cast<NativeWindowType>(spec.native_window);
return eglCreateWindowSurface(display, config, window, nullptr);
}
return eglCreateWindowSurface(display, config, 0, nullptr);
}
EGLContext EglGetCurrentContext() const override {
return reinterpret_cast<EGLContext>(GlContext::GetCurrentGlContextId());
}
EGLBoolean EglMakeCurrent(EGLDisplay display, EGLSurface draw,
EGLSurface read,
EGLContext context) const override {
DCHECK(context == this->EglGetCurrentContext() ||
context == EGL_NO_CONTEXT);
return true;
}
};
} // namespace
// static
GlContextPtr GlContext::CreateGlContext(const GlContextSpec& spec) {
base::SharedPtr<AsmjsContext> context(new AsmjsContext(true));
if (!context->InitOwned(nullptr, spec)) {
context.Reset();
}
return context;
}
// static
GlContextPtr GlContext::CreateWrappingGlContext() {
base::SharedPtr<AsmjsContext> context(new AsmjsContext(false));
if (!context->InitWrapped()) {
context.Reset();
}
return context;
}
// static
uintptr_t GlContext::GetCurrentGlContextId() {
return EM_ASM_INT_V({return !!Module.ctx}) ? kValidContext : kInvalidContext;
}
} // namespace portgfx
} // namespace ion
| 31.361111 | 79 | 0.726897 | isabella232 |
123de896206d5746f22aa2b9908819ecfe7e92a8 | 8,264 | cpp | C++ | src/CodeGen_Zynq_C.cpp | kevinkim06/Halide-FIRRTL | e0e64aab1ecbc9c7fce17a929fea765d5412378d | [
"MIT"
] | 1 | 2019-03-03T00:19:21.000Z | 2019-03-03T00:19:21.000Z | src/CodeGen_Zynq_C.cpp | kevinkim06/Halide-FIRRTL | e0e64aab1ecbc9c7fce17a929fea765d5412378d | [
"MIT"
] | null | null | null | src/CodeGen_Zynq_C.cpp | kevinkim06/Halide-FIRRTL | e0e64aab1ecbc9c7fce17a929fea765d5412378d | [
"MIT"
] | 1 | 2019-03-03T00:21:02.000Z | 2019-03-03T00:21:02.000Z | #include <iostream>
#include <limits>
#include "CodeGen_Zynq_C.h"
#include "CodeGen_Internal.h"
#include "IROperator.h"
#include "Simplify.h"
namespace Halide {
namespace Internal {
using std::ostream;
using std::endl;
using std::string;
using std::vector;
using std::pair;
using std::ostringstream;
using std::to_string;
class Zynq_Closure : public Closure {
public:
Zynq_Closure(Stmt s) {
s.accept(this);
}
vector<string> arguments(void);
protected:
using Closure::visit;
};
vector<string> Zynq_Closure::arguments(void) {
vector<string> res;
for (const pair<string, Buffer> &i : buffers) {
debug(3) << "buffer: " << i.first << " " << i.second.size;
if (i.second.read) debug(3) << " (read)";
if (i.second.write) debug(3) << " (write)";
debug(3) << "\n";
}
internal_assert(buffers.empty()) << "we expect no references to buffers in a hw pipeline.\n";
for (const pair<string, Type> &i : vars) {
debug(3) << "var: " << i.first << "\n";
if(!(ends_with(i.first, ".stream") ||
ends_with(i.first, ".stencil"))) {
// stream will be processed by halide_zynq_subimage()
// tap.stencil will be processed by buffer_to_stencil()
// it is a scalar variable
res.push_back(i.first);
}
}
return res;
}
namespace {
// copied from src/runtime/zynq.cpp
const string zynq_runtime =
"#ifndef CMA_BUFFER_T_DEFINED\n"
"#define CMA_BUFFER_T_DEFINED\n"
"struct mMap;\n"
"typedef struct cma_buffer_t {\n"
" unsigned int id; // ID flag for internal use\n"
" unsigned int width; // Width of the image\n"
" unsigned int stride; // Stride between rows, in pixels. This must be >= width\n"
" unsigned int height; // Height of the image\n"
" unsigned int depth; // Byte-depth of the image\n"
" unsigned int phys_addr; // Bus address for DMA\n"
" void* kern_addr; // Kernel virtual address\n"
" struct mMap* cvals;\n"
" unsigned int mmap_offset;\n"
"} cma_buffer_t;\n"
"#endif\n"
"// Zynq runtime API\n"
"int halide_zynq_init();\n"
"void halide_zynq_free(void *user_context, void *ptr);\n"
"int halide_zynq_cma_alloc(struct halide_buffer_t *buf);\n"
"int halide_zynq_cma_free(struct halide_buffer_t *buf);\n"
"int halide_zynq_subimage(const struct halide_buffer_t* image, struct cma_buffer_t* subimage, void *address_of_subimage_origin, int width, int height);\n"
"int halide_zynq_hwacc_launch(struct cma_buffer_t bufs[]);\n"
"int halide_zynq_hwacc_sync(int task_id);\n"
"#include \"halide_zynq_api_setreg.h\"\n";
}
CodeGen_Zynq_C::CodeGen_Zynq_C(ostream &dest,
Target target,
OutputKind output_kind)
: CodeGen_C(dest, target, output_kind) {
stream << zynq_runtime;
}
// Follow name coversion rule of HLS CodeGen for compatibility.
string CodeGen_Zynq_C::print_name(const string &name) {
ostringstream oss;
// Prefix an underscore to avoid reserved words (e.g. a variable named "while")
if (isalpha(name[0])) {
oss << '_';
}
for (size_t i = 0; i < name.size(); i++) {
// vivado HLS compiler doesn't like '__'
if (!isalnum(name[i])) {
oss << "_";
}
else oss << name[i];
}
return oss.str();
}
void CodeGen_Zynq_C::visit(const Realize *op) {
internal_assert(ends_with(op->name, ".stream")||ends_with(op->name, ".tap.stencil"));
if (ends_with(op->name, ".stream")) {
open_scope();
string slice_name = op->name;
buffer_slices.push_back(slice_name);
do_indent();
stream << "cma_buffer_t " << print_name(slice_name) << ";\n";
// Recurse
print_stmt(op->body);
close_scope(slice_name);
} else {
print_stmt(op->body);
}
}
void CodeGen_Zynq_C::visit(const ProducerConsumer *op) {
if (op->is_producer && starts_with(op->name, "_hls_target.")) {
// reachs the HW boundary
/* C code:
cma_buffer_t kbufs[3];
kbufs[0] = kbuf_in0;
kbufs[1] = kbuf_in1;
kbufs[2] = kbuf_out;
int process_id halide_zynq_hwacc_launch(kbufs);
halide_pend_processed(process_id);
*/
// TODO check the order of buffer slices is consistent with
// the order of DMA ports in the driver
Stmt hw_body = op->body;
debug(1) << "compute the closure for hardware pipeline "
<< op->name << '\n';
Zynq_Closure c(hw_body);
vector<string> args = c.arguments();
// emits the register setting api function call
for(size_t i = 0; i < args.size(); i++) {
do_indent();
stream << "halide_zynq_set_" << print_name(args[i]) << "(" << print_name(args[i]) << ");\n";
}
do_indent();
stream << "cma_buffer_t _cma_bufs[" << buffer_slices.size() << "];\n";
for (size_t i = 0; i < buffer_slices.size(); i++) {
do_indent();
stream << "_cma_bufs[" << i << "] = " << print_name(buffer_slices[i]) << ";\n";
}
do_indent();
stream << "int _process_id = halide_zynq_hwacc_launch(_cma_bufs);\n";
do_indent();
stream << "halide_zynq_hwacc_sync(_process_id);\n";
buffer_slices.clear();
} else {
CodeGen_C::visit(op);
}
}
void CodeGen_Zynq_C::visit(const Call *op) {
ostringstream rhs;
if (op->is_intrinsic("halide_zynq_cma_alloc")) {
internal_assert(op->args.size() == 1);
string buffer = print_expr(op->args[0]);
rhs << "halide_zynq_cma_alloc(" << buffer << ")";
print_assignment(op->type, rhs.str());
} else if (op->is_intrinsic("halide_zynq_cma_free")) {
internal_assert(op->args.size() == 1);
string buffer = print_expr(op->args[0]);
do_indent();
stream << "halide_zynq_cma_free(" << buffer << ");\n";
} else if (op->is_intrinsic("stream_subimage")) {
/* IR:
stream_subimage(direction, buffer_var, stream_var,
address_of_subimage_origin,
dim_0_stride, dim_0_extent, ...)
C code:
halide_zynq_subimage(&buffer_var, &stream_var, address_of_subimage_origin, width, height);
*/
internal_assert(op->args.size() >= 6);
const Variable *buffer_var = op->args[1].as<Variable>();
internal_assert(buffer_var && buffer_var->type == type_of<struct buffer_t *>());
string buffer_name = print_expr(op->args[1]);
string slice_name = print_expr(op->args[2]);
string address_of_subimage_origin = print_expr(op->args[3]);
string width, height;
// TODO check the lower demesion matches the buffer depth
// TODO static check that the slice is within the bounds of kernel buffer
size_t arg_length = op->args.size();
width = print_expr(op->args[arg_length-3]);
height = print_expr(op->args[arg_length-1]);
do_indent();
stream << "halide_zynq_subimage("
<< print_name(buffer_name) << ", &" << print_name(slice_name) << ", "
<< address_of_subimage_origin << ", " << width << ", " << height << ");\n";
} else if (op->name == "address_of") {
std::ostringstream rhs;
const Load *l = op->args[0].as<Load>();
internal_assert(op->args.size() == 1 && l);
rhs << "(("
<< print_type(l->type.element_of()) // index is in elements, not vectors.
<< " *)"
<< print_name(l->name)
<< " + "
<< print_expr(l->index)
<< ")";
print_assignment(op->type, rhs.str());
} else if (op->name == "buffer_to_stencil") {
internal_assert(op->args.size() == 2);
// add a suffix to buffer var, in order to be compatible with CodeGen_C
string a0 = print_expr(op->args[0]);
string a1 = print_expr(op->args[1]);
do_indent();
stream << "halide_zynq_set_" << a1 << "(_halide_buffer_get_host(" << a0 << "));\n";
id = "0"; // skip evaluation
} else {
CodeGen_C::visit(op);
}
}
}
}
| 34.722689 | 158 | 0.584342 | kevinkim06 |
123ec0fb25bcc03033cffc2d9137bfc0bd9993be | 129 | hpp | C++ | deps/opencv/win/include/opencv2/reg/mapperpyramid.hpp | YLiLarry/ggframe | ffb6a7d7d878c155d03830cf6fb6fb8f948084f0 | [
"MIT"
] | null | null | null | deps/opencv/win/include/opencv2/reg/mapperpyramid.hpp | YLiLarry/ggframe | ffb6a7d7d878c155d03830cf6fb6fb8f948084f0 | [
"MIT"
] | null | null | null | deps/opencv/win/include/opencv2/reg/mapperpyramid.hpp | YLiLarry/ggframe | ffb6a7d7d878c155d03830cf6fb6fb8f948084f0 | [
"MIT"
] | null | null | null | version https://git-lfs.github.com/spec/v1
oid sha256:86174bf90d9ed9280d77cb38b39041e56c8742dd60eeb77a6275eeea4bc086fb
size 3851
| 32.25 | 75 | 0.883721 | YLiLarry |
12404786494bdb2b0cc9642bf45e7680fc10180a | 6,532 | cpp | C++ | Model/Mesh2D.cpp | danielfrascarelli/esys-particle | e56638000fd9c4af77e21c75aa35a4f8922fd9f0 | [
"Apache-2.0"
] | null | null | null | Model/Mesh2D.cpp | danielfrascarelli/esys-particle | e56638000fd9c4af77e21c75aa35a4f8922fd9f0 | [
"Apache-2.0"
] | null | null | null | Model/Mesh2D.cpp | danielfrascarelli/esys-particle | e56638000fd9c4af77e21c75aa35a4f8922fd9f0 | [
"Apache-2.0"
] | null | null | null | /////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003-2017 by The University of Queensland //
// Centre for Geoscience Computing //
// http://earth.uq.edu.au/centre-geoscience-computing //
// //
// Primary Business: Brisbane, Queensland, Australia //
// Licensed under the Open Software License version 3.0 //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
/////////////////////////////////////////////////////////////
#include <mpi.h>
#include "Foundation/console.h"
#include "Model/Mesh2D.h"
#include "Parallel/Mesh2DReader.h"
// --- STL includes ---
#include <set>
using std::set;
using namespace esys::lsm;
/*!
constructor for empty 2D mesh
*/
Mesh2D::Mesh2D()
{}
/*!
setup 2D mesh from node and edge data
\param node_vec the node data
\param edge_vec the edge data
*/
void Mesh2D::LoadMesh(const vector<MeshNodeData2D>& node_vec,const vector<MeshEdgeData2D>& edge_vec)
{
// get temporary set of corner ids used in edges
set<int> tmp_cid_set;
for(vector<MeshEdgeData2D>::const_iterator iter=edge_vec.begin();
iter!=edge_vec.end();
iter++){
int id0=iter->p1;
int id1=iter->p2;
tmp_cid_set.insert(id0);
tmp_cid_set.insert(id1);
}
// setup node map
for(vector<MeshNodeData2D>::const_iterator iter=node_vec.begin();
iter!=node_vec.end();
iter++){
// check if corner is used in any edge
set<int>::iterator sit=tmp_cid_set.find(iter->id);
if(sit!=tmp_cid_set.end()){
Corner2D Co=Corner2D(Vec3(iter->x,iter->y,0.0),iter->id);
m_corners.push_back(Co);
m_corner_by_id.insert(make_pair(iter->id,m_corners.size()-1));
}
}
console.Debug() << m_corner_by_id.size() << " elements in node map\n";
// setup edges
for(vector<MeshEdgeData2D>::const_iterator iter=edge_vec.begin();
iter!=edge_vec.end();
iter++){
int id0=iter->p1;
int id1=iter->p2;
Vec3 p1=m_corners[m_corner_by_id[id0]].getPos();
Vec3 p2=m_corners[m_corner_by_id[id1]].getPos();
Edge2D E=Edge2D(id0,id1,p1,p2,iter->id,iter->tag);
m_edges.push_back(E);
}
console.Debug() << m_edges.size() << " edges generated\n";
// setup mapping from node id to edge
for(vector<Edge2D>::iterator iter=m_edges.begin();
iter!=m_edges.end();
iter++){
Edge2D* e_ptr=&(*iter);
// get node ids
int id0=(iter->getP0()).first;
int id1=(iter->getP1()).first;
// add pairs
m_edge_by_node_id.insert(make_pair(id0,e_ptr));
m_edge_by_node_id.insert(make_pair(id1,e_ptr));
// add edge pointer to corners
m_corners[m_corner_by_id[id0]].addEdge(e_ptr);
m_corners[m_corner_by_id[id1]].addEdge(e_ptr);
}
// edge id to edge
for(size_t i=0;i<m_edges.size();i++){
Edge2D et=m_edges[i];
//console.Debug() << et << "\n";
m_edge_index_by_id[m_edges[i].getID()]=i;
}
}
/*!
move one node by a given amount
\param id the id of the node
\param d the displacement
*/
void Mesh2D::moveNode(int id,const Vec3& d)
{
// move edges
typedef multimap<int,Edge2D*>::iterator emmi;
pair<emmi,emmi> efound=m_edge_by_node_id.equal_range(id);
for(emmi iter=efound.first;iter!=efound.second;iter++){
iter->second->moveNode(id,d);
}
// move nodes
Corner2D *c=getCornerById(id);
if(c!=NULL){
c->move(d);
}
}
void Mesh2D::translateBy(const Vec3 &translation)
{
for (
std::vector<Corner2D>::iterator it = m_corners.begin();
it != m_corners.end();
++it
)
{
it->move(translation);
}
}
/*!
zero all forces on the mesh. Currently forces are only on
edge
*/
void Mesh2D::zeroForces()
{
for(vector<Edge2D>::iterator iter=m_edges.begin();
iter!=m_edges.end();
iter++){
iter->zeroForce();
}
}
/*!
Get a pointer to a edge with a given ID. If the ID doesn't exist, return NULL
\param id the id
*/
Edge2D* Mesh2D::getEdgeById(int id)
{
Edge2D* res;
map<int,int>::iterator it=m_edge_index_by_id.find(id);
if(it!=m_edge_index_by_id.end()){
res=&(m_edges[it->second]);
} else {
res=NULL;
}
return res;
}
/*!
Get a pointer to a corner with a given ID. If the ID doesn't exist, return NULL
\param id the id
*/
Corner2D* Mesh2D::getCornerById(int id)
{
Corner2D* res;
map<int,int>::iterator it=m_corner_by_id.find(id);
if(it!=m_corner_by_id.end()){
res=&(m_corners[it->second]);
} else {
res=NULL;
}
return res;
}
/*!
Write checkpoint data to stream. The mesh data is written in the original mesh file
format -> can reuse meshreader to read in checkpointed meshes
\param ost the output stream
\param delim the delimiter
\warning doesn't deal with tags yet
*/
void Mesh2D::writeCheckPoint(ostream& ost,const string& delim) const
{
int tag=0;
// build node map
map<int,Vec3> nodemap;
for(vector<Edge2D>::const_iterator iter=m_edges.begin();
iter!=m_edges.end();
iter++){
nodemap.insert(iter->getP0());
nodemap.insert(iter->getP1());
}
// write nodes
ost << "2D-Nodes " << nodemap.size() << delim;
for(map<int,Vec3>::iterator iter=nodemap.begin();
iter!=nodemap.end();
iter++){
ost << iter->first << " " << iter->first << " " << tag << " "
<< iter->second.X() << " " << iter->second.Y() << delim;
}
// write lines
ost << "Line2 " << m_edges.size() << delim;
int count=0;
for(vector<Edge2D>::const_iterator iter=m_edges.begin();
iter!=m_edges.end();
iter++){
ost << count << " " << tag << " ";
ost << (iter->getP0()).first << " ";
ost << (iter->getP1()).first << delim;
count++;
}
}
/*!
load checkpoint data from stream. Re-uses code from meshreader to read in
checkpointed meshes
\param ist the input stream
\warning doesn't deal with tags yet
*/
void Mesh2D::loadCheckPoint(istream& ist)
{
vector<MeshNodeData2D> node_vec;
vector<MeshEdgeData2D> tri_vec;
// --- Nodes ---
Node2DReader nreader(ist);
Node2DReader::Iterator &niter=nreader.getIterator();
// read nodes into vector
while(niter.hasNext()){
node_vec.push_back(niter.next());
}
// --- Edges ---
Edge2DReader treader(ist);
Edge2DReader::Iterator &titer=treader.getIterator();
// read edges into vector
while(titer.hasNext()){
tri_vec.push_back(titer.next());
}
LoadMesh(node_vec,tri_vec);
}
| 25.920635 | 100 | 0.609308 | danielfrascarelli |
1240768799d3c8df6a3ddacd325bd05de27a6972 | 27,755 | cc | C++ | src/keyValueAdapter.cc | onedata/helpers | bf14082d5a8de384c1f126b2fa522c3b360ad500 | [
"MIT"
] | 1 | 2018-06-04T08:08:11.000Z | 2018-06-04T08:08:11.000Z | src/keyValueAdapter.cc | onedata/helpers | bf14082d5a8de384c1f126b2fa522c3b360ad500 | [
"MIT"
] | 1 | 2019-03-26T11:15:13.000Z | 2019-03-26T11:15:13.000Z | src/keyValueAdapter.cc | onedata/helpers | bf14082d5a8de384c1f126b2fa522c3b360ad500 | [
"MIT"
] | 1 | 2018-02-05T09:19:45.000Z | 2018-02-05T09:19:45.000Z | /**
* @file keyValueAdapter.cc
* @author Krzysztof Trzepla
* @copyright (C) 2016 ACK CYFRONET AGH
* @copyright This software is released under the MIT license cited in
* 'LICENSE.txt'
*/
#include "keyValueAdapter.h"
#include "helpers/logging.h"
#include "keyValueHelper.h"
namespace {
uint64_t getBlockId(off_t offset, std::size_t blockSize)
{
LOG_FCALL() << LOG_FARG(offset) << LOG_FARG(blockSize);
if (blockSize == 0)
return 0;
return offset / blockSize;
}
off_t getBlockOffset(off_t offset, std::size_t blockSize)
{
LOG_FCALL() << LOG_FARG(offset) << LOG_FARG(blockSize);
if (blockSize == 0)
return offset;
return offset - getBlockId(offset, blockSize) * blockSize;
}
void logError(const folly::fbstring &operation, const std::system_error &error)
{
LOG(ERROR) << "Operation '" << operation
<< "' failed due to: " << error.what()
<< " (code: " << error.code().value() << ")";
}
folly::IOBufQueue readBlock(
const std::shared_ptr<one::helpers::KeyValueHelper> &helper,
const folly::fbstring &key, const off_t offset, const std::size_t size)
{
LOG_FCALL() << LOG_FARG(key) << LOG_FARG(offset) << LOG_FARG(size);
try {
return helper->getObject(key, offset, size);
}
catch (const std::system_error &e) {
if (e.code().value() == ENOENT)
return folly::IOBufQueue{folly::IOBufQueue::cacheChainLength()};
throw;
}
}
folly::IOBufQueue fillToSize(folly::IOBufQueue buf, const std::size_t size)
{
LOG_FCALL() << LOG_FARG(buf.chainLength()) << LOG_FARG(size);
if (buf.chainLength() < size) {
const std::size_t fillLength = size - buf.chainLength();
auto *data = static_cast<char *>(buf.allocate(fillLength));
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
std::fill(data, data + fillLength, 0);
}
return buf;
}
} // namespace
namespace one {
namespace helpers {
KeyValueFileHandle::KeyValueFileHandle(folly::fbstring fileId,
std::shared_ptr<KeyValueAdapter> helper, const std::size_t blockSize,
std::shared_ptr<Locks> locks, std::shared_ptr<folly::Executor> executor)
: FileHandle{std::move(fileId), std::move(helper)}
, m_blockSize{blockSize}
, m_locks{std::move(locks)}
, m_executor{std::move(executor)}
{
LOG_FCALL() << LOG_FARG(fileId) << LOG_FARG(blockSize);
}
folly::Future<folly::IOBufQueue> KeyValueFileHandle::readFlat(
const off_t offset, const std::size_t size,
const std::size_t storageBlockSize)
{
using one::logging::log_timer;
using one::logging::csv::log;
using one::logging::csv::read_write_perf;
log_timer<> timer;
return folly::via(m_executor.get(),
[this, offset, size, storageBlockSize, locks = m_locks,
helper = std::dynamic_pointer_cast<KeyValueAdapter>(this->helper())
->helper(),
timer, self = shared_from_this()]() {
auto res = readBlocks(offset, size, storageBlockSize);
log<read_write_perf>(fileId(), "KeyValueFileHandle", "read", offset,
size, timer.stop());
return res;
});
}
folly::Future<folly::IOBufQueue> KeyValueFileHandle::readCanonical(
const off_t offset, const std::size_t size)
{
using one::logging::log_timer;
using one::logging::csv::log;
using one::logging::csv::read_write_perf;
LOG_FCALL() << LOG_FARG(offset) << LOG_FARG(size);
log_timer<> timer;
return folly::via(m_executor.get(),
[this, offset, size, locks = m_locks,
helper = std::dynamic_pointer_cast<KeyValueAdapter>(this->helper())
->helper(),
timer, self = shared_from_this()]() {
// If the file is in 1 object
Locks::accessor acc;
locks->insert(acc, fileId());
auto g = folly::makeGuard([&]() mutable { locks->erase(acc); });
auto res = folly::makeFuture<folly::IOBufQueue>(
helper->getObject(fileId(), offset, size));
log<read_write_perf>(fileId(), "KeyValueFileHandle", "read", offset,
size, timer.stop());
return res;
});
}
folly::Future<folly::IOBufQueue> KeyValueFileHandle::read(
const off_t offset, const std::size_t size)
{
LOG_FCALL() << LOG_FARG(offset) << LOG_FARG(size);
if (helper()->storagePathType() == StoragePathType::FLAT)
return readFlat(offset, size, m_blockSize);
return readCanonical(offset, size);
}
folly::Future<std::size_t> KeyValueFileHandle::writeCanonical(
const off_t offset, folly::IOBufQueue buf, WriteCallback &&writeCb)
{
return folly::via(m_executor.get(),
[this, offset, locks = m_locks, writeCb = std::move(writeCb),
helper = std::dynamic_pointer_cast<KeyValueAdapter>(this->helper())
->helper(),
buf = std::move(buf), self = shared_from_this()]() mutable {
const auto size = buf.chainLength();
if (size == 0 && offset > 0)
return folly::makeFuture<std::size_t>(0);
using one::logging::log_timer;
using one::logging::csv::log;
using one::logging::csv::read_write_perf;
log_timer<> timer;
if (!helper->hasRandomAccess() &&
(size + offset > helper->getMaxCanonicalObjectSize())) {
LOG(ERROR) << "Cannot write to object storage beyond "
<< helper->getMaxCanonicalObjectSize();
throw one::helpers::makePosixException(ERANGE);
}
Locks::accessor acc;
locks->insert(acc, fileId());
auto g = folly::makeGuard([&]() mutable { locks->erase(acc); });
if (size > 0) {
return folly::makeFuture<std::size_t>(static_cast<std::size_t>(
helper->modifyObject(fileId(), std::move(buf), offset)));
}
return folly::makeFuture<std::size_t>(
static_cast<std::size_t>(size));
});
}
folly::Future<std::size_t> KeyValueFileHandle::writeFlat(const off_t offset,
folly::IOBufQueue buf, std::size_t storageBlockSize,
WriteCallback &&writeCb)
{
return folly::via(m_executor.get(),
[this, offset, storageBlockSize, locks = m_locks,
writeCb = std::move(writeCb),
helper = std::dynamic_pointer_cast<KeyValueAdapter>(this->helper())
->helper(),
buf = std::move(buf), self = shared_from_this()]() mutable {
const auto size = buf.chainLength();
if (size == 0 && offset > 0)
return folly::makeFuture<std::size_t>(0);
using one::logging::log_timer;
using one::logging::csv::log;
using one::logging::csv::read_write_perf;
log_timer<> timer;
auto blockId = getBlockId(offset, storageBlockSize);
auto blockOffset = getBlockOffset(offset, storageBlockSize);
folly::fbvector<folly::Future<folly::Unit>> writeFutures;
for (std::size_t bufOffset = 0; bufOffset < size;
blockOffset = 0, ++blockId) {
const auto blockSize = std::min<std::size_t>(
storageBlockSize - blockOffset, size - bufOffset);
auto writeFuture = via(m_executor.get(),
[this, iobuf = buf.front()->clone(), blockId, blockOffset,
bufOffset, blockSize,
self = shared_from_this()]() mutable {
folly::IOBufQueue bufq{
folly::IOBufQueue::cacheChainLength()};
bufq.append(std::move(iobuf));
bufq.trimStart(bufOffset);
bufq.trimEnd(bufq.chainLength() - blockSize);
return writeBlock(
std::move(bufq), blockId, blockOffset);
});
writeFutures.emplace_back(std::move(writeFuture));
bufOffset += blockSize;
}
return folly::collect(writeFutures)
.via(m_executor.get())
.thenValue([size, offset, fileId = fileId(),
writeCb = std::move(writeCb),
timer](std::vector<folly::Unit> && /*unused*/) {
log<read_write_perf>(fileId, "KeyValueFileHandle", "write",
offset, size, timer.stop());
if (writeCb)
writeCb(size);
return size;
})
.thenTry([](folly::Try<std::size_t> t) {
try {
return t.value();
}
catch (const std::system_error &e) {
logError("write", e);
throw;
}
});
});
}
folly::Future<std::size_t> KeyValueFileHandle::write(
const off_t offset, folly::IOBufQueue buf, WriteCallback &&writeCb)
{
LOG_FCALL() << LOG_FARG(offset) << LOG_FARG(buf.chainLength());
if (buf.empty())
return folly::makeFuture<std::size_t>(0);
if (helper()->storagePathType() == StoragePathType::FLAT)
return writeFlat(
offset, std::move(buf), m_blockSize, std::move(writeCb));
return writeCanonical(offset, std::move(buf), std::move(writeCb));
}
const Timeout &KeyValueFileHandle::timeout() { return helper()->timeout(); }
KeyValueAdapter::KeyValueAdapter(std::shared_ptr<KeyValueHelper> helper,
std::shared_ptr<folly::Executor> executor, std::size_t blockSize,
ExecutionContext executionContext)
: StorageHelper{executionContext}
, m_helper{std::move(helper)}
, m_executor{std::move(executor)}
, m_locks{std::make_shared<Locks>()}
, m_blockSize{blockSize}
{
LOG_FCALL() << LOG_FARG(blockSize);
}
folly::fbstring KeyValueAdapter::name() const { return helper()->name(); }
folly::Future<folly::Unit> KeyValueAdapter::unlink(
const folly::fbstring &fileId, const size_t currentSize)
{
LOG_FCALL() << LOG_FARG(fileId);
if (helper()->storagePathType() == StoragePathType::FLAT &&
currentSize == 0)
return folly::makeFuture();
// In case files on this storage are stored in single objects
// simply remove the object
if (helper()->storagePathType() == StoragePathType::CANONICAL) {
return folly::via(m_executor.get(), [fileId, helper = m_helper] {
helper->getObjectInfo(fileId);
helper->deleteObject(fileId);
});
}
// Calculate the list of objects into which the file has been
// split on the storage
folly::fbvector<folly::fbstring> keysToDelete;
for (size_t objectId = 0; objectId <= (currentSize / m_blockSize);
objectId++) {
keysToDelete.emplace_back(m_helper->getKey(fileId, objectId));
}
// In case the storage supports batch delete (in a single request)
// use it, otherwise schedule deletions of each object individually
// in asynchronous requests
if (m_helper->supportsBatchDelete()) {
return folly::via(m_executor.get(),
[keysToDelete = std::move(keysToDelete), helper = m_helper] {
helper->deleteObjects(keysToDelete);
});
}
auto futs = folly::window(
keysToDelete,
[helper = m_helper](const auto &keyToDelete) {
helper->deleteObject(keyToDelete);
return folly::makeFuture();
},
MAX_ASYNC_DELETE_OBJECTS);
return folly::collectAll(futs.begin(), futs.end())
.via(m_executor.get())
.thenValue([](std::vector<folly::Try<folly::Unit>> &&res) {
std::for_each(res.begin(), res.end(),
[](const auto &v) { v.throwIfFailed(); });
return folly::makeFuture();
});
}
folly::Future<folly::Unit> KeyValueAdapter::mknod(const folly::fbstring &fileId,
const mode_t mode, const FlagsSet &flags, const dev_t /*rdev*/)
{
LOG_FCALL() << LOG_FARG(fileId) << LOG_FARG(mode);
if (helper()->storagePathType() == StoragePathType::FLAT) {
return folly::makeFuture();
}
if (!S_ISREG(flagsToMask(flags))) {
LOG(ERROR)
<< "Ignoring mknod request for " << fileId << " with flags "
<< flagsToMask(flags)
<< " - only regular files can be created on object storages.";
return folly::makeFuture();
}
return folly::via(
m_executor.get(), [fileId, helper = m_helper, locks = m_locks] {
// This try-catch is necessary in order to return EEXIST error
// in case the object `fileId` already exists on the storage
try {
helper->getObjectInfo(fileId);
}
catch (const std::system_error &e) {
if (e.code().value() == ENOENT) {
Locks::accessor acc;
locks->insert(acc, fileId);
auto g =
folly::makeGuard([&]() mutable { locks->erase(acc); });
helper->putObject(fileId,
folly::IOBufQueue{
folly::IOBufQueue::cacheChainLength()});
return folly::makeFuture();
}
throw e;
}
throw one::helpers::makePosixException(EEXIST);
});
}
folly::Future<folly::Unit> KeyValueAdapter::truncate(
const folly::fbstring &fileId, const off_t size, const size_t currentSize)
{
LOG_FCALL() << LOG_FARG(fileId) << LOG_FARG(size);
if (static_cast<size_t>(size) == currentSize)
return folly::makeFuture();
// In case files on this storage are stored in single objects
// simply remove the object
if (helper()->storagePathType() == StoragePathType::CANONICAL) {
return folly::via(m_executor.get(),
[fileId, size, currentSize, helper = m_helper, locks = m_locks] {
Locks::accessor acc;
locks->insert(acc, fileId);
auto g = folly::makeGuard([&]() mutable { locks->erase(acc); });
auto attr = helper->getObjectInfo(fileId);
if (currentSize != static_cast<std::size_t>(attr.st_size)) {
LOG(WARNING) << "Current size in metadata of '" << fileId
<< "' is different than actual storage size ("
<< currentSize << "!=" << attr.st_size << ")";
}
if (size > attr.st_size) {
auto buf = fillToSize(
helper->getObject(fileId, 0, attr.st_size), size);
helper->putObject(fileId, std::move(buf));
}
else if (size < attr.st_size) {
if (size == 0) {
helper->putObject(fileId,
folly::IOBufQueue{
folly::IOBufQueue::cacheChainLength()});
}
else {
auto buf = helper->getObject(fileId, 0, size);
helper->putObject(fileId, std::move(buf));
}
}
});
}
auto currentLastBlockId = getBlockId(currentSize, m_blockSize);
auto newLastBlockId = getBlockId(size, m_blockSize);
auto newLastBlockOffset = getBlockOffset(size, m_blockSize);
// Generate a list of objects to delete
folly::fbvector<folly::fbstring> keysToDelete;
for (size_t objectId = 0; objectId <= currentLastBlockId; objectId++) {
if ((objectId > newLastBlockId) ||
((objectId == newLastBlockId) && (newLastBlockOffset == 0))) {
keysToDelete.emplace_back(m_helper->getKey(fileId, objectId));
}
}
auto key = m_helper->getKey(fileId, newLastBlockId);
auto remainderBlockSize = static_cast<std::size_t>(newLastBlockOffset);
if (remainderBlockSize == 0 && newLastBlockId > 0) {
key = m_helper->getKey(fileId, newLastBlockId - 1);
remainderBlockSize = m_blockSize;
}
return folly::via(m_executor.get(),
[fileId, remainderBlockSize, newLastBlockId, key, helper = m_helper,
locks = m_locks] {
if (remainderBlockSize > 0 || newLastBlockId > 0) {
Locks::accessor acc;
locks->insert(acc, key);
auto g = folly::makeGuard([&]() mutable { locks->erase(acc); });
try {
auto buf = fillToSize(
readBlock(helper, key, 0, remainderBlockSize),
remainderBlockSize);
helper->putObject(key, std::move(buf));
}
catch (...) {
LOG(ERROR) << "Truncate failed due to unknown "
"error during "
"'fillToSize'";
throw;
}
}
})
.thenValue([keysToDelete = std::move(keysToDelete), helper = m_helper,
executor = m_executor](auto && /*unit*/) {
if (keysToDelete.empty())
return folly::makeFuture();
if (helper->supportsBatchDelete()) {
helper->deleteObjects(keysToDelete);
return folly::makeFuture();
}
auto futs = folly::window(
keysToDelete,
[helper](const auto &keyToDelete) {
helper->deleteObject(keyToDelete);
return folly::makeFuture();
},
MAX_ASYNC_DELETE_OBJECTS);
return folly::collectAll(futs.begin(), futs.end())
.via(executor.get())
.thenValue([](std::vector<folly::Try<folly::Unit>> &&res) {
std::for_each(res.begin(), res.end(),
[](const auto &v) { v.throwIfFailed(); });
return folly::makeFuture();
});
});
}
folly::Future<struct stat> KeyValueAdapter::getattr(
const folly::fbstring &fileId)
{
LOG_FCALL() << LOG_FARG(fileId);
return folly::makeFuture()
.via(m_executor.get())
.thenValue(
[fileId, helper = m_helper, locks = m_locks](
auto && /*unit*/) { return helper->getObjectInfo(fileId); });
}
folly::Future<folly::Unit> KeyValueAdapter::access(
const folly::fbstring &fileId, const int /*mask*/)
{
LOG_FCALL() << LOG_FARG(fileId);
return getattr(fileId).thenValue(
[](auto && /*unit*/) { return folly::makeFuture(); });
}
folly::Future<folly::Unit> KeyValueAdapter::multipartCopy(
const folly::fbstring &sourceKey, const folly::fbstring &destinationKey,
const std::size_t blockSize, const std::size_t size)
{
return folly::makeFuture()
.via(m_executor.get())
.thenValue([sourceKey, destinationKey, blockSize, size,
helper = m_helper, locks = m_locks](auto && /*unit*/) {
return helper->multipartCopy(
sourceKey, destinationKey, blockSize, size);
});
}
folly::Future<ListObjectsResult> KeyValueAdapter::listobjects(
const folly::fbstring &prefix, const folly::fbstring &marker,
const off_t offset, const size_t count)
{
LOG_FCALL() << LOG_FARG(prefix) << LOG_FARG(marker) << LOG_FARG(offset)
<< LOG_FARG(count);
return folly::makeFuture()
.via(m_executor.get())
.thenValue([prefix, marker, offset, count, helper = m_helper,
locks = m_locks](auto && /*unit*/) {
return helper->listObjects(prefix, marker, offset, count);
});
}
const Timeout &KeyValueAdapter::timeout()
{
LOG_FCALL();
return m_helper->timeout();
}
StoragePathType KeyValueAdapter::storagePathType() const
{
return m_helper->storagePathType();
}
folly::Future<folly::IOBufQueue> KeyValueFileHandle::readBlocks(
const off_t offset, const std::size_t requestedSize,
const std::size_t storageBlockSize)
{
LOG_FCALL() << LOG_FARG(offset) << LOG_FARG(requestedSize);
const auto size = requestedSize;
if (size == 0)
return folly::makeFuture(
folly::IOBufQueue{folly::IOBufQueue::cacheChainLength()});
folly::fbvector<folly::Future<folly::IOBufQueue>> readFutures;
auto blockId = getBlockId(offset, storageBlockSize);
auto blockOffset = getBlockOffset(offset, storageBlockSize);
for (std::size_t bufOffset = 0; bufOffset < size;
blockOffset = 0, ++blockId) {
const auto blockSize =
std::min(static_cast<std::size_t>(storageBlockSize - blockOffset),
static_cast<std::size_t>(size - bufOffset));
auto readFuture =
folly::makeFuture()
.via(m_executor.get())
.thenValue([blockId, blockOffset, blockSize,
self = shared_from_this()](auto && /*unit*/) {
return fillToSize(
self->readBlock(blockId, blockOffset, blockSize),
blockSize);
});
readFutures.emplace_back(std::move(readFuture));
bufOffset += blockSize;
}
return folly::collect(readFutures)
.via(m_executor.get())
.thenValue([](std::vector<folly::IOBufQueue> &&results) {
folly::IOBufQueue buf{folly::IOBufQueue::cacheChainLength()};
for (auto &subBuf : results)
buf.append(std::move(subBuf));
return buf;
})
.thenTry([](folly::Try<folly::IOBufQueue> &&t) {
try {
return std::move(t.value());
}
catch (const std::system_error &e) {
logError("read", e);
throw;
}
});
}
folly::IOBufQueue KeyValueFileHandle::readBlock(
const uint64_t blockId, const off_t blockOffset, const std::size_t size)
{
LOG_FCALL() << LOG_FARG(blockId) << LOG_FARG(blockOffset) << LOG_FARG(size);
auto helper =
std::dynamic_pointer_cast<KeyValueAdapter>(this->helper())->helper();
auto key = helper->getKey(fileId(), blockId);
Locks::accessor acc;
m_locks->insert(acc, key);
auto g = folly::makeGuard([&]() mutable { m_locks->erase(acc); });
using one::logging::log_timer;
using one::logging::csv::log;
using one::logging::csv::read_write_perf;
log_timer<> timer;
auto ret = ::readBlock(helper, key, blockOffset, size);
log<read_write_perf>(key.toStdString(), "KeyValueFileHandle", "read",
blockOffset, size, timer.stop());
return ret;
}
void KeyValueFileHandle::writeBlock(
folly::IOBufQueue buf, const uint64_t blockId, const off_t blockOffset)
{
LOG_FCALL() << LOG_FARG(buf.chainLength()) << LOG_FARG(blockId)
<< LOG_FARG(blockOffset);
auto helper =
std::dynamic_pointer_cast<KeyValueAdapter>(this->helper())->helper();
auto key = helper->getKey(fileId(), blockId);
Locks::accessor acc;
m_locks->insert(acc, key);
auto g = folly::makeGuard([&]() mutable { m_locks->erase(acc); });
if (buf.chainLength() != m_blockSize) {
if (helper->hasRandomAccess()) {
helper->putObject(key, std::move(buf), blockOffset);
}
else {
auto fetchedBuf = ::readBlock(helper, key, 0, m_blockSize);
folly::IOBufQueue filledBuf{folly::IOBufQueue::cacheChainLength()};
if (blockOffset > 0) {
if (!fetchedBuf.empty())
filledBuf.append(fetchedBuf.front()->clone());
if (filledBuf.chainLength() >=
static_cast<std::size_t>(blockOffset))
filledBuf.trimEnd(filledBuf.chainLength() - blockOffset);
filledBuf = fillToSize(std::move(filledBuf),
static_cast<std::size_t>(blockOffset));
}
filledBuf.append(std::move(buf));
if (filledBuf.chainLength() < fetchedBuf.chainLength()) {
fetchedBuf.trimStart(filledBuf.chainLength());
filledBuf.append(std::move(fetchedBuf));
}
using one::logging::log_timer;
using one::logging::csv::log;
using one::logging::csv::read_write_perf;
log_timer<> timer;
auto filledSize = filledBuf.chainLength();
helper->putObject(key, std::move(filledBuf));
log<read_write_perf>(key.toStdString(), "KeyValueFileHandle",
"write", blockOffset, filledSize, timer.stop());
}
}
else {
using one::logging::log_timer;
using one::logging::csv::log;
using one::logging::csv::read_write_perf;
log_timer<> timer;
auto size = buf.chainLength();
helper->putObject(key, std::move(buf));
log<read_write_perf>(key.toStdString(), "KeyValueFileHandle", "write",
blockOffset, size);
}
}
folly::Future<folly::Unit> KeyValueAdapter::fillMissingFileBlocks(
const folly::fbstring &fileId, std::size_t size)
{
size_t blockId = 0;
std::vector<folly::Future<std::size_t>> futs;
bool lastPart = false;
while (blockId * m_blockSize < size) {
if ((blockId + 1) * m_blockSize >= size)
lastPart = true;
auto key = helper()->getKey(fileId, blockId);
auto fut =
getattr(key)
.thenValue([this, helper = helper(), lastPart, key](
auto &&attr) -> std::size_t {
if (!lastPart &&
(static_cast<std::size_t>(attr.st_size) <
m_blockSize)) {
return helper->putObject(key,
fillToSize(helper->getObject(key, 0, attr.st_size),
m_blockSize));
}
return 0;
})
.thenError(folly::tag_t<std::system_error>{},
[this, key](auto && /*e*/) {
LOG_DBG(2) << "Creating empty null block: " << key;
return helper()->putObject(key,
fillToSize(
folly::IOBufQueue{
folly::IOBufQueue::cacheChainLength()},
m_blockSize));
});
futs.emplace_back(std::move(fut));
blockId++;
}
return folly::collectAll(futs.begin(), futs.end())
.via(m_executor.get())
.thenValue([](std::vector<folly::Try<std::size_t>> &&res) {
std::for_each(res.begin(), res.end(),
[](const auto &v) { v.throwIfFailed(); });
return folly::makeFuture();
});
}
folly::Future<FileHandlePtr> KeyValueAdapter::open(
const folly::fbstring &fileId, const int /*flags*/,
const Params &openParams)
{
LOG_FCALL() << LOG_FARG(fileId) << LOG_FARGM(openParams);
FileHandlePtr handle = std::make_shared<KeyValueFileHandle>(
fileId, shared_from_this(), m_blockSize, m_locks, m_executor);
return folly::makeFuture(std::move(handle));
}
std::vector<folly::fbstring> KeyValueAdapter::handleOverridableParams() const
{
return m_helper->getHandleOverridableParams();
}
} // namespace helpers
} // namespace one
| 35.132911 | 80 | 0.56044 | onedata |
124133c752dc2371e7834c838c208addfba365f8 | 261 | hpp | C++ | include/jln/mp/smp/list/pop_back.hpp | jonathanpoelen/jln.mp | e5f05fc4467f14ac0047e3bdc75a04076e689985 | [
"MIT"
] | 9 | 2020-07-04T16:46:13.000Z | 2022-01-09T21:59:31.000Z | include/jln/mp/smp/list/pop_back.hpp | jonathanpoelen/jln.mp | e5f05fc4467f14ac0047e3bdc75a04076e689985 | [
"MIT"
] | null | null | null | include/jln/mp/smp/list/pop_back.hpp | jonathanpoelen/jln.mp | e5f05fc4467f14ac0047e3bdc75a04076e689985 | [
"MIT"
] | 1 | 2021-05-23T13:37:40.000Z | 2021-05-23T13:37:40.000Z | #pragma once
#include <jln/mp/smp/algorithm/rotate.hpp>
#include <jln/mp/smp/list/pop_front.hpp>
#include <jln/mp/list/pop_back.hpp>
namespace jln::mp::smp
{
template<class C = listify>
using pop_back = mp::detail::sfinae<mp::pop_back<subcontract<C>>>;
}
| 21.75 | 68 | 0.720307 | jonathanpoelen |
12426a8c585cd8a92ef063b1da53b83438d479e2 | 2,381 | hpp | C++ | libs/core/include/core/byte_array/byte_array.hpp | AronVanAmmers/ledger | 5cf8b85e5ee42957d9d38fd76b2b3ead0f061954 | [
"Apache-2.0"
] | 1 | 2019-05-15T17:23:08.000Z | 2019-05-15T17:23:08.000Z | libs/core/include/core/byte_array/byte_array.hpp | AronVanAmmers/ledger | 5cf8b85e5ee42957d9d38fd76b2b3ead0f061954 | [
"Apache-2.0"
] | null | null | null | libs/core/include/core/byte_array/byte_array.hpp | AronVanAmmers/ledger | 5cf8b85e5ee42957d9d38fd76b2b3ead0f061954 | [
"Apache-2.0"
] | null | null | null | #pragma once
//------------------------------------------------------------------------------
//
// Copyright 2018 Fetch.AI Limited
//
// 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 "core/byte_array/const_byte_array.hpp"
#include <algorithm>
#include <cassert>
#include <iostream>
#include <ostream>
#include <type_traits>
namespace fetch {
namespace byte_array {
class ByteArray : public ConstByteArray
{
public:
using super_type = ConstByteArray;
ByteArray() = default;
ByteArray(char const *str) : super_type(str) {}
ByteArray(std::string const &s) : super_type(s) {}
ByteArray(ByteArray const &other) = default;
ByteArray(std::initializer_list<container_type> l) : super_type(l) {}
ByteArray(ByteArray const &other, std::size_t const &start, std::size_t const &length)
: super_type(other, start, length)
{}
ByteArray(super_type const &other) : super_type(other) {}
ByteArray(super_type const &other, std::size_t const &start, std::size_t const &length)
: super_type(other, start, length)
{}
container_type & operator[](std::size_t const &n) { return super_type::operator[](n); }
container_type const &operator[](std::size_t const &n) const { return super_type::operator[](n); }
using super_type::Resize;
using super_type::Reserve;
using super_type::operator+;
using super_type::pointer;
using super_type::char_pointer;
};
inline std::ostream &operator<<(std::ostream &os, ByteArray const &str)
{
char const *arr = reinterpret_cast<char const *>(str.pointer());
for (std::size_t i = 0; i < str.size(); ++i) os << arr[i];
return os;
}
inline ByteArray operator+(char const *a, ByteArray const &b)
{
ByteArray s(a);
s = s + b;
return s;
}
} // namespace byte_array
} // namespace fetch
| 31.746667 | 100 | 0.657287 | AronVanAmmers |
124383bd389c07d18bf9868d51eac2e47b98fdfc | 27,867 | cpp | C++ | src/UnivManip.cpp | lhamot/DroneWars | 6f457064395c61e37b8f2c162b7bec64ed6f277b | [
"BSL-1.0"
] | null | null | null | src/UnivManip.cpp | lhamot/DroneWars | 6f457064395c61e37b8f2c162b7bec64ed6f277b | [
"BSL-1.0"
] | null | null | null | src/UnivManip.cpp | lhamot/DroneWars | 6f457064395c61e37b8f2c162b7bec64ed6f277b | [
"BSL-1.0"
] | null | null | null | //
// Copyright (c) 2018 Loïc HAMOT
//
// 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 "stdafx.h"
#include <boost/range/numeric.hpp>
#include <boost/range/algorithm/transform.hpp>
#include <boost/format.hpp>
#include <boost/bind.hpp>
#pragma warning(push)
#pragma warning(disable: 4310 4100 4244 4458 4456 4706 4702)
#include <boost/archive/binary_iarchive.hpp>
#include "portable_binary_oarchive.hpp"
#include "portable_binary_iarchive.hpp"
#include <boost/property_tree/ptree_serialization.hpp>
#include <boost/locale.hpp>
#include <boost/serialization/boost_array.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/set.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/variant.hpp>
#include <boost/serialization/utility.hpp>
#include <boost/serialization/optional.hpp>
#include <boost/serialization/unordered_map.hpp>
#include <boost/serialization/split_free.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/combine.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/copy.hpp>
#pragma warning(pop)
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include "UnivManip.h"
#include "Tools.h"
#include "Rules.h"
#include "NameGen.h"
#include "DataBase.h"
#include "Skills.h"
BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian)
using namespace std;
using namespace boost;
namespace BL = boost::locale;
//! Retourne le prix d'un Building donné, à un niveau donné
//! @pre id est dans [0: Building::Count[
//! @pre level > 0
boost::optional<RessourceSet> getBuilingPrice(Building::Enum id, size_t level)
{
if(id < 0 || id >= Building::Count)
BOOST_THROW_EXCEPTION(
std::out_of_range("Expect a building id in the range [0: Building::Count["));
if(level < 1)
BOOST_THROW_EXCEPTION(
std::out_of_range("Expect a level greater than 1"));
Building const& building = Building::List[id];
double const coef = std::pow(building.coef, level - 1.) * 1000.;
RessourceSet result = building.price;
static double const maxVal = std::numeric_limits<Ressource::Value>::max();
for(auto& val : result.tab)
{
double val2 = (double(val) * coef);
if(val2 > maxVal)
return boost::none;
val = NUMERIC_CAST(Ressource::Value, val2);
}
for(auto& val : result.tab)
val /= 1000;
return result;
}
//! Recupère les script pour un nouveau joueur
//! @param codes [out] planète_lua, planète_blockly, flotte_lua, flotte_blockly
void getNewPlayerCode(std::vector<std::string>& codes)
{
std::vector<std::string> result;
//Ajout du code du joueur (Planet)
{
std::stringstream blocklyPlanetDefaultCode;
{
std::ifstream planetFile("blocklyPlanetDefaultCode.xml",
std::ios::binary | std::ios::in);
if(planetFile.is_open() == false)
BOOST_THROW_EXCEPTION(
std::ios::failure("Cant open blocklyPlanetDefaultCode.xml"));
boost::iostreams::copy(planetFile, blocklyPlanetDefaultCode);
}
std::string const blocklyCode =
(boost::format(blocklyPlanetDefaultCode.str()) %
BL::gettext("my_planet") %
BL::gettext("fleets") %
BL::gettext("order") %
BL::gettext("PLANET_ACTION_CODE_COMMENT")).str();
std::string const code =
"function AI(planet, fleets)\n"
" return noPlanetAction()\n"
"end";
result.push_back(code);
result.push_back(blocklyCode);
}
//Ajout du code du joueur (Fleet)
{
std::stringstream blocklyFleetDefaultCode;
{
std::ifstream fleetFile("blocklyFleetDefaultCode.xml",
std::ios::binary | std::ios::in);
if(fleetFile.is_open() == false)
BOOST_THROW_EXCEPTION(
std::ios::failure("Can't open blocklyFleetDefaultCode.xml"));
boost::iostreams::copy(fleetFile, blocklyFleetDefaultCode);
}
std::string const blocklyCode =
(boost::format(blocklyFleetDefaultCode.str()) %
BL::gettext("my_fleet") %
BL::gettext("otherFleet") %
BL::gettext("local_planet") %
BL::gettext("order") %
BL::gettext("DO_GATHER_CODE_COMMENT") %
BL::gettext("DO_FIGHT_CODE_COMMENT") %
BL::gettext("FLEET_ACTION_CODE_COMMENT") %
BL::gettext("myself_player") %
BL::gettext("other_player")).str();
std::string const code =
"function AI_do_gather(myFleet, otherFleet)\n"
" return true\n"
"end\n"
"function AI_do_fight(myFleet, fighter)\n"
" return true\n"
"end\n"
"function AI_action(myFleet, planet)\n"
" order = FleetAction(FleetAction.Nothing, Direction())\n"
" return order\n"
"end\n"
"function AI_do_escape(ma_flotte, planete_locale, autres_flottes)\n"
" return simulates(ma_flotte, planete_locale, autres_flottes) < 50\n"
"end";
result.push_back(code);
result.push_back(blocklyCode);
}
result.swap(codes);
}
//! @brief Donne une planète a un nouveau joueur
//! @return la coordonée de la nouvelle planète
Coord createMainPlanet(Universe& univ, Player::ID pid)
{
bool done = false;
Coord mainPlanetCoord;
do
{
size_t const planetNumber = rand() % univ.planetMap.size();
auto planetIter = univ.planetMap.begin();
std::advance(planetIter, planetNumber);
Planet& planet = planetIter->second;
if(planet.playerId == Player::NoId)
{
planet.playerId = pid;
if(planet.playerId > 100000)
BOOST_THROW_EXCEPTION(
std::logic_error("planet.playerId > 100000"));
mainPlanetCoord = planet.coord;
planet.buildingList[Building::CommandCenter] = 1;
planet.ressourceSet = RessourceSet(4000, 400, 0);
done = true;
}
}
while(done == false);
return mainPlanetCoord;
}
//! Construit l'Universe et la base de donnée SQL, au premier lancement
//!
//! Si des joueurs sont présent dans la base ils seront conservés mais reinisialisés
void construct(Universe& univ, DataBase& database)
{
univ.roundCount = 0;
// Creation des planetes
std::set<Coord, CompCoord> coordSet;
for(int i = 0; i < 100000; ++i)
{
Coord coord(rand() % Universe::MapSizeX,
rand() % Universe::MapSizeY,
rand() % Universe::MapSizeZ);
RessourceSet ress(rand() % 1000,
rand() % 500,
rand() % 200);
if(false == coordSet.count(coord))
{
Planet planet(coord, 0);
planet.ressourceSet = ress;
planet.name = nameGen();
planet.parentCoord = coord;
univ.planetMap.insert(std::make_pair(coord, planet));
coordSet.insert(coord);
}
}
// Création des joueurs AI
std::string const& password = "test";
std::vector<std::string> codes;
getNewPlayerCode(codes);
for(size_t playerCount = 0; playerCount < 100;)
{
Player::ID pid = database.addPlayer(nameGen(), password, codes, true);
if(pid != Player::NoId)
{
playerCount += 1;
Player::SkillTab skillTab;
skillTab.fill(0);
skillTab[Skill::Cohesion] = rand() % 10;
skillTab[Skill::Strategy] = rand() % 10;
skillTab[Skill::Conquest] = rand() % 10;
skillTab[Skill::Escape] = rand() % 3;
database.setPlayerSkills(pid, skillTab);
}
}
auto players = database.getPlayers();
// Assignement d'une planete a chaque joueurs (AI et non AI)
for(Player const& player : players)
database.setPlayerMainPlanet(player.id,
createMainPlanet(univ, player.id));
// Chargement des codes des IA
std::string planetScript;
std::string fleetScript;
{
ifstream planetFile("planetScript.lua");
std::getline(planetFile, planetScript, char(0));
ifstream fleetFile("fleetScript.lua");
std::getline(fleetFile, fleetScript, char(0));
}
// Definition du code source de chaque joueur (AI et non AI)
for(Player const& player : players)
{
if(player.isAI)
{
database.addScript(player.id, CodeData::Planet, planetScript);
database.addScript(player.id, CodeData::Fleet, fleetScript);
}
else
{
database.addScript(player.id, CodeData::Planet, codes[0]);
database.addScript(player.id, CodeData::Fleet, codes[2]);
database.addBlocklyCode(player.id, CodeData::Planet, codes[1]);
database.addBlocklyCode(player.id, CodeData::Fleet, codes[3]);
}
}
};
//! Serialize l'Universe dans un flux
void saveToStream(Universe const& univ, std::ostream& out)
{
using namespace boost::iostreams;
filtering_ostream outFilter;
outFilter.push(gzip_compressor());
outFilter.push(out);
portable_binary_oarchive oa(outFilter);
clock_t start = clock();
oa& univ;
clock_t end = clock();
std::cout << "Saving time : " << double(end - start) / CLOCKS_PER_SEC <<
" sec" << std::endl;
}
//! @brief Déserialize l'Universe depuit un flux
void loadFromStream_v2(std::istream& in, Universe& univ)
{
using namespace boost::iostreams;
std::cout << "Loading... ";
filtering_istream inFilter;
inFilter.push(gzip_decompressor());
inFilter.push(in);
portable_binary_iarchive ia(inFilter);
ia& univ;
std::cout << "OK" << std::endl;
}
//! @brief true si un RessourceSet en contient un autre
//!
//! C'est a dire que chaque quantité de chaque type de ressource dans stock
//! est plus grand que dans price
bool canPay(RessourceSet const& stock, RessourceSet const& price)
{
for(int i = 0; i < Ressource::Count; ++i)
{
if(stock.tab[i] < price.tab[i])
return false;
}
return true;
}
//! @brief true si la planète a asser de ressource pour payer price
bool canPay(Planet const& planet, RessourceSet const& price)
{
return canPay(planet.ressourceSet, price);
}
//! @brief true si la flotte a asser de ressource pour payer price
bool canPay(Fleet const& fleet, RessourceSet const& price)
{
return canPay(fleet.ressourceSet, price);
}
//! @brief Retire à planète la quantité de ressource demandée
//! @pre La planète peut payer
void pay(Planet& planet, RessourceSet const& price)
{
if(canPay(planet, price) == false)
BOOST_THROW_EXCEPTION(std::logic_error("Can't pay"));
boost::transform(planet.ressourceSet.tab,
price.tab,
planet.ressourceSet.tab.begin(),
std::minus<Ressource::Value>());
if(planet.ressourceSet.tab[0] > 2000000000)
BOOST_THROW_EXCEPTION(std::logic_error("Strange ressources value"));
}
//! @brief Retire à flotte la quantité de ressource demandée
//! @pre La flotte peut payer
void pay(Fleet& fleet, RessourceSet const& price)
{
if(canPay(fleet, price) == false)
BOOST_THROW_EXCEPTION(std::logic_error("Can't pay"));
boost::transform(fleet.ressourceSet.tab,
price.tab,
fleet.ressourceSet.tab.begin(),
std::minus<Ressource::Value>());
if(fleet.ressourceSet.tab[0] > 2000000000)
BOOST_THROW_EXCEPTION(std::logic_error("Strange ressources value"));
}
//! Test si une planète peut fabriquer un vaisseau dans la quantité demandée
BuildTestState canBuild(Planet const& planet, Ship::Enum type)
{
if(type < 0 || type >= Ship::Count)
return BuildTestState::BadValue;
if(planet.buildingList[Building::Factory] == 0)
return BuildTestState::FactoryMissing;
if(planet.task)
return BuildTestState::OtherTaskRunning;
RessourceSet price = Ship::List[type].price;
if(canPay(planet, price) == false)
return BuildTestState::NotEnoughRessources;
size_t const hangarSize = boost::accumulate(planet.hangar, 0);
if(hangarSize)
return BuildTestState::HangarFull;
else
return BuildTestState::Ok;
}
//! Test si une planète peut upgrader un batiment
BuildTestState canBuild(Planet const& planet, Building::Enum type)
{
if(type < 0 || type >= Building::Count)
return BuildTestState::BadValue;
if(planet.buildingList[Building::CommandCenter] == 0)
return BuildTestState::CommendCenterMissing;
if(planet.task)
return BuildTestState::OtherTaskRunning;
size_t const buNextLevel = planet.buildingList[type] + 1;
boost::optional<RessourceSet> const price = getBuilingPrice(type, buNextLevel);
if(price.is_initialized())
{
if(false == canPay(planet, price.get()))
return BuildTestState::NotEnoughRessources;
else
return BuildTestState::Ok;
}
else
return BuildTestState::NotEnoughRessources;
}
//! Test si une planète peut fabriquer un canon dans la quantité demandée
BuildTestState canBuild(Planet const& planet, Cannon::Enum type)
{
if(type < 0 || type >= Cannon::Count)
return BuildTestState::BadValue;
if(planet.buildingList[Building::Factory] == 0)
return BuildTestState::FactoryMissing;
if(planet.task)
return BuildTestState::OtherTaskRunning;
RessourceSet price = Ship::List[type].price;
if(false == canPay(planet, price))
return BuildTestState::NotEnoughRessources;
else
return BuildTestState::Ok;
}
//! Ajoute une tache d'upgrade de building a la planète
//! @pre building est compris dans [0: Building::Count[
//! @pre La planète a un CommandCenter
//! @pre La planète peut payer
void addTask(Planet& planet, uint32_t roundCount, Building::Enum building)
{
size_t const buNextLevel = planet.buildingList[building] + 1;
size_t const centerLevel = planet.buildingList[Building::CommandCenter];
if(centerLevel == 0)
BOOST_THROW_EXCEPTION(
std::logic_error("Can't create Building without CommandCenter"));
double const floatDuration =
double(Building::List[building].price.tab[0]) /
(centerLevel * pow(1.15, centerLevel) * 4); //-V112
uint32_t const duration = statRound<uint32_t>(floatDuration);
PlanetTask task(PlanetTask::UpgradeBuilding, roundCount, duration);
task.value = building;
boost::optional<RessourceSet> const price = getBuilingPrice(building, buNextLevel);
if(price.is_initialized() == false)
BOOST_THROW_EXCEPTION(std::logic_error("Can't pay"));
task.startCost = price.get();
if(canPay(planet, price.get()) == false)
BOOST_THROW_EXCEPTION(std::logic_error("Can't pay"));
if(planet.task)
BOOST_THROW_EXCEPTION(std::logic_error("planet.task is full"));
planet.task = task;
pay(planet, price.get());
}
//! Ajoute une tache de fabrication de vaisseau à la planète
//! @pre ship est compris dans [0: Ship::Count[
//! @pre La planète a un Building::Factory
//! @pre La planète peut payer
void addTask(Planet& planet, uint32_t roundCount, Ship::Enum ship, uint32_t number)
{
size_t const factoryLvl = planet.buildingList[Building::Factory];
if(factoryLvl == 0)
BOOST_THROW_EXCEPTION(std::logic_error("Need Factory"));
//! @todo: Ajouter regle sur durée de fabrication dans Rules
double const floatDuration =
double(Ship::List[ship].price.tab[0]) /
(factoryLvl * pow(1.15, factoryLvl) * 4); //-V112
uint32_t const duration = statRound<uint32_t>(floatDuration);
PlanetTask task(PlanetTask::MakeShip, roundCount, duration);
task.value = ship;
task.value2 = number;
RessourceSet const& price = Ship::List[ship].price;
task.startCost = price;
if(planet.task)
BOOST_THROW_EXCEPTION(std::logic_error("planet.task is full"));
planet.task = task;
pay(planet, price);
}
//! Ajoute une tache de fabrication de canon à la planète
//! @pre cannon est compris dans [0: Cannon::Count[
//! @pre La planète a un Building::Factory
//! @pre La planète peut payer
void addTask(Planet& planet,
uint32_t roundCount,
Cannon::Enum cannon,
uint32_t number)
{
size_t const factoryLvl = planet.buildingList[Building::Factory];
if(factoryLvl == 0)
BOOST_THROW_EXCEPTION(std::logic_error("Need Factory"));
double const floatDuration =
double(Cannon::List[cannon].price.tab[0]) /
(factoryLvl * pow(1.15, factoryLvl) * 4); //-V112
uint32_t const duration = statRound<uint32_t>(floatDuration);
PlanetTask task(PlanetTask::MakeCannon, roundCount, duration);
if(cannon >= Cannon::Count)
BOOST_THROW_EXCEPTION(std::logic_error("Unconsistent cannon type"));
task.value = cannon;
task.value2 = number;
RessourceSet const& price = Cannon::List[cannon].price;
task.startCost = price;
if(planet.task)
BOOST_THROW_EXCEPTION(std::logic_error("planet.task is full"));
planet.task = task;
pay(planet, price);
}
//! @brief tTest si il y une tache d'upgrade d'un building pour arreter
//! @todo: canStop
bool canStop(
Planet const&,// planet,
Building::Enum// type
)
{
return true;
}
//! Stop une tache de cette, si la tache existe
void stopTask(Planet& planet,
PlanetTask::Enum tasktype,
Building::Enum building)
{
if(!planet.task)
return;
PlanetTask const& task = *planet.task;
if(task.type == tasktype &&
task.value == static_cast<uint32_t>(building))
planet.task.reset();
}
//! Excecute une tache sur une planète
void execTask(Universe& univ,
Planet& planet,
PlanetTask& task,
std::vector<Event>& events)
{
if((task.lauchTime + task.duration) <= univ.roundCount)
{
switch(task.type)
{
case PlanetTask::UpgradeBuilding:
if(static_cast<size_t>(task.value) >= planet.buildingList.size())
BOOST_THROW_EXCEPTION(std::logic_error("Bad building type"));
else
{
planet.buildingList[static_cast<size_t>(task.value)] += 1;
Event event(planet.playerId, time(0), Event::Upgraded);
event.setValue(task.value).setPlanetCoord(planet.coord);
events.push_back(event);
}
break;
case PlanetTask::MakeShip:
{
planet.hangar[static_cast<size_t>(task.value)] += task.value2;
Event event(planet.playerId, time(0), Event::ShipMade);
event.setValue(intptr_t(task.value)).setPlanetCoord(planet.coord);
events.push_back(event);
}
break;
case PlanetTask::MakeCannon:
if(task.value < Cannon::Count)
{
planet.cannonTab[static_cast<size_t>(task.value)] += 1;
Event event(planet.playerId, time(0), Event::CannonMade);
event.setValue(task.value).setPlanetCoord(planet.coord);
events.push_back(event);
}
break;
default:
BOOST_THROW_EXCEPTION(std::logic_error("Unknown PlanetTask"));
}
static_assert(PlanetTask::MakeCannon == (PlanetTask::Count - 1),
"Missing cases in switch");
task.expired = true;
}
}
//! Excecute une tache sur une flotte
void execTask(Universe& univ,
Player const& player,
Fleet& fleet,
FleetTask& task,
std::vector<Event>& events)
{
if((task.lauchTime + task.duration) <= univ.roundCount)
{
switch(task.type)
{
case FleetTask::Move:
fleet.coord = task.position;
break;
case FleetTask::Harvest:
{
Planet& planet = MAP_FIND(univ.planetMap, task.position)->second;
if(planet.playerId == Player::NoId)
{
addArray(fleet.ressourceSet.tab, planet.ressourceSet.tab);
planet.ressourceSet.tab.fill(0);
Event event(fleet.playerId, time(0), Event::PlanetHarvested);
event.setFleetID(fleet.id);
events.push_back(event);
}
}
break;
case FleetTask::Colonize:
{
using namespace boost;
Planet& planet = MAP_FIND(univ.planetMap, task.position)->second;
if(planet.playerId == Player::NoId && fleet.shipList[Ship::Queen])
{
if(player.planetCount < getMaxPlanetCount(player))
{
Event ev = Event(
fleet.playerId,
time(0),
Event::PlanetColonized)
.setFleetID(fleet.id)
.setPlanetCoord(planet.coord);
events.push_back(ev);
fleet.shipList[Ship::Queen] -= 1;
planet.buildingList[Building::CommandCenter] = 1;
addArray(planet.ressourceSet.tab, RessourceSet(2000, 500, 0).tab);
planet.playerId = fleet.playerId;
planet.player = fleet.player;
planet.parentCoord = fleet.origin;
planet.firstRound = univ.roundCount;
if(planet.playerId > 100000)
BOOST_THROW_EXCEPTION(
std::logic_error("planet.playerId > 100000"));
}
}
}
break;
default:
BOOST_THROW_EXCEPTION(std::logic_error("Unknown FleetTask"));
}
static_assert(FleetTask::Colonize == (FleetTask::Count - 1),
"Missing cases in switch");
task.expired = true;
}
}
//! @brief Fait le travail d'un building, en connaissant son type et son niveau
//! @todo: Remplacer par une liste de building polymorphic?
void execBuilding(Planet& planet, Building::Enum type, size_t level)
{
static size_t const speedMult = 4; //-V112
if(level == 0)
return;
switch(type)
{
case Building::CommandCenter:
cappedAdd(planet.ressourceSet.tab[Ressource::Metal], Ressource::Value(1));
break;
case Building::MetalMine:
{
size_t toAdd = level * size_t(std::pow(1.1, double(level))) * speedMult;
toAdd = min<size_t>(std::numeric_limits<Ressource::Value>::max(), toAdd);
if(toAdd > (std::numeric_limits<Ressource::Value>::max() - planet.ressourceSet.tab[Ressource::Metal]))
planet.ressourceSet.tab[Ressource::Metal] = std::numeric_limits<Ressource::Value>::max();
else
planet.ressourceSet.tab[Ressource::Metal] += static_cast<Ressource::Value>(toAdd);
}
break;
case Building::CarbonMine:
break;
case Building::LoiciumFilter:
break;
case Building::Factory:
break;
case Building::Laboratory:
break;
case Building::CarbonicCentral:
break;
case Building::SolarCentral:
break;
case Building::GeothermicCentral:
break;
default:
assert(false && "Unconsistent Building::Enum type");
};
}
//! Simule la vie de la planète durant un round
void planetRound(Player const& player,
Universe& univ,
Planet& planet,
std::vector<Event>& events)
{
if(planet.task)
execTask(univ, planet, *planet.task, events);
size_t const maxFleetCount = getMaxFleetCount(player);
if(player.fleetCount < maxFleetCount && boost::accumulate(planet.hangar, 0))
{
Fleet newFleet(univ.nextFleetID++,
planet.playerId,
planet.coord,
univ.roundCount);
newFleet.shipList.swap(planet.hangar);
newFleet.player = planet.player;
univ.fleetMap.insert(make_pair(newFleet.id, newFleet));
}
if(planet.task && planet.task->expired)
planet.task.reset();
for(size_t type = 0; type < planet.buildingList.size(); ++type)
execBuilding(planet, Building::Enum(type), planet.buildingList[type]);
//Cristalisations des ressources
if((rand() % 10) == 0) //! @todo: rand rapide
{
cappedAdd(planet.ressourceSet.tab[Ressource::Metal], Ressource::Value(rand() % 7));
cappedAdd(planet.ressourceSet.tab[Ressource::Carbon], Ressource::Value(rand() % 5));
cappedAdd(planet.ressourceSet.tab[Ressource::Loicium], Ressource::Value(rand() % 3));
}
//Limitation des ressources à un milliard
for(auto& val : planet.ressourceSet.tab)
val = std::min(val, Ressource::Value(1000000000));
}
//! Simule la vie de la flotte durant un round
void fleetRound(Universe& univ,
Player const& player,
Fleet& fleet,
std::vector<Event>& events)
{
if(fleet.task)
execTask(univ, player, fleet, *fleet.task, events);
if(fleet.task && fleet.task->expired)
fleet.task.reset();
//Limitation des ressources à un milliard
for(auto& val : fleet.ressourceSet.tab)
val = std::min(val, Ressource::Value(1000000000));
}
//! Ajoute otherFleet dans fleet
void gather(Fleet& fleet, Fleet const& otherFleet)
{
addArray(fleet.ressourceSet.tab, otherFleet.ressourceSet.tab);
addArray(fleet.shipList, otherFleet.shipList);
}
//! Test si une flotte peut se rendre a la destination coord
FleetActionTest canMove(Fleet const& fleet,
Coord const& coord //Destination en valeur absolue
)
{
if(fleet.task)
return FleetActionTest::OtherTaskRunning;
if(abs(fleet.coord.X - coord.X) > 1 ||
abs(fleet.coord.Y - coord.Y) > 1 ||
abs(fleet.coord.Z - coord.Z) > 1)
return FleetActionTest::TooFarAway;
if(coord.X < 0 || coord.X >= Universe::MapSizeX ||
coord.Y < 0 || coord.Y >= Universe::MapSizeY ||
coord.Z < 0 || coord.Z >= Universe::MapSizeZ)
return FleetActionTest::OutOfGalaxy;
//! @todo: Gestion du caburant
return FleetActionTest::Ok;
}
//! Ajoute une tache de déplacement dans la flotte
//! @pre la flotte peut se rendre a cet coordonée (canMove)
void addTaskMove(Fleet& fleet, uint32_t roundCount, Coord const& coord)
{
if(fleet.task)
BOOST_THROW_EXCEPTION(std::logic_error("fleet.task is not NULL!"));
FleetTask task(FleetTask::Move, roundCount, 1);
task.position = coord;
fleet.task = task;
}
//! Test si la flotte peut récolter la planète
FleetActionTest canHarvest(Fleet const& fleet, Planet const* planet)
{
if(fleet.task)
return FleetActionTest::OtherTaskRunning;
else if(planet == nullptr)
return FleetActionTest::NoPlanet;
else if(planet->playerId)
return FleetActionTest::PlanetHasOwner;
else
return FleetActionTest::Ok;
}
//! Ajoute une tache de récolte dans la flotte
//! @pre la flotte peut récolter la planète (canHarvest)
void addTaskHarvest(Fleet& fleet, uint32_t roundCount, Planet const& planet)
{
if(fleet.task)
BOOST_THROW_EXCEPTION(std::logic_error("fleet.task is not NULL!"));
FleetTask task(FleetTask::Harvest, roundCount, 1);
task.position = planet.coord;
fleet.task = task;
}
//! Test si la flotte peut colonizer la planète
FleetActionTest canColonize(Player const& player,
Fleet const& fleet,
Planet const* planet,
size_t planetCount)
{
if(fleet.task)
return FleetActionTest::OtherTaskRunning;
else if(planet == nullptr)
return FleetActionTest::NoPlanet;
else if(planet->playerId != Player::NoId)
return FleetActionTest::PlanetHasOwner;
else if(fleet.shipList[Ship::Queen] == 0)
return FleetActionTest::QueenMissing;
return InternalRules::canColonize(player, fleet, *planet, planetCount);
}
//! Ajoute une tache de récolte dans la flotte
//! @pre la flotte peut colonizer la planète (canColonize)
void addTaskColonize(Fleet& fleet, uint32_t roundCount, Planet const& planet)
{
if(fleet.task)
BOOST_THROW_EXCEPTION(std::logic_error("fleet.task is not NULL!"));
FleetTask task(FleetTask::Colonize, roundCount, 1);
task.position = planet.coord;
fleet.task = task;
}
//! Test si la flotte peut balancer ses ressources sur la planète
FleetActionTest canDrop(Fleet const& fleet, Planet const* planet)
{
if(planet == nullptr)
return FleetActionTest::NoPlanet;
Ressource::Value const ressCount = boost::accumulate(fleet.ressourceSet.tab, 0);
if(planet->playerId != fleet.playerId)
return FleetActionTest::NotYourOwnPlanet;
else if(ressCount == 0)
return FleetActionTest::NotEnoughRessources;
else
return FleetActionTest::Ok;
}
//! La flotte balance ses ressources sur la planète
//! @pre la flotte peut balancer ses ressources sur la planète (canDrop)
void drop(Fleet& fleet, Planet& planet)
{
addArray(planet.ressourceSet.tab, fleet.ressourceSet.tab);
fleet.ressourceSet.tab.fill(0);
}
FleetActionTest canGather(
Player const& player,
Fleet const& fleet1,
Fleet const& fleet2)
{
return InternalRules::canGather(player, fleet1, fleet2);
}
//! test si la flotte est vide
bool emptyFleet(Fleet const& fleet)
{
return boost::accumulate(fleet.shipList, 0) == 0;
}
| 31.136313 | 105 | 0.676212 | lhamot |
12448aa38ba21c252984b54eff71d070c47e58b7 | 10,983 | cc | C++ | third_party/nucleus/io/bed_reader.cc | ruif2009/deepvariant | c7fd07016577c253f81ef253aed65c416e4c0ef7 | [
"BSD-3-Clause"
] | null | null | null | third_party/nucleus/io/bed_reader.cc | ruif2009/deepvariant | c7fd07016577c253f81ef253aed65c416e4c0ef7 | [
"BSD-3-Clause"
] | null | null | null | third_party/nucleus/io/bed_reader.cc | ruif2009/deepvariant | c7fd07016577c253f81ef253aed65c416e4c0ef7 | [
"BSD-3-Clause"
] | 1 | 2022-02-03T21:54:57.000Z | 2022-02-03T21:54:57.000Z | /*
* Copyright 2018 Google Inc.
*
* 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.
*/
// Implementation of bed_reader.h
#include "third_party/nucleus/io/bed_reader.h"
#include "absl/strings/str_split.h"
#include "third_party/nucleus/protos/bed.pb.h"
#include "third_party/nucleus/util/utils.h"
#include "third_party/nucleus/vendor/zlib_compression_options.h"
#include "third_party/nucleus/vendor/zlib_inputstream.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/io/buffered_inputstream.h"
#include "tensorflow/core/lib/io/compression.h"
#include "tensorflow/core/lib/io/random_inputstream.h"
#include "tensorflow/core/lib/strings/numbers.h"
#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/file_system.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/types.h"
namespace nucleus {
namespace tf = tensorflow;
using tensorflow::int32;
using tensorflow::int64;
using tensorflow::string;
// 256 KB read buffer.
constexpr int READER_BUFFER_SIZE = 256 * 1024;
// BED-specific attributes.
constexpr char BED_COMMENT_CHAR = '#';
// -----------------------------------------------------------------------------
//
// Reader for BED format data.
//
// -----------------------------------------------------------------------------
namespace {
bool ValidNumBedFields(const int fields) {
return (fields == 3 || fields == 4 || fields == 5 || fields == 6 ||
fields == 8 || fields == 9 || fields == 12);
}
// Read the next non-comment line.
tf::Status NextNonCommentLine(
const std::unique_ptr<tf::io::BufferedInputStream>& instream,
string* line) {
TF_RETURN_IF_ERROR(instream->ReadLine(line));
while ((*line)[0] == BED_COMMENT_CHAR) {
TF_RETURN_IF_ERROR(instream->ReadLine(line));
}
return tf::Status::OK();
}
tf::Status ConvertToPb(const string& line, const int desiredNumFields,
int* numTokensSeen,
nucleus::genomics::v1::BedRecord* record) {
CHECK(record != nullptr) << "BED record cannot be null";
record->Clear();
std::vector<string> tokens = absl::StrSplit(line, '\t');
int numTokens = static_cast<int>(tokens.size());
*numTokensSeen = numTokens;
if (!ValidNumBedFields(numTokens)) {
return tf::errors::Unknown("BED record has invalid number of fields");
}
int numFields =
desiredNumFields == 0 ? numTokens : std::min(numTokens, desiredNumFields);
int64 int64Value;
record->set_reference_name(tokens[0]);
tf::strings::safe_strto64(tokens[1], &int64Value);
record->set_start(int64Value);
tf::strings::safe_strto64(tokens[2], &int64Value);
record->set_end(int64Value);
if (numFields > 3) record->set_name(tokens[3]);
if (numFields > 4) {
double value;
tf::strings::safe_strtod(tokens[4].c_str(), &value);
record->set_score(value);
}
if (numFields > 5) {
if (tokens[5] == "+")
record->set_strand(nucleus::genomics::v1::BedRecord::FORWARD_STRAND);
else if (tokens[5] == "-")
record->set_strand(nucleus::genomics::v1::BedRecord::REVERSE_STRAND);
else if (tokens[5] == ".")
record->set_strand(nucleus::genomics::v1::BedRecord::NO_STRAND);
else
return tf::errors::Unknown("Invalid BED record with unknown strand");
}
if (numFields > 7) {
tf::strings::safe_strto64(tokens[6], &int64Value);
record->set_thick_start(int64Value);
tf::strings::safe_strto64(tokens[7], &int64Value);
record->set_thick_end(int64Value);
}
if (numFields > 8) record->set_item_rgb(tokens[8]);
if (numFields >= 12) {
int32 int32Value;
tf::strings::safe_strto32(tokens[9], &int32Value);
record->set_block_count(int32Value);
record->set_block_sizes(tokens[10]);
record->set_block_starts(tokens[11]);
}
return tf::Status::OK();
}
// Peeks into the path to the first BED record and returns the number of fields
// in the record.
// NOTE: This is quite heavyweight. Reading upon initialization and then
// rewinding the stream to 0 is a nicer solution, but currently has a memory
// leak in the compressed stream reset implementation.
tf::Status GetNumFields(const string& path, bool isCompressed, int* numFields) {
std::unique_ptr<tensorflow::RandomAccessFile> sp;
tf::Status status =
tf::Env::Default()->NewRandomAccessFile(path.c_str(), &sp);
if (!status.ok()) {
return tf::errors::NotFound(tf::strings::StrCat("Could not open ", path));
}
tensorflow::RandomAccessFile* fp = sp.release();
std::unique_ptr<tensorflow::io::BufferedInputStream> bi;
string line;
if (isCompressed) {
std::unique_ptr<tensorflow::io::RandomAccessInputStream> fs;
std::unique_ptr<tensorflow::io::ZlibInputStream> zs;
fs.reset(new tf::io::RandomAccessInputStream(fp));
zs.reset(new tf::io::ZlibInputStream(
fs.get(), READER_BUFFER_SIZE, READER_BUFFER_SIZE,
tf::io::ZlibCompressionOptions::GZIP()));
bi.reset(new tf::io::BufferedInputStream(zs.get(), READER_BUFFER_SIZE));
TF_RETURN_IF_ERROR(NextNonCommentLine(bi, &line));
bi.reset();
zs.reset();
fs.reset();
} else {
bi.reset(new tf::io::BufferedInputStream(fp, READER_BUFFER_SIZE));
TF_RETURN_IF_ERROR(NextNonCommentLine(bi, &line));
bi.reset();
}
delete fp;
std::vector<string> tokens = absl::StrSplit(line, '\t');
*numFields = static_cast<int>(tokens.size());
return tf::Status::OK();
}
} // namespace
// Iterable class for traversing all BED records in the file.
class BedFullFileIterable : public BedIterable {
public:
// Advance to the next record.
StatusOr<bool> Next(nucleus::genomics::v1::BedRecord* out) override;
// Constructor is invoked via BedReader::Iterate.
BedFullFileIterable(const BedReader* reader);
~BedFullFileIterable() override;
};
StatusOr<std::unique_ptr<BedReader>> BedReader::FromFile(
const string& bed_path,
const nucleus::genomics::v1::BedReaderOptions& options) {
int numFieldsInBed;
TF_RETURN_IF_ERROR(
GetNumFields(bed_path,
options.compression_type() ==
nucleus::genomics::v1::BedReaderOptions::GZIP,
&numFieldsInBed));
nucleus::genomics::v1::BedHeader header;
header.set_num_fields(numFieldsInBed);
// Ensure options are valid.
if (options.num_fields() != 0 && (options.num_fields() > numFieldsInBed ||
!ValidNumBedFields(options.num_fields()))) {
return tf::errors::InvalidArgument(
"Invalid requested number of fields to parse");
}
std::unique_ptr<tensorflow::RandomAccessFile> fp;
tf::Status status =
tf::Env::Default()->NewRandomAccessFile(bed_path.c_str(), &fp);
if (!status.ok()) {
return tf::errors::NotFound(
tf::strings::StrCat("Could not open ", bed_path));
}
return std::unique_ptr<BedReader>(
new BedReader(fp.release(), options, header));
}
BedReader::BedReader(tensorflow::RandomAccessFile* fp,
const nucleus::genomics::v1::BedReaderOptions& options,
const nucleus::genomics::v1::BedHeader& header)
: options_(options), header_(header), src_(fp) {
if (options.compression_type() ==
nucleus::genomics::v1::BedReaderOptions::GZIP) {
file_stream_.reset(new tf::io::RandomAccessInputStream(src_));
zlib_stream_.reset(new tf::io::ZlibInputStream(
file_stream_.get(), READER_BUFFER_SIZE, READER_BUFFER_SIZE,
tf::io::ZlibCompressionOptions::GZIP()));
buffered_inputstream_.reset(new tf::io::BufferedInputStream(
zlib_stream_.get(), READER_BUFFER_SIZE));
} else {
buffered_inputstream_.reset(
new tf::io::BufferedInputStream(src_, READER_BUFFER_SIZE));
}
}
BedReader::~BedReader() {
if (src_) {
TF_CHECK_OK(Close());
}
}
tf::Status BedReader::Close() {
if (src_ == nullptr) {
return tf::errors::FailedPrecondition("BedReader already closed");
}
buffered_inputstream_.reset();
zlib_stream_.reset();
file_stream_.reset();
delete src_;
src_ = nullptr;
return tf::Status::OK();
}
// Ensures the number of fields is consistent across all records in the BED.
tf::Status BedReader::Validate(const int numTokens) const {
if (header_.num_fields() != numTokens) {
return tf::errors::Unknown(
"Invalid BED with varying number of fields in file");
}
return tf::Status::OK();
}
StatusOr<std::shared_ptr<BedIterable>> BedReader::Iterate() const {
if (src_ == nullptr)
return tf::errors::FailedPrecondition("Cannot Iterate a closed BedReader.");
return StatusOr<std::shared_ptr<BedIterable>>(
MakeIterable<BedFullFileIterable>(this));
}
// Iterable class definitions.
StatusOr<bool> BedFullFileIterable::Next(
nucleus::genomics::v1::BedRecord* out) {
TF_RETURN_IF_ERROR(CheckIsAlive());
const BedReader* bed_reader = static_cast<const BedReader*>(reader_);
string line;
tf::Status status = NextNonCommentLine(bed_reader->Stream(), &line);
if (tf::errors::IsOutOfRange(status)) {
return false;
} else if (!status.ok()) {
return status;
}
int numTokens;
TF_RETURN_IF_ERROR(
ConvertToPb(line, bed_reader->Options().num_fields(), &numTokens, out));
TF_RETURN_IF_ERROR(bed_reader->Validate(numTokens));
return true;
}
BedFullFileIterable::~BedFullFileIterable() {}
BedFullFileIterable::BedFullFileIterable(const BedReader* reader)
: Iterable(reader) {}
} // namespace nucleus
| 36.732441 | 80 | 0.693344 | ruif2009 |
12496627ceaf7bf6641f094ad577428e151ccc15 | 358 | cc | C++ | bcd.cc | lamarrr/BCD | 864774d6f95a9d8e6b2dcb771ff29b6e0e7843cf | [
"MIT"
] | 2 | 2019-09-18T22:02:46.000Z | 2019-09-19T21:15:53.000Z | bcd.cc | lamarrr/BCD | 864774d6f95a9d8e6b2dcb771ff29b6e0e7843cf | [
"MIT"
] | null | null | null | bcd.cc | lamarrr/BCD | 864774d6f95a9d8e6b2dcb771ff29b6e0e7843cf | [
"MIT"
] | null | null | null | #include <iostream>
#include "bcd.h"
int main() {
//
auto u = bcd::Encode<int16_t, uint16_t, 8U, 8U>(-17);
bcd::BinPrint<uint16_t, false>(u);
std::cout << std::endl << bcd::BinString<uint32_t>(1U << 30) << std::endl;
bcd::BinPrint(bcd::Decode<int16_t, uint16_t, 8U, 8U>(u));
printf("\n%d", bcd::Decode<uint8_t, uint8_t, 2U, 3U>(0b01001U));
}
| 23.866667 | 76 | 0.617318 | lamarrr |
124b35725afdb0e5ce9a2bca2d91370ba8ba1aa8 | 143 | cpp | C++ | src/selfie_scheduler/src/clients/client_interface.cpp | KNR-Selfie/selfie_carolocup2020 | 5d6331962e4752c9e9c4fcc88ebd3093e4d96b85 | [
"BSD-3-Clause"
] | 10 | 2019-08-17T14:50:13.000Z | 2021-07-19T17:21:13.000Z | src/selfie_scheduler/src/clients/client_interface.cpp | KNR-Selfie/selfie_carolocup2020 | 5d6331962e4752c9e9c4fcc88ebd3093e4d96b85 | [
"BSD-3-Clause"
] | 16 | 2019-05-27T18:50:09.000Z | 2020-02-11T00:23:50.000Z | src/selfie_scheduler/src/clients/client_interface.cpp | KNR-Selfie/selfie_carolocup2020 | 5d6331962e4752c9e9c4fcc88ebd3093e4d96b85 | [
"BSD-3-Clause"
] | 3 | 2020-01-21T15:03:24.000Z | 2021-05-02T06:40:50.000Z | #include <selfie_scheduler/client_interface.h>
ClientInterface::~ClientInterface()
{
std::cout << "Pure virtual destructor is called";
}
| 17.875 | 53 | 0.741259 | KNR-Selfie |
124bd83394fbb1af01f40c4a7a8a3c8110b6e7f2 | 361 | cpp | C++ | codeforces/235b.cpp | jffifa/algo-solution | af2400d6071ee8f777f9473d6a34698ceef08355 | [
"MIT"
] | 5 | 2015-07-14T10:29:25.000Z | 2016-10-11T12:45:18.000Z | codeforces/235b.cpp | jffifa/algo-solution | af2400d6071ee8f777f9473d6a34698ceef08355 | [
"MIT"
] | null | null | null | codeforces/235b.cpp | jffifa/algo-solution | af2400d6071ee8f777f9473d6a34698ceef08355 | [
"MIT"
] | 3 | 2016-08-23T01:05:26.000Z | 2017-05-28T02:04:20.000Z | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int N;
double p[111111], ans;
int main() {
int i, j, k;
cin>>N;
for (i = 0; i < N; ++i) {
scanf("%lf", p+i);
ans += p[i];
}
double now = 0;
for (i = 1; i < N; ++i) {
now = (now+p[i-1])*p[i];
ans += 2*now;
}
printf("%.10f\n", ans);
return 0;
}
| 14.44 | 26 | 0.526316 | jffifa |
124c5604f5c0c68e1195f8ab2c05b7f6eee9a6ff | 390 | hpp | C++ | wechat/models/wx_synckey.hpp | ArkBriar/WxPenguin | ae1cf9719a185b3ecb546e4f0537c6afc77ddb45 | [
"MIT"
] | 1 | 2017-03-13T09:59:30.000Z | 2017-03-13T09:59:30.000Z | wechat/models/wx_synckey.hpp | arkbriar/WxPenguin | ae1cf9719a185b3ecb546e4f0537c6afc77ddb45 | [
"MIT"
] | null | null | null | wechat/models/wx_synckey.hpp | arkbriar/WxPenguin | ae1cf9719a185b3ecb546e4f0537c6afc77ddb45 | [
"MIT"
] | null | null | null | #pragma once
#ifndef WX_SYNCKEY_HPP_1Z6TPOWO
#define WX_SYNCKEY_HPP_1Z6TPOWO
#include <string>
#include "../json/json.hpp"
namespace WebWx {
namespace Model {
class WxSyncKey {
public:
//@no impl/
WxSyncKey() {}
WxSyncKey(const nlohmann::json&) {}
};
}
}
#endif /* end of include guard: WX_SYNCKEY_HPP_1Z6TPOWO */
| 15.6 | 58 | 0.597436 | ArkBriar |
124e4540fcb9bd45359e5934698fd2a0c509a125 | 1,353 | cpp | C++ | src/systems/consumable_system.cpp | pkuehne/fortress | 1fac97edcb47b4dd6bf65f553585c22d0cd2e4de | [
"MIT"
] | null | null | null | src/systems/consumable_system.cpp | pkuehne/fortress | 1fac97edcb47b4dd6bf65f553585c22d0cd2e4de | [
"MIT"
] | 118 | 2015-08-03T08:06:53.000Z | 2022-01-13T17:26:00.000Z | src/systems/consumable_system.cpp | pkuehne/fortress | 1fac97edcb47b4dd6bf65f553585c22d0cd2e4de | [
"MIT"
] | null | null | null | #include "consumable_system.h"
#include "../components/consumable_component.h"
#include "../components/health_component.h"
void updateHealth(ConsumableComponent* consumable, HealthComponent* health) {
if (!health) {
return;
}
if (consumable->quenches == THIRST) {
int result = health->thirst - consumable->quenchStrength;
health->thirst = (result < 0) ? 0 : result;
} else if (consumable->quenches == HUNGER) {
int result = health->hunger - consumable->quenchStrength;
health->hunger = (result < 0) ? 0 : result;
}
if (consumable->effect == HEALTH_EFFECT) {
health->health += consumable->effectStrength;
}
}
void ConsumableSystem::handleConsumeItemEvent(const ConsumeItemEvent* event) {
ConsumableComponent* consumable =
getEngine()->state()->components()->get<ConsumableComponent>(
event->item);
HealthComponent* health =
getEngine()->state()->components()->get<HealthComponent>(event->entity);
// Validate
if (!consumable) {
LOG(ERROR) << "Consume event on non-consumable item: " << event->item
<< " !" << std::endl;
return;
}
// Check whether this has a health impact
updateHealth(consumable, health);
getEngine()->state()->entityManager()->destroyEntity(event->item);
}
| 31.465116 | 80 | 0.634146 | pkuehne |
1250618f23b7798ec800b533a86113eb044904f4 | 1,910 | cc | C++ | src/relay_tensor_store.cc | PrincetonUniversity/relay-ila | 9c14053f9068c95a73a92253625b7cff118a3751 | [
"MIT"
] | null | null | null | src/relay_tensor_store.cc | PrincetonUniversity/relay-ila | 9c14053f9068c95a73a92253625b7cff118a3751 | [
"MIT"
] | null | null | null | src/relay_tensor_store.cc | PrincetonUniversity/relay-ila | 9c14053f9068c95a73a92253625b7cff118a3751 | [
"MIT"
] | 2 | 2020-04-24T18:29:27.000Z | 2020-04-24T18:31:14.000Z | // =============================================================================
// MIT License
//
// Copyright (c) 2020 Princeton University
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// =============================================================================
// File: relay_tensor_store.cc
#include <ilang/util/log.h>
#include <relay/relay_top.h>
namespace ilang {
namespace relay {
void DefineTensorStore(Ila& m) {
auto instr = m.NewInstr(F_TENSOR_STORE);
auto func_run = (m.input(RELAY_FUNC_RUN_IN) == RELAY_FUNC_RUN_ON);
auto func_id_match = (m.input(RELAY_FUNC_ID_IN) == F_TENSOR_STORE_ID);
instr.SetDecode(func_run & func_id_match);
auto tensor = m.state(RELAY_TENSOR_MEM);
auto addr = m.input(DATA_IN_Y);
auto data = m.input(RELAY_DATA_IN);
instr.SetUpdate(tensor, Store(tensor, addr, data));
}
} // namespace relay
} // namespace ilang
| 36.037736 | 80 | 0.686911 | PrincetonUniversity |
125296dcd01bdd43a61a1ff1ac2c8db7d4c39470 | 2,207 | cpp | C++ | test/std_complex.cpp | rwols/yaml-archive | 4afec73e557c15350c5e068c010f4e378edc95ef | [
"BSL-1.0"
] | 1 | 2018-01-27T23:35:21.000Z | 2018-01-27T23:35:21.000Z | test/std_complex.cpp | rwols/yaml-archive | 4afec73e557c15350c5e068c010f4e378edc95ef | [
"BSL-1.0"
] | 2 | 2019-08-17T05:37:36.000Z | 2019-08-17T22:57:26.000Z | test/std_complex.cpp | rwols/yaml-archive | 4afec73e557c15350c5e068c010f4e378edc95ef | [
"BSL-1.0"
] | 1 | 2021-03-19T11:53:53.000Z | 2021-03-19T11:53:53.000Z | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// test_complex.cpp
// (C) Copyright 2005 Matthias Troyer .
// Use, modification and distribution is subject to 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)
// should pass compilation and execution
#include <fstream>
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/math/special_functions/next.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
#include <boost/limits.hpp>
namespace std {
using ::rand;
using ::remove;
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
using ::numeric_limits;
#endif
}
#endif
#include "io_fixture.hpp"
#include <boost/preprocessor/stringize.hpp>
#include <boost/serialization/complex.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
template <class T>
std::ostream& operator<<(std::ostream& os, const std::complex<T>& z)
{
os << std::setprecision(std::numeric_limits<T>::digits10 + 1);
return os << z.real() << " + " << z.imag() << 'i';
}
BOOST_FIXTURE_TEST_CASE(std_complex, io_fixture)
{
using boost::serialization::make_nvp;
std::complex<float> a(
static_cast<float>(std::rand()) / static_cast<float>(std::rand()),
static_cast<float>(std::rand()) / static_cast<float>(std::rand()));
std::complex<double> b(
static_cast<double>(std::rand()) / static_cast<double>(std::rand()),
static_cast<double>(std::rand()) / static_cast<double>(std::rand()));
{
output() << make_nvp("afloatcomplex", a)
<< make_nvp("adoublecomplex", b);
}
std::complex<float> a1;
std::complex<double> b1;
{
input() >> make_nvp("afloatcomplex", a1) >>
make_nvp("adoublecomplex", b1);
}
// FIXME!!! FLOAT PRECISION!!!
using boost::math::float_distance;
BOOST_CHECK_LT(std::abs(float_distance(a.real(), a1.real())), 8);
BOOST_CHECK_LT(std::abs(float_distance(a.imag(), a1.imag())), 8);
BOOST_CHECK_LT(std::abs(float_distance(b.real(), b1.real())), 8);
BOOST_CHECK_LT(std::abs(float_distance(b.imag(), b1.imag())), 8);
}
// EOF
| 31.528571 | 80 | 0.643407 | rwols |
125624723ff8ea429178ef0793673794b8123142 | 11,945 | cpp | C++ | src/Interop.cpp | jparimaa/glvk-interop | 3428cafe5ea0359609fd42d84b87b1900d9ff58f | [
"MIT"
] | null | null | null | src/Interop.cpp | jparimaa/glvk-interop | 3428cafe5ea0359609fd42d84b87b1900d9ff58f | [
"MIT"
] | null | null | null | src/Interop.cpp | jparimaa/glvk-interop | 3428cafe5ea0359609fd42d84b87b1900d9ff58f | [
"MIT"
] | null | null | null | #include "Interop.hpp"
#include "VulkanUtils.hpp"
#include "Utils.hpp"
#include <vulkan/vulkan_win32.h>
#include <array>
Interop::Interop(Context& context) :
m_context(context),
m_device(context.getDevice())
{
createInteropSemaphores();
createInteropTexture();
}
Interop::~Interop()
{
vkDeviceWaitIdle(m_device);
vkDestroyImage(m_device, m_sharedImage, nullptr);
vkFreeMemory(m_device, m_sharedImageMemory, nullptr);
vkDestroyImageView(m_device, m_sharedImageView, nullptr);
vkDestroySemaphore(m_device, m_glCompleteSemaphore, nullptr);
vkDestroySemaphore(m_device, m_vulkanCompleteSemaphore, nullptr);
}
void Interop::transformSharedImageForGLWrite(VkCommandBuffer cb)
{
CHECK(!m_stateIsGLWrite);
VkImageMemoryBarrier barrier{};
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.image = m_sharedImage;
barrier.srcAccessMask = VK_ACCESS_SHADER_READ_BIT;
barrier.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
barrier.oldLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
barrier.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
barrier.subresourceRange.levelCount = 1;
barrier.subresourceRange.layerCount = 1;
const VkPipelineStageFlags sourceStage = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
const VkPipelineStageFlags destinationStage = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
vkCmdPipelineBarrier(cb, sourceStage, destinationStage, 0, 0, nullptr, 0, nullptr, 1, &barrier);
m_stateIsGLWrite = true;
}
void Interop::transformSharedImageForVKRead(VkCommandBuffer cb)
{
CHECK(m_stateIsGLWrite);
VkImageMemoryBarrier barrier{};
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.image = m_sharedImage;
barrier.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
barrier.oldLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
barrier.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
barrier.subresourceRange.levelCount = 1;
barrier.subresourceRange.layerCount = 1;
const VkPipelineStageFlags sourceStage = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
const VkPipelineStageFlags destinationStage = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
vkCmdPipelineBarrier(cb, sourceStage, destinationStage, 0, 0, nullptr, 0, nullptr, 1, &barrier);
m_stateIsGLWrite = false;
}
HANDLE Interop::getGLCompleteHandle() const
{
return m_glCompleteSemaphoreHandle;
}
HANDLE Interop::getVKReadyHandle() const
{
return m_vulkanCompleteSemaphoreHandle;
}
HANDLE Interop::getSharedImageMemoryHandle() const
{
return m_sharedImageMemoryHandle;
}
uint64_t Interop::getSharedImageMemorySize() const
{
return m_sharedImageMemorySize;
}
VkSemaphore Interop::getGLCompleteSemaphore() const
{
return m_glCompleteSemaphore;
}
VkSemaphore Interop::getVKReadySemaphore() const
{
return m_vulkanCompleteSemaphore;
}
VkImageView Interop::getSharedImageView() const
{
return m_sharedImageView;
}
void Interop::createInteropSemaphores()
{
auto vkGetPhysicalDeviceExternalSemaphorePropertiesKHRAddr = vkGetInstanceProcAddr(m_context.getInstance(), "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");
auto vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(vkGetPhysicalDeviceExternalSemaphorePropertiesKHRAddr);
CHECK(vkGetPhysicalDeviceExternalSemaphorePropertiesKHR);
const std::vector<VkExternalSemaphoreHandleTypeFlagBits> flags{
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT};
VkPhysicalDeviceExternalSemaphoreInfo externalSemaphoreInfo{};
externalSemaphoreInfo.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO;
externalSemaphoreInfo.pNext = nullptr;
VkExternalSemaphoreProperties externalSemaphoreProperties{};
externalSemaphoreProperties.sType = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES;
externalSemaphoreProperties.pNext = nullptr;
bool found = false;
VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice();
VkExternalSemaphoreHandleTypeFlagBits compatibleSemaphoreType;
for (size_t i = 0; i < flags.size(); ++i)
{
externalSemaphoreInfo.handleType = flags[i];
vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(physicalDevice, &externalSemaphoreInfo, &externalSemaphoreProperties);
if (externalSemaphoreProperties.compatibleHandleTypes & flags[i] && //
externalSemaphoreProperties.externalSemaphoreFeatures & VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT)
{
compatibleSemaphoreType = flags[i];
found = true;
break;
}
}
CHECK(found);
VkExportSemaphoreCreateInfo exportSemaphoreCreateInfo{};
exportSemaphoreCreateInfo.sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO;
exportSemaphoreCreateInfo.pNext = nullptr;
exportSemaphoreCreateInfo.handleTypes = VkExternalSemaphoreHandleTypeFlags(compatibleSemaphoreType);
VkSemaphoreCreateInfo semaphoreCreateInfo{};
semaphoreCreateInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
semaphoreCreateInfo.pNext = &exportSemaphoreCreateInfo;
VK_CHECK(vkCreateSemaphore(m_device, &semaphoreCreateInfo, nullptr, &m_glCompleteSemaphore));
VK_CHECK(vkCreateSemaphore(m_device, &semaphoreCreateInfo, nullptr, &m_vulkanCompleteSemaphore));
// VkSemaphoreGetFdInfoKHR for Linux
VkSemaphoreGetWin32HandleInfoKHR semaphoreGetHandleInfo{};
semaphoreGetHandleInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR;
semaphoreGetHandleInfo.pNext = nullptr;
semaphoreGetHandleInfo.semaphore = VK_NULL_HANDLE;
semaphoreGetHandleInfo.handleType = compatibleSemaphoreType;
// vkGetSemaphoreFdKHR for Linux
auto vkGetSemaphoreWin32HandleKHRAddr = vkGetInstanceProcAddr(m_context.getInstance(), "vkGetSemaphoreWin32HandleKHR");
auto vkGetSemaphoreWin32HandleKHR = PFN_vkGetSemaphoreWin32HandleKHR(vkGetSemaphoreWin32HandleKHRAddr);
CHECK(vkGetSemaphoreWin32HandleKHR);
semaphoreGetHandleInfo.semaphore = m_vulkanCompleteSemaphore;
VK_CHECK(vkGetSemaphoreWin32HandleKHR(m_device, &semaphoreGetHandleInfo, &m_vulkanCompleteSemaphoreHandle));
semaphoreGetHandleInfo.semaphore = m_glCompleteSemaphore;
VK_CHECK(vkGetSemaphoreWin32HandleKHR(m_device, &semaphoreGetHandleInfo, &m_glCompleteSemaphoreHandle));
}
void Interop::createInteropTexture()
{
// VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR for Linux
const VkExternalMemoryHandleTypeFlags handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR;
{ // Create Image
VkExternalMemoryImageCreateInfo externalMemoryCreateInfo{};
externalMemoryCreateInfo.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO;
externalMemoryCreateInfo.handleTypes = handleType;
VkImageCreateInfo imageCreateInfo{};
imageCreateInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
imageCreateInfo.pNext = &externalMemoryCreateInfo;
imageCreateInfo.imageType = VK_IMAGE_TYPE_2D;
imageCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
imageCreateInfo.mipLevels = 1;
imageCreateInfo.arrayLayers = 1;
imageCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
imageCreateInfo.extent.depth = 1;
imageCreateInfo.extent.width = c_windowWidth;
imageCreateInfo.extent.height = c_windowHeight;
imageCreateInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
VK_CHECK(vkCreateImage(m_device, &imageCreateInfo, nullptr, &m_sharedImage));
}
{ // Allocate and bind memory
VkMemoryRequirements memRequirements{};
vkGetImageMemoryRequirements(m_device, m_sharedImage, &memRequirements);
VkExportMemoryAllocateInfo exportAllocInfo{};
exportAllocInfo.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO;
exportAllocInfo.pNext = nullptr;
exportAllocInfo.handleTypes = handleType;
const MemoryTypeResult memoryTypeResult = findMemoryType(m_context.getPhysicalDevice(), memRequirements.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
CHECK(memoryTypeResult.found);
VkMemoryAllocateInfo memAllocInfo{};
memAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
memAllocInfo.pNext = &exportAllocInfo;
memAllocInfo.allocationSize = memRequirements.size;
memAllocInfo.memoryTypeIndex = memoryTypeResult.typeIndex;
m_sharedImageMemorySize = memRequirements.size;
VK_CHECK(vkAllocateMemory(m_device, &memAllocInfo, nullptr, &m_sharedImageMemory));
VK_CHECK(vkBindImageMemory(m_device, m_sharedImage, m_sharedImageMemory, 0));
}
{ // Get memory handle
// vkGetMemoryFdKHR for Linux
auto vkGetMemoryWin32HandleKHRAddr = vkGetInstanceProcAddr(m_context.getInstance(), "vkGetMemoryWin32HandleKHR");
auto vkGetMemoryWin32HandleKHR = PFN_vkGetMemoryWin32HandleKHR(vkGetMemoryWin32HandleKHRAddr);
CHECK(vkGetMemoryWin32HandleKHR);
VkMemoryGetWin32HandleInfoKHR memoryFdInfo{};
memoryFdInfo.sType = VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR;
memoryFdInfo.pNext = nullptr;
memoryFdInfo.memory = m_sharedImageMemory;
memoryFdInfo.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
VK_CHECK(vkGetMemoryWin32HandleKHR(m_device, &memoryFdInfo, &m_sharedImageMemoryHandle));
}
{ // Create image view
VkImageViewCreateInfo viewCreateInfo{};
viewCreateInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
viewCreateInfo.viewType = VK_IMAGE_VIEW_TYPE_2D;
viewCreateInfo.image = m_sharedImage;
viewCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
viewCreateInfo.subresourceRange = VkImageSubresourceRange{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
vkCreateImageView(m_device, &viewCreateInfo, nullptr, &m_sharedImageView);
}
{ // Image layout transform
VkImageMemoryBarrier barrier{};
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.image = m_sharedImage;
barrier.srcAccessMask = 0;
barrier.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
barrier.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
barrier.subresourceRange.levelCount = 1;
barrier.subresourceRange.layerCount = 1;
const VkPipelineStageFlags sourceStage = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
const VkPipelineStageFlags destinationStage = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
const SingleTimeCommand command = beginSingleTimeCommands(m_context.getGraphicsCommandPool(), m_device);
vkCmdPipelineBarrier(command.commandBuffer, sourceStage, destinationStage, 0, 0, nullptr, 0, nullptr, 1, &barrier);
endSingleTimeCommands(m_context.getGraphicsQueue(), command, m_vulkanCompleteSemaphore);
m_stateIsGLWrite = true;
}
}
| 43.436364 | 170 | 0.787024 | jparimaa |
12569b4cf790d623e6e113bd48c5ec2268b2687e | 67,685 | cc | C++ | tfop/wtoolkit.cc | vghost2008/wml | d0c5a1da6c228e321ae59a563e9ac84aa66266ff | [
"MIT"
] | 6 | 2019-12-10T17:18:56.000Z | 2022-03-01T01:00:35.000Z | tfop/wtoolkit.cc | vghost2008/wml | d0c5a1da6c228e321ae59a563e9ac84aa66266ff | [
"MIT"
] | 2 | 2021-08-25T16:16:01.000Z | 2022-02-10T05:21:19.000Z | tfop/wtoolkit.cc | vghost2008/wml | d0c5a1da6c228e321ae59a563e9ac84aa66266ff | [
"MIT"
] | 2 | 2019-12-07T09:57:35.000Z | 2021-09-06T04:58:10.000Z | #include <stdio.h>
#include <cfloat>
#include <list>
#include <cstdlib>
#include <vector>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <future>
#include <assert.h>
#include <boost/algorithm/clamp.hpp>
#include "tensorflow/core/framework/common_shape_fns.h"
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/util/work_sharder.h"
using namespace tensorflow;
using namespace std;
typedef Eigen::ThreadPoolDevice CPUDevice;
REGISTER_OP("DrawPoints")
.Attr("T: {float, double}")
.Attr("color:list(float)")
.Attr("point_size:int")
.Input("image: T")
.Input("points: T")
.Output("output:T")
.SetShapeFn(shape_inference::UnchangedShape);
template <typename Device, typename T>
class DrawPointsOp: public OpKernel {
public:
explicit DrawPointsOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("color", &color_));
OP_REQUIRES_OK(context, context->GetAttr("point_size", &point_size_));
}
void Compute(OpKernelContext* context) override
{
const Tensor &_image = context->input(0);
const Tensor &_points = context->input(1);
auto image_flat = _image.flat<T>();
auto points_flat = _points.flat<T>();
const auto points_nr = _points.dim_size(0);
const auto width = _image.dim_size(1);
const auto height = _image.dim_size(0);
const auto channels = _image.dim_size(2);
OP_REQUIRES(context, _image.dims() == 3, errors::InvalidArgument("images data must be 3-dimensional"));
OP_REQUIRES(context, _points.dims() == 2, errors::InvalidArgument("points data must be 2-dimensional"));
OP_REQUIRES(context, color_.size() > 0, errors::InvalidArgument("empty color"));
TensorShape output_shape = _image.shape();
Tensor *output_tensor = nullptr;
OP_REQUIRES_OK(context,context->allocate_output(0,output_shape,&output_tensor));
if(!output_tensor->CopyFrom(_image,output_shape))
return;
auto image = output_tensor->tensor<T,3>();
const auto points = _points.tensor<T,2>();
while(color_.size()<channels)
color_.push_back(color_.back());
auto shard = [&]
(int64 start, int64 limit) {
for(auto i=start; i<limit; ++i) {
const auto x = points(i,1);
const auto y = points(i,0);
const auto beg_x = std::max<int>(x-point_size_,0);
const auto end_x = std::min<int>(x+point_size_,width-1);
const auto beg_y = std::max<int>(y-point_size_,0);
const auto end_y = std::min<int>(y+point_size_,height-1);
for(auto j=beg_x; j<=end_x; ++j) {
for(auto k=beg_y; k<=end_y; ++k) {
for(auto m=0; m<channels; ++m) {
image(k,j,m) = color_.at(m);
}
}
}
}
};
shard(0,points_nr);
/*const DeviceBase::CpuWorkerThreads& worker_threads =
*(context->device()->tensorflow_cpu_worker_threads());
const int64 total = points_nr;
const int64 cost_per_unit = 2;*/
//Shard(worker_threads.num_threads, worker_threads.workers,total,cost_per_unit, shard);
}
private:
std::vector<float> color_;
int point_size_;
};
REGISTER_KERNEL_BUILDER(Name("DrawPoints").Device(DEVICE_CPU).TypeConstraint<float>("T"), DrawPointsOp<CPUDevice, float>);
/*
* phy_max:返回的begin_index与end_index之间最多差phy_max(强制限制)
* max:begin_index,end_index的最大值,
* hint:提示值,生成的区间至少要包含hint中的一个值, 要求其值位于[0,max)之间
* 输出:
* oindex:[begin_index,end_index) shape=[2]的tensor用于表示一个范围
* ohint:输入的hint中在[begin_index,end_index之间的部分
*/
REGISTER_OP("RandomRange")
.Attr("phy_max:int")
.Input("max: int32")
.Input("hint: int32")
.Output("oindex:int32")
.Output("ohint:int32")
.SetShapeFn([](shape_inference::InferenceContext* c){
auto shape0 = c->Vector(2);
auto shape1 = c->Vector(c->UnknownDim());
c->set_output(0,shape0);
c->set_output(1,shape1);
return Status::OK();
});
class RandomRange: public OpKernel {
public:
explicit RandomRange(OpKernelConstruction* context) : OpKernel(context) {
std::srand(::time(nullptr));
OP_REQUIRES_OK(context, context->GetAttr("phy_max", &phy_max_));
}
void Compute(OpKernelContext* context) override
{
const Tensor &_max = context->input(0);
const Tensor &_hint = context->input(1);
auto max = _max.flat<int>().data()[0];
auto hint_flat = _hint.flat<int>();
const auto hint_size = _hint.dim_size(0);
int index = 0;
int beg_index = 0;
int end_index = max;
OP_REQUIRES(context, _max.dims() <=1, errors::InvalidArgument("max data must be 1/0-dimensional"));
OP_REQUIRES(context, _hint.dims() == 1, errors::InvalidArgument("hint data must be 1-dimensional"));
TensorShape output_shape0;
Tensor *output_tensor0 = nullptr;
Tensor *output_tensor1 = nullptr;
const int dim0[] = {2};
TensorShapeUtils::MakeShape(dim0,1,&output_shape0);
OP_REQUIRES_OK(context,context->allocate_output(0,output_shape0,&output_tensor0));
auto oindex = output_tensor0->flat<int>();
if(max> phy_max_) {
const auto index = std::rand()%hint_size;
const auto base_index = hint_flat.data()[index];
vector<int> outdata;
beg_index = base_index-(phy_max_/2);
end_index = beg_index+phy_max_;
if(beg_index<0) {
beg_index = 0;
end_index = phy_max_;
} else if (end_index>=max) {
end_index = max;
beg_index = max-phy_max_;
}
std::copy_if(hint_flat.data(),hint_flat.data()+hint_size,std::back_inserter(outdata),[beg_index,end_index](int v){ return (v>=beg_index)&& (v<end_index); });
TensorShape output_shape1;
const int dim1[] = {int(outdata.size())};
TensorShapeUtils::MakeShape(dim1,1,&output_shape1);
OP_REQUIRES_OK(context,context->allocate_output(1,output_shape1,&output_tensor1));
auto ohint = output_tensor1->flat<int>();
std::copy(outdata.begin(),outdata.end(),ohint.data());
} else {
TensorShape output_shape1 = _hint.shape();
OP_REQUIRES_OK(context,context->allocate_output(1,output_shape1,&output_tensor1));
output_tensor1->CopyFrom(_hint,output_shape1);
}
oindex.data()[0] = beg_index;
oindex.data()[1] = end_index;
}
private:
int phy_max_;
};
REGISTER_KERNEL_BUILDER(Name("RandomRange").Device(DEVICE_CPU), RandomRange);
/*
* 将输入的整数按指定的方式进行映射
*/
REGISTER_OP("IntHash")
.Attr("T:{int32,int64}")
.Attr("key:list(int)")
.Attr("value:list(int)")
.Input("input:T")
.Output("output:T")
.SetShapeFn(shape_inference::UnchangedShape);
template <typename Device, typename T>
class IntHash: public OpKernel {
public:
explicit IntHash(OpKernelConstruction* context) : OpKernel(context) {
vector<int> key;
vector<int> value;
OP_REQUIRES_OK(context, context->GetAttr("key", &key));
OP_REQUIRES_OK(context, context->GetAttr("value", &value));
const auto nr = std::min(key.size(),value.size());
for(auto i=0; i<nr; ++i)
dict_[key[i]] = value[i];
}
void Compute(OpKernelContext* context) override
{
const Tensor &_input = context->input(0);
Tensor *output_tensor0 = nullptr;
OP_REQUIRES_OK(context,context->allocate_output(0,_input.shape(),&output_tensor0));
auto input = _input.flat<T>();
auto output = output_tensor0->flat<T>();
for(auto i=0; i<input.size(); ++i) {
const auto v = input.data()[i];
const auto it = dict_.find(v);
if(it != dict_.end())
output.data()[i] = it->second;
else
output.data()[i] = 65536;
}
}
private:
map<int,int> dict_;
};
REGISTER_KERNEL_BUILDER(Name("IntHash").Device(DEVICE_CPU).TypeConstraint<int>("T"), IntHash<CPUDevice, int>);
REGISTER_KERNEL_BUILDER(Name("IntHash").Device(DEVICE_CPU).TypeConstraint<tensorflow::int64>("T"), IntHash<CPUDevice, tensorflow::int64>);
/*
* 对Boxes的概率进行调整
* 具体方法为:
* 1,如果最大概率不在指定的类型中则不调整
* 2,否则将指定的类型中非最大概率的一半值分配给最大概率
* classes:指定需要调整的类别,如果为空则表示使用所有的非背景类别
* probs:概率,[X,N]
*/
REGISTER_OP("ProbabilityAdjust")
.Attr("T: {float, double}")
.Attr("classes:list(int)")
.Input("probs: T")
.Output("output_probs:T")
.SetShapeFn(shape_inference::UnchangedShape);
template <typename Device, typename T>
class ProbabilityAdjustOp: public OpKernel {
public:
explicit ProbabilityAdjustOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("classes", &classes_));
}
void Compute(OpKernelContext* context) override
{
const Tensor &probs = context->input(0);
auto probs_flat = probs.flat<T>();
const auto nr = probs.dim_size(0);
const auto classes_nr = probs.dim_size(1);
OP_REQUIRES(context, probs.dims() == 2, errors::InvalidArgument("probs must be 2-dimensional"));
TensorShape output_shape = probs.shape();
if(classes_.empty()) {
for(auto i=1; i<classes_nr; ++i) {
classes_.push_back(i);
}
}
auto it = remove_if(classes_.begin(),classes_.end(),[classes_nr](int i){ return (i<0) || (i>=classes_nr);});
classes_.erase(it,classes_.end());
Tensor *output_probs = NULL;
OP_REQUIRES_OK(context, context->allocate_output(0, output_shape, &output_probs));
output_probs->CopyFrom(probs,output_shape);
auto output = output_probs->template flat<T>();
for(int i=0; i<nr; ++i) {
auto v = output.data()+i*classes_nr;
const auto it = max_element(v,v+classes_nr);
const int index = distance(v,it);
auto jt = find(classes_.begin(),classes_.end(),index);
auto sum = 0.;
if(jt ==classes_.end()) continue;
for(auto k:classes_) {
if(k==index)continue;
sum += v[k]/2.;
v[k] = v[k]/2.;
}
v[index] = v[index]+sum;
}
}
private:
vector<int> classes_;
};
REGISTER_KERNEL_BUILDER(Name("ProbabilityAdjust").Device(DEVICE_CPU).TypeConstraint<float>("T"), ProbabilityAdjustOp<CPUDevice, float>);
/*
* labels:[batch_size,nr]
* ids:[batch_size,nr]
* line_no[batch_size,nr]
*return:
* output:[batch_size,sample_nr,3] (id0,id1_pos,id2_neg) 内容为相应的索引
*/
REGISTER_OP("SampleLabels")
.Attr("T: {int32, int64}")
.Attr("sample_nr:int")
.Input("labels: T")
.Input("ids: T")
.Input("line_no: T")
.Output("data:T")
.SetShapeFn([](shape_inference::InferenceContext* c) {
int sample_nr = 0;
const auto input_shape0 = c->input(0);
const auto batch_size = c->Dim(input_shape0,0);
c->GetAttr("sample_nr",&sample_nr);
auto shape0 = c->MakeShape({batch_size,sample_nr,3});
c->set_output(0, shape0);
return Status::OK();
});
template <typename Device, typename T>
class SampleLabelsOp: public OpKernel {
public:
explicit SampleLabelsOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("sample_nr", &sample_nr_));
}
void Compute(OpKernelContext* context) override
{
const Tensor &_labels = context->input(0);
const Tensor &_ids = context->input(1);
const Tensor &_line_no = context->input(2);
OP_REQUIRES(context, _labels.dims() == 2, errors::InvalidArgument("labels must be 2-dimensional"));
OP_REQUIRES(context, _line_no.dims() == 2, errors::InvalidArgument("line no must be 2-dimensional"));
OP_REQUIRES(context, _ids.dims() == 2, errors::InvalidArgument("ids must be 2-dimensional"));
auto labels = _labels.tensor<T,2>();
auto ids = _ids.tensor<T,2>();
auto line_no = _line_no.tensor<T,2>();
auto batch_size = labels.dimension(0);
const auto line_no_br = line_no.dimension(0);
int dims_3d[] = {batch_size,sample_nr_,3};
TensorShape outshape0;
Tensor *output_data = NULL;
TensorShapeUtils::MakeShape(dims_3d, 3, &outshape0);
OP_REQUIRES_OK(context, context->allocate_output(0, outshape0, &output_data));
auto out_tensor = output_data->tensor<T,3>();
list<future<vector<tuple<T,T,T>>>> res;
for(auto i=0; i<batch_size; ++i) {
res.emplace_back(async(launch::async,&SampleLabelsOp<Device,T>::sample_one_batch,Eigen::Tensor<T,1,Eigen::RowMajor>(ids.chip(i,0)),
Eigen::Tensor<T,1,Eigen::RowMajor>(labels.chip(i,0)),
line_no.chip(line_no_br>1?i:0,0),
sample_nr_));
}
for(auto i=0; i<batch_size; ++i) {
auto data = next(res.begin(),i)->get();
for(auto j=0; j<sample_nr_; ++j) {
out_tensor(i,j,0) = std::get<0>(data[j]);
out_tensor(i,j,1) = std::get<1>(data[j]);
out_tensor(i,j,2) = std::get<2>(data[j]);
}
}
}
static vector<tuple<T,T,T>> sample_one_batch(const Eigen::Tensor<T,1,Eigen::RowMajor>& ids,
const Eigen::Tensor<T,1,Eigen::RowMajor>& labels,
const Eigen::Tensor<T,1,Eigen::RowMajor>& line_no,
int sample_nr) {
//instance id->box index
map<T,vector<int>> datas;
map<T,int> id_to_label;
map<int,vector<T>> label_to_id;
const auto kDelta = 3;
assert(ids.dimension(0)>0);
const auto data_nr = ids.dimension(0);
auto default_neg = data_nr-1;
for(auto i=0; i<data_nr; ++i) {
auto id = ids(i);
if((id<1) || (labels(i)<1)) continue;
auto it = datas.find(id);
if(it == datas.end()) {
datas[id] = vector<int>({i});
} else {
it->second.push_back(i);
}
const auto l = labels[i];
id_to_label[id] = l;
}
for(auto it=id_to_label.begin(); it!=id_to_label.end(); ++it) {
const auto id = it->first;
const auto l = it->second;
if(label_to_id.find(l) == label_to_id.end()) {
label_to_id[l] = vector<T>({id});
} else {
label_to_id[l].push_back(id);
}
}
/*
* 用于简化采样时的操作
*/
for(auto it=datas.begin(); it!=datas.end(); ++it) {
if(it->second.size()==1) {
it->second.push_back(it->second[0]);
}
}
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> dis(0, data_nr);
if(datas.size() == 1) {
auto it0 = datas.begin();
auto ids = datas.begin()->second;
int v0;
int v1;
std::tie(v0,v1) = sample_two_pos_int(ids,kDelta,line_no,[&dis,&gen]{return dis(gen);});
auto neg_idx = (data_nr-1);
if(find(ids.begin(),ids.end(),neg_idx) != ids.end()) {
neg_idx = 0;
if(find(ids.begin(),ids.end(),neg_idx) != ids.end()) {
cout<<"No neg idx find in sample_one_batch."<<endl;
}
}
vector<tuple<T,T,T>> res(sample_nr,make_tuple(v0,v1,neg_idx));
return res;
} else {
/*
* 至少有两个以上的目标
*/
vector<tuple<T,T,T>> res(sample_nr);
generate(res.begin(),res.end(),[&gen,&dis,&datas,&label_to_id,&id_to_label,&line_no](){
const auto id_index0 = dis(gen)%datas.size();
const auto id_index1 = sample_neg_data(datas,id_to_label,label_to_id,id_index0,[&dis,&gen]{return dis(gen);});
auto it0 = next(datas.begin(),id_index0);
auto it1 = next(datas.begin(),id_index1);
int v0;
int v1;
std::tie(v0,v1) = sample_two_pos_int(it0->second,kDelta,line_no,[&dis,&gen]{return dis(gen);});
auto id1_idx = dis(gen)%it1->second.size();
auto v2 = it1->second[id1_idx];
return make_tuple(v0,v1,v2);
});
return res;
}
}
template<typename RFunc>
static int sample_neg_data(const map<T,vector<int>>& id_to_index,const map<T,int>& id_to_label,const map<int,vector<T>>& label_to_id,int id_index,RFunc func) {
/*
* 尽量从具有相同label的实例中采样
*/
auto id = next(id_to_index.begin(),id_index)->first;
const auto label = id_to_label.at(id);
auto ids = label_to_id.at(label);
if(ids.size() == 1) {
return sample_int_exclude(id_to_index.size(),id_index,func);
} else {
auto _index = distance(ids.begin(),find(ids.begin(),ids.end(),id));
auto index = sample_int_exclude(ids.size(),_index,func);
auto id1 = ids[index];
assert(id_to_label.at(id1)==label);
assert(id1!=id);
auto it = id_to_index.find(id1);
return distance(id_to_index.begin(),it);
}
}
static pair<int,int> sample_two_int(int max_val,int delta,auto func) {
const int v0 = func()%max_val;
if(max_val<=delta) {
const auto v1 = sample_int_exclude(max_val,v0,func);
return make_pair(v0,v1);
}
auto d_v1 = (func()%delta)+1;
if(v0<max_val-1) {
auto v1 = min(v0+d_v1,max_val-1);
return make_pair(v0,v1);
} else {
return make_pair(v0,v0-d_v1);
}
};
static pair<int,int> sample_two_pos_int(const vector<int>& indexs,int delta,
const Eigen::Tensor<T,1,Eigen::RowMajor>& line_no,
auto func) {
/*
* 尽量在不同的行采样
*/
const int v0 = func()%indexs.size();
const int index0 = indexs[v0];
const int line_no0 = line_no(index0);
vector<int> a_indexs;
a_indexs.reserve(indexs.size());
copy_if(indexs.begin(),indexs.end(),back_inserter(a_indexs),[line_no0,delta,&line_no](int v) {
auto line_no1 = line_no(v);
if(line_no1==line_no0) return false;
return fabs(line_no1-line_no0)<=delta;
});
if(a_indexs.size()==0) {
const auto v1 = sample_int_exclude(indexs.size(),v0,func);
const int index1 = indexs[v1];
return make_pair(index0,index1);
}
const auto v1 = func()%a_indexs.size();
const auto index1 = a_indexs[v1];
return make_pair(index0,index1);
};
template<typename RFunc>
static int sample_int_exclude(int max_val,int exclude_v,RFunc func)
{
assert(max_val>0);
auto res = func()%(max_val-1);
return (res==exclude_v)?res+1:res;
}
private:
int sample_nr_ = 0;
};
REGISTER_KERNEL_BUILDER(Name("SampleLabels").Device(DEVICE_CPU).TypeConstraint<int>("T"), SampleLabelsOp<CPUDevice, int>);
REGISTER_KERNEL_BUILDER(Name("SampleLabels").Device(DEVICE_CPU).TypeConstraint<tensorflow::int64>("T"), SampleLabelsOp<CPUDevice, tensorflow::int64>);
/*
* data:[nr,nr] (i,j)表示i到j的距离
* labels:[nr]
* bboxes:[nr,4]
* threshold:
* dis_threshold:[2](x,y)
* output:[nr]
*/
REGISTER_OP("MergeLineBoxes")
.Attr("T: {int32, int64}")
.Attr("threshold:float")
.Attr("dis_threshold:list(float)")
.Input("data: float")
.Input("labels: T")
.Input("bboxes:float")
.Output("ids:T")
.Output("unique_ids:T")
.SetShapeFn([](shape_inference::InferenceContext* c) {
const auto input_shape0 = c->input(1);
c->set_output(0, input_shape0);
return Status::OK();
});
template <typename Device, typename T>
class MergeLineBoxesOp: public OpKernel {
public:
explicit MergeLineBoxesOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("dis_threshold", &dis_threshold_));
OP_REQUIRES_OK(context, context->GetAttr("threshold", &threshold_));
OP_REQUIRES(context, dis_threshold_.size() == 2, errors::InvalidArgument("Threshold must be contains two elements."));
}
void Compute(OpKernelContext* context) override
{
const Tensor &_data = context->input(0);
const Tensor &_labels = context->input(1);
const Tensor &_bboxes = context->input(2);
OP_REQUIRES(context, _labels.dims() == 1, errors::InvalidArgument("labels must be 1-dimensional"));
OP_REQUIRES(context, _data.dims() == 2, errors::InvalidArgument("data must be 2-dimensional"));
OP_REQUIRES(context, _bboxes.dims() == 2, errors::InvalidArgument("bboxes must be 2-dimensional"));
auto data = _data.tensor<float,2>();
auto bboxes = _bboxes.tensor<float,2>();
auto labels = _labels.tensor<T,1>();
auto batch_size = labels.dimension(0);
const auto data_nr = labels.dimension(0);
list<future<vector<int>>> res;
auto res_data = process(data,labels,bboxes,data_nr);
vector<int> res_data1 = res_data;
sort(res_data1.begin(),res_data1.end());
auto last = unique(res_data1.begin(),res_data1.end());
res_data1.erase(last,res_data1.end());
int dims_1d[] = {data_nr};
int dims_1d2[] = {res_data1.size()};
TensorShape outshape0;
TensorShape outshape1;
TensorShapeUtils::MakeShape(dims_1d, 1, &outshape0);
TensorShapeUtils::MakeShape(dims_1d2, 1, &outshape1);
Tensor *output_data = NULL;
Tensor *output_data1 = NULL;
OP_REQUIRES_OK(context, context->allocate_output(0, outshape0, &output_data));
OP_REQUIRES_OK(context, context->allocate_output(1, outshape1, &output_data1));
auto out_tensor = output_data->tensor<T,1>();
auto out_tensor1 = output_data1->tensor<T,1>();
out_tensor.setConstant(0);
for(auto j=0; j<data_nr; ++j) {
out_tensor(j) = res_data[j];
}
for(auto j=0; j<res_data1.size(); ++j) {
out_tensor1(j) = res_data1[j];
}
}
static auto get_distance(const Eigen::Tensor<float,1,Eigen::RowMajor>& box0,
const Eigen::Tensor<float,1,Eigen::RowMajor>& box1
) {
float xdis;
const float ydis = fabs(box0(0)+box0(2)-box1(0)-box1(2))/2.0f;
const float box_h = (box0(2)-box0(0));
if(fabs(box_h-(box1(2)-box1(0)))>1e-2) {
cout<<"Error box height "<<box_h<<", "<<(box1(2)-box1(0))<<endl;
}
if(ydis<0.8*box_h)
return make_pair(1e8f,1e8f);
if(box0(1)>=box1(3)) {
xdis = box0(1)-box1(3);
} else if(box0(3)<=box1(1)) {
xdis = box1(1)-box0(3);
} else {
xdis = 0.0f;
}
return make_pair(xdis,ydis);
}
static auto get_distance_matrix(const Eigen::Tensor<T,1,Eigen::RowMajor>& labels,
const Eigen::Tensor<float,2,Eigen::RowMajor>& bboxes,int data_nr) {
const auto kMaxDis = 1e8;
Eigen::Tensor<float,3,Eigen::RowMajor> dis(data_nr,data_nr,2); //dis(x,y)
dis.setConstant(kMaxDis);
for(auto i=0; i<data_nr; ++i) {
dis(i,i,0) = 0;
dis(i,i,1) = 0;
for(auto j=i+1; j<data_nr; ++j) {
if(labels(i) != labels(j)) continue;
const auto b_dis = get_distance(bboxes.chip(i,0),bboxes.chip(j,0));
dis(i,j,0) = b_dis.first;
dis(i,j,1) = b_dis.second;
dis(j,i,0) = b_dis.first;
dis(j,i,1) = b_dis.second;
}
}
return dis;
}
template<typename DT>
void label_one(const DT& dis_matrix,
int index,
const Eigen::Tensor<float,2,Eigen::RowMajor>& data,
vector<int>& ids,
int data_nr) {
for(auto j=0; j<data_nr; ++j) {
if(ids[j]>0) continue;
if((dis_matrix(index,j,0) < dis_threshold_[0])
&&(dis_matrix(index,j,1) < dis_threshold_[1])
&& (data(index,j) <threshold_)){
ids[j] = ids[index];
label_one(dis_matrix,j,data,ids,data_nr);
}
}
}
vector<int> process(const Eigen::Tensor<float,2,Eigen::RowMajor>& data,
const Eigen::Tensor<T,1,Eigen::RowMajor>& labels,
const Eigen::Tensor<float,2,Eigen::RowMajor>& bboxes,int data_nr) {
const auto dis_matrix = get_distance_matrix(labels,bboxes,data_nr);
vector<int> ids(data_nr,0);
int id = 0;
for(auto i=0; i<data_nr; ++i) {
if(ids[i] == 0) {
ids[i] = ++id;
}
const Eigen::Tensor<float,1,Eigen::RowMajor> data_i = data.chip(i,0);
label_one(dis_matrix,i,data,ids,data_nr);
}
return ids;
}
private:
vector<float> dis_threshold_;
float threshold_ = 0.0f;
};
REGISTER_KERNEL_BUILDER(Name("MergeLineBoxes").Device(DEVICE_CPU).TypeConstraint<int>("T"), MergeLineBoxesOp<CPUDevice, int>);
REGISTER_KERNEL_BUILDER(Name("MergeLineBoxes").Device(DEVICE_CPU).TypeConstraint<tensorflow::int64>("T"), MergeLineBoxesOp<CPUDevice, tensorflow::int64>);
/*
* limit:[min_size,max_size], satisfy max(out_size)<=max_size,min(out_size)>=min_size, if min_size/max_size is -1 or 1, means no limit
* if both min_size and max_size return the input size
* align:satisfy out_size[0]%align[0] == 0 and out_size[1]%align[1] == 0
* Try to keep the ratio constant
*/
REGISTER_OP("GetImageResizeSize")
.Input("size: int32")
.Input("limit:int32")
.Input("align:int32")
.Output("output_size:int32")
.SetShapeFn([](shape_inference::InferenceContext* c){
auto shape0 = c->Vector(2);
c->set_output(0,shape0);
return Status::OK();
});
class GetImageResizeSizeOp: public OpKernel {
public:
explicit GetImageResizeSizeOp(OpKernelConstruction* context) : OpKernel(context) {
}
void Compute(OpKernelContext* context) override
{
const Tensor &_size = context->input(0);
const Tensor &_limit= context->input(1);
const Tensor &_align= context->input(2);
OP_REQUIRES(context, _size.dims() == 1, errors::InvalidArgument("size must be 1-dimensional"));
OP_REQUIRES(context, _limit.dims() == 1, errors::InvalidArgument("limit must be 1-dimensional"));
OP_REQUIRES(context, _align.dims() == 1, errors::InvalidArgument("align must be 1-dimensional"));
auto size= _size.tensor<int,1>();
auto limit = _limit.flat<int>().data();
auto align = _align.flat<int>().data();
int out_size[2];
auto scale = 1.0;
if((limit[0]<1) && (limit[1]<1)) {
out_size[0] = size(0);
out_size[1] = size(1);
} else if((limit[0]>0) && (limit[1]>0)) {
if(size(0)<size(1))
scale = std::min(float(limit[0])/size(0),float(limit[1])/size(1));
else
scale = std::min(float(limit[0])/size(1),float(limit[1])/size(0));
} else if(limit[1]<1) {
if(size(0)<size(1))
scale = float(limit[0])/size(0);
else
scale = float(limit[0])/size(1);
} else if(limit[0]<1) {
if(size(0)<size(1))
scale = float(limit[1])/size(1);
else
scale = float(limit[1])/size(0);
}
out_size[0] = size(0)*scale+0.5;
out_size[1] = size(1)*scale+0.5;
if(limit[0]>0) {
if(out_size[0]<limit[0])
out_size[0] = limit[0];
else if(out_size[1]<limit[0])
out_size[1] = limit[0];
}
if(align[1]>1)
out_size[1] = ((out_size[1]+align[1]-1)/align[1])*align[1];
if(align[0]>1)
out_size[0] = ((out_size[0]+align[0]-1)/align[0])*align[0];
TensorShape outshape0;
Tensor *output_size = nullptr;
int dims_1d0[1] = {2};
TensorShapeUtils::MakeShape(dims_1d0, 1, &outshape0);
OP_REQUIRES_OK(context, context->allocate_output(0, outshape0, &output_size));
auto output_tensor = output_size->tensor<int,1>();
output_tensor(0) = out_size[0];
output_tensor(1) = out_size[1];
}
};
REGISTER_KERNEL_BUILDER(Name("GetImageResizeSize").Device(DEVICE_CPU), GetImageResizeSizeOp);
/*
* image[H,W,C]
* boxes[N,4], 绝对坐标
*/
REGISTER_OP("FillBBoxes")
.Attr("T: {float, double}")
.Attr("v: float")
.Attr("include_last: bool=True")
.Input("image: T")
.Input("bboxes: T")
.Output("output:T")
.SetShapeFn([](shape_inference::InferenceContext* c){
c->set_output(0,c->input(0));
return Status::OK();
});
template <typename Device, typename T>
class FillBoxesOp: public OpKernel {
public:
explicit FillBoxesOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("v", &v_));
OP_REQUIRES_OK(context, context->GetAttr("include_last", &include_last_));
}
void Compute(OpKernelContext* context) override
{
const Tensor &_image = context->input(0);
const Tensor &_bboxes = context->input(1);
OP_REQUIRES(context, _image.dims() == 3, errors::InvalidArgument("images data must be 3-dimensional"));
OP_REQUIRES(context, _bboxes.dims() == 2, errors::InvalidArgument("boxes data must be 2-dimensional"));
auto image = _image.tensor<T,3>();
const auto bboxes = _bboxes.tensor<T,2>();
const auto box_nr = _bboxes.dim_size(0);
TensorShape output_shape = _image.shape();
Tensor *output_tensor = nullptr;
OP_REQUIRES_OK(context,context->allocate_output(0,output_shape,&output_tensor));
auto out_tensor = output_tensor->tensor<T,3>();
out_tensor = image;
for(auto i=0; i<box_nr; ++i)
draw_a_box(out_tensor,bboxes.chip(i,0));
}
template<typename IT>
void draw_a_box(IT& image,const Eigen::Tensor<T,1,Eigen::RowMajor>& box) {
//使用float结束,结果更准确
const auto xmin = max<int>(0,box(1));
const auto xmax = min<float>(image.dimension(1),box(3));
const auto ymin = max<int>(0,box(0));
const auto ymax = min<float>(image.dimension(0),box(2));
const auto channel = image.dimension(2);
if(include_last_)
for(int x=xmin; x<=xmax; ++x) {
for(int y=ymin; y<=ymax; ++y) {
for(auto z=0; z<channel; ++z)
image(y,x,z) = v_;
}
}
else
for(int x=xmin; x<xmax; ++x) {
for(int y=ymin; y<ymax; ++y) {
for(auto z=0; z<channel; ++z)
image(y,x,z) = v_;
}
}
}
private:
float v_ = 1.0;
bool include_last_ = true;
};
REGISTER_KERNEL_BUILDER(Name("FillBBoxes").Device(DEVICE_CPU).TypeConstraint<float>("T"), FillBoxesOp<CPUDevice, float>);
/*
* 在data最后一维为True的位置随机选择出nr个,并将其它的设置为False
* data: [D0,D1,...,Dn] a bool tensor
* indices:[D0,D1,...,nr] 与返回值相对应的indices
*/
REGISTER_OP("RandomSelect")
.Attr("nr: int")
.Attr("sort_indices: bool = False")
.Input("data: bool")
.Output("output:bool")
.Output("indices:int32")
.SetShapeFn([](shape_inference::InferenceContext* c) {
auto input_shape0 = c->input(0);
const auto dims = c->Rank(input_shape0);
int nr;
c->GetAttr("nr",&nr);
shape_inference::ShapeHandle tmp_shape0;
shape_inference::ShapeHandle tmp_shape1 = c->MakeShape({nr});
shape_inference::ShapeHandle output_shape1;
c->Subshape(input_shape0,0,-1,&tmp_shape0);
c->Concatenate(tmp_shape0,tmp_shape1,&output_shape1);
c->set_output(0, input_shape0);
c->set_output(1, output_shape1);
return Status::OK();
});
template <typename Device>
class RandomSelectOp: public OpKernel {
public:
explicit RandomSelectOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("nr", &nr_));
OP_REQUIRES_OK(context, context->GetAttr("sort_indices", &sort_indices_));
}
void Compute(OpKernelContext* context) override
{
const Tensor &_tensor = context->input(0);
auto tensor = _tensor.template flat<bool>().data();
auto dim_nr = _tensor.dims();
const auto block_size = _tensor.dim_size(dim_nr-1);
const auto total_nr = _tensor.NumElements()/block_size;
Tensor* output_data = NULL;
Tensor* output_indices = NULL;
TensorShape output_shape1 = _tensor.shape();
output_shape1.set_dim(dim_nr-1,nr_);
OP_REQUIRES(context, _tensor.dims() >= 1, errors::InvalidArgument("data must be at lest 1-dimensional"));
OP_REQUIRES_OK(context, context->allocate_output(0, _tensor.shape(), &output_data));
OP_REQUIRES_OK(context, context->allocate_output(1, output_shape1, &output_indices));
auto oq_tensor = output_data->template flat<bool>().data();
auto oi_tensor = output_indices->template flat<int>().data();
const auto kMaxThreadNr = 100;
std::vector<std::future<void>> res;
const auto kDataNrPerThread = 20000;
const auto kBatchSizePerThread = std::max<int>(1,kDataNrPerThread/block_size);
output_indices->template flat<int>().setZero();
copy(tensor,tensor+_tensor.NumElements(),oq_tensor);
for(auto i=0; i<total_nr; i+=kBatchSizePerThread) {
res.emplace_back(std::move(std::async(std::launch::async,
process_one_batch,oq_tensor+i*block_size,oi_tensor+i*nr_,
std::min<int>(kBatchSizePerThread,total_nr-i),
block_size,nr_,sort_indices_
)));
if(res.size()>kMaxThreadNr)
res.clear();
}
res.clear();
}
static void process_one_batch(bool* data,int* o_indices,int batch_size,int size,int nr,bool sort_indices){
for(auto i=0; i<batch_size; ++i) {
process_one_block(data+i*size,o_indices+i*nr,size,nr,sort_indices);
}
}
static void process_one_block(bool* data,int* o_indices,int size,int nr,bool sort_indices){
vector<int> indices;
indices.reserve(nr*2);
for(auto i=0; i<size; ++i){
if(data[i])
indices.push_back(i);
}
if(indices.size()>=nr) {
std::random_shuffle(indices.begin(),indices.end());
for(auto i=nr; i<indices.size(); ++i) {
data[indices[i]] = false;
}
}
nr = std::min<int>(nr,indices.size());
if(sort_indices)
std::sort(indices.begin(),std::next(indices.begin(),nr));
for(auto i=0; i<nr; ++i) {
o_indices[i] = indices[i];
}
}
private:
int nr_ = 1;
bool sort_indices_ = false;
};
REGISTER_KERNEL_BUILDER(Name("RandomSelect").Device(DEVICE_CPU), RandomSelectOp<CPUDevice>);
/*
* 将输入数据按其值的大小均分为his_nr个值域,从每个值域中选出select_nr/his_nr个值(如果某个值域中没有足够
* 的数据,同一个值可能被选择多次)
* 返回为所选择的数据的index, 如果需要排序则按index的大小从小到大排
* data: [N]
* output: [select_nr]
*/
REGISTER_OP("HisRandomSelect")
.Attr("T: {float, double,int32}")
.Attr("his_nr: int=0")
.Attr("min: float=0")
.Attr("max: float=0")
.Attr("const_min_max: bool=True")
.Attr("sort_indices: bool = False")
.Input("data: T")
.Input("select_nr: int32")
.Output("indices:int32")
.SetShapeFn([](shape_inference::InferenceContext* c) {
shape_inference::ShapeHandle tmp_shape = c->MakeShape({-1});
c->set_output(0, tmp_shape);
return Status::OK();
});
template <typename Device,typename T>
class HisRandomSelectOp: public OpKernel {
public:
explicit HisRandomSelectOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("his_nr", &his_nr_));
OP_REQUIRES_OK(context, context->GetAttr("max", &max_));
OP_REQUIRES_OK(context, context->GetAttr("min", &min_));
OP_REQUIRES_OK(context, context->GetAttr("const_min_max", &const_min_max_));
OP_REQUIRES_OK(context, context->GetAttr("sort_indices", &sort_indices_));
std::srand(std::time(nullptr)); // use current time as seed for random generator
}
void Compute(OpKernelContext* context) override
{
const Tensor &_tensor = context->input(0);
auto tensor = _tensor.template flat<T>().data();
auto data_nr = _tensor.dim_size(0);
const Tensor &_select_nr = context->input(1);
auto select_nr = _select_nr.template flat<int>().data()[0];
Tensor *output_indices = NULL;
int dim1[] = {select_nr};
TensorShape output_shape;
TensorShapeUtils::MakeShape(dim1,1,&output_shape);
OP_REQUIRES(context, _tensor.dims() == 1, errors::InvalidArgument("data must be at 1-dimensional"));
OP_REQUIRES_OK(context, context->allocate_output(0, output_shape, &output_indices));
if(!const_min_max_) {
auto res = minmax_element(tensor,tensor+data_nr);
min_ = *res.first;
max_ = *res.second;
}
vector<vector<int>> indices(his_nr_);
const auto delta = (max_-min_)/his_nr_;
const auto bin_nr = select_nr/his_nr_;
auto out_data = output_indices->template flat<int>().data();
vector<int> unused_index;
unused_index.reserve(max<int>(16,data_nr-select_nr));
for(auto i=0; i<data_nr; ++i) {
int idx = (tensor[i]-min_)/delta;
idx = min(idx,his_nr_-1);
idx = max(idx,0);
indices[idx].push_back(i);
}
int total_res_nr = 0;
for(auto i=0; i<his_nr_; ++i) {
auto& tmp_indices = indices[i];
auto tmp_data = random_select(tmp_indices.begin(),tmp_indices.end(),bin_nr,&unused_index);
copy(tmp_data.begin(),tmp_data.end(),out_data+total_res_nr);
total_res_nr += tmp_data.size();
}
if(total_res_nr<select_nr) {
const auto tmp_sel_nr = select_nr-total_res_nr;
if(unused_index.size()>=tmp_sel_nr) {
auto tmp_data = random_select(unused_index.begin(),unused_index.end(),tmp_sel_nr);
copy(tmp_data.begin(),tmp_data.end(),out_data+total_res_nr);
} else {
vector<int> tmp_tensor(data_nr);
//copy(tensor,tensor+data_nr,tmp_tensor.begin());
generate(tmp_tensor.begin(),tmp_tensor.end(),[n=0]()mutable{return n++;});
auto tmp_data = random_select_v2(tmp_tensor.begin(),tmp_tensor.end(),tmp_sel_nr);
copy(tmp_data.begin(),tmp_data.end(),out_data+total_res_nr);
}
}
if(sort_indices_)
sort(out_data,out_data+select_nr);
}
template<typename IT>
vector<int> random_select(IT begin, IT end, int nr,vector<int>* unused_index=nullptr) {
vector<int> res;
const auto input_nr = distance(begin,end);
if((0 == input_nr) || (nr==0))
return res;
res.reserve(nr);
std::random_shuffle(begin,end);
if(nr<input_nr) {
res.insert(res.end(),begin,next(begin,nr));
if(nullptr != unused_index)
unused_index->insert(unused_index->end(),next(begin,nr),end);
} else {
res.insert(res.end(),begin,end);
}
return res;
}
template<typename IT>
vector<int> random_select_v2(IT begin, IT end, int nr) {
vector<int> res;
const auto input_nr = distance(begin,end);
if((0 == input_nr) || (nr==0))
return res;
res.reserve(nr);
std::random_shuffle(begin,end);
if(nr<=input_nr) {
res.insert(res.end(),begin,next(begin,nr));
} else {
auto repeat_nr = nr/input_nr;
for(auto i=0; i<repeat_nr; ++i) {
res.insert(res.end(),begin,end);
}
repeat_nr = nr-res.size();
res.insert(res.end(),begin,next(begin,repeat_nr));
}
return res;
}
private:
int his_nr_ = 1;
bool const_min_max_ = true;
float min_ = 0;
float max_ = 0;
bool sort_indices_ = false;
};
/*
* int特化版本
* 针对每一个值取相同的数量的样本
*/
template <typename Device>
class HisRandomSelectOp<Device,int>: public OpKernel {
using T = int;
public:
explicit HisRandomSelectOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("sort_indices", &sort_indices_));
std::srand(std::time(nullptr)); // use current time as seed for random generator
}
void Compute(OpKernelContext* context) override
{
const Tensor &_tensor = context->input(0);
auto tensor = _tensor.template flat<T>().data();
auto data_nr = _tensor.dim_size(0);
const Tensor &_select_nr = context->input(1);
auto select_nr = _select_nr.template flat<int>().data()[0];
Tensor *output_indices = NULL;
int dim1[] = {select_nr};
TensorShape output_shape;
TensorShapeUtils::MakeShape(dim1,1,&output_shape);
OP_REQUIRES(context, _tensor.dims() == 1, errors::InvalidArgument("data must be at 1-dimensional"));
OP_REQUIRES_OK(context, context->allocate_output(0, output_shape, &output_indices));
map<int,vector<int>> indices;
auto out_data = output_indices->template flat<int>().data();
vector<int> unused_index;
unused_index.reserve(max<int>(16,data_nr-select_nr));
for(auto i=0; i<data_nr; ++i) {
const int key = tensor[i];
if(indices.find(key) == indices.end())
indices[key] = vector<int>();
indices[key].push_back(i);
}
int total_res_nr = 0;
const int bin_nr = select_nr/indices.size();
if(bin_nr>0) {
for(auto it=indices.begin(); it != indices.end(); ++it) {
auto& tmp_indices = it->second;
auto tmp_data = random_select(tmp_indices.begin(),tmp_indices.end(),bin_nr,&unused_index);
copy(tmp_data.begin(),tmp_data.end(),out_data+total_res_nr);
total_res_nr += tmp_data.size();
}
}
if(total_res_nr<select_nr) {
const auto tmp_sel_nr = select_nr-total_res_nr;
if(unused_index.size()>=tmp_sel_nr) {
auto tmp_data = random_select(unused_index.begin(),unused_index.end(),tmp_sel_nr);
copy(tmp_data.begin(),tmp_data.end(),out_data+total_res_nr);
} else {
vector<int> tmp_tensor(data_nr);
generate(tmp_tensor.begin(),tmp_tensor.end(),[n=0]()mutable{return n++;});
auto tmp_data = random_select_v2(tmp_tensor.begin(),tmp_tensor.end(),tmp_sel_nr);
copy(tmp_data.begin(),tmp_data.end(),out_data+total_res_nr);
}
}
if(sort_indices_)
sort(out_data,out_data+select_nr);
}
template<typename IT>
vector<int> random_select(IT begin, IT end, int nr,vector<int>* unused_index=nullptr) {
vector<int> res;
const auto input_nr = distance(begin,end);
if((0 == input_nr) || (nr==0))
return res;
res.reserve(nr);
std::random_shuffle(begin,end);
if(nr<input_nr) {
res.insert(res.end(),begin,next(begin,nr));
if(nullptr != unused_index)
unused_index->insert(unused_index->end(),next(begin,nr),end);
} else {
res.insert(res.end(),begin,end);
}
return res;
}
template<typename IT>
vector<int> random_select_v2(IT begin, IT end, int nr) {
vector<int> res;
const auto input_nr = distance(begin,end);
if((0 == input_nr) || (nr==0))
return res;
res.reserve(nr);
std::random_shuffle(begin,end);
if(nr<=input_nr) {
res.insert(res.end(),begin,next(begin,nr));
} else {
auto repeat_nr = nr/input_nr;
for(auto i=0; i<repeat_nr; ++i) {
res.insert(res.end(),begin,end);
}
repeat_nr = nr-res.size();
res.insert(res.end(),begin,next(begin,repeat_nr));
}
return res;
}
private:
bool sort_indices_ = false;
};
REGISTER_KERNEL_BUILDER(Name("HisRandomSelect").Device(DEVICE_CPU).TypeConstraint<float>("T"), HisRandomSelectOp<CPUDevice,float>);
REGISTER_KERNEL_BUILDER(Name("HisRandomSelect").Device(DEVICE_CPU).TypeConstraint<int>("T"), HisRandomSelectOp<CPUDevice,int>);
/*
data:输入Tensor,shape为[X,Y]
输出:output shape为[X*(1+expand_nr),Y]
如输入[[1,2],
[3,4]]
expand_nr = 2:
输出:
[[1,2],
[1,2],
[1,2],
[3,4],
[3,4],
[3,4]]
*/
REGISTER_OP("ExpandTensor")
.Attr("T: {int32, int64,float32,float64}")
.Attr("expand_nr:int")
.Input("data: T")
.Output("output:T")
.SetShapeFn([](shape_inference::InferenceContext* c){
auto dims_data0 = c->input(0);
int expand_nr = 0;
c->GetAttr("expand_nr",&expand_nr);
auto batch_size = c->Value(c->Dim(dims_data0,0))*(1+expand_nr);
auto output_shape0 = c->Matrix(batch_size,c->Dim(dims_data0,1));
c->set_output(0,output_shape0);
return Status::OK();
});
template <typename Device, typename T>
class ExpandTensorOp: public OpKernel {
public:
explicit ExpandTensorOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context,
context->GetAttr("expand_nr", &expand_nr));
}
void Compute(OpKernelContext* context) override
{
const Tensor &data= context->input(0);
auto data_flat = data.flat<T>();
OP_REQUIRES(context, data.dims() == 2, errors::InvalidArgument("data data must be 2-dimensional"));
const auto batch_size = data.dim_size(0);
const auto num_output = batch_size *(1+expand_nr);
const auto data_len = data.dim_size(1);
TensorShape output_shape0({num_output,data_len});
Tensor* output_data = NULL;
OP_REQUIRES_OK(context, context->allocate_output(0, output_shape0, &output_data));
auto oq_flat = output_data->flat<T>();
for(auto i=0; i<batch_size; ++i) {
auto bq_i = data_flat.data()+data_len*i;
auto bq_o = oq_flat.data()+data_len*i*(expand_nr+1);
for(auto k=0; k<=expand_nr; ++k) {
for(auto j=0; j<data_len; ++j) {
bq_o[j] = bq_i[j];
}
bq_o += data_len;
}
}
}
private:
int expand_nr;
};
REGISTER_KERNEL_BUILDER(Name("ExpandTensor").Device(DEVICE_CPU).TypeConstraint<int32_t>("T"), ExpandTensorOp<CPUDevice, int32_t>);
REGISTER_KERNEL_BUILDER(Name("ExpandTensor").Device(DEVICE_CPU).TypeConstraint<float>("T"), ExpandTensorOp<CPUDevice, float>);
REGISTER_KERNEL_BUILDER(Name("ExpandTensor").Device(DEVICE_CPU).TypeConstraint<double>("T"), ExpandTensorOp<CPUDevice, double>);
Status slide_batch_shape(shape_inference::InferenceContext* c)
{
auto shape = c->input(0);
auto filter_shape = c->input(1);
string padding;
vector<int> strides;
shape_inference::ShapeHandle output;
c->GetAttr("padding",&padding);
c->GetAttr("strides",&strides);
auto org_h = c->Value(c->Dim(shape,0));
auto org_w = c->Value(c->Dim(shape,1));
if(padding == "SAME") {
org_h += (c->Value(c->Dim(filter_shape,0))-1);
org_w += (c->Value(c->Dim(filter_shape,1))-1);
}
const auto h_size = (org_h-c->Value(c->Dim(filter_shape,0)))/strides[0]+1;
const auto w_size = (org_w-c->Value(c->Dim(filter_shape,1)))/strides[1]+1;
c->Concatenate(c->MakeShape({h_size,w_size}),shape,&output);
c->set_output(0,output);
return Status::OK();
}
/*
* 输入一个[H,W,C]或[H,W]的tensor
* 输出一个[H1,W1,H,W,C]的tensor
* filter:[h,w,c]或[h,w]
* H1,W1指定的每一个tensor都是原tensor在相应位置与filter相乘的结果
*/
REGISTER_OP("SlideBatch")
.Attr("T: {int32, int64,float32,float64}")
.Attr("strides:list(int)")
.Attr("padding:string")
.Input("data: T")
.Input("filter: T")
.Output("output:T")
.SetShapeFn(slide_batch_shape);
template <typename Device, typename T>
class SlideBatchOp: public OpKernel {
public:
explicit SlideBatchOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("strides", &strides_));
OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_));
}
inline bool is_same() const {
return padding_ == "SAME";
}
inline bool is_valid()const {
return !is_same();
}
inline int h_stride()const { return strides_[0]; }
inline int w_stride()const { return strides_[1]; }
inline int h_begin(int fh)const {
if(is_same())
return (1-fh)/2;
else
return 0;
}
inline int h_end(int fh,int h)const {
if(is_same())
return h-1;
else
return h-fh+1;
}
inline int w_begin(int fw)const {
if(is_same())
return (1-fw)/2;
else
return 0;
}
inline int w_end(int fw,int w)const {
if(is_same())
return w-1;
else
return w-fw+1;
}
inline size_t output_h_size(int fh,int h) const {
return (h_end(fh,h)-h_begin(fh))/h_stride();
}
inline size_t output_w_size(int fw,int w) const {
return (w_end(fw,w)-w_begin(fw))/w_stride();
}
void Compute(OpKernelContext* context) override
{
const Tensor &data = context->input(0);
const Tensor &filter = context->input(1);
const int fh = filter.dim_size(0);
const int fw = filter.dim_size(1);
Eigen::Tensor<T, 3,Eigen::RowMajor> data_t = data.template tensor<T,3>();
Eigen::Tensor<T,3,Eigen::RowMajor> filter_t = filter.template tensor<T,3>();
auto data_flat = data.flat<T>();
auto filter_flat = filter.flat<T>();
const int h = data_t.dimension(0);
const int w = data_t.dimension(1);
const int c = data_t.dimension(2);
const int oh = output_h_size(fh,h);
const int ow = output_w_size(fw,w);
TensorShape output_shape0({oh,ow,data.dim_size(0),data.dim_size(1),c});
cout<<"oh="<<oh<<", ow="<<ow<<endl;
Tensor* output_data = NULL;
OP_REQUIRES_OK(context, context->allocate_output(0, output_shape0, &output_data));
auto oq_tensor = output_data->template tensor<T,5>();
const int size[] = {h,w,c};
for(auto i=0; i<oh; ++i) {
for(auto j=0; j<ow; ++j) {
Eigen::array<int, 3> offsets = {h_begin(fh)+h_stride()*i,w_begin(fw)+w_stride()*j,0};
Eigen::array<int, 3> extents = {fh, fw,c};
Eigen::array<int, 3> offsets1 = {0,0};
correct(offsets,extents,offsets1,size);
auto v = data_t.slice(offsets, extents) *filter_t.slice(offsets1,extents);
auto target = oq_tensor.chip(i,0).chip(j,0);
target = data_t;
target.slice(offsets,extents) = v;
}
}
}
static void correct(Eigen::array<int,3>& offsets,Eigen::array<int,3>& extents, Eigen::array<int,3>& offsets1,const int size[3] ) {
for(auto i=0; i<3; ++i) {
if(offsets[i]< 0) {
extents[i] = offsets[i]+extents[i];
offsets1[i] = -offsets[i];
offsets[i] = 0;
} else if(offsets[i]+extents[i] > size[i]) {
extents[i] = size[i]-offsets[i];
}
}
}
private:
vector<int> strides_;
string padding_;
};
REGISTER_KERNEL_BUILDER(Name("SlideBatch").Device(DEVICE_CPU).TypeConstraint<int32_t>("T"), SlideBatchOp<CPUDevice, int32_t>);
REGISTER_KERNEL_BUILDER(Name("SlideBatch").Device(DEVICE_CPU).TypeConstraint<float>("T"), SlideBatchOp<CPUDevice, float>);
REGISTER_KERNEL_BUILDER(Name("SlideBatch").Device(DEVICE_CPU).TypeConstraint<double>("T"), SlideBatchOp<CPUDevice, double>);
/*
* 输入data 1D:Tensor
* padding:表示在axis 0上进行对称padding的数量,负数或0表示无操作
* 如果原有数据的数量为0, 则使用0填充
*/
REGISTER_OP("WPad")
.Attr("T: {int32, int64,float32,float64}")
.Input("tensor: T")
.Input("padding: int32")
.Output("data:T");
template <typename Device, typename T>
class WPadOp: public OpKernel {
public:
explicit WPadOp(OpKernelConstruction* context) : OpKernel(context) {
}
void Compute(OpKernelContext* context) override
{
const Tensor &_data = context->input(0);
const Tensor &_padding = context->input(1);
auto data = _data.template flat<T>().data();
auto padding = _padding.template flat<int>().data();
const auto data_nr = _data.dim_size(0);
const auto out_size = data_nr+ std::max<int>(0,padding[0])+std::max<int>(0,padding[1]);
OP_REQUIRES(context, _data.dims()<=1, errors::InvalidArgument("tensor data must be 1-dimensional"));
OP_REQUIRES(context, _padding.dims()<=1, errors::InvalidArgument("padding data must be 1-dimensional"));
TensorShape output_shape0({out_size});
Tensor* output_data = NULL;
OP_REQUIRES_OK(context, context->allocate_output(0, output_shape0, &output_data));
auto oq_tensor = output_data->template flat<T>().data();
/*
* 如果原始数据中没有内容,使用0填充
*/
if(data_nr == 0) {
for(auto i=0; i<out_size; ++i) {
oq_tensor[i] = 0.0f;
}
return;
}
/*
* 原始数据中有内容,对称填充
*/
for(auto i=0; i<padding[0]; ++i) {
oq_tensor[i] = data[(padding[0]-i-1)%data_nr];
}
auto base_index = std::max<int>(0,padding[0]);
for(auto i=0; i<data_nr; ++i) {
oq_tensor[i+base_index] = data[i];
}
base_index = std::max<int>(0,padding[0])+data_nr;
auto src_index = data_nr-1;
for(auto i=0; i<padding[1]; ++i,--src_index) {
if(src_index<0)
src_index = data_nr-1;
oq_tensor[i+base_index] = data[src_index];
}
}
};
REGISTER_KERNEL_BUILDER(Name("WPad").Device(DEVICE_CPU).TypeConstraint<int32_t>("T"), WPadOp<CPUDevice, int32_t>);
REGISTER_KERNEL_BUILDER(Name("WPad").Device(DEVICE_CPU).TypeConstraint<float>("T"), WPadOp<CPUDevice, float>);
/*
* 设置多个子tensor的值
* 输入tensor [X,Y,Z,...,M,N,..]tensor
* 输入v[M,N,...] tensor
* 输入index[num],依次表示[X,Y,Z,...]维度的值
* 将tensor中由index指定的值设置为
* example:
* tensor shape=[2,3,4,2,2]
* v shape=[2,2]
* index=[[0,1,3]]
* 那么tensor[0,1,3]=v
*/
REGISTER_OP("SetValue")
.Attr("T: {int32,int64,float32,float64,bool}")
.Input("tensor: T")
.Input("v: T")
.Input("index: int32")
.Output("data:T")
.SetShapeFn(shape_inference::UnchangedShape);
template <typename Device, typename T>
class SetValueOp: public OpKernel {
public:
explicit SetValueOp(OpKernelConstruction* context) : OpKernel(context) {
}
void Compute(OpKernelContext* context) override
{
const Tensor &_tensor = context->input(0);
const Tensor &_v = context->input(1);
const Tensor &_index = context->input(2);
OP_REQUIRES(context, _index.dims()==2, errors::InvalidArgument("index must be 2-dimensional"));
auto tensor = _tensor.template flat<T>().data();
auto v = _v.template flat<T>().data();
auto indexs = _index.template tensor<int,2>();
auto dim_nr = _tensor.dims();
auto skip_dim_nr = _index.dim_size(1);
const auto block_size = _v.NumElements();
Tensor* output_data = NULL;
OP_REQUIRES_OK(context, context->allocate_output(0, _tensor.shape(), &output_data));
auto oq_tensor = output_data->template flat<T>().data();
copy(tensor,tensor+_tensor.NumElements(),oq_tensor);
/*
* 如果原始数据中没有内容,使用0填充
*/
const auto nr = _index.dim_size(0);
for(auto i=0; i<nr; ++i) {
auto offset = 0;
auto cur_block_size = block_size;
for(auto j=skip_dim_nr-1; j>=0; --j) {
offset += indexs(i,j)*cur_block_size;
cur_block_size *= _tensor.dim_size(j);
}
copy(v,v+block_size,oq_tensor+offset);
}
}
};
REGISTER_KERNEL_BUILDER(Name("SetValue").Device(DEVICE_CPU).TypeConstraint<int32_t>("T"), SetValueOp<CPUDevice, int32_t>);
REGISTER_KERNEL_BUILDER(Name("SetValue").Device(DEVICE_CPU).TypeConstraint<float>("T"), SetValueOp<CPUDevice, float>);
REGISTER_KERNEL_BUILDER(Name("SetValue").Device(DEVICE_CPU).TypeConstraint<double>("T"), SetValueOp<CPUDevice, double>);
REGISTER_KERNEL_BUILDER(Name("SetValue").Device(DEVICE_CPU).TypeConstraint<bool>("T"), SetValueOp<CPUDevice, bool>);
REGISTER_KERNEL_BUILDER(Name("SetValue").Device(DEVICE_CPU).TypeConstraint<tensorflow::int64>("T"), SetValueOp<CPUDevice, tensorflow::int64>);
/*
* 实现类似于numpy tensor[index[0][0]:index[0][1],index[1][0]:index[1][1],..] = v的功能
* 输入tensor [X,Y,Z,]tensor
* 输入 v,值
* 输入index [Nr,2] 分别表示tensor X,Y,Z...维度的起始及终止范围tensor
* example:
* tensor shape=[2,3,4,2,2]
* v =[0,9]
* index=[[1,3]]
* 那么tensor = [2,0,9,2,2]
*/
REGISTER_OP("ItemAssign")
.Attr("T: {int32,int64,float32,float64,bool,uint8,int8}")
.Input("tensor: T")
.Input("v: T")
.Input("index: int32")
.Output("data:T")
.SetShapeFn([](shape_inference::InferenceContext* c){
c->set_output(0,c->input(0));
return Status::OK();
});
template <typename Device, typename T>
class ItemAssignOp: public OpKernel {
public:
explicit ItemAssignOp(OpKernelConstruction* context) : OpKernel(context) {
}
void Compute(OpKernelContext* context) override
{
const Tensor &_tensor = context->input(0);
const Tensor &_v = context->input(1);
const Tensor &_index = context->input(2);
auto tensor_flat = _tensor.template flat<T>().data();
auto indexs = _index.template tensor<int,2>();
auto dim_nr = _tensor.dims();
auto index_nr = _index.dim_size(0);
OP_REQUIRES(context, _index.dims()==2, errors::InvalidArgument("index must be 2-dimensional"));
OP_REQUIRES(context, index_nr==dim_nr, errors::InvalidArgument("index size must equal tensor's dim size"));
Tensor* output_data = NULL;
OP_REQUIRES_OK(context, context->allocate_output(0, _tensor.shape(), &output_data));
auto oq_tensor = output_data->template flat<T>().data();
copy(tensor_flat,tensor_flat+_tensor.NumElements(),oq_tensor);
for(auto i=0; i<index_nr; ++i) {
if(indexs(i,0)==indexs(i,1))
return;
if((indexs(i,0)>indexs(i,1))
|| (indexs(i,0)<0)
|| (indexs(i,1)>_tensor.dim_size(i))) {
cout<<"Error index value ("<<indexs(i,0)<<","<<indexs(i,1)<<"), tensor dim size: "<<_tensor.dim_size(i)<<endl;
return;
}
}
if(1 == dim_nr) {
auto tensor = output_data->template tensor<T,1>();
auto v = _v.template tensor<T,1>();
Eigen::array<long,1> offset={indexs(0,0)};
Eigen::array<long,1> extents={indexs(0,1)-indexs(0,0)};
tensor.slice(offset,extents) = v;
} else if(2 == dim_nr) {
auto tensor = output_data->template tensor<T,2>();
auto v = _v.template tensor<T,2>();
Eigen::array<long,2> offset={indexs(0,0),indexs(1,0)};
Eigen::array<long,2> extents={indexs(0,1)-indexs(0,0),indexs(1,1)-indexs(1,0)};
tensor.slice(offset,extents) = v;
} else if(3 == dim_nr) {
auto tensor = output_data->template tensor<T,3>();
auto v = _v.template tensor<T,3>();
Eigen::array<long,3> offset={indexs(0,0),indexs(1,0),indexs(2,0)};
Eigen::array<long,3> extents={indexs(0,1)-indexs(0,0),indexs(1,1)-indexs(1,0),indexs(2,1)-indexs(2,0)};
tensor.slice(offset,extents) = v;
} else if(4 == dim_nr) {
auto tensor = output_data->template tensor<T,4>();
auto v = _v.template tensor<T,4>();
Eigen::array<long,4> offset={indexs(0,0),indexs(1,0),indexs(2,0),indexs(3,0)};
Eigen::array<long,4> extents={indexs(0,1)-indexs(0,0),indexs(1,1)-indexs(1,0),indexs(2,1)-indexs(2,0),indexs(3,1)-indexs(3,0)};
tensor.slice(offset,extents) = v;
} else {
cout<<"Error unimplement for dim_nr = "<<dim_nr<<endl;
}
}
};
REGISTER_KERNEL_BUILDER(Name("ItemAssign").Device(DEVICE_CPU).TypeConstraint<int32_t>("T"), ItemAssignOp<CPUDevice, int32_t>);
REGISTER_KERNEL_BUILDER(Name("ItemAssign").Device(DEVICE_CPU).TypeConstraint<float>("T"), ItemAssignOp<CPUDevice, float>);
REGISTER_KERNEL_BUILDER(Name("ItemAssign").Device(DEVICE_CPU).TypeConstraint<double>("T"), ItemAssignOp<CPUDevice, double>);
REGISTER_KERNEL_BUILDER(Name("ItemAssign").Device(DEVICE_CPU).TypeConstraint<bool>("T"), ItemAssignOp<CPUDevice, bool>);
REGISTER_KERNEL_BUILDER(Name("ItemAssign").Device(DEVICE_CPU).TypeConstraint<tensorflow::int64>("T"), ItemAssignOp<CPUDevice, tensorflow::int64>);
REGISTER_KERNEL_BUILDER(Name("ItemAssign").Device(DEVICE_CPU).TypeConstraint<uint8_t>("T"), ItemAssignOp<CPUDevice, uint8_t>);
REGISTER_KERNEL_BUILDER(Name("ItemAssign").Device(DEVICE_CPU).TypeConstraint<int8_t>("T"), ItemAssignOp<CPUDevice, int8_t>);
/*
* 对输入tensor的值计数,如输入[1,1,2,4,3,1,1,] max_value=7,输出
* [0,4,1,1,1,0,0,0]
*/
REGISTER_OP("Counting")
.Attr("T: {int32,int64,uint8,int8}")
.Attr("max_value:int")
.Input("tensor: T")
.Output("data:int32")
.SetShapeFn([](shape_inference::InferenceContext* c){
int max_value = 0;
c->GetAttr("max_value",&max_value);
auto shape0 = c->MakeShape({max_value+1});
c->set_output(0, shape0);
return Status::OK();
return Status::OK();
});
template <typename Device, typename T>
class CountingOp: public OpKernel {
public:
explicit CountingOp(OpKernelConstruction* context) : OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("max_value", &max_value_));
}
void Compute(OpKernelContext* context) override
{
const Tensor &_tensor = context->input(0);
auto tensor_flat = _tensor.template flat<T>().data();
auto total_nr = _tensor.NumElements();
Tensor* output_data = NULL;
TensorShape output_shape;
const int dim0[] = {max_value_+1};
TensorShapeUtils::MakeShape(dim0,1,&output_shape);
OP_REQUIRES_OK(context, context->allocate_output(0, output_shape, &output_data));
auto oq_tensor = output_data->template flat<int>();
oq_tensor.setZero();
for(auto i=0; i<total_nr; ++i) {
const auto v = tensor_flat[i];
oq_tensor(v) = oq_tensor(v)+1;
}
}
private:
int max_value_ = 0;
};
REGISTER_KERNEL_BUILDER(Name("Counting").Device(DEVICE_CPU).TypeConstraint<int32_t>("T"), CountingOp<CPUDevice, int32_t>);
REGISTER_KERNEL_BUILDER(Name("Counting").Device(DEVICE_CPU).TypeConstraint<uint8_t>("T"), CountingOp<CPUDevice, uint8_t>);
REGISTER_KERNEL_BUILDER(Name("Counting").Device(DEVICE_CPU).TypeConstraint<int8_t>("T"), CountingOp<CPUDevice, int8_t>);
REGISTER_KERNEL_BUILDER(Name("Counting").Device(DEVICE_CPU).TypeConstraint<tensorflow::int64>("T"), CountingOp<CPUDevice, tensorflow::int64>);
| 38.240113 | 173 | 0.56856 | vghost2008 |
12582c1c94e65991b001b7c8b821cb886a6f6b74 | 1,715 | cpp | C++ | test/main.cpp | pfeifenheini/cppProjects | c2ffd3e02711af041698ff32a8dd89498f6ee3e5 | [
"MIT"
] | null | null | null | test/main.cpp | pfeifenheini/cppProjects | c2ffd3e02711af041698ff32a8dd89498f6ee3e5 | [
"MIT"
] | null | null | null | test/main.cpp | pfeifenheini/cppProjects | c2ffd3e02711af041698ff32a8dd89498f6ee3e5 | [
"MIT"
] | null | null | null | #include <iostream>
#include <limits>
#include <queue>
#include <math.h>
#include <conio.h>
#include <mingw.thread.h>
#include <mingw.mutex.h>
using namespace std;
int currentNumber = 3;
int primeNumbersPrinted = 0;
int largestPrime = 2;
bool keepWorking = true;
mutex mu_currentNumber, mu_print, mu_keepWorking;
bool isPrime(int n)
{
if(n <= 1) return false;
if(n <= 3) return true;
if(n%2 == 0 || n%3 == 0) return false;
for(int i=5;i*i <= n;i+=6)
{
if(n%i == 0 || n%(i+2) == 0) return false;
}
return true;
}
void calcPrimes(int id)
{
bool working = true;
while(working)
{
mu_currentNumber.lock();
int toCheck = currentNumber;
currentNumber+=2;
mu_currentNumber.unlock();
if(isPrime(toCheck))
{
mu_print.lock();
//cout << toCheck << endl;
primeNumbersPrinted++;
if(toCheck > largestPrime)
largestPrime = toCheck;
mu_print.unlock();
}
mu_keepWorking.lock();
if(!keepWorking)
working = false;
mu_keepWorking.unlock();
}
}
int main()
{
thread t1(calcPrimes,1);
thread t2(calcPrimes,2);
thread t3(calcPrimes,3);
thread t4(calcPrimes,4);
while(true)
{
Sleep(1000);
mu_print.lock();
cout << largestPrime << endl;
if(kbhit())
{
getch();
keepWorking = false;
mu_print.unlock();
break;
}
mu_print.unlock();
}
mu_keepWorking.lock();
keepWorking = false;
mu_keepWorking.unlock();
t1.join();
t2.join();
t3.join();
t4.join();
}
| 18.244681 | 50 | 0.53586 | pfeifenheini |
1258d3e6997db21184b803589765e8df01d77019 | 4,622 | cpp | C++ | api/api_autogen/ui_form_extractor.cpp | nickdiorio/SAM | 4288d4261f4f88f44106867b561b81c2ba480c85 | [
"BSD-3-Clause"
] | null | null | null | api/api_autogen/ui_form_extractor.cpp | nickdiorio/SAM | 4288d4261f4f88f44106867b561b81c2ba480c85 | [
"BSD-3-Clause"
] | null | null | null | api/api_autogen/ui_form_extractor.cpp | nickdiorio/SAM | 4288d4261f4f88f44106867b561b81c2ba480c85 | [
"BSD-3-Clause"
] | null | null | null | #include <stdexcept>
#include <iostream>
#include "ui_form_extractor.h"
#include "equation_extractor.h"
#include "variables.h"
std::unordered_map<std::string, std::unordered_map<std::string, VarValue>> SAM_ui_form_to_defaults;
ui_form_extractor_database SAM_ui_extracted_db;
VarValue ui_form_extractor::get_varvalue(wxInputStream &is, wxString var_name) {
wxTextInputStream in(is, "\n");
VarValue vv;
in.Read8(); // ver
// read default
unsigned char m_type = in.Read8();
if (m_type > 0 && m_type < 4){
int nr = in.Read32();
int nc = in.Read32();
if (nc*nr > 1) {
for (size_t r = 0; r < nr; r++) {
in.ReadLine();
}
// need to do maybe
in.ReadLine();
}
else{
double def;
in.ReadLine().ToDouble(&def);
vv.Set(def);
}
}
// string
else if (m_type == 4){
if (in.Read32() > 0) vv.Set(in.ReadLine());
}
// table
else if (m_type == 5){
in.Read8(); //ver
size_t m = in.Read32();
VarTable vt;
for (size_t j = 0; j<m; j++)
{
std::string entry = in.ReadWord().ToStdString();
vt.Set(entry, get_varvalue(is, entry));
}
vv.Set(vt);
}
// binary
else if (m_type == 6){
size_t len = in.Read32();
for (size_t i = 0; i <len; i++)
in.GetChar();
vv.Set(wxMemoryBuffer());
}
return vv;
}
/// Formatting of UI form txt taken from InputPageData::Read, VarDatabase::Read
void ui_form_extractor::get_eqn_and_callback_script(wxInputStream& is) {
wxTextInputStream in(is, "\n");
for (size_t i = 0; i < 3; i++)
in.ReadLine();
// skipping through UI objects
size_t n = in.Read32();
for (size_t i = 0; i < n; i++){
in.ReadLine(); // type
in.ReadLine(); // space
in.ReadLine(); // visible
size_t m = in.Read32(); // ui objects
for (size_t j = 0; j < m; j++) {
wxString name = in.ReadLine(); // name
int type = in.Read16(); // property type
if (type == 6) {
// STRINGLIST
size_t count = in.Read32();
for (size_t k = 0; k < count; k++)
in.ReadWord();
}
else if (type == 5) {
if (in.Read32() > 0) in.ReadLine();
}
else if (type == 4) {
// COLOR
for (size_t k = 0; k < 4; k++) in.ReadLine();
} else in.ReadLine();
}
}
// save variable names while skipping through variable info
in.ReadLine();
n = in.Read32();
// save variable defaults for each configuration for use in ui script evaluation
for (size_t i = 0; i < n; i++){
std::string name = in.ReadWord().ToStdString();
auto it = SAM_ui_form_to_defaults[ui_form_name].find(name);
if (it != SAM_ui_form_to_defaults[ui_form_name].end())
it->second.Read_text(is);
else{
VarInfo vi;
vi.Read_text(is);
SAM_ui_form_to_defaults[ui_form_name].insert({name, vi.DefaultValue});
}
}
in.ReadLine();
// get equation script
m_eqn_script.clear();
n = in.Read32();
wxString tmp;
if (n > 0)
{
for (size_t i = 0; i < n; i++)
tmp.Append(in.GetChar());
}
m_eqn_script = tmp.ToStdString();
tmp.clear();
m_callback_script.clear();
n = in.Read32();
if (n > 0)
{
for (size_t i = 0; i < n; i++)
tmp.Append(in.GetChar());
}
m_callback_script = tmp.ToStdString();
}
bool ui_form_extractor::extract(std::string file) {
wxFileName ff(file);
// store the lk scripts
wxFFileInputStream is(file, "r");
bool bff = is.IsOk();
if (!bff) return false;
get_eqn_and_callback_script(is);
return true;
}
/// Populates SAM_ui_extracted_db, SAM_ui_form_to_eqn_info, and
bool ui_form_extractor_database::populate_ui_data(std::string ui_path, std::vector<std::string> ui_form_names){
for (size_t i = 0; i < ui_form_names.size(); i++){
std::string ui_name = ui_form_names[i];
ui_form_extractor* ui_fe = SAM_ui_extracted_db.make_entry(ui_name);
bool success = ui_fe->extract(ui_path + ui_name + ".txt");
if (!success){
std::cout << "ui_form_extractor_database error: Cannot open " + ui_name + " file at " + ui_path;
return false;
}
ui_fe->export_eqn_infos();
}
return true;
} | 27.843373 | 111 | 0.539161 | nickdiorio |
12593f01ce641e672b3eb0888d5903a7417dc730 | 48 | cpp | C++ | Estudos de Classes/main.cpp | miguelsrrobo/C-C- | 9126c613309e83d13000e665440fd46e72b109a9 | [
"MIT"
] | null | null | null | Estudos de Classes/main.cpp | miguelsrrobo/C-C- | 9126c613309e83d13000e665440fd46e72b109a9 | [
"MIT"
] | null | null | null | Estudos de Classes/main.cpp | miguelsrrobo/C-C- | 9126c613309e83d13000e665440fd46e72b109a9 | [
"MIT"
] | null | null | null | #include "mod.hpp"
int main()
{
return 0;
} | 8 | 18 | 0.5625 | miguelsrrobo |
125c27c799008c0d6a066b63a3974c7111d448e8 | 4,030 | cpp | C++ | src/bytecode/Operations.cpp | VCrate/bytecode-description | c46f61fda817301b6705bc16654c634dc2c3212d | [
"MIT"
] | 1 | 2018-04-14T14:04:39.000Z | 2018-04-14T14:04:39.000Z | src/bytecode/Operations.cpp | VCrate/bytecode-description | c46f61fda817301b6705bc16654c634dc2c3212d | [
"MIT"
] | null | null | null | src/bytecode/Operations.cpp | VCrate/bytecode-description | c46f61fda817301b6705bc16654c634dc2c3212d | [
"MIT"
] | null | null | null | #include <vcrate/bytecode/Operations.hpp>
#include <map>
#include <iostream>
#include <algorithm>
namespace vcrate { namespace bytecode {
OpDefinition::OpDefinition(std::string const& name, Operations ope, std::vector<ui8> const& args_constraints)
: name(name), ope(ope), args_constraints(args_constraints) {}
ui32 OpDefinition::arg_count() const {
return args_constraints.size();
}
ui8 OpDefinition::value() const {
return static_cast<ui8>(ope);
}
bool OpDefinition::should_be_readable(ui32 arg) const {
return args_constraints[arg] & ArgConstraint::Readable;
}
bool OpDefinition::should_be_writable(ui32 arg) const {
return args_constraints[arg] & ArgConstraint::Writable;
}
bool OpDefinition::should_be_addressable(ui32 arg) const {
return args_constraints[arg] & ArgConstraint::Adressable;
}
const OpDefinition& OpDefinition::get(std::string ope) {
std::transform(std::begin(ope), std::end(ope), std::begin(ope), [] (char c) { return std::toupper(c); });
#define OP(op, cs...) { #op, Operations::op }
static std::map<std::string, Operations> map = {
OP(MOV),
OP(LEA),
OP(SWP),
OP(CMP),
OP(CMPU),
OP(ADD),
OP(ADDF),
OP(SUB),
OP(SUBF),
OP(MOD),
OP(MODF),
OP(MUL),
OP(MULF),
OP(MULU),
OP(DIV),
OP(DIVF),
OP(DIVU),
OP(INC),
OP(INCF),
OP(DEC),
OP(DECF),
OP(ITU),
OP(ITF),
OP(UTF),
OP(UTI),
OP(FTI),
OP(FTU),
OP(AND),
OP(OR),
OP(NOT),
OP(XOR),
OP(SHL),
OP(SHR),
OP(RTL),
OP(RTR),
OP(JMP),
OP(JMPE),
OP(JMPNE),
OP(JMPG),
OP(JMPGE),
OP(CALL),
OP(RET),
OP(HLT),
OP(PUSH),
OP(POP),
OP(ETR),
OP(LVE),
OP(NEW),
OP(DEL),
OP(OUT),
OP(DBG),
OP(DBGU),
OP(DBGF)
};
#undef OP
try {
return get(map.at(ope));
} catch(...) {
std::cerr << "Operation unknown : " << ope << '\n';
throw;
}
}
const OpDefinition& OpDefinition::get(Operations ope) {
#define OP(op, cs...) { Operations::op, OpDefinition(#op, Operations::op, cs) }
constexpr ui8 R = ArgConstraint::Readable;
constexpr ui8 W = ArgConstraint::Writable;
constexpr ui8 A = ArgConstraint::Adressable;
constexpr ui8 RW = R | W;
static std::map<Operations, OpDefinition> def = {
OP(MOV, {W, R}),
OP(LEA, {W, A}),
OP(SWP, {RW, RW}),
OP(CMP, {R, R}),
OP(CMPU, {R, R}),
OP(ADD, {RW, R}),
OP(ADDF, {RW, R}),
OP(SUB, {RW, R}),
OP(SUBF, {RW, R}),
OP(MOD, {RW, R}),
OP(MODF, {RW, R}),
OP(MUL, {RW, R}),
OP(MULF, {RW, R}),
OP(MULU, {RW, R}),
OP(DIV, {RW, R}),
OP(DIVF, {RW, R}),
OP(DIVU, {RW, R}),
OP(INC, {RW}),
OP(INCF, {RW}),
OP(DEC, {RW}),
OP(DECF, {RW}),
OP(ITU, {RW}),
OP(ITF, {RW}),
OP(UTF, {RW}),
OP(UTI, {RW}),
OP(FTI, {RW}),
OP(FTU, {RW}),
OP(AND, {RW, R}),
OP(OR, {RW, R}),
OP(NOT, {RW}),
OP(XOR, {RW, R}),
OP(SHL, {RW, R}),
OP(SHR, {RW, R}),
OP(RTL, {RW, R}),
OP(RTR, {RW, R}),
OP(JMP, {R}),
OP(JMPE, {R}),
OP(JMPNE, {R}),
OP(JMPG, {R}),
OP(JMPGE, {R}),
OP(CALL, {R}),
OP(RET, {}),
OP(HLT, {}),
OP(PUSH, {R}),
OP(POP, {W}),
OP(ETR, {}),
OP(LVE, {}),
OP(NEW, {W, R}),
OP(DEL, {R}),
OP(OUT, {R}),
OP(DBG, {R}),
OP(DBGU, {R}),
OP(DBGF, {R})
};
#undef OP
try {
return def.at(ope);
} catch(...) {
std::cerr << "Operation unknown : " << static_cast<ui32>(ope) << '\n';
throw;
}
}
}} | 20.880829 | 109 | 0.462283 | VCrate |
126367c68d5c399700550b1a4310e01426f3e555 | 599 | cc | C++ | src/connectivity/bluetooth/core/bt-host/l2cap/basic_mode_rx_engine.cc | yanyushr/fuchsia | 98e70672a81a206d235503e398f37b7b65581f79 | [
"BSD-3-Clause"
] | null | null | null | src/connectivity/bluetooth/core/bt-host/l2cap/basic_mode_rx_engine.cc | yanyushr/fuchsia | 98e70672a81a206d235503e398f37b7b65581f79 | [
"BSD-3-Clause"
] | null | null | null | src/connectivity/bluetooth/core/bt-host/l2cap/basic_mode_rx_engine.cc | yanyushr/fuchsia | 98e70672a81a206d235503e398f37b7b65581f79 | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2019 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 "src/connectivity/bluetooth/core/bt-host/l2cap/basic_mode_rx_engine.h"
#include <zircon/assert.h>
namespace bt {
namespace l2cap {
namespace internal {
common::ByteBufferPtr BasicModeRxEngine::ProcessPdu(PDU pdu) {
ZX_ASSERT(pdu.is_valid());
auto sdu = std::make_unique<common::DynamicByteBuffer>(pdu.length());
pdu.Copy(sdu.get());
return sdu;
}
} // namespace internal
} // namespace l2cap
} // namespace bt
| 26.043478 | 79 | 0.737896 | yanyushr |
12645efe5abc3ec5e7901c8a298ddce811069738 | 31,072 | cpp | C++ | export/windows/cpp/obj/src/flixel/input/FlxKeyManager.cpp | TinyPlanetStudios/Project-Crash-Land | 365f196be4212602d32251566f26b53fb70693f6 | [
"MIT"
] | null | null | null | export/windows/cpp/obj/src/flixel/input/FlxKeyManager.cpp | TinyPlanetStudios/Project-Crash-Land | 365f196be4212602d32251566f26b53fb70693f6 | [
"MIT"
] | null | null | null | export/windows/cpp/obj/src/flixel/input/FlxKeyManager.cpp | TinyPlanetStudios/Project-Crash-Land | 365f196be4212602d32251566f26b53fb70693f6 | [
"MIT"
] | null | null | null | // Generated by Haxe 3.3.0
#include <hxcpp.h>
#ifndef INCLUDED_Type
#include <Type.h>
#endif
#ifndef INCLUDED_flixel_input_FlxBaseKeyList
#include <flixel/input/FlxBaseKeyList.h>
#endif
#ifndef INCLUDED_flixel_input_FlxInput
#include <flixel/input/FlxInput.h>
#endif
#ifndef INCLUDED_flixel_input_FlxKeyManager
#include <flixel/input/FlxKeyManager.h>
#endif
#ifndef INCLUDED_flixel_input_IFlxInput
#include <flixel/input/IFlxInput.h>
#endif
#ifndef INCLUDED_flixel_input_IFlxInputManager
#include <flixel/input/IFlxInputManager.h>
#endif
#ifndef INCLUDED_flixel_util_IFlxDestroyable
#include <flixel/util/IFlxDestroyable.h>
#endif
#ifndef INCLUDED_haxe_IMap
#include <haxe/IMap.h>
#endif
#ifndef INCLUDED_haxe_ds_IntMap
#include <haxe/ds/IntMap.h>
#endif
#ifndef INCLUDED_openfl__legacy_Lib
#include <openfl/_legacy/Lib.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_DisplayObject
#include <openfl/_legacy/display/DisplayObject.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_DisplayObjectContainer
#include <openfl/_legacy/display/DisplayObjectContainer.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_IBitmapDrawable
#include <openfl/_legacy/display/IBitmapDrawable.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_InteractiveObject
#include <openfl/_legacy/display/InteractiveObject.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_MovieClip
#include <openfl/_legacy/display/MovieClip.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_Sprite
#include <openfl/_legacy/display/Sprite.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_Stage
#include <openfl/_legacy/display/Stage.h>
#endif
#ifndef INCLUDED_openfl__legacy_events_Event
#include <openfl/_legacy/events/Event.h>
#endif
#ifndef INCLUDED_openfl__legacy_events_EventDispatcher
#include <openfl/_legacy/events/EventDispatcher.h>
#endif
#ifndef INCLUDED_openfl__legacy_events_IEventDispatcher
#include <openfl/_legacy/events/IEventDispatcher.h>
#endif
#ifndef INCLUDED_openfl__legacy_events_KeyboardEvent
#include <openfl/_legacy/events/KeyboardEvent.h>
#endif
namespace flixel{
namespace input{
void FlxKeyManager_obj::__construct(hx::Class keyListClass){
HX_STACK_FRAME("flixel.input.FlxKeyManager","new",0x4637a4fc,"flixel.input.FlxKeyManager.new","flixel/input/FlxKeyManager.hx",7,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(keyListClass,"keyListClass")
HXLINE( 40) this->_keyListMap = ::haxe::ds::IntMap_obj::__new();
HXLINE( 36) this->_keyListArray = ::Array_obj< ::Dynamic>::__new(0);
HXLINE( 18) this->preventDefaultKeys = ::cpp::VirtualArray_obj::__new(0);
HXLINE( 12) this->enabled = true;
HXLINE( 198) ::openfl::_legacy::Lib_obj::get_current()->get_stage()->addEventListener(::openfl::_legacy::events::KeyboardEvent_obj::KEY_DOWN,this->onKeyDown_dyn(),null(),null(),null());
HXLINE( 199) ::openfl::_legacy::Lib_obj::get_current()->get_stage()->addEventListener(::openfl::_legacy::events::KeyboardEvent_obj::KEY_UP,this->onKeyUp_dyn(),null(),null(),null());
HXLINE( 201) this->pressed = ::Type_obj::createInstance(keyListClass,::cpp::VirtualArray_obj::__new(2)->init(0,(int)1)->init(1,hx::ObjectPtr<OBJ_>(this)));
HXLINE( 202) this->justPressed = ::Type_obj::createInstance(keyListClass,::cpp::VirtualArray_obj::__new(2)->init(0,(int)2)->init(1,hx::ObjectPtr<OBJ_>(this)));
HXLINE( 203) this->justReleased = ::Type_obj::createInstance(keyListClass,::cpp::VirtualArray_obj::__new(2)->init(0,(int)-1)->init(1,hx::ObjectPtr<OBJ_>(this)));
}
Dynamic FlxKeyManager_obj::__CreateEmpty() { return new FlxKeyManager_obj; }
hx::ObjectPtr< FlxKeyManager_obj > FlxKeyManager_obj::__new(hx::Class keyListClass)
{
hx::ObjectPtr< FlxKeyManager_obj > _hx_result = new FlxKeyManager_obj();
_hx_result->__construct(keyListClass);
return _hx_result;
}
Dynamic FlxKeyManager_obj::__Create(hx::DynamicArray inArgs)
{
hx::ObjectPtr< FlxKeyManager_obj > _hx_result = new FlxKeyManager_obj();
_hx_result->__construct(inArgs[0]);
return _hx_result;
}
static ::flixel::input::IFlxInputManager_obj _hx_flixel_input_FlxKeyManager__hx_flixel_input_IFlxInputManager= {
( void (hx::Object::*)())&::flixel::input::FlxKeyManager_obj::reset,
( void (hx::Object::*)())&::flixel::input::FlxKeyManager_obj::update,
( void (hx::Object::*)())&::flixel::input::FlxKeyManager_obj::onFocus,
( void (hx::Object::*)())&::flixel::input::FlxKeyManager_obj::onFocusLost,
( void (hx::Object::*)())&::flixel::input::FlxKeyManager_obj::destroy,
};
static ::flixel::util::IFlxDestroyable_obj _hx_flixel_input_FlxKeyManager__hx_flixel_util_IFlxDestroyable= {
( void (hx::Object::*)())&::flixel::input::FlxKeyManager_obj::destroy,
};
void *FlxKeyManager_obj::_hx_getInterface(int inHash) {
switch(inHash) {
case (int)0x65dd217a: return &_hx_flixel_input_FlxKeyManager__hx_flixel_input_IFlxInputManager;
case (int)0xd4fe2fcd: return &_hx_flixel_input_FlxKeyManager__hx_flixel_util_IFlxDestroyable;
}
#ifdef HXCPP_SCRIPTABLE
return super::_hx_getInterface(inHash);
#else
return 0;
#endif
}
Bool FlxKeyManager_obj::anyPressed(::cpp::VirtualArray KeyArray){
HX_STACK_FRAME("flixel.input.FlxKeyManager","anyPressed",0xbdbeabfa,"flixel.input.FlxKeyManager.anyPressed","flixel/input/FlxKeyManager.hx",50,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(KeyArray,"KeyArray")
HXLINE( 50) return this->checkKeyArrayState(KeyArray,(int)1);
}
HX_DEFINE_DYNAMIC_FUNC1(FlxKeyManager_obj,anyPressed,return )
Bool FlxKeyManager_obj::anyJustPressed(::cpp::VirtualArray KeyArray){
HX_STACK_FRAME("flixel.input.FlxKeyManager","anyJustPressed",0x4d22732e,"flixel.input.FlxKeyManager.anyJustPressed","flixel/input/FlxKeyManager.hx",61,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(KeyArray,"KeyArray")
HXLINE( 61) return this->checkKeyArrayState(KeyArray,(int)2);
}
HX_DEFINE_DYNAMIC_FUNC1(FlxKeyManager_obj,anyJustPressed,return )
Bool FlxKeyManager_obj::anyJustReleased(::cpp::VirtualArray KeyArray){
HX_STACK_FRAME("flixel.input.FlxKeyManager","anyJustReleased",0x37d862b1,"flixel.input.FlxKeyManager.anyJustReleased","flixel/input/FlxKeyManager.hx",72,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(KeyArray,"KeyArray")
HXLINE( 72) return this->checkKeyArrayState(KeyArray,(int)-1);
}
HX_DEFINE_DYNAMIC_FUNC1(FlxKeyManager_obj,anyJustReleased,return )
Int FlxKeyManager_obj::firstPressed(){
HX_STACK_FRAME("flixel.input.FlxKeyManager","firstPressed",0xa191a036,"flixel.input.FlxKeyManager.firstPressed","flixel/input/FlxKeyManager.hx",81,0xfedfa8b6)
HX_STACK_THIS(this)
HXLINE( 82) {
HXLINE( 82) HX_VARI( Int,_g) = (int)0;
HXDLIN( 82) HX_VARI( ::Array< ::Dynamic>,_g1) = this->_keyListArray;
HXDLIN( 82) while((_g < _g1->length)){
HXLINE( 82) HX_VARI( ::flixel::input::FlxInput,key) = _g1->__get(_g).StaticCast< ::flixel::input::FlxInput >();
HXDLIN( 82) ++_g;
HXLINE( 84) Bool _hx_tmp;
HXDLIN( 84) Bool _hx_tmp1 = hx::IsNotNull( key );
HXDLIN( 84) if (_hx_tmp1) {
HXLINE( 84) if ((key->current != (int)1)) {
HXLINE( 84) _hx_tmp = (key->current == (int)2);
}
else {
HXLINE( 84) _hx_tmp = true;
}
}
else {
HXLINE( 84) _hx_tmp = false;
}
HXDLIN( 84) if (_hx_tmp) {
HXLINE( 86) return key->ID;
}
}
}
HXLINE( 89) return (int)-1;
}
HX_DEFINE_DYNAMIC_FUNC0(FlxKeyManager_obj,firstPressed,return )
Int FlxKeyManager_obj::firstJustPressed(){
HX_STACK_FRAME("flixel.input.FlxKeyManager","firstJustPressed",0xd38a356a,"flixel.input.FlxKeyManager.firstJustPressed","flixel/input/FlxKeyManager.hx",98,0xfedfa8b6)
HX_STACK_THIS(this)
HXLINE( 99) {
HXLINE( 99) HX_VARI( Int,_g) = (int)0;
HXDLIN( 99) HX_VARI( ::Array< ::Dynamic>,_g1) = this->_keyListArray;
HXDLIN( 99) while((_g < _g1->length)){
HXLINE( 99) HX_VARI( ::flixel::input::FlxInput,key) = _g1->__get(_g).StaticCast< ::flixel::input::FlxInput >();
HXDLIN( 99) ++_g;
HXLINE( 101) Bool _hx_tmp;
HXDLIN( 101) Bool _hx_tmp1 = hx::IsNotNull( key );
HXDLIN( 101) if (_hx_tmp1) {
HXLINE( 101) _hx_tmp = (key->current == (int)2);
}
else {
HXLINE( 101) _hx_tmp = false;
}
HXDLIN( 101) if (_hx_tmp) {
HXLINE( 103) return key->ID;
}
}
}
HXLINE( 106) return (int)-1;
}
HX_DEFINE_DYNAMIC_FUNC0(FlxKeyManager_obj,firstJustPressed,return )
Int FlxKeyManager_obj::firstJustReleased(){
HX_STACK_FRAME("flixel.input.FlxKeyManager","firstJustReleased",0x4c3a94f5,"flixel.input.FlxKeyManager.firstJustReleased","flixel/input/FlxKeyManager.hx",115,0xfedfa8b6)
HX_STACK_THIS(this)
HXLINE( 116) {
HXLINE( 116) HX_VARI( Int,_g) = (int)0;
HXDLIN( 116) HX_VARI( ::Array< ::Dynamic>,_g1) = this->_keyListArray;
HXDLIN( 116) while((_g < _g1->length)){
HXLINE( 116) HX_VARI( ::flixel::input::FlxInput,key) = _g1->__get(_g).StaticCast< ::flixel::input::FlxInput >();
HXDLIN( 116) ++_g;
HXLINE( 118) Bool _hx_tmp;
HXDLIN( 118) Bool _hx_tmp1 = hx::IsNotNull( key );
HXDLIN( 118) if (_hx_tmp1) {
HXLINE( 118) _hx_tmp = (key->current == (int)-1);
}
else {
HXLINE( 118) _hx_tmp = false;
}
HXDLIN( 118) if (_hx_tmp) {
HXLINE( 120) return key->ID;
}
}
}
HXLINE( 123) return (int)-1;
}
HX_DEFINE_DYNAMIC_FUNC0(FlxKeyManager_obj,firstJustReleased,return )
Bool FlxKeyManager_obj::checkStatus( ::Dynamic KeyCode,Int Status){
HX_STACK_FRAME("flixel.input.FlxKeyManager","checkStatus",0xbf018ab6,"flixel.input.FlxKeyManager.checkStatus","flixel/input/FlxKeyManager.hx",134,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(KeyCode,"KeyCode")
HX_STACK_ARG(Status,"Status")
HXLINE( 135) HX_VARI( ::flixel::input::FlxInput,key) = this->_keyListMap->get(KeyCode).StaticCast< ::flixel::input::FlxInput >();
HXLINE( 137) Bool _hx_tmp = hx::IsNotNull( key );
HXDLIN( 137) if (_hx_tmp) {
HXLINE( 139) Bool _hx_tmp1 = key->hasState(Status);
HXDLIN( 139) if (_hx_tmp1) {
HXLINE( 141) return true;
}
}
HXLINE( 151) return false;
}
HX_DEFINE_DYNAMIC_FUNC2(FlxKeyManager_obj,checkStatus,return )
::Array< ::Dynamic> FlxKeyManager_obj::getIsDown(){
HX_STACK_FRAME("flixel.input.FlxKeyManager","getIsDown",0x4bba783e,"flixel.input.FlxKeyManager.getIsDown","flixel/input/FlxKeyManager.hx",160,0xfedfa8b6)
HX_STACK_THIS(this)
HXLINE( 161) HX_VARI( ::Array< ::Dynamic>,keysDown) = ::Array_obj< ::Dynamic>::__new();
HXLINE( 163) {
HXLINE( 163) HX_VARI( Int,_g) = (int)0;
HXDLIN( 163) HX_VARI( ::Array< ::Dynamic>,_g1) = this->_keyListArray;
HXDLIN( 163) while((_g < _g1->length)){
HXLINE( 163) HX_VARI( ::flixel::input::FlxInput,key) = _g1->__get(_g).StaticCast< ::flixel::input::FlxInput >();
HXDLIN( 163) ++_g;
HXLINE( 165) Bool _hx_tmp;
HXDLIN( 165) Bool _hx_tmp1 = hx::IsNotNull( key );
HXDLIN( 165) if (_hx_tmp1) {
HXLINE( 165) if ((key->current != (int)1)) {
HXLINE( 165) _hx_tmp = (key->current == (int)2);
}
else {
HXLINE( 165) _hx_tmp = true;
}
}
else {
HXLINE( 165) _hx_tmp = false;
}
HXDLIN( 165) if (_hx_tmp) {
HXLINE( 167) keysDown->push(key);
}
}
}
HXLINE( 170) return keysDown;
}
HX_DEFINE_DYNAMIC_FUNC0(FlxKeyManager_obj,getIsDown,return )
void FlxKeyManager_obj::destroy(){
HX_STACK_FRAME("flixel.input.FlxKeyManager","destroy",0x5d667f96,"flixel.input.FlxKeyManager.destroy","flixel/input/FlxKeyManager.hx",177,0xfedfa8b6)
HX_STACK_THIS(this)
HXLINE( 178) this->_keyListArray = null();
HXLINE( 179) this->_keyListMap = null();
}
HX_DEFINE_DYNAMIC_FUNC0(FlxKeyManager_obj,destroy,(void))
void FlxKeyManager_obj::reset(){
HX_STACK_FRAME("flixel.input.FlxKeyManager","reset",0x4cbf7d6b,"flixel.input.FlxKeyManager.reset","flixel/input/FlxKeyManager.hx",187,0xfedfa8b6)
HX_STACK_THIS(this)
HXLINE( 187) HX_VARI( Int,_g) = (int)0;
HXDLIN( 187) HX_VARI( ::Array< ::Dynamic>,_g1) = this->_keyListArray;
HXDLIN( 187) while((_g < _g1->length)){
HXLINE( 187) HX_VARI( ::flixel::input::FlxInput,key) = _g1->__get(_g).StaticCast< ::flixel::input::FlxInput >();
HXDLIN( 187) ++_g;
HXLINE( 189) Bool _hx_tmp = hx::IsNotNull( key );
HXDLIN( 189) if (_hx_tmp) {
HXLINE( 191) key->release();
}
}
}
HX_DEFINE_DYNAMIC_FUNC0(FlxKeyManager_obj,reset,(void))
void FlxKeyManager_obj::update(){
HX_STACK_FRAME("flixel.input.FlxKeyManager","update",0x595b7aed,"flixel.input.FlxKeyManager.update","flixel/input/FlxKeyManager.hx",211,0xfedfa8b6)
HX_STACK_THIS(this)
HXLINE( 211) HX_VARI( Int,_g) = (int)0;
HXDLIN( 211) HX_VARI( ::Array< ::Dynamic>,_g1) = this->_keyListArray;
HXDLIN( 211) while((_g < _g1->length)){
HXLINE( 211) HX_VARI( ::flixel::input::FlxInput,key) = _g1->__get(_g).StaticCast< ::flixel::input::FlxInput >();
HXDLIN( 211) ++_g;
HXLINE( 213) Bool _hx_tmp = hx::IsNotNull( key );
HXDLIN( 213) if (_hx_tmp) {
HXLINE( 215) key->update();
}
}
}
HX_DEFINE_DYNAMIC_FUNC0(FlxKeyManager_obj,update,(void))
Bool FlxKeyManager_obj::checkKeyArrayState(::cpp::VirtualArray KeyArray,Int State){
HX_STACK_FRAME("flixel.input.FlxKeyManager","checkKeyArrayState",0xb44c8d33,"flixel.input.FlxKeyManager.checkKeyArrayState","flixel/input/FlxKeyManager.hx",228,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(KeyArray,"KeyArray")
HX_STACK_ARG(State,"State")
HXLINE( 229) Bool _hx_tmp = hx::IsNull( KeyArray );
HXDLIN( 229) if (_hx_tmp) {
HXLINE( 231) return false;
}
HXLINE( 234) {
HXLINE( 234) HX_VARI( Int,_g) = (int)0;
HXDLIN( 234) while((_g < KeyArray->get_length())){
HXLINE( 234) HX_VARI( ::Dynamic,code) = KeyArray->__get(_g);
HXDLIN( 234) ++_g;
HXLINE( 236) HX_VARI( ::flixel::input::FlxInput,key) = this->_keyListMap->get(code).StaticCast< ::flixel::input::FlxInput >();
HXLINE( 238) Bool _hx_tmp1 = hx::IsNotNull( key );
HXDLIN( 238) if (_hx_tmp1) {
HXLINE( 240) Bool _hx_tmp2 = key->hasState(State);
HXDLIN( 240) if (_hx_tmp2) {
HXLINE( 242) return true;
}
}
}
}
HXLINE( 247) return false;
}
HX_DEFINE_DYNAMIC_FUNC2(FlxKeyManager_obj,checkKeyArrayState,return )
void FlxKeyManager_obj::onKeyUp( ::openfl::_legacy::events::KeyboardEvent event){
HX_STACK_FRAME("flixel.input.FlxKeyManager","onKeyUp",0xae1caad7,"flixel.input.FlxKeyManager.onKeyUp","flixel/input/FlxKeyManager.hx",254,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(event,"event")
HXLINE( 255) HX_VARI( Int,c) = this->resolveKeyCode(event);
HXLINE( 256) this->handlePreventDefaultKeys(c,event);
HXLINE( 258) Bool _hx_tmp = this->enabled;
HXDLIN( 258) if (_hx_tmp) {
HXLINE( 260) HX_VARI( ::flixel::input::FlxInput,key) = this->_keyListMap->get(c).StaticCast< ::flixel::input::FlxInput >();
HXDLIN( 260) Bool _hx_tmp1 = hx::IsNotNull( key );
HXDLIN( 260) if (_hx_tmp1) {
HXLINE( 260) key->release();
}
}
}
HX_DEFINE_DYNAMIC_FUNC1(FlxKeyManager_obj,onKeyUp,(void))
void FlxKeyManager_obj::onKeyDown( ::openfl::_legacy::events::KeyboardEvent event){
HX_STACK_FRAME("flixel.input.FlxKeyManager","onKeyDown",0xe38153de,"flixel.input.FlxKeyManager.onKeyDown","flixel/input/FlxKeyManager.hx",268,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(event,"event")
HXLINE( 269) HX_VARI( Int,c) = this->resolveKeyCode(event);
HXLINE( 270) this->handlePreventDefaultKeys(c,event);
HXLINE( 272) Bool _hx_tmp = this->enabled;
HXDLIN( 272) if (_hx_tmp) {
HXLINE( 274) HX_VARI( ::flixel::input::FlxInput,key) = this->_keyListMap->get(c).StaticCast< ::flixel::input::FlxInput >();
HXDLIN( 274) Bool _hx_tmp1 = hx::IsNotNull( key );
HXDLIN( 274) if (_hx_tmp1) {
HXLINE( 274) key->press();
}
}
}
HX_DEFINE_DYNAMIC_FUNC1(FlxKeyManager_obj,onKeyDown,(void))
void FlxKeyManager_obj::handlePreventDefaultKeys(Int keyCode, ::openfl::_legacy::events::KeyboardEvent event){
HX_STACK_FRAME("flixel.input.FlxKeyManager","handlePreventDefaultKeys",0x60508309,"flixel.input.FlxKeyManager.handlePreventDefaultKeys","flixel/input/FlxKeyManager.hx",279,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(keyCode,"keyCode")
HX_STACK_ARG(event,"event")
HXLINE( 280) HX_VARI( ::flixel::input::FlxInput,key) = this->_keyListMap->get(keyCode).StaticCast< ::flixel::input::FlxInput >();
HXLINE( 281) Bool _hx_tmp;
HXDLIN( 281) Bool _hx_tmp1;
HXDLIN( 281) Bool _hx_tmp2 = hx::IsNotNull( key );
HXDLIN( 281) if (_hx_tmp2) {
HXLINE( 281) _hx_tmp1 = hx::IsNotNull( this->preventDefaultKeys );
}
else {
HXLINE( 281) _hx_tmp1 = false;
}
HXDLIN( 281) if (_hx_tmp1) {
HXLINE( 281) Int _hx_tmp3 = this->preventDefaultKeys->indexOf(key->ID,null());
HXDLIN( 281) _hx_tmp = (_hx_tmp3 != (int)-1);
}
else {
HXLINE( 281) _hx_tmp = false;
}
HXDLIN( 281) if (_hx_tmp) {
HXLINE( 283) event->stopImmediatePropagation();
HXLINE( 284) event->stopPropagation();
}
}
HX_DEFINE_DYNAMIC_FUNC2(FlxKeyManager_obj,handlePreventDefaultKeys,(void))
Bool FlxKeyManager_obj::inKeyArray(::cpp::VirtualArray KeyArray, ::Dynamic Key){
HX_STACK_FRAME("flixel.input.FlxKeyManager","inKeyArray",0xf3ad4f63,"flixel.input.FlxKeyManager.inKeyArray","flixel/input/FlxKeyManager.hx",293,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(KeyArray,"KeyArray")
HX_STACK_ARG(Key,"Key")
HXLINE( 294) Bool _hx_tmp = hx::IsNull( KeyArray );
HXDLIN( 294) if (_hx_tmp) {
HXLINE( 296) return false;
}
else {
HXLINE( 300) HX_VARI( Int,_g) = (int)0;
HXDLIN( 300) while((_g < KeyArray->get_length())){
HXLINE( 300) HX_VARI( ::Dynamic,key) = KeyArray->__get(_g);
HXDLIN( 300) ++_g;
HXLINE( 302) Bool _hx_tmp1;
HXDLIN( 302) if (hx::IsNotEq( key,Key )) {
HXLINE( 302) _hx_tmp1 = hx::IsEq( key,(int)-2 );
}
else {
HXLINE( 302) _hx_tmp1 = true;
}
HXDLIN( 302) if (_hx_tmp1) {
HXLINE( 304) return true;
}
}
}
HXLINE( 308) return false;
}
HX_DEFINE_DYNAMIC_FUNC2(FlxKeyManager_obj,inKeyArray,return )
Int FlxKeyManager_obj::resolveKeyCode( ::openfl::_legacy::events::KeyboardEvent e){
HX_STACK_FRAME("flixel.input.FlxKeyManager","resolveKeyCode",0x9a8225c4,"flixel.input.FlxKeyManager.resolveKeyCode","flixel/input/FlxKeyManager.hx",313,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(e,"e")
HXLINE( 313) return e->keyCode;
}
HX_DEFINE_DYNAMIC_FUNC1(FlxKeyManager_obj,resolveKeyCode,return )
void FlxKeyManager_obj::updateKeyStates(Int KeyCode,Bool Down){
HX_STACK_FRAME("flixel.input.FlxKeyManager","updateKeyStates",0xe52c7794,"flixel.input.FlxKeyManager.updateKeyStates","flixel/input/FlxKeyManager.hx",320,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(KeyCode,"KeyCode")
HX_STACK_ARG(Down,"Down")
HXLINE( 321) HX_VARI( ::flixel::input::FlxInput,key) = this->_keyListMap->get(KeyCode).StaticCast< ::flixel::input::FlxInput >();
HXLINE( 323) Bool _hx_tmp = hx::IsNotNull( key );
HXDLIN( 323) if (_hx_tmp) {
HXLINE( 325) if (Down) {
HXLINE( 327) key->press();
}
else {
HXLINE( 331) key->release();
}
}
}
HX_DEFINE_DYNAMIC_FUNC2(FlxKeyManager_obj,updateKeyStates,(void))
void FlxKeyManager_obj::onFocus(){
HX_STACK_FRAME("flixel.input.FlxKeyManager","onFocus",0xd3a750d5,"flixel.input.FlxKeyManager.onFocus","flixel/input/FlxKeyManager.hx",336,0xfedfa8b6)
HX_STACK_THIS(this)
}
HX_DEFINE_DYNAMIC_FUNC0(FlxKeyManager_obj,onFocus,(void))
void FlxKeyManager_obj::onFocusLost(){
HX_STACK_FRAME("flixel.input.FlxKeyManager","onFocusLost",0x1879b559,"flixel.input.FlxKeyManager.onFocusLost","flixel/input/FlxKeyManager.hx",340,0xfedfa8b6)
HX_STACK_THIS(this)
HXLINE( 340) this->reset();
}
HX_DEFINE_DYNAMIC_FUNC0(FlxKeyManager_obj,onFocusLost,(void))
::flixel::input::FlxInput FlxKeyManager_obj::getKey(Int KeyCode){
HX_STACK_FRAME("flixel.input.FlxKeyManager","getKey",0x7576b78d,"flixel.input.FlxKeyManager.getKey","flixel/input/FlxKeyManager.hx",348,0xfedfa8b6)
HX_STACK_THIS(this)
HX_STACK_ARG(KeyCode,"KeyCode")
HXLINE( 348) return this->_keyListMap->get(KeyCode).StaticCast< ::flixel::input::FlxInput >();
}
HX_DEFINE_DYNAMIC_FUNC1(FlxKeyManager_obj,getKey,return )
FlxKeyManager_obj::FlxKeyManager_obj()
{
}
void FlxKeyManager_obj::__Mark(HX_MARK_PARAMS)
{
HX_MARK_BEGIN_CLASS(FlxKeyManager);
HX_MARK_MEMBER_NAME(enabled,"enabled");
HX_MARK_MEMBER_NAME(preventDefaultKeys,"preventDefaultKeys");
HX_MARK_MEMBER_NAME(pressed,"pressed");
HX_MARK_MEMBER_NAME(justPressed,"justPressed");
HX_MARK_MEMBER_NAME(justReleased,"justReleased");
HX_MARK_MEMBER_NAME(_keyListArray,"_keyListArray");
HX_MARK_MEMBER_NAME(_keyListMap,"_keyListMap");
HX_MARK_END_CLASS();
}
void FlxKeyManager_obj::__Visit(HX_VISIT_PARAMS)
{
HX_VISIT_MEMBER_NAME(enabled,"enabled");
HX_VISIT_MEMBER_NAME(preventDefaultKeys,"preventDefaultKeys");
HX_VISIT_MEMBER_NAME(pressed,"pressed");
HX_VISIT_MEMBER_NAME(justPressed,"justPressed");
HX_VISIT_MEMBER_NAME(justReleased,"justReleased");
HX_VISIT_MEMBER_NAME(_keyListArray,"_keyListArray");
HX_VISIT_MEMBER_NAME(_keyListMap,"_keyListMap");
}
hx::Val FlxKeyManager_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 5:
if (HX_FIELD_EQ(inName,"reset") ) { return hx::Val( reset_dyn()); }
break;
case 6:
if (HX_FIELD_EQ(inName,"update") ) { return hx::Val( update_dyn()); }
if (HX_FIELD_EQ(inName,"getKey") ) { return hx::Val( getKey_dyn()); }
break;
case 7:
if (HX_FIELD_EQ(inName,"enabled") ) { return hx::Val( enabled); }
if (HX_FIELD_EQ(inName,"pressed") ) { return hx::Val( pressed); }
if (HX_FIELD_EQ(inName,"destroy") ) { return hx::Val( destroy_dyn()); }
if (HX_FIELD_EQ(inName,"onKeyUp") ) { return hx::Val( onKeyUp_dyn()); }
if (HX_FIELD_EQ(inName,"onFocus") ) { return hx::Val( onFocus_dyn()); }
break;
case 9:
if (HX_FIELD_EQ(inName,"getIsDown") ) { return hx::Val( getIsDown_dyn()); }
if (HX_FIELD_EQ(inName,"onKeyDown") ) { return hx::Val( onKeyDown_dyn()); }
break;
case 10:
if (HX_FIELD_EQ(inName,"anyPressed") ) { return hx::Val( anyPressed_dyn()); }
if (HX_FIELD_EQ(inName,"inKeyArray") ) { return hx::Val( inKeyArray_dyn()); }
break;
case 11:
if (HX_FIELD_EQ(inName,"justPressed") ) { return hx::Val( justPressed); }
if (HX_FIELD_EQ(inName,"_keyListMap") ) { return hx::Val( _keyListMap); }
if (HX_FIELD_EQ(inName,"checkStatus") ) { return hx::Val( checkStatus_dyn()); }
if (HX_FIELD_EQ(inName,"onFocusLost") ) { return hx::Val( onFocusLost_dyn()); }
break;
case 12:
if (HX_FIELD_EQ(inName,"justReleased") ) { return hx::Val( justReleased); }
if (HX_FIELD_EQ(inName,"firstPressed") ) { return hx::Val( firstPressed_dyn()); }
break;
case 13:
if (HX_FIELD_EQ(inName,"_keyListArray") ) { return hx::Val( _keyListArray); }
break;
case 14:
if (HX_FIELD_EQ(inName,"anyJustPressed") ) { return hx::Val( anyJustPressed_dyn()); }
if (HX_FIELD_EQ(inName,"resolveKeyCode") ) { return hx::Val( resolveKeyCode_dyn()); }
break;
case 15:
if (HX_FIELD_EQ(inName,"anyJustReleased") ) { return hx::Val( anyJustReleased_dyn()); }
if (HX_FIELD_EQ(inName,"updateKeyStates") ) { return hx::Val( updateKeyStates_dyn()); }
break;
case 16:
if (HX_FIELD_EQ(inName,"firstJustPressed") ) { return hx::Val( firstJustPressed_dyn()); }
break;
case 17:
if (HX_FIELD_EQ(inName,"firstJustReleased") ) { return hx::Val( firstJustReleased_dyn()); }
break;
case 18:
if (HX_FIELD_EQ(inName,"preventDefaultKeys") ) { return hx::Val( preventDefaultKeys); }
if (HX_FIELD_EQ(inName,"checkKeyArrayState") ) { return hx::Val( checkKeyArrayState_dyn()); }
break;
case 24:
if (HX_FIELD_EQ(inName,"handlePreventDefaultKeys") ) { return hx::Val( handlePreventDefaultKeys_dyn()); }
}
return super::__Field(inName,inCallProp);
}
hx::Val FlxKeyManager_obj::__SetField(const ::String &inName,const hx::Val &inValue,hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 7:
if (HX_FIELD_EQ(inName,"enabled") ) { enabled=inValue.Cast< Bool >(); return inValue; }
if (HX_FIELD_EQ(inName,"pressed") ) { pressed=inValue.Cast< ::Dynamic >(); return inValue; }
break;
case 11:
if (HX_FIELD_EQ(inName,"justPressed") ) { justPressed=inValue.Cast< ::Dynamic >(); return inValue; }
if (HX_FIELD_EQ(inName,"_keyListMap") ) { _keyListMap=inValue.Cast< ::haxe::ds::IntMap >(); return inValue; }
break;
case 12:
if (HX_FIELD_EQ(inName,"justReleased") ) { justReleased=inValue.Cast< ::Dynamic >(); return inValue; }
break;
case 13:
if (HX_FIELD_EQ(inName,"_keyListArray") ) { _keyListArray=inValue.Cast< ::Array< ::Dynamic> >(); return inValue; }
break;
case 18:
if (HX_FIELD_EQ(inName,"preventDefaultKeys") ) { preventDefaultKeys=inValue.Cast< ::cpp::VirtualArray >(); return inValue; }
}
return super::__SetField(inName,inValue,inCallProp);
}
void FlxKeyManager_obj::__GetFields(Array< ::String> &outFields)
{
outFields->push(HX_HCSTRING("enabled","\x81","\x04","\x31","\x7e"));
outFields->push(HX_HCSTRING("preventDefaultKeys","\x5d","\xd3","\x15","\x2d"));
outFields->push(HX_HCSTRING("pressed","\xa2","\xd2","\xe6","\x39"));
outFields->push(HX_HCSTRING("justPressed","\xd6","\x0d","\xa7","\xf2"));
outFields->push(HX_HCSTRING("justReleased","\x09","\x1b","\x5b","\x66"));
outFields->push(HX_HCSTRING("_keyListArray","\x9b","\x69","\x07","\xf6"));
outFields->push(HX_HCSTRING("_keyListMap","\x1e","\xa2","\x94","\x4b"));
super::__GetFields(outFields);
};
#if HXCPP_SCRIPTABLE
static hx::StorageInfo FlxKeyManager_obj_sMemberStorageInfo[] = {
{hx::fsBool,(int)offsetof(FlxKeyManager_obj,enabled),HX_HCSTRING("enabled","\x81","\x04","\x31","\x7e")},
{hx::fsObject /*cpp::ArrayBase*/ ,(int)offsetof(FlxKeyManager_obj,preventDefaultKeys),HX_HCSTRING("preventDefaultKeys","\x5d","\xd3","\x15","\x2d")},
{hx::fsObject /*Dynamic*/ ,(int)offsetof(FlxKeyManager_obj,pressed),HX_HCSTRING("pressed","\xa2","\xd2","\xe6","\x39")},
{hx::fsObject /*Dynamic*/ ,(int)offsetof(FlxKeyManager_obj,justPressed),HX_HCSTRING("justPressed","\xd6","\x0d","\xa7","\xf2")},
{hx::fsObject /*Dynamic*/ ,(int)offsetof(FlxKeyManager_obj,justReleased),HX_HCSTRING("justReleased","\x09","\x1b","\x5b","\x66")},
{hx::fsObject /*Array< ::Dynamic >*/ ,(int)offsetof(FlxKeyManager_obj,_keyListArray),HX_HCSTRING("_keyListArray","\x9b","\x69","\x07","\xf6")},
{hx::fsObject /*::haxe::ds::IntMap*/ ,(int)offsetof(FlxKeyManager_obj,_keyListMap),HX_HCSTRING("_keyListMap","\x1e","\xa2","\x94","\x4b")},
{ hx::fsUnknown, 0, null()}
};
static hx::StaticInfo *FlxKeyManager_obj_sStaticStorageInfo = 0;
#endif
static ::String FlxKeyManager_obj_sMemberFields[] = {
HX_HCSTRING("enabled","\x81","\x04","\x31","\x7e"),
HX_HCSTRING("preventDefaultKeys","\x5d","\xd3","\x15","\x2d"),
HX_HCSTRING("pressed","\xa2","\xd2","\xe6","\x39"),
HX_HCSTRING("justPressed","\xd6","\x0d","\xa7","\xf2"),
HX_HCSTRING("justReleased","\x09","\x1b","\x5b","\x66"),
HX_HCSTRING("_keyListArray","\x9b","\x69","\x07","\xf6"),
HX_HCSTRING("_keyListMap","\x1e","\xa2","\x94","\x4b"),
HX_HCSTRING("anyPressed","\x16","\x75","\x02","\x90"),
HX_HCSTRING("anyJustPressed","\x4a","\xfa","\xb6","\xa6"),
HX_HCSTRING("anyJustReleased","\x15","\x14","\x3a","\x40"),
HX_HCSTRING("firstPressed","\x52","\xe8","\x2e","\x63"),
HX_HCSTRING("firstJustPressed","\x86","\xbb","\xa3","\x20"),
HX_HCSTRING("firstJustReleased","\x59","\x67","\x76","\x75"),
HX_HCSTRING("checkStatus","\x1a","\xba","\x0d","\xe8"),
HX_HCSTRING("getIsDown","\xa2","\x46","\x2b","\xdc"),
HX_HCSTRING("destroy","\xfa","\x2c","\x86","\x24"),
HX_HCSTRING("reset","\xcf","\x49","\xc8","\xe6"),
HX_HCSTRING("update","\x09","\x86","\x05","\x87"),
HX_HCSTRING("checkKeyArrayState","\x4f","\xd2","\x68","\x9f"),
HX_HCSTRING("onKeyUp","\x3b","\x58","\x3c","\x75"),
HX_HCSTRING("onKeyDown","\x42","\x22","\xf2","\x73"),
HX_HCSTRING("handlePreventDefaultKeys","\x25","\x85","\xc7","\x5d"),
HX_HCSTRING("inKeyArray","\x7f","\x18","\xf1","\xc5"),
HX_HCSTRING("resolveKeyCode","\xe0","\xac","\x16","\xf4"),
HX_HCSTRING("updateKeyStates","\xf8","\x28","\x8e","\xed"),
HX_HCSTRING("onFocus","\x39","\xfe","\xc6","\x9a"),
HX_HCSTRING("onFocusLost","\xbd","\xe4","\x85","\x41"),
HX_HCSTRING("getKey","\xa9","\xc2","\x20","\xa3"),
::String(null()) };
static void FlxKeyManager_obj_sMarkStatics(HX_MARK_PARAMS) {
HX_MARK_MEMBER_NAME(FlxKeyManager_obj::__mClass,"__mClass");
};
#ifdef HXCPP_VISIT_ALLOCS
static void FlxKeyManager_obj_sVisitStatics(HX_VISIT_PARAMS) {
HX_VISIT_MEMBER_NAME(FlxKeyManager_obj::__mClass,"__mClass");
};
#endif
hx::Class FlxKeyManager_obj::__mClass;
void FlxKeyManager_obj::__register()
{
hx::Static(__mClass) = new hx::Class_obj();
__mClass->mName = HX_HCSTRING("flixel.input.FlxKeyManager","\x0a","\xb7","\x52","\x80");
__mClass->mSuper = &super::__SGetClass();
__mClass->mConstructEmpty = &__CreateEmpty;
__mClass->mConstructArgs = &__Create;
__mClass->mGetStaticField = &hx::Class_obj::GetNoStaticField;
__mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField;
__mClass->mMarkFunc = FlxKeyManager_obj_sMarkStatics;
__mClass->mStatics = hx::Class_obj::dupFunctions(0 /* sStaticFields */);
__mClass->mMembers = hx::Class_obj::dupFunctions(FlxKeyManager_obj_sMemberFields);
__mClass->mCanCast = hx::TCanCast< FlxKeyManager_obj >;
#ifdef HXCPP_VISIT_ALLOCS
__mClass->mVisitFunc = FlxKeyManager_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mMemberStorageInfo = FlxKeyManager_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mStaticStorageInfo = FlxKeyManager_obj_sStaticStorageInfo;
#endif
hx::_hx_RegisterClass(__mClass->mName, __mClass);
}
} // end namespace flixel
} // end namespace input
| 41.81965 | 196 | 0.682061 | TinyPlanetStudios |
12653638327f75d850665585d60f848ee5c7554f | 8,442 | cpp | C++ | GPS/DOG/Main/LaunchTM/Common.cpp | goodspeed24e/2011Corel | 4efb585a589ea5587a877f4184493b758fa6f9b2 | [
"MIT"
] | 1 | 2019-07-24T07:59:07.000Z | 2019-07-24T07:59:07.000Z | GPS/DOG/Main/LaunchTM/Common.cpp | goodspeed24e/2011Corel | 4efb585a589ea5587a877f4184493b758fa6f9b2 | [
"MIT"
] | null | null | null | GPS/DOG/Main/LaunchTM/Common.cpp | goodspeed24e/2011Corel | 4efb585a589ea5587a877f4184493b758fa6f9b2 | [
"MIT"
] | 6 | 2015-03-17T12:11:38.000Z | 2022-01-29T01:15:52.000Z | // THIS SOURCE CODE IS PROPRIETARY INFORMATION BELONGING TO COREL CORP.
// ANY USE INCLUDING BUT NOT LIMITED TO COPYING OF CODE, CONCEPTS, AND/OR
// ALGORITHMS IS PROHIBITED EXCEPT WITH EXPRESS WRITTEN PERMISSION BY THE
// COMPANY.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 2007 - 2012 Corel Corporation. All Rights Reserved.
//
//--------------------------------------------------------------------------
#include "stdafx.h"
#include <windows.h>
#include "CPU_Usage.h"
// using undocumented functions and structures
#define SystemBasicInformation 0
#define SystemPerformanceInformation 2
#define SystemTimeInformation 3
#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart))
typedef struct
{
DWORD dwUnknown1;
ULONG uKeMaximumIncrement;
ULONG uPageSize;
ULONG uMmNumberOfPhysicalPages;
ULONG uMmLowestPhysicalPage;
ULONG UMmHighestPhysicalPage;
ULONG uAllocationGranularity;
PVOID pLowestUserAddress;
PVOID pMmHighestUserAddress;
ULONG uKeActiveProcessors;
BYTE bKeNumberProcessors;
BYTE bUnknown2;
WORD bUnknown3;
} SYSTEM_BASIC_INFORMATION;
typedef struct
{
LARGE_INTEGER liIdleTime;
DWORD dwSpare[76];
} SYSTEM_PERFORMANCE_INFORMATION;
typedef struct
{
LARGE_INTEGER liKeBootTime;
LARGE_INTEGER liKeSystemTime;
LARGE_INTEGER liExpTimeZoneBias;
ULONG uCurrentTimeZoneID;
DWORD dwReserved;
} SYSTEM_TIME_INFORMATION;
CCPU_Usage::CCPU_Usage(UINT nINTERVAL) : m_pfnNtQuerySystemInformation(NULL)
{
HMODULE hNTDLL = ::GetModuleHandle(_T("ntdll"));
if (hNTDLL)
{
if (NULL != ::GetProcAddress(hNTDLL, "NtQuerySystemInformationEx")) // check win7 present
m_pfnNtQuerySystemInformation = NULL;
else
m_pfnNtQuerySystemInformation = (PVOID)GetProcAddress(hNTDLL, "NtQuerySystemInformation");
}
// NtQuerySystemInformation = (PROCNTQSI)GetProcAddress(hNTDLL, "NtQuerySystemInformation");
m_nInterval = nINTERVAL;
}
CCPU_Usage::~CCPU_Usage()
{
m_pfnNtQuerySystemInformation = NULL;
}
double CCPU_Usage::GetCPUUsages()
{
double dResult = 0.0;
if (m_pfnNtQuerySystemInformation == NULL) // call GetSystemTimes
{
dResult = _Win7_CPU();
}
else
{
dResult = _XP_Vista_CPU();
}
return dResult;
}
ULONGLONG __inline CompareFileTime ( FILETIME time1, FILETIME time2 )
{
ULONGLONG a = ((ULONGLONG)time1.dwHighDateTime << 32) | time1.dwLowDateTime ;
ULONGLONG b = ((ULONGLONG)time2.dwHighDateTime << 32) | time2.dwLowDateTime ;
return (b - a);
}
double CCPU_Usage::_Win7_CPU()
{
BOOL bSuccess = FALSE;
double dbIdleTime = 0.0;
FILETIME OLD_idleTime = {0};
FILETIME OLD_kernelTime = {0};
FILETIME OLD_userTime = {0};
FILETIME idleTime;
FILETIME kernelTime;
FILETIME userTime;
ULONGLONG uIdleTime = 0L;
ULONGLONG uKernelTime = 0L;
ULONGLONG uUserTime = 0L;
while (bSuccess == FALSE)
{
if (GetSystemTimes( &idleTime, &kernelTime, &userTime ))
{
OLD_idleTime = idleTime;
OLD_kernelTime = kernelTime;
OLD_userTime = userTime;
// wait one second
::Sleep(m_nInterval);
if (GetSystemTimes( &idleTime, &kernelTime, &userTime ))
{
uIdleTime = CompareFileTime(OLD_idleTime, idleTime);
uKernelTime = CompareFileTime(OLD_kernelTime, kernelTime);
uUserTime = CompareFileTime(OLD_userTime, userTime);
if ((uKernelTime + uUserTime) > 1L)
{
dbIdleTime = (double)(uKernelTime + uUserTime - uIdleTime) * 100.0 / (double)(uKernelTime + uUserTime);
dbIdleTime += 0.25;
bSuccess = TRUE;
}
}
}
}
return dbIdleTime;
}
// NtQuerySystemInformation
// The function copies the system information of the specified type into a buffer
// NTSYSAPI
// NTSTATUS
// NTAPI
// NtQuerySystemInformation(
// IN UINT SystemInformationClass, // information type
// OUT PVOID SystemInformation, // pointer to buffer
// IN ULONG SystemInformationLength, // buffer size in bytes
// OUT PULONG ReturnLength OPTIONAL // pointer to a 32 bit variable that
// // receives the number of bytes written
// // to the buffer
// );
typedef LONG (WINAPI *PROCNTQSI) (UINT, PVOID, ULONG, PULONG);
double CCPU_Usage::_XP_Vista_CPU()
{
SYSTEM_BASIC_INFORMATION SysBaseInfo;
SYSTEM_TIME_INFORMATION SysTimeInfo;
SYSTEM_PERFORMANCE_INFORMATION SysPerfInfo;
LONG status;
LARGE_INTEGER liOldIdleTime = {0, 0};
LARGE_INTEGER liOldSystemTime = {0, 0};
double dbIdleTime = 0.0;
double dbSystemTime = 0.0;
PROCNTQSI NtQuerySystemInformation = (PROCNTQSI)m_pfnNtQuerySystemInformation;
if (NtQuerySystemInformation)
{
status = NtQuerySystemInformation(SystemBasicInformation, &SysBaseInfo,
sizeof(SysBaseInfo), NULL);
if (status == NO_ERROR)
{
// get system time
status = NtQuerySystemInformation(SystemTimeInformation, &SysTimeInfo,
sizeof(SysTimeInfo), NULL);
if (status == NO_ERROR)
{
// get system idle time
status = NtQuerySystemInformation(SystemPerformanceInformation,
&SysPerfInfo, sizeof(SysPerfInfo), NULL);
if (status == NO_ERROR)
{
liOldIdleTime = SysPerfInfo.liIdleTime;
liOldSystemTime = SysTimeInfo.liKeSystemTime;
// wait one second
::Sleep(m_nInterval);
// get new System time
status = NtQuerySystemInformation(SystemTimeInformation, &SysTimeInfo,
sizeof(SysTimeInfo), NULL);
if (status == NO_ERROR)
{
// get new system idle time
status = NtQuerySystemInformation(SystemPerformanceInformation,
&SysPerfInfo, sizeof(SysPerfInfo), NULL);
if (status == NO_ERROR)
{
// current value = new value - old value
dbIdleTime = Li2Double(SysPerfInfo.liIdleTime) - Li2Double(liOldIdleTime);
dbSystemTime = Li2Double(SysTimeInfo.liKeSystemTime) - Li2Double(liOldSystemTime);
// currentCpuIdle = IdleTime / SystemTime;
dbIdleTime = dbIdleTime / dbSystemTime;
// currentCpuUsage% = 100 - (CurrentCpuIdle * 100) / NumberOfProcessors
dbIdleTime = 100.0 - dbIdleTime * 100.0 / (double)SysBaseInfo.bKeNumberProcessors + 0.25;
}
}
}
}
}
}
return dbIdleTime;
}
// Terminate a running process safely
BOOL gfnSafeTerminateProcess(HANDLE hProcess, UINT uExitCode, DWORD dwTimeout)
{
DWORD dwTID, dwCode, dwErr = 0;
HANDLE hProcessDup = INVALID_HANDLE_VALUE;
HANDLE hRT = NULL;
HINSTANCE hKernel = GetModuleHandle(_T("Kernel32"));
BOOL bSuccess = FALSE;
BOOL bDup = DuplicateHandle(GetCurrentProcess(),
hProcess,
GetCurrentProcess(),
&hProcessDup,
PROCESS_ALL_ACCESS,
FALSE,
0);
// Detect the special case where the process is
// already dead...
if ( GetExitCodeProcess((bDup) ? hProcessDup : hProcess, &dwCode) &&
(dwCode == STILL_ACTIVE) )
{
FARPROC pfnExitProc;
pfnExitProc = GetProcAddress(hKernel, "ExitProcess");
hRT = CreateRemoteThread((bDup) ? hProcessDup : hProcess,
NULL,
0,
(LPTHREAD_START_ROUTINE)pfnExitProc,
(PVOID)uExitCode, 0, &dwTID);
if ( hRT == NULL )
dwErr = GetLastError();
}
else
{
dwErr = ERROR_PROCESS_ABORTED;
}
if ( hRT )
{
// Must wait process to terminate to
// guarantee that it has exited...
DWORD dwResult = WaitForSingleObject(
(bDup) ? hProcessDup : hProcess, dwTimeout);
bSuccess = dwResult == WAIT_OBJECT_0;
if (!bSuccess)
dwErr = ERROR_PROCESS_ABORTED;
CloseHandle(hRT);
}
if ( bDup )
CloseHandle(hProcessDup);
if ( !bSuccess )
SetLastError(dwErr);
return bSuccess;
}
BOOL gfnIsFileExist(LPCTSTR lpszFileName)
{
BOOL bRet = FALSE;
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
if (lpszFileName)
{
hFind = ::FindFirstFile(lpszFileName, &FindFileData);
if (hFind != INVALID_HANDLE_VALUE)
{
if (FindFileData.dwFileAttributes = FILE_ATTRIBUTE_NORMAL)
bRet = TRUE;
::FindClose(hFind);
}
}
return bRet;
}
| 27.232258 | 108 | 0.670457 | goodspeed24e |
12653cb208a30f769f8eda7e5d156cbaa90186d3 | 518 | cpp | C++ | org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/cpp/test1.cpp | assessorgeneral/ConQAT | 2a462f23f22c22aa9d01a7a204453d1be670ba60 | [
"Apache-2.0"
] | 4 | 2016-06-26T01:13:39.000Z | 2022-03-04T16:42:35.000Z | org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/cpp/test1.cpp | brynary/conqat | 52172907ec76c4b0915091343f0975dc0cf4891c | [
"Apache-2.0"
] | null | null | null | org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/cpp/test1.cpp | brynary/conqat | 52172907ec76c4b0915091343f0975dc0cf4891c | [
"Apache-2.0"
] | 7 | 2015-04-01T03:50:54.000Z | 2021-11-11T05:19:48.000Z | // this file contains a couple of interesting cases for testing our parser.
// this file will not compile!
enum State {
ON=1, OFF, DONT_KNOW=17
};
// forward declarations
class MyClass;
struct MyStruct;
struct MyNamespace::MyStruct;
enum MyEnum;
// diffent kinds of types for variables
MyStruct *ms1;
struct MyStruct *ms2;
MyNamespace::MyStruct *ms3;
// actual struct
struct MyStruct {
int a;
};
// extern stuff
extern "C" void foo();
extern "C" {
void bar ();
}
void foo (int *a) {
if (a) delete a;
}
| 14 | 75 | 0.69305 | assessorgeneral |
126ab438d7361207f47319104e8bcae01249b567 | 3,235 | cc | C++ | Online Judge/11439 - Maximizing the ICPC.cc | BrehamPie/Problem-Solves | 055e21ca4922170b80c5a53f43d9216f34b6f642 | [
"CC0-1.0"
] | null | null | null | Online Judge/11439 - Maximizing the ICPC.cc | BrehamPie/Problem-Solves | 055e21ca4922170b80c5a53f43d9216f34b6f642 | [
"CC0-1.0"
] | null | null | null | Online Judge/11439 - Maximizing the ICPC.cc | BrehamPie/Problem-Solves | 055e21ca4922170b80c5a53f43d9216f34b6f642 | [
"CC0-1.0"
] | null | null | null | #include<bits/stdc++.h>
using namespace std;
// Finds Maximum matching in General Graph
// Complexity O(NM)
// source: https://codeforces.com/blog/entry/92339?#comment-810242
using pii = pair<int, int>;
int Blossom(vector<vector<int>>& graph) {
//mate contains matched edge.
int n = graph.size(), timer = -1;
vector<int> mate(n, -1), label(n), parent(n),
orig(n), aux(n, -1), q;
auto lca = [&](int x, int y) {
for (timer++; ; swap(x, y)) {
if (x == -1) continue;
if (aux[x] == timer) return x;
aux[x] = timer;
x = (mate[x] == -1 ? -1 : orig[parent[mate[x]]]);
}
};
auto blossom = [&](int v, int w, int a) {
while (orig[v] != a) {
parent[v] = w; w = mate[v];
if (label[w] == 1) label[w] = 0, q.push_back(w);
orig[v] = orig[w] = a; v = parent[w];
}
};
auto augment = [&](int v) {
while (v != -1) {
int pv = parent[v], nv = mate[pv];
mate[v] = pv; mate[pv] = v; v = nv;
}
};
auto bfs = [&](int root) {
fill(label.begin(), label.end(), -1);
iota(orig.begin(), orig.end(), 0);
q.clear();
label[root] = 0; q.push_back(root);
for (int i = 0; i < (int)q.size(); ++i) {
int v = q[i];
for (auto x : graph[v]) {
if (label[x] == -1) {
label[x] = 1; parent[x] = v;
if (mate[x] == -1)
return augment(x), 1;
label[mate[x]] = 0; q.push_back(mate[x]);
}
else if (label[x] == 0 && orig[v] != orig[x]) {
int a = lca(orig[v], orig[x]);
blossom(x, v, a); blossom(v, x, a);
}
}
}
return 0;
};
// Time halves if you start with (any) maximal matching.
for (int i = 0; i < n; i++)
if (mate[i] == -1)
bfs(i);
int match = 0;
for (int i = 0;i < n;i++) {
if (mate[i] + 1)match++;
}
return match / 2;
}
int main() {
int t;
scanf("%d", &t);
for (int ks = 1;ks <= t;ks++) {
int n;
scanf("%d", &n);
vector<int>a[1 << n];
int total = (1 << n);
vector<vector<pii>>adj(total);
for (int i = 0;i < total - 1;i++) {
for (int j = i + 1;j < total;j++) {
int x;
scanf("%d", &x);
adj[i].push_back({ j,x });
adj[j].push_back({ i,x });
}
}
int hi = 1000000000;
int lo = 0;
int ans = 0;
while (lo <= hi) {
int mid = (hi + lo) / 2;
vector<vector<int>>g(total);
for (int i = 0;i < total;i++) {
for (auto x : adj[i]) {
if (x.second >= mid) {
g[i].push_back(x.first);
}
}
}
int match = Blossom(g);
if (match == (total) / 2) {
ans = mid;
lo = mid + 1;
}
else hi = mid - 1;
}
printf("Case %d: %d\n", ks, ans);
}
} | 30.809524 | 66 | 0.381762 | BrehamPie |
126b94d77603c11bfa95fb2740b2cb9777c048a0 | 6,245 | cpp | C++ | fboss/agent/hw/bcm/BcmRxPacket.cpp | TomMD/fboss | 30654277076e1f1f50c9b756e9690737dc1476e0 | [
"BSD-3-Clause"
] | null | null | null | fboss/agent/hw/bcm/BcmRxPacket.cpp | TomMD/fboss | 30654277076e1f1f50c9b756e9690737dc1476e0 | [
"BSD-3-Clause"
] | null | null | null | fboss/agent/hw/bcm/BcmRxPacket.cpp | TomMD/fboss | 30654277076e1f1f50c9b756e9690737dc1476e0 | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 2004-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include "fboss/agent/hw/bcm/BcmRxPacket.h"
#include "fboss/agent/hw/bcm/BcmError.h"
#include "fboss/agent/hw/bcm/BcmSwitch.h"
#include "fboss/agent/hw/bcm/BcmTrunkTable.h"
#include "fboss/agent/hw/bcm/RxUtils.h"
#include <folly/Format.h>
#include <tuple>
extern "C" {
#include <bcm/rx.h>
#ifdef INCLUDE_PKTIO
#include <bcm/pktio.h>
#include <bcm/pktio_defs.h>
#include <bcmpkt/bcmpkt_rxpmd_defs.h>
#endif
}
using folly::IOBuf;
namespace {
/*
* This is the callback in the IOBuf destructor for releasing SDK buf.
* Only used in non-PKTIO case.
*/
void freeRxBuf(void* ptr, void* arg) {
intptr_t unit = reinterpret_cast<intptr_t>(arg);
bcm_rx_free(unit, ptr);
}
#ifdef INCLUDE_PKTIO
/* IOBuf requires a free callback. Otherwise the default free() will
* be called. For PKTIO, nothing needs to be done. Provide an empty
* callback just to avoid the default free() being called.
*/
void pktioIOBufEmptyCallback(void* ptr, void* arg) {}
#endif
const char* const kRxReasonNames[] = BCM_RX_REASON_NAMES_INITIALIZER;
#ifdef INCLUDE_PKTIO
const struct {
std::string name;
int reason;
} kPktIORxReasonInfos[] = {BCMPKT_REASON_NAME_MAP_INIT};
#endif
} // namespace
namespace facebook::fboss {
BcmRxPacket::BcmRxPacket(const BcmPacketT& bcmPacket) {
usePktIO_ = bcmPacket.usePktIO;
if (!usePktIO_) {
bcm_pkt_t* pkt = bcmPacket.ptrUnion.pkt;
unit_ = pkt->unit;
// The BCM RX code always uses a single buffer.
// As long as there is just a single buffer, we don't need to allocate
// a separate array of bcm_pkt_blk_t objects.
CHECK_EQ(pkt->blk_count, 1);
CHECK_EQ(pkt->pkt_data, &pkt->_pkt_data);
buf_ = IOBuf::takeOwnership(
pkt->pkt_data->data, // void* buf
pkt->pkt_len,
freeRxBuf, // FreeFunction freeFn
reinterpret_cast<void*>(unit_)); // void* userData
srcPort_ = PortID(pkt->src_port);
srcVlan_ = VlanID(pkt->vlan);
len_ = pkt->pkt_len;
} else { // PKTIO
#ifdef INCLUDE_PKTIO
bcm_pktio_pkt_t* pkt = bcmPacket.ptrUnion.pktioPkt;
unit_ = pkt->unit;
void* buffer;
int rv;
uint32 val;
rv = bcm_pktio_pmd_field_get(
unit_, pkt, bcmPktioPmdTypeHigig2, BCM_PKTIO_HG2_SRC_PORT, &val);
bcmCheckError(rv, "failed to get pktio BCM_PKTIO_HG2_SRC_PORT");
srcPort_ = PortID(val);
// lowest bit in module id is used to accommodate port logical ids greater
// than 255
rv = bcm_pktio_pmd_field_get(
unit_, pkt, bcmPktioPmdTypeHigig2, BCM_PKTIO_HG2_SRC_MODID, &val);
bcmCheckError(rv, "failed to get pktio BCM_PKTIO_HG2_SRC_MODID");
srcPort_ = (val << 8) | srcPort_;
rv = bcm_pktio_pmd_field_get(
unit_, pkt, bcmPktioPmdTypeRx, BCMPKT_RXPMD_OUTER_VID, &val);
bcmCheckError(rv, "failed to get pktio OUTER_VID");
srcVlan_ = VlanID(val);
rv = bcm_pktio_pkt_data_get(unit_, pkt, &buffer, &len_);
bcmCheckError(rv, "failed to get pktio packet data");
buf_ = IOBuf::takeOwnership(buffer, len_, pktioIOBufEmptyCallback, nullptr);
#else
throw FbossError("invalid PKTIO configuration");
#endif
} // PKTIO
}
BcmRxPacket::~BcmRxPacket() {
// Nothing to do. The IOBuf destructor will call freeRxBuf()
// to free the packet data
}
FbBcmRxPacket::FbBcmRxPacket(
const BcmPacketT& bcmPacket,
const BcmSwitch* bcmSwitch)
: BcmRxPacket(bcmPacket) {
bool usePktIO = bcmPacket.usePktIO;
_reasons.usePktIO = usePktIO;
if (!usePktIO) {
bcm_pkt_t* pkt = bcmPacket.ptrUnion.pkt;
_cosQueue = pkt->cos;
if (pkt->flags & BCM_PKT_F_TRUNK) {
isFromAggregatePort_ = true;
srcAggregatePort_ =
bcmSwitch->getTrunkTable()->getAggregatePortId(pkt->src_trunk);
}
_priority = pkt->prio_int;
_reasons.reasonsUnion.reasons = pkt->rx_reasons;
} else { // PKTIO
#ifdef INCLUDE_PKTIO
bcm_pktio_pkt_t* pkt = bcmPacket.ptrUnion.pktioPkt;
bcm_pktio_fid_support_t support;
uint32 val;
bool is_trunk;
auto rv = bcm_pktio_pmd_field_get(
unit_, pkt, bcmPktioPmdTypeRx, BCMPKT_RXPMD_CPU_COS, &val);
bcmCheckError(rv, "failed to get pktio CPU_COS");
_cosQueue = val;
rv = bcm_pktio_pmd_field_get(
unit_, pkt, bcmPktioPmdTypeHigig2, BCM_PKTIO_HG2_PPD0_SRC_T, &val);
bcmCheckError(rv, "failed to get pktio BCM_PKTIO_HG2_PPD0_SRC_T");
is_trunk = val;
if (is_trunk) {
uint32 src_port;
rv = bcm_pktio_pmd_field_get(
unit_, pkt, bcmPktioPmdTypeHigig2, BCM_PKTIO_HG2_SRC_PORT, &val);
bcmCheckError(rv, "failed to get pktio BCM_PKTIO_HG2_SRC_PORT");
src_port = val;
isFromAggregatePort_ = true;
srcAggregatePort_ =
bcmSwitch->getTrunkTable()->getAggregatePortId(src_port);
}
rv = bcm_pktio_pmd_field_get(
unit_, pkt, bcmPktioPmdTypeRx, BCMPKT_RXPMD_OUTER_PRI, &val);
bcmCheckError(rv, "failed to get pktio OUTER_PRI");
_priority = val;
rv = bcm_pktio_pmd_reasons_get(
unit_, pkt, &_reasons.reasonsUnion.pktio_reasons);
bcmCheckError(rv, "failed to get pktio RX reasons");
#endif
}
}
std::string FbBcmRxPacket::describeDetails() const {
return folly::sformat(
"cos={} priority={} reasons={}",
_cosQueue,
_priority,
RxUtils::describeReasons(_reasons));
}
std::vector<BcmRxPacket::RxReason> FbBcmRxPacket::getReasons() {
std::vector<BcmRxPacket::RxReason> reasons;
if (!usePktIO_) {
for (int n = 0; n < bcmRxReasonCount; n++) {
if (BCM_RX_REASON_GET(_reasons.reasonsUnion.reasons, n)) {
reasons.push_back({n, kRxReasonNames[n]});
}
}
} else {
#ifdef INCLUDE_PKTIO
for (int n = BCMPKT_RX_REASON_NONE; n < BCMPKT_RX_REASON_COUNT; n++) {
if (BCM_PKTIO_REASON_GET(
_reasons.reasonsUnion.pktio_reasons.rx_reasons, n)) {
reasons.push_back({n, kPktIORxReasonInfos[n].name});
}
}
#endif
}
return reasons;
}
} // namespace facebook::fboss
| 28.646789 | 80 | 0.690633 | TomMD |
126cdaec4358ab0a3bdfc4fc4c23815da9f11c7d | 19,860 | cpp | C++ | front-end/poker_game/game/game_view.cpp | marklion/poker_game | 1efad6ac3da333df714c88bee7e4a261ac594f5a | [
"BSD-2-Clause"
] | 3 | 2020-07-09T11:31:46.000Z | 2020-12-15T03:02:12.000Z | front-end/poker_game/game/game_view.cpp | marklion/poker_game | 1efad6ac3da333df714c88bee7e4a261ac594f5a | [
"BSD-2-Clause"
] | 2 | 2022-02-19T06:08:20.000Z | 2022-02-27T09:46:31.000Z | front-end/poker_game/game/game_view.cpp | marklion/poker_game | 1efad6ac3da333df714c88bee7e4a261ac594f5a | [
"BSD-2-Clause"
] | null | null | null | #include "game_view.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGraphicsGridLayout>
#include <qgraphicslayout.h>
#include <QSize>
void show_cards_img_inLabel(QLabel &_lab, game_msg_card *_card)
{
QString color_map[game_card_invalid] = {
[game_card_heart] = "heart",
[game_card_spade] = "spade",
[game_card_diamond] = "diamond",
[game_card_club] = "club"
};
if (_card->number == 0)
{
QString filename = ":/cards_imgs/little_joker.jpg";
_lab.setPixmap(QPixmap(filename));
}
else
{
QString filename = QString(":/cards_imgs/") + color_map[_card->color] + "_" + QString::number(_card->number) + ".jpg";
_lab.setPixmap(QPixmap(filename));
}
}
game_view::game_view(QWidget *parent) : QMainWindow(parent)
{
game_control::GetController()->AddView(this);
this->setWindowTitle(tr("游戏"));
auto cenwid = new QWidget(this);
auto cenlayout = new QVBoxLayout(cenwid);
setCentralWidget(cenwid);
auto table_info_layout = new QHBoxLayout(this);
cenlayout->addLayout(table_info_layout);
m_table_input.setPlaceholderText("请输入桌号");
m_table_input.setInputMethodHints(Qt::ImhDigitsOnly);
table_info_layout->addWidget(&m_table_input);
m_follow_btn.setText("跟随");
connect(&m_follow_btn, SIGNAL(clicked()), this, SLOT(proc_follow_table()));
table_info_layout->addWidget(&m_follow_btn);
m_create_btn.setText("开新桌");
connect(&m_create_btn, SIGNAL(clicked()), this, SLOT(proc_create_table()));
table_info_layout->addWidget(&m_create_btn);
m_cur_table_no.setText("当前桌号:");
table_info_layout->addWidget(&m_cur_table_no);
m_cancle_btn.setText("退出");
table_info_layout->addWidget(&m_cancle_btn);
connect(&m_cancle_btn, SIGNAL(clicked()), this, SLOT(proc_cancle()));
auto player_zone_layout = new QHBoxLayout();
cenlayout->addLayout(player_zone_layout);
for (int i = 0; i < 5; i++)
{
auto player_info = new game_sub_view_otherPlayer(this);
m_sub_view.push_back(player_info);
player_zone_layout->addWidget(player_info);
player_info->show();
m_pastOtherplayer[i] = player_info;
}
auto pub_cards_view = new game_sub_view_pub_cards(this);
cenlayout->addWidget(pub_cards_view);
m_sub_view.push_back(pub_cards_view);
pub_cards_view->show();
cenlayout->addWidget(&m_cur_pool);
auto sub_op_view = new game_sub_view_operate(this);
cenlayout->addWidget(sub_op_view);
sub_op_view->show();
m_sub_view.push_back(sub_op_view);
}
game_view::~game_view()
{
game_control::GetController()->DelView(this);
}
void game_view::refresh()
{
int iTableNo = game_control::GetController()->m_game_module.GetCurTableNo();
if (iTableNo != -1)
{
m_cur_table_no.setText(QString("当前桌号: ") + QString::number(iTableNo));
m_table_input.hide();
m_follow_btn.hide();
m_create_btn.hide();
}
m_cur_pool.setText(QString("主池金额:") + QString::number(game_control::GetController()->m_game_module.GetPoolCash()));
int iCurPos = game_control::GetController()->m_game_module.GetMySeat();
int iNextSeat = (iCurPos + 1) % 6;
int i = 0;
while (iNextSeat != iCurPos)
{
m_pastOtherplayer[i++]->SetSeat(iNextSeat);
iNextSeat++;
iNextSeat %= 6;
}
for (auto itr:m_sub_view)
{
itr->refresh();
}
}
void game_view::proc_follow_table()
{
game_control::GetController()->ReqToFollowTable(m_table_input.text().toInt());
}
void game_view::proc_create_table()
{
game_control::GetController()->ReqToCreateTable();
}
void game_view::proc_cancle()
{
this->close();
}
game_sub_view_operate::game_sub_view_operate(QWidget *parent):QWidget(parent),
m_cash_full_pool_btn("全池"),
m_cash_half_pool_btn("半池"),
m_cash_double_pool_btn("两倍池"),
m_cash_sld(Qt::Horizontal, nullptr),
m_result(new game_sub_view_last_result(this))
{
auto op_layout = new QHBoxLayout(this);
op_layout->addWidget(&m_hand_cards_lable[0]);
op_layout->addWidget(&m_hand_cards_lable[1]);
auto cash_zone_layout = new QGridLayout(this);
op_layout->addLayout(cash_zone_layout);
cash_zone_layout->addWidget(&m_SeatPos_lable, 0, 0);
cash_zone_layout->addWidget(&m_username_lable, 0, 1);
cash_zone_layout->addWidget(new QLabel("当前金额", this), 1,0);
cash_zone_layout->addWidget(&m_curCash_lable, 1, 1);
cash_zone_layout->addWidget(new QLabel("下注金额", this), 2, 0);
cash_zone_layout->addWidget(&m_batCash_lable, 2, 1);
cash_zone_layout->addWidget(new QLabel("行动时间",this), 3, 0);
cash_zone_layout->addWidget(&m_count_down_lable, 3, 1);
auto bat_zone_layout = new QVBoxLayout(this);
op_layout->addLayout(bat_zone_layout);
bat_zone_layout->addWidget(&m_ready_btn);
connect(&m_ready_btn, SIGNAL(clicked()), this, SLOT(proc_ready_btn()));
bat_zone_layout->addWidget(&m_cash_sld);
m_cash_sld.setRange(0, 100);
connect(&m_cash_sld, SIGNAL(sliderMoved(int)), this, SLOT(proc_slide_move(int)));
auto bat_cash_layout = new QHBoxLayout(this);
bat_zone_layout->addLayout(bat_cash_layout);
bat_cash_layout->addWidget(&m_cash_half_pool_btn);
bat_cash_layout->addWidget(&m_cash_full_pool_btn);
bat_cash_layout->addWidget(&m_cash_double_pool_btn);
connect(&m_cash_half_pool_btn, SIGNAL(clicked()), this, SLOT(proc_half_pool_btn()));
connect(&m_cash_full_pool_btn, SIGNAL(clicked()), this, SLOT(proc_full_pool_btn()));
connect(&m_cash_double_pool_btn, SIGNAL(clicked()), this, SLOT(proc_double_pool_btn()));
bat_zone_layout->addWidget(&m_bat_btn);
connect(&m_bat_btn, SIGNAL(clicked()), this, SLOT(proc_bat_btn()));
bat_zone_layout->addWidget(&m_follow_btn);
connect(&m_follow_btn, SIGNAL(clicked()), this, SLOT(proc_flw_btn()));
bat_zone_layout->addWidget(&m_fall_btn);
m_fall_btn.setText("弃牌");
connect(&m_fall_btn, SIGNAL(clicked()), this , SLOT(proc_fall_btn()));
op_layout->addWidget(m_result);
}
void game_sub_view_operate::_set_bat_cash(int _bat_cash)
{
int cur_cash = m_curCash_lable.text().toUInt() + game_control::GetController()->m_game_module.GetMybatCash();
int set_value = _bat_cash <= cur_cash ? _bat_cash : cur_cash;
if (cur_cash != 0)
{
m_cash_sld.setRange(game_control::GetController()->m_game_module.GetMinBatCash() * 2,cur_cash);
m_cash_sld.setValue(set_value);
}
}
void game_sub_view_operate::proc_full_pool_btn()
{
int pool_cash = game_control::GetController()->m_game_module.GetPoolCash();
int bat_cash = pool_cash;
_set_bat_cash(bat_cash);
}
void game_sub_view_operate::proc_half_pool_btn()
{
int pool_cash = game_control::GetController()->m_game_module.GetPoolCash();
int bat_cash = pool_cash / 2;
_set_bat_cash(bat_cash);
}
void game_sub_view_operate::proc_double_pool_btn()
{
int pool_cash = game_control::GetController()->m_game_module.GetPoolCash();
int bat_cash = pool_cash * 2;
_set_bat_cash(bat_cash);
}
void game_sub_view_operate::proc_slide_move(int _value)
{
_set_bat_cash(_value);
}
void game_sub_view_operate::proc_bat_btn()
{
game_control::GetController()->ReqToBatCash(game_msg_action_bat, m_cash_sld.value());
m_cash_sld.setValue(m_cash_sld.minimum());
}
void game_sub_view_operate::proc_fall_btn()
{
game_control::GetController()->ReqToBatCash(game_msg_action_fall, 0);
m_cash_sld.setValue(m_cash_sld.minimum());
}
void game_sub_view_operate::proc_flw_btn()
{
m_cash_sld.setValue(m_cash_sld.minimum());
int iSelfSeat = game_control::GetController()->m_game_module.GetMySeat();
int iLastSeat = (iSelfSeat + 5) % 6;
while (iSelfSeat != iLastSeat)
{
game_msg_player_info *lastPlayer = game_control::GetController()->m_game_module.GetPlayerBySeatpos(iLastSeat);
if (nullptr != lastPlayer && !(lastPlayer->bFalled))
{
game_control::GetController()->ReqToBatCash(game_msg_action_call, lastPlayer->ibatCash);
break;
}
iLastSeat = (iLastSeat + 5) % 6;
}
}
void game_sub_view_operate::proc_ready_btn()
{
auto self_seat = game_control::GetController()->m_game_module.GetMySeat();
auto self_player = game_control::GetController()->m_game_module.GetPlayerBySeatpos(self_seat);
if (self_player->bReady != 0)
{
game_control::GetController()->ReqToGetReady(false);
}
else
{
game_control::GetController()->ReqToGetReady(true);
}
}
void game_sub_view_operate::show_count_down()
{
if (m_count_down_lable.isHidden())
{
m_count_down_lable.show();
m_timer.start(18000);
}
int left_sec = m_timer.remainingTime() / 1000;
m_count_down_lable.setText(QString::number(left_sec));
}
void game_sub_view_operate::hide_count_down()
{
m_timer.stop();
m_count_down_lable.hide();
}
void game_sub_view_operate::refresh()
{
for (int i = 0; i < 2; i++)
{
show_cards_img_inLabel(m_hand_cards_lable[i], game_control::GetController()->m_game_module.GetMyhandCardbyIndex(i));
}
auto &gm = game_control::GetController()->m_game_module;
qDebug("refresh-view op %s", gm.GetSelfName().toUtf8().data());
m_SeatPos_lable.setText(QString::number( gm.GetMySeat() + 1) + "号位");
m_username_lable.setText(gm.GetSelfName());
if (!m_curCash_lable.text().isEmpty() && gm.GetPoolCash() == 0)
{
auto last_cash = m_curCash_lable.text().toInt();
auto cur_cash = gm.GetMyCurCash();
if (cur_cash > last_cash)
{
m_curCash_lable.setStyleSheet("background-color: green;");
}
else if (cur_cash < last_cash)
{
m_curCash_lable.setStyleSheet("background-color: red;");
}
}
m_curCash_lable.setText(QString::number(gm.GetMyCurCash()));
auto self_seat = game_control::GetController()->m_game_module.GetMySeat();
auto self_player = game_control::GetController()->m_game_module.GetPlayerBySeatpos(self_seat);
if (self_player!= nullptr && self_player->bReady != 0)
{
m_ready_btn.setText("取消准备");
}
else
{
m_ready_btn.setText("准备");
}
if (game_control::GetController()->m_game_module.IsGameStarted())
{
m_ready_btn.hide();
}
else
{
m_ready_btn.show();
}
m_batCash_lable.setText(QString::number(gm.GetMybatCash()));
int cur_cash = m_curCash_lable.text().toUInt() + game_control::GetController()->m_game_module.GetMybatCash();
m_cash_sld.setRange(game_control::GetController()->m_game_module.GetMinBatCash() * 2, cur_cash);
int iSelfSeat = game_control::GetController()->m_game_module.GetMySeat();
int iLastSeat = (iSelfSeat + 5) % 6;
while (iSelfSeat != iLastSeat)
{
game_msg_player_info *lastPlayer = game_control::GetController()->m_game_module.GetPlayerBySeatpos(iLastSeat);
if (nullptr != lastPlayer && !lastPlayer->bFalled)
{
if (lastPlayer->ibatCash <= 0)
{
auto bat_cash_now = QString::number( m_cash_sld.value());
m_bat_btn.setText(QString("下注:") + bat_cash_now);
m_follow_btn.setText("过牌");
}
else if (lastPlayer->ibatCash >= game_control::GetController()->m_game_module.GetMybatCash() * 2)
{
auto bat_cash_now = QString::number( m_cash_sld.value());
m_bat_btn.setText(QString("加注:") + bat_cash_now);
m_follow_btn.setText("跟注");
}
else
{
auto bat_cash_now = QString::number( m_cash_sld.value());
m_bat_btn.setText(QString("加注:") + bat_cash_now);
m_follow_btn.setText("过牌");
}
break;
}
iLastSeat = (iLastSeat + 5) % 6;
}
int iActionPos = game_control::GetController()->m_game_module.GetActionPos();
if (iActionPos != self_seat)
{
m_bat_btn.setDisabled(true);
m_fall_btn.setDisabled(true);
m_follow_btn.setDisabled(true);
m_cash_sld.hide();
m_cash_half_pool_btn.hide();
m_cash_full_pool_btn.hide();
m_cash_double_pool_btn.hide();
hide_count_down();
}
else
{
m_bat_btn.setDisabled(false);
m_fall_btn.setDisabled(false);
m_follow_btn.setDisabled(false);
m_cash_sld.show();
m_cash_half_pool_btn.show();
m_cash_full_pool_btn.show();
m_cash_double_pool_btn.show();
show_count_down();
}
m_result->SetSeat(gm.GetMySeat());
m_result->refresh();
}
game_sub_view_otherPlayer::game_sub_view_otherPlayer(QWidget *parent):QWidget(parent),m_result_wid(new game_sub_view_last_result(this))
{
auto player_info_layout = new QVBoxLayout(this);
player_info_layout->addWidget(&m_seat_label);
player_info_layout->addWidget(&m_name_label);
player_info_layout->addWidget(&m_curCash_label);
player_info_layout->addWidget(&m_batCash_label);
player_info_layout->addWidget(&m_ready_label);
player_info_layout->addWidget(&m_isAction_label);
player_info_layout->addWidget(&m_isFalled_label);
player_info_layout->addWidget(m_result_wid);
}
void game_sub_view_otherPlayer::SetSeat(int _seat)
{
m_iSeat = _seat;
m_result_wid->SetSeat(m_iSeat);
}
void game_sub_view_otherPlayer::hide_count_down()
{
m_isAction_label.hide();
m_timer.stop();
}
void game_sub_view_otherPlayer::show_count_down()
{
if (m_isAction_label.isHidden())
{
m_timer.start(18000);
m_isAction_label.show();
}
int left_sec = m_timer.remainingTime() / 1000;
m_isAction_label.setText(QString("行动中,剩余") + QString::number(left_sec) + "秒");
}
void game_sub_view_otherPlayer::refresh()
{
m_seat_label.setText(QString::number(m_iSeat + 1) + "号位");
game_msg_player_info *player = game_control::GetController()->m_game_module.GetPlayerBySeatpos(m_iSeat);
if (NULL != player)
{
m_name_label.setText(QString(player->szName));
if (!m_curCash_label.text().isEmpty() && game_control::GetController()->m_game_module.GetPoolCash() == 0)
{
auto last_cash = m_curCash_label.text().split(":").back().toInt();
if (player->icurrentCash > last_cash)
{
m_curCash_label.setStyleSheet("background-color: green;");
}
else if (player->icurrentCash < last_cash)
{
m_curCash_label.setStyleSheet("background-color: red;");
}
}
m_curCash_label.setText(QString("拥有金额:") + QString::number(player->icurrentCash));
m_batCash_label.setText(QString("下注金额:") + QString::number(player->ibatCash));
if (0 != player->bReady)
{
m_ready_label.setText("已准备");
}
else
{
m_ready_label.setText("未准备");
}
if (game_control::GetController()->m_game_module.IsGameStarted())
{
m_ready_label.hide();
if (game_control::GetController()->m_game_module.GetActionPos() == m_iSeat)
{
show_count_down();
m_isAction_label.setStyleSheet("background-color: green;");
}
else
{
if (player->bFalled)
{
m_isFalled_label.show();
m_isFalled_label.setText("弃牌");
m_isFalled_label.setStyleSheet("background-color: red;");
}
else if (player->bAllined)
{
m_isFalled_label.show();
m_isFalled_label.setText("全下");
m_isFalled_label.setStyleSheet("background-color: red;");
}
else
{
m_isFalled_label.hide();
}
hide_count_down();
}
}
else
{
m_ready_label.show();
}
m_result_wid->show();
m_result_wid->refresh();
}
else
{
m_name_label.setText("无玩家");
m_curCash_label.setText("");
m_batCash_label.setText("");
m_ready_label.setText("");
m_result_wid->hide();
}
}
game_sub_view_pub_cards::game_sub_view_pub_cards(QWidget *parent):QWidget(parent)
{
auto pub_card_layout = new QHBoxLayout(this);
for (int i = 0; i < 5; i++) {
pub_card_layout->addWidget(&m_pub_cards_label[i]);
}
}
void game_sub_view_pub_cards::refresh()
{
for (int i = 0; i < 5; i++)
{
auto single_card = game_control::GetController()->m_game_module.GetPubCardByIndex(i);
if (NULL != single_card)
{
show_cards_img_inLabel(m_pub_cards_label[i], single_card);
m_pub_cards_label[i].show();
}
else
{
m_pub_cards_label[i].hide();
}
}
}
game_sub_view_last_result::game_sub_view_last_result(QWidget *parent):QWidget(parent)
{
auto result_layout = new QVBoxLayout(this);
result_layout->addWidget(&m_pattern_type_label);
auto patt_layout = new QHBoxLayout(this);
result_layout->addLayout((patt_layout));
patt_layout->addWidget(&m_pattern_label[0]);
patt_layout->addWidget(&m_pattern_label[1]);
patt_layout->addWidget(&m_pattern_label[2]);
patt_layout->addWidget(&m_pattern_label[3]);
patt_layout->addWidget(&m_pattern_label[4]);
}
void game_sub_view_last_result::refresh()
{
auto single_result = game_control::GetController()->m_game_module.GetsingleResult(m_seat);
if (single_result->bShow)
{
this->show();
switch (single_result->enType) {
case game_msg_pattern_type_hight:
m_pattern_type_label.setText("高牌");
break;
case game_msg_pattern_type_pair:
m_pattern_type_label.setText("对子");
break;
case game_msg_pattern_type_two_pair:
m_pattern_type_label.setText("两对");
break;
case game_msg_pattern_type_set:
m_pattern_type_label.setText("三条");
break;
case game_msg_pattern_type_straiht:
m_pattern_type_label.setText("顺子");
break;
case game_msg_pattern_type_flush:
m_pattern_type_label.setText("同花");
break;
case game_msg_pattern_type_fullhouse:
m_pattern_type_label.setText("葫芦");
break;
case game_msg_pattern_type_fok:
m_pattern_type_label.setText("四条");
break;
case game_msg_pattern_type_flush_straight:
m_pattern_type_label.setText("同花顺");
break;
case game_msg_pattern_type_max:
m_pattern_type_label.setText("");
break;
}
for (int i = 0; i < 5; ++i) {
show_cards_img_inLabel(m_pattern_label[i], &single_result->finalPattern[i]);
m_pattern_label[i].setPixmap(m_pattern_label[i].pixmap()->scaled(60,90));
}
}
else
{
this->hide();
}
}
void game_sub_view_last_result::SetSeat(int _seat)
{
m_seat = _seat;
}
| 32.826446 | 136 | 0.629859 | marklion |
1271fe23ba6e1a8015426dd39bf871ab778b267d | 1,149 | hh | C++ | psalg/psalg/calib/CalibParsDBWeb.hh | JBlaschke/lcls2 | 30523ef069e823535475d68fa283c6387bcf817b | [
"BSD-3-Clause-LBNL"
] | 16 | 2017-11-09T17:10:56.000Z | 2022-03-09T23:03:10.000Z | psalg/psalg/calib/CalibParsDBWeb.hh | JBlaschke/lcls2 | 30523ef069e823535475d68fa283c6387bcf817b | [
"BSD-3-Clause-LBNL"
] | 6 | 2017-12-12T19:30:05.000Z | 2020-07-09T00:28:33.000Z | psalg/psalg/calib/CalibParsDBWeb.hh | JBlaschke/lcls2 | 30523ef069e823535475d68fa283c6387bcf817b | [
"BSD-3-Clause-LBNL"
] | 25 | 2017-09-18T20:02:43.000Z | 2022-03-27T22:27:42.000Z | #ifndef PSALG_CALIBPARSDBWEB_H
#define PSALG_CALIBPARSDBWEB_H
//-----------------------------
#include "psalg/calib/CalibParsDB.hh" // #include "psalg/calib/Query.hh"
#include "psalg/calib/MDBWebUtils.hh"
using namespace psalg; // for NDArray
namespace calib {
//-----------------------------
class CalibParsDBWeb : public CalibParsDB {
public:
CalibParsDBWeb();
virtual ~CalibParsDBWeb();
virtual const NDArray<float>& get_ndarray_float (Query&);
virtual const NDArray<double>& get_ndarray_double(Query&);
virtual const NDArray<uint16_t>& get_ndarray_uint16(Query&);
virtual const NDArray<uint32_t>& get_ndarray_uint32(Query&);
virtual const std::string& get_string (Query&);
virtual const rapidjson::Document& get_data (Query&);
virtual const rapidjson::Document& get_metadata (Query&);
CalibParsDBWeb(const CalibParsDBWeb&) = delete;
CalibParsDBWeb& operator = (const CalibParsDBWeb&) = delete;
private:
void _default_msg(const std::string& msg=std::string()) const;
}; // class
//-----------------------------
} // namespace calib
#endif // PSALG_CALIBPARSDBWEB_H
| 27.357143 | 72 | 0.664926 | JBlaschke |
12726762f02819a028b8c9f2447491996689243c | 41,478 | cpp | C++ | RobotRaconteurCore/src/AsyncMessageReader.cpp | robotraconteur/robotraconteur_pyodide | e2a529c75b1603ae9471091095c9c6b10652dbbb | [
"Apache-2.0"
] | null | null | null | RobotRaconteurCore/src/AsyncMessageReader.cpp | robotraconteur/robotraconteur_pyodide | e2a529c75b1603ae9471091095c9c6b10652dbbb | [
"Apache-2.0"
] | 1 | 2019-11-15T02:20:44.000Z | 2019-11-15T05:57:21.000Z | RobotRaconteurCore/src/AsyncMessageReader.cpp | johnwason/robotraconteur_pyodide | 438f1013ef144e27e8c714561cc4ab48815cb607 | [
"Apache-2.0"
] | 1 | 2021-03-05T16:20:48.000Z | 2021-03-05T16:20:48.000Z | // Copyright 2011-2020 Wason Technology, 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 "AsyncMessageReader.h"
#include <boost/range.hpp>
namespace RobotRaconteur
{
AsyncMessageReaderImpl::state_data::state_data()
{
state = Message_init;
pop_state = Message_init;
param1 = 0;
param2 = 0;
}
AsyncMessageReaderImpl::AsyncMessageReaderImpl()
{
Reset();
buf.reset(new uint8_t[128]);
buf_len = 128;
}
size_t& AsyncMessageReaderImpl::message_len()
{
return state_stack.front().limit;
}
AsyncMessageReaderImpl::state_type& AsyncMessageReaderImpl::state()
{
return state_stack.back().state;
}
size_t& AsyncMessageReaderImpl::param1()
{
return state_stack.back().param1;
}
size_t& AsyncMessageReaderImpl::param2()
{
return state_stack.back().param2;
}
std::string& AsyncMessageReaderImpl::param3()
{
return state_stack.back().param3;
}
size_t& AsyncMessageReaderImpl::limit()
{
return state_stack.back().limit;
}
size_t AsyncMessageReaderImpl::distance_from_limit()
{
return limit() - message_pos;
}
void AsyncMessageReaderImpl::pop_state()
{
if (state_stack.size() == 1) throw InvalidOperationException("Message read stack empty");
state_type s = state_stack.back().pop_state;
state_stack.pop_back();
state_stack.back().state = s;
}
void AsyncMessageReaderImpl::push_state(AsyncMessageReaderImpl::state_type new_state, AsyncMessageReaderImpl::state_type pop_state, size_t relative_limit, RR_INTRUSIVE_PTR<RRValue> data, size_t param1, size_t param2)
{
state_data d;
d.state = new_state;
d.pop_state = pop_state;
d.data = data;
d.param1 = param1;
d.param2 = param2;
d.limit = message_pos + relative_limit;
if (d.limit > message_len()) throw ProtocolException("Invalid message limit");
state_stack.push_back(d);
}
void AsyncMessageReaderImpl::push_state(AsyncMessageReaderImpl::state_type new_state, AsyncMessageReaderImpl::state_type pop_state, size_t relative_limit, void* ptrdata, size_t param1, size_t param2, std::string& param3)
{
state_data d;
d.state = new_state;
d.pop_state = pop_state;
d.ptrdata = ptrdata;
d.param1 = param1;
d.param2 = param2;
d.param3.swap(param3);
d.limit = message_pos + relative_limit;
if (d.limit > message_len()) throw ProtocolException("Invalid message limit");
state_stack.push_back(d);
}
void AsyncMessageReaderImpl::prepare_continue(const const_buffers& other_bufs1, size_t& other_bufs_used)
{
if (buf_avail_pos > 0)
{
if (buf_read_pos == buf_avail_pos)
{
buf_avail_pos = 0;
buf_read_pos = 0;
}
else
{
//Move any remaining data to the beginning of buffer
size_t n = buf_avail_pos - buf_read_pos;
std::memmove(buf.get(), buf.get() + buf_read_pos, n);
buf_read_pos = 0;
buf_avail_pos = n;
}
}
size_t n2 = boost::asio::buffer_size(this->other_bufs);
if ( n2 > 0)
{
boost::asio::mutable_buffer p2(buf.get(), buf_len);
p2 = p2 + buf_avail_pos;
size_t n2=boost::asio::buffer_copy(p2, other_bufs);
buf_avail_pos += n2;
buffers_consume(this->other_bufs, n2);
}
else
{
this->other_bufs.clear();
}
other_bufs_used = boost::asio::buffer_size(other_bufs1) - boost::asio::buffer_size(this->other_bufs);
//other_bufs.clear();
}
size_t AsyncMessageReaderImpl::available()
{
size_t s = (buf_avail_pos - buf_read_pos);
s += (boost::asio::buffer_size(other_bufs));
return s;
}
bool AsyncMessageReaderImpl::read_all_bytes(void* p, size_t len)
{
if (distance_from_limit() < len)
{
throw ProtocolException("Message limit error");
}
if (available() < len)
{
return false;
}
read_some_bytes(p, len);
return true;
}
size_t AsyncMessageReaderImpl::read_some_bytes(void* p, size_t len)
{
if (len == 0) return 0;
len = std::min(len, distance_from_limit());
if (len == 0) throw ProtocolException("Message limit error");
boost::asio::mutable_buffer p2 (p, len);
size_t c = 0;
if (buf_avail_pos - buf_read_pos > 0)
{
boost::asio::const_buffer p3(buf.get(), buf_avail_pos);
p3 = p3 + buf_read_pos;
c = boost::asio::buffer_copy(p2, p3);
p2 = p2 + c;
p3 = p3 + c;
if (boost::asio::buffer_size(p3) == 0)
{
buf_read_pos = 0;
buf_avail_pos = 0;
}
else
{
buf_read_pos += c;
}
if (boost::asio::buffer_size(p2) == 0)
{
message_pos += c;
return c;
}
}
size_t c2 = boost::asio::buffer_copy(p2, other_bufs);
if (c2 == 0)
{
message_pos += c;
return c;
}
buffers_consume(other_bufs, c2);
size_t c3 = c + c2;
message_pos += c3;
return c3;
}
bool AsyncMessageReaderImpl::peek_byte(uint8_t& b)
{
if (distance_from_limit() == 0) throw ProtocolException("Message limit error");
if (available() == 0) return false;
if (buf_avail_pos - buf_read_pos > 0)
{
b = *(buf.get() + buf_read_pos);
return true;
}
size_t a1 = boost::asio::buffer_copy(boost::asio::buffer(&b, 1), other_bufs);
if (a1 == 1) return true;
return false;
}
bool AsyncMessageReaderImpl::read_uint_x(uint32_t& num)
{
uint8_t b1;
if (!peek_byte(b1)) return false;
if (b1 <= 252)
{
read_number(b1);
num = b1;
return true;
}
if (b1 == 253)
{
size_t a1 = available();
if (a1 < 3) return false;
read_number(b1);
uint16_t num2;
read_number(num2);
num = num2;
return true;
}
if (b1 == 254)
{
size_t a1 = available();
if (a1 < 5) return false;
read_number(b1);
read_number(num);
return true;
}
throw ProtocolException("Invalid uint_x in read");
}
bool AsyncMessageReaderImpl::read_uint_x2(uint64_t& num)
{
uint8_t b1;
if (!peek_byte(b1)) return false;
if (b1 <= 252)
{
read_number(b1);
num = b1;
return true;
}
if (b1 == 253)
{
size_t a1 = available();
if (a1 < 3) return false;
read_number(b1);
uint16_t num2;
read_number(num2);
num = num2;
return true;
}
if (b1 == 254)
{
size_t a1 = available();
if (a1 < 5) return false;
read_number(b1);
uint32_t num2;
read_number(num2);
num = num2;
return true;
}
if (b1 == 255)
{
size_t a1 = available();
if (a1 < 9) return false;
read_number(b1);
read_number(num);
return true;
}
return false;
}
bool AsyncMessageReaderImpl::read_int_x(int32_t& num)
{
uint8_t b1_1;
if (!peek_byte(b1_1)) return false;
int8_t b1 = *reinterpret_cast<int8_t*>(&b1_1);
if (b1 <= 124)
{
read_number(b1);
num = b1;
return true;
}
if (b1 == 125)
{
size_t a1 = available();
if (a1 < 3) return false;
read_number(b1);
int16_t num2;
read_number(num2);
num = num2;
return true;
}
if (b1 == 126)
{
size_t a1 = available();
if (a1 < 5) return false;
read_number(b1);
read_number(num);
return true;
}
throw ProtocolException("Invalid uint_x in read");
}
bool AsyncMessageReaderImpl::read_int_x2(int64_t& num)
{
uint8_t b1_1;
if (!peek_byte(b1_1)) return false;
int8_t b1 = *reinterpret_cast<int8_t*>(&b1_1);
if (b1 <= 124)
{
read_number(b1);
num = b1;
return true;
}
if (b1 == 125)
{
size_t a1 = available();
if (a1 < 3) return false;
read_number(b1);
int16_t num2;
read_number(num2);
num = num2;
return true;
}
if (b1 == 126)
{
size_t a1 = available();
if (a1 < 5) return false;
read_number(b1);
int32_t num2;
read_number(num2);
num = num2;
return true;
}
if (b1 == 127)
{
size_t a1 = available();
if (a1 < 9) return false;
read_number(b1);
read_number(num);
return true;
}
return false;
}
static void null_str_deleter(std::string* s) {}
bool AsyncMessageReaderImpl::read_string(MessageStringPtr& str, state_type next_state)
{
uint16_t l;
if (!read_number(l)) return false;
//TODO: avoid swap
std::string s;
s.resize(l);
size_t n = read_some_bytes(&s[0], l);
if (n == l)
{
str = MessageStringPtr(RR_MOVE(s));
return true;
}
push_state(Header_readstring, next_state, l - n, &str, n, 0, s);
return false;
}
bool AsyncMessageReaderImpl::read_string(MessageStringPtr& str)
{
state_type next_state = state();
next_state = static_cast<state_type>(static_cast<int>(next_state) + 1);
return read_string(str, next_state);
}
bool AsyncMessageReaderImpl::read_string4(MessageStringPtr& str, state_type next_state)
{
uint32_t l;
if (!read_uint_x(l)) return false;
std::string s;
s.resize(l);
size_t n = read_some_bytes(&s[0], l);
if (n == l)
{
str = MessageStringPtr(s);
return true;
}
push_state(Header_readstring, next_state, l-n, &str, n, 0, s);
return false;
}
bool AsyncMessageReaderImpl::read_string4(MessageStringPtr& str)
{
state_type next_state = state();
next_state = static_cast<state_type>(static_cast<int>(next_state) + 1);
return read_string4(str, next_state);
}
void AsyncMessageReaderImpl::Reset()
{
this->version = 2;
buf_avail_pos = 0;
buf_read_pos = 0;
while (!read_messages.empty()) read_messages.pop();
state_stack.clear();
state_data s;
RR_INTRUSIVE_PTR<Message> m = CreateMessage();
s.data = m;
s.state = Message_init;
s.limit = 12;
message_pos = 0;
state_stack.push_back(s);
message_pos = 0;
}
#define R(res) if (!res) { \
prepare_continue(other_bufs, other_bufs_used); \
return ReadReturn_continue_nobuffers; }
#define DO_POP_STATE() { \
pop_state(); \
continue; }
AsyncMessageReaderImpl::return_type AsyncMessageReaderImpl::Read(const const_buffers& other_bufs, size_t& other_bufs_used, size_t continue_read_len, mutable_buffers& next_continue_read_bufs)
{
this->other_bufs = other_bufs;
while (true)
{
switch (state())
{
case Message_init:
{
RR_INTRUSIVE_PTR<Message> m = CreateMessage();
state_stack[0].data = m;
state() = MessageHeader_init;
continue;
}
case Message_done:
prepare_continue(other_bufs, other_bufs_used);
if (distance_from_limit() != 0) throw ProtocolException("Message did not consume all data");
read_messages.push(RR_STATIC_POINTER_CAST<Message>(state_stack.back().data));
return ReadReturn_done;
case MessageHeader_init:
{
if (available() < 12)
{
throw ProtocolException("Initial message header not available");
}
std::string magic;
magic.resize(4);
read_all_bytes(&magic[0], 4);
if (magic != "RRAC")
{
throw ProtocolException("Invalid message magic");
}
RR_INTRUSIVE_PTR<MessageHeader> h = CreateMessageHeader();
read_number(h->MessageSize);
read_number(version);
uint16_t header_size = 0;
read_number(header_size);
h->HeaderSize = header_size;
message_len() = h->MessageSize;
data<Message>()->header = h;
push_state(MessageHeader_routing1, Message_readentries, h->HeaderSize - 12, h);
}
case MessageHeader_routing1:
{
boost::array<uint8_t, 16> nodeid;
R(read_all_bytes(&nodeid[0], 16));
data<MessageHeader>()->SenderNodeID = NodeID(nodeid);
state() = MessageHeader_routing2;
}
case MessageHeader_routing2:
{
boost::array<uint8_t, 16> nodeid;
R(read_all_bytes(&nodeid[0], 16));
data<MessageHeader>()->ReceiverNodeID = NodeID(nodeid);
state() = MessageHeader_endpoint1;
}
case MessageHeader_endpoint1:
{
R(read_number(data<MessageHeader>()->SenderEndpoint));
state() = MessageHeader_endpoint2;
}
case MessageHeader_endpoint2:
{
R(read_number(data<MessageHeader>()->ReceiverEndpoint));
state() = MessageHeader_routing3;
}
case MessageHeader_routing3:
{
R(read_string(data<MessageHeader>()->SenderNodeName, MessageHeader_routing4));
state() = MessageHeader_routing4;
}
case MessageHeader_routing4:
{
R(read_string(data<MessageHeader>()->ReceiverNodeName, MessageHeader_metainfo));
state() = MessageHeader_metainfo;
}
case MessageHeader_metainfo:
{
R(read_string(data<MessageHeader>()->MetaData, MessageHeader_entrycount));
state() = MessageHeader_entrycount;
}
case MessageHeader_entrycount:
{
R(read_number(data<MessageHeader>()->EntryCount));
state() = MessageHeader_messageid1;
}
case MessageHeader_messageid1:
{
R(read_number(data<MessageHeader>()->MessageID));
state() = MessageHeader_messageid2;
}
case MessageHeader_messageid2:
{
R(read_number(data<MessageHeader>()->MessageResID));
pop_state();
state() = Message_readentries;
}
case Message_readentries:
{
Message* m = data<Message>();
m->entries.reserve(m->header->EntryCount);
if (m->entries.size() >= m->header->EntryCount)
{
state() = Message_done;
continue;
}
state() = MessageEntry_init;
}
case MessageEntry_init:
{
RR_INTRUSIVE_PTR<MessageEntry> ee = CreateMessageEntry();
data<Message>()->entries.push_back(ee);
push_state(MessageEntry_entrysize, Message_readentries, limit() - message_pos, ee);
continue;
}
case MessageEntry_finishread:
{
if (distance_from_limit() != 0) throw ProtocolException("MessageEntry did not consume all data");
DO_POP_STATE();
}
case MessageEntry_entrysize:
{
uint32_t p = message_pos;
MessageEntry* ee = data<MessageEntry>();
R(read_number(ee->EntrySize));
if (ee->EntrySize < 4) throw ProtocolException("Message entry too short");
if (p + ee->EntrySize > message_len()) throw ProtocolException("Message entry out of bounds");
limit() = p + ee->EntrySize;
state() = MessageEntry_entrytype;
}
case MessageEntry_entrytype:
{
uint16_t t;
R(read_number(t));
data<MessageEntry>()->EntryType = static_cast<MessageEntryType>(t);
state() = MessageEntry_pad;
}
case MessageEntry_pad:
{
uint16_t v;
R(read_number(v));
state() = MessageEntry_servicepathstr;
}
case MessageEntry_servicepathstr:
{
R(read_string(data<MessageEntry>()->ServicePath, MessageEntry_membernamestr));
state() = MessageEntry_membernamestr;
}
case MessageEntry_membernamestr:
{
R(read_string(data<MessageEntry>()->MemberName, MessageEntry_requestid));
state() = MessageEntry_requestid;
}
case MessageEntry_requestid:
{
R(read_number(data<MessageEntry>()->RequestID));
state() = MessageEntry_error;
}
case MessageEntry_error:
{
MessageEntry* e = data<MessageEntry>();
uint16_t err;
R(read_number(err));
data<MessageEntry>()->Error = static_cast<MessageErrorType>(err);
state() = MessageEntry_metainfo;
}
case MessageEntry_metainfo:
{
R(read_string(data<MessageEntry>()->MetaData, MessageEntry_elementcount));
state() = MessageEntry_elementcount;
}
case MessageEntry_elementcount:
{
uint16_t c;
R(read_number(c));
param1() = c;
data<MessageEntry>()->elements.reserve(c);
state() = MessageEntry_readelements;
}
case MessageEntry_readelements:
{
MessageEntry* ee = data<MessageEntry>();
if (ee->elements.size() >= param1())
{
state() = MessageEntry_finishread;
continue;
}
state() = MessageElement_init;
}
case MessageElement_init:
{
RR_INTRUSIVE_PTR<MessageElement> el = CreateMessageElement();
MessageEntry* ee = data<MessageEntry>();
ee->elements.push_back(el);
push_state(MessageElement_elementsize, MessageEntry_readelements, limit() - message_pos, el);
}
case MessageElement_elementsize:
{
size_t p = message_pos;
uint32_t l;
R(read_number(l));
if (l < 4) throw ProtocolException("Message element too short");
data<MessageElement>()->ElementSize = l;
if (p + l > limit()) throw ProtocolException("Message element out of bounds");
limit() = p + l;
state() = MessageElement_elementnamestr;
}
case MessageElement_elementnamestr:
{
R(read_string(data<MessageElement>()->ElementName, MessageElement_elementtype));
state() = MessageElement_elementtype;
}
case MessageElement_elementtype:
{
uint16_t t;
R(read_number(t));
data<MessageElement>()->ElementType = static_cast<DataTypes>(t);
state() = MessageElement_elementtypestr;
}
case MessageElement_elementtypestr:
{
R(read_string(data<MessageElement>()->ElementTypeName, MessageElement_metainfo));
state() = MessageElement_metainfo;
}
case MessageElement_metainfo:
{
R(read_string(data<MessageElement>()->MetaData, MessageElement_datacount));
state() = MessageElement_datacount;
}
case MessageElement_datacount:
{
MessageElement* el = data<MessageElement>();
R(read_number(el->DataCount));
state() = MessageElement_readdata;
}
case MessageElement_readdata:
{
MessageElement* el = data<MessageElement>();
switch (el->ElementType)
{
case DataTypes_void_t:
{
DO_POP_STATE();
}
case DataTypes_double_t:
case DataTypes_single_t:
case DataTypes_int8_t:
case DataTypes_uint8_t:
case DataTypes_int16_t:
case DataTypes_uint16_t:
case DataTypes_int32_t:
case DataTypes_uint32_t:
case DataTypes_int64_t:
case DataTypes_uint64_t:
case DataTypes_string_t:
case DataTypes_cdouble_t:
case DataTypes_csingle_t:
case DataTypes_bool_t:
{
state() = MessageElement_readarray1;
continue;
}
case DataTypes_structure_t:
case DataTypes_vector_t:
case DataTypes_dictionary_t:
case DataTypes_multidimarray_t:
case DataTypes_list_t:
case DataTypes_pod_t:
case DataTypes_pod_array_t:
case DataTypes_pod_multidimarray_t:
case DataTypes_namedarray_array_t:
case DataTypes_namedarray_multidimarray_t:
{
state() = MessageElement_readnested1;
continue;
}
default:
throw DataTypeException("Invalid data type");
}
}
case MessageElement_finishreaddata:
{
if (distance_from_limit() != 0) throw ProtocolException("Element did not consume all data");
DO_POP_STATE();
}
case MessageElement_readarray1:
{
MessageElement* el = data<MessageElement>();
RR_INTRUSIVE_PTR<RRBaseArray> a = AllocateRRArrayByType(el->ElementType, el->DataCount);
size_t n = a->ElementSize() * a->size();
size_t p = read_some_bytes(a->void_ptr(), n);
size_t l = el->ElementSize;
el->SetData(a);
el->ElementSize = l;
if (p >= n)
{
state() = MessageElement_finishreaddata;
continue;
}
push_state(MessageElement_readarray2, MessageElement_finishreaddata, n - p, a, p, n);
boost::asio::mutable_buffer b(a->void_ptr(), n);
b = b + p;
next_continue_read_bufs.push_back(b);
state() = MessageElement_readarray2;
prepare_continue(other_bufs, other_bufs_used);
return ReadReturn_continue_buffers;
}
case MessageElement_readarray2:
{
if (buf_avail_pos != 0)
{
throw InvalidOperationException("Invalid stream position for async read");
}
size_t l = param2() - param1();
size_t n1 = boost::asio::buffer_size(other_bufs);
if (n1 != 0 && continue_read_len != 0)
{
throw InvalidOperationException("Cannot use other_bufs and continue_read_bufs at the same time");
}
if (continue_read_len == 0)
{
boost::asio::mutable_buffer b(data<RRBaseArray>()->void_ptr(), param2());
b = b + param1();
size_t n2 = boost::asio::buffer_copy(b, this->other_bufs);
buffers_consume(this->other_bufs, n2);
message_pos += n2;
if (n2 >= l)
{
//Done
DO_POP_STATE();
}
param1() += n2;
b = b + n2;
next_continue_read_bufs.push_back(b);
state() = MessageElement_readarray2;
prepare_continue(other_bufs, other_bufs_used);
return ReadReturn_continue_buffers;
}
else
{
param1() += continue_read_len;
message_pos += continue_read_len;
if (param1() > param2()) throw ProtocolException("Stream reading error");
if (param1() < param2())
{
boost::asio::mutable_buffer b(data<RRBaseArray>()->void_ptr(), param2());
b = b + param1();
next_continue_read_bufs.push_back(b);
state() = MessageElement_readarray2;
prepare_continue(other_bufs, other_bufs_used);
return ReadReturn_continue_buffers;
}
//Done
DO_POP_STATE();
}
}
//Read nested element list
case MessageElement_readnested1:
{
MessageElement* el = data<MessageElement>();
std::vector<RR_INTRUSIVE_PTR<MessageElement> > v;
v.reserve(el->DataCount);
RR_INTRUSIVE_PTR<MessageElementNestedElementList> s = CreateMessageElementNestedElementList(el->ElementType,el->ElementTypeName, RR_MOVE(v));
uint32_t l = el->ElementSize;
el->SetData(s);
el->ElementSize = l;
push_state(MessageElement_readnested2, MessageElement_finishreaddata, limit() - message_pos, s, el->DataCount);
}
case MessageElement_readnested2:
{
MessageElementNestedElementList* s = data<MessageElementNestedElementList>();
if (s->Elements.size() >= param1())
{
DO_POP_STATE();
}
state() = MessageElement_readnested3;
}
case MessageElement_readnested3:
{
RR_INTRUSIVE_PTR<MessageElement> el = CreateMessageElement();
MessageElementNestedElementList* s = data<MessageElementNestedElementList>();
s->Elements.push_back(el);
push_state(MessageElement_elementsize, MessageElement_readnested2, limit() - message_pos, el);
continue;
}
//Read header string
case Header_readstring:
{
size_t& p1 = param1();
MessageStringPtr* ptr_s = ptrdata<MessageStringPtr>();
std::string& s = param3();
//TODO: avoid swaps
size_t n = read_some_bytes(&(s).at(p1), s.size() - p1);
p1 += n;
size_t s_size = s.size();
if (p1 == s_size)
{
(*ptr_s) = MessageStringPtr(RR_MOVE(s));
DO_POP_STATE();
}
else
{
R(false);
}
}
default:
throw InvalidOperationException("Invalid read state");
}
}
}
AsyncMessageReaderImpl::return_type AsyncMessageReaderImpl::Read4(const const_buffers& other_bufs, size_t& other_bufs_used, size_t continue_read_len, mutable_buffers& next_continue_read_bufs)
{
this->other_bufs = other_bufs;
while (true)
{
switch (state())
{
case Message_init:
{
RR_INTRUSIVE_PTR<Message> m = CreateMessage();
state_stack[0].data = m;
state() = MessageHeader_init;
continue;
}
case Message_done:
prepare_continue(other_bufs, other_bufs_used);
if (distance_from_limit() != 0) throw ProtocolException("Message did not consume all data");
read_messages.push(RR_STATIC_POINTER_CAST<Message>(state_stack.back().data));
return ReadReturn_done;
case MessageHeader_init:
{
if (available() < 12)
{
throw ProtocolException("Initial message header not available");
}
std::string magic;
magic.resize(4);
read_all_bytes(&magic[0], 4);
if (magic != "RRAC")
{
throw ProtocolException("Invalid message magic");
}
RR_INTRUSIVE_PTR<MessageHeader> h = CreateMessageHeader();
read_number(h->MessageSize);
read_number(version);
message_len() = h->MessageSize;
data<Message>()->header = h;
push_state(MessageHeader_headersize, Message_readentries, h->MessageSize-10, h);
}
case MessageHeader_headersize:
{
size_t p = message_pos;
uint32_t l;
R(read_uint_x(l));
limit() = l;
data<MessageHeader>()->HeaderSize = l;
state() = MessageHeader_flags;
}
case MessageHeader_flags:
{
R(read_number(data<MessageHeader>()->MessageFlags));
state() = MessageHeader_routing1;
}
case MessageHeader_routing1:
{
MessageHeader* h = data<MessageHeader>();
if (!(h->MessageFlags & MessageFlags_ROUTING_INFO))
{
state() = MessageHeader_endpoint1;
continue;
}
boost::array<uint8_t, 16> nodeid;
R(read_all_bytes(&nodeid[0], 16));
h->SenderNodeID = NodeID(nodeid);
state() = MessageHeader_routing2;
}
case MessageHeader_routing2:
{
boost::array<uint8_t, 16> nodeid;
R(read_all_bytes(&nodeid[0], 16));
data<MessageHeader>()->ReceiverNodeID = NodeID(nodeid);
state() = MessageHeader_routing3;
}
case MessageHeader_routing3:
{
R(read_string4(data<MessageHeader>()->SenderNodeName));
state() = MessageHeader_routing4;
}
case MessageHeader_routing4:
{
R(read_string4(data<MessageHeader>()->ReceiverNodeName));
state() = MessageHeader_endpoint1;
}
case MessageHeader_endpoint1:
{
MessageHeader* h = data<MessageHeader>();
if (!(h->MessageFlags & MessageFlags_ENDPOINT_INFO))
{
state() = MessageHeader_priority;
continue;
}
R(read_uint_x(h->SenderEndpoint));
state() = MessageHeader_endpoint2;
}
case MessageHeader_endpoint2:
{
R(read_uint_x(data<MessageHeader>()->ReceiverEndpoint));
state() = MessageHeader_priority;
}
case MessageHeader_priority:
{
MessageHeader* h = data<MessageHeader>();
if (!(h->MessageFlags & MessageFlags_PRIORITY))
{
state() = MessageHeader_metainfo;
continue;
}
R(read_number(h->Priority));
state() = MessageHeader_metainfo;
}
case MessageHeader_metainfo:
{
MessageHeader* h = data<MessageHeader>();
if (!(h->MessageFlags & MessageFlags_META_INFO))
{
state() = MessageHeader_stringtable1;
continue;
}
R(read_string4(h->MetaData));
state() = MessageHeader_messageid1;
}
case MessageHeader_messageid1:
{
MessageHeader* h = data<MessageHeader>();
R(read_number(h->MessageID));
state() = MessageHeader_messageid2;
}
case MessageHeader_messageid2:
{
R(read_number(data<MessageHeader>()->MessageResID));
state() = MessageHeader_stringtable1;
}
case MessageHeader_stringtable1:
{
MessageHeader* h = data<MessageHeader>();
if (!(h->MessageFlags & MessageFlags_STRING_TABLE))
{
state() = MessageHeader_entrycount;
continue;
}
uint32_t n;
R(read_uint_x(n));
param1() = n;
state() = MessageHeader_stringtable2;
}
case MessageHeader_stringtable2:
{
if (param1() == 0)
{
state() = MessageHeader_entrycount;
continue;
}
uint32_t code;
R(read_uint_x(code));
data<MessageHeader>()->StringTable.push_back(boost::make_tuple(code, ""));
param1()--;
state() = MessageHeader_stringtable3;
}
case MessageHeader_stringtable3:
{
MessageHeader* h = data<MessageHeader>();
R(read_string4(data<MessageHeader>()->StringTable.back().get<1>(), MessageHeader_stringtable2));
state() = MessageHeader_stringtable2;
continue;
}
case MessageHeader_entrycount:
{
MessageHeader* h = data<MessageHeader>();
if (!(h->MessageFlags & MessageFlags_MULTIPLE_ENTRIES))
{
h->EntryCount = 1;
}
else
{
uint32_t c;
R(read_uint_x(c));
if (c > std::numeric_limits<uint16_t>::max()) throw ProtocolException("Too many entries in message");
h->EntryCount = boost::numeric_cast<uint16_t>(c);
}
state() = MessageHeader_extended1;
}
case MessageHeader_extended1:
{
MessageHeader* h = data<MessageHeader>();
if (!(h->MessageFlags & MessageFlags_EXTENDED))
{
pop_state();
state() = Message_readentries;
continue;
}
uint32_t n;
R(read_uint_x(n));
h->Extended.resize(n);
state() = MessageHeader_extended2;
}
case MessageHeader_extended2:
{
MessageHeader* h = data<MessageHeader>();
if (!h->Extended.empty())
{
R(read_all_bytes(&h->Extended[0], h->Extended.size()));
}
pop_state();
state() = Message_readentries;
}
case Message_readentries:
{
Message* m = data<Message>();
m->entries.reserve(m->header->EntryCount);
if (m->entries.size() >= m->header->EntryCount)
{
state() = Message_done;
continue;
}
state() = MessageEntry_init;
}
case MessageEntry_init:
{
RR_INTRUSIVE_PTR<MessageEntry> ee = CreateMessageEntry();
data<Message>()->entries.push_back(ee);
push_state(MessageEntry_entrysize, Message_readentries, limit() - message_pos, ee);
continue;
}
case MessageEntry_finishread:
{
if (distance_from_limit() != 0) throw ProtocolException("MessageEntry did not consume all data");
DO_POP_STATE();
}
case MessageEntry_entrysize:
{
uint32_t p = message_pos;
MessageEntry* ee = data<MessageEntry>();
R(read_uint_x(ee->EntrySize));
if (ee->EntrySize < 4) throw ProtocolException("Message entry too short");
if (p + ee->EntrySize > message_len()) throw ProtocolException("Message entry out of bounds");
limit() = p + ee->EntrySize;
state() = MessageEntry_entryflags;
}
case MessageEntry_entryflags:
{
R(read_number(data<MessageEntry>()->EntryFlags));
state() = MessageEntry_entrytype;
}
case MessageEntry_entrytype:
{
uint16_t t;
R(read_number(t));
data<MessageEntry>()->EntryType = static_cast<MessageEntryType>(t);
state() = MessageEntry_servicepathstr;
}
case MessageEntry_servicepathstr:
{
MessageEntry* ee = data<MessageEntry>();
if (ee->EntryFlags & MessageEntryFlags_SERVICE_PATH_STR)
{
R(read_string4(ee->ServicePath));
}
state() = MessageEntry_servicepathcode;
}
case MessageEntry_servicepathcode:
{
MessageEntry* ee = data<MessageEntry>();
if (ee->EntryFlags & MessageEntryFlags_SERVICE_PATH_CODE)
{
R(read_uint_x(ee->ServicePathCode));
}
state() = MessageEntry_membernamestr;
}
case MessageEntry_membernamestr:
{
MessageEntry* ee = data<MessageEntry>();
if (ee->EntryFlags & MessageEntryFlags_MEMBER_NAME_STR)
{
R(read_string4(ee->MemberName));
}
state() = MessageEntry_membernamecode;
}
case MessageEntry_membernamecode:
{
MessageEntry* ee = data<MessageEntry>();
if (ee->EntryFlags & MessageEntryFlags_MEMBER_NAME_CODE)
{
R(read_uint_x(ee->MemberNameCode));
}
state() = MessageEntry_requestid;
}
case MessageEntry_requestid:
{
MessageEntry* ee = data<MessageEntry>();
if (ee->EntryFlags & MessageEntryFlags_REQUEST_ID)
{
R(read_uint_x(ee->RequestID));
}
state() = MessageEntry_error;
}
case MessageEntry_error:
{
MessageEntry* ee = data<MessageEntry>();
if (ee->EntryFlags & MessageEntryFlags_ERROR)
{
uint16_t err;
R(read_number(err));
ee->Error = static_cast<MessageErrorType>(err);
}
state() = MessageEntry_metainfo;
}
case MessageEntry_metainfo:
{
MessageEntry* ee = data<MessageEntry>();
if (ee->EntryFlags & MessageEntryFlags_META_INFO)
{
R(read_string4(ee->MetaData));
}
state() = MessageEntry_extended1;
}
case MessageEntry_extended1:
{
MessageEntry* ee = data<MessageEntry>();
if (!(ee->EntryFlags & MessageEntryFlags_EXTENDED))
{
state() = MessageEntry_elementcount;
continue;
}
uint32_t n;
R(read_uint_x(n));
ee->Extended.resize(n);
state() = MessageEntry_extended2;
}
case MessageEntry_extended2:
{
MessageEntry* ee = data<MessageEntry>();
if (!ee->Extended.empty())
{
R(read_all_bytes(&ee->Extended[0], ee->Extended.size()));
}
state() = MessageEntry_elementcount;
}
case MessageEntry_elementcount:
{
MessageEntry* ee = data<MessageEntry>();
uint32_t c;
R(read_uint_x(c));
param1() = c;
ee->elements.reserve(c);
state() = MessageEntry_readelements;
}
case MessageEntry_readelements:
{
MessageEntry* ee = data<MessageEntry>();
if (ee->elements.size() >= param1())
{
state() = MessageEntry_finishread;
continue;
}
state() = MessageElement_init;
}
case MessageElement_init:
{
RR_INTRUSIVE_PTR<MessageElement> el = CreateMessageElement();
MessageEntry* ee = data<MessageEntry>();
ee->elements.push_back(el);
push_state(MessageElement_elementsize, MessageEntry_readelements, limit() - message_pos, el);
}
case MessageElement_elementsize:
{
size_t p = message_pos;
uint32_t l;
R(read_uint_x(l));
if (l < 4) throw ProtocolException("Message element too short");
data<MessageElement>()->ElementSize = l;
if (p + l > limit()) throw ProtocolException("Message element out of bounds");
limit() = p + l;
state() = MessageElement_elementflags;
}
case MessageElement_elementflags:
{
R(read_number(data<MessageElement>()->ElementFlags));
state() = MessageElement_elementnamestr;
}
case MessageElement_elementnamestr:
{
MessageElement* el = data<MessageElement>();
if (el->ElementFlags & MessageElementFlags_ELEMENT_NAME_STR)
{
R(read_string4(el->ElementName));
}
state() = MessageElement_elementnamecode;
}
case MessageElement_elementnamecode:
{
MessageElement* el = data<MessageElement>();
if (el->ElementFlags & MessageElementFlags_ELEMENT_NAME_CODE)
{
R(read_uint_x(el->ElementNameCode));
}
state() = MessageElement_elementnumber;
}
case MessageElement_elementnumber:
{
MessageElement* el = data<MessageElement>();
if (el->ElementFlags & MessageElementFlags_ELEMENT_NUMBER)
{
R(read_int_x(el->ElementNumber));
}
state() = MessageElement_elementtype;
}
case MessageElement_elementtype:
{
uint16_t t;
R(read_number(t));
data<MessageElement>()->ElementType = static_cast<DataTypes>(t);
state() = MessageElement_elementtypestr;
}
case MessageElement_elementtypestr:
{
MessageElement* el = data<MessageElement>();
if (el->ElementFlags & MessageElementFlags_ELEMENT_TYPE_NAME_STR)
{
R(read_string4(el->ElementTypeName));
}
state() = MessageElement_elementtypecode;
}
case MessageElement_elementtypecode:
{
MessageElement* el = data<MessageElement>();
if (el->ElementFlags & MessageElementFlags_ELEMENT_TYPE_NAME_CODE)
{
R(read_uint_x(el->ElementTypeNameCode));
}
state() = MessageElement_metainfo;
}
case MessageElement_metainfo:
{
MessageElement* el = data<MessageElement>();
if (el->ElementFlags & MessageElementFlags_META_INFO)
{
R(read_string4(el->MetaData));
}
state() = MessageElement_extended1;
}
case MessageElement_extended1:
{
MessageElement* ee = data<MessageElement>();
if (!(ee->ElementFlags & MessageElementFlags_EXTENDED))
{
state() = MessageElement_datacount;
continue;
}
uint32_t n;
R(read_uint_x(n));
ee->Extended.resize(n);
state() = MessageElement_extended2;
}
case MessageElement_extended2:
{
MessageElement* ee = data<MessageElement>();
if (!ee->Extended.empty())
{
R(read_all_bytes(&ee->Extended[0], ee->Extended.size()));
}
state() = MessageElement_datacount;
}
case MessageElement_datacount:
{
MessageElement* el = data<MessageElement>();
R(read_uint_x(el->DataCount));
state() = MessageElement_readdata;
}
case MessageElement_readdata:
{
MessageElement* el = data<MessageElement>();
switch (el->ElementType)
{
case DataTypes_void_t:
{
DO_POP_STATE();
}
case DataTypes_double_t:
case DataTypes_single_t:
case DataTypes_int8_t:
case DataTypes_uint8_t:
case DataTypes_int16_t:
case DataTypes_uint16_t:
case DataTypes_int32_t:
case DataTypes_uint32_t:
case DataTypes_int64_t:
case DataTypes_uint64_t:
case DataTypes_string_t:
case DataTypes_cdouble_t:
case DataTypes_csingle_t:
case DataTypes_bool_t:
{
state() = MessageElement_readarray1;
continue;
}
case DataTypes_structure_t:
case DataTypes_vector_t:
case DataTypes_dictionary_t:
case DataTypes_multidimarray_t:
case DataTypes_list_t:
case DataTypes_pod_t:
case DataTypes_pod_array_t:
case DataTypes_pod_multidimarray_t:
case DataTypes_namedarray_array_t:
case DataTypes_namedarray_multidimarray_t:
{
state() = MessageElement_readnested1;
continue;
}
default:
throw DataTypeException("Invalid data type");
}
}
case MessageElement_finishreaddata:
{
MessageElement* el = data<MessageElement>();
if (distance_from_limit() != 0) throw ProtocolException("Element did not consume all data");
DO_POP_STATE();
}
case MessageElement_readarray1:
{
MessageElement* el = data<MessageElement>();
RR_INTRUSIVE_PTR<RRBaseArray> a = AllocateRRArrayByType(el->ElementType, el->DataCount);
size_t n = a->ElementSize() * a->size();
size_t p = read_some_bytes(a->void_ptr(), n);
size_t l = el->ElementSize;
el->SetData(a);
el->ElementSize = l;
if (p >= n)
{
state() = MessageElement_finishreaddata;
continue;
}
push_state(MessageElement_readarray2, MessageElement_finishreaddata, n-p, a, p, n);
boost::asio::mutable_buffer b(a->void_ptr(), n);
b = b + p;
next_continue_read_bufs.push_back(b);
state() = MessageElement_readarray2;
prepare_continue(other_bufs, other_bufs_used);
return ReadReturn_continue_buffers;
}
case MessageElement_readarray2:
{
if (buf_avail_pos != 0)
{
throw InvalidOperationException("Invalid stream position for async read");
}
size_t l = param2() - param1();
size_t n1 = boost::asio::buffer_size(other_bufs);
if (n1 !=0 && continue_read_len != 0)
{
throw InvalidOperationException("Cannot use other_bufs and continue_read_bufs at the same time");
}
if (continue_read_len==0)
{
boost::asio::mutable_buffer b(data<RRBaseArray>()->void_ptr(), param2());
b = b + param1();
size_t n2 = boost::asio::buffer_copy(b, this->other_bufs);
buffers_consume(this->other_bufs, n2);
message_pos += n2;
if (n2 >= l)
{
//Done
DO_POP_STATE();
}
param1() += n2;
b = b + n2;
next_continue_read_bufs.push_back(b);
state() = MessageElement_readarray2;
prepare_continue(other_bufs, other_bufs_used);
return ReadReturn_continue_buffers;
}
else
{
param1() += continue_read_len;
message_pos += continue_read_len;
if (param1() > param2()) throw ProtocolException("Stream reading error");
if (param1() < param2())
{
boost::asio::mutable_buffer b(data<RRBaseArray>()->void_ptr(), param2());
b = b + param1();
next_continue_read_bufs.push_back(b);
state() = MessageElement_readarray2;
prepare_continue(other_bufs, other_bufs_used);
return ReadReturn_continue_buffers;
}
//Done
DO_POP_STATE();
}
}
//Read nested elements
case MessageElement_readnested1:
{
MessageElement* el = data<MessageElement>();
std::vector<RR_INTRUSIVE_PTR<MessageElement> > v;
v.reserve(el->DataCount);
RR_INTRUSIVE_PTR<MessageElementNestedElementList> s = CreateMessageElementNestedElementList(el->ElementType, el->ElementTypeName, RR_MOVE(v));
uint32_t l = el->ElementSize;
el->SetData(s);
el->ElementSize = l;
push_state(MessageElement_readnested2, MessageElement_finishreaddata, limit() - message_pos, s, el->DataCount);
}
case MessageElement_readnested2:
{
MessageElementNestedElementList* s = data<MessageElementNestedElementList>();
if (s->Elements.size() >= param1())
{
DO_POP_STATE();
}
state() = MessageElement_readnested3;
}
case MessageElement_readnested3:
{
RR_INTRUSIVE_PTR<MessageElement> el = CreateMessageElement();
MessageElementNestedElementList* s = data<MessageElementNestedElementList>();
s->Elements.push_back(el);
push_state(MessageElement_elementsize, MessageElement_readnested2, limit() - message_pos, el);
continue;
}
//Read header string
case Header_readstring:
{
size_t& p1 = param1();
MessageStringPtr* ptr_s = ptrdata<MessageStringPtr>();
//TODO: avoid swaps;
std::string& s = param3();
size_t n = read_some_bytes(&(s).at(p1), s.size() - p1);
p1 += n;
size_t s_size = s.size();
if (p1 == s_size)
{
(*ptr_s) = MessageStringPtr(RR_MOVE(s));
DO_POP_STATE();
}
else
{
R(false);
}
}
default:
throw InvalidOperationException("Invalid read state");
}
}
}
bool AsyncMessageReaderImpl::MessageReady()
{
return !read_messages.empty();
}
RR_INTRUSIVE_PTR<Message> AsyncMessageReaderImpl::GetNextMessage()
{
if (read_messages.empty()) throw InvalidOperationException("Message not ready");
RR_INTRUSIVE_PTR<Message> m=read_messages.front();
read_messages.pop();
return m;
}
} | 26.35197 | 221 | 0.664039 | robotraconteur |
127d2bcc4b3d10a6e1081fbe48060281f0df3783 | 763 | cc | C++ | pcraster/pcraster-4.2.0/pcraster-4.2.0/source/fern/source/fern/language/ast/core/function_call_vertex.cc | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | pcraster/pcraster-4.2.0/pcraster-4.2.0/source/fern/source/fern/language/ast/core/function_call_vertex.cc | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | pcraster/pcraster-4.2.0/pcraster-4.2.0/source/fern/source/fern/language/ast/core/function_call_vertex.cc | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | // -----------------------------------------------------------------------------
// Fern © Geoneric
//
// This file is part of Geoneric Fern which is available under the terms of
// the GNU General Public License (GPL), version 2. If you do not want to
// be bound by the terms of the GPL, you may purchase a proprietary license
// from Geoneric (http://www.geoneric.eu/contact).
// -----------------------------------------------------------------------------
#include "fern/language/ast/core/function_call_vertex.h"
namespace fern {
namespace language {
FunctionCallVertex::FunctionCallVertex(
std::string const& name,
ExpressionVertices const& expressions)
: OperationVertex(name, expressions)
{
}
} // namespace language
} // namespace fern
| 29.346154 | 80 | 0.580603 | quanpands |
1284ff218a516158d42f7075be8cfcf007072873 | 890 | cpp | C++ | src/cpu-kernels/awkward_IndexedArray_unique_next_index_and_offsets_64.cpp | BioGeek/awkward-1.0 | 0cfb4e43c41d5c7d9830cc7b1d750485c0a93eb2 | [
"BSD-3-Clause"
] | 2 | 2019-09-12T03:07:23.000Z | 2019-09-27T05:32:07.000Z | src/cpu-kernels/awkward_IndexedArray_unique_next_index_and_offsets_64.cpp | BioGeek/awkward-1.0 | 0cfb4e43c41d5c7d9830cc7b1d750485c0a93eb2 | [
"BSD-3-Clause"
] | 1 | 2019-09-26T17:57:45.000Z | 2019-09-26T17:57:45.000Z | src/cpu-kernels/awkward_IndexedArray_unique_next_index_and_offsets_64.cpp | BioGeek/awkward-1.0 | 0cfb4e43c41d5c7d9830cc7b1d750485c0a93eb2 | [
"BSD-3-Clause"
] | null | null | null | // BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
#define FILENAME(line) FILENAME_FOR_EXCEPTIONS_C("src/cpu-kernels/awkward_IndexedArray_unique_next_index_and_offsets_64.cpp", line)
#include "awkward/kernels.h"
ERROR awkward_IndexedArray_unique_next_index_and_offsets_64(
int64_t* toindex,
int64_t* tooffsets,
const int64_t* fromoffsets,
const int64_t* fromnulls,
int64_t startslength) {
int64_t k = 0;
int64_t ll = 0;
int64_t shift = 0;
toindex[0] = ll;
tooffsets[0] = fromoffsets[0];
for (int64_t i = 0; i < startslength; i++) {
for (int64_t j = fromoffsets[i]; j < fromoffsets[i + 1]; j++) {
toindex[k] = ll;
k += 1;
ll += 1;
}
if (fromnulls[k] == 1) {
toindex[k] = -1;
k += 1;
shift += 1;
}
tooffsets[i + 1] = fromoffsets[i + 1] + shift;
}
return success();
}
| 26.969697 | 131 | 0.641573 | BioGeek |
128addfca10e75818526a5d246348437ef027395 | 2,473 | cc | C++ | sandbox/limit.cc | Codu-LLC/sandbox | f78cb0fb8705904ffcda370f3395ca134d5fd87e | [
"MIT"
] | 1 | 2021-02-11T11:10:06.000Z | 2021-02-11T11:10:06.000Z | sandbox/limit.cc | Codu-LLC/sandbox | f78cb0fb8705904ffcda370f3395ca134d5fd87e | [
"MIT"
] | 1 | 2021-02-26T08:20:08.000Z | 2021-02-26T08:44:54.000Z | sandbox/limit.cc | Codu-LLC/sandbox | f78cb0fb8705904ffcda370f3395ca134d5fd87e | [
"MIT"
] | null | null | null | //
// Created by Eugene Junghyun Kim on 1/13/2021.
//
#include "cgroup.h"
#include "limit.h"
#include "sandbox.h"
#include <cmath>
#include <memory>
#include <signal.h>
#include <sys/resource.h>
#include <string>
#include <unistd.h>
#define MB_TO_BYTES(x) ((x) << 20)
#define MILLISECONDS_TO_SECONDS(x) ((x)/1000.)
std::unique_ptr <Cgroup> setup_cgroup(Sandbox *ptr, const std::string &cgroup_name, bool create) {
auto cgroup = std::make_unique<Cgroup>(cgroup_name);
cgroup->add_controller("cpu");
cgroup->add_controller("cpuacct");
cgroup->add_controller("memory");
if (create && !cgroup->setup_cgroup()) {
return nullptr;
}
if (!cgroup->set_property("memory", "limit_in_bytes",
std::to_string(MB_TO_BYTES((int)(ptr->get_memory_limit_in_mb() * 1.1))))) {
return nullptr;
}
if (!cgroup->set_property("cpu", "shares", "512")) {
return nullptr;
}
if (!cgroup->set_property("cpuacct", "usage", "0")) {
return nullptr;
}
return cgroup;
}
static void set_resource_limit(int resource, rlim_t limit) {
struct rlimit rl = {limit, limit};
if (setrlimit(resource, &rl) == -1) {
exit(EXIT_FAILURE);
}
}
void set_sandbox_limit(Sandbox *ptr) {
// Set Maximum file size to FILE_SIZE_LIMIT_IN_MB.
set_resource_limit(RLIMIT_FSIZE, MB_TO_BYTES(ptr->get_file_size_limit_in_mb()));
// TODO(conankun): Change return type to int and return -1 in this case.
// Limit creating core dump files.
set_resource_limit(RLIMIT_CORE, 0);
// Limit sending and receiving message through message queue.
set_resource_limit(RLIMIT_MSGQUEUE, 0);
// Set the limit on the number of open file descriptors.
set_resource_limit(RLIMIT_NOFILE, 100);
// Limit creating another thread or process.
set_resource_limit(RLIMIT_NPROC, 256);
// Limit in Wall time. If process is sleeping, they are not consuming cpu time and thus can block grading system
// from processing future requests. Therefore, there should be an enforcement on wall time
alarm(static_cast<int>(ceil(MILLISECONDS_TO_SECONDS(ptr->get_time_limit_in_ms()))) << 1);
set_resource_limit(
RLIMIT_CPU,
static_cast<int>(ceil(MILLISECONDS_TO_SECONDS(ptr->get_time_limit_in_ms() << 1))));
// Prevent the process from making system calls other than read, write, sigreturn, and exit.
// prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT);
}
| 36.910448 | 116 | 0.680954 | Codu-LLC |
128bf43d9515c6a045c4f7110e5fdf0419481bf8 | 7,571 | hpp | C++ | src/scanner.hpp | ShameekConyers/sicinterpreter | 24d0451436f0af67d24aae987155c3b090aa2fed | [
"MIT"
] | null | null | null | src/scanner.hpp | ShameekConyers/sicinterpreter | 24d0451436f0af67d24aae987155c3b090aa2fed | [
"MIT"
] | null | null | null | src/scanner.hpp | ShameekConyers/sicinterpreter | 24d0451436f0af67d24aae987155c3b090aa2fed | [
"MIT"
] | null | null | null | #pragma once
#include <string>
namespace TokenType
{
enum Any {
// single-char tokens 0
TOKEN_LEFT_PAREN,
TOKEN_RIGHT_PAREN,
TOKEN_LEFT_BRACE,
TOKEN_RIGHT_BRACE,
TOKEN_COMMA,
TOKEN_DOT,
TOKEN_SEMICOLON,
TOKEN_MINUS,
TOKEN_PLUS,
TOKEN_SLASH,
TOKEN_STAR,
// one or two character tokens 11
TOKEN_BANG,
TOKEN_BANG_EQUAL,
TOKEN_EQUAL,
TOKEN_EQUAL_EQUAL,
TOKEN_GREATER,
TOKEN_GREATER_EQUAL,
TOKEN_LESS,
TOKEN_LESS_EQUAL,
// Literals 19
TOKEN_IDENTIFIER,
TOKEN_STRING,
TOKEN_NUMBER,
// Keywords 22
TOKEN_AND, TOKEN_CLASS, TOKEN_ELSE, TOKEN_FALSE,
TOKEN_FOR, TOKEN_FN, TOKEN_IF, TOKEN_NIL, TOKEN_OR,
TOKEN_PRINT, TOKEN_RETURN, TOKEN_SUPER, TOKEN_THIS,
TOKEN_TRUE, TOKEN_LET, TOKEN_WHILE,
// Misc 38
TOKEN_ERROR, TOKEN_EOF
};
}
struct Token {
TokenType::Any m_type;
const char* m_start;
uint32_t m_length;
uint32_t m_line;
};
char* make_token_error_msg(const std::string& message)
{
// HERE
char* error_message = new char[message.size() + 1];
for (uint32_t i = 0; i < message.size(); i++) {
error_message[i] = message[i];
}
error_message[message.size()] = '\0';
return error_message;
}
void process_token_error_msg(Token& token)
{
delete [] token.m_start;
token.m_start = nullptr;
}
struct Scanner {
// m_start_lexeme_char
const char* m_start;
// m_current_lexeme_char (end of scanned token)
const char* m_current;
uint32_t m_line;
Scanner(const std::string& source)
{
m_start = source.data();
m_current = source.data();
m_line = 0;
}
Token scan_token()
{
// std::cerr << "enter scan token\n";
skip_whitespace();
m_start = m_current;
if (is_at_end()) {
return make_token(TokenType::TOKEN_EOF);
}
char c = advance();
if (is_alpha(c)) return make_identifier_token();
if (is_digit(c)) return make_number_token();
switch (c) {
case '(': return make_token(TokenType::TOKEN_LEFT_PAREN);
case ')': return make_token(TokenType::TOKEN_RIGHT_PAREN);
case '{': return make_token(TokenType::TOKEN_LEFT_BRACE);
case '}': return make_token(TokenType::TOKEN_RIGHT_BRACE);
case ';': return make_token(TokenType::TOKEN_SEMICOLON);
case ',': return make_token(TokenType::TOKEN_COMMA);
case '.': return make_token(TokenType::TOKEN_DOT);
case '-': return make_token(TokenType::TOKEN_MINUS);
case '+': return make_token(TokenType::TOKEN_PLUS);
case '/': return make_token(TokenType::TOKEN_SLASH);
case '*': return make_token(TokenType::TOKEN_STAR);
case '!':
return make_token(
match('=') ? TokenType::TOKEN_BANG_EQUAL
: TokenType::TOKEN_BANG);
case '=':
return make_token(
match('=') ? TokenType::TOKEN_EQUAL_EQUAL
: TokenType::TOKEN_EQUAL);
case '<':
return make_token(
match('=') ? TokenType::TOKEN_LESS_EQUAL
: TokenType::TOKEN_LESS);
case '>':
return make_token(
match('=') ? TokenType::TOKEN_GREATER_EQUAL
: TokenType::TOKEN_GREATER);
case '"':
return make_string_token();
}
return make_error_token("unexpected character.");
}
bool is_alpha(char c)
{
return ('a' <= c && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
c == '_';
}
bool is_digit(char c)
{
return '0' <= c && c <= '9';
}
// conditionally consumes the next character
bool match(char input)
{
if (is_at_end()
|| *m_current != input) {
return false;
}
m_current++;
return true;
}
char advance()
{
m_current++;
return m_current[-1];
}
char peek()
{
return m_current[0];
}
char peek_next()
{
if (is_at_end()) return '\0';
return m_current[1];
}
void skip_whitespace()
{
while (true) {
char c = peek();
switch (c) {
case '\n':
m_line++;
case ' ':
case '\r':
case '\t':
advance();
break;
case '/':
if (peek_next() == '/') {
while (peek() != '\n' && !is_at_end()) advance();
}
else {
return; // not whitespace
}
break;
default:
return;
}
}
}
bool is_at_end()
{
return *m_current == '\0'; // HERE
}
Token make_token(TokenType::Any type)
{
Token token;
token.m_type = type;
token.m_start = m_start;
token.m_length = (uint32_t)(m_current - m_start);
token.m_line = m_line;
return token;
}
Token make_error_token(const std::string& message)
{
Token token;
token.m_type = TokenType::TOKEN_ERROR;
token.m_start = make_token_error_msg(message);
token.m_length = (uint32_t)message.size();
token.m_line = m_line;
return token;
}
Token make_string_token()
{
while (peek() != '"' && !is_at_end()) {
if (peek() == '\n') {
m_line++;
}
advance();
}
if (is_at_end()) {
return make_error_token("Unterminated String.");
}
advance();
return make_token(TokenType::TOKEN_STRING);
}
Token make_number_token()
{
while (is_digit(peek())) {
advance();
}
if (peek() == '.' && is_digit(peek_next())) {
advance();
while (is_digit(peek())) {
advance();
}
}
return make_token(TokenType::TOKEN_NUMBER);
}
Token make_identifier_token()
{
while (is_alpha(peek()) || is_digit(peek())) {
advance();
}
return make_token(find_identifier_type());
}
// Trie
TokenType::Any find_identifier_type()
{
switch (m_start[0]) {
case 'a': return check_keyword("and", TokenType::TOKEN_AND);
case 'c': return check_keyword("class", TokenType::TOKEN_CLASS);
case 'e': return check_keyword("else", TokenType::TOKEN_ELSE);
case 'i': return check_keyword("if", TokenType::TOKEN_IF);
case 'n': return check_keyword("nil", TokenType::TOKEN_NIL);
case 'o': return check_keyword("or", TokenType::TOKEN_OR);
case 'p': return check_keyword("print", TokenType::TOKEN_PRINT);
case 'r': return check_keyword("return", TokenType::TOKEN_RETURN);
case 's': return check_keyword("super", TokenType::TOKEN_SUPER);
case 'l': return check_keyword("let", TokenType::TOKEN_LET);
case 'w': return check_keyword("while", TokenType::TOKEN_WHILE);
case 'f':
if (m_current - m_start == 1) {
break;
}
switch (m_start[1]) {
case 'n': return TokenType::TOKEN_FN;
case 'o': return check_keyword("for", TokenType::TOKEN_FOR);
case 'a': return check_keyword("false", TokenType::TOKEN_FALSE);
}
case 't':
if (m_current - m_start == 1) {
break;
}
switch (m_start[1]) {
case 'r': return check_keyword("true", TokenType::TOKEN_TRUE);
case 'h': return check_keyword("this", TokenType::TOKEN_THIS);
}
default:
break;
}
return TokenType::TOKEN_IDENTIFIER;
}
TokenType::Any check_keyword(
const std::string& target_keyword,
TokenType::Any token_to_check)
{
const char* cursor = m_start;
size_t keyword_size = target_keyword.size();
if (m_current - m_start != keyword_size) {
return TokenType::TOKEN_IDENTIFIER;
}
for (uint32_t i = 0; i < keyword_size; i++) {
if (target_keyword[i] != cursor[i]) {
return TokenType::TOKEN_IDENTIFIER;
}
}
return token_to_check;
}
};
| 22.399408 | 74 | 0.596355 | ShameekConyers |
128c7a1b3c91a06fb3d2f74eca060f9190a0189d | 1,734 | hpp | C++ | src/mex/late_reverb_filter_calculator/signal_flow.hpp | s3a-spatialaudio/VISR | 55f6289bc5058d4898106f3520e1a60644ffb3ab | [
"ISC"
] | 17 | 2019-03-12T14:52:22.000Z | 2021-11-09T01:16:23.000Z | src/mex/late_reverb_filter_calculator/signal_flow.hpp | s3a-spatialaudio/VISR | 55f6289bc5058d4898106f3520e1a60644ffb3ab | [
"ISC"
] | null | null | null | src/mex/late_reverb_filter_calculator/signal_flow.hpp | s3a-spatialaudio/VISR | 55f6289bc5058d4898106f3520e1a60644ffb3ab | [
"ISC"
] | 2 | 2019-08-11T12:53:07.000Z | 2021-06-22T10:08:08.000Z | /* Copyright Institute of Sound and Vibration Research - All rights reserved */
#ifndef VISR_MEX_LATE_REVERB_FILTER_CALCULATOR_SIGNAL_FLOW_HPP_INCLUDED
#define VISR_MEX_LATE_REVERB_FILTER_CALCULATOR_SIGNAL_FLOW_HPP_INCLUDED
#include <librrl/audio_signal_flow.hpp>
#include <libpml/message_queue.hpp>
#include <librcl/scene_decoder.hpp>
#include <librcl/late_reverb_filter_calculator.hpp>
#include <libefl/basic_matrix.hpp>
#include <libobjectmodel/object_vector.hpp>
namespace visr
{
namespace mex
{
namespace late_reverb_filter_calculator
{
class SignalFlow: public rrl::AudioSignalFlow
{
public:
using LateFilterMessageQueue = pml::MessageQueue< std::pair<std::size_t, std::vector<ril::SampleType> > >;
using SubBandMessageQueue = pml::MessageQueue< std::pair<std::size_t, objectmodel::PointSourceWithReverb::LateReverb> >;
explicit SignalFlow( ril::SampleType lateReflectionLengthSeconds,
std::size_t numLateReflectionSubBandLevels,
std::size_t period,
ril::SamplingFrequencyType samplingFrequency );
~SignalFlow();
/**
* We do not use this one, but it is required because it is pure virtual in the base class.
*/
/*virtual*/ void process() {};
void process( std::string const & objectVector,
LateFilterMessageQueue & outputQueue );
private:
objectmodel::ObjectVector mObjectVector;
rcl::SceneDecoder mDecoder;
rcl::LateReverbFilterCalculator mCalc;
pml::MessageQueue<std::string> mMessages;
SubBandMessageQueue mLateObjects;
};
} // namespace late_reverb_filter_calculator
} // namespace mex
} // namespace visr
#endif // #ifndef VISR_MEX_LATE_REVERB_FILTER_CALCULATOR_SIGNAL_FLOW_HPP_INCLUDED
| 27.09375 | 122 | 0.753172 | s3a-spatialaudio |
128d7942607906359685849bba14e652bda730a4 | 585 | cpp | C++ | base/CountDownLatch.cpp | tryturned/webserver | f9a1342b08c1e2fe36249ce881a771b72bc9b423 | [
"MulanPSL-1.0"
] | null | null | null | base/CountDownLatch.cpp | tryturned/webserver | f9a1342b08c1e2fe36249ce881a771b72bc9b423 | [
"MulanPSL-1.0"
] | null | null | null | base/CountDownLatch.cpp | tryturned/webserver | f9a1342b08c1e2fe36249ce881a771b72bc9b423 | [
"MulanPSL-1.0"
] | null | null | null | /*
* @Autor: taobo
* @Date: 2020-05-27 19:04:46
* @LastEditTime: 2020-12-22 12:41:50
* @Description: file content
*/
#include "CountDownLatch.h"
#include <condition_variable>
#include <mutex>
using namespace std;
CountDownLatch::CountDownLatch(int cnt) : cnt_(cnt) {}
void CountDownLatch::wait() {
unique_lock<mutex> lck(this->mtx_);
condition_.wait(lck, [&] { return !blocked(); });
}
bool CountDownLatch::blocked() { return cnt_ > 0; }
void CountDownLatch::countDown() {
unique_lock<mutex> lck(this->mtx_);
--cnt_;
if (cnt_ == 0) this->condition_.notify_all();
} | 21.666667 | 54 | 0.678632 | tryturned |
128fd91523797e94958160e046f2aefab3edbfb2 | 6,751 | cpp | C++ | tests/test_set.cpp | ftlorg/ftl | 75a580043ddf011477f0fbcb0ed1dc01be37814d | [
"BSL-1.0"
] | 47 | 2020-07-17T07:31:42.000Z | 2022-02-18T10:31:45.000Z | tests/test_set.cpp | ftlorg/ftl | 75a580043ddf011477f0fbcb0ed1dc01be37814d | [
"BSL-1.0"
] | 40 | 2020-07-23T09:01:39.000Z | 2020-12-19T15:19:44.000Z | tests/test_set.cpp | ftlorg/ftl | 75a580043ddf011477f0fbcb0ed1dc01be37814d | [
"BSL-1.0"
] | 1 | 2020-07-26T18:21:36.000Z | 2020-07-26T18:21:36.000Z | #include <catch2/catch.hpp>
#include <ftl/ftl.hpp>
#define TEST_TAG "[set]"
TEST_CASE(TEST_TAG "default ctor", TEST_TAG) {
ftl::set<std::string> set;
REQUIRE(set.empty());
}
TEST_CASE(TEST_TAG "input iterator ctor", TEST_TAG) {
ftl::set<std::string> set1 = { { std::string("red"), std::string("green"), std::string("blue") } };
ftl::set<std::string> set2 = { std::begin(set1), std::end(set1) };
REQUIRE(set1.size() == set2.size());
REQUIRE(*set1.find("red") == *set2.find("red"));
REQUIRE(*set1.find("green") == *set2.find("green"));
REQUIRE(*set1.find("blue") == *set2.find("blue"));
}
TEST_CASE(TEST_TAG "copy ctor", TEST_TAG) {
ftl::set<std::string> set1 = { { std::string("red"), std::string("green"), std::string("blue") } };
ftl::set<std::string> set2 = set1;
REQUIRE(set1.size() == set2.size());
REQUIRE(*set1.find("red") == *set2.find("red"));
REQUIRE(*set1.find("green") == *set2.find("green"));
REQUIRE(*set1.find("blue") == *set2.find("blue"));
}
TEST_CASE(TEST_TAG "move ctor", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
ftl::set<std::string> set2 = std::move(set1);
REQUIRE(set2.size() == 3);
REQUIRE(set2.find("red") != set2.end());
REQUIRE(set2.find("green") != set2.end());
REQUIRE(set2.find("blue") != set2.end());
}
TEST_CASE(TEST_TAG "insert elements which already exist", TEST_TAG) {
ftl::set<std::string> set = { { "red", "green", "blue" } };
set.insert("blue");
set.insert("green");
set.insert("red");
REQUIRE(set.size() == 3);
}
TEST_CASE(TEST_TAG "operator=", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
ftl::set<std::string> set2{};
set2 = set1;
REQUIRE(set2.size() == 3);
REQUIRE(set2.find("red") != set2.end());
REQUIRE(set2.find("green") != set2.end());
REQUIRE(set2.find("blue") != set2.end());
}
TEST_CASE(TEST_TAG "move operator=", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
ftl::set<std::string> set2{};
set2 = std::move(set1);
REQUIRE(set1.empty());
REQUIRE(set2.size() == 3);
REQUIRE(set2.find("red") != set2.end());
REQUIRE(set2.find("green") != set2.end());
REQUIRE(set2.find("blue") != set2.end());
}
TEST_CASE(TEST_TAG "begin", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
REQUIRE(set1.begin() != set1.end());
}
TEST_CASE(TEST_TAG "begin const", TEST_TAG) {
const ftl::set<std::string> set1 = { { "red", "green", "blue" } };
REQUIRE(set1.begin() != set1.end());
}
TEST_CASE(TEST_TAG "empty", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
REQUIRE_FALSE(set1.empty());
}
TEST_CASE(TEST_TAG "empty const", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
REQUIRE_FALSE(set1.empty());
}
TEST_CASE(TEST_TAG "size", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
REQUIRE(set1.size() == 3);
}
TEST_CASE(TEST_TAG "size const", TEST_TAG) {
const ftl::set<std::string> set1 = { { "red", "green", "blue" } };
REQUIRE(set1.size() == 3);
}
TEST_CASE(TEST_TAG "clear", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
set1.clear();
REQUIRE(set1.empty());
}
TEST_CASE(TEST_TAG "insert", TEST_TAG) {
ftl::set<std::string> set = { { "red", "green", "blue" } };
REQUIRE(set.size() == 3);
set.insert("blue");
set.insert("green");
set.insert("red");
set.insert({ "orange" });
REQUIRE(set.size() == 4);
REQUIRE(set.find("orange") != set.end());
}
TEST_CASE(TEST_TAG "emplace", TEST_TAG) {
ftl::set<std::string> set1 = {};
set1.emplace("red");
set1.emplace("green");
set1.emplace("blue");
REQUIRE(set1.size() == 3);
}
TEST_CASE(TEST_TAG "emplace_hint", TEST_TAG) {
ftl::set<std::string> set1 = { { "red" } };
set1.emplace_hint(set1.begin(), "green");
set1.emplace_hint(set1.begin(), "blue");
REQUIRE(set1.size() == 3);
}
TEST_CASE(TEST_TAG "erase by iter", TEST_TAG) {
ftl::set<std::string> set = { { "red", "green", "blue", "blue" } };
auto it = set.find("blue");
set.erase(it);
REQUIRE(set.size() == 2);
}
TEST_CASE(TEST_TAG "erase with key", TEST_TAG) {
ftl::set<std::string> set = { { "red", "green", "blue", "blue" } };
set.erase("blue");
REQUIRE(set.size() == 2);
}
TEST_CASE(TEST_TAG "erase range", TEST_TAG) {
ftl::set<std::string> set = { { "red", "green", "blue", "blue" } };
set.erase(std::begin(set), std::end(set));
REQUIRE_FALSE(!set.empty());
}
TEST_CASE(TEST_TAG "swap", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue", "blue" } };
REQUIRE(set1.size() == 3);
ftl::set<std::string> set2 = { { "orange", "purple", "purple" } };
REQUIRE(set2.size() == 2);
set1.swap(set2);
REQUIRE(set1.size() == 2);
REQUIRE(set2.size() == 3);
}
TEST_CASE(TEST_TAG "extract by iter", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
auto it = set1.find("red");
auto handle = set1.extract(it);
REQUIRE(handle.value() == "red");
REQUIRE(set1.size() == 2);
}
TEST_CASE(TEST_TAG "extract by key", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
auto handle = set1.extract("red");
REQUIRE(handle.value() == "red");
REQUIRE(set1.size() == 2);
}
TEST_CASE(TEST_TAG "merge", TEST_TAG) {
ftl::set<std::string> ma{ { "apple", "pear", "banana" } };
ftl::set<std::string> mb{ { "zorro", "batman", "X", "alpaca", "apple" } };
ftl::set<std::string> u;
u.merge(ma);
REQUIRE(u.size() == 3);
u.merge(mb);
REQUIRE(u.size() == 7);
}
TEST_CASE(TEST_TAG "count", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
REQUIRE(set1.count("red") == 1);
REQUIRE(set1.count("orange") == 0);
}
TEST_CASE(TEST_TAG "find", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
auto found_it = set1.find("red");
REQUIRE(found_it != std::end(set1));
REQUIRE(*found_it == "red");
auto not_found_it = set1.find("orange");
REQUIRE(not_found_it == std::end(set1));
}
TEST_CASE(TEST_TAG "equal_range", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
auto [lower_bound, upper_bound] = set1.equal_range("red");
REQUIRE(lower_bound == set1.lower_bound("red"));
REQUIRE(upper_bound == set1.upper_bound("red"));
}
TEST_CASE(TEST_TAG "lower_bound", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
auto lower_bound = set1.lower_bound("blue");
REQUIRE(lower_bound != std::end(set1));
}
TEST_CASE(TEST_TAG "upper_bound", TEST_TAG) {
ftl::set<std::string> set1 = { { "red", "green", "blue" } };
auto upper_bound = set1.upper_bound("red");
REQUIRE(upper_bound == std::end(set1));
}
| 25.284644 | 101 | 0.595171 | ftlorg |
1290e333a82a5283c1f171e46c32471442c99e93 | 130 | cc | C++ | src/enums/webrtc/media_type.cc | elofun/node-webrtc | be63c8c007402c25962df9e30c9813ba70b8a17b | [
"Apache-2.0"
] | 1,302 | 2018-11-26T03:29:51.000Z | 2022-03-31T23:38:34.000Z | src/enums/webrtc/media_type.cc | elofun/node-webrtc | be63c8c007402c25962df9e30c9813ba70b8a17b | [
"Apache-2.0"
] | 311 | 2018-11-26T14:22:19.000Z | 2022-03-28T09:47:38.000Z | src/enums/webrtc/media_type.cc | elofun/node-webrtc | be63c8c007402c25962df9e30c9813ba70b8a17b | [
"Apache-2.0"
] | 233 | 2018-11-26T18:08:11.000Z | 2022-03-30T01:29:50.000Z | #include "src/enums/webrtc/media_type.h"
#define ENUM(X) CRICKET_MEDIA_TYPE ## X
#include "src/enums/macros/impls.h"
#undef ENUM
| 21.666667 | 40 | 0.753846 | elofun |
12917226c425f0bde8defd200d14dfab93386a39 | 1,039 | cc | C++ | third_party/webrtc/src/chromium/src/device/vibration/vibration_manager_impl_default.cc | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 8 | 2016-02-08T11:59:31.000Z | 2020-05-31T15:19:54.000Z | third_party/webrtc/src/chromium/src/device/vibration/vibration_manager_impl_default.cc | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 1 | 2021-05-05T11:11:31.000Z | 2021-05-05T11:11:31.000Z | third_party/webrtc/src/chromium/src/device/vibration/vibration_manager_impl_default.cc | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 7 | 2016-02-09T09:28:14.000Z | 2020-07-25T19:03:36.000Z | // Copyright 2014 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 "device/vibration/vibration_manager_impl.h"
#include "base/basictypes.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
namespace device {
namespace {
class VibrationManagerEmptyImpl : public VibrationManager {
public:
void Vibrate(int64 milliseconds) override {}
void Cancel() override {}
private:
friend VibrationManagerImpl;
explicit VibrationManagerEmptyImpl(
mojo::InterfaceRequest<VibrationManager> request)
: binding_(this, request.Pass()) {}
~VibrationManagerEmptyImpl() override {}
// The binding between this object and the other end of the pipe.
mojo::StrongBinding<VibrationManager> binding_;
};
} // namespace
// static
void VibrationManagerImpl::Create(
mojo::InterfaceRequest<VibrationManager> request) {
new VibrationManagerEmptyImpl(request.Pass());
}
} // namespace device
| 25.975 | 73 | 0.757459 | bopopescu |
129267bd10d2c13f4e2c2cb14dd6f5dc753770a3 | 2,966 | cpp | C++ | source/puma/private/internal/ecs/components/inputcomponent.cpp | fpuma/Puma | e8eb5a8711f506077899a1fb5322d616a37e89c4 | [
"MIT"
] | null | null | null | source/puma/private/internal/ecs/components/inputcomponent.cpp | fpuma/Puma | e8eb5a8711f506077899a1fb5322d616a37e89c4 | [
"MIT"
] | null | null | null | source/puma/private/internal/ecs/components/inputcomponent.cpp | fpuma/Puma | e8eb5a8711f506077899a1fb5322d616a37e89c4 | [
"MIT"
] | null | null | null | #include "precompiledengine.h"
#include "internal/ecs/components/inputcomponent.h"
namespace puma
{
void InputComponent::addInputMap( InputAction _inputAction, MousePositionInput _mousePositionInput )
{
m_inputMaps.insert( InputMap( _inputAction, _mousePositionInput ) );
}
void InputComponent::addInputMap( InputAction _inputAction, MouseButtonInput _mouseButtonInput )
{
m_inputMaps.insert( InputMap( _inputAction, _mouseButtonInput ) );
}
void InputComponent::addInputMap( InputAction _inputAction, MouseWheelInput _mouseWheelInput )
{
m_inputMaps.insert( InputMap( _inputAction, _mouseWheelInput ) );
}
void InputComponent::addInputMap( InputAction _inputAction, KeyboardInput _keyboardInput )
{
m_inputMaps.insert( InputMap( _inputAction, _keyboardInput ) );
}
void InputComponent::addInputMap( InputAction _inputAction, ControllerButtonInput _controllerButtonInput )
{
m_inputMaps.insert( InputMap( _inputAction, _controllerButtonInput ) );
}
void InputComponent::addInputMap( InputAction _inputAction, ControllerTriggerInput _controllerTriggerInput )
{
m_inputMaps.insert( InputMap( _inputAction, _controllerTriggerInput ) );
}
void InputComponent::addInputMap( InputAction _inputAction, ControllerJoystickInput _controllerJoystickInput )
{
m_inputMaps.insert( InputMap( _inputAction, _controllerJoystickInput ) );
}
void InputComponent::enableAction( InputAction _inputAction )
{
m_disabledActions.erase( _inputAction );
}
void InputComponent::disableAction( InputAction _inputAction )
{
m_disabledActions.insert( _inputAction );
}
bool InputComponent::isActionActive( InputAction _inputAction ) const
{
bool found = m_activeAction.find( _inputAction ) != m_activeAction.end();
return (found);
}
InputActionExtraInfo InputComponent::getInputActionExtraInfo( InputAction _inputAction ) const
{
auto itFound = std::find_if( m_extraInfo.begin(), m_extraInfo.end(), [_inputAction]( const ExtraInfoData& extraInfoData )
{
return extraInfoData.inputAction == _inputAction;
} );
InputActionExtraInfo result;
if ( itFound != m_extraInfo.end() )
{
result = itFound->extraInfo;
}
return result;
}
void InputComponent::evaluate()
{
m_activeAction.clear();
m_extraInfo.clear();
for ( const InputMap& inputMap : m_inputMaps )
{
InputEvalResult result = inputMap.evaluate();
if ( result.active )
{
m_activeAction.insert( inputMap.getInputAction() );
if ( result.hasExtraInfo )
{
m_extraInfo.insert( { inputMap.getInputAction(), result.extraInfo } );
}
}
}
}
} | 31.892473 | 129 | 0.664869 | fpuma |
1296b8f82d6bf72057df336aefc3ba4e4fc933ba | 1,118 | cpp | C++ | CodeChef Starters 32/Volume Control.cpp | tarunbisht-24/Codechef-Contests | 8e7dcf69b839d586f4e73bc8183b8963a8cf1d50 | [
"Apache-2.0"
] | 1 | 2022-03-06T18:27:58.000Z | 2022-03-06T18:27:58.000Z | CodeChef Starters 32/Volume Control.cpp | tarunbisht-24/Codechef-Contests | 8e7dcf69b839d586f4e73bc8183b8963a8cf1d50 | [
"Apache-2.0"
] | null | null | null | CodeChef Starters 32/Volume Control.cpp | tarunbisht-24/Codechef-Contests | 8e7dcf69b839d586f4e73bc8183b8963a8cf1d50 | [
"Apache-2.0"
] | null | null | null | /*
Chef is watching TV. The current volume of the TV is X. Pressing the volume up button of the TV remote increases the volume by 1 while pressing the volume down button decreases the volume by 1. Chef wants to change the volume from X to Y. Find the minimum number of button presses required to do so.
Input Format
The first line contains a single integer T - the number of test cases. Then the test cases follow.
The first and only line of each test case contains two integers X and Y - the initial volume and final volume of the TV.
Output Format
For each test case, output the minimum number of times Chef has to press a button to change the volume from X to Y.
Constraints
1≤T≤100
1≤X,Y≤100
Sample Input 1
2
50 54
12 10
Sample Output 1
4
2
Explanation
Test Case 1: Chef can press the volume up button 4 times to increase the volume from 50 to 54.
Test Case 2: Chef can press the volume down button 2 times to decrease the volume from 12 to 10.
*/
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--)
{
int x,y;
cin>>x>>y;
cout<<abs(x-y)<<endl;
}
return 0;
}
| 27.95 | 299 | 0.734347 | tarunbisht-24 |
129d5f744ed43e8f2ec753761ebfe8c2f4aa2a91 | 824,659 | cpp | C++ | src/main_5900.cpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | src/main_5900.cpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | src/main_5900.cpp | RedBrumbler/virtuoso-codegen | e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3 | [
"Unlicense"
] | null | null | null | // Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.AddressFamily
#include "System/Net/Sockets/AddressFamily.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Unknown
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Unknown() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Unknown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Unknown"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Unknown
void System::Net::Sockets::AddressFamily::_set_Unknown(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Unknown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Unknown", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Unspecified
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Unspecified() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Unspecified");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Unspecified"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Unspecified
void System::Net::Sockets::AddressFamily::_set_Unspecified(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Unspecified");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Unspecified", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Unix
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Unix() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Unix");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Unix"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Unix
void System::Net::Sockets::AddressFamily::_set_Unix(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Unix");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Unix", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily InterNetwork
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_InterNetwork() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_InterNetwork");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "InterNetwork"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily InterNetwork
void System::Net::Sockets::AddressFamily::_set_InterNetwork(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_InterNetwork");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "InterNetwork", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily ImpLink
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_ImpLink() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_ImpLink");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "ImpLink"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily ImpLink
void System::Net::Sockets::AddressFamily::_set_ImpLink(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_ImpLink");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "ImpLink", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Pup
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Pup() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Pup");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Pup"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Pup
void System::Net::Sockets::AddressFamily::_set_Pup(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Pup");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Pup", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Chaos
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Chaos() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Chaos");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Chaos"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Chaos
void System::Net::Sockets::AddressFamily::_set_Chaos(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Chaos");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Chaos", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily NS
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_NS() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_NS");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "NS"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily NS
void System::Net::Sockets::AddressFamily::_set_NS(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_NS");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "NS", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Ipx
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Ipx() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Ipx");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Ipx"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Ipx
void System::Net::Sockets::AddressFamily::_set_Ipx(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Ipx");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Ipx", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Iso
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Iso() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Iso");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Iso"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Iso
void System::Net::Sockets::AddressFamily::_set_Iso(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Iso");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Iso", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Osi
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Osi() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Osi");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Osi"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Osi
void System::Net::Sockets::AddressFamily::_set_Osi(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Osi");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Osi", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Ecma
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Ecma() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Ecma");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Ecma"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Ecma
void System::Net::Sockets::AddressFamily::_set_Ecma(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Ecma");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Ecma", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily DataKit
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_DataKit() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_DataKit");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "DataKit"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily DataKit
void System::Net::Sockets::AddressFamily::_set_DataKit(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_DataKit");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "DataKit", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Ccitt
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Ccitt() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Ccitt");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Ccitt"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Ccitt
void System::Net::Sockets::AddressFamily::_set_Ccitt(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Ccitt");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Ccitt", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Sna
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Sna() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Sna");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Sna"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Sna
void System::Net::Sockets::AddressFamily::_set_Sna(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Sna");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Sna", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily DecNet
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_DecNet() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_DecNet");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "DecNet"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily DecNet
void System::Net::Sockets::AddressFamily::_set_DecNet(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_DecNet");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "DecNet", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily DataLink
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_DataLink() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_DataLink");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "DataLink"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily DataLink
void System::Net::Sockets::AddressFamily::_set_DataLink(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_DataLink");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "DataLink", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Lat
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Lat() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Lat");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Lat"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Lat
void System::Net::Sockets::AddressFamily::_set_Lat(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Lat");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Lat", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily HyperChannel
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_HyperChannel() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_HyperChannel");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "HyperChannel"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily HyperChannel
void System::Net::Sockets::AddressFamily::_set_HyperChannel(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_HyperChannel");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "HyperChannel", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily AppleTalk
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_AppleTalk() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_AppleTalk");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "AppleTalk"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily AppleTalk
void System::Net::Sockets::AddressFamily::_set_AppleTalk(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_AppleTalk");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "AppleTalk", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily NetBios
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_NetBios() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_NetBios");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "NetBios"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily NetBios
void System::Net::Sockets::AddressFamily::_set_NetBios(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_NetBios");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "NetBios", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily VoiceView
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_VoiceView() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_VoiceView");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "VoiceView"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily VoiceView
void System::Net::Sockets::AddressFamily::_set_VoiceView(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_VoiceView");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "VoiceView", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily FireFox
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_FireFox() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_FireFox");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "FireFox"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily FireFox
void System::Net::Sockets::AddressFamily::_set_FireFox(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_FireFox");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "FireFox", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Banyan
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Banyan() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Banyan");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Banyan"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Banyan
void System::Net::Sockets::AddressFamily::_set_Banyan(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Banyan");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Banyan", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Atm
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Atm() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Atm");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Atm"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Atm
void System::Net::Sockets::AddressFamily::_set_Atm(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Atm");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Atm", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily InterNetworkV6
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_InterNetworkV6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_InterNetworkV6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "InterNetworkV6"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily InterNetworkV6
void System::Net::Sockets::AddressFamily::_set_InterNetworkV6(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_InterNetworkV6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "InterNetworkV6", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Cluster
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Cluster() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Cluster");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Cluster"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Cluster
void System::Net::Sockets::AddressFamily::_set_Cluster(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Cluster");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Cluster", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Ieee12844
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Ieee12844() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Ieee12844");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Ieee12844"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Ieee12844
void System::Net::Sockets::AddressFamily::_set_Ieee12844(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Ieee12844");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Ieee12844", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Irda
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Irda() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Irda");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Irda"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Irda
void System::Net::Sockets::AddressFamily::_set_Irda(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Irda");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Irda", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily NetworkDesigners
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_NetworkDesigners() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_NetworkDesigners");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "NetworkDesigners"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily NetworkDesigners
void System::Net::Sockets::AddressFamily::_set_NetworkDesigners(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_NetworkDesigners");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "NetworkDesigners", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.AddressFamily Max
::System::Net::Sockets::AddressFamily System::Net::Sockets::AddressFamily::_get_Max() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_get_Max");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::AddressFamily>("System.Net.Sockets", "AddressFamily", "Max"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.AddressFamily Max
void System::Net::Sockets::AddressFamily::_set_Max(::System::Net::Sockets::AddressFamily value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::_set_Max");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "AddressFamily", "Max", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::AddressFamily::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::AddressFamily::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.IOControlCode
#include "System/Net/Sockets/IOControlCode.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode AsyncIO
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_AsyncIO() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_AsyncIO");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "AsyncIO"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode AsyncIO
void System::Net::Sockets::IOControlCode::_set_AsyncIO(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_AsyncIO");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "AsyncIO", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode NonBlockingIO
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_NonBlockingIO() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_NonBlockingIO");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "NonBlockingIO"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode NonBlockingIO
void System::Net::Sockets::IOControlCode::_set_NonBlockingIO(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_NonBlockingIO");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "NonBlockingIO", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode DataToRead
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_DataToRead() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_DataToRead");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "DataToRead"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode DataToRead
void System::Net::Sockets::IOControlCode::_set_DataToRead(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_DataToRead");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "DataToRead", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode OobDataRead
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_OobDataRead() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_OobDataRead");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "OobDataRead"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode OobDataRead
void System::Net::Sockets::IOControlCode::_set_OobDataRead(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_OobDataRead");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "OobDataRead", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode AssociateHandle
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_AssociateHandle() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_AssociateHandle");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "AssociateHandle"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode AssociateHandle
void System::Net::Sockets::IOControlCode::_set_AssociateHandle(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_AssociateHandle");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "AssociateHandle", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode EnableCircularQueuing
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_EnableCircularQueuing() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_EnableCircularQueuing");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "EnableCircularQueuing"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode EnableCircularQueuing
void System::Net::Sockets::IOControlCode::_set_EnableCircularQueuing(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_EnableCircularQueuing");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "EnableCircularQueuing", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode Flush
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_Flush() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_Flush");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "Flush"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode Flush
void System::Net::Sockets::IOControlCode::_set_Flush(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_Flush");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "Flush", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode GetBroadcastAddress
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_GetBroadcastAddress() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_GetBroadcastAddress");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "GetBroadcastAddress"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode GetBroadcastAddress
void System::Net::Sockets::IOControlCode::_set_GetBroadcastAddress(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_GetBroadcastAddress");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "GetBroadcastAddress", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode GetExtensionFunctionPointer
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_GetExtensionFunctionPointer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_GetExtensionFunctionPointer");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "GetExtensionFunctionPointer"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode GetExtensionFunctionPointer
void System::Net::Sockets::IOControlCode::_set_GetExtensionFunctionPointer(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_GetExtensionFunctionPointer");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "GetExtensionFunctionPointer", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode GetQos
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_GetQos() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_GetQos");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "GetQos"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode GetQos
void System::Net::Sockets::IOControlCode::_set_GetQos(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_GetQos");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "GetQos", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode GetGroupQos
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_GetGroupQos() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_GetGroupQos");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "GetGroupQos"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode GetGroupQos
void System::Net::Sockets::IOControlCode::_set_GetGroupQos(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_GetGroupQos");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "GetGroupQos", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode MultipointLoopback
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_MultipointLoopback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_MultipointLoopback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "MultipointLoopback"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode MultipointLoopback
void System::Net::Sockets::IOControlCode::_set_MultipointLoopback(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_MultipointLoopback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "MultipointLoopback", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode MulticastScope
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_MulticastScope() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_MulticastScope");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "MulticastScope"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode MulticastScope
void System::Net::Sockets::IOControlCode::_set_MulticastScope(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_MulticastScope");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "MulticastScope", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode SetQos
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_SetQos() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_SetQos");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "SetQos"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode SetQos
void System::Net::Sockets::IOControlCode::_set_SetQos(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_SetQos");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "SetQos", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode SetGroupQos
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_SetGroupQos() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_SetGroupQos");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "SetGroupQos"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode SetGroupQos
void System::Net::Sockets::IOControlCode::_set_SetGroupQos(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_SetGroupQos");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "SetGroupQos", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode TranslateHandle
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_TranslateHandle() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_TranslateHandle");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "TranslateHandle"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode TranslateHandle
void System::Net::Sockets::IOControlCode::_set_TranslateHandle(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_TranslateHandle");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "TranslateHandle", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode RoutingInterfaceQuery
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_RoutingInterfaceQuery() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_RoutingInterfaceQuery");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "RoutingInterfaceQuery"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode RoutingInterfaceQuery
void System::Net::Sockets::IOControlCode::_set_RoutingInterfaceQuery(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_RoutingInterfaceQuery");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "RoutingInterfaceQuery", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode RoutingInterfaceChange
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_RoutingInterfaceChange() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_RoutingInterfaceChange");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "RoutingInterfaceChange"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode RoutingInterfaceChange
void System::Net::Sockets::IOControlCode::_set_RoutingInterfaceChange(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_RoutingInterfaceChange");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "RoutingInterfaceChange", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode AddressListQuery
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_AddressListQuery() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_AddressListQuery");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "AddressListQuery"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode AddressListQuery
void System::Net::Sockets::IOControlCode::_set_AddressListQuery(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_AddressListQuery");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "AddressListQuery", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode AddressListChange
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_AddressListChange() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_AddressListChange");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "AddressListChange"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode AddressListChange
void System::Net::Sockets::IOControlCode::_set_AddressListChange(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_AddressListChange");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "AddressListChange", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode QueryTargetPnpHandle
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_QueryTargetPnpHandle() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_QueryTargetPnpHandle");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "QueryTargetPnpHandle"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode QueryTargetPnpHandle
void System::Net::Sockets::IOControlCode::_set_QueryTargetPnpHandle(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_QueryTargetPnpHandle");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "QueryTargetPnpHandle", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode NamespaceChange
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_NamespaceChange() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_NamespaceChange");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "NamespaceChange"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode NamespaceChange
void System::Net::Sockets::IOControlCode::_set_NamespaceChange(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_NamespaceChange");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "NamespaceChange", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode AddressListSort
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_AddressListSort() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_AddressListSort");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "AddressListSort"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode AddressListSort
void System::Net::Sockets::IOControlCode::_set_AddressListSort(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_AddressListSort");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "AddressListSort", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode ReceiveAll
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_ReceiveAll() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_ReceiveAll");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "ReceiveAll"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode ReceiveAll
void System::Net::Sockets::IOControlCode::_set_ReceiveAll(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_ReceiveAll");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "ReceiveAll", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode ReceiveAllMulticast
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_ReceiveAllMulticast() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_ReceiveAllMulticast");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "ReceiveAllMulticast"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode ReceiveAllMulticast
void System::Net::Sockets::IOControlCode::_set_ReceiveAllMulticast(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_ReceiveAllMulticast");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "ReceiveAllMulticast", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode ReceiveAllIgmpMulticast
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_ReceiveAllIgmpMulticast() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_ReceiveAllIgmpMulticast");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "ReceiveAllIgmpMulticast"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode ReceiveAllIgmpMulticast
void System::Net::Sockets::IOControlCode::_set_ReceiveAllIgmpMulticast(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_ReceiveAllIgmpMulticast");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "ReceiveAllIgmpMulticast", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode KeepAliveValues
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_KeepAliveValues() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_KeepAliveValues");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "KeepAliveValues"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode KeepAliveValues
void System::Net::Sockets::IOControlCode::_set_KeepAliveValues(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_KeepAliveValues");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "KeepAliveValues", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode AbsorbRouterAlert
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_AbsorbRouterAlert() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_AbsorbRouterAlert");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "AbsorbRouterAlert"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode AbsorbRouterAlert
void System::Net::Sockets::IOControlCode::_set_AbsorbRouterAlert(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_AbsorbRouterAlert");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "AbsorbRouterAlert", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode UnicastInterface
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_UnicastInterface() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_UnicastInterface");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "UnicastInterface"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode UnicastInterface
void System::Net::Sockets::IOControlCode::_set_UnicastInterface(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_UnicastInterface");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "UnicastInterface", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode LimitBroadcasts
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_LimitBroadcasts() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_LimitBroadcasts");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "LimitBroadcasts"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode LimitBroadcasts
void System::Net::Sockets::IOControlCode::_set_LimitBroadcasts(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_LimitBroadcasts");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "LimitBroadcasts", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode BindToInterface
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_BindToInterface() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_BindToInterface");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "BindToInterface"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode BindToInterface
void System::Net::Sockets::IOControlCode::_set_BindToInterface(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_BindToInterface");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "BindToInterface", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode MulticastInterface
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_MulticastInterface() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_MulticastInterface");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "MulticastInterface"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode MulticastInterface
void System::Net::Sockets::IOControlCode::_set_MulticastInterface(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_MulticastInterface");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "MulticastInterface", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode AddMulticastGroupOnInterface
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_AddMulticastGroupOnInterface() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_AddMulticastGroupOnInterface");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "AddMulticastGroupOnInterface"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode AddMulticastGroupOnInterface
void System::Net::Sockets::IOControlCode::_set_AddMulticastGroupOnInterface(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_AddMulticastGroupOnInterface");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "AddMulticastGroupOnInterface", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IOControlCode DeleteMulticastGroupFromInterface
::System::Net::Sockets::IOControlCode System::Net::Sockets::IOControlCode::_get_DeleteMulticastGroupFromInterface() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_get_DeleteMulticastGroupFromInterface");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IOControlCode>("System.Net.Sockets", "IOControlCode", "DeleteMulticastGroupFromInterface"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IOControlCode DeleteMulticastGroupFromInterface
void System::Net::Sockets::IOControlCode::_set_DeleteMulticastGroupFromInterface(::System::Net::Sockets::IOControlCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::_set_DeleteMulticastGroupFromInterface");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IOControlCode", "DeleteMulticastGroupFromInterface", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int64 value__
int64_t& System::Net::Sockets::IOControlCode::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IOControlCode::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int64_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.IPProtectionLevel
#include "System/Net/Sockets/IPProtectionLevel.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IPProtectionLevel Unspecified
::System::Net::Sockets::IPProtectionLevel System::Net::Sockets::IPProtectionLevel::_get_Unspecified() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IPProtectionLevel::_get_Unspecified");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IPProtectionLevel>("System.Net.Sockets", "IPProtectionLevel", "Unspecified"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IPProtectionLevel Unspecified
void System::Net::Sockets::IPProtectionLevel::_set_Unspecified(::System::Net::Sockets::IPProtectionLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IPProtectionLevel::_set_Unspecified");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IPProtectionLevel", "Unspecified", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IPProtectionLevel Unrestricted
::System::Net::Sockets::IPProtectionLevel System::Net::Sockets::IPProtectionLevel::_get_Unrestricted() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IPProtectionLevel::_get_Unrestricted");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IPProtectionLevel>("System.Net.Sockets", "IPProtectionLevel", "Unrestricted"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IPProtectionLevel Unrestricted
void System::Net::Sockets::IPProtectionLevel::_set_Unrestricted(::System::Net::Sockets::IPProtectionLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IPProtectionLevel::_set_Unrestricted");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IPProtectionLevel", "Unrestricted", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IPProtectionLevel EdgeRestricted
::System::Net::Sockets::IPProtectionLevel System::Net::Sockets::IPProtectionLevel::_get_EdgeRestricted() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IPProtectionLevel::_get_EdgeRestricted");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IPProtectionLevel>("System.Net.Sockets", "IPProtectionLevel", "EdgeRestricted"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IPProtectionLevel EdgeRestricted
void System::Net::Sockets::IPProtectionLevel::_set_EdgeRestricted(::System::Net::Sockets::IPProtectionLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IPProtectionLevel::_set_EdgeRestricted");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IPProtectionLevel", "EdgeRestricted", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.IPProtectionLevel Restricted
::System::Net::Sockets::IPProtectionLevel System::Net::Sockets::IPProtectionLevel::_get_Restricted() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IPProtectionLevel::_get_Restricted");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::IPProtectionLevel>("System.Net.Sockets", "IPProtectionLevel", "Restricted"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.IPProtectionLevel Restricted
void System::Net::Sockets::IPProtectionLevel::_set_Restricted(::System::Net::Sockets::IPProtectionLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IPProtectionLevel::_set_Restricted");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "IPProtectionLevel", "Restricted", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::IPProtectionLevel::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::IPProtectionLevel::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.LingerOption
#include "System/Net/Sockets/LingerOption.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Boolean enabled
bool& System::Net::Sockets::LingerOption::dyn_enabled() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::LingerOption::dyn_enabled");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "enabled"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 lingerTime
int& System::Net::Sockets::LingerOption::dyn_lingerTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::LingerOption::dyn_lingerTime");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "lingerTime"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.LingerOption.set_Enabled
void System::Net::Sockets::LingerOption::set_Enabled(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::LingerOption::set_Enabled");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Enabled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.LingerOption.set_LingerTime
void System::Net::Sockets::LingerOption::set_LingerTime(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::LingerOption::set_LingerTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_LingerTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Sockets.NetworkStream
#include "System/Net/Sockets/NetworkStream.hpp"
// Including type: System.Net.Sockets.Socket
#include "System/Net/Sockets/Socket.hpp"
// Including type: System.IO.FileAccess
#include "System/IO/FileAccess.hpp"
// Including type: System.Net.Sockets.SocketShutdown
#include "System/Net/Sockets/SocketShutdown.hpp"
// Including type: System.IO.SeekOrigin
#include "System/IO/SeekOrigin.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
// Including type: System.Threading.Tasks.Task
#include "System/Threading/Tasks/Task.hpp"
// Including type: System.Threading.CancellationToken
#include "System/Threading/CancellationToken.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.Socket m_StreamSocket
::System::Net::Sockets::Socket*& System::Net::Sockets::NetworkStream::dyn_m_StreamSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::dyn_m_StreamSocket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_StreamSocket"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_Readable
bool& System::Net::Sockets::NetworkStream::dyn_m_Readable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::dyn_m_Readable");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Readable"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_Writeable
bool& System::Net::Sockets::NetworkStream::dyn_m_Writeable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::dyn_m_Writeable");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Writeable"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_OwnsSocket
bool& System::Net::Sockets::NetworkStream::dyn_m_OwnsSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::dyn_m_OwnsSocket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_OwnsSocket"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 m_CloseTimeout
int& System::Net::Sockets::NetworkStream::dyn_m_CloseTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::dyn_m_CloseTimeout");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_CloseTimeout"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_CleanedUp
bool& System::Net::Sockets::NetworkStream::dyn_m_CleanedUp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::dyn_m_CleanedUp");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_CleanedUp"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 m_CurrentReadTimeout
int& System::Net::Sockets::NetworkStream::dyn_m_CurrentReadTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::dyn_m_CurrentReadTimeout");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_CurrentReadTimeout"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 m_CurrentWriteTimeout
int& System::Net::Sockets::NetworkStream::dyn_m_CurrentWriteTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::dyn_m_CurrentWriteTimeout");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_CurrentWriteTimeout"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.get_InternalSocket
::System::Net::Sockets::Socket* System::Net::Sockets::NetworkStream::get_InternalSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::get_InternalSocket");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InternalSocket", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::Socket*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.get_DataAvailable
bool System::Net::Sockets::NetworkStream::get_DataAvailable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::get_DataAvailable");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DataAvailable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.InitNetworkStream
void System::Net::Sockets::NetworkStream::InitNetworkStream(::System::Net::Sockets::Socket* socket, ::System::IO::FileAccess Access) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::InitNetworkStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InitNetworkStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractType(Access)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, socket, Access);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.SetSocketTimeoutOption
void System::Net::Sockets::NetworkStream::SetSocketTimeoutOption(::System::Net::Sockets::SocketShutdown mode, int timeout, bool silent) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::SetSocketTimeoutOption");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetSocketTimeoutOption", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(mode), ::il2cpp_utils::ExtractType(timeout), ::il2cpp_utils::ExtractType(silent)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, mode, timeout, silent);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.get_CanRead
bool System::Net::Sockets::NetworkStream::get_CanRead() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::get_CanRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.get_CanSeek
bool System::Net::Sockets::NetworkStream::get_CanSeek() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::get_CanSeek");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanSeek", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.get_CanWrite
bool System::Net::Sockets::NetworkStream::get_CanWrite() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::get_CanWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.get_ReadTimeout
int System::Net::Sockets::NetworkStream::get_ReadTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::get_ReadTimeout");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ReadTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.set_ReadTimeout
void System::Net::Sockets::NetworkStream::set_ReadTimeout(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::set_ReadTimeout");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ReadTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.get_WriteTimeout
int System::Net::Sockets::NetworkStream::get_WriteTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::get_WriteTimeout");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_WriteTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.get_Length
int64_t System::Net::Sockets::NetworkStream::get_Length() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::get_Length");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Length", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.get_Position
int64_t System::Net::Sockets::NetworkStream::get_Position() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::get_Position");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.set_Position
void System::Net::Sockets::NetworkStream::set_Position(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::set_Position");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.Seek
int64_t System::Net::Sockets::NetworkStream::Seek(int64_t offset, ::System::IO::SeekOrigin origin) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::Seek");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Seek", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(origin)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, offset, origin);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.Read
int System::Net::Sockets::NetworkStream::Read(ByRef<::ArrayW<uint8_t>> buffer, int offset, int size) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::Read");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Read", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, byref(buffer), offset, size);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.Write
void System::Net::Sockets::NetworkStream::Write(::ArrayW<uint8_t> buffer, int offset, int size) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::Write");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Write", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, buffer, offset, size);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.Dispose
void System::Net::Sockets::NetworkStream::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.Finalize
void System::Net::Sockets::NetworkStream::Finalize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::Finalize");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Finalize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.BeginRead
::System::IAsyncResult* System::Net::Sockets::NetworkStream::BeginRead(::ArrayW<uint8_t> buffer, int offset, int size, ::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::BeginRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, size, callback, state);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.EndRead
int System::Net::Sockets::NetworkStream::EndRead(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::EndRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.BeginWrite
::System::IAsyncResult* System::Net::Sockets::NetworkStream::BeginWrite(::ArrayW<uint8_t> buffer, int offset, int size, ::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::BeginWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, size, callback, state);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.EndWrite
void System::Net::Sockets::NetworkStream::EndWrite(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::EndWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.Flush
void System::Net::Sockets::NetworkStream::Flush() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::Flush");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Flush", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.FlushAsync
::System::Threading::Tasks::Task* System::Net::Sockets::NetworkStream::FlushAsync(::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::FlushAsync");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FlushAsync", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(this, ___internal__method, cancellationToken);
}
// Autogenerated method: System.Net.Sockets.NetworkStream.SetLength
void System::Net::Sockets::NetworkStream::SetLength(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::NetworkStream::SetLength");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.ProtocolType
#include "System/Net/Sockets/ProtocolType.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IP
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IP() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IP");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IP"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IP
void System::Net::Sockets::ProtocolType::_set_IP(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IP");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IP", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IPv6HopByHopOptions
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IPv6HopByHopOptions() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IPv6HopByHopOptions");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IPv6HopByHopOptions"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IPv6HopByHopOptions
void System::Net::Sockets::ProtocolType::_set_IPv6HopByHopOptions(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IPv6HopByHopOptions");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IPv6HopByHopOptions", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Icmp
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Icmp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Icmp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Icmp"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Icmp
void System::Net::Sockets::ProtocolType::_set_Icmp(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Icmp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Icmp", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Igmp
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Igmp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Igmp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Igmp"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Igmp
void System::Net::Sockets::ProtocolType::_set_Igmp(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Igmp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Igmp", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Ggp
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Ggp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Ggp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Ggp"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Ggp
void System::Net::Sockets::ProtocolType::_set_Ggp(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Ggp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Ggp", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IPv4
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IPv4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IPv4");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IPv4"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IPv4
void System::Net::Sockets::ProtocolType::_set_IPv4(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IPv4");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IPv4", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Tcp
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Tcp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Tcp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Tcp"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Tcp
void System::Net::Sockets::ProtocolType::_set_Tcp(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Tcp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Tcp", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Pup
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Pup() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Pup");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Pup"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Pup
void System::Net::Sockets::ProtocolType::_set_Pup(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Pup");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Pup", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Udp
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Udp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Udp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Udp"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Udp
void System::Net::Sockets::ProtocolType::_set_Udp(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Udp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Udp", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Idp
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Idp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Idp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Idp"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Idp
void System::Net::Sockets::ProtocolType::_set_Idp(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Idp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Idp", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IPv6
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IPv6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IPv6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IPv6"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IPv6
void System::Net::Sockets::ProtocolType::_set_IPv6(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IPv6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IPv6", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IPv6RoutingHeader
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IPv6RoutingHeader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IPv6RoutingHeader");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IPv6RoutingHeader"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IPv6RoutingHeader
void System::Net::Sockets::ProtocolType::_set_IPv6RoutingHeader(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IPv6RoutingHeader");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IPv6RoutingHeader", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IPv6FragmentHeader
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IPv6FragmentHeader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IPv6FragmentHeader");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IPv6FragmentHeader"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IPv6FragmentHeader
void System::Net::Sockets::ProtocolType::_set_IPv6FragmentHeader(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IPv6FragmentHeader");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IPv6FragmentHeader", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IPSecEncapsulatingSecurityPayload
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IPSecEncapsulatingSecurityPayload() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IPSecEncapsulatingSecurityPayload");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IPSecEncapsulatingSecurityPayload"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IPSecEncapsulatingSecurityPayload
void System::Net::Sockets::ProtocolType::_set_IPSecEncapsulatingSecurityPayload(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IPSecEncapsulatingSecurityPayload");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IPSecEncapsulatingSecurityPayload", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IPSecAuthenticationHeader
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IPSecAuthenticationHeader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IPSecAuthenticationHeader");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IPSecAuthenticationHeader"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IPSecAuthenticationHeader
void System::Net::Sockets::ProtocolType::_set_IPSecAuthenticationHeader(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IPSecAuthenticationHeader");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IPSecAuthenticationHeader", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IcmpV6
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IcmpV6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IcmpV6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IcmpV6"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IcmpV6
void System::Net::Sockets::ProtocolType::_set_IcmpV6(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IcmpV6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IcmpV6", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IPv6NoNextHeader
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IPv6NoNextHeader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IPv6NoNextHeader");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IPv6NoNextHeader"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IPv6NoNextHeader
void System::Net::Sockets::ProtocolType::_set_IPv6NoNextHeader(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IPv6NoNextHeader");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IPv6NoNextHeader", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType IPv6DestinationOptions
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_IPv6DestinationOptions() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_IPv6DestinationOptions");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "IPv6DestinationOptions"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType IPv6DestinationOptions
void System::Net::Sockets::ProtocolType::_set_IPv6DestinationOptions(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_IPv6DestinationOptions");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "IPv6DestinationOptions", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType ND
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_ND() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_ND");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "ND"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType ND
void System::Net::Sockets::ProtocolType::_set_ND(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_ND");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "ND", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Raw
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Raw() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Raw");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Raw"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Raw
void System::Net::Sockets::ProtocolType::_set_Raw(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Raw");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Raw", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Unspecified
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Unspecified() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Unspecified");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Unspecified"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Unspecified
void System::Net::Sockets::ProtocolType::_set_Unspecified(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Unspecified");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Unspecified", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Ipx
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Ipx() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Ipx");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Ipx"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Ipx
void System::Net::Sockets::ProtocolType::_set_Ipx(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Ipx");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Ipx", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Spx
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Spx() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Spx");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Spx"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Spx
void System::Net::Sockets::ProtocolType::_set_Spx(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Spx");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Spx", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType SpxII
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_SpxII() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_SpxII");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "SpxII"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType SpxII
void System::Net::Sockets::ProtocolType::_set_SpxII(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_SpxII");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "SpxII", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.ProtocolType Unknown
::System::Net::Sockets::ProtocolType System::Net::Sockets::ProtocolType::_get_Unknown() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_get_Unknown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::ProtocolType>("System.Net.Sockets", "ProtocolType", "Unknown"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.ProtocolType Unknown
void System::Net::Sockets::ProtocolType::_set_Unknown(::System::Net::Sockets::ProtocolType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::_set_Unknown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "ProtocolType", "Unknown", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::ProtocolType::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::ProtocolType::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SelectMode
#include "System/Net/Sockets/SelectMode.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SelectMode SelectRead
::System::Net::Sockets::SelectMode System::Net::Sockets::SelectMode::_get_SelectRead() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SelectMode::_get_SelectRead");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SelectMode>("System.Net.Sockets", "SelectMode", "SelectRead"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SelectMode SelectRead
void System::Net::Sockets::SelectMode::_set_SelectRead(::System::Net::Sockets::SelectMode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SelectMode::_set_SelectRead");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SelectMode", "SelectRead", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SelectMode SelectWrite
::System::Net::Sockets::SelectMode System::Net::Sockets::SelectMode::_get_SelectWrite() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SelectMode::_get_SelectWrite");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SelectMode>("System.Net.Sockets", "SelectMode", "SelectWrite"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SelectMode SelectWrite
void System::Net::Sockets::SelectMode::_set_SelectWrite(::System::Net::Sockets::SelectMode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SelectMode::_set_SelectWrite");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SelectMode", "SelectWrite", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SelectMode SelectError
::System::Net::Sockets::SelectMode System::Net::Sockets::SelectMode::_get_SelectError() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SelectMode::_get_SelectError");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SelectMode>("System.Net.Sockets", "SelectMode", "SelectError"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SelectMode SelectError
void System::Net::Sockets::SelectMode::_set_SelectError(::System::Net::Sockets::SelectMode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SelectMode::_set_SelectError");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SelectMode", "SelectError", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::SelectMode::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SelectMode::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Sockets.Socket
#include "System/Net/Sockets/Socket.hpp"
// Including type: System.Net.Sockets.Socket/System.Net.Sockets.WSABUF
#include "System/Net/Sockets/Socket_WSABUF.hpp"
// Including type: System.Net.Sockets.Socket/System.Net.Sockets.<>c
#include "System/Net/Sockets/Socket_--c.hpp"
// Including type: System.Net.Sockets.Socket/System.Net.Sockets.<>c__DisplayClass243_0
#include "System/Net/Sockets/Socket_--c__DisplayClass243_0.hpp"
// Including type: System.Net.Sockets.Socket/System.Net.Sockets.<>c__DisplayClass299_0
#include "System/Net/Sockets/Socket_--c__DisplayClass299_0.hpp"
// Including type: System.Net.Sockets.SafeSocketHandle
#include "System/Net/Sockets/SafeSocketHandle.hpp"
// Including type: System.Net.EndPoint
#include "System/Net/EndPoint.hpp"
// Including type: System.Threading.SemaphoreSlim
#include "System/Threading/SemaphoreSlim.hpp"
// Including type: System.String
#include "System/String.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
// Including type: System.IOAsyncCallback
#include "System/IOAsyncCallback.hpp"
// Including type: System.IntPtr
#include "System/IntPtr.hpp"
// Including type: System.Collections.Generic.IList`1
#include "System/Collections/Generic/IList_1.hpp"
// Including type: System.Net.Sockets.SocketFlags
#include "System/Net/Sockets/SocketFlags.hpp"
// Including type: System.Net.Sockets.IOControlCode
#include "System/Net/Sockets/IOControlCode.hpp"
// Including type: System.Net.Sockets.IPProtectionLevel
#include "System/Net/Sockets/IPProtectionLevel.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.Net.Sockets.SocketShutdown
#include "System/Net/Sockets/SocketShutdown.hpp"
// Including type: System.Net.Sockets.SocketOptionLevel
#include "System/Net/Sockets/SocketOptionLevel.hpp"
// Including type: System.Net.Sockets.SocketOptionName
#include "System/Net/Sockets/SocketOptionName.hpp"
// Including type: System.Net.SocketAddress
#include "System/Net/SocketAddress.hpp"
// Including type: System.Net.Sockets.SelectMode
#include "System/Net/Sockets/SelectMode.hpp"
// Including type: System.Net.IPAddress
#include "System/Net/IPAddress.hpp"
// Including type: System.Net.Sockets.SocketAsyncResult
#include "System/Net/Sockets/SocketAsyncResult.hpp"
// Including type: System.Net.Sockets.SocketError
#include "System/Net/Sockets/SocketError.hpp"
// Including type: System.IOSelectorJob
#include "System/IOSelectorJob.hpp"
// Including type: System.Net.IPEndPoint
#include "System/Net/IPEndPoint.hpp"
// Including type: System.Threading.Thread
#include "System/Threading/Thread.hpp"
// Including type: System.Net.NetworkInformation.NetworkInterfaceComponent
#include "System/Net/NetworkInformation/NetworkInterfaceComponent.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Object s_InternalSyncObject
::Il2CppObject* System::Net::Sockets::Socket::_get_s_InternalSyncObject() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_s_InternalSyncObject");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Il2CppObject*>("System.Net.Sockets", "Socket", "s_InternalSyncObject"));
}
// Autogenerated static field setter
// Set static field: static private System.Object s_InternalSyncObject
void System::Net::Sockets::Socket::_set_s_InternalSyncObject(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_s_InternalSyncObject");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "s_InternalSyncObject", value));
}
// Autogenerated static field getter
// Get static field: static System.Boolean s_SupportsIPv4
bool System::Net::Sockets::Socket::_get_s_SupportsIPv4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_s_SupportsIPv4");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System.Net.Sockets", "Socket", "s_SupportsIPv4"));
}
// Autogenerated static field setter
// Set static field: static System.Boolean s_SupportsIPv4
void System::Net::Sockets::Socket::_set_s_SupportsIPv4(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_s_SupportsIPv4");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "s_SupportsIPv4", value));
}
// Autogenerated static field getter
// Get static field: static System.Boolean s_SupportsIPv6
bool System::Net::Sockets::Socket::_get_s_SupportsIPv6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_s_SupportsIPv6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System.Net.Sockets", "Socket", "s_SupportsIPv6"));
}
// Autogenerated static field setter
// Set static field: static System.Boolean s_SupportsIPv6
void System::Net::Sockets::Socket::_set_s_SupportsIPv6(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_s_SupportsIPv6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "s_SupportsIPv6", value));
}
// Autogenerated static field getter
// Get static field: static System.Boolean s_OSSupportsIPv6
bool System::Net::Sockets::Socket::_get_s_OSSupportsIPv6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_s_OSSupportsIPv6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System.Net.Sockets", "Socket", "s_OSSupportsIPv6"));
}
// Autogenerated static field setter
// Set static field: static System.Boolean s_OSSupportsIPv6
void System::Net::Sockets::Socket::_set_s_OSSupportsIPv6(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_s_OSSupportsIPv6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "s_OSSupportsIPv6", value));
}
// Autogenerated static field getter
// Get static field: static System.Boolean s_Initialized
bool System::Net::Sockets::Socket::_get_s_Initialized() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_s_Initialized");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System.Net.Sockets", "Socket", "s_Initialized"));
}
// Autogenerated static field setter
// Set static field: static System.Boolean s_Initialized
void System::Net::Sockets::Socket::_set_s_Initialized(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_s_Initialized");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "s_Initialized", value));
}
// Autogenerated static field getter
// Get static field: static private System.Boolean s_LoggingEnabled
bool System::Net::Sockets::Socket::_get_s_LoggingEnabled() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_s_LoggingEnabled");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System.Net.Sockets", "Socket", "s_LoggingEnabled"));
}
// Autogenerated static field setter
// Set static field: static private System.Boolean s_LoggingEnabled
void System::Net::Sockets::Socket::_set_s_LoggingEnabled(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_s_LoggingEnabled");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "s_LoggingEnabled", value));
}
// Autogenerated static field getter
// Get static field: static System.Boolean s_PerfCountersEnabled
bool System::Net::Sockets::Socket::_get_s_PerfCountersEnabled() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_s_PerfCountersEnabled");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System.Net.Sockets", "Socket", "s_PerfCountersEnabled"));
}
// Autogenerated static field setter
// Set static field: static System.Boolean s_PerfCountersEnabled
void System::Net::Sockets::Socket::_set_s_PerfCountersEnabled(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_s_PerfCountersEnabled");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "s_PerfCountersEnabled", value));
}
// Autogenerated static field getter
// Get static field: static System.Int32 DefaultCloseTimeout
int System::Net::Sockets::Socket::_get_DefaultCloseTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_DefaultCloseTimeout");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System.Net.Sockets", "Socket", "DefaultCloseTimeout"));
}
// Autogenerated static field setter
// Set static field: static System.Int32 DefaultCloseTimeout
void System::Net::Sockets::Socket::_set_DefaultCloseTimeout(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_DefaultCloseTimeout");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "DefaultCloseTimeout", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 SOCKET_CLOSED_CODE
int System::Net::Sockets::Socket::_get_SOCKET_CLOSED_CODE() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_SOCKET_CLOSED_CODE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System.Net.Sockets", "Socket", "SOCKET_CLOSED_CODE"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 SOCKET_CLOSED_CODE
void System::Net::Sockets::Socket::_set_SOCKET_CLOSED_CODE(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_SOCKET_CLOSED_CODE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "SOCKET_CLOSED_CODE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TIMEOUT_EXCEPTION_MSG
::StringW System::Net::Sockets::Socket::_get_TIMEOUT_EXCEPTION_MSG() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_TIMEOUT_EXCEPTION_MSG");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("System.Net.Sockets", "Socket", "TIMEOUT_EXCEPTION_MSG"));
}
// Autogenerated static field setter
// Set static field: static private System.String TIMEOUT_EXCEPTION_MSG
void System::Net::Sockets::Socket::_set_TIMEOUT_EXCEPTION_MSG(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_TIMEOUT_EXCEPTION_MSG");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "TIMEOUT_EXCEPTION_MSG", value));
}
// Autogenerated static field getter
// Get static field: static private System.AsyncCallback AcceptAsyncCallback
::System::AsyncCallback* System::Net::Sockets::Socket::_get_AcceptAsyncCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_AcceptAsyncCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AsyncCallback*>("System.Net.Sockets", "Socket", "AcceptAsyncCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.AsyncCallback AcceptAsyncCallback
void System::Net::Sockets::Socket::_set_AcceptAsyncCallback(::System::AsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_AcceptAsyncCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "AcceptAsyncCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.IOAsyncCallback BeginAcceptCallback
::System::IOAsyncCallback* System::Net::Sockets::Socket::_get_BeginAcceptCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_BeginAcceptCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IOAsyncCallback*>("System.Net.Sockets", "Socket", "BeginAcceptCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.IOAsyncCallback BeginAcceptCallback
void System::Net::Sockets::Socket::_set_BeginAcceptCallback(::System::IOAsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_BeginAcceptCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "BeginAcceptCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.IOAsyncCallback BeginAcceptReceiveCallback
::System::IOAsyncCallback* System::Net::Sockets::Socket::_get_BeginAcceptReceiveCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_BeginAcceptReceiveCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IOAsyncCallback*>("System.Net.Sockets", "Socket", "BeginAcceptReceiveCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.IOAsyncCallback BeginAcceptReceiveCallback
void System::Net::Sockets::Socket::_set_BeginAcceptReceiveCallback(::System::IOAsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_BeginAcceptReceiveCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "BeginAcceptReceiveCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.AsyncCallback ConnectAsyncCallback
::System::AsyncCallback* System::Net::Sockets::Socket::_get_ConnectAsyncCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_ConnectAsyncCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AsyncCallback*>("System.Net.Sockets", "Socket", "ConnectAsyncCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.AsyncCallback ConnectAsyncCallback
void System::Net::Sockets::Socket::_set_ConnectAsyncCallback(::System::AsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_ConnectAsyncCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "ConnectAsyncCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.IOAsyncCallback BeginConnectCallback
::System::IOAsyncCallback* System::Net::Sockets::Socket::_get_BeginConnectCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_BeginConnectCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IOAsyncCallback*>("System.Net.Sockets", "Socket", "BeginConnectCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.IOAsyncCallback BeginConnectCallback
void System::Net::Sockets::Socket::_set_BeginConnectCallback(::System::IOAsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_BeginConnectCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "BeginConnectCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.AsyncCallback DisconnectAsyncCallback
::System::AsyncCallback* System::Net::Sockets::Socket::_get_DisconnectAsyncCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_DisconnectAsyncCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AsyncCallback*>("System.Net.Sockets", "Socket", "DisconnectAsyncCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.AsyncCallback DisconnectAsyncCallback
void System::Net::Sockets::Socket::_set_DisconnectAsyncCallback(::System::AsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_DisconnectAsyncCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "DisconnectAsyncCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.IOAsyncCallback BeginDisconnectCallback
::System::IOAsyncCallback* System::Net::Sockets::Socket::_get_BeginDisconnectCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_BeginDisconnectCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IOAsyncCallback*>("System.Net.Sockets", "Socket", "BeginDisconnectCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.IOAsyncCallback BeginDisconnectCallback
void System::Net::Sockets::Socket::_set_BeginDisconnectCallback(::System::IOAsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_BeginDisconnectCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "BeginDisconnectCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.AsyncCallback ReceiveAsyncCallback
::System::AsyncCallback* System::Net::Sockets::Socket::_get_ReceiveAsyncCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_ReceiveAsyncCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AsyncCallback*>("System.Net.Sockets", "Socket", "ReceiveAsyncCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.AsyncCallback ReceiveAsyncCallback
void System::Net::Sockets::Socket::_set_ReceiveAsyncCallback(::System::AsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_ReceiveAsyncCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "ReceiveAsyncCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.IOAsyncCallback BeginReceiveCallback
::System::IOAsyncCallback* System::Net::Sockets::Socket::_get_BeginReceiveCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_BeginReceiveCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IOAsyncCallback*>("System.Net.Sockets", "Socket", "BeginReceiveCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.IOAsyncCallback BeginReceiveCallback
void System::Net::Sockets::Socket::_set_BeginReceiveCallback(::System::IOAsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_BeginReceiveCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "BeginReceiveCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.IOAsyncCallback BeginReceiveGenericCallback
::System::IOAsyncCallback* System::Net::Sockets::Socket::_get_BeginReceiveGenericCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_BeginReceiveGenericCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IOAsyncCallback*>("System.Net.Sockets", "Socket", "BeginReceiveGenericCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.IOAsyncCallback BeginReceiveGenericCallback
void System::Net::Sockets::Socket::_set_BeginReceiveGenericCallback(::System::IOAsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_BeginReceiveGenericCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "BeginReceiveGenericCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.AsyncCallback ReceiveFromAsyncCallback
::System::AsyncCallback* System::Net::Sockets::Socket::_get_ReceiveFromAsyncCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_ReceiveFromAsyncCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AsyncCallback*>("System.Net.Sockets", "Socket", "ReceiveFromAsyncCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.AsyncCallback ReceiveFromAsyncCallback
void System::Net::Sockets::Socket::_set_ReceiveFromAsyncCallback(::System::AsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_ReceiveFromAsyncCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "ReceiveFromAsyncCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.IOAsyncCallback BeginReceiveFromCallback
::System::IOAsyncCallback* System::Net::Sockets::Socket::_get_BeginReceiveFromCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_BeginReceiveFromCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IOAsyncCallback*>("System.Net.Sockets", "Socket", "BeginReceiveFromCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.IOAsyncCallback BeginReceiveFromCallback
void System::Net::Sockets::Socket::_set_BeginReceiveFromCallback(::System::IOAsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_BeginReceiveFromCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "BeginReceiveFromCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.AsyncCallback SendAsyncCallback
::System::AsyncCallback* System::Net::Sockets::Socket::_get_SendAsyncCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_SendAsyncCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AsyncCallback*>("System.Net.Sockets", "Socket", "SendAsyncCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.AsyncCallback SendAsyncCallback
void System::Net::Sockets::Socket::_set_SendAsyncCallback(::System::AsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_SendAsyncCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "SendAsyncCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.IOAsyncCallback BeginSendGenericCallback
::System::IOAsyncCallback* System::Net::Sockets::Socket::_get_BeginSendGenericCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_BeginSendGenericCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IOAsyncCallback*>("System.Net.Sockets", "Socket", "BeginSendGenericCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.IOAsyncCallback BeginSendGenericCallback
void System::Net::Sockets::Socket::_set_BeginSendGenericCallback(::System::IOAsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_BeginSendGenericCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "BeginSendGenericCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.AsyncCallback SendToAsyncCallback
::System::AsyncCallback* System::Net::Sockets::Socket::_get_SendToAsyncCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_get_SendToAsyncCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::AsyncCallback*>("System.Net.Sockets", "Socket", "SendToAsyncCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.AsyncCallback SendToAsyncCallback
void System::Net::Sockets::Socket::_set_SendToAsyncCallback(::System::AsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::_set_SendToAsyncCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket", "SendToAsyncCallback", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean is_closed
bool& System::Net::Sockets::Socket::dyn_is_closed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_is_closed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "is_closed"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean is_listening
bool& System::Net::Sockets::Socket::dyn_is_listening() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_is_listening");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "is_listening"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean useOverlappedIO
bool& System::Net::Sockets::Socket::dyn_useOverlappedIO() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_useOverlappedIO");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "useOverlappedIO"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 linger_timeout
int& System::Net::Sockets::Socket::dyn_linger_timeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_linger_timeout");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "linger_timeout"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.AddressFamily addressFamily
::System::Net::Sockets::AddressFamily& System::Net::Sockets::Socket::dyn_addressFamily() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_addressFamily");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "addressFamily"))->offset;
return *reinterpret_cast<::System::Net::Sockets::AddressFamily*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.SocketType socketType
::System::Net::Sockets::SocketType& System::Net::Sockets::Socket::dyn_socketType() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_socketType");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "socketType"))->offset;
return *reinterpret_cast<::System::Net::Sockets::SocketType*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.ProtocolType protocolType
::System::Net::Sockets::ProtocolType& System::Net::Sockets::Socket::dyn_protocolType() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_protocolType");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "protocolType"))->offset;
return *reinterpret_cast<::System::Net::Sockets::ProtocolType*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Net.Sockets.SafeSocketHandle m_Handle
::System::Net::Sockets::SafeSocketHandle*& System::Net::Sockets::Socket::dyn_m_Handle() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_m_Handle");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Handle"))->offset;
return *reinterpret_cast<::System::Net::Sockets::SafeSocketHandle**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Net.EndPoint seed_endpoint
::System::Net::EndPoint*& System::Net::Sockets::Socket::dyn_seed_endpoint() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_seed_endpoint");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "seed_endpoint"))->offset;
return *reinterpret_cast<::System::Net::EndPoint**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Threading.SemaphoreSlim ReadSem
::System::Threading::SemaphoreSlim*& System::Net::Sockets::Socket::dyn_ReadSem() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_ReadSem");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ReadSem"))->offset;
return *reinterpret_cast<::System::Threading::SemaphoreSlim**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Threading.SemaphoreSlim WriteSem
::System::Threading::SemaphoreSlim*& System::Net::Sockets::Socket::dyn_WriteSem() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_WriteSem");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "WriteSem"))->offset;
return *reinterpret_cast<::System::Threading::SemaphoreSlim**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Boolean is_blocking
bool& System::Net::Sockets::Socket::dyn_is_blocking() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_is_blocking");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "is_blocking"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Boolean is_bound
bool& System::Net::Sockets::Socket::dyn_is_bound() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_is_bound");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "is_bound"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Boolean is_connected
bool& System::Net::Sockets::Socket::dyn_is_connected() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_is_connected");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "is_connected"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 m_IntCleanedUp
int& System::Net::Sockets::Socket::dyn_m_IntCleanedUp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_m_IntCleanedUp");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_IntCleanedUp"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Boolean connect_in_progress
bool& System::Net::Sockets::Socket::dyn_connect_in_progress() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_connect_in_progress");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "connect_in_progress"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: readonly System.Int32 ID
int& System::Net::Sockets::Socket::dyn_ID() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::dyn_ID");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ID"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.Socket.get_SupportsIPv4
bool System::Net::Sockets::Socket::get_SupportsIPv4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_SupportsIPv4");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "get_SupportsIPv4", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_OSSupportsIPv4
bool System::Net::Sockets::Socket::get_OSSupportsIPv4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_OSSupportsIPv4");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "get_OSSupportsIPv4", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_SupportsIPv6
bool System::Net::Sockets::Socket::get_SupportsIPv6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_SupportsIPv6");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "get_SupportsIPv6", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_OSSupportsIPv6
bool System::Net::Sockets::Socket::get_OSSupportsIPv6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_OSSupportsIPv6");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "get_OSSupportsIPv6", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_Handle
::System::IntPtr System::Net::Sockets::Socket::get_Handle() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_Handle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Handle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_AddressFamily
::System::Net::Sockets::AddressFamily System::Net::Sockets::Socket::get_AddressFamily() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_AddressFamily");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AddressFamily", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::AddressFamily, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_SocketType
::System::Net::Sockets::SocketType System::Net::Sockets::Socket::get_SocketType() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_SocketType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SocketType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::SocketType, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_ProtocolType
::System::Net::Sockets::ProtocolType System::Net::Sockets::Socket::get_ProtocolType() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_ProtocolType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ProtocolType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::ProtocolType, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.set_ExclusiveAddressUse
void System::Net::Sockets::Socket::set_ExclusiveAddressUse(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::set_ExclusiveAddressUse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ExclusiveAddressUse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.Socket.set_DontFragment
void System::Net::Sockets::Socket::set_DontFragment(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::set_DontFragment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_DontFragment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.Socket.get_DualMode
bool System::Net::Sockets::Socket::get_DualMode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_DualMode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DualMode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.set_DualMode
void System::Net::Sockets::Socket::set_DualMode(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::set_DualMode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_DualMode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.Socket.get_IsDualMode
bool System::Net::Sockets::Socket::get_IsDualMode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_IsDualMode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsDualMode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_InternalSyncObject
::Il2CppObject* System::Net::Sockets::Socket::get_InternalSyncObject() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_InternalSyncObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "get_InternalSyncObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_CleanedUp
bool System::Net::Sockets::Socket::get_CleanedUp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_CleanedUp");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CleanedUp", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_Available
int System::Net::Sockets::Socket::get_Available() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_Available");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Available", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_IsBound
bool System::Net::Sockets::Socket::get_IsBound() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_IsBound");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsBound", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_LocalEndPoint
::System::Net::EndPoint* System::Net::Sockets::Socket::get_LocalEndPoint() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_LocalEndPoint");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_LocalEndPoint", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::EndPoint*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.get_Blocking
bool System::Net::Sockets::Socket::get_Blocking() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_Blocking");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Blocking", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.set_Blocking
void System::Net::Sockets::Socket::set_Blocking(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::set_Blocking");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Blocking", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.Socket.get_Connected
bool System::Net::Sockets::Socket::get_Connected() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_Connected");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Connected", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.set_NoDelay
void System::Net::Sockets::Socket::set_NoDelay(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::set_NoDelay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_NoDelay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.Socket.get_FamilyHint
int System::Net::Sockets::Socket::get_FamilyHint() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::get_FamilyHint");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "get_FamilyHint", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket..cctor
void System::Net::Sockets::Socket::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.Send
int System::Net::Sockets::Socket::Send(::System::Collections::Generic::IList_1<::System::ArraySegment_1<uint8_t>>* buffers, ::System::Net::Sockets::SocketFlags socketFlags) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Send");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Send", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffers), ::il2cpp_utils::ExtractType(socketFlags)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffers, socketFlags);
}
// Autogenerated method: System.Net.Sockets.Socket.Send
int System::Net::Sockets::Socket::Send(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Send");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Send", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffer, offset, size, socketFlags);
}
// Autogenerated method: System.Net.Sockets.Socket.Receive
int System::Net::Sockets::Socket::Receive(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Receive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Receive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffer, offset, size, socketFlags);
}
// Autogenerated method: System.Net.Sockets.Socket.Receive
int System::Net::Sockets::Socket::Receive(::System::Collections::Generic::IList_1<::System::ArraySegment_1<uint8_t>>* buffers, ::System::Net::Sockets::SocketFlags socketFlags) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Receive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Receive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffers), ::il2cpp_utils::ExtractType(socketFlags)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffers, socketFlags);
}
// Autogenerated method: System.Net.Sockets.Socket.ReceiveFrom
int System::Net::Sockets::Socket::ReceiveFrom(::ArrayW<uint8_t> buffer, int size, ::System::Net::Sockets::SocketFlags socketFlags, ByRef<::System::Net::EndPoint*> remoteEP) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ReceiveFrom");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReceiveFrom", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractType(remoteEP)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffer, size, socketFlags, byref(remoteEP));
}
// Autogenerated method: System.Net.Sockets.Socket.IOControl
int System::Net::Sockets::Socket::IOControl(::System::Net::Sockets::IOControlCode ioControlCode, ::ArrayW<uint8_t> optionInValue, ::ArrayW<uint8_t> optionOutValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::IOControl");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "IOControl", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ioControlCode), ::il2cpp_utils::ExtractType(optionInValue), ::il2cpp_utils::ExtractType(optionOutValue)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, ioControlCode, optionInValue, optionOutValue);
}
// Autogenerated method: System.Net.Sockets.Socket.SetIPProtectionLevel
void System::Net::Sockets::Socket::SetIPProtectionLevel(::System::Net::Sockets::IPProtectionLevel level) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::SetIPProtectionLevel");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetIPProtectionLevel", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(level)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, level);
}
// Autogenerated method: System.Net.Sockets.Socket.BeginSend
::System::IAsyncResult* System::Net::Sockets::Socket::BeginSend(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags, ::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginSend");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginSend", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, size, socketFlags, callback, state);
}
// Autogenerated method: System.Net.Sockets.Socket.EndSend
int System::Net::Sockets::Socket::EndSend(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndSend");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndSend", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Sockets.Socket.BeginReceive
::System::IAsyncResult* System::Net::Sockets::Socket::BeginReceive(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags, ::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginReceive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginReceive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, size, socketFlags, callback, state);
}
// Autogenerated method: System.Net.Sockets.Socket.EndReceive
int System::Net::Sockets::Socket::EndReceive(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndReceive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndReceive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Sockets.Socket.InitializeSockets
void System::Net::Sockets::Socket::InitializeSockets() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::InitializeSockets");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "InitializeSockets", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.Dispose
void System::Net::Sockets::Socket::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.InternalShutdown
void System::Net::Sockets::Socket::InternalShutdown(::System::Net::Sockets::SocketShutdown how) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::InternalShutdown");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InternalShutdown", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(how)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, how);
}
// Autogenerated method: System.Net.Sockets.Socket.SetSocketOption
void System::Net::Sockets::Socket::SetSocketOption(::System::Net::Sockets::SocketOptionLevel optionLevel, ::System::Net::Sockets::SocketOptionName optionName, int optionValue, bool silent) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::SetSocketOption");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetSocketOption", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(optionLevel), ::il2cpp_utils::ExtractType(optionName), ::il2cpp_utils::ExtractType(optionValue), ::il2cpp_utils::ExtractType(silent)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, optionLevel, optionName, optionValue, silent);
}
// Autogenerated method: System.Net.Sockets.Socket.SocketDefaults
void System::Net::Sockets::Socket::SocketDefaults() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::SocketDefaults");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SocketDefaults", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.Socket_internal
::System::IntPtr System::Net::Sockets::Socket::Socket_internal(::System::Net::Sockets::AddressFamily family, ::System::Net::Sockets::SocketType type, ::System::Net::Sockets::ProtocolType proto, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Socket_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Socket_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(family), ::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractType(proto), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, family, type, proto, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Available_internal
int System::Net::Sockets::Socket::Available_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Available_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Available_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Available_internal
int System::Net::Sockets::Socket::Available_internal(::System::IntPtr socket, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Available_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Available_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, socket, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.LocalEndPoint_internal
::System::Net::SocketAddress* System::Net::Sockets::Socket::LocalEndPoint_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, int family, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::LocalEndPoint_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "LocalEndPoint_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(family), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::SocketAddress*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, family, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.LocalEndPoint_internal
::System::Net::SocketAddress* System::Net::Sockets::Socket::LocalEndPoint_internal(::System::IntPtr socket, int family, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::LocalEndPoint_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "LocalEndPoint_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractType(family), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::SocketAddress*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, socket, family, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Blocking_internal
void System::Net::Sockets::Socket::Blocking_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, bool block, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Blocking_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Blocking_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(block), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, block, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Blocking_internal
void System::Net::Sockets::Socket::Blocking_internal(::System::IntPtr socket, bool block, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Blocking_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Blocking_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractType(block), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, socket, block, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Poll
bool System::Net::Sockets::Socket::Poll(int microSeconds, ::System::Net::Sockets::SelectMode mode) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Poll");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Poll", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(microSeconds), ::il2cpp_utils::ExtractType(mode)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, microSeconds, mode);
}
// Autogenerated method: System.Net.Sockets.Socket.Poll_internal
bool System::Net::Sockets::Socket::Poll_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ::System::Net::Sockets::SelectMode mode, int timeout, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Poll_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Poll_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(mode), ::il2cpp_utils::ExtractType(timeout), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, mode, timeout, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Poll_internal
bool System::Net::Sockets::Socket::Poll_internal(::System::IntPtr socket, ::System::Net::Sockets::SelectMode mode, int timeout, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Poll_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Poll_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractType(mode), ::il2cpp_utils::ExtractType(timeout), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, socket, mode, timeout, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Accept
::System::Net::Sockets::Socket* System::Net::Sockets::Socket::Accept() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Accept");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Accept", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::Socket*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.Accept
void System::Net::Sockets::Socket::Accept(::System::Net::Sockets::Socket* acceptSocket) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Accept");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Accept", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(acceptSocket)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, acceptSocket);
}
// Autogenerated method: System.Net.Sockets.Socket.BeginAccept
::System::IAsyncResult* System::Net::Sockets::Socket::BeginAccept(::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginAccept");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginAccept", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, callback, state);
}
// Autogenerated method: System.Net.Sockets.Socket.EndAccept
::System::Net::Sockets::Socket* System::Net::Sockets::Socket::EndAccept(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndAccept");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndAccept", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::Socket*, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Sockets.Socket.EndAccept
::System::Net::Sockets::Socket* System::Net::Sockets::Socket::EndAccept(ByRef<::ArrayW<uint8_t>> buffer, ByRef<int> bytesTransferred, ::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndAccept");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndAccept", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractIndependentType<::ArrayW<uint8_t>&>(), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(asyncResult)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::Socket*, false>(this, ___internal__method, byref(buffer), byref(bytesTransferred), asyncResult);
}
// Autogenerated method: System.Net.Sockets.Socket.Accept_internal
::System::Net::Sockets::SafeSocketHandle* System::Net::Sockets::Socket::Accept_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Accept_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Accept_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::SafeSocketHandle*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Accept_internal
::System::IntPtr System::Net::Sockets::Socket::Accept_internal(::System::IntPtr sock, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Accept_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Accept_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Bind
void System::Net::Sockets::Socket::Bind(::System::Net::EndPoint* localEP) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Bind");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Bind", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(localEP)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, localEP);
}
// Autogenerated method: System.Net.Sockets.Socket.Bind_internal
void System::Net::Sockets::Socket::Bind_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ::System::Net::SocketAddress* sa, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Bind_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Bind_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(sa), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, sa, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Bind_internal
void System::Net::Sockets::Socket::Bind_internal(::System::IntPtr sock, ::System::Net::SocketAddress* sa, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Bind_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Bind_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(sa), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, sa, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Listen
void System::Net::Sockets::Socket::Listen(int backlog) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Listen");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Listen", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(backlog)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, backlog);
}
// Autogenerated method: System.Net.Sockets.Socket.Listen_internal
void System::Net::Sockets::Socket::Listen_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, int backlog, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Listen_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Listen_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(backlog), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, backlog, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Listen_internal
void System::Net::Sockets::Socket::Listen_internal(::System::IntPtr sock, int backlog, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Listen_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Listen_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(backlog), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, backlog, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Connect
void System::Net::Sockets::Socket::Connect(::System::Net::EndPoint* remoteEP) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Connect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Connect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(remoteEP)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, remoteEP);
}
// Autogenerated method: System.Net.Sockets.Socket.BeginConnect
::System::IAsyncResult* System::Net::Sockets::Socket::BeginConnect(::StringW host, int port, ::System::AsyncCallback* requestCallback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginConnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginConnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(host), ::il2cpp_utils::ExtractType(port), ::il2cpp_utils::ExtractType(requestCallback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, host, port, requestCallback, state);
}
// Autogenerated method: System.Net.Sockets.Socket.BeginConnect
::System::IAsyncResult* System::Net::Sockets::Socket::BeginConnect(::System::Net::EndPoint* remoteEP, ::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginConnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginConnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(remoteEP), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, remoteEP, callback, state);
}
// Autogenerated method: System.Net.Sockets.Socket.BeginConnect
::System::IAsyncResult* System::Net::Sockets::Socket::BeginConnect(::ArrayW<::System::Net::IPAddress*> addresses, int port, ::System::AsyncCallback* requestCallback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginConnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginConnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(addresses), ::il2cpp_utils::ExtractType(port), ::il2cpp_utils::ExtractType(requestCallback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, addresses, port, requestCallback, state);
}
// Autogenerated method: System.Net.Sockets.Socket.BeginMConnect
void System::Net::Sockets::Socket::BeginMConnect(::System::Net::Sockets::SocketAsyncResult* sockares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginMConnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "BeginMConnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sockares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sockares);
}
// Autogenerated method: System.Net.Sockets.Socket.BeginSConnect
void System::Net::Sockets::Socket::BeginSConnect(::System::Net::Sockets::SocketAsyncResult* sockares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginSConnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "BeginSConnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sockares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sockares);
}
// Autogenerated method: System.Net.Sockets.Socket.EndConnect
void System::Net::Sockets::Socket::EndConnect(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndConnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndConnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Sockets.Socket.Connect_internal
void System::Net::Sockets::Socket::Connect_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ::System::Net::SocketAddress* sa, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Connect_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Connect_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(sa), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, sa, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Connect_internal
void System::Net::Sockets::Socket::Connect_internal(::System::IntPtr sock, ::System::Net::SocketAddress* sa, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Connect_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Connect_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(sa), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, sa, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Disconnect
void System::Net::Sockets::Socket::Disconnect(bool reuseSocket) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Disconnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Disconnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(reuseSocket)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, reuseSocket);
}
// Autogenerated method: System.Net.Sockets.Socket.EndDisconnect
void System::Net::Sockets::Socket::EndDisconnect(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndDisconnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndDisconnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Sockets.Socket.Disconnect_internal
void System::Net::Sockets::Socket::Disconnect_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, bool reuse, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Disconnect_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Disconnect_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(reuse), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, reuse, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Disconnect_internal
void System::Net::Sockets::Socket::Disconnect_internal(::System::IntPtr sock, bool reuse, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Disconnect_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Disconnect_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(reuse), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, reuse, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Receive
int System::Net::Sockets::Socket::Receive(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags, ByRef<::System::Net::Sockets::SocketError> errorCode) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Receive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Receive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractIndependentType<::System::Net::Sockets::SocketError&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffer, offset, size, socketFlags, byref(errorCode));
}
// Autogenerated method: System.Net.Sockets.Socket.Receive
int System::Net::Sockets::Socket::Receive(::System::Collections::Generic::IList_1<::System::ArraySegment_1<uint8_t>>* buffers, ::System::Net::Sockets::SocketFlags socketFlags, ByRef<::System::Net::Sockets::SocketError> errorCode) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Receive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Receive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffers), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractIndependentType<::System::Net::Sockets::SocketError&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffers, socketFlags, byref(errorCode));
}
// Autogenerated method: System.Net.Sockets.Socket.BeginReceive
::System::IAsyncResult* System::Net::Sockets::Socket::BeginReceive(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags, ByRef<::System::Net::Sockets::SocketError> errorCode, ::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginReceive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginReceive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractIndependentType<::System::Net::Sockets::SocketError&>(), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, size, socketFlags, byref(errorCode), callback, state);
}
// Autogenerated method: System.Net.Sockets.Socket.EndReceive
int System::Net::Sockets::Socket::EndReceive(::System::IAsyncResult* asyncResult, ByRef<::System::Net::Sockets::SocketError> errorCode) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndReceive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndReceive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult), ::il2cpp_utils::ExtractIndependentType<::System::Net::Sockets::SocketError&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, asyncResult, byref(errorCode));
}
// Autogenerated method: System.Net.Sockets.Socket.Receive_internal
int System::Net::Sockets::Socket::Receive_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ::System::Net::Sockets::Socket::WSABUF* bufarray, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Receive_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Receive_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(bufarray), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, bufarray, count, flags, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Receive_internal
int System::Net::Sockets::Socket::Receive_internal(::System::IntPtr sock, ::System::Net::Sockets::Socket::WSABUF* bufarray, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Receive_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Receive_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(bufarray), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, bufarray, count, flags, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Receive_internal
int System::Net::Sockets::Socket::Receive_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, uint8_t* buffer, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Receive_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Receive_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, buffer, count, flags, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Receive_internal
int System::Net::Sockets::Socket::Receive_internal(::System::IntPtr sock, uint8_t* buffer, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Receive_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Receive_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, buffer, count, flags, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.ReceiveFrom
int System::Net::Sockets::Socket::ReceiveFrom(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags, ByRef<::System::Net::EndPoint*> remoteEP) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ReceiveFrom");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReceiveFrom", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractType(remoteEP)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffer, offset, size, socketFlags, byref(remoteEP));
}
// Autogenerated method: System.Net.Sockets.Socket.ReceiveFrom
int System::Net::Sockets::Socket::ReceiveFrom(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags, ByRef<::System::Net::EndPoint*> remoteEP, ByRef<::System::Net::Sockets::SocketError> errorCode) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ReceiveFrom");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReceiveFrom", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractType(remoteEP), ::il2cpp_utils::ExtractIndependentType<::System::Net::Sockets::SocketError&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffer, offset, size, socketFlags, byref(remoteEP), byref(errorCode));
}
// Autogenerated method: System.Net.Sockets.Socket.EndReceiveFrom
int System::Net::Sockets::Socket::EndReceiveFrom(::System::IAsyncResult* asyncResult, ByRef<::System::Net::EndPoint*> endPoint) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndReceiveFrom");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndReceiveFrom", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult), ::il2cpp_utils::ExtractType(endPoint)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, asyncResult, byref(endPoint));
}
// Autogenerated method: System.Net.Sockets.Socket.ReceiveFrom_internal
int System::Net::Sockets::Socket::ReceiveFrom_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, uint8_t* buffer, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<::System::Net::SocketAddress*> sockaddr, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ReceiveFrom_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "ReceiveFrom_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractType(sockaddr), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, buffer, count, flags, byref(sockaddr), byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.ReceiveFrom_internal
int System::Net::Sockets::Socket::ReceiveFrom_internal(::System::IntPtr sock, uint8_t* buffer, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<::System::Net::SocketAddress*> sockaddr, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ReceiveFrom_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "ReceiveFrom_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractType(sockaddr), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, buffer, count, flags, byref(sockaddr), byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Send
int System::Net::Sockets::Socket::Send(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags, ByRef<::System::Net::Sockets::SocketError> errorCode) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Send");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Send", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractIndependentType<::System::Net::Sockets::SocketError&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffer, offset, size, socketFlags, byref(errorCode));
}
// Autogenerated method: System.Net.Sockets.Socket.Send
int System::Net::Sockets::Socket::Send(::System::Collections::Generic::IList_1<::System::ArraySegment_1<uint8_t>>* buffers, ::System::Net::Sockets::SocketFlags socketFlags, ByRef<::System::Net::Sockets::SocketError> errorCode) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Send");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Send", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffers), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractIndependentType<::System::Net::Sockets::SocketError&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffers, socketFlags, byref(errorCode));
}
// Autogenerated method: System.Net.Sockets.Socket.BeginSend
::System::IAsyncResult* System::Net::Sockets::Socket::BeginSend(::ArrayW<uint8_t> buffer, int offset, int size, ::System::Net::Sockets::SocketFlags socketFlags, ByRef<::System::Net::Sockets::SocketError> errorCode, ::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginSend");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginSend", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size), ::il2cpp_utils::ExtractType(socketFlags), ::il2cpp_utils::ExtractIndependentType<::System::Net::Sockets::SocketError&>(), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, size, socketFlags, byref(errorCode), callback, state);
}
// Autogenerated method: System.Net.Sockets.Socket.BeginSendCallback
void System::Net::Sockets::Socket::BeginSendCallback(::System::Net::Sockets::SocketAsyncResult* sockares, int sent_so_far) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::BeginSendCallback");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "BeginSendCallback", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sockares), ::il2cpp_utils::ExtractType(sent_so_far)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sockares, sent_so_far);
}
// Autogenerated method: System.Net.Sockets.Socket.EndSend
int System::Net::Sockets::Socket::EndSend(::System::IAsyncResult* asyncResult, ByRef<::System::Net::Sockets::SocketError> errorCode) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndSend");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndSend", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult), ::il2cpp_utils::ExtractIndependentType<::System::Net::Sockets::SocketError&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, asyncResult, byref(errorCode));
}
// Autogenerated method: System.Net.Sockets.Socket.Send_internal
int System::Net::Sockets::Socket::Send_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ::System::Net::Sockets::Socket::WSABUF* bufarray, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Send_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Send_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(bufarray), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, bufarray, count, flags, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Send_internal
int System::Net::Sockets::Socket::Send_internal(::System::IntPtr sock, ::System::Net::Sockets::Socket::WSABUF* bufarray, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Send_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Send_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(bufarray), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, bufarray, count, flags, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Send_internal
int System::Net::Sockets::Socket::Send_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, uint8_t* buffer, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Send_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Send_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, buffer, count, flags, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.Send_internal
int System::Net::Sockets::Socket::Send_internal(::System::IntPtr sock, uint8_t* buffer, int count, ::System::Net::Sockets::SocketFlags flags, ByRef<int> error, bool blocking) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Send_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Send_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(flags), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(blocking)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, buffer, count, flags, byref(error), blocking);
}
// Autogenerated method: System.Net.Sockets.Socket.EndSendTo
int System::Net::Sockets::Socket::EndSendTo(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::EndSendTo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndSendTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Sockets.Socket.GetSocketOption
::Il2CppObject* System::Net::Sockets::Socket::GetSocketOption(::System::Net::Sockets::SocketOptionLevel optionLevel, ::System::Net::Sockets::SocketOptionName optionName) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::GetSocketOption");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetSocketOption", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(optionLevel), ::il2cpp_utils::ExtractType(optionName)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, optionLevel, optionName);
}
// Autogenerated method: System.Net.Sockets.Socket.GetSocketOption_obj_internal
void System::Net::Sockets::Socket::GetSocketOption_obj_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ::System::Net::Sockets::SocketOptionLevel level, ::System::Net::Sockets::SocketOptionName name, ByRef<::Il2CppObject*> obj_val, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::GetSocketOption_obj_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "GetSocketOption_obj_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(level), ::il2cpp_utils::ExtractType(name), ::il2cpp_utils::ExtractIndependentType<::Il2CppObject*&>(), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, level, name, byref(obj_val), byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.GetSocketOption_obj_internal
void System::Net::Sockets::Socket::GetSocketOption_obj_internal(::System::IntPtr socket, ::System::Net::Sockets::SocketOptionLevel level, ::System::Net::Sockets::SocketOptionName name, ByRef<::Il2CppObject*> obj_val, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::GetSocketOption_obj_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "GetSocketOption_obj_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractType(level), ::il2cpp_utils::ExtractType(name), ::il2cpp_utils::ExtractIndependentType<::Il2CppObject*&>(), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, socket, level, name, byref(obj_val), byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.SetSocketOption
void System::Net::Sockets::Socket::SetSocketOption(::System::Net::Sockets::SocketOptionLevel optionLevel, ::System::Net::Sockets::SocketOptionName optionName, int optionValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::SetSocketOption");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetSocketOption", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(optionLevel), ::il2cpp_utils::ExtractType(optionName), ::il2cpp_utils::ExtractType(optionValue)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, optionLevel, optionName, optionValue);
}
// Autogenerated method: System.Net.Sockets.Socket.SetSocketOption_internal
void System::Net::Sockets::Socket::SetSocketOption_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ::System::Net::Sockets::SocketOptionLevel level, ::System::Net::Sockets::SocketOptionName name, ::Il2CppObject* obj_val, ::ArrayW<uint8_t> byte_val, int int_val, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::SetSocketOption_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "SetSocketOption_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(level), ::il2cpp_utils::ExtractType(name), ::il2cpp_utils::ExtractType(obj_val), ::il2cpp_utils::ExtractType(byte_val), ::il2cpp_utils::ExtractType(int_val), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, level, name, obj_val, byte_val, int_val, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.SetSocketOption_internal
void System::Net::Sockets::Socket::SetSocketOption_internal(::System::IntPtr socket, ::System::Net::Sockets::SocketOptionLevel level, ::System::Net::Sockets::SocketOptionName name, ::Il2CppObject* obj_val, ::ArrayW<uint8_t> byte_val, int int_val, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::SetSocketOption_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "SetSocketOption_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractType(level), ::il2cpp_utils::ExtractType(name), ::il2cpp_utils::ExtractType(obj_val), ::il2cpp_utils::ExtractType(byte_val), ::il2cpp_utils::ExtractType(int_val), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, socket, level, name, obj_val, byte_val, int_val, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.IOControl
int System::Net::Sockets::Socket::IOControl(int ioControlCode, ::ArrayW<uint8_t> optionInValue, ::ArrayW<uint8_t> optionOutValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::IOControl");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "IOControl", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ioControlCode), ::il2cpp_utils::ExtractType(optionInValue), ::il2cpp_utils::ExtractType(optionOutValue)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, ioControlCode, optionInValue, optionOutValue);
}
// Autogenerated method: System.Net.Sockets.Socket.IOControl_internal
int System::Net::Sockets::Socket::IOControl_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, int ioctl_code, ::ArrayW<uint8_t> input, ::ArrayW<uint8_t> output, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::IOControl_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "IOControl_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(ioctl_code), ::il2cpp_utils::ExtractType(input), ::il2cpp_utils::ExtractType(output), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, ioctl_code, input, output, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.IOControl_internal
int System::Net::Sockets::Socket::IOControl_internal(::System::IntPtr sock, int ioctl_code, ::ArrayW<uint8_t> input, ::ArrayW<uint8_t> output, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::IOControl_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "IOControl_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sock), ::il2cpp_utils::ExtractType(ioctl_code), ::il2cpp_utils::ExtractType(input), ::il2cpp_utils::ExtractType(output), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, sock, ioctl_code, input, output, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Close
void System::Net::Sockets::Socket::Close() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Close");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Close", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.Close
void System::Net::Sockets::Socket::Close(int timeout) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Close");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Close", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(timeout)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, timeout);
}
// Autogenerated method: System.Net.Sockets.Socket.Close_internal
void System::Net::Sockets::Socket::Close_internal(::System::IntPtr socket, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Close_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Close_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, socket, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Shutdown_internal
void System::Net::Sockets::Socket::Shutdown_internal(::System::Net::Sockets::SafeSocketHandle* safeHandle, ::System::Net::Sockets::SocketShutdown how, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Shutdown_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Shutdown_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(safeHandle), ::il2cpp_utils::ExtractType(how), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, safeHandle, how, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Shutdown_internal
void System::Net::Sockets::Socket::Shutdown_internal(::System::IntPtr socket, ::System::Net::Sockets::SocketShutdown how, ByRef<int> error) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Shutdown_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "Shutdown_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractType(how), ::il2cpp_utils::ExtractIndependentType<int&>()})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, socket, how, byref(error));
}
// Autogenerated method: System.Net.Sockets.Socket.Dispose
void System::Net::Sockets::Socket::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.Net.Sockets.Socket.Linger
void System::Net::Sockets::Socket::Linger(::System::IntPtr handle) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Linger");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Linger", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(handle)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, handle);
}
// Autogenerated method: System.Net.Sockets.Socket.ThrowIfDisposedAndClosed
void System::Net::Sockets::Socket::ThrowIfDisposedAndClosed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ThrowIfDisposedAndClosed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ThrowIfDisposedAndClosed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.ThrowIfBufferNull
void System::Net::Sockets::Socket::ThrowIfBufferNull(::ArrayW<uint8_t> buffer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ThrowIfBufferNull");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ThrowIfBufferNull", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, buffer);
}
// Autogenerated method: System.Net.Sockets.Socket.ThrowIfBufferOutOfRange
void System::Net::Sockets::Socket::ThrowIfBufferOutOfRange(::ArrayW<uint8_t> buffer, int offset, int size) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ThrowIfBufferOutOfRange");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ThrowIfBufferOutOfRange", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(size)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, buffer, offset, size);
}
// Autogenerated method: System.Net.Sockets.Socket.ThrowIfUdp
void System::Net::Sockets::Socket::ThrowIfUdp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ThrowIfUdp");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ThrowIfUdp", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket.ValidateEndIAsyncResult
::System::Net::Sockets::SocketAsyncResult* System::Net::Sockets::Socket::ValidateEndIAsyncResult(::System::IAsyncResult* ares, ::StringW methodName, ::StringW argName) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::ValidateEndIAsyncResult");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ValidateEndIAsyncResult", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares), ::il2cpp_utils::ExtractType(methodName), ::il2cpp_utils::ExtractType(argName)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::SocketAsyncResult*, false>(this, ___internal__method, ares, methodName, argName);
}
// Autogenerated method: System.Net.Sockets.Socket.QueueIOSelectorJob
void System::Net::Sockets::Socket::QueueIOSelectorJob(::System::Threading::SemaphoreSlim* sem, ::System::IntPtr handle, ::System::IOSelectorJob* job) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::QueueIOSelectorJob");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "QueueIOSelectorJob", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sem), ::il2cpp_utils::ExtractType(handle), ::il2cpp_utils::ExtractType(job)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, sem, handle, job);
}
// Autogenerated method: System.Net.Sockets.Socket.RemapIPEndPoint
::System::Net::IPEndPoint* System::Net::Sockets::Socket::RemapIPEndPoint(::System::Net::IPEndPoint* input) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::RemapIPEndPoint");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RemapIPEndPoint", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::IPEndPoint*, false>(this, ___internal__method, input);
}
// Autogenerated method: System.Net.Sockets.Socket.cancel_blocking_socket_operation
void System::Net::Sockets::Socket::cancel_blocking_socket_operation(::System::Threading::Thread* thread) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::cancel_blocking_socket_operation");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "cancel_blocking_socket_operation", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(thread)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, thread);
}
// Autogenerated method: System.Net.Sockets.Socket.IsProtocolSupported_internal
bool System::Net::Sockets::Socket::IsProtocolSupported_internal(::System::Net::NetworkInformation::NetworkInterfaceComponent networkInterface) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::IsProtocolSupported_internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "IsProtocolSupported_internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(networkInterface)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, networkInterface);
}
// Autogenerated method: System.Net.Sockets.Socket.IsProtocolSupported
bool System::Net::Sockets::Socket::IsProtocolSupported(::System::Net::NetworkInformation::NetworkInterfaceComponent networkInterface) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::IsProtocolSupported");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket", "IsProtocolSupported", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(networkInterface)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, networkInterface);
}
// Autogenerated method: System.Net.Sockets.Socket.Finalize
void System::Net::Sockets::Socket::Finalize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::Finalize");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Finalize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.Socket/System.Net.Sockets.<>c
#include "System/Net/Sockets/Socket_--c.hpp"
// Including type: System.IOAsyncCallback
#include "System/IOAsyncCallback.hpp"
// Including type: System.IOAsyncResult
#include "System/IOAsyncResult.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.Net.Sockets.Socket/System.Net.Sockets.<>c <>9
::System::Net::Sockets::Socket::$$c* System::Net::Sockets::Socket::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Net::Sockets::Socket::$$c*>("System.Net.Sockets", "Socket/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Net.Sockets.Socket/System.Net.Sockets.<>c <>9
void System::Net::Sockets::Socket::$$c::_set_$$9(::System::Net::Sockets::Socket::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.IOAsyncCallback <>9__242_0
::System::IOAsyncCallback* System::Net::Sockets::Socket::$$c::_get_$$9__242_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::_get_$$9__242_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::IOAsyncCallback*>("System.Net.Sockets", "Socket/<>c", "<>9__242_0")));
}
// Autogenerated static field setter
// Set static field: static public System.IOAsyncCallback <>9__242_0
void System::Net::Sockets::Socket::$$c::_set_$$9__242_0(::System::IOAsyncCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::_set_$$9__242_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("System.Net.Sockets", "Socket/<>c", "<>9__242_0", value)));
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c..cctor
void System::Net::Sockets::Socket::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "Socket/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<BeginSend>b__242_0
void System::Net::Sockets::Socket::$$c::$BeginSend$b__242_0(::System::IOAsyncResult* s) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<BeginSend>b__242_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<BeginSend>b__242_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, s);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_0
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_0(::System::IAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_1
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_1(::System::IOAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_2
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_2(::System::IOAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_2");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_3
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_3(::System::IAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_3");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_3", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_4
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_4(::System::IOAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_4");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_4", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_5
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_5(::System::IAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_5");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_5", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_6
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_6(::System::IOAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_6");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_6", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_7
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_7(::System::IAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_7");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_7", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_8
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_8(::System::IOAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_8");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_8", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_9
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_9(::System::IOAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_9");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_9", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_10
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_10(::System::IAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_10");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_10", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_11
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_11(::System::IOAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_11");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_11", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_12
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_12(::System::IAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_12");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_12", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_13
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_13(::System::IOAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_13");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_13", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c.<.cctor>b__310_14
void System::Net::Sockets::Socket::$$c::$_cctor$b__310_14(::System::IAsyncResult* ares) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c::<.cctor>b__310_14");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<.cctor>b__310_14", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ares)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ares);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.Socket/System.Net.Sockets.<>c__DisplayClass243_0
#include "System/Net/Sockets/Socket_--c__DisplayClass243_0.hpp"
// Including type: System.IOAsyncResult
#include "System/IOAsyncResult.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.Int32 sent_so_far
int& System::Net::Sockets::Socket::$$c__DisplayClass243_0::dyn_sent_so_far() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c__DisplayClass243_0::dyn_sent_so_far");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "sent_so_far"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c__DisplayClass243_0.<BeginSendCallback>b__0
void System::Net::Sockets::Socket::$$c__DisplayClass243_0::$BeginSendCallback$b__0(::System::IOAsyncResult* s) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c__DisplayClass243_0::<BeginSendCallback>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<BeginSendCallback>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, s);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.Socket/System.Net.Sockets.<>c__DisplayClass299_0
#include "System/Net/Sockets/Socket_--c__DisplayClass299_0.hpp"
// Including type: System.IOSelectorJob
#include "System/IOSelectorJob.hpp"
// Including type: System.Threading.Tasks.Task
#include "System/Threading/Tasks/Task.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.Net.Sockets.Socket <>4__this
::System::Net::Sockets::Socket*& System::Net::Sockets::Socket::$$c__DisplayClass299_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c__DisplayClass299_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.IOSelectorJob job
::System::IOSelectorJob*& System::Net::Sockets::Socket::$$c__DisplayClass299_0::dyn_job() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c__DisplayClass299_0::dyn_job");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "job"))->offset;
return *reinterpret_cast<::System::IOSelectorJob**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.IntPtr handle
::System::IntPtr& System::Net::Sockets::Socket::$$c__DisplayClass299_0::dyn_handle() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c__DisplayClass299_0::dyn_handle");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "handle"))->offset;
return *reinterpret_cast<::System::IntPtr*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.Socket/System.Net.Sockets.<>c__DisplayClass299_0.<QueueIOSelectorJob>b__0
void System::Net::Sockets::Socket::$$c__DisplayClass299_0::$QueueIOSelectorJob$b__0(::System::Threading::Tasks::Task* t) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::Socket::$$c__DisplayClass299_0::<QueueIOSelectorJob>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<QueueIOSelectorJob>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(t)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, t);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SocketError
#include "System/Net/Sockets/SocketError.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError Success
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_Success() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_Success");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "Success"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError Success
void System::Net::Sockets::SocketError::_set_Success(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_Success");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "Success", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError SocketError
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_SocketError() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_SocketError");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "SocketError"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError SocketError
void System::Net::Sockets::SocketError::_set_SocketError(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_SocketError");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "SocketError", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError Interrupted
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_Interrupted() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_Interrupted");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "Interrupted"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError Interrupted
void System::Net::Sockets::SocketError::_set_Interrupted(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_Interrupted");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "Interrupted", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError AccessDenied
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_AccessDenied() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_AccessDenied");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "AccessDenied"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError AccessDenied
void System::Net::Sockets::SocketError::_set_AccessDenied(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_AccessDenied");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "AccessDenied", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError Fault
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_Fault() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_Fault");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "Fault"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError Fault
void System::Net::Sockets::SocketError::_set_Fault(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_Fault");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "Fault", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError InvalidArgument
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_InvalidArgument() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_InvalidArgument");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "InvalidArgument"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError InvalidArgument
void System::Net::Sockets::SocketError::_set_InvalidArgument(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_InvalidArgument");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "InvalidArgument", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError TooManyOpenSockets
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_TooManyOpenSockets() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_TooManyOpenSockets");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "TooManyOpenSockets"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError TooManyOpenSockets
void System::Net::Sockets::SocketError::_set_TooManyOpenSockets(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_TooManyOpenSockets");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "TooManyOpenSockets", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError WouldBlock
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_WouldBlock() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_WouldBlock");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "WouldBlock"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError WouldBlock
void System::Net::Sockets::SocketError::_set_WouldBlock(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_WouldBlock");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "WouldBlock", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError InProgress
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_InProgress() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_InProgress");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "InProgress"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError InProgress
void System::Net::Sockets::SocketError::_set_InProgress(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_InProgress");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "InProgress", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError AlreadyInProgress
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_AlreadyInProgress() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_AlreadyInProgress");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "AlreadyInProgress"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError AlreadyInProgress
void System::Net::Sockets::SocketError::_set_AlreadyInProgress(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_AlreadyInProgress");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "AlreadyInProgress", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError NotSocket
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_NotSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_NotSocket");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "NotSocket"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError NotSocket
void System::Net::Sockets::SocketError::_set_NotSocket(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_NotSocket");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "NotSocket", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError DestinationAddressRequired
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_DestinationAddressRequired() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_DestinationAddressRequired");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "DestinationAddressRequired"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError DestinationAddressRequired
void System::Net::Sockets::SocketError::_set_DestinationAddressRequired(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_DestinationAddressRequired");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "DestinationAddressRequired", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError MessageSize
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_MessageSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_MessageSize");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "MessageSize"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError MessageSize
void System::Net::Sockets::SocketError::_set_MessageSize(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_MessageSize");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "MessageSize", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError ProtocolType
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_ProtocolType() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_ProtocolType");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "ProtocolType"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError ProtocolType
void System::Net::Sockets::SocketError::_set_ProtocolType(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_ProtocolType");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "ProtocolType", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError ProtocolOption
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_ProtocolOption() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_ProtocolOption");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "ProtocolOption"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError ProtocolOption
void System::Net::Sockets::SocketError::_set_ProtocolOption(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_ProtocolOption");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "ProtocolOption", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError ProtocolNotSupported
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_ProtocolNotSupported() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_ProtocolNotSupported");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "ProtocolNotSupported"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError ProtocolNotSupported
void System::Net::Sockets::SocketError::_set_ProtocolNotSupported(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_ProtocolNotSupported");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "ProtocolNotSupported", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError SocketNotSupported
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_SocketNotSupported() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_SocketNotSupported");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "SocketNotSupported"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError SocketNotSupported
void System::Net::Sockets::SocketError::_set_SocketNotSupported(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_SocketNotSupported");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "SocketNotSupported", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError OperationNotSupported
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_OperationNotSupported() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_OperationNotSupported");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "OperationNotSupported"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError OperationNotSupported
void System::Net::Sockets::SocketError::_set_OperationNotSupported(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_OperationNotSupported");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "OperationNotSupported", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError ProtocolFamilyNotSupported
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_ProtocolFamilyNotSupported() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_ProtocolFamilyNotSupported");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "ProtocolFamilyNotSupported"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError ProtocolFamilyNotSupported
void System::Net::Sockets::SocketError::_set_ProtocolFamilyNotSupported(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_ProtocolFamilyNotSupported");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "ProtocolFamilyNotSupported", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError AddressFamilyNotSupported
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_AddressFamilyNotSupported() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_AddressFamilyNotSupported");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "AddressFamilyNotSupported"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError AddressFamilyNotSupported
void System::Net::Sockets::SocketError::_set_AddressFamilyNotSupported(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_AddressFamilyNotSupported");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "AddressFamilyNotSupported", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError AddressAlreadyInUse
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_AddressAlreadyInUse() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_AddressAlreadyInUse");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "AddressAlreadyInUse"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError AddressAlreadyInUse
void System::Net::Sockets::SocketError::_set_AddressAlreadyInUse(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_AddressAlreadyInUse");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "AddressAlreadyInUse", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError AddressNotAvailable
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_AddressNotAvailable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_AddressNotAvailable");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "AddressNotAvailable"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError AddressNotAvailable
void System::Net::Sockets::SocketError::_set_AddressNotAvailable(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_AddressNotAvailable");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "AddressNotAvailable", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError NetworkDown
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_NetworkDown() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_NetworkDown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "NetworkDown"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError NetworkDown
void System::Net::Sockets::SocketError::_set_NetworkDown(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_NetworkDown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "NetworkDown", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError NetworkUnreachable
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_NetworkUnreachable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_NetworkUnreachable");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "NetworkUnreachable"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError NetworkUnreachable
void System::Net::Sockets::SocketError::_set_NetworkUnreachable(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_NetworkUnreachable");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "NetworkUnreachable", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError NetworkReset
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_NetworkReset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_NetworkReset");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "NetworkReset"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError NetworkReset
void System::Net::Sockets::SocketError::_set_NetworkReset(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_NetworkReset");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "NetworkReset", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError ConnectionAborted
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_ConnectionAborted() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_ConnectionAborted");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "ConnectionAborted"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError ConnectionAborted
void System::Net::Sockets::SocketError::_set_ConnectionAborted(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_ConnectionAborted");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "ConnectionAborted", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError ConnectionReset
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_ConnectionReset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_ConnectionReset");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "ConnectionReset"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError ConnectionReset
void System::Net::Sockets::SocketError::_set_ConnectionReset(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_ConnectionReset");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "ConnectionReset", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError NoBufferSpaceAvailable
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_NoBufferSpaceAvailable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_NoBufferSpaceAvailable");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "NoBufferSpaceAvailable"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError NoBufferSpaceAvailable
void System::Net::Sockets::SocketError::_set_NoBufferSpaceAvailable(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_NoBufferSpaceAvailable");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "NoBufferSpaceAvailable", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError IsConnected
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_IsConnected() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_IsConnected");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "IsConnected"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError IsConnected
void System::Net::Sockets::SocketError::_set_IsConnected(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_IsConnected");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "IsConnected", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError NotConnected
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_NotConnected() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_NotConnected");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "NotConnected"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError NotConnected
void System::Net::Sockets::SocketError::_set_NotConnected(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_NotConnected");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "NotConnected", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError Shutdown
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_Shutdown() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_Shutdown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "Shutdown"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError Shutdown
void System::Net::Sockets::SocketError::_set_Shutdown(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_Shutdown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "Shutdown", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError TimedOut
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_TimedOut() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_TimedOut");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "TimedOut"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError TimedOut
void System::Net::Sockets::SocketError::_set_TimedOut(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_TimedOut");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "TimedOut", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError ConnectionRefused
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_ConnectionRefused() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_ConnectionRefused");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "ConnectionRefused"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError ConnectionRefused
void System::Net::Sockets::SocketError::_set_ConnectionRefused(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_ConnectionRefused");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "ConnectionRefused", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError HostDown
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_HostDown() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_HostDown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "HostDown"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError HostDown
void System::Net::Sockets::SocketError::_set_HostDown(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_HostDown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "HostDown", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError HostUnreachable
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_HostUnreachable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_HostUnreachable");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "HostUnreachable"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError HostUnreachable
void System::Net::Sockets::SocketError::_set_HostUnreachable(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_HostUnreachable");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "HostUnreachable", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError ProcessLimit
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_ProcessLimit() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_ProcessLimit");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "ProcessLimit"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError ProcessLimit
void System::Net::Sockets::SocketError::_set_ProcessLimit(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_ProcessLimit");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "ProcessLimit", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError SystemNotReady
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_SystemNotReady() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_SystemNotReady");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "SystemNotReady"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError SystemNotReady
void System::Net::Sockets::SocketError::_set_SystemNotReady(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_SystemNotReady");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "SystemNotReady", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError VersionNotSupported
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_VersionNotSupported() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_VersionNotSupported");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "VersionNotSupported"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError VersionNotSupported
void System::Net::Sockets::SocketError::_set_VersionNotSupported(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_VersionNotSupported");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "VersionNotSupported", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError NotInitialized
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_NotInitialized() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_NotInitialized");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "NotInitialized"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError NotInitialized
void System::Net::Sockets::SocketError::_set_NotInitialized(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_NotInitialized");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "NotInitialized", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError Disconnecting
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_Disconnecting() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_Disconnecting");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "Disconnecting"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError Disconnecting
void System::Net::Sockets::SocketError::_set_Disconnecting(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_Disconnecting");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "Disconnecting", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError TypeNotFound
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_TypeNotFound() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_TypeNotFound");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "TypeNotFound"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError TypeNotFound
void System::Net::Sockets::SocketError::_set_TypeNotFound(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_TypeNotFound");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "TypeNotFound", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError HostNotFound
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_HostNotFound() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_HostNotFound");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "HostNotFound"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError HostNotFound
void System::Net::Sockets::SocketError::_set_HostNotFound(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_HostNotFound");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "HostNotFound", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError TryAgain
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_TryAgain() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_TryAgain");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "TryAgain"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError TryAgain
void System::Net::Sockets::SocketError::_set_TryAgain(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_TryAgain");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "TryAgain", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError NoRecovery
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_NoRecovery() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_NoRecovery");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "NoRecovery"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError NoRecovery
void System::Net::Sockets::SocketError::_set_NoRecovery(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_NoRecovery");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "NoRecovery", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError NoData
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_NoData() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_NoData");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "NoData"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError NoData
void System::Net::Sockets::SocketError::_set_NoData(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_NoData");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "NoData", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError IOPending
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_IOPending() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_IOPending");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "IOPending"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError IOPending
void System::Net::Sockets::SocketError::_set_IOPending(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_IOPending");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "IOPending", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketError OperationAborted
::System::Net::Sockets::SocketError System::Net::Sockets::SocketError::_get_OperationAborted() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_get_OperationAborted");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketError>("System.Net.Sockets", "SocketError", "OperationAborted"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketError OperationAborted
void System::Net::Sockets::SocketError::_set_OperationAborted(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::_set_OperationAborted");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketError", "OperationAborted", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::SocketError::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketError::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SocketFlags
#include "System/Net/Sockets/SocketFlags.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags None
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_None() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_None");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "None"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags None
void System::Net::Sockets::SocketFlags::_set_None(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_None");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "None", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags OutOfBand
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_OutOfBand() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_OutOfBand");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "OutOfBand"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags OutOfBand
void System::Net::Sockets::SocketFlags::_set_OutOfBand(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_OutOfBand");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "OutOfBand", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags Peek
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_Peek() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_Peek");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "Peek"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags Peek
void System::Net::Sockets::SocketFlags::_set_Peek(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_Peek");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "Peek", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags DontRoute
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_DontRoute() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_DontRoute");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "DontRoute"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags DontRoute
void System::Net::Sockets::SocketFlags::_set_DontRoute(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_DontRoute");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "DontRoute", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags MaxIOVectorLength
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_MaxIOVectorLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_MaxIOVectorLength");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "MaxIOVectorLength"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags MaxIOVectorLength
void System::Net::Sockets::SocketFlags::_set_MaxIOVectorLength(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_MaxIOVectorLength");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "MaxIOVectorLength", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags Truncated
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_Truncated() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_Truncated");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "Truncated"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags Truncated
void System::Net::Sockets::SocketFlags::_set_Truncated(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_Truncated");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "Truncated", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags ControlDataTruncated
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_ControlDataTruncated() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_ControlDataTruncated");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "ControlDataTruncated"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags ControlDataTruncated
void System::Net::Sockets::SocketFlags::_set_ControlDataTruncated(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_ControlDataTruncated");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "ControlDataTruncated", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags Broadcast
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_Broadcast() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_Broadcast");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "Broadcast"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags Broadcast
void System::Net::Sockets::SocketFlags::_set_Broadcast(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_Broadcast");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "Broadcast", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags Multicast
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_Multicast() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_Multicast");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "Multicast"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags Multicast
void System::Net::Sockets::SocketFlags::_set_Multicast(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_Multicast");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "Multicast", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketFlags Partial
::System::Net::Sockets::SocketFlags System::Net::Sockets::SocketFlags::_get_Partial() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_get_Partial");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketFlags>("System.Net.Sockets", "SocketFlags", "Partial"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketFlags Partial
void System::Net::Sockets::SocketFlags::_set_Partial(::System::Net::Sockets::SocketFlags value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::_set_Partial");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketFlags", "Partial", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::SocketFlags::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketFlags::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SocketOptionLevel
#include "System/Net/Sockets/SocketOptionLevel.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionLevel Socket
::System::Net::Sockets::SocketOptionLevel System::Net::Sockets::SocketOptionLevel::_get_Socket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_get_Socket");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionLevel>("System.Net.Sockets", "SocketOptionLevel", "Socket"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionLevel Socket
void System::Net::Sockets::SocketOptionLevel::_set_Socket(::System::Net::Sockets::SocketOptionLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_set_Socket");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionLevel", "Socket", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionLevel IP
::System::Net::Sockets::SocketOptionLevel System::Net::Sockets::SocketOptionLevel::_get_IP() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_get_IP");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionLevel>("System.Net.Sockets", "SocketOptionLevel", "IP"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionLevel IP
void System::Net::Sockets::SocketOptionLevel::_set_IP(::System::Net::Sockets::SocketOptionLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_set_IP");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionLevel", "IP", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionLevel IPv6
::System::Net::Sockets::SocketOptionLevel System::Net::Sockets::SocketOptionLevel::_get_IPv6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_get_IPv6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionLevel>("System.Net.Sockets", "SocketOptionLevel", "IPv6"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionLevel IPv6
void System::Net::Sockets::SocketOptionLevel::_set_IPv6(::System::Net::Sockets::SocketOptionLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_set_IPv6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionLevel", "IPv6", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionLevel Tcp
::System::Net::Sockets::SocketOptionLevel System::Net::Sockets::SocketOptionLevel::_get_Tcp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_get_Tcp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionLevel>("System.Net.Sockets", "SocketOptionLevel", "Tcp"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionLevel Tcp
void System::Net::Sockets::SocketOptionLevel::_set_Tcp(::System::Net::Sockets::SocketOptionLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_set_Tcp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionLevel", "Tcp", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionLevel Udp
::System::Net::Sockets::SocketOptionLevel System::Net::Sockets::SocketOptionLevel::_get_Udp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_get_Udp");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionLevel>("System.Net.Sockets", "SocketOptionLevel", "Udp"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionLevel Udp
void System::Net::Sockets::SocketOptionLevel::_set_Udp(::System::Net::Sockets::SocketOptionLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::_set_Udp");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionLevel", "Udp", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::SocketOptionLevel::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionLevel::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SocketOptionName
#include "System/Net/Sockets/SocketOptionName.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName Debug
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_Debug() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_Debug");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "Debug"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName Debug
void System::Net::Sockets::SocketOptionName::_set_Debug(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_Debug");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "Debug", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName AcceptConnection
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_AcceptConnection() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_AcceptConnection");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "AcceptConnection"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName AcceptConnection
void System::Net::Sockets::SocketOptionName::_set_AcceptConnection(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_AcceptConnection");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "AcceptConnection", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName ReuseAddress
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_ReuseAddress() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_ReuseAddress");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "ReuseAddress"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName ReuseAddress
void System::Net::Sockets::SocketOptionName::_set_ReuseAddress(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_ReuseAddress");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "ReuseAddress", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName KeepAlive
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_KeepAlive() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_KeepAlive");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "KeepAlive"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName KeepAlive
void System::Net::Sockets::SocketOptionName::_set_KeepAlive(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_KeepAlive");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "KeepAlive", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName DontRoute
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_DontRoute() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_DontRoute");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "DontRoute"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName DontRoute
void System::Net::Sockets::SocketOptionName::_set_DontRoute(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_DontRoute");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "DontRoute", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName Broadcast
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_Broadcast() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_Broadcast");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "Broadcast"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName Broadcast
void System::Net::Sockets::SocketOptionName::_set_Broadcast(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_Broadcast");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "Broadcast", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName UseLoopback
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_UseLoopback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_UseLoopback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "UseLoopback"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName UseLoopback
void System::Net::Sockets::SocketOptionName::_set_UseLoopback(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_UseLoopback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "UseLoopback", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName Linger
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_Linger() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_Linger");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "Linger"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName Linger
void System::Net::Sockets::SocketOptionName::_set_Linger(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_Linger");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "Linger", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName OutOfBandInline
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_OutOfBandInline() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_OutOfBandInline");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "OutOfBandInline"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName OutOfBandInline
void System::Net::Sockets::SocketOptionName::_set_OutOfBandInline(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_OutOfBandInline");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "OutOfBandInline", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName DontLinger
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_DontLinger() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_DontLinger");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "DontLinger"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName DontLinger
void System::Net::Sockets::SocketOptionName::_set_DontLinger(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_DontLinger");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "DontLinger", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName ExclusiveAddressUse
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_ExclusiveAddressUse() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_ExclusiveAddressUse");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "ExclusiveAddressUse"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName ExclusiveAddressUse
void System::Net::Sockets::SocketOptionName::_set_ExclusiveAddressUse(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_ExclusiveAddressUse");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "ExclusiveAddressUse", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName SendBuffer
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_SendBuffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_SendBuffer");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "SendBuffer"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName SendBuffer
void System::Net::Sockets::SocketOptionName::_set_SendBuffer(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_SendBuffer");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "SendBuffer", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName ReceiveBuffer
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_ReceiveBuffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_ReceiveBuffer");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "ReceiveBuffer"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName ReceiveBuffer
void System::Net::Sockets::SocketOptionName::_set_ReceiveBuffer(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_ReceiveBuffer");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "ReceiveBuffer", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName SendLowWater
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_SendLowWater() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_SendLowWater");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "SendLowWater"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName SendLowWater
void System::Net::Sockets::SocketOptionName::_set_SendLowWater(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_SendLowWater");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "SendLowWater", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName ReceiveLowWater
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_ReceiveLowWater() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_ReceiveLowWater");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "ReceiveLowWater"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName ReceiveLowWater
void System::Net::Sockets::SocketOptionName::_set_ReceiveLowWater(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_ReceiveLowWater");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "ReceiveLowWater", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName SendTimeout
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_SendTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_SendTimeout");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "SendTimeout"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName SendTimeout
void System::Net::Sockets::SocketOptionName::_set_SendTimeout(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_SendTimeout");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "SendTimeout", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName ReceiveTimeout
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_ReceiveTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_ReceiveTimeout");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "ReceiveTimeout"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName ReceiveTimeout
void System::Net::Sockets::SocketOptionName::_set_ReceiveTimeout(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_ReceiveTimeout");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "ReceiveTimeout", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName Error
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_Error() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_Error");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "Error"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName Error
void System::Net::Sockets::SocketOptionName::_set_Error(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_Error");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "Error", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName Type
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_Type() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_Type");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "Type"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName Type
void System::Net::Sockets::SocketOptionName::_set_Type(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_Type");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "Type", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName ReuseUnicastPort
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_ReuseUnicastPort() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_ReuseUnicastPort");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "ReuseUnicastPort"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName ReuseUnicastPort
void System::Net::Sockets::SocketOptionName::_set_ReuseUnicastPort(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_ReuseUnicastPort");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "ReuseUnicastPort", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName MaxConnections
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_MaxConnections() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_MaxConnections");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "MaxConnections"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName MaxConnections
void System::Net::Sockets::SocketOptionName::_set_MaxConnections(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_MaxConnections");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "MaxConnections", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName IPOptions
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_IPOptions() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_IPOptions");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "IPOptions"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName IPOptions
void System::Net::Sockets::SocketOptionName::_set_IPOptions(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_IPOptions");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "IPOptions", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName HeaderIncluded
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_HeaderIncluded() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_HeaderIncluded");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "HeaderIncluded"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName HeaderIncluded
void System::Net::Sockets::SocketOptionName::_set_HeaderIncluded(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_HeaderIncluded");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "HeaderIncluded", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName TypeOfService
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_TypeOfService() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_TypeOfService");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "TypeOfService"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName TypeOfService
void System::Net::Sockets::SocketOptionName::_set_TypeOfService(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_TypeOfService");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "TypeOfService", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName IpTimeToLive
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_IpTimeToLive() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_IpTimeToLive");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "IpTimeToLive"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName IpTimeToLive
void System::Net::Sockets::SocketOptionName::_set_IpTimeToLive(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_IpTimeToLive");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "IpTimeToLive", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName MulticastInterface
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_MulticastInterface() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_MulticastInterface");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "MulticastInterface"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName MulticastInterface
void System::Net::Sockets::SocketOptionName::_set_MulticastInterface(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_MulticastInterface");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "MulticastInterface", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName MulticastTimeToLive
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_MulticastTimeToLive() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_MulticastTimeToLive");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "MulticastTimeToLive"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName MulticastTimeToLive
void System::Net::Sockets::SocketOptionName::_set_MulticastTimeToLive(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_MulticastTimeToLive");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "MulticastTimeToLive", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName MulticastLoopback
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_MulticastLoopback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_MulticastLoopback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "MulticastLoopback"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName MulticastLoopback
void System::Net::Sockets::SocketOptionName::_set_MulticastLoopback(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_MulticastLoopback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "MulticastLoopback", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName AddMembership
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_AddMembership() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_AddMembership");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "AddMembership"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName AddMembership
void System::Net::Sockets::SocketOptionName::_set_AddMembership(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_AddMembership");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "AddMembership", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName DropMembership
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_DropMembership() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_DropMembership");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "DropMembership"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName DropMembership
void System::Net::Sockets::SocketOptionName::_set_DropMembership(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_DropMembership");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "DropMembership", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName DontFragment
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_DontFragment() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_DontFragment");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "DontFragment"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName DontFragment
void System::Net::Sockets::SocketOptionName::_set_DontFragment(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_DontFragment");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "DontFragment", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName AddSourceMembership
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_AddSourceMembership() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_AddSourceMembership");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "AddSourceMembership"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName AddSourceMembership
void System::Net::Sockets::SocketOptionName::_set_AddSourceMembership(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_AddSourceMembership");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "AddSourceMembership", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName DropSourceMembership
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_DropSourceMembership() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_DropSourceMembership");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "DropSourceMembership"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName DropSourceMembership
void System::Net::Sockets::SocketOptionName::_set_DropSourceMembership(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_DropSourceMembership");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "DropSourceMembership", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName BlockSource
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_BlockSource() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_BlockSource");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "BlockSource"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName BlockSource
void System::Net::Sockets::SocketOptionName::_set_BlockSource(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_BlockSource");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "BlockSource", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName UnblockSource
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_UnblockSource() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_UnblockSource");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "UnblockSource"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName UnblockSource
void System::Net::Sockets::SocketOptionName::_set_UnblockSource(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_UnblockSource");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "UnblockSource", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName PacketInformation
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_PacketInformation() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_PacketInformation");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "PacketInformation"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName PacketInformation
void System::Net::Sockets::SocketOptionName::_set_PacketInformation(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_PacketInformation");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "PacketInformation", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName HopLimit
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_HopLimit() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_HopLimit");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "HopLimit"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName HopLimit
void System::Net::Sockets::SocketOptionName::_set_HopLimit(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_HopLimit");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "HopLimit", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName IPProtectionLevel
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_IPProtectionLevel() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_IPProtectionLevel");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "IPProtectionLevel"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName IPProtectionLevel
void System::Net::Sockets::SocketOptionName::_set_IPProtectionLevel(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_IPProtectionLevel");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "IPProtectionLevel", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName IPv6Only
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_IPv6Only() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_IPv6Only");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "IPv6Only"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName IPv6Only
void System::Net::Sockets::SocketOptionName::_set_IPv6Only(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_IPv6Only");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "IPv6Only", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName NoDelay
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_NoDelay() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_NoDelay");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "NoDelay"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName NoDelay
void System::Net::Sockets::SocketOptionName::_set_NoDelay(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_NoDelay");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "NoDelay", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName BsdUrgent
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_BsdUrgent() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_BsdUrgent");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "BsdUrgent"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName BsdUrgent
void System::Net::Sockets::SocketOptionName::_set_BsdUrgent(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_BsdUrgent");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "BsdUrgent", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName Expedited
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_Expedited() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_Expedited");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "Expedited"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName Expedited
void System::Net::Sockets::SocketOptionName::_set_Expedited(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_Expedited");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "Expedited", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName NoChecksum
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_NoChecksum() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_NoChecksum");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "NoChecksum"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName NoChecksum
void System::Net::Sockets::SocketOptionName::_set_NoChecksum(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_NoChecksum");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "NoChecksum", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName ChecksumCoverage
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_ChecksumCoverage() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_ChecksumCoverage");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "ChecksumCoverage"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName ChecksumCoverage
void System::Net::Sockets::SocketOptionName::_set_ChecksumCoverage(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_ChecksumCoverage");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "ChecksumCoverage", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName UpdateAcceptContext
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_UpdateAcceptContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_UpdateAcceptContext");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "UpdateAcceptContext"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName UpdateAcceptContext
void System::Net::Sockets::SocketOptionName::_set_UpdateAcceptContext(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_UpdateAcceptContext");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "UpdateAcceptContext", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOptionName UpdateConnectContext
::System::Net::Sockets::SocketOptionName System::Net::Sockets::SocketOptionName::_get_UpdateConnectContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_get_UpdateConnectContext");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOptionName>("System.Net.Sockets", "SocketOptionName", "UpdateConnectContext"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOptionName UpdateConnectContext
void System::Net::Sockets::SocketOptionName::_set_UpdateConnectContext(::System::Net::Sockets::SocketOptionName value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::_set_UpdateConnectContext");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOptionName", "UpdateConnectContext", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::SocketOptionName::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOptionName::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SocketShutdown
#include "System/Net/Sockets/SocketShutdown.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketShutdown Receive
::System::Net::Sockets::SocketShutdown System::Net::Sockets::SocketShutdown::_get_Receive() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketShutdown::_get_Receive");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketShutdown>("System.Net.Sockets", "SocketShutdown", "Receive"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketShutdown Receive
void System::Net::Sockets::SocketShutdown::_set_Receive(::System::Net::Sockets::SocketShutdown value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketShutdown::_set_Receive");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketShutdown", "Receive", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketShutdown Send
::System::Net::Sockets::SocketShutdown System::Net::Sockets::SocketShutdown::_get_Send() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketShutdown::_get_Send");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketShutdown>("System.Net.Sockets", "SocketShutdown", "Send"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketShutdown Send
void System::Net::Sockets::SocketShutdown::_set_Send(::System::Net::Sockets::SocketShutdown value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketShutdown::_set_Send");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketShutdown", "Send", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketShutdown Both
::System::Net::Sockets::SocketShutdown System::Net::Sockets::SocketShutdown::_get_Both() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketShutdown::_get_Both");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketShutdown>("System.Net.Sockets", "SocketShutdown", "Both"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketShutdown Both
void System::Net::Sockets::SocketShutdown::_set_Both(::System::Net::Sockets::SocketShutdown value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketShutdown::_set_Both");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketShutdown", "Both", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::SocketShutdown::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketShutdown::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SocketType
#include "System/Net/Sockets/SocketType.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketType Stream
::System::Net::Sockets::SocketType System::Net::Sockets::SocketType::_get_Stream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_get_Stream");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketType>("System.Net.Sockets", "SocketType", "Stream"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketType Stream
void System::Net::Sockets::SocketType::_set_Stream(::System::Net::Sockets::SocketType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_set_Stream");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketType", "Stream", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketType Dgram
::System::Net::Sockets::SocketType System::Net::Sockets::SocketType::_get_Dgram() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_get_Dgram");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketType>("System.Net.Sockets", "SocketType", "Dgram"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketType Dgram
void System::Net::Sockets::SocketType::_set_Dgram(::System::Net::Sockets::SocketType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_set_Dgram");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketType", "Dgram", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketType Raw
::System::Net::Sockets::SocketType System::Net::Sockets::SocketType::_get_Raw() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_get_Raw");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketType>("System.Net.Sockets", "SocketType", "Raw"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketType Raw
void System::Net::Sockets::SocketType::_set_Raw(::System::Net::Sockets::SocketType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_set_Raw");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketType", "Raw", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketType Rdm
::System::Net::Sockets::SocketType System::Net::Sockets::SocketType::_get_Rdm() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_get_Rdm");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketType>("System.Net.Sockets", "SocketType", "Rdm"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketType Rdm
void System::Net::Sockets::SocketType::_set_Rdm(::System::Net::Sockets::SocketType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_set_Rdm");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketType", "Rdm", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketType Seqpacket
::System::Net::Sockets::SocketType System::Net::Sockets::SocketType::_get_Seqpacket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_get_Seqpacket");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketType>("System.Net.Sockets", "SocketType", "Seqpacket"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketType Seqpacket
void System::Net::Sockets::SocketType::_set_Seqpacket(::System::Net::Sockets::SocketType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_set_Seqpacket");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketType", "Seqpacket", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketType Unknown
::System::Net::Sockets::SocketType System::Net::Sockets::SocketType::_get_Unknown() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_get_Unknown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketType>("System.Net.Sockets", "SocketType", "Unknown"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketType Unknown
void System::Net::Sockets::SocketType::_set_Unknown(::System::Net::Sockets::SocketType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::_set_Unknown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketType", "Unknown", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::SocketType::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketType::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Sockets.TcpClient
#include "System/Net/Sockets/TcpClient.hpp"
// Including type: System.Net.Sockets.Socket
#include "System/Net/Sockets/Socket.hpp"
// Including type: System.Net.Sockets.NetworkStream
#include "System/Net/Sockets/NetworkStream.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.Socket m_ClientSocket
::System::Net::Sockets::Socket*& System::Net::Sockets::TcpClient::dyn_m_ClientSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::dyn_m_ClientSocket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_ClientSocket"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_Active
bool& System::Net::Sockets::TcpClient::dyn_m_Active() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::dyn_m_Active");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Active"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.NetworkStream m_DataStream
::System::Net::Sockets::NetworkStream*& System::Net::Sockets::TcpClient::dyn_m_DataStream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::dyn_m_DataStream");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_DataStream"))->offset;
return *reinterpret_cast<::System::Net::Sockets::NetworkStream**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.AddressFamily m_Family
::System::Net::Sockets::AddressFamily& System::Net::Sockets::TcpClient::dyn_m_Family() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::dyn_m_Family");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Family"))->offset;
return *reinterpret_cast<::System::Net::Sockets::AddressFamily*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_CleanedUp
bool& System::Net::Sockets::TcpClient::dyn_m_CleanedUp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::dyn_m_CleanedUp");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_CleanedUp"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.TcpClient.get_Client
::System::Net::Sockets::Socket* System::Net::Sockets::TcpClient::get_Client() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::get_Client");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Client", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::Socket*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.TcpClient.set_Client
void System::Net::Sockets::TcpClient::set_Client(::System::Net::Sockets::Socket* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::set_Client");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Client", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.TcpClient.get_Connected
bool System::Net::Sockets::TcpClient::get_Connected() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::get_Connected");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Connected", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.TcpClient.BeginConnect
::System::IAsyncResult* System::Net::Sockets::TcpClient::BeginConnect(::StringW host, int port, ::System::AsyncCallback* requestCallback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::BeginConnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginConnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(host), ::il2cpp_utils::ExtractType(port), ::il2cpp_utils::ExtractType(requestCallback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, host, port, requestCallback, state);
}
// Autogenerated method: System.Net.Sockets.TcpClient.EndConnect
void System::Net::Sockets::TcpClient::EndConnect(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::EndConnect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndConnect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Sockets.TcpClient.GetStream
::System::Net::Sockets::NetworkStream* System::Net::Sockets::TcpClient::GetStream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::GetStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::NetworkStream*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.TcpClient.Close
void System::Net::Sockets::TcpClient::Close() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::Close");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Close", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.TcpClient.Dispose
void System::Net::Sockets::TcpClient::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.Net.Sockets.TcpClient.Dispose
void System::Net::Sockets::TcpClient::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.TcpClient.initialize
void System::Net::Sockets::TcpClient::initialize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::initialize");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "initialize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.TcpClient.Finalize
void System::Net::Sockets::TcpClient::Finalize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpClient::Finalize");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Finalize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Sockets.TcpListener
#include "System/Net/Sockets/TcpListener.hpp"
// Including type: System.Net.IPEndPoint
#include "System/Net/IPEndPoint.hpp"
// Including type: System.Net.Sockets.Socket
#include "System/Net/Sockets/Socket.hpp"
// Including type: System.Net.EndPoint
#include "System/Net/EndPoint.hpp"
// Including type: System.Net.IPAddress
#include "System/Net/IPAddress.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
// Including type: System.Net.Sockets.TcpClient
#include "System/Net/Sockets/TcpClient.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Net.IPEndPoint m_ServerSocketEP
::System::Net::IPEndPoint*& System::Net::Sockets::TcpListener::dyn_m_ServerSocketEP() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::dyn_m_ServerSocketEP");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_ServerSocketEP"))->offset;
return *reinterpret_cast<::System::Net::IPEndPoint**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.Socket m_ServerSocket
::System::Net::Sockets::Socket*& System::Net::Sockets::TcpListener::dyn_m_ServerSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::dyn_m_ServerSocket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_ServerSocket"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_Active
bool& System::Net::Sockets::TcpListener::dyn_m_Active() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::dyn_m_Active");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Active"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_ExclusiveAddressUse
bool& System::Net::Sockets::TcpListener::dyn_m_ExclusiveAddressUse() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::dyn_m_ExclusiveAddressUse");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_ExclusiveAddressUse"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.TcpListener.get_LocalEndpoint
::System::Net::EndPoint* System::Net::Sockets::TcpListener::get_LocalEndpoint() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::get_LocalEndpoint");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_LocalEndpoint", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::EndPoint*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.TcpListener.Start
void System::Net::Sockets::TcpListener::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.TcpListener.Start
void System::Net::Sockets::TcpListener::Start(int backlog) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(backlog)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, backlog);
}
// Autogenerated method: System.Net.Sockets.TcpListener.Stop
void System::Net::Sockets::TcpListener::Stop() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::Stop");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Stop", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.TcpListener.BeginAcceptTcpClient
::System::IAsyncResult* System::Net::Sockets::TcpListener::BeginAcceptTcpClient(::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::BeginAcceptTcpClient");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginAcceptTcpClient", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, callback, state);
}
// Autogenerated method: System.Net.Sockets.TcpListener.EndAcceptTcpClient
::System::Net::Sockets::TcpClient* System::Net::Sockets::TcpListener::EndAcceptTcpClient(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::TcpListener::EndAcceptTcpClient");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndAcceptTcpClient", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::TcpClient*, false>(this, ___internal__method, asyncResult);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.UdpClient
#include "System/Net/Sockets/UdpClient.hpp"
// Including type: System.Net.Sockets.Socket
#include "System/Net/Sockets/Socket.hpp"
// Including type: System.Net.IPAddress
#include "System/Net/IPAddress.hpp"
// Including type: System.Net.IPEndPoint
#include "System/Net/IPEndPoint.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Int32 MaxUDPSize
int System::Net::Sockets::UdpClient::_get_MaxUDPSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::_get_MaxUDPSize");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System.Net.Sockets", "UdpClient", "MaxUDPSize"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 MaxUDPSize
void System::Net::Sockets::UdpClient::_set_MaxUDPSize(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::_set_MaxUDPSize");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "UdpClient", "MaxUDPSize", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.Socket m_ClientSocket
::System::Net::Sockets::Socket*& System::Net::Sockets::UdpClient::dyn_m_ClientSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::dyn_m_ClientSocket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_ClientSocket"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_Active
bool& System::Net::Sockets::UdpClient::dyn_m_Active() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::dyn_m_Active");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Active"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Byte[] m_Buffer
::ArrayW<uint8_t>& System::Net::Sockets::UdpClient::dyn_m_Buffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::dyn_m_Buffer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Buffer"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.AddressFamily m_Family
::System::Net::Sockets::AddressFamily& System::Net::Sockets::UdpClient::dyn_m_Family() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::dyn_m_Family");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_Family"))->offset;
return *reinterpret_cast<::System::Net::Sockets::AddressFamily*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_CleanedUp
bool& System::Net::Sockets::UdpClient::dyn_m_CleanedUp() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::dyn_m_CleanedUp");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_CleanedUp"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean m_IsBroadcast
bool& System::Net::Sockets::UdpClient::dyn_m_IsBroadcast() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::dyn_m_IsBroadcast");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "m_IsBroadcast"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.UdpClient.get_Client
::System::Net::Sockets::Socket* System::Net::Sockets::UdpClient::get_Client() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::get_Client");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Client", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::Socket*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.UdpClient.set_Client
void System::Net::Sockets::UdpClient::set_Client(::System::Net::Sockets::Socket* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::set_Client");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Client", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.UdpClient.Close
void System::Net::Sockets::UdpClient::Close() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::Close");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Close", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.UdpClient.FreeResources
void System::Net::Sockets::UdpClient::FreeResources() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::FreeResources");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FreeResources", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.UdpClient.Dispose
void System::Net::Sockets::UdpClient::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.UdpClient.Dispose
void System::Net::Sockets::UdpClient::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.Net.Sockets.UdpClient.Connect
void System::Net::Sockets::UdpClient::Connect(::System::Net::IPAddress* addr, int port) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::Connect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Connect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(addr), ::il2cpp_utils::ExtractType(port)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, addr, port);
}
// Autogenerated method: System.Net.Sockets.UdpClient.Connect
void System::Net::Sockets::UdpClient::Connect(::System::Net::IPEndPoint* endPoint) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::Connect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Connect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(endPoint)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, endPoint);
}
// Autogenerated method: System.Net.Sockets.UdpClient.CheckForBroadcast
void System::Net::Sockets::UdpClient::CheckForBroadcast(::System::Net::IPAddress* ipAddress) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::CheckForBroadcast");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CheckForBroadcast", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ipAddress)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, ipAddress);
}
// Autogenerated method: System.Net.Sockets.UdpClient.Send
int System::Net::Sockets::UdpClient::Send(::ArrayW<uint8_t> dgram, int bytes) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::Send");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Send", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(dgram), ::il2cpp_utils::ExtractType(bytes)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, dgram, bytes);
}
// Autogenerated method: System.Net.Sockets.UdpClient.Receive
::ArrayW<uint8_t> System::Net::Sockets::UdpClient::Receive(ByRef<::System::Net::IPEndPoint*> remoteEP) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::Receive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Receive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(remoteEP)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(this, ___internal__method, byref(remoteEP));
}
// Autogenerated method: System.Net.Sockets.UdpClient.createClientSocket
void System::Net::Sockets::UdpClient::createClientSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::UdpClient::createClientSocket");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "createClientSocket", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SafeSocketHandle
#include "System/Net/Sockets/SafeSocketHandle.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: System.Threading.Thread
#include "System/Threading/Thread.hpp"
// Including type: System.Collections.Generic.Dictionary`2
#include "System/Collections/Generic/Dictionary_2.hpp"
// Including type: System.Diagnostics.StackTrace
#include "System/Diagnostics/StackTrace.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Int32 SOCKET_CLOSED
int System::Net::Sockets::SafeSocketHandle::_get_SOCKET_CLOSED() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::_get_SOCKET_CLOSED");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System.Net.Sockets", "SafeSocketHandle", "SOCKET_CLOSED"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 SOCKET_CLOSED
void System::Net::Sockets::SafeSocketHandle::_set_SOCKET_CLOSED(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::_set_SOCKET_CLOSED");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SafeSocketHandle", "SOCKET_CLOSED", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 ABORT_RETRIES
int System::Net::Sockets::SafeSocketHandle::_get_ABORT_RETRIES() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::_get_ABORT_RETRIES");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("System.Net.Sockets", "SafeSocketHandle", "ABORT_RETRIES"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 ABORT_RETRIES
void System::Net::Sockets::SafeSocketHandle::_set_ABORT_RETRIES(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::_set_ABORT_RETRIES");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SafeSocketHandle", "ABORT_RETRIES", value));
}
// Autogenerated static field getter
// Get static field: static private System.Boolean THROW_ON_ABORT_RETRIES
bool System::Net::Sockets::SafeSocketHandle::_get_THROW_ON_ABORT_RETRIES() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::_get_THROW_ON_ABORT_RETRIES");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System.Net.Sockets", "SafeSocketHandle", "THROW_ON_ABORT_RETRIES"));
}
// Autogenerated static field setter
// Set static field: static private System.Boolean THROW_ON_ABORT_RETRIES
void System::Net::Sockets::SafeSocketHandle::_set_THROW_ON_ABORT_RETRIES(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::_set_THROW_ON_ABORT_RETRIES");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SafeSocketHandle", "THROW_ON_ABORT_RETRIES", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.Threading.Thread> blocking_threads
::System::Collections::Generic::List_1<::System::Threading::Thread*>*& System::Net::Sockets::SafeSocketHandle::dyn_blocking_threads() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::dyn_blocking_threads");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "blocking_threads"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::System::Threading::Thread*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Dictionary`2<System.Threading.Thread,System.Diagnostics.StackTrace> threads_stacktraces
::System::Collections::Generic::Dictionary_2<::System::Threading::Thread*, ::System::Diagnostics::StackTrace*>*& System::Net::Sockets::SafeSocketHandle::dyn_threads_stacktraces() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::dyn_threads_stacktraces");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "threads_stacktraces"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::System::Threading::Thread*, ::System::Diagnostics::StackTrace*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean in_cleanup
bool& System::Net::Sockets::SafeSocketHandle::dyn_in_cleanup() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::dyn_in_cleanup");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "in_cleanup"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.SafeSocketHandle..cctor
void System::Net::Sockets::SafeSocketHandle::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "SafeSocketHandle", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SafeSocketHandle.RegisterForBlockingSyscall
void System::Net::Sockets::SafeSocketHandle::RegisterForBlockingSyscall() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::RegisterForBlockingSyscall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RegisterForBlockingSyscall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SafeSocketHandle.UnRegisterForBlockingSyscall
void System::Net::Sockets::SafeSocketHandle::UnRegisterForBlockingSyscall() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::UnRegisterForBlockingSyscall");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UnRegisterForBlockingSyscall", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SafeSocketHandle.ReleaseHandle
bool System::Net::Sockets::SafeSocketHandle::ReleaseHandle() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SafeSocketHandle::ReleaseHandle");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReleaseHandle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SocketAsyncEventArgs
#include "System/Net/Sockets/SocketAsyncEventArgs.hpp"
// Including type: System.Net.EndPoint
#include "System/Net/EndPoint.hpp"
// Including type: System.Net.Sockets.Socket
#include "System/Net/Sockets/Socket.hpp"
// Including type: System.EventHandler`1
#include "System/EventHandler_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Boolean disposed
bool& System::Net::Sockets::SocketAsyncEventArgs::dyn_disposed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::dyn_disposed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "disposed"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Int32 in_progress
int& System::Net::Sockets::SocketAsyncEventArgs::dyn_in_progress() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::dyn_in_progress");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "in_progress"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Net.EndPoint remote_ep
::System::Net::EndPoint*& System::Net::Sockets::SocketAsyncEventArgs::dyn_remote_ep() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::dyn_remote_ep");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "remote_ep"))->offset;
return *reinterpret_cast<::System::Net::EndPoint**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Net.Sockets.Socket current_socket
::System::Net::Sockets::Socket*& System::Net::Sockets::SocketAsyncEventArgs::dyn_current_socket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::dyn_current_socket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "current_socket"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.Socket <AcceptSocket>k__BackingField
::System::Net::Sockets::Socket*& System::Net::Sockets::SocketAsyncEventArgs::dyn_$AcceptSocket$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::dyn_$AcceptSocket$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<AcceptSocket>k__BackingField"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <BytesTransferred>k__BackingField
int& System::Net::Sockets::SocketAsyncEventArgs::dyn_$BytesTransferred$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::dyn_$BytesTransferred$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<BytesTransferred>k__BackingField"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Net.Sockets.SocketError <SocketError>k__BackingField
::System::Net::Sockets::SocketError& System::Net::Sockets::SocketAsyncEventArgs::dyn_$SocketError$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::dyn_$SocketError$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<SocketError>k__BackingField"))->offset;
return *reinterpret_cast<::System::Net::Sockets::SocketError*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.EventHandler`1<System.Net.Sockets.SocketAsyncEventArgs> Completed
::System::EventHandler_1<::System::Net::Sockets::SocketAsyncEventArgs*>*& System::Net::Sockets::SocketAsyncEventArgs::dyn_Completed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::dyn_Completed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Completed"))->offset;
return *reinterpret_cast<::System::EventHandler_1<::System::Net::Sockets::SocketAsyncEventArgs*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncEventArgs.get_AcceptSocket
::System::Net::Sockets::Socket* System::Net::Sockets::SocketAsyncEventArgs::get_AcceptSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::get_AcceptSocket");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AcceptSocket", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::Socket*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncEventArgs.set_AcceptSocket
void System::Net::Sockets::SocketAsyncEventArgs::set_AcceptSocket(::System::Net::Sockets::Socket* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::set_AcceptSocket");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_AcceptSocket", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncEventArgs.set_BytesTransferred
void System::Net::Sockets::SocketAsyncEventArgs::set_BytesTransferred(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::set_BytesTransferred");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_BytesTransferred", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncEventArgs.set_SocketError
void System::Net::Sockets::SocketAsyncEventArgs::set_SocketError(::System::Net::Sockets::SocketError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::set_SocketError");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_SocketError", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncEventArgs.Dispose
void System::Net::Sockets::SocketAsyncEventArgs::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::Dispose");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncEventArgs.Dispose
void System::Net::Sockets::SocketAsyncEventArgs::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncEventArgs.Complete
void System::Net::Sockets::SocketAsyncEventArgs::Complete() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::Complete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Complete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncEventArgs.OnCompleted
void System::Net::Sockets::SocketAsyncEventArgs::OnCompleted(::System::Net::Sockets::SocketAsyncEventArgs* e) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncEventArgs::OnCompleted");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnCompleted", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(e)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, e);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Sockets.SocketAsyncResult
#include "System/Net/Sockets/SocketAsyncResult.hpp"
// Including type: System.Net.Sockets.SocketAsyncResult/System.Net.Sockets.<>c
#include "System/Net/Sockets/SocketAsyncResult_--c.hpp"
// Including type: System.Net.Sockets.Socket
#include "System/Net/Sockets/Socket.hpp"
// Including type: System.Exception
#include "System/Exception.hpp"
// Including type: System.Net.EndPoint
#include "System/Net/EndPoint.hpp"
// Including type: System.Net.IPAddress
#include "System/Net/IPAddress.hpp"
// Including type: System.Collections.Generic.IList`1
#include "System/Collections/Generic/IList_1.hpp"
// Including type: System.IntPtr
#include "System/IntPtr.hpp"
// Including type: System.Net.Sockets.SocketError
#include "System/Net/Sockets/SocketError.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.Net.Sockets.Socket socket
::System::Net::Sockets::Socket*& System::Net::Sockets::SocketAsyncResult::dyn_socket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_socket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "socket"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Net.Sockets.SocketOperation operation
::System::Net::Sockets::SocketOperation& System::Net::Sockets::SocketAsyncResult::dyn_operation() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_operation");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "operation"))->offset;
return *reinterpret_cast<::System::Net::Sockets::SocketOperation*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Exception DelayedException
::System::Exception*& System::Net::Sockets::SocketAsyncResult::dyn_DelayedException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_DelayedException");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "DelayedException"))->offset;
return *reinterpret_cast<::System::Exception**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Net.EndPoint EndPoint
::System::Net::EndPoint*& System::Net::Sockets::SocketAsyncResult::dyn_EndPoint() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_EndPoint");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "EndPoint"))->offset;
return *reinterpret_cast<::System::Net::EndPoint**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Byte[] Buffer
::ArrayW<uint8_t>& System::Net::Sockets::SocketAsyncResult::dyn_Buffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_Buffer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Buffer"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 Offset
int& System::Net::Sockets::SocketAsyncResult::dyn_Offset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_Offset");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Offset"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 Size
int& System::Net::Sockets::SocketAsyncResult::dyn_Size() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_Size");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Size"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Net.Sockets.SocketFlags SockFlags
::System::Net::Sockets::SocketFlags& System::Net::Sockets::SocketAsyncResult::dyn_SockFlags() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_SockFlags");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "SockFlags"))->offset;
return *reinterpret_cast<::System::Net::Sockets::SocketFlags*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Net.Sockets.Socket AcceptSocket
::System::Net::Sockets::Socket*& System::Net::Sockets::SocketAsyncResult::dyn_AcceptSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_AcceptSocket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "AcceptSocket"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Net.IPAddress[] Addresses
::ArrayW<::System::Net::IPAddress*>& System::Net::Sockets::SocketAsyncResult::dyn_Addresses() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_Addresses");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Addresses"))->offset;
return *reinterpret_cast<::ArrayW<::System::Net::IPAddress*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 Port
int& System::Net::Sockets::SocketAsyncResult::dyn_Port() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_Port");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Port"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Collections.Generic.IList`1<System.ArraySegment`1<System.Byte>> Buffers
::System::Collections::Generic::IList_1<::System::ArraySegment_1<uint8_t>>*& System::Net::Sockets::SocketAsyncResult::dyn_Buffers() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_Buffers");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Buffers"))->offset;
return *reinterpret_cast<::System::Collections::Generic::IList_1<::System::ArraySegment_1<uint8_t>>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Boolean ReuseSocket
bool& System::Net::Sockets::SocketAsyncResult::dyn_ReuseSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_ReuseSocket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ReuseSocket"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 CurrentAddress
int& System::Net::Sockets::SocketAsyncResult::dyn_CurrentAddress() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_CurrentAddress");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "CurrentAddress"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Net.Sockets.Socket AcceptedSocket
::System::Net::Sockets::Socket*& System::Net::Sockets::SocketAsyncResult::dyn_AcceptedSocket() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_AcceptedSocket");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "AcceptedSocket"))->offset;
return *reinterpret_cast<::System::Net::Sockets::Socket**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 Total
int& System::Net::Sockets::SocketAsyncResult::dyn_Total() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_Total");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Total"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: System.Int32 error
int& System::Net::Sockets::SocketAsyncResult::dyn_error() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_error");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "error"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 EndCalled
int& System::Net::Sockets::SocketAsyncResult::dyn_EndCalled() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::dyn_EndCalled");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "EndCalled"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.get_Handle
::System::IntPtr System::Net::Sockets::SocketAsyncResult::get_Handle() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::get_Handle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Handle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.get_ErrorCode
::System::Net::Sockets::SocketError System::Net::Sockets::SocketAsyncResult::get_ErrorCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::get_ErrorCode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ErrorCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Sockets::SocketError, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException
void System::Net::Sockets::SocketAsyncResult::CheckIfThrowDelayedException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::CheckIfThrowDelayedException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CheckIfThrowDelayedException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.Complete
void System::Net::Sockets::SocketAsyncResult::Complete() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::Complete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Complete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.Complete
void System::Net::Sockets::SocketAsyncResult::Complete(bool synch) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::Complete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Complete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(synch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, synch);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.Complete
void System::Net::Sockets::SocketAsyncResult::Complete(int total) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::Complete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Complete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(total)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, total);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.Complete
void System::Net::Sockets::SocketAsyncResult::Complete(::System::Exception* e, bool synch) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::Complete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Complete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(e), ::il2cpp_utils::ExtractType(synch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, e, synch);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.Complete
void System::Net::Sockets::SocketAsyncResult::Complete(::System::Exception* e) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::Complete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Complete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(e)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, e);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.Complete
void System::Net::Sockets::SocketAsyncResult::Complete(::System::Net::Sockets::Socket* s) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::Complete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Complete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, s);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.Complete
void System::Net::Sockets::SocketAsyncResult::Complete(::System::Net::Sockets::Socket* s, int total) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::Complete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Complete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(total)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, s, total);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult.CompleteDisposed
void System::Net::Sockets::SocketAsyncResult::CompleteDisposed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::CompleteDisposed");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CompleteDisposed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Sockets.SocketAsyncResult/System.Net.Sockets.<>c
#include "System/Net/Sockets/SocketAsyncResult_--c.hpp"
// Including type: System.Threading.WaitCallback
#include "System/Threading/WaitCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.Net.Sockets.SocketAsyncResult/System.Net.Sockets.<>c <>9
::System::Net::Sockets::SocketAsyncResult::$$c* System::Net::Sockets::SocketAsyncResult::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketAsyncResult::$$c*>("System.Net.Sockets", "SocketAsyncResult/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Net.Sockets.SocketAsyncResult/System.Net.Sockets.<>c <>9
void System::Net::Sockets::SocketAsyncResult::$$c::_set_$$9(::System::Net::Sockets::SocketAsyncResult::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketAsyncResult/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Threading.WaitCallback <>9__27_0
::System::Threading::WaitCallback* System::Net::Sockets::SocketAsyncResult::$$c::_get_$$9__27_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::$$c::_get_$$9__27_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Threading::WaitCallback*>("System.Net.Sockets", "SocketAsyncResult/<>c", "<>9__27_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Threading.WaitCallback <>9__27_0
void System::Net::Sockets::SocketAsyncResult::$$c::_set_$$9__27_0(::System::Threading::WaitCallback* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::$$c::_set_$$9__27_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketAsyncResult/<>c", "<>9__27_0", value)));
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult/System.Net.Sockets.<>c..cctor
void System::Net::Sockets::SocketAsyncResult::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "SocketAsyncResult/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SocketAsyncResult/System.Net.Sockets.<>c.<Complete>b__27_0
void System::Net::Sockets::SocketAsyncResult::$$c::$Complete$b__27_0(::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketAsyncResult::$$c::<Complete>b__27_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Complete>b__27_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(state)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, state);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SocketOperation
#include "System/Net/Sockets/SocketOperation.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation Accept
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_Accept() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_Accept");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "Accept"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation Accept
void System::Net::Sockets::SocketOperation::_set_Accept(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_Accept");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "Accept", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation Connect
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_Connect() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_Connect");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "Connect"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation Connect
void System::Net::Sockets::SocketOperation::_set_Connect(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_Connect");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "Connect", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation Receive
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_Receive() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_Receive");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "Receive"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation Receive
void System::Net::Sockets::SocketOperation::_set_Receive(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_Receive");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "Receive", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation ReceiveFrom
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_ReceiveFrom() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_ReceiveFrom");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "ReceiveFrom"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation ReceiveFrom
void System::Net::Sockets::SocketOperation::_set_ReceiveFrom(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_ReceiveFrom");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "ReceiveFrom", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation Send
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_Send() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_Send");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "Send"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation Send
void System::Net::Sockets::SocketOperation::_set_Send(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_Send");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "Send", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation SendTo
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_SendTo() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_SendTo");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "SendTo"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation SendTo
void System::Net::Sockets::SocketOperation::_set_SendTo(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_SendTo");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "SendTo", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation RecvJustCallback
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_RecvJustCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_RecvJustCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "RecvJustCallback"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation RecvJustCallback
void System::Net::Sockets::SocketOperation::_set_RecvJustCallback(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_RecvJustCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "RecvJustCallback", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation SendJustCallback
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_SendJustCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_SendJustCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "SendJustCallback"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation SendJustCallback
void System::Net::Sockets::SocketOperation::_set_SendJustCallback(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_SendJustCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "SendJustCallback", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation Disconnect
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_Disconnect() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_Disconnect");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "Disconnect"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation Disconnect
void System::Net::Sockets::SocketOperation::_set_Disconnect(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_Disconnect");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "Disconnect", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation AcceptReceive
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_AcceptReceive() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_AcceptReceive");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "AcceptReceive"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation AcceptReceive
void System::Net::Sockets::SocketOperation::_set_AcceptReceive(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_AcceptReceive");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "AcceptReceive", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation ReceiveGeneric
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_ReceiveGeneric() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_ReceiveGeneric");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "ReceiveGeneric"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation ReceiveGeneric
void System::Net::Sockets::SocketOperation::_set_ReceiveGeneric(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_ReceiveGeneric");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "ReceiveGeneric", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Sockets.SocketOperation SendGeneric
::System::Net::Sockets::SocketOperation System::Net::Sockets::SocketOperation::_get_SendGeneric() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_get_SendGeneric");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketOperation>("System.Net.Sockets", "SocketOperation", "SendGeneric"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Sockets.SocketOperation SendGeneric
void System::Net::Sockets::SocketOperation::_set_SendGeneric(::System::Net::Sockets::SocketOperation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::_set_SendGeneric");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketOperation", "SendGeneric", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Sockets::SocketOperation::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketOperation::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Sockets.SocketTaskExtensions
#include "System/Net/Sockets/SocketTaskExtensions.hpp"
// Including type: System.Net.Sockets.SocketTaskExtensions/System.Net.Sockets.<>c
#include "System/Net/Sockets/SocketTaskExtensions_--c.hpp"
// Including type: System.Threading.Tasks.Task
#include "System/Threading/Tasks/Task.hpp"
// Including type: System.Net.Sockets.Socket
#include "System/Net/Sockets/Socket.hpp"
// Including type: System.Net.EndPoint
#include "System/Net/EndPoint.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Sockets.SocketTaskExtensions.ConnectAsync
::System::Threading::Tasks::Task* System::Net::Sockets::SocketTaskExtensions::ConnectAsync(::System::Net::Sockets::Socket* socket, ::System::Net::EndPoint* remoteEP) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::ConnectAsync");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "SocketTaskExtensions", "ConnectAsync", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(socket), ::il2cpp_utils::ExtractType(remoteEP)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, socket, remoteEP);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Sockets.SocketTaskExtensions/System.Net.Sockets.<>c
#include "System/Net/Sockets/SocketTaskExtensions_--c.hpp"
// Including type: System.Func`4
#include "System/Func_4.hpp"
// Including type: System.Net.EndPoint
#include "System/Net/EndPoint.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.Action`1
#include "System/Action_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly System.Net.Sockets.SocketTaskExtensions/System.Net.Sockets.<>c <>9
::System::Net::Sockets::SocketTaskExtensions::$$c* System::Net::Sockets::SocketTaskExtensions::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Net::Sockets::SocketTaskExtensions::$$c*>("System.Net.Sockets", "SocketTaskExtensions/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Net.Sockets.SocketTaskExtensions/System.Net.Sockets.<>c <>9
void System::Net::Sockets::SocketTaskExtensions::$$c::_set_$$9(::System::Net::Sockets::SocketTaskExtensions::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketTaskExtensions/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`4<System.Net.EndPoint,System.AsyncCallback,System.Object,System.IAsyncResult> <>9__2_0
::System::Func_4<::System::Net::EndPoint*, ::System::AsyncCallback*, ::Il2CppObject*, ::System::IAsyncResult*>* System::Net::Sockets::SocketTaskExtensions::$$c::_get_$$9__2_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::$$c::_get_$$9__2_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_4<::System::Net::EndPoint*, ::System::AsyncCallback*, ::Il2CppObject*, ::System::IAsyncResult*>*>("System.Net.Sockets", "SocketTaskExtensions/<>c", "<>9__2_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`4<System.Net.EndPoint,System.AsyncCallback,System.Object,System.IAsyncResult> <>9__2_0
void System::Net::Sockets::SocketTaskExtensions::$$c::_set_$$9__2_0(::System::Func_4<::System::Net::EndPoint*, ::System::AsyncCallback*, ::Il2CppObject*, ::System::IAsyncResult*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::$$c::_set_$$9__2_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketTaskExtensions/<>c", "<>9__2_0", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Action`1<System.IAsyncResult> <>9__2_1
::System::Action_1<::System::IAsyncResult*>* System::Net::Sockets::SocketTaskExtensions::$$c::_get_$$9__2_1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::$$c::_get_$$9__2_1");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Action_1<::System::IAsyncResult*>*>("System.Net.Sockets", "SocketTaskExtensions/<>c", "<>9__2_1")));
}
// Autogenerated static field setter
// Set static field: static public System.Action`1<System.IAsyncResult> <>9__2_1
void System::Net::Sockets::SocketTaskExtensions::$$c::_set_$$9__2_1(::System::Action_1<::System::IAsyncResult*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::$$c::_set_$$9__2_1");
THROW_UNLESS((il2cpp_utils::SetFieldValue("System.Net.Sockets", "SocketTaskExtensions/<>c", "<>9__2_1", value)));
}
// Autogenerated method: System.Net.Sockets.SocketTaskExtensions/System.Net.Sockets.<>c..cctor
void System::Net::Sockets::SocketTaskExtensions::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Sockets", "SocketTaskExtensions/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Sockets.SocketTaskExtensions/System.Net.Sockets.<>c.<ConnectAsync>b__2_0
::System::IAsyncResult* System::Net::Sockets::SocketTaskExtensions::$$c::$ConnectAsync$b__2_0(::System::Net::EndPoint* targetEndPoint, ::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::$$c::<ConnectAsync>b__2_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<ConnectAsync>b__2_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(targetEndPoint), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, targetEndPoint, callback, state);
}
// Autogenerated method: System.Net.Sockets.SocketTaskExtensions/System.Net.Sockets.<>c.<ConnectAsync>b__2_1
void System::Net::Sockets::SocketTaskExtensions::$$c::$ConnectAsync$b__2_1(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Sockets::SocketTaskExtensions::$$c::<ConnectAsync>b__2_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<ConnectAsync>b__2_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, asyncResult);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Security.AuthenticatedStream
#include "System/Net/Security/AuthenticatedStream.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.IO.Stream _InnerStream
::System::IO::Stream*& System::Net::Security::AuthenticatedStream::dyn__InnerStream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticatedStream::dyn__InnerStream");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_InnerStream"))->offset;
return *reinterpret_cast<::System::IO::Stream**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _LeaveStreamOpen
bool& System::Net::Security::AuthenticatedStream::dyn__LeaveStreamOpen() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticatedStream::dyn__LeaveStreamOpen");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_LeaveStreamOpen"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Security.AuthenticatedStream.get_InnerStream
::System::IO::Stream* System::Net::Security::AuthenticatedStream::get_InnerStream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticatedStream::get_InnerStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InnerStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Stream*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.AuthenticatedStream.get_IsAuthenticated
bool System::Net::Security::AuthenticatedStream::get_IsAuthenticated() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticatedStream::get_IsAuthenticated");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsAuthenticated", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.AuthenticatedStream.Dispose
void System::Net::Security::AuthenticatedStream::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticatedStream::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Security.AuthenticationLevel
#include "System/Net/Security/AuthenticationLevel.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Security.AuthenticationLevel None
::System::Net::Security::AuthenticationLevel System::Net::Security::AuthenticationLevel::_get_None() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticationLevel::_get_None");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Security::AuthenticationLevel>("System.Net.Security", "AuthenticationLevel", "None"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Security.AuthenticationLevel None
void System::Net::Security::AuthenticationLevel::_set_None(::System::Net::Security::AuthenticationLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticationLevel::_set_None");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Security", "AuthenticationLevel", "None", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Security.AuthenticationLevel MutualAuthRequested
::System::Net::Security::AuthenticationLevel System::Net::Security::AuthenticationLevel::_get_MutualAuthRequested() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticationLevel::_get_MutualAuthRequested");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Security::AuthenticationLevel>("System.Net.Security", "AuthenticationLevel", "MutualAuthRequested"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Security.AuthenticationLevel MutualAuthRequested
void System::Net::Security::AuthenticationLevel::_set_MutualAuthRequested(::System::Net::Security::AuthenticationLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticationLevel::_set_MutualAuthRequested");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Security", "AuthenticationLevel", "MutualAuthRequested", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Security.AuthenticationLevel MutualAuthRequired
::System::Net::Security::AuthenticationLevel System::Net::Security::AuthenticationLevel::_get_MutualAuthRequired() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticationLevel::_get_MutualAuthRequired");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Security::AuthenticationLevel>("System.Net.Security", "AuthenticationLevel", "MutualAuthRequired"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Security.AuthenticationLevel MutualAuthRequired
void System::Net::Security::AuthenticationLevel::_set_MutualAuthRequired(::System::Net::Security::AuthenticationLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticationLevel::_set_MutualAuthRequired");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Security", "AuthenticationLevel", "MutualAuthRequired", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Security::AuthenticationLevel::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::AuthenticationLevel::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Security.RemoteCertificateValidationCallback
#include "System/Net/Security/RemoteCertificateValidationCallback.hpp"
// Including type: System.Security.Cryptography.X509Certificates.X509Certificate
#include "System/Security/Cryptography/X509Certificates/X509Certificate.hpp"
// Including type: System.Security.Cryptography.X509Certificates.X509Chain
#include "System/Security/Cryptography/X509Certificates/X509Chain.hpp"
// Including type: System.Net.Security.SslPolicyErrors
#include "System/Net/Security/SslPolicyErrors.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Security.RemoteCertificateValidationCallback.Invoke
bool System::Net::Security::RemoteCertificateValidationCallback::Invoke(::Il2CppObject* sender, ::System::Security::Cryptography::X509Certificates::X509Certificate* certificate, ::System::Security::Cryptography::X509Certificates::X509Chain* chain, ::System::Net::Security::SslPolicyErrors sslPolicyErrors) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::RemoteCertificateValidationCallback::Invoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sender), ::il2cpp_utils::ExtractType(certificate), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(sslPolicyErrors)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, sender, certificate, chain, sslPolicyErrors);
}
// Autogenerated method: System.Net.Security.RemoteCertificateValidationCallback.BeginInvoke
::System::IAsyncResult* System::Net::Security::RemoteCertificateValidationCallback::BeginInvoke(::Il2CppObject* sender, ::System::Security::Cryptography::X509Certificates::X509Certificate* certificate, ::System::Security::Cryptography::X509Certificates::X509Chain* chain, ::System::Net::Security::SslPolicyErrors sslPolicyErrors, ::System::AsyncCallback* callback, ::Il2CppObject* object) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::RemoteCertificateValidationCallback::BeginInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sender), ::il2cpp_utils::ExtractType(certificate), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(sslPolicyErrors), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, sender, certificate, chain, sslPolicyErrors, callback, object);
}
// Autogenerated method: System.Net.Security.RemoteCertificateValidationCallback.EndInvoke
bool System::Net::Security::RemoteCertificateValidationCallback::EndInvoke(::System::IAsyncResult* result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::RemoteCertificateValidationCallback::EndInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(result)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, result);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Security.SslPolicyErrors
#include "System/Net/Security/SslPolicyErrors.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Security.SslPolicyErrors None
::System::Net::Security::SslPolicyErrors System::Net::Security::SslPolicyErrors::_get_None() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslPolicyErrors::_get_None");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Security::SslPolicyErrors>("System.Net.Security", "SslPolicyErrors", "None"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Security.SslPolicyErrors None
void System::Net::Security::SslPolicyErrors::_set_None(::System::Net::Security::SslPolicyErrors value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslPolicyErrors::_set_None");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Security", "SslPolicyErrors", "None", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Security.SslPolicyErrors RemoteCertificateNotAvailable
::System::Net::Security::SslPolicyErrors System::Net::Security::SslPolicyErrors::_get_RemoteCertificateNotAvailable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslPolicyErrors::_get_RemoteCertificateNotAvailable");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Security::SslPolicyErrors>("System.Net.Security", "SslPolicyErrors", "RemoteCertificateNotAvailable"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Security.SslPolicyErrors RemoteCertificateNotAvailable
void System::Net::Security::SslPolicyErrors::_set_RemoteCertificateNotAvailable(::System::Net::Security::SslPolicyErrors value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslPolicyErrors::_set_RemoteCertificateNotAvailable");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Security", "SslPolicyErrors", "RemoteCertificateNotAvailable", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Security.SslPolicyErrors RemoteCertificateNameMismatch
::System::Net::Security::SslPolicyErrors System::Net::Security::SslPolicyErrors::_get_RemoteCertificateNameMismatch() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslPolicyErrors::_get_RemoteCertificateNameMismatch");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Security::SslPolicyErrors>("System.Net.Security", "SslPolicyErrors", "RemoteCertificateNameMismatch"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Security.SslPolicyErrors RemoteCertificateNameMismatch
void System::Net::Security::SslPolicyErrors::_set_RemoteCertificateNameMismatch(::System::Net::Security::SslPolicyErrors value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslPolicyErrors::_set_RemoteCertificateNameMismatch");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Security", "SslPolicyErrors", "RemoteCertificateNameMismatch", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Security.SslPolicyErrors RemoteCertificateChainErrors
::System::Net::Security::SslPolicyErrors System::Net::Security::SslPolicyErrors::_get_RemoteCertificateChainErrors() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslPolicyErrors::_get_RemoteCertificateChainErrors");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Security::SslPolicyErrors>("System.Net.Security", "SslPolicyErrors", "RemoteCertificateChainErrors"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Security.SslPolicyErrors RemoteCertificateChainErrors
void System::Net::Security::SslPolicyErrors::_set_RemoteCertificateChainErrors(::System::Net::Security::SslPolicyErrors value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslPolicyErrors::_set_RemoteCertificateChainErrors");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Security", "SslPolicyErrors", "RemoteCertificateChainErrors", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Security::SslPolicyErrors::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslPolicyErrors::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Security.LocalCertSelectionCallback
#include "System/Net/Security/LocalCertSelectionCallback.hpp"
// Including type: System.Security.Cryptography.X509Certificates.X509Certificate
#include "System/Security/Cryptography/X509Certificates/X509Certificate.hpp"
// Including type: System.Security.Cryptography.X509Certificates.X509CertificateCollection
#include "System/Security/Cryptography/X509Certificates/X509CertificateCollection.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Security.LocalCertSelectionCallback.Invoke
::System::Security::Cryptography::X509Certificates::X509Certificate* System::Net::Security::LocalCertSelectionCallback::Invoke(::StringW targetHost, ::System::Security::Cryptography::X509Certificates::X509CertificateCollection* localCertificates, ::System::Security::Cryptography::X509Certificates::X509Certificate* remoteCertificate, ::ArrayW<::StringW> acceptableIssuers) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::LocalCertSelectionCallback::Invoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(targetHost), ::il2cpp_utils::ExtractType(localCertificates), ::il2cpp_utils::ExtractType(remoteCertificate), ::il2cpp_utils::ExtractType(acceptableIssuers)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Security::Cryptography::X509Certificates::X509Certificate*, false>(this, ___internal__method, targetHost, localCertificates, remoteCertificate, acceptableIssuers);
}
// Autogenerated method: System.Net.Security.LocalCertSelectionCallback.BeginInvoke
::System::IAsyncResult* System::Net::Security::LocalCertSelectionCallback::BeginInvoke(::StringW targetHost, ::System::Security::Cryptography::X509Certificates::X509CertificateCollection* localCertificates, ::System::Security::Cryptography::X509Certificates::X509Certificate* remoteCertificate, ::ArrayW<::StringW> acceptableIssuers, ::System::AsyncCallback* callback, ::Il2CppObject* object) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::LocalCertSelectionCallback::BeginInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(targetHost), ::il2cpp_utils::ExtractType(localCertificates), ::il2cpp_utils::ExtractType(remoteCertificate), ::il2cpp_utils::ExtractType(acceptableIssuers), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, targetHost, localCertificates, remoteCertificate, acceptableIssuers, callback, object);
}
// Autogenerated method: System.Net.Security.LocalCertSelectionCallback.EndInvoke
::System::Security::Cryptography::X509Certificates::X509Certificate* System::Net::Security::LocalCertSelectionCallback::EndInvoke(::System::IAsyncResult* result) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::LocalCertSelectionCallback::EndInvoke");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(result)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Security::Cryptography::X509Certificates::X509Certificate*, false>(this, ___internal__method, result);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Security.SslStream
#include "System/Net/Security/SslStream.hpp"
// Including type: Mono.Security.Interface.MonoTlsProvider
#include "Mono/Security/Interface/MonoTlsProvider.hpp"
// Including type: Mono.Security.Interface.IMonoSslStream
#include "Mono/Security/Interface/IMonoSslStream.hpp"
// Including type: System.IO.Stream
#include "System/IO/Stream.hpp"
// Including type: Mono.Security.Interface.MonoTlsSettings
#include "Mono/Security/Interface/MonoTlsSettings.hpp"
// Including type: System.IO.SeekOrigin
#include "System/IO/SeekOrigin.hpp"
// Including type: System.Threading.Tasks.Task
#include "System/Threading/Tasks/Task.hpp"
// Including type: System.Threading.CancellationToken
#include "System/Threading/CancellationToken.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private Mono.Security.Interface.MonoTlsProvider provider
::Mono::Security::Interface::MonoTlsProvider*& System::Net::Security::SslStream::dyn_provider() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::dyn_provider");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "provider"))->offset;
return *reinterpret_cast<::Mono::Security::Interface::MonoTlsProvider**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Mono.Security.Interface.IMonoSslStream impl
::Mono::Security::Interface::IMonoSslStream*& System::Net::Security::SslStream::dyn_impl() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::dyn_impl");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "impl"))->offset;
return *reinterpret_cast<::Mono::Security::Interface::IMonoSslStream**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Security.SslStream.get_Impl
::Mono::Security::Interface::IMonoSslStream* System::Net::Security::SslStream::get_Impl() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::get_Impl");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Impl", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Mono::Security::Interface::IMonoSslStream*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.CreateMonoSslStream
::Mono::Security::Interface::IMonoSslStream* System::Net::Security::SslStream::CreateMonoSslStream(::System::IO::Stream* innerStream, bool leaveInnerStreamOpen, ::Mono::Security::Interface::MonoTlsProvider* provider, ::Mono::Security::Interface::MonoTlsSettings* settings) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::CreateMonoSslStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Security", "SslStream", "CreateMonoSslStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(innerStream), ::il2cpp_utils::ExtractType(leaveInnerStreamOpen), ::il2cpp_utils::ExtractType(provider), ::il2cpp_utils::ExtractType(settings)})));
return ::il2cpp_utils::RunMethodRethrow<::Mono::Security::Interface::IMonoSslStream*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, innerStream, leaveInnerStreamOpen, provider, settings);
}
// Autogenerated method: System.Net.Security.SslStream.CheckDisposed
void System::Net::Security::SslStream::CheckDisposed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::CheckDisposed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CheckDisposed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.get_IsAuthenticated
bool System::Net::Security::SslStream::get_IsAuthenticated() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::get_IsAuthenticated");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsAuthenticated", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.get_CanSeek
bool System::Net::Security::SslStream::get_CanSeek() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::get_CanSeek");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanSeek", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.get_CanRead
bool System::Net::Security::SslStream::get_CanRead() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::get_CanRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.get_CanWrite
bool System::Net::Security::SslStream::get_CanWrite() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::get_CanWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.get_ReadTimeout
int System::Net::Security::SslStream::get_ReadTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::get_ReadTimeout");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ReadTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.set_ReadTimeout
void System::Net::Security::SslStream::set_ReadTimeout(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::set_ReadTimeout");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ReadTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Security.SslStream.get_WriteTimeout
int System::Net::Security::SslStream::get_WriteTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::get_WriteTimeout");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_WriteTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.get_Length
int64_t System::Net::Security::SslStream::get_Length() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::get_Length");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Length", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.get_Position
int64_t System::Net::Security::SslStream::get_Position() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::get_Position");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.set_Position
void System::Net::Security::SslStream::set_Position(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::set_Position");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Security.SslStream.SetLength
void System::Net::Security::SslStream::SetLength(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::SetLength");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.Net.Security.SslStream.Seek
int64_t System::Net::Security::SslStream::Seek(int64_t offset, ::System::IO::SeekOrigin origin) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::Seek");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Seek", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(origin)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, offset, origin);
}
// Autogenerated method: System.Net.Security.SslStream.FlushAsync
::System::Threading::Tasks::Task* System::Net::Security::SslStream::FlushAsync(::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::FlushAsync");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FlushAsync", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(this, ___internal__method, cancellationToken);
}
// Autogenerated method: System.Net.Security.SslStream.Flush
void System::Net::Security::SslStream::Flush() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::Flush");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Flush", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Security.SslStream.Dispose
void System::Net::Security::SslStream::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.Net.Security.SslStream.Read
int System::Net::Security::SslStream::Read(::ArrayW<uint8_t> buffer, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::Read");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Read", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffer, offset, count);
}
// Autogenerated method: System.Net.Security.SslStream.Write
void System::Net::Security::SslStream::Write(::ArrayW<uint8_t> buffer, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::Write");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Write", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, buffer, offset, count);
}
// Autogenerated method: System.Net.Security.SslStream.BeginRead
::System::IAsyncResult* System::Net::Security::SslStream::BeginRead(::ArrayW<uint8_t> buffer, int offset, int count, ::System::AsyncCallback* asyncCallback, ::Il2CppObject* asyncState) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::BeginRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(asyncCallback), ::il2cpp_utils::ExtractType(asyncState)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, count, asyncCallback, asyncState);
}
// Autogenerated method: System.Net.Security.SslStream.EndRead
int System::Net::Security::SslStream::EndRead(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::EndRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.Net.Security.SslStream.BeginWrite
::System::IAsyncResult* System::Net::Security::SslStream::BeginWrite(::ArrayW<uint8_t> buffer, int offset, int count, ::System::AsyncCallback* asyncCallback, ::Il2CppObject* asyncState) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::BeginWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(asyncCallback), ::il2cpp_utils::ExtractType(asyncState)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, count, asyncCallback, asyncState);
}
// Autogenerated method: System.Net.Security.SslStream.EndWrite
void System::Net::Security::SslStream::EndWrite(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Security::SslStream::EndWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, asyncResult);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.IPGlobalProperties
#include "System/Net/NetworkInformation/IPGlobalProperties.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private readonly System.Boolean <PlatformNeedsLibCWorkaround>k__BackingField
bool System::Net::NetworkInformation::IPGlobalProperties::_get_$PlatformNeedsLibCWorkaround$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::IPGlobalProperties::_get_$PlatformNeedsLibCWorkaround$k__BackingField");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<bool>("System.Net.NetworkInformation", "IPGlobalProperties", "<PlatformNeedsLibCWorkaround>k__BackingField")));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Boolean <PlatformNeedsLibCWorkaround>k__BackingField
void System::Net::NetworkInformation::IPGlobalProperties::_set_$PlatformNeedsLibCWorkaround$k__BackingField(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::IPGlobalProperties::_set_$PlatformNeedsLibCWorkaround$k__BackingField");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "IPGlobalProperties", "<PlatformNeedsLibCWorkaround>k__BackingField", value));
}
// Autogenerated method: System.Net.NetworkInformation.IPGlobalProperties.get_PlatformNeedsLibCWorkaround
bool System::Net::NetworkInformation::IPGlobalProperties::get_PlatformNeedsLibCWorkaround() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::IPGlobalProperties::get_PlatformNeedsLibCWorkaround");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.NetworkInformation", "IPGlobalProperties", "get_PlatformNeedsLibCWorkaround", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.NetworkInformation.IPGlobalProperties.get_DomainName
::StringW System::Net::NetworkInformation::IPGlobalProperties::get_DomainName() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::IPGlobalProperties::get_DomainName");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DomainName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties
::System::Net::NetworkInformation::IPGlobalProperties* System::Net::NetworkInformation::IPGlobalProperties::GetIPGlobalProperties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::IPGlobalProperties::GetIPGlobalProperties");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.NetworkInformation", "IPGlobalProperties", "GetIPGlobalProperties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::NetworkInformation::IPGlobalProperties*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.NetworkInformation.IPGlobalProperties.InternalGetIPGlobalProperties
::System::Net::NetworkInformation::IPGlobalProperties* System::Net::NetworkInformation::IPGlobalProperties::InternalGetIPGlobalProperties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::IPGlobalProperties::InternalGetIPGlobalProperties");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.NetworkInformation", "IPGlobalProperties", "InternalGetIPGlobalProperties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::NetworkInformation::IPGlobalProperties*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.NetworkInformationException
#include "System/Net/NetworkInformation/NetworkInformationException.hpp"
// Including type: System.Runtime.Serialization.SerializationInfo
#include "System/Runtime/Serialization/SerializationInfo.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.NetworkInterfaceComponent
#include "System/Net/NetworkInformation/NetworkInterfaceComponent.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.NetworkInformation.NetworkInterfaceComponent IPv4
::System::Net::NetworkInformation::NetworkInterfaceComponent System::Net::NetworkInformation::NetworkInterfaceComponent::_get_IPv4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetworkInterfaceComponent::_get_IPv4");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::NetworkInformation::NetworkInterfaceComponent>("System.Net.NetworkInformation", "NetworkInterfaceComponent", "IPv4"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.NetworkInformation.NetworkInterfaceComponent IPv4
void System::Net::NetworkInformation::NetworkInterfaceComponent::_set_IPv4(::System::Net::NetworkInformation::NetworkInterfaceComponent value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetworkInterfaceComponent::_set_IPv4");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "NetworkInterfaceComponent", "IPv4", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.NetworkInformation.NetworkInterfaceComponent IPv6
::System::Net::NetworkInformation::NetworkInterfaceComponent System::Net::NetworkInformation::NetworkInterfaceComponent::_get_IPv6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetworkInterfaceComponent::_get_IPv6");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::NetworkInformation::NetworkInterfaceComponent>("System.Net.NetworkInformation", "NetworkInterfaceComponent", "IPv6"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.NetworkInformation.NetworkInterfaceComponent IPv6
void System::Net::NetworkInformation::NetworkInterfaceComponent::_set_IPv6(::System::Net::NetworkInformation::NetworkInterfaceComponent value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetworkInterfaceComponent::_set_IPv6");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "NetworkInterfaceComponent", "IPv6", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::NetworkInformation::NetworkInterfaceComponent::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetworkInterfaceComponent::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.NetBiosNodeType
#include "System/Net/NetworkInformation/NetBiosNodeType.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.NetworkInformation.NetBiosNodeType Unknown
::System::Net::NetworkInformation::NetBiosNodeType System::Net::NetworkInformation::NetBiosNodeType::_get_Unknown() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_get_Unknown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::NetworkInformation::NetBiosNodeType>("System.Net.NetworkInformation", "NetBiosNodeType", "Unknown"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.NetworkInformation.NetBiosNodeType Unknown
void System::Net::NetworkInformation::NetBiosNodeType::_set_Unknown(::System::Net::NetworkInformation::NetBiosNodeType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_set_Unknown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "NetBiosNodeType", "Unknown", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.NetworkInformation.NetBiosNodeType Broadcast
::System::Net::NetworkInformation::NetBiosNodeType System::Net::NetworkInformation::NetBiosNodeType::_get_Broadcast() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_get_Broadcast");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::NetworkInformation::NetBiosNodeType>("System.Net.NetworkInformation", "NetBiosNodeType", "Broadcast"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.NetworkInformation.NetBiosNodeType Broadcast
void System::Net::NetworkInformation::NetBiosNodeType::_set_Broadcast(::System::Net::NetworkInformation::NetBiosNodeType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_set_Broadcast");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "NetBiosNodeType", "Broadcast", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.NetworkInformation.NetBiosNodeType Peer2Peer
::System::Net::NetworkInformation::NetBiosNodeType System::Net::NetworkInformation::NetBiosNodeType::_get_Peer2Peer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_get_Peer2Peer");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::NetworkInformation::NetBiosNodeType>("System.Net.NetworkInformation", "NetBiosNodeType", "Peer2Peer"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.NetworkInformation.NetBiosNodeType Peer2Peer
void System::Net::NetworkInformation::NetBiosNodeType::_set_Peer2Peer(::System::Net::NetworkInformation::NetBiosNodeType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_set_Peer2Peer");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "NetBiosNodeType", "Peer2Peer", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.NetworkInformation.NetBiosNodeType Mixed
::System::Net::NetworkInformation::NetBiosNodeType System::Net::NetworkInformation::NetBiosNodeType::_get_Mixed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_get_Mixed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::NetworkInformation::NetBiosNodeType>("System.Net.NetworkInformation", "NetBiosNodeType", "Mixed"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.NetworkInformation.NetBiosNodeType Mixed
void System::Net::NetworkInformation::NetBiosNodeType::_set_Mixed(::System::Net::NetworkInformation::NetBiosNodeType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_set_Mixed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "NetBiosNodeType", "Mixed", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.NetworkInformation.NetBiosNodeType Hybrid
::System::Net::NetworkInformation::NetBiosNodeType System::Net::NetworkInformation::NetBiosNodeType::_get_Hybrid() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_get_Hybrid");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::NetworkInformation::NetBiosNodeType>("System.Net.NetworkInformation", "NetBiosNodeType", "Hybrid"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.NetworkInformation.NetBiosNodeType Hybrid
void System::Net::NetworkInformation::NetBiosNodeType::_set_Hybrid(::System::Net::NetworkInformation::NetBiosNodeType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::_set_Hybrid");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "NetBiosNodeType", "Hybrid", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::NetworkInformation::NetBiosNodeType::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::NetBiosNodeType::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.CommonUnixIPGlobalProperties
#include "System/Net/NetworkInformation/CommonUnixIPGlobalProperties.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.NetworkInformation.CommonUnixIPGlobalProperties.getdomainname
int System::Net::NetworkInformation::CommonUnixIPGlobalProperties::getdomainname(::ArrayW<uint8_t> name, int len) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::CommonUnixIPGlobalProperties::getdomainname");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.NetworkInformation", "CommonUnixIPGlobalProperties", "getdomainname", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(name), ::il2cpp_utils::ExtractType(len)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, name, len);
}
// Autogenerated method: System.Net.NetworkInformation.CommonUnixIPGlobalProperties.get_DomainName
::StringW System::Net::NetworkInformation::CommonUnixIPGlobalProperties::get_DomainName() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::CommonUnixIPGlobalProperties::get_DomainName");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DomainName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.UnixIPGlobalProperties
#include "System/Net/NetworkInformation/UnixIPGlobalProperties.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.UnixNoLibCIPGlobalProperties
#include "System/Net/NetworkInformation/UnixNoLibCIPGlobalProperties.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.NetworkInformation.UnixNoLibCIPGlobalProperties.get_DomainName
::StringW System::Net::NetworkInformation::UnixNoLibCIPGlobalProperties::get_DomainName() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::UnixNoLibCIPGlobalProperties::get_DomainName");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DomainName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.MibIPGlobalProperties
#include "System/Net/NetworkInformation/MibIPGlobalProperties.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private readonly System.Char[] wsChars
::ArrayW<::Il2CppChar> System::Net::NetworkInformation::MibIPGlobalProperties::_get_wsChars() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::MibIPGlobalProperties::_get_wsChars");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<::Il2CppChar>>("System.Net.NetworkInformation", "MibIPGlobalProperties", "wsChars"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Char[] wsChars
void System::Net::NetworkInformation::MibIPGlobalProperties::_set_wsChars(::ArrayW<::Il2CppChar> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::MibIPGlobalProperties::_set_wsChars");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "MibIPGlobalProperties", "wsChars", value));
}
// Autogenerated instance field getter
// Get instance field: public readonly System.String StatisticsFile
::StringW& System::Net::NetworkInformation::MibIPGlobalProperties::dyn_StatisticsFile() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::MibIPGlobalProperties::dyn_StatisticsFile");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "StatisticsFile"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public readonly System.String StatisticsFileIPv6
::StringW& System::Net::NetworkInformation::MibIPGlobalProperties::dyn_StatisticsFileIPv6() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::MibIPGlobalProperties::dyn_StatisticsFileIPv6");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "StatisticsFileIPv6"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public readonly System.String TcpFile
::StringW& System::Net::NetworkInformation::MibIPGlobalProperties::dyn_TcpFile() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::MibIPGlobalProperties::dyn_TcpFile");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "TcpFile"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public readonly System.String Tcp6File
::StringW& System::Net::NetworkInformation::MibIPGlobalProperties::dyn_Tcp6File() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::MibIPGlobalProperties::dyn_Tcp6File");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Tcp6File"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public readonly System.String UdpFile
::StringW& System::Net::NetworkInformation::MibIPGlobalProperties::dyn_UdpFile() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::MibIPGlobalProperties::dyn_UdpFile");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "UdpFile"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public readonly System.String Udp6File
::StringW& System::Net::NetworkInformation::MibIPGlobalProperties::dyn_Udp6File() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::MibIPGlobalProperties::dyn_Udp6File");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Udp6File"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.NetworkInformation.MibIPGlobalProperties..cctor
void System::Net::NetworkInformation::MibIPGlobalProperties::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::MibIPGlobalProperties::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.NetworkInformation", "MibIPGlobalProperties", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.Win32IPGlobalProperties
#include "System/Net/NetworkInformation/Win32IPGlobalProperties.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.NetworkInformation.Win32IPGlobalProperties.get_DomainName
::StringW System::Net::NetworkInformation::Win32IPGlobalProperties::get_DomainName() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::Win32IPGlobalProperties::get_DomainName");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_DomainName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.NetworkInformation.Win32NetworkInterface
#include "System/Net/NetworkInformation/Win32NetworkInterface.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Net.NetworkInformation.Win32_FIXED_INFO fixedInfo
::System::Net::NetworkInformation::Win32_FIXED_INFO System::Net::NetworkInformation::Win32NetworkInterface::_get_fixedInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::Win32NetworkInterface::_get_fixedInfo");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::NetworkInformation::Win32_FIXED_INFO>("System.Net.NetworkInformation", "Win32NetworkInterface", "fixedInfo"));
}
// Autogenerated static field setter
// Set static field: static private System.Net.NetworkInformation.Win32_FIXED_INFO fixedInfo
void System::Net::NetworkInformation::Win32NetworkInterface::_set_fixedInfo(::System::Net::NetworkInformation::Win32_FIXED_INFO value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::Win32NetworkInterface::_set_fixedInfo");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "Win32NetworkInterface", "fixedInfo", value));
}
// Autogenerated static field getter
// Get static field: static private System.Boolean initialized
bool System::Net::NetworkInformation::Win32NetworkInterface::_get_initialized() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::Win32NetworkInterface::_get_initialized");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("System.Net.NetworkInformation", "Win32NetworkInterface", "initialized"));
}
// Autogenerated static field setter
// Set static field: static private System.Boolean initialized
void System::Net::NetworkInformation::Win32NetworkInterface::_set_initialized(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::Win32NetworkInterface::_set_initialized");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.NetworkInformation", "Win32NetworkInterface", "initialized", value));
}
// Autogenerated method: System.Net.NetworkInformation.Win32NetworkInterface.get_FixedInfo
::System::Net::NetworkInformation::Win32_FIXED_INFO System::Net::NetworkInformation::Win32NetworkInterface::get_FixedInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::Win32NetworkInterface::get_FixedInfo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.NetworkInformation", "Win32NetworkInterface", "get_FixedInfo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::NetworkInformation::Win32_FIXED_INFO, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.NetworkInformation.Win32NetworkInterface.GetNetworkParams
int System::Net::NetworkInformation::Win32NetworkInterface::GetNetworkParams(::System::IntPtr ptr, ByRef<int> size) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::NetworkInformation::Win32NetworkInterface::GetNetworkParams");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.NetworkInformation", "Win32NetworkInterface", "GetNetworkParams", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ptr), ::il2cpp_utils::ExtractType(size)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, ptr, byref(size));
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Net.Configuration.DefaultProxySectionInternal
#include "System/Net/Configuration/DefaultProxySectionInternal.hpp"
// Including type: System.Net.IWebProxy
#include "System/Net/IWebProxy.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Object classSyncObject
::Il2CppObject* System::Net::Configuration::DefaultProxySectionInternal::_get_classSyncObject() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySectionInternal::_get_classSyncObject");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Il2CppObject*>("System.Net.Configuration", "DefaultProxySectionInternal", "classSyncObject"));
}
// Autogenerated static field setter
// Set static field: static private System.Object classSyncObject
void System::Net::Configuration::DefaultProxySectionInternal::_set_classSyncObject(::Il2CppObject* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySectionInternal::_set_classSyncObject");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Configuration", "DefaultProxySectionInternal", "classSyncObject", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Net.IWebProxy webProxy
::System::Net::IWebProxy*& System::Net::Configuration::DefaultProxySectionInternal::dyn_webProxy() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySectionInternal::dyn_webProxy");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "webProxy"))->offset;
return *reinterpret_cast<::System::Net::IWebProxy**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Configuration.DefaultProxySectionInternal.get_ClassSyncObject
::Il2CppObject* System::Net::Configuration::DefaultProxySectionInternal::get_ClassSyncObject() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySectionInternal::get_ClassSyncObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Configuration", "DefaultProxySectionInternal", "get_ClassSyncObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Configuration.DefaultProxySectionInternal.get_WebProxy
::System::Net::IWebProxy* System::Net::Configuration::DefaultProxySectionInternal::get_WebProxy() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySectionInternal::get_WebProxy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_WebProxy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::IWebProxy*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Configuration.DefaultProxySectionInternal.GetDefaultProxy_UsingOldMonoCode
::System::Net::IWebProxy* System::Net::Configuration::DefaultProxySectionInternal::GetDefaultProxy_UsingOldMonoCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySectionInternal::GetDefaultProxy_UsingOldMonoCode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Configuration", "DefaultProxySectionInternal", "GetDefaultProxy_UsingOldMonoCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::IWebProxy*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Configuration.DefaultProxySectionInternal.GetSystemWebProxy
::System::Net::IWebProxy* System::Net::Configuration::DefaultProxySectionInternal::GetSystemWebProxy() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySectionInternal::GetSystemWebProxy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Configuration", "DefaultProxySectionInternal", "GetSystemWebProxy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::IWebProxy*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Configuration.DefaultProxySectionInternal.GetSection
::System::Net::Configuration::DefaultProxySectionInternal* System::Net::Configuration::DefaultProxySectionInternal::GetSection() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySectionInternal::GetSection");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Configuration", "DefaultProxySectionInternal", "GetSection", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Configuration::DefaultProxySectionInternal*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.SettingsSectionInternal
#include "System/Net/Configuration/SettingsSectionInternal.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private readonly System.Net.Configuration.SettingsSectionInternal instance
::System::Net::Configuration::SettingsSectionInternal* System::Net::Configuration::SettingsSectionInternal::_get_instance() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::SettingsSectionInternal::_get_instance");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Configuration::SettingsSectionInternal*>("System.Net.Configuration", "SettingsSectionInternal", "instance"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Net.Configuration.SettingsSectionInternal instance
void System::Net::Configuration::SettingsSectionInternal::_set_instance(::System::Net::Configuration::SettingsSectionInternal* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::SettingsSectionInternal::_set_instance");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Configuration", "SettingsSectionInternal", "instance", value));
}
// Autogenerated instance field getter
// Get instance field: readonly System.Boolean HttpListenerUnescapeRequestUrl
bool& System::Net::Configuration::SettingsSectionInternal::dyn_HttpListenerUnescapeRequestUrl() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::SettingsSectionInternal::dyn_HttpListenerUnescapeRequestUrl");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "HttpListenerUnescapeRequestUrl"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: readonly System.Net.Sockets.IPProtectionLevel IPProtectionLevel
::System::Net::Sockets::IPProtectionLevel& System::Net::Configuration::SettingsSectionInternal::dyn_IPProtectionLevel() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::SettingsSectionInternal::dyn_IPProtectionLevel");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "IPProtectionLevel"))->offset;
return *reinterpret_cast<::System::Net::Sockets::IPProtectionLevel*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Configuration.SettingsSectionInternal.get_Section
::System::Net::Configuration::SettingsSectionInternal* System::Net::Configuration::SettingsSectionInternal::get_Section() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::SettingsSectionInternal::get_Section");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Configuration", "SettingsSectionInternal", "get_Section", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Net::Configuration::SettingsSectionInternal*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.Net.Configuration.SettingsSectionInternal.get_Ipv6Enabled
bool System::Net::Configuration::SettingsSectionInternal::get_Ipv6Enabled() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::SettingsSectionInternal::get_Ipv6Enabled");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Ipv6Enabled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Configuration.SettingsSectionInternal..cctor
void System::Net::Configuration::SettingsSectionInternal::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::SettingsSectionInternal::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Configuration", "SettingsSectionInternal", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Cache.RequestCache
#include "System/Net/Cache/RequestCache.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static readonly System.Char[] LineSplits
::ArrayW<::Il2CppChar> System::Net::Cache::RequestCache::_get_LineSplits() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCache::_get_LineSplits");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<::Il2CppChar>>("System.Net.Cache", "RequestCache", "LineSplits"));
}
// Autogenerated static field setter
// Set static field: static readonly System.Char[] LineSplits
void System::Net::Cache::RequestCache::_set_LineSplits(::ArrayW<::Il2CppChar> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCache::_set_LineSplits");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Cache", "RequestCache", "LineSplits", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _IsPrivateCache
bool& System::Net::Cache::RequestCache::dyn__IsPrivateCache() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCache::dyn__IsPrivateCache");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_IsPrivateCache"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _CanWrite
bool& System::Net::Cache::RequestCache::dyn__CanWrite() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCache::dyn__CanWrite");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_CanWrite"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.Net.Cache.RequestCache..cctor
void System::Net::Cache::RequestCache::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCache::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Net.Cache", "RequestCache", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Cache.RequestCacheLevel
#include "System/Net/Cache/RequestCacheLevel.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Net.Cache.RequestCacheLevel Default
::System::Net::Cache::RequestCacheLevel System::Net::Cache::RequestCacheLevel::_get_Default() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_get_Default");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Cache::RequestCacheLevel>("System.Net.Cache", "RequestCacheLevel", "Default"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Cache.RequestCacheLevel Default
void System::Net::Cache::RequestCacheLevel::_set_Default(::System::Net::Cache::RequestCacheLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_set_Default");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Cache", "RequestCacheLevel", "Default", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Cache.RequestCacheLevel BypassCache
::System::Net::Cache::RequestCacheLevel System::Net::Cache::RequestCacheLevel::_get_BypassCache() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_get_BypassCache");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Cache::RequestCacheLevel>("System.Net.Cache", "RequestCacheLevel", "BypassCache"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Cache.RequestCacheLevel BypassCache
void System::Net::Cache::RequestCacheLevel::_set_BypassCache(::System::Net::Cache::RequestCacheLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_set_BypassCache");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Cache", "RequestCacheLevel", "BypassCache", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Cache.RequestCacheLevel CacheOnly
::System::Net::Cache::RequestCacheLevel System::Net::Cache::RequestCacheLevel::_get_CacheOnly() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_get_CacheOnly");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Cache::RequestCacheLevel>("System.Net.Cache", "RequestCacheLevel", "CacheOnly"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Cache.RequestCacheLevel CacheOnly
void System::Net::Cache::RequestCacheLevel::_set_CacheOnly(::System::Net::Cache::RequestCacheLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_set_CacheOnly");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Cache", "RequestCacheLevel", "CacheOnly", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Cache.RequestCacheLevel CacheIfAvailable
::System::Net::Cache::RequestCacheLevel System::Net::Cache::RequestCacheLevel::_get_CacheIfAvailable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_get_CacheIfAvailable");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Cache::RequestCacheLevel>("System.Net.Cache", "RequestCacheLevel", "CacheIfAvailable"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Cache.RequestCacheLevel CacheIfAvailable
void System::Net::Cache::RequestCacheLevel::_set_CacheIfAvailable(::System::Net::Cache::RequestCacheLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_set_CacheIfAvailable");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Cache", "RequestCacheLevel", "CacheIfAvailable", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Cache.RequestCacheLevel Revalidate
::System::Net::Cache::RequestCacheLevel System::Net::Cache::RequestCacheLevel::_get_Revalidate() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_get_Revalidate");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Cache::RequestCacheLevel>("System.Net.Cache", "RequestCacheLevel", "Revalidate"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Cache.RequestCacheLevel Revalidate
void System::Net::Cache::RequestCacheLevel::_set_Revalidate(::System::Net::Cache::RequestCacheLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_set_Revalidate");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Cache", "RequestCacheLevel", "Revalidate", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Cache.RequestCacheLevel Reload
::System::Net::Cache::RequestCacheLevel System::Net::Cache::RequestCacheLevel::_get_Reload() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_get_Reload");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Cache::RequestCacheLevel>("System.Net.Cache", "RequestCacheLevel", "Reload"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Cache.RequestCacheLevel Reload
void System::Net::Cache::RequestCacheLevel::_set_Reload(::System::Net::Cache::RequestCacheLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_set_Reload");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Cache", "RequestCacheLevel", "Reload", value));
}
// Autogenerated static field getter
// Get static field: static public System.Net.Cache.RequestCacheLevel NoCacheNoStore
::System::Net::Cache::RequestCacheLevel System::Net::Cache::RequestCacheLevel::_get_NoCacheNoStore() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_get_NoCacheNoStore");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Net::Cache::RequestCacheLevel>("System.Net.Cache", "RequestCacheLevel", "NoCacheNoStore"));
}
// Autogenerated static field setter
// Set static field: static public System.Net.Cache.RequestCacheLevel NoCacheNoStore
void System::Net::Cache::RequestCacheLevel::_set_NoCacheNoStore(::System::Net::Cache::RequestCacheLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::_set_NoCacheNoStore");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.Net.Cache", "RequestCacheLevel", "NoCacheNoStore", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::Net::Cache::RequestCacheLevel::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Cache::RequestCacheLevel::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.BypassElementCollection
#include "System/Net/Configuration/BypassElementCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.ConnectionManagementElementCollection
#include "System/Net/Configuration/ConnectionManagementElementCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.ConnectionManagementSection
#include "System/Net/Configuration/ConnectionManagementSection.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.ConnectionManagementSection.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::ConnectionManagementSection::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::ConnectionManagementSection::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.DefaultProxySection
#include "System/Net/Configuration/DefaultProxySection.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.DefaultProxySection.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::DefaultProxySection::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySection::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated method: System.Net.Configuration.DefaultProxySection.Reset
void System::Net::Configuration::DefaultProxySection::Reset(::System::Configuration::ConfigurationElement* parentElement) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::DefaultProxySection::Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parentElement)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, parentElement);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.ProxyElement
#include "System/Net/Configuration/ProxyElement.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.ProxyElement.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::ProxyElement::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::ProxyElement::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.HttpWebRequestElement
#include "System/Net/Configuration/HttpWebRequestElement.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.HttpWebRequestElement.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::HttpWebRequestElement::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::HttpWebRequestElement::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.Ipv6Element
#include "System/Net/Configuration/Ipv6Element.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.Ipv6Element.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::Ipv6Element::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::Ipv6Element::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.NetSectionGroup
#include "System/Net/Configuration/NetSectionGroup.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.SettingsSection
#include "System/Net/Configuration/SettingsSection.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.SettingsSection.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::SettingsSection::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::SettingsSection::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.PerformanceCountersElement
#include "System/Net/Configuration/PerformanceCountersElement.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.PerformanceCountersElement.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::PerformanceCountersElement::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::PerformanceCountersElement::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.ServicePointManagerElement
#include "System/Net/Configuration/ServicePointManagerElement.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.ServicePointManagerElement.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::ServicePointManagerElement::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::ServicePointManagerElement::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.SocketElement
#include "System/Net/Configuration/SocketElement.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.SocketElement.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::SocketElement::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::SocketElement::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.WebProxyScriptElement
#include "System/Net/Configuration/WebProxyScriptElement.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.WebProxyScriptElement.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::WebProxyScriptElement::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::WebProxyScriptElement::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.WebRequestModulesSection
#include "System/Net/Configuration/WebRequestModulesSection.hpp"
// Including type: System.Configuration.ConfigurationPropertyCollection
#include "System/Configuration/ConfigurationPropertyCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Net.Configuration.WebRequestModulesSection.get_Properties
::System::Configuration::ConfigurationPropertyCollection* System::Net::Configuration::WebRequestModulesSection::get_Properties() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Net::Configuration::WebRequestModulesSection::get_Properties");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Properties", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Configuration::ConfigurationPropertyCollection*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.Net.Configuration.WebRequestModuleElementCollection
#include "System/Net/Configuration/WebRequestModuleElementCollection.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.Diagnostics.DiagnosticsConfigurationHandler
#include "System/Diagnostics/DiagnosticsConfigurationHandler.hpp"
// Including type: System.Xml.XmlNode
#include "System/Xml/XmlNode.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.Diagnostics.DiagnosticsConfigurationHandler.Create
::Il2CppObject* System::Diagnostics::DiagnosticsConfigurationHandler::Create(::Il2CppObject* parent, ::Il2CppObject* configContext, ::System::Xml::XmlNode* section) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::Diagnostics::DiagnosticsConfigurationHandler::Create");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Create", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parent), ::il2cpp_utils::ExtractType(configContext), ::il2cpp_utils::ExtractType(section)})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method, parent, configContext, section);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.BlockType
#include "System/IO/Compression/BlockType.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.BlockType Uncompressed
::System::IO::Compression::BlockType System::IO::Compression::BlockType::_get_Uncompressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::BlockType::_get_Uncompressed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::BlockType>("System.IO.Compression", "BlockType", "Uncompressed"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.BlockType Uncompressed
void System::IO::Compression::BlockType::_set_Uncompressed(::System::IO::Compression::BlockType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::BlockType::_set_Uncompressed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "BlockType", "Uncompressed", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.BlockType Static
::System::IO::Compression::BlockType System::IO::Compression::BlockType::_get_Static() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::BlockType::_get_Static");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::BlockType>("System.IO.Compression", "BlockType", "Static"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.BlockType Static
void System::IO::Compression::BlockType::_set_Static(::System::IO::Compression::BlockType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::BlockType::_set_Static");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "BlockType", "Static", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.BlockType Dynamic
::System::IO::Compression::BlockType System::IO::Compression::BlockType::_get_Dynamic() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::BlockType::_get_Dynamic");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::BlockType>("System.IO.Compression", "BlockType", "Dynamic"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.BlockType Dynamic
void System::IO::Compression::BlockType::_set_Dynamic(::System::IO::Compression::BlockType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::BlockType::_set_Dynamic");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "BlockType", "Dynamic", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::IO::Compression::BlockType::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::BlockType::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.CopyEncoder
#include "System/IO/Compression/CopyEncoder.hpp"
// Including type: System.IO.Compression.DeflateInput
#include "System/IO/Compression/DeflateInput.hpp"
// Including type: System.IO.Compression.OutputBuffer
#include "System/IO/Compression/OutputBuffer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.IO.Compression.CopyEncoder.GetBlock
void System::IO::Compression::CopyEncoder::GetBlock(::System::IO::Compression::DeflateInput* input, ::System::IO::Compression::OutputBuffer* output, bool isFinal) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::CopyEncoder::GetBlock");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetBlock", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input), ::il2cpp_utils::ExtractType(output), ::il2cpp_utils::ExtractType(isFinal)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, input, output, isFinal);
}
// Autogenerated method: System.IO.Compression.CopyEncoder.WriteLenNLen
void System::IO::Compression::CopyEncoder::WriteLenNLen(uint16_t len, ::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::CopyEncoder::WriteLenNLen");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteLenNLen", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(len), ::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, len, output);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.DeflateInput
#include "System/IO/Compression/DeflateInput.hpp"
// Including type: System.IO.Compression.DeflateInput/System.IO.Compression.InputState
#include "System/IO/Compression/DeflateInput_InputState.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Byte[] <Buffer>k__BackingField
::ArrayW<uint8_t>& System::IO::Compression::DeflateInput::dyn_$Buffer$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::dyn_$Buffer$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Buffer>k__BackingField"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <Count>k__BackingField
int& System::IO::Compression::DeflateInput::dyn_$Count$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::dyn_$Count$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Count>k__BackingField"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <StartIndex>k__BackingField
int& System::IO::Compression::DeflateInput::dyn_$StartIndex$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::dyn_$StartIndex$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<StartIndex>k__BackingField"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.DeflateInput.get_Buffer
::ArrayW<uint8_t> System::IO::Compression::DeflateInput::get_Buffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::get_Buffer");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Buffer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateInput.set_Buffer
void System::IO::Compression::DeflateInput::set_Buffer(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::set_Buffer");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Buffer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.DeflateInput.get_Count
int System::IO::Compression::DeflateInput::get_Count() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::get_Count");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Count", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateInput.set_Count
void System::IO::Compression::DeflateInput::set_Count(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::set_Count");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Count", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.DeflateInput.get_StartIndex
int System::IO::Compression::DeflateInput::get_StartIndex() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::get_StartIndex");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_StartIndex", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateInput.set_StartIndex
void System::IO::Compression::DeflateInput::set_StartIndex(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::set_StartIndex");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_StartIndex", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.DeflateInput.ConsumeBytes
void System::IO::Compression::DeflateInput::ConsumeBytes(int n) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::ConsumeBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ConsumeBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(n)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, n);
}
// Autogenerated method: System.IO.Compression.DeflateInput.DumpState
::System::IO::Compression::DeflateInput::InputState System::IO::Compression::DeflateInput::DumpState() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::DumpState");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DumpState", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::DeflateInput::InputState, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateInput.RestoreState
void System::IO::Compression::DeflateInput::RestoreState(::System::IO::Compression::DeflateInput::InputState state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::RestoreState");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RestoreState", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(state)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, state);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.DeflateInput/System.IO.Compression.InputState
#include "System/IO/Compression/DeflateInput_InputState.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: readonly System.Int32 _count
int& System::IO::Compression::DeflateInput::InputState::dyn__count() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::InputState::dyn__count");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_count"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: readonly System.Int32 _startIndex
int& System::IO::Compression::DeflateInput::InputState::dyn__startIndex() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateInput::InputState::dyn__startIndex");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startIndex"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.DeflateInput/System.IO.Compression.InputState..ctor
// ABORTED elsewhere. System::IO::Compression::DeflateInput::InputState::InputState(int count, int startIndex)
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.IO.Compression.DeflateManagedStream
#include "System/IO/Compression/DeflateManagedStream.hpp"
// Including type: System.IO.Compression.DeflateManagedStream/System.IO.Compression.<ReadAsyncCore>d__40
#include "System/IO/Compression/DeflateManagedStream_-ReadAsyncCore-d__40.hpp"
// Including type: System.IO.Compression.DeflateManagedStream/System.IO.Compression.<WriteAsyncCore>d__47
#include "System/IO/Compression/DeflateManagedStream_-WriteAsyncCore-d__47.hpp"
// Including type: System.IO.Compression.InflaterManaged
#include "System/IO/Compression/InflaterManaged.hpp"
// Including type: System.IO.Compression.DeflaterManaged
#include "System/IO/Compression/DeflaterManaged.hpp"
// Including type: System.IO.Compression.IFileFormatWriter
#include "System/IO/Compression/IFileFormatWriter.hpp"
// Including type: System.IO.Compression.IFileFormatReader
#include "System/IO/Compression/IFileFormatReader.hpp"
// Including type: System.Threading.Tasks.Task`1
#include "System/Threading/Tasks/Task_1.hpp"
// Including type: System.Threading.CancellationToken
#include "System/Threading/CancellationToken.hpp"
// Including type: System.Threading.Tasks.Task
#include "System/Threading/Tasks/Task.hpp"
// Including type: System.IO.SeekOrigin
#include "System/IO/SeekOrigin.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.IO.Stream _stream
::System::IO::Stream*& System::IO::Compression::DeflateManagedStream::dyn__stream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__stream");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_stream"))->offset;
return *reinterpret_cast<::System::IO::Stream**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.CompressionMode _mode
::System::IO::Compression::CompressionMode& System::IO::Compression::DeflateManagedStream::dyn__mode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__mode");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_mode"))->offset;
return *reinterpret_cast<::System::IO::Compression::CompressionMode*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _leaveOpen
bool& System::IO::Compression::DeflateManagedStream::dyn__leaveOpen() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__leaveOpen");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_leaveOpen"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.InflaterManaged _inflater
::System::IO::Compression::InflaterManaged*& System::IO::Compression::DeflateManagedStream::dyn__inflater() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__inflater");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inflater"))->offset;
return *reinterpret_cast<::System::IO::Compression::InflaterManaged**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.DeflaterManaged _deflater
::System::IO::Compression::DeflaterManaged*& System::IO::Compression::DeflateManagedStream::dyn__deflater() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__deflater");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_deflater"))->offset;
return *reinterpret_cast<::System::IO::Compression::DeflaterManaged**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Byte[] _buffer
::ArrayW<uint8_t>& System::IO::Compression::DeflateManagedStream::dyn__buffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__buffer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_buffer"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _asyncOperations
int& System::IO::Compression::DeflateManagedStream::dyn__asyncOperations() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__asyncOperations");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_asyncOperations"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.IFileFormatWriter _formatWriter
::System::IO::Compression::IFileFormatWriter*& System::IO::Compression::DeflateManagedStream::dyn__formatWriter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__formatWriter");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_formatWriter"))->offset;
return *reinterpret_cast<::System::IO::Compression::IFileFormatWriter**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _wroteHeader
bool& System::IO::Compression::DeflateManagedStream::dyn__wroteHeader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__wroteHeader");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_wroteHeader"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _wroteBytes
bool& System::IO::Compression::DeflateManagedStream::dyn__wroteBytes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::dyn__wroteBytes");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_wroteBytes"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.InitializeInflater
void System::IO::Compression::DeflateManagedStream::InitializeInflater(::System::IO::Stream* stream, bool leaveOpen, ::System::IO::Compression::IFileFormatReader* reader, ::System::IO::Compression::ZipArchiveEntry::CompressionMethodValues method) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::InitializeInflater");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InitializeInflater", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(stream), ::il2cpp_utils::ExtractType(leaveOpen), ::il2cpp_utils::ExtractType(reader), ::il2cpp_utils::ExtractType(method)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stream, leaveOpen, reader, method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.ValidateParameters
void System::IO::Compression::DeflateManagedStream::ValidateParameters(::ArrayW<uint8_t> array, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::ValidateParameters");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ValidateParameters", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, array, offset, count);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.EnsureNotDisposed
void System::IO::Compression::DeflateManagedStream::EnsureNotDisposed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::EnsureNotDisposed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnsureNotDisposed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.ThrowStreamClosedException
void System::IO::Compression::DeflateManagedStream::ThrowStreamClosedException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::ThrowStreamClosedException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "DeflateManagedStream", "ThrowStreamClosedException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.EnsureDecompressionMode
void System::IO::Compression::DeflateManagedStream::EnsureDecompressionMode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::EnsureDecompressionMode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnsureDecompressionMode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.ThrowCannotReadFromDeflateManagedStreamException
void System::IO::Compression::DeflateManagedStream::ThrowCannotReadFromDeflateManagedStreamException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::ThrowCannotReadFromDeflateManagedStreamException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "DeflateManagedStream", "ThrowCannotReadFromDeflateManagedStreamException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.EnsureCompressionMode
void System::IO::Compression::DeflateManagedStream::EnsureCompressionMode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::EnsureCompressionMode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnsureCompressionMode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.ThrowCannotWriteToDeflateManagedStreamException
void System::IO::Compression::DeflateManagedStream::ThrowCannotWriteToDeflateManagedStreamException() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::ThrowCannotWriteToDeflateManagedStreamException");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "DeflateManagedStream", "ThrowCannotWriteToDeflateManagedStreamException", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.ReadAsyncCore
::System::Threading::Tasks::Task_1<int>* System::IO::Compression::DeflateManagedStream::ReadAsyncCore(::System::Threading::Tasks::Task_1<int>* readTask, ::ArrayW<uint8_t> array, int offset, int count, ::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::ReadAsyncCore");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReadAsyncCore", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(readTask), ::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task_1<int>*, false>(this, ___internal__method, readTask, array, offset, count, cancellationToken);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.WriteDeflaterOutput
void System::IO::Compression::DeflateManagedStream::WriteDeflaterOutput() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::WriteDeflaterOutput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteDeflaterOutput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.DoMaintenance
void System::IO::Compression::DeflateManagedStream::DoMaintenance(::ArrayW<uint8_t> array, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::DoMaintenance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DoMaintenance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, array, offset, count);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.PurgeBuffers
void System::IO::Compression::DeflateManagedStream::PurgeBuffers(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::PurgeBuffers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PurgeBuffers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.WriteAsyncCore
::System::Threading::Tasks::Task* System::IO::Compression::DeflateManagedStream::WriteAsyncCore(::ArrayW<uint8_t> array, int offset, int count, ::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::WriteAsyncCore");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteAsyncCore", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(this, ___internal__method, array, offset, count, cancellationToken);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.<>n__0
::System::Threading::Tasks::Task* System::IO::Compression::DeflateManagedStream::$$n__0(::ArrayW<uint8_t> buffer, int offset, int count, ::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::<>n__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<>n__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(this, ___internal__method, buffer, offset, count, cancellationToken);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.get_CanRead
bool System::IO::Compression::DeflateManagedStream::get_CanRead() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::get_CanRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.get_CanWrite
bool System::IO::Compression::DeflateManagedStream::get_CanWrite() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::get_CanWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.get_CanSeek
bool System::IO::Compression::DeflateManagedStream::get_CanSeek() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::get_CanSeek");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanSeek", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.get_Length
int64_t System::IO::Compression::DeflateManagedStream::get_Length() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::get_Length");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Length", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.get_Position
int64_t System::IO::Compression::DeflateManagedStream::get_Position() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::get_Position");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.set_Position
void System::IO::Compression::DeflateManagedStream::set_Position(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::set_Position");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.Flush
void System::IO::Compression::DeflateManagedStream::Flush() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::Flush");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Flush", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.FlushAsync
::System::Threading::Tasks::Task* System::IO::Compression::DeflateManagedStream::FlushAsync(::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::FlushAsync");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FlushAsync", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(this, ___internal__method, cancellationToken);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.Seek
int64_t System::IO::Compression::DeflateManagedStream::Seek(int64_t offset, ::System::IO::SeekOrigin origin) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::Seek");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Seek", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(origin)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, offset, origin);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.SetLength
void System::IO::Compression::DeflateManagedStream::SetLength(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::SetLength");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.Read
int System::IO::Compression::DeflateManagedStream::Read(::ArrayW<uint8_t> array, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::Read");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Read", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, array, offset, count);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.BeginRead
::System::IAsyncResult* System::IO::Compression::DeflateManagedStream::BeginRead(::ArrayW<uint8_t> buffer, int offset, int count, ::System::AsyncCallback* asyncCallback, ::Il2CppObject* asyncState) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::BeginRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(asyncCallback), ::il2cpp_utils::ExtractType(asyncState)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, count, asyncCallback, asyncState);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.EndRead
int System::IO::Compression::DeflateManagedStream::EndRead(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::EndRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.ReadAsync
::System::Threading::Tasks::Task_1<int>* System::IO::Compression::DeflateManagedStream::ReadAsync(::ArrayW<uint8_t> array, int offset, int count, ::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::ReadAsync");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReadAsync", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task_1<int>*, false>(this, ___internal__method, array, offset, count, cancellationToken);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.Write
void System::IO::Compression::DeflateManagedStream::Write(::ArrayW<uint8_t> array, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::Write");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Write", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, array, offset, count);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.Dispose
void System::IO::Compression::DeflateManagedStream::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.WriteAsync
::System::Threading::Tasks::Task* System::IO::Compression::DeflateManagedStream::WriteAsync(::ArrayW<uint8_t> array, int offset, int count, ::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::WriteAsync");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteAsync", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(array), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(this, ___internal__method, array, offset, count, cancellationToken);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.BeginWrite
::System::IAsyncResult* System::IO::Compression::DeflateManagedStream::BeginWrite(::ArrayW<uint8_t> buffer, int offset, int count, ::System::AsyncCallback* asyncCallback, ::Il2CppObject* asyncState) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::BeginWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(asyncCallback), ::il2cpp_utils::ExtractType(asyncState)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, count, asyncCallback, asyncState);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream.EndWrite
void System::IO::Compression::DeflateManagedStream::EndWrite(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::EndWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, asyncResult);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.DeflateManagedStream/System.IO.Compression.<ReadAsyncCore>d__40
#include "System/IO/Compression/DeflateManagedStream_-ReadAsyncCore-d__40.hpp"
// Including type: System.Threading.Tasks.Task`1
#include "System/Threading/Tasks/Task_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.Int32 <>1__state
int& System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_$$1__state");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Int32> <>t__builder
::System::Runtime::CompilerServices::AsyncTaskMethodBuilder_1<int>& System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_$$t__builder() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_$$t__builder");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset;
return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder_1<int>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Threading.Tasks.Task`1<System.Int32> readTask
::System::Threading::Tasks::Task_1<int>*& System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_readTask() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_readTask");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "readTask"))->offset;
return *reinterpret_cast<::System::Threading::Tasks::Task_1<int>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.IO.Compression.DeflateManagedStream <>4__this
::System::IO::Compression::DeflateManagedStream*& System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_$$4__this");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::System::IO::Compression::DeflateManagedStream**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Threading.CancellationToken cancellationToken
::System::Threading::CancellationToken& System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_cancellationToken() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_cancellationToken");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "cancellationToken"))->offset;
return *reinterpret_cast<::System::Threading::CancellationToken*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Byte[] array
::ArrayW<uint8_t>& System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_array() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_array");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "array"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 offset
int& System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_offset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_offset");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "offset"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 count
int& System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_count() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_count");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "count"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/System.Runtime.CompilerServices.ConfiguredTaskAwaiter<System.Int32> <>u__1
typename ::System::Runtime::CompilerServices::ConfiguredTaskAwaitable_1<int>::ConfiguredTaskAwaiter& System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_$$u__1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::dyn_$$u__1");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset;
return *reinterpret_cast<typename ::System::Runtime::CompilerServices::ConfiguredTaskAwaitable_1<int>::ConfiguredTaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream/System.IO.Compression.<ReadAsyncCore>d__40.MoveNext
void System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream/System.IO.Compression.<ReadAsyncCore>d__40.SetStateMachine
void System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$ReadAsyncCore$d__40::SetStateMachine");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SetStateMachine", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(stateMachine)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.DeflateManagedStream/System.IO.Compression.<WriteAsyncCore>d__47
#include "System/IO/Compression/DeflateManagedStream_-WriteAsyncCore-d__47.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.Int32 <>1__state
int& System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_$$1__state");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder
::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_$$t__builder() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_$$t__builder");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset;
return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.IO.Compression.DeflateManagedStream <>4__this
::System::IO::Compression::DeflateManagedStream*& System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_$$4__this");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::System::IO::Compression::DeflateManagedStream**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Byte[] array
::ArrayW<uint8_t>& System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_array() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_array");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "array"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 offset
int& System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_offset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_offset");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "offset"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 count
int& System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_count() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_count");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "count"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Threading.CancellationToken cancellationToken
::System::Threading::CancellationToken& System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_cancellationToken() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_cancellationToken");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "cancellationToken"))->offset;
return *reinterpret_cast<::System::Threading::CancellationToken*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Runtime.CompilerServices.ConfiguredTaskAwaitable/System.Runtime.CompilerServices.ConfiguredTaskAwaiter <>u__1
::System::Runtime::CompilerServices::ConfiguredTaskAwaitable::ConfiguredTaskAwaiter& System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_$$u__1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::dyn_$$u__1");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset;
return *reinterpret_cast<::System::Runtime::CompilerServices::ConfiguredTaskAwaitable::ConfiguredTaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream/System.IO.Compression.<WriteAsyncCore>d__47.MoveNext
void System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflateManagedStream/System.IO.Compression.<WriteAsyncCore>d__47.SetStateMachine
void System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflateManagedStream::$WriteAsyncCore$d__47::SetStateMachine");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SetStateMachine", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(stateMachine)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.DeflaterManaged
#include "System/IO/Compression/DeflaterManaged.hpp"
// Including type: System.IO.Compression.FastEncoder
#include "System/IO/Compression/FastEncoder.hpp"
// Including type: System.IO.Compression.CopyEncoder
#include "System/IO/Compression/CopyEncoder.hpp"
// Including type: System.IO.Compression.DeflateInput
#include "System/IO/Compression/DeflateInput.hpp"
// Including type: System.IO.Compression.OutputBuffer
#include "System/IO/Compression/OutputBuffer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private readonly System.IO.Compression.FastEncoder _deflateEncoder
::System::IO::Compression::FastEncoder*& System::IO::Compression::DeflaterManaged::dyn__deflateEncoder() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::dyn__deflateEncoder");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_deflateEncoder"))->offset;
return *reinterpret_cast<::System::IO::Compression::FastEncoder**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.IO.Compression.CopyEncoder _copyEncoder
::System::IO::Compression::CopyEncoder*& System::IO::Compression::DeflaterManaged::dyn__copyEncoder() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::dyn__copyEncoder");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_copyEncoder"))->offset;
return *reinterpret_cast<::System::IO::Compression::CopyEncoder**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.IO.Compression.DeflateInput _input
::System::IO::Compression::DeflateInput*& System::IO::Compression::DeflaterManaged::dyn__input() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::dyn__input");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_input"))->offset;
return *reinterpret_cast<::System::IO::Compression::DeflateInput**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.IO.Compression.OutputBuffer _output
::System::IO::Compression::OutputBuffer*& System::IO::Compression::DeflaterManaged::dyn__output() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::dyn__output");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_output"))->offset;
return *reinterpret_cast<::System::IO::Compression::OutputBuffer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState _processingState
::System::IO::Compression::DeflaterManaged::DeflaterState& System::IO::Compression::DeflaterManaged::dyn__processingState() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::dyn__processingState");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_processingState"))->offset;
return *reinterpret_cast<::System::IO::Compression::DeflaterManaged::DeflaterState*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.DeflateInput _inputFromHistory
::System::IO::Compression::DeflateInput*& System::IO::Compression::DeflaterManaged::dyn__inputFromHistory() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::dyn__inputFromHistory");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputFromHistory"))->offset;
return *reinterpret_cast<::System::IO::Compression::DeflateInput**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.DeflaterManaged.NeedsInput
bool System::IO::Compression::DeflaterManaged::NeedsInput() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::NeedsInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NeedsInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflaterManaged.SetInput
void System::IO::Compression::DeflaterManaged::SetInput(::ArrayW<uint8_t> inputBuffer, int startIndex, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::SetInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputBuffer), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, inputBuffer, startIndex, count);
}
// Autogenerated method: System.IO.Compression.DeflaterManaged.GetDeflateOutput
int System::IO::Compression::DeflaterManaged::GetDeflateOutput(::ArrayW<uint8_t> outputBuffer) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::GetDeflateOutput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetDeflateOutput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(outputBuffer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, outputBuffer);
}
// Autogenerated method: System.IO.Compression.DeflaterManaged.Finish
bool System::IO::Compression::DeflaterManaged::Finish(::ArrayW<uint8_t> outputBuffer, ByRef<int> bytesRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::Finish");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Finish", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(outputBuffer), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, outputBuffer, byref(bytesRead));
}
// Autogenerated method: System.IO.Compression.DeflaterManaged.UseCompressed
bool System::IO::Compression::DeflaterManaged::UseCompressed(double ratio) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::UseCompressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UseCompressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ratio)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, ratio);
}
// Autogenerated method: System.IO.Compression.DeflaterManaged.FlushInputWindows
void System::IO::Compression::DeflaterManaged::FlushInputWindows() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::FlushInputWindows");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FlushInputWindows", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflaterManaged.WriteFinal
void System::IO::Compression::DeflaterManaged::WriteFinal() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::WriteFinal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteFinal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.DeflaterManaged.Dispose
void System::IO::Compression::DeflaterManaged::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState
#include "System/IO/Compression/DeflaterManaged.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState NotStarted
::System::IO::Compression::DeflaterManaged::DeflaterState System::IO::Compression::DeflaterManaged::DeflaterState::_get_NotStarted() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_get_NotStarted");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::DeflaterManaged::DeflaterState>("System.IO.Compression", "DeflaterManaged/DeflaterState", "NotStarted"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState NotStarted
void System::IO::Compression::DeflaterManaged::DeflaterState::_set_NotStarted(::System::IO::Compression::DeflaterManaged::DeflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_set_NotStarted");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "DeflaterManaged/DeflaterState", "NotStarted", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState SlowDownForIncompressible1
::System::IO::Compression::DeflaterManaged::DeflaterState System::IO::Compression::DeflaterManaged::DeflaterState::_get_SlowDownForIncompressible1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_get_SlowDownForIncompressible1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::DeflaterManaged::DeflaterState>("System.IO.Compression", "DeflaterManaged/DeflaterState", "SlowDownForIncompressible1"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState SlowDownForIncompressible1
void System::IO::Compression::DeflaterManaged::DeflaterState::_set_SlowDownForIncompressible1(::System::IO::Compression::DeflaterManaged::DeflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_set_SlowDownForIncompressible1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "DeflaterManaged/DeflaterState", "SlowDownForIncompressible1", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState SlowDownForIncompressible2
::System::IO::Compression::DeflaterManaged::DeflaterState System::IO::Compression::DeflaterManaged::DeflaterState::_get_SlowDownForIncompressible2() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_get_SlowDownForIncompressible2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::DeflaterManaged::DeflaterState>("System.IO.Compression", "DeflaterManaged/DeflaterState", "SlowDownForIncompressible2"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState SlowDownForIncompressible2
void System::IO::Compression::DeflaterManaged::DeflaterState::_set_SlowDownForIncompressible2(::System::IO::Compression::DeflaterManaged::DeflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_set_SlowDownForIncompressible2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "DeflaterManaged/DeflaterState", "SlowDownForIncompressible2", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState StartingSmallData
::System::IO::Compression::DeflaterManaged::DeflaterState System::IO::Compression::DeflaterManaged::DeflaterState::_get_StartingSmallData() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_get_StartingSmallData");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::DeflaterManaged::DeflaterState>("System.IO.Compression", "DeflaterManaged/DeflaterState", "StartingSmallData"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState StartingSmallData
void System::IO::Compression::DeflaterManaged::DeflaterState::_set_StartingSmallData(::System::IO::Compression::DeflaterManaged::DeflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_set_StartingSmallData");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "DeflaterManaged/DeflaterState", "StartingSmallData", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState CompressThenCheck
::System::IO::Compression::DeflaterManaged::DeflaterState System::IO::Compression::DeflaterManaged::DeflaterState::_get_CompressThenCheck() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_get_CompressThenCheck");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::DeflaterManaged::DeflaterState>("System.IO.Compression", "DeflaterManaged/DeflaterState", "CompressThenCheck"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState CompressThenCheck
void System::IO::Compression::DeflaterManaged::DeflaterState::_set_CompressThenCheck(::System::IO::Compression::DeflaterManaged::DeflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_set_CompressThenCheck");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "DeflaterManaged/DeflaterState", "CompressThenCheck", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState CheckingForIncompressible
::System::IO::Compression::DeflaterManaged::DeflaterState System::IO::Compression::DeflaterManaged::DeflaterState::_get_CheckingForIncompressible() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_get_CheckingForIncompressible");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::DeflaterManaged::DeflaterState>("System.IO.Compression", "DeflaterManaged/DeflaterState", "CheckingForIncompressible"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState CheckingForIncompressible
void System::IO::Compression::DeflaterManaged::DeflaterState::_set_CheckingForIncompressible(::System::IO::Compression::DeflaterManaged::DeflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_set_CheckingForIncompressible");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "DeflaterManaged/DeflaterState", "CheckingForIncompressible", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState HandlingSmallData
::System::IO::Compression::DeflaterManaged::DeflaterState System::IO::Compression::DeflaterManaged::DeflaterState::_get_HandlingSmallData() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_get_HandlingSmallData");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::DeflaterManaged::DeflaterState>("System.IO.Compression", "DeflaterManaged/DeflaterState", "HandlingSmallData"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.DeflaterManaged/System.IO.Compression.DeflaterState HandlingSmallData
void System::IO::Compression::DeflaterManaged::DeflaterState::_set_HandlingSmallData(::System::IO::Compression::DeflaterManaged::DeflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::_set_HandlingSmallData");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "DeflaterManaged/DeflaterState", "HandlingSmallData", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::IO::Compression::DeflaterManaged::DeflaterState::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::DeflaterManaged::DeflaterState::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.FastEncoder
#include "System/IO/Compression/FastEncoder.hpp"
// Including type: System.IO.Compression.FastEncoderWindow
#include "System/IO/Compression/FastEncoderWindow.hpp"
// Including type: System.IO.Compression.Match
#include "System/IO/Compression/Match.hpp"
// Including type: System.IO.Compression.DeflateInput
#include "System/IO/Compression/DeflateInput.hpp"
// Including type: System.IO.Compression.OutputBuffer
#include "System/IO/Compression/OutputBuffer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private readonly System.IO.Compression.FastEncoderWindow _inputWindow
::System::IO::Compression::FastEncoderWindow*& System::IO::Compression::FastEncoder::dyn__inputWindow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::dyn__inputWindow");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inputWindow"))->offset;
return *reinterpret_cast<::System::IO::Compression::FastEncoderWindow**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.IO.Compression.Match _currentMatch
::System::IO::Compression::Match*& System::IO::Compression::FastEncoder::dyn__currentMatch() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::dyn__currentMatch");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentMatch"))->offset;
return *reinterpret_cast<::System::IO::Compression::Match**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Double _lastCompressionRatio
double& System::IO::Compression::FastEncoder::dyn__lastCompressionRatio() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::dyn__lastCompressionRatio");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lastCompressionRatio"))->offset;
return *reinterpret_cast<double*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.FastEncoder.get_BytesInHistory
int System::IO::Compression::FastEncoder::get_BytesInHistory() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::get_BytesInHistory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_BytesInHistory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoder.get_UnprocessedInput
::System::IO::Compression::DeflateInput* System::IO::Compression::FastEncoder::get_UnprocessedInput() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::get_UnprocessedInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UnprocessedInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::DeflateInput*, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoder.get_LastCompressionRatio
double System::IO::Compression::FastEncoder::get_LastCompressionRatio() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::get_LastCompressionRatio");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_LastCompressionRatio", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<double, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoder.FlushInput
void System::IO::Compression::FastEncoder::FlushInput() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::FlushInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FlushInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoder.GetBlock
void System::IO::Compression::FastEncoder::GetBlock(::System::IO::Compression::DeflateInput* input, ::System::IO::Compression::OutputBuffer* output, int maxBytesToCopy) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::GetBlock");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetBlock", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input), ::il2cpp_utils::ExtractType(output), ::il2cpp_utils::ExtractType(maxBytesToCopy)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, input, output, maxBytesToCopy);
}
// Autogenerated method: System.IO.Compression.FastEncoder.GetCompressedData
void System::IO::Compression::FastEncoder::GetCompressedData(::System::IO::Compression::DeflateInput* input, ::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::GetCompressedData");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetCompressedData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input), ::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, input, output);
}
// Autogenerated method: System.IO.Compression.FastEncoder.GetBlockHeader
void System::IO::Compression::FastEncoder::GetBlockHeader(::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::GetBlockHeader");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetBlockHeader", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, output);
}
// Autogenerated method: System.IO.Compression.FastEncoder.GetBlockFooter
void System::IO::Compression::FastEncoder::GetBlockFooter(::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::GetBlockFooter");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetBlockFooter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, output);
}
// Autogenerated method: System.IO.Compression.FastEncoder.GetCompressedOutput
void System::IO::Compression::FastEncoder::GetCompressedOutput(::System::IO::Compression::DeflateInput* input, ::System::IO::Compression::OutputBuffer* output, int maxBytesToCopy) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::GetCompressedOutput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetCompressedOutput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input), ::il2cpp_utils::ExtractType(output), ::il2cpp_utils::ExtractType(maxBytesToCopy)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, input, output, maxBytesToCopy);
}
// Autogenerated method: System.IO.Compression.FastEncoder.GetCompressedOutput
void System::IO::Compression::FastEncoder::GetCompressedOutput(::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::GetCompressedOutput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetCompressedOutput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, output);
}
// Autogenerated method: System.IO.Compression.FastEncoder.InputAvailable
bool System::IO::Compression::FastEncoder::InputAvailable(::System::IO::Compression::DeflateInput* input) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::InputAvailable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InputAvailable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, input);
}
// Autogenerated method: System.IO.Compression.FastEncoder.SafeToWriteTo
bool System::IO::Compression::FastEncoder::SafeToWriteTo(::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::SafeToWriteTo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SafeToWriteTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(output)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, output);
}
// Autogenerated method: System.IO.Compression.FastEncoder.WriteEndOfBlock
void System::IO::Compression::FastEncoder::WriteEndOfBlock(::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::WriteEndOfBlock");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteEndOfBlock", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, output);
}
// Autogenerated method: System.IO.Compression.FastEncoder.WriteMatch
void System::IO::Compression::FastEncoder::WriteMatch(int matchLen, int matchPos, ::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::WriteMatch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "FastEncoder", "WriteMatch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(matchLen), ::il2cpp_utils::ExtractType(matchPos), ::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, matchLen, matchPos, output);
}
// Autogenerated method: System.IO.Compression.FastEncoder.WriteChar
void System::IO::Compression::FastEncoder::WriteChar(uint8_t b, ::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::WriteChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "FastEncoder", "WriteChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(b), ::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, b, output);
}
// Autogenerated method: System.IO.Compression.FastEncoder.WriteDeflatePreamble
void System::IO::Compression::FastEncoder::WriteDeflatePreamble(::System::IO::Compression::OutputBuffer* output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoder::WriteDeflatePreamble");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "FastEncoder", "WriteDeflatePreamble", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, output);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.FastEncoderStatics
#include "System/IO/Compression/FastEncoderStatics.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static readonly System.Byte[] FastEncoderTreeStructureData
::ArrayW<uint8_t> System::IO::Compression::FastEncoderStatics::_get_FastEncoderTreeStructureData() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_get_FastEncoderTreeStructureData");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint8_t>>("System.IO.Compression", "FastEncoderStatics", "FastEncoderTreeStructureData"));
}
// Autogenerated static field setter
// Set static field: static readonly System.Byte[] FastEncoderTreeStructureData
void System::IO::Compression::FastEncoderStatics::_set_FastEncoderTreeStructureData(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_set_FastEncoderTreeStructureData");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "FastEncoderStatics", "FastEncoderTreeStructureData", value));
}
// Autogenerated static field getter
// Get static field: static readonly System.Byte[] BFinalFastEncoderTreeStructureData
::ArrayW<uint8_t> System::IO::Compression::FastEncoderStatics::_get_BFinalFastEncoderTreeStructureData() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_get_BFinalFastEncoderTreeStructureData");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint8_t>>("System.IO.Compression", "FastEncoderStatics", "BFinalFastEncoderTreeStructureData"));
}
// Autogenerated static field setter
// Set static field: static readonly System.Byte[] BFinalFastEncoderTreeStructureData
void System::IO::Compression::FastEncoderStatics::_set_BFinalFastEncoderTreeStructureData(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_set_BFinalFastEncoderTreeStructureData");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "FastEncoderStatics", "BFinalFastEncoderTreeStructureData", value));
}
// Autogenerated static field getter
// Get static field: static readonly System.UInt32[] FastEncoderLiteralCodeInfo
::ArrayW<uint> System::IO::Compression::FastEncoderStatics::_get_FastEncoderLiteralCodeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_get_FastEncoderLiteralCodeInfo");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint>>("System.IO.Compression", "FastEncoderStatics", "FastEncoderLiteralCodeInfo"));
}
// Autogenerated static field setter
// Set static field: static readonly System.UInt32[] FastEncoderLiteralCodeInfo
void System::IO::Compression::FastEncoderStatics::_set_FastEncoderLiteralCodeInfo(::ArrayW<uint> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_set_FastEncoderLiteralCodeInfo");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "FastEncoderStatics", "FastEncoderLiteralCodeInfo", value));
}
// Autogenerated static field getter
// Get static field: static readonly System.UInt32[] FastEncoderDistanceCodeInfo
::ArrayW<uint> System::IO::Compression::FastEncoderStatics::_get_FastEncoderDistanceCodeInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_get_FastEncoderDistanceCodeInfo");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint>>("System.IO.Compression", "FastEncoderStatics", "FastEncoderDistanceCodeInfo"));
}
// Autogenerated static field setter
// Set static field: static readonly System.UInt32[] FastEncoderDistanceCodeInfo
void System::IO::Compression::FastEncoderStatics::_set_FastEncoderDistanceCodeInfo(::ArrayW<uint> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_set_FastEncoderDistanceCodeInfo");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "FastEncoderStatics", "FastEncoderDistanceCodeInfo", value));
}
// Autogenerated static field getter
// Get static field: static readonly System.UInt32[] BitMask
::ArrayW<uint> System::IO::Compression::FastEncoderStatics::_get_BitMask() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_get_BitMask");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint>>("System.IO.Compression", "FastEncoderStatics", "BitMask"));
}
// Autogenerated static field setter
// Set static field: static readonly System.UInt32[] BitMask
void System::IO::Compression::FastEncoderStatics::_set_BitMask(::ArrayW<uint> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_set_BitMask");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "FastEncoderStatics", "BitMask", value));
}
// Autogenerated static field getter
// Get static field: static readonly System.Byte[] ExtraLengthBits
::ArrayW<uint8_t> System::IO::Compression::FastEncoderStatics::_get_ExtraLengthBits() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_get_ExtraLengthBits");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint8_t>>("System.IO.Compression", "FastEncoderStatics", "ExtraLengthBits"));
}
// Autogenerated static field setter
// Set static field: static readonly System.Byte[] ExtraLengthBits
void System::IO::Compression::FastEncoderStatics::_set_ExtraLengthBits(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_set_ExtraLengthBits");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "FastEncoderStatics", "ExtraLengthBits", value));
}
// Autogenerated static field getter
// Get static field: static readonly System.Byte[] ExtraDistanceBits
::ArrayW<uint8_t> System::IO::Compression::FastEncoderStatics::_get_ExtraDistanceBits() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_get_ExtraDistanceBits");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint8_t>>("System.IO.Compression", "FastEncoderStatics", "ExtraDistanceBits"));
}
// Autogenerated static field setter
// Set static field: static readonly System.Byte[] ExtraDistanceBits
void System::IO::Compression::FastEncoderStatics::_set_ExtraDistanceBits(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_set_ExtraDistanceBits");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "FastEncoderStatics", "ExtraDistanceBits", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.Byte[] s_distLookup
::ArrayW<uint8_t> System::IO::Compression::FastEncoderStatics::_get_s_distLookup() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_get_s_distLookup");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint8_t>>("System.IO.Compression", "FastEncoderStatics", "s_distLookup"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Byte[] s_distLookup
void System::IO::Compression::FastEncoderStatics::_set_s_distLookup(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::_set_s_distLookup");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "FastEncoderStatics", "s_distLookup", value));
}
// Autogenerated method: System.IO.Compression.FastEncoderStatics..cctor
void System::IO::Compression::FastEncoderStatics::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "FastEncoderStatics", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoderStatics.CreateDistanceLookup
::ArrayW<uint8_t> System::IO::Compression::FastEncoderStatics::CreateDistanceLookup() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::CreateDistanceLookup");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "FastEncoderStatics", "CreateDistanceLookup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoderStatics.GetSlot
int System::IO::Compression::FastEncoderStatics::GetSlot(int pos) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::GetSlot");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "FastEncoderStatics", "GetSlot", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pos)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, pos);
}
// Autogenerated method: System.IO.Compression.FastEncoderStatics.BitReverse
uint System::IO::Compression::FastEncoderStatics::BitReverse(uint code, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderStatics::BitReverse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "FastEncoderStatics", "BitReverse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(code), ::il2cpp_utils::ExtractType(length)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, code, length);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.FastEncoderWindow
#include "System/IO/Compression/FastEncoderWindow.hpp"
// Including type: System.IO.Compression.DeflateInput
#include "System/IO/Compression/DeflateInput.hpp"
// Including type: System.IO.Compression.Match
#include "System/IO/Compression/Match.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Byte[] _window
::ArrayW<uint8_t>& System::IO::Compression::FastEncoderWindow::dyn__window() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::dyn__window");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_window"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _bufPos
int& System::IO::Compression::FastEncoderWindow::dyn__bufPos() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::dyn__bufPos");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bufPos"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _bufEnd
int& System::IO::Compression::FastEncoderWindow::dyn__bufEnd() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::dyn__bufEnd");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bufEnd"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.UInt16[] _prev
::ArrayW<uint16_t>& System::IO::Compression::FastEncoderWindow::dyn__prev() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::dyn__prev");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_prev"))->offset;
return *reinterpret_cast<::ArrayW<uint16_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.UInt16[] _lookup
::ArrayW<uint16_t>& System::IO::Compression::FastEncoderWindow::dyn__lookup() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::dyn__lookup");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lookup"))->offset;
return *reinterpret_cast<::ArrayW<uint16_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.get_BytesAvailable
int System::IO::Compression::FastEncoderWindow::get_BytesAvailable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::get_BytesAvailable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_BytesAvailable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.get_UnprocessedInput
::System::IO::Compression::DeflateInput* System::IO::Compression::FastEncoderWindow::get_UnprocessedInput() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::get_UnprocessedInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UnprocessedInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::DeflateInput*, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.get_FreeWindowSpace
int System::IO::Compression::FastEncoderWindow::get_FreeWindowSpace() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::get_FreeWindowSpace");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_FreeWindowSpace", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.FlushWindow
void System::IO::Compression::FastEncoderWindow::FlushWindow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::FlushWindow");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FlushWindow", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.ResetWindow
void System::IO::Compression::FastEncoderWindow::ResetWindow() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::ResetWindow");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ResetWindow", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.CopyBytes
void System::IO::Compression::FastEncoderWindow::CopyBytes(::ArrayW<uint8_t> inputBuffer, int startIndex, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::CopyBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CopyBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputBuffer), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, inputBuffer, startIndex, count);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.MoveWindows
void System::IO::Compression::FastEncoderWindow::MoveWindows() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::MoveWindows");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveWindows", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.HashValue
uint System::IO::Compression::FastEncoderWindow::HashValue(uint hash, uint8_t b) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::HashValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HashValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hash), ::il2cpp_utils::ExtractType(b)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, hash, b);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.InsertString
uint System::IO::Compression::FastEncoderWindow::InsertString(ByRef<uint> hash) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::InsertString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InsertString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hash)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, byref(hash));
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.InsertStrings
void System::IO::Compression::FastEncoderWindow::InsertStrings(ByRef<uint> hash, int matchLen) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::InsertStrings");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InsertStrings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hash), ::il2cpp_utils::ExtractType(matchLen)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, byref(hash), matchLen);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.GetNextSymbolOrMatch
bool System::IO::Compression::FastEncoderWindow::GetNextSymbolOrMatch(::System::IO::Compression::Match* match) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::GetNextSymbolOrMatch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetNextSymbolOrMatch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(match)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, match);
}
// Autogenerated method: System.IO.Compression.FastEncoderWindow.FindMatch
int System::IO::Compression::FastEncoderWindow::FindMatch(int search, ByRef<int> matchPos, int searchDepth, int niceLength) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::FastEncoderWindow::FindMatch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FindMatch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(search), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(searchDepth), ::il2cpp_utils::ExtractType(niceLength)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, search, byref(matchPos), searchDepth, niceLength);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.IFileFormatWriter
#include "System/IO/Compression/IFileFormatWriter.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.IO.Compression.IFileFormatWriter.GetHeader
::ArrayW<uint8_t> System::IO::Compression::IFileFormatWriter::GetHeader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::IFileFormatWriter::GetHeader");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetHeader", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.IFileFormatWriter.UpdateWithBytesRead
void System::IO::Compression::IFileFormatWriter::UpdateWithBytesRead(::ArrayW<uint8_t> buffer, int offset, int bytesToCopy) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::IFileFormatWriter::UpdateWithBytesRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateWithBytesRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(bytesToCopy)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, buffer, offset, bytesToCopy);
}
// Autogenerated method: System.IO.Compression.IFileFormatWriter.GetFooter
::ArrayW<uint8_t> System::IO::Compression::IFileFormatWriter::GetFooter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::IFileFormatWriter::GetFooter");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetFooter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.IFileFormatReader
#include "System/IO/Compression/IFileFormatReader.hpp"
// Including type: System.IO.Compression.InputBuffer
#include "System/IO/Compression/InputBuffer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: System.IO.Compression.IFileFormatReader.ReadHeader
bool System::IO::Compression::IFileFormatReader::ReadHeader(::System::IO::Compression::InputBuffer* input) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::IFileFormatReader::ReadHeader");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReadHeader", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, input);
}
// Autogenerated method: System.IO.Compression.IFileFormatReader.ReadFooter
bool System::IO::Compression::IFileFormatReader::ReadFooter(::System::IO::Compression::InputBuffer* input) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::IFileFormatReader::ReadFooter");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReadFooter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, input);
}
// Autogenerated method: System.IO.Compression.IFileFormatReader.UpdateWithBytesRead
void System::IO::Compression::IFileFormatReader::UpdateWithBytesRead(::ArrayW<uint8_t> buffer, int offset, int bytesToCopy) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::IFileFormatReader::UpdateWithBytesRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateWithBytesRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(bytesToCopy)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, buffer, offset, bytesToCopy);
}
// Autogenerated method: System.IO.Compression.IFileFormatReader.Validate
void System::IO::Compression::IFileFormatReader::Validate() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::IFileFormatReader::Validate");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Validate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.HuffmanTree
#include "System/IO/Compression/HuffmanTree.hpp"
// Including type: System.IO.Compression.InputBuffer
#include "System/IO/Compression/InputBuffer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private readonly System.IO.Compression.HuffmanTree <StaticLiteralLengthTree>k__BackingField
::System::IO::Compression::HuffmanTree* System::IO::Compression::HuffmanTree::_get_$StaticLiteralLengthTree$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::_get_$StaticLiteralLengthTree$k__BackingField");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::IO::Compression::HuffmanTree*>("System.IO.Compression", "HuffmanTree", "<StaticLiteralLengthTree>k__BackingField")));
}
// Autogenerated static field setter
// Set static field: static private readonly System.IO.Compression.HuffmanTree <StaticLiteralLengthTree>k__BackingField
void System::IO::Compression::HuffmanTree::_set_$StaticLiteralLengthTree$k__BackingField(::System::IO::Compression::HuffmanTree* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::_set_$StaticLiteralLengthTree$k__BackingField");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "HuffmanTree", "<StaticLiteralLengthTree>k__BackingField", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.IO.Compression.HuffmanTree <StaticDistanceTree>k__BackingField
::System::IO::Compression::HuffmanTree* System::IO::Compression::HuffmanTree::_get_$StaticDistanceTree$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::_get_$StaticDistanceTree$k__BackingField");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::IO::Compression::HuffmanTree*>("System.IO.Compression", "HuffmanTree", "<StaticDistanceTree>k__BackingField")));
}
// Autogenerated static field setter
// Set static field: static private readonly System.IO.Compression.HuffmanTree <StaticDistanceTree>k__BackingField
void System::IO::Compression::HuffmanTree::_set_$StaticDistanceTree$k__BackingField(::System::IO::Compression::HuffmanTree* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::_set_$StaticDistanceTree$k__BackingField");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "HuffmanTree", "<StaticDistanceTree>k__BackingField", value));
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Int32 _tableBits
int& System::IO::Compression::HuffmanTree::dyn__tableBits() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::dyn__tableBits");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_tableBits"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Int16[] _table
::ArrayW<int16_t>& System::IO::Compression::HuffmanTree::dyn__table() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::dyn__table");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_table"))->offset;
return *reinterpret_cast<::ArrayW<int16_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Int16[] _left
::ArrayW<int16_t>& System::IO::Compression::HuffmanTree::dyn__left() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::dyn__left");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_left"))->offset;
return *reinterpret_cast<::ArrayW<int16_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Int16[] _right
::ArrayW<int16_t>& System::IO::Compression::HuffmanTree::dyn__right() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::dyn__right");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_right"))->offset;
return *reinterpret_cast<::ArrayW<int16_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Byte[] _codeLengthArray
::ArrayW<uint8_t>& System::IO::Compression::HuffmanTree::dyn__codeLengthArray() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::dyn__codeLengthArray");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_codeLengthArray"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Int32 _tableMask
int& System::IO::Compression::HuffmanTree::dyn__tableMask() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::dyn__tableMask");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_tableMask"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.HuffmanTree.get_StaticLiteralLengthTree
::System::IO::Compression::HuffmanTree* System::IO::Compression::HuffmanTree::get_StaticLiteralLengthTree() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::get_StaticLiteralLengthTree");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "HuffmanTree", "get_StaticLiteralLengthTree", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::HuffmanTree*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.HuffmanTree.get_StaticDistanceTree
::System::IO::Compression::HuffmanTree* System::IO::Compression::HuffmanTree::get_StaticDistanceTree() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::get_StaticDistanceTree");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "HuffmanTree", "get_StaticDistanceTree", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::HuffmanTree*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.HuffmanTree..cctor
void System::IO::Compression::HuffmanTree::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "HuffmanTree", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.HuffmanTree.GetStaticLiteralTreeLength
::ArrayW<uint8_t> System::IO::Compression::HuffmanTree::GetStaticLiteralTreeLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::GetStaticLiteralTreeLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "HuffmanTree", "GetStaticLiteralTreeLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.HuffmanTree.GetStaticDistanceTreeLength
::ArrayW<uint8_t> System::IO::Compression::HuffmanTree::GetStaticDistanceTreeLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::GetStaticDistanceTreeLength");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "HuffmanTree", "GetStaticDistanceTreeLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.HuffmanTree.CalculateHuffmanCode
::ArrayW<uint> System::IO::Compression::HuffmanTree::CalculateHuffmanCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::CalculateHuffmanCode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CalculateHuffmanCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint>, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.HuffmanTree.CreateTable
void System::IO::Compression::HuffmanTree::CreateTable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::CreateTable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateTable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.HuffmanTree.GetNextSymbol
int System::IO::Compression::HuffmanTree::GetNextSymbol(::System::IO::Compression::InputBuffer* input) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::HuffmanTree::GetNextSymbol");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetNextSymbol", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, input);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.InflaterManaged
#include "System/IO/Compression/InflaterManaged.hpp"
// Including type: System.IO.Compression.OutputWindow
#include "System/IO/Compression/OutputWindow.hpp"
// Including type: System.IO.Compression.InputBuffer
#include "System/IO/Compression/InputBuffer.hpp"
// Including type: System.IO.Compression.HuffmanTree
#include "System/IO/Compression/HuffmanTree.hpp"
// Including type: System.IO.Compression.IFileFormatReader
#include "System/IO/Compression/IFileFormatReader.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private readonly System.Byte[] s_extraLengthBits
::ArrayW<uint8_t> System::IO::Compression::InflaterManaged::_get_s_extraLengthBits() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_get_s_extraLengthBits");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint8_t>>("System.IO.Compression", "InflaterManaged", "s_extraLengthBits"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Byte[] s_extraLengthBits
void System::IO::Compression::InflaterManaged::_set_s_extraLengthBits(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_set_s_extraLengthBits");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterManaged", "s_extraLengthBits", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.Int32[] s_lengthBase
::ArrayW<int> System::IO::Compression::InflaterManaged::_get_s_lengthBase() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_get_s_lengthBase");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<int>>("System.IO.Compression", "InflaterManaged", "s_lengthBase"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Int32[] s_lengthBase
void System::IO::Compression::InflaterManaged::_set_s_lengthBase(::ArrayW<int> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_set_s_lengthBase");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterManaged", "s_lengthBase", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.Int32[] s_distanceBasePosition
::ArrayW<int> System::IO::Compression::InflaterManaged::_get_s_distanceBasePosition() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_get_s_distanceBasePosition");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<int>>("System.IO.Compression", "InflaterManaged", "s_distanceBasePosition"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Int32[] s_distanceBasePosition
void System::IO::Compression::InflaterManaged::_set_s_distanceBasePosition(::ArrayW<int> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_set_s_distanceBasePosition");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterManaged", "s_distanceBasePosition", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.Byte[] s_codeOrder
::ArrayW<uint8_t> System::IO::Compression::InflaterManaged::_get_s_codeOrder() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_get_s_codeOrder");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint8_t>>("System.IO.Compression", "InflaterManaged", "s_codeOrder"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Byte[] s_codeOrder
void System::IO::Compression::InflaterManaged::_set_s_codeOrder(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_set_s_codeOrder");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterManaged", "s_codeOrder", value));
}
// Autogenerated static field getter
// Get static field: static private readonly System.Byte[] s_staticDistanceTreeTable
::ArrayW<uint8_t> System::IO::Compression::InflaterManaged::_get_s_staticDistanceTreeTable() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_get_s_staticDistanceTreeTable");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<uint8_t>>("System.IO.Compression", "InflaterManaged", "s_staticDistanceTreeTable"));
}
// Autogenerated static field setter
// Set static field: static private readonly System.Byte[] s_staticDistanceTreeTable
void System::IO::Compression::InflaterManaged::_set_s_staticDistanceTreeTable(::ArrayW<uint8_t> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::_set_s_staticDistanceTreeTable");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterManaged", "s_staticDistanceTreeTable", value));
}
// Autogenerated instance field getter
// Get instance field: private readonly System.IO.Compression.OutputWindow _output
::System::IO::Compression::OutputWindow*& System::IO::Compression::InflaterManaged::dyn__output() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__output");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_output"))->offset;
return *reinterpret_cast<::System::IO::Compression::OutputWindow**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.IO.Compression.InputBuffer _input
::System::IO::Compression::InputBuffer*& System::IO::Compression::InflaterManaged::dyn__input() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__input");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_input"))->offset;
return *reinterpret_cast<::System::IO::Compression::InputBuffer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.HuffmanTree _literalLengthTree
::System::IO::Compression::HuffmanTree*& System::IO::Compression::InflaterManaged::dyn__literalLengthTree() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__literalLengthTree");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_literalLengthTree"))->offset;
return *reinterpret_cast<::System::IO::Compression::HuffmanTree**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.HuffmanTree _distanceTree
::System::IO::Compression::HuffmanTree*& System::IO::Compression::InflaterManaged::dyn__distanceTree() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__distanceTree");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_distanceTree"))->offset;
return *reinterpret_cast<::System::IO::Compression::HuffmanTree**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.InflaterState _state
::System::IO::Compression::InflaterState& System::IO::Compression::InflaterManaged::dyn__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_state"))->offset;
return *reinterpret_cast<::System::IO::Compression::InflaterState*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _hasFormatReader
bool& System::IO::Compression::InflaterManaged::dyn__hasFormatReader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__hasFormatReader");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hasFormatReader"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _bfinal
int& System::IO::Compression::InflaterManaged::dyn__bfinal() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__bfinal");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bfinal"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.BlockType _blockType
::System::IO::Compression::BlockType& System::IO::Compression::InflaterManaged::dyn__blockType() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__blockType");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_blockType"))->offset;
return *reinterpret_cast<::System::IO::Compression::BlockType*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Byte[] _blockLengthBuffer
::ArrayW<uint8_t>& System::IO::Compression::InflaterManaged::dyn__blockLengthBuffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__blockLengthBuffer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_blockLengthBuffer"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _blockLength
int& System::IO::Compression::InflaterManaged::dyn__blockLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__blockLength");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_blockLength"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _length
int& System::IO::Compression::InflaterManaged::dyn__length() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__length");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_length"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _distanceCode
int& System::IO::Compression::InflaterManaged::dyn__distanceCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__distanceCode");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_distanceCode"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _extraBits
int& System::IO::Compression::InflaterManaged::dyn__extraBits() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__extraBits");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_extraBits"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _loopCounter
int& System::IO::Compression::InflaterManaged::dyn__loopCounter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__loopCounter");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_loopCounter"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _literalLengthCodeCount
int& System::IO::Compression::InflaterManaged::dyn__literalLengthCodeCount() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__literalLengthCodeCount");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_literalLengthCodeCount"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _distanceCodeCount
int& System::IO::Compression::InflaterManaged::dyn__distanceCodeCount() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__distanceCodeCount");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_distanceCodeCount"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _codeLengthCodeCount
int& System::IO::Compression::InflaterManaged::dyn__codeLengthCodeCount() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__codeLengthCodeCount");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_codeLengthCodeCount"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _codeArraySize
int& System::IO::Compression::InflaterManaged::dyn__codeArraySize() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__codeArraySize");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_codeArraySize"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _lengthCode
int& System::IO::Compression::InflaterManaged::dyn__lengthCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__lengthCode");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_lengthCode"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Byte[] _codeList
::ArrayW<uint8_t>& System::IO::Compression::InflaterManaged::dyn__codeList() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__codeList");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_codeList"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Byte[] _codeLengthTreeCodeLength
::ArrayW<uint8_t>& System::IO::Compression::InflaterManaged::dyn__codeLengthTreeCodeLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__codeLengthTreeCodeLength");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_codeLengthTreeCodeLength"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private readonly System.Boolean _deflate64
bool& System::IO::Compression::InflaterManaged::dyn__deflate64() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__deflate64");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_deflate64"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.HuffmanTree _codeLengthTree
::System::IO::Compression::HuffmanTree*& System::IO::Compression::InflaterManaged::dyn__codeLengthTree() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__codeLengthTree");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_codeLengthTree"))->offset;
return *reinterpret_cast<::System::IO::Compression::HuffmanTree**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.IFileFormatReader _formatReader
::System::IO::Compression::IFileFormatReader*& System::IO::Compression::InflaterManaged::dyn__formatReader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::dyn__formatReader");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_formatReader"))->offset;
return *reinterpret_cast<::System::IO::Compression::IFileFormatReader**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.InflaterManaged..cctor
void System::IO::Compression::InflaterManaged::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.IO.Compression", "InflaterManaged", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: System.IO.Compression.InflaterManaged.Reset
void System::IO::Compression::InflaterManaged::Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::Reset");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.InflaterManaged.SetInput
void System::IO::Compression::InflaterManaged::SetInput(::ArrayW<uint8_t> inputBytes, int offset, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::SetInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(inputBytes), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, inputBytes, offset, length);
}
// Autogenerated method: System.IO.Compression.InflaterManaged.Finished
bool System::IO::Compression::InflaterManaged::Finished() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::Finished");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Finished", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.InflaterManaged.Inflate
int System::IO::Compression::InflaterManaged::Inflate(::ArrayW<uint8_t> bytes, int offset, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::Inflate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Inflate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bytes), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(length)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, bytes, offset, length);
}
// Autogenerated method: System.IO.Compression.InflaterManaged.Decode
bool System::IO::Compression::InflaterManaged::Decode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::Decode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Decode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.InflaterManaged.DecodeUncompressedBlock
bool System::IO::Compression::InflaterManaged::DecodeUncompressedBlock(ByRef<bool> end_of_block) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::DecodeUncompressedBlock");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DecodeUncompressedBlock", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractIndependentType<bool&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, byref(end_of_block));
}
// Autogenerated method: System.IO.Compression.InflaterManaged.DecodeBlock
bool System::IO::Compression::InflaterManaged::DecodeBlock(ByRef<bool> end_of_block_code_seen) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::DecodeBlock");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DecodeBlock", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractIndependentType<bool&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, byref(end_of_block_code_seen));
}
// Autogenerated method: System.IO.Compression.InflaterManaged.DecodeDynamicBlockHeader
bool System::IO::Compression::InflaterManaged::DecodeDynamicBlockHeader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::DecodeDynamicBlockHeader");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DecodeDynamicBlockHeader", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.InflaterManaged.Dispose
void System::IO::Compression::InflaterManaged::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterManaged::Dispose");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.InflaterState
#include "System/IO/Compression/InflaterState.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingHeader
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingHeader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingHeader");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingHeader"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingHeader
void System::IO::Compression::InflaterState::_set_ReadingHeader(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingHeader");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingHeader", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingBFinal
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingBFinal() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingBFinal");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingBFinal"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingBFinal
void System::IO::Compression::InflaterState::_set_ReadingBFinal(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingBFinal");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingBFinal", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingBType
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingBType() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingBType");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingBType"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingBType
void System::IO::Compression::InflaterState::_set_ReadingBType(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingBType");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingBType", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingNumLitCodes
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingNumLitCodes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingNumLitCodes");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingNumLitCodes"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingNumLitCodes
void System::IO::Compression::InflaterState::_set_ReadingNumLitCodes(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingNumLitCodes");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingNumLitCodes", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingNumDistCodes
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingNumDistCodes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingNumDistCodes");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingNumDistCodes"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingNumDistCodes
void System::IO::Compression::InflaterState::_set_ReadingNumDistCodes(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingNumDistCodes");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingNumDistCodes", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingNumCodeLengthCodes
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingNumCodeLengthCodes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingNumCodeLengthCodes");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingNumCodeLengthCodes"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingNumCodeLengthCodes
void System::IO::Compression::InflaterState::_set_ReadingNumCodeLengthCodes(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingNumCodeLengthCodes");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingNumCodeLengthCodes", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingCodeLengthCodes
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingCodeLengthCodes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingCodeLengthCodes");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingCodeLengthCodes"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingCodeLengthCodes
void System::IO::Compression::InflaterState::_set_ReadingCodeLengthCodes(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingCodeLengthCodes");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingCodeLengthCodes", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingTreeCodesBefore
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingTreeCodesBefore() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingTreeCodesBefore");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingTreeCodesBefore"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingTreeCodesBefore
void System::IO::Compression::InflaterState::_set_ReadingTreeCodesBefore(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingTreeCodesBefore");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingTreeCodesBefore", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingTreeCodesAfter
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingTreeCodesAfter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingTreeCodesAfter");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingTreeCodesAfter"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingTreeCodesAfter
void System::IO::Compression::InflaterState::_set_ReadingTreeCodesAfter(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingTreeCodesAfter");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingTreeCodesAfter", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState DecodeTop
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_DecodeTop() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_DecodeTop");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "DecodeTop"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState DecodeTop
void System::IO::Compression::InflaterState::_set_DecodeTop(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_DecodeTop");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "DecodeTop", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState HaveInitialLength
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_HaveInitialLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_HaveInitialLength");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "HaveInitialLength"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState HaveInitialLength
void System::IO::Compression::InflaterState::_set_HaveInitialLength(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_HaveInitialLength");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "HaveInitialLength", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState HaveFullLength
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_HaveFullLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_HaveFullLength");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "HaveFullLength"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState HaveFullLength
void System::IO::Compression::InflaterState::_set_HaveFullLength(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_HaveFullLength");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "HaveFullLength", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState HaveDistCode
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_HaveDistCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_HaveDistCode");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "HaveDistCode"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState HaveDistCode
void System::IO::Compression::InflaterState::_set_HaveDistCode(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_HaveDistCode");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "HaveDistCode", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState UncompressedAligning
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_UncompressedAligning() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_UncompressedAligning");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "UncompressedAligning"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState UncompressedAligning
void System::IO::Compression::InflaterState::_set_UncompressedAligning(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_UncompressedAligning");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "UncompressedAligning", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState UncompressedByte1
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_UncompressedByte1() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_UncompressedByte1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "UncompressedByte1"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState UncompressedByte1
void System::IO::Compression::InflaterState::_set_UncompressedByte1(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_UncompressedByte1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "UncompressedByte1", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState UncompressedByte2
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_UncompressedByte2() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_UncompressedByte2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "UncompressedByte2"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState UncompressedByte2
void System::IO::Compression::InflaterState::_set_UncompressedByte2(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_UncompressedByte2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "UncompressedByte2", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState UncompressedByte3
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_UncompressedByte3() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_UncompressedByte3");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "UncompressedByte3"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState UncompressedByte3
void System::IO::Compression::InflaterState::_set_UncompressedByte3(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_UncompressedByte3");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "UncompressedByte3", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState UncompressedByte4
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_UncompressedByte4() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_UncompressedByte4");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "UncompressedByte4"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState UncompressedByte4
void System::IO::Compression::InflaterState::_set_UncompressedByte4(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_UncompressedByte4");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "UncompressedByte4", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState DecodingUncompressed
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_DecodingUncompressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_DecodingUncompressed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "DecodingUncompressed"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState DecodingUncompressed
void System::IO::Compression::InflaterState::_set_DecodingUncompressed(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_DecodingUncompressed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "DecodingUncompressed", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState StartReadingFooter
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_StartReadingFooter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_StartReadingFooter");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "StartReadingFooter"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState StartReadingFooter
void System::IO::Compression::InflaterState::_set_StartReadingFooter(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_StartReadingFooter");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "StartReadingFooter", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState ReadingFooter
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_ReadingFooter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_ReadingFooter");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "ReadingFooter"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState ReadingFooter
void System::IO::Compression::InflaterState::_set_ReadingFooter(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_ReadingFooter");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "ReadingFooter", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState VerifyingFooter
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_VerifyingFooter() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_VerifyingFooter");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "VerifyingFooter"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState VerifyingFooter
void System::IO::Compression::InflaterState::_set_VerifyingFooter(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_VerifyingFooter");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "VerifyingFooter", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.InflaterState Done
::System::IO::Compression::InflaterState System::IO::Compression::InflaterState::_get_Done() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_get_Done");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::InflaterState>("System.IO.Compression", "InflaterState", "Done"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.InflaterState Done
void System::IO::Compression::InflaterState::_set_Done(::System::IO::Compression::InflaterState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::_set_Done");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "InflaterState", "Done", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::IO::Compression::InflaterState::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InflaterState::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.InputBuffer
#include "System/IO/Compression/InputBuffer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Byte[] _buffer
::ArrayW<uint8_t>& System::IO::Compression::InputBuffer::dyn__buffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::dyn__buffer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_buffer"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _start
int& System::IO::Compression::InputBuffer::dyn__start() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::dyn__start");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_start"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _end
int& System::IO::Compression::InputBuffer::dyn__end() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::dyn__end");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_end"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.UInt32 _bitBuffer
uint& System::IO::Compression::InputBuffer::dyn__bitBuffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::dyn__bitBuffer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bitBuffer"))->offset;
return *reinterpret_cast<uint*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _bitsInBuffer
int& System::IO::Compression::InputBuffer::dyn__bitsInBuffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::dyn__bitsInBuffer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bitsInBuffer"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.InputBuffer.get_AvailableBits
int System::IO::Compression::InputBuffer::get_AvailableBits() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::get_AvailableBits");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AvailableBits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.InputBuffer.get_AvailableBytes
int System::IO::Compression::InputBuffer::get_AvailableBytes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::get_AvailableBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AvailableBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.InputBuffer.EnsureBitsAvailable
bool System::IO::Compression::InputBuffer::EnsureBitsAvailable(int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::EnsureBitsAvailable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnsureBitsAvailable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(count)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, count);
}
// Autogenerated method: System.IO.Compression.InputBuffer.TryLoad16Bits
uint System::IO::Compression::InputBuffer::TryLoad16Bits() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::TryLoad16Bits");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "TryLoad16Bits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.InputBuffer.GetBitMask
uint System::IO::Compression::InputBuffer::GetBitMask(int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::GetBitMask");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetBitMask", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(count)})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method, count);
}
// Autogenerated method: System.IO.Compression.InputBuffer.GetBits
int System::IO::Compression::InputBuffer::GetBits(int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::GetBits");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetBits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(count)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, count);
}
// Autogenerated method: System.IO.Compression.InputBuffer.CopyTo
int System::IO::Compression::InputBuffer::CopyTo(::ArrayW<uint8_t> output, int offset, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::CopyTo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CopyTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(output), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(length)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, output, offset, length);
}
// Autogenerated method: System.IO.Compression.InputBuffer.NeedsInput
bool System::IO::Compression::InputBuffer::NeedsInput() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::NeedsInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NeedsInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.InputBuffer.SetInput
void System::IO::Compression::InputBuffer::SetInput(::ArrayW<uint8_t> buffer, int offset, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::SetInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, buffer, offset, length);
}
// Autogenerated method: System.IO.Compression.InputBuffer.SkipBits
void System::IO::Compression::InputBuffer::SkipBits(int n) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::SkipBits");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SkipBits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(n)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, n);
}
// Autogenerated method: System.IO.Compression.InputBuffer.SkipToByteBoundary
void System::IO::Compression::InputBuffer::SkipToByteBoundary() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::InputBuffer::SkipToByteBoundary");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SkipToByteBoundary", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.Match
#include "System/IO/Compression/Match.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.MatchState <State>k__BackingField
::System::IO::Compression::MatchState& System::IO::Compression::Match::dyn_$State$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::dyn_$State$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<State>k__BackingField"))->offset;
return *reinterpret_cast<::System::IO::Compression::MatchState*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <Position>k__BackingField
int& System::IO::Compression::Match::dyn_$Position$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::dyn_$Position$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Position>k__BackingField"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <Length>k__BackingField
int& System::IO::Compression::Match::dyn_$Length$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::dyn_$Length$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Length>k__BackingField"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Byte <Symbol>k__BackingField
uint8_t& System::IO::Compression::Match::dyn_$Symbol$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::dyn_$Symbol$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Symbol>k__BackingField"))->offset;
return *reinterpret_cast<uint8_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.Match.get_State
::System::IO::Compression::MatchState System::IO::Compression::Match::get_State() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::get_State");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_State", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::MatchState, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.Match.set_State
void System::IO::Compression::Match::set_State(::System::IO::Compression::MatchState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::set_State");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_State", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.Match.get_Position
int System::IO::Compression::Match::get_Position() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::get_Position");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.Match.set_Position
void System::IO::Compression::Match::set_Position(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::set_Position");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.Match.get_Length
int System::IO::Compression::Match::get_Length() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::get_Length");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Length", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.Match.set_Length
void System::IO::Compression::Match::set_Length(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::set_Length");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Length", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.Match.get_Symbol
uint8_t System::IO::Compression::Match::get_Symbol() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::get_Symbol");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Symbol", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<uint8_t, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.Match.set_Symbol
void System::IO::Compression::Match::set_Symbol(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::Match::set_Symbol");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Symbol", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.MatchState
#include "System/IO/Compression/MatchState.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.MatchState HasSymbol
::System::IO::Compression::MatchState System::IO::Compression::MatchState::_get_HasSymbol() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::MatchState::_get_HasSymbol");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::MatchState>("System.IO.Compression", "MatchState", "HasSymbol"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.MatchState HasSymbol
void System::IO::Compression::MatchState::_set_HasSymbol(::System::IO::Compression::MatchState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::MatchState::_set_HasSymbol");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "MatchState", "HasSymbol", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.MatchState HasMatch
::System::IO::Compression::MatchState System::IO::Compression::MatchState::_get_HasMatch() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::MatchState::_get_HasMatch");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::MatchState>("System.IO.Compression", "MatchState", "HasMatch"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.MatchState HasMatch
void System::IO::Compression::MatchState::_set_HasMatch(::System::IO::Compression::MatchState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::MatchState::_set_HasMatch");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "MatchState", "HasMatch", value));
}
// Autogenerated static field getter
// Get static field: static public System.IO.Compression.MatchState HasSymbolAndMatch
::System::IO::Compression::MatchState System::IO::Compression::MatchState::_get_HasSymbolAndMatch() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::MatchState::_get_HasSymbolAndMatch");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IO::Compression::MatchState>("System.IO.Compression", "MatchState", "HasSymbolAndMatch"));
}
// Autogenerated static field setter
// Set static field: static public System.IO.Compression.MatchState HasSymbolAndMatch
void System::IO::Compression::MatchState::_set_HasSymbolAndMatch(::System::IO::Compression::MatchState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::MatchState::_set_HasSymbolAndMatch");
THROW_UNLESS(il2cpp_utils::SetFieldValue("System.IO.Compression", "MatchState", "HasSymbolAndMatch", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& System::IO::Compression::MatchState::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::MatchState::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.OutputBuffer
#include "System/IO/Compression/OutputBuffer.hpp"
// Including type: System.IO.Compression.OutputBuffer/System.IO.Compression.BufferState
#include "System/IO/Compression/OutputBuffer_BufferState.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Byte[] _byteBuffer
::ArrayW<uint8_t>& System::IO::Compression::OutputBuffer::dyn__byteBuffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::dyn__byteBuffer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_byteBuffer"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _pos
int& System::IO::Compression::OutputBuffer::dyn__pos() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::dyn__pos");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pos"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.UInt32 _bitBuf
uint& System::IO::Compression::OutputBuffer::dyn__bitBuf() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::dyn__bitBuf");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bitBuf"))->offset;
return *reinterpret_cast<uint*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _bitCount
int& System::IO::Compression::OutputBuffer::dyn__bitCount() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::dyn__bitCount");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bitCount"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.get_BytesWritten
int System::IO::Compression::OutputBuffer::get_BytesWritten() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::get_BytesWritten");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_BytesWritten", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.get_FreeBytes
int System::IO::Compression::OutputBuffer::get_FreeBytes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::get_FreeBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_FreeBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.get_BitsInBuffer
int System::IO::Compression::OutputBuffer::get_BitsInBuffer() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::get_BitsInBuffer");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_BitsInBuffer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.UpdateBuffer
void System::IO::Compression::OutputBuffer::UpdateBuffer(::ArrayW<uint8_t> output) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::UpdateBuffer");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateBuffer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(output)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, output);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.WriteUInt16
void System::IO::Compression::OutputBuffer::WriteUInt16(uint16_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::WriteUInt16");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteUInt16", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.WriteBits
void System::IO::Compression::OutputBuffer::WriteBits(int n, uint bits) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::WriteBits");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteBits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(n), ::il2cpp_utils::ExtractType(bits)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, n, bits);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.FlushBits
void System::IO::Compression::OutputBuffer::FlushBits() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::FlushBits");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FlushBits", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.WriteBytes
void System::IO::Compression::OutputBuffer::WriteBytes(::ArrayW<uint8_t> byteArray, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::WriteBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(byteArray), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, byteArray, offset, count);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.WriteBytesUnaligned
void System::IO::Compression::OutputBuffer::WriteBytesUnaligned(::ArrayW<uint8_t> byteArray, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::WriteBytesUnaligned");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteBytesUnaligned", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(byteArray), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, byteArray, offset, count);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.WriteByteUnaligned
void System::IO::Compression::OutputBuffer::WriteByteUnaligned(uint8_t b) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::WriteByteUnaligned");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteByteUnaligned", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(b)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, b);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.DumpState
::System::IO::Compression::OutputBuffer::BufferState System::IO::Compression::OutputBuffer::DumpState() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::DumpState");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DumpState", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::OutputBuffer::BufferState, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.OutputBuffer.RestoreState
void System::IO::Compression::OutputBuffer::RestoreState(::System::IO::Compression::OutputBuffer::BufferState state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::RestoreState");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RestoreState", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(state)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, state);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.OutputBuffer/System.IO.Compression.BufferState
#include "System/IO/Compression/OutputBuffer_BufferState.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: readonly System.Int32 _pos
int& System::IO::Compression::OutputBuffer::BufferState::dyn__pos() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::BufferState::dyn__pos");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pos"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: readonly System.UInt32 _bitBuf
uint& System::IO::Compression::OutputBuffer::BufferState::dyn__bitBuf() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::BufferState::dyn__bitBuf");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bitBuf"))->offset;
return *reinterpret_cast<uint*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: readonly System.Int32 _bitCount
int& System::IO::Compression::OutputBuffer::BufferState::dyn__bitCount() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputBuffer::BufferState::dyn__bitCount");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bitCount"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.OutputBuffer/System.IO.Compression.BufferState..ctor
// ABORTED elsewhere. System::IO::Compression::OutputBuffer::BufferState::BufferState(int pos, uint bitBuf, int bitCount)
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.OutputWindow
#include "System/IO/Compression/OutputWindow.hpp"
// Including type: System.IO.Compression.InputBuffer
#include "System/IO/Compression/InputBuffer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private readonly System.Byte[] _window
::ArrayW<uint8_t>& System::IO::Compression::OutputWindow::dyn__window() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputWindow::dyn__window");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_window"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _end
int& System::IO::Compression::OutputWindow::dyn__end() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputWindow::dyn__end");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_end"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _bytesUsed
int& System::IO::Compression::OutputWindow::dyn__bytesUsed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputWindow::dyn__bytesUsed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bytesUsed"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.OutputWindow.get_FreeBytes
int System::IO::Compression::OutputWindow::get_FreeBytes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputWindow::get_FreeBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_FreeBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.OutputWindow.get_AvailableBytes
int System::IO::Compression::OutputWindow::get_AvailableBytes() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputWindow::get_AvailableBytes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AvailableBytes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.OutputWindow.Write
void System::IO::Compression::OutputWindow::Write(uint8_t b) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputWindow::Write");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Write", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(b)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, b);
}
// Autogenerated method: System.IO.Compression.OutputWindow.WriteLengthDistance
void System::IO::Compression::OutputWindow::WriteLengthDistance(int length, int distance) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputWindow::WriteLengthDistance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteLengthDistance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(length), ::il2cpp_utils::ExtractType(distance)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, length, distance);
}
// Autogenerated method: System.IO.Compression.OutputWindow.CopyFrom
int System::IO::Compression::OutputWindow::CopyFrom(::System::IO::Compression::InputBuffer* input, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputWindow::CopyFrom");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CopyFrom", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input), ::il2cpp_utils::ExtractType(length)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, input, length);
}
// Autogenerated method: System.IO.Compression.OutputWindow.CopyTo
int System::IO::Compression::OutputWindow::CopyTo(::ArrayW<uint8_t> output, int offset, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::OutputWindow::CopyTo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CopyTo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(output), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(length)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, output, offset, length);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper
#include "System/IO/Compression/PositionPreservingWriteOnlyStreamWrapper.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
// Including type: System.Threading.Tasks.Task
#include "System/Threading/Tasks/Task.hpp"
// Including type: System.Threading.CancellationToken
#include "System/Threading/CancellationToken.hpp"
// Including type: System.IO.SeekOrigin
#include "System/IO/SeekOrigin.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private readonly System.IO.Stream _stream
::System::IO::Stream*& System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::dyn__stream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::dyn__stream");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_stream"))->offset;
return *reinterpret_cast<::System::IO::Stream**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int64 _position
int64_t& System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::dyn__position() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::dyn__position");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_position"))->offset;
return *reinterpret_cast<int64_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.get_CanRead
bool System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_CanRead() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_CanRead");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.get_CanSeek
bool System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_CanSeek() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_CanSeek");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanSeek", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.get_CanWrite
bool System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_CanWrite() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_CanWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CanWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.get_Position
int64_t System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_Position() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_Position");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.set_Position
void System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::set_Position(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::set_Position");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Position", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.get_ReadTimeout
int System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_ReadTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_ReadTimeout");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ReadTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.set_ReadTimeout
void System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::set_ReadTimeout(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::set_ReadTimeout");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ReadTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.get_WriteTimeout
int System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_WriteTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_WriteTimeout");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_WriteTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.get_Length
int64_t System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_Length() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::get_Length");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Length", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.Write
void System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Write(::ArrayW<uint8_t> buffer, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Write");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Write", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, buffer, offset, count);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.BeginWrite
::System::IAsyncResult* System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::BeginWrite(::ArrayW<uint8_t> buffer, int offset, int count, ::System::AsyncCallback* callback, ::Il2CppObject* state) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::BeginWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, offset, count, callback, state);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.EndWrite
void System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::EndWrite(::System::IAsyncResult* asyncResult) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::EndWrite");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(asyncResult)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, asyncResult);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.WriteByte
void System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::WriteByte(uint8_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::WriteByte");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteByte", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.WriteAsync
::System::Threading::Tasks::Task* System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::WriteAsync(::ArrayW<uint8_t> buffer, int offset, int count, ::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::WriteAsync");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteAsync", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count), ::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(this, ___internal__method, buffer, offset, count, cancellationToken);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.Flush
void System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Flush() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Flush");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Flush", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.FlushAsync
::System::Threading::Tasks::Task* System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::FlushAsync(::System::Threading::CancellationToken cancellationToken) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::FlushAsync");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FlushAsync", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(cancellationToken)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(this, ___internal__method, cancellationToken);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.Close
void System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Close() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Close");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Close", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.Dispose
void System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.Seek
int64_t System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Seek(int64_t offset, ::System::IO::SeekOrigin origin) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Seek");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Seek", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(origin)})));
return ::il2cpp_utils::RunMethodRethrow<int64_t, false>(this, ___internal__method, offset, origin);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.SetLength
void System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::SetLength(int64_t value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::SetLength");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetLength", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.PositionPreservingWriteOnlyStreamWrapper.Read
int System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Read(::ArrayW<uint8_t> buffer, int offset, int count) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::PositionPreservingWriteOnlyStreamWrapper::Read");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Read", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, buffer, offset, count);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: System.IO.Compression.ZipArchive
#include "System/IO/Compression/ZipArchive.hpp"
// Including type: System.IO.Stream
#include "System/IO/Stream.hpp"
// Including type: System.IO.Compression.ZipArchiveEntry
#include "System/IO/Compression/ZipArchiveEntry.hpp"
// Including type: System.IO.BinaryReader
#include "System/IO/BinaryReader.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: System.Collections.ObjectModel.ReadOnlyCollection`1
#include "System/Collections/ObjectModel/ReadOnlyCollection_1.hpp"
// Including type: System.Collections.Generic.Dictionary`2
#include "System/Collections/Generic/Dictionary_2.hpp"
// Including type: System.Text.Encoding
#include "System/Text/Encoding.hpp"
// Including type: System.Nullable`1
#include "System/Nullable_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.IO.Stream _archiveStream
::System::IO::Stream*& System::IO::Compression::ZipArchive::dyn__archiveStream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__archiveStream");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_archiveStream"))->offset;
return *reinterpret_cast<::System::IO::Stream**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.ZipArchiveEntry _archiveStreamOwner
::System::IO::Compression::ZipArchiveEntry*& System::IO::Compression::ZipArchive::dyn__archiveStreamOwner() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__archiveStreamOwner");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_archiveStreamOwner"))->offset;
return *reinterpret_cast<::System::IO::Compression::ZipArchiveEntry**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.BinaryReader _archiveReader
::System::IO::BinaryReader*& System::IO::Compression::ZipArchive::dyn__archiveReader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__archiveReader");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_archiveReader"))->offset;
return *reinterpret_cast<::System::IO::BinaryReader**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Compression.ZipArchiveMode _mode
::System::IO::Compression::ZipArchiveMode& System::IO::Compression::ZipArchive::dyn__mode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__mode");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_mode"))->offset;
return *reinterpret_cast<::System::IO::Compression::ZipArchiveMode*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.IO.Compression.ZipArchiveEntry> _entries
::System::Collections::Generic::List_1<::System::IO::Compression::ZipArchiveEntry*>*& System::IO::Compression::ZipArchive::dyn__entries() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__entries");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_entries"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::System::IO::Compression::ZipArchiveEntry*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.ObjectModel.ReadOnlyCollection`1<System.IO.Compression.ZipArchiveEntry> _entriesCollection
::System::Collections::ObjectModel::ReadOnlyCollection_1<::System::IO::Compression::ZipArchiveEntry*>*& System::IO::Compression::ZipArchive::dyn__entriesCollection() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__entriesCollection");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_entriesCollection"))->offset;
return *reinterpret_cast<::System::Collections::ObjectModel::ReadOnlyCollection_1<::System::IO::Compression::ZipArchiveEntry*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Dictionary`2<System.String,System.IO.Compression.ZipArchiveEntry> _entriesDictionary
::System::Collections::Generic::Dictionary_2<::StringW, ::System::IO::Compression::ZipArchiveEntry*>*& System::IO::Compression::ZipArchive::dyn__entriesDictionary() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__entriesDictionary");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_entriesDictionary"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::StringW, ::System::IO::Compression::ZipArchiveEntry*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _readEntries
bool& System::IO::Compression::ZipArchive::dyn__readEntries() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__readEntries");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_readEntries"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _leaveOpen
bool& System::IO::Compression::ZipArchive::dyn__leaveOpen() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__leaveOpen");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_leaveOpen"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int64 _centralDirectoryStart
int64_t& System::IO::Compression::ZipArchive::dyn__centralDirectoryStart() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__centralDirectoryStart");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_centralDirectoryStart"))->offset;
return *reinterpret_cast<int64_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _isDisposed
bool& System::IO::Compression::ZipArchive::dyn__isDisposed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__isDisposed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isDisposed"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.UInt32 _numberOfThisDisk
uint& System::IO::Compression::ZipArchive::dyn__numberOfThisDisk() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__numberOfThisDisk");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_numberOfThisDisk"))->offset;
return *reinterpret_cast<uint*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int64 _expectedNumberOfEntries
int64_t& System::IO::Compression::ZipArchive::dyn__expectedNumberOfEntries() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__expectedNumberOfEntries");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_expectedNumberOfEntries"))->offset;
return *reinterpret_cast<int64_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.IO.Stream _backingStream
::System::IO::Stream*& System::IO::Compression::ZipArchive::dyn__backingStream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__backingStream");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_backingStream"))->offset;
return *reinterpret_cast<::System::IO::Stream**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Byte[] _archiveComment
::ArrayW<uint8_t>& System::IO::Compression::ZipArchive::dyn__archiveComment() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__archiveComment");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_archiveComment"))->offset;
return *reinterpret_cast<::ArrayW<uint8_t>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Text.Encoding _entryNameEncoding
::System::Text::Encoding*& System::IO::Compression::ZipArchive::dyn__entryNameEncoding() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::dyn__entryNameEncoding");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_entryNameEncoding"))->offset;
return *reinterpret_cast<::System::Text::Encoding**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: System.IO.Compression.ZipArchive.get_Entries
::System::Collections::ObjectModel::ReadOnlyCollection_1<::System::IO::Compression::ZipArchiveEntry*>* System::IO::Compression::ZipArchive::get_Entries() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::get_Entries");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Entries", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::ObjectModel::ReadOnlyCollection_1<::System::IO::Compression::ZipArchiveEntry*>*, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.get_Mode
::System::IO::Compression::ZipArchiveMode System::IO::Compression::ZipArchive::get_Mode() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::get_Mode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Mode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::ZipArchiveMode, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.get_ArchiveReader
::System::IO::BinaryReader* System::IO::Compression::ZipArchive::get_ArchiveReader() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::get_ArchiveReader");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ArchiveReader", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::BinaryReader*, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.get_ArchiveStream
::System::IO::Stream* System::IO::Compression::ZipArchive::get_ArchiveStream() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::get_ArchiveStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ArchiveStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Stream*, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.get_NumberOfThisDisk
uint System::IO::Compression::ZipArchive::get_NumberOfThisDisk() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::get_NumberOfThisDisk");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_NumberOfThisDisk", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<uint, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.get_EntryNameEncoding
::System::Text::Encoding* System::IO::Compression::ZipArchive::get_EntryNameEncoding() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::get_EntryNameEncoding");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_EntryNameEncoding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Text::Encoding*, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.set_EntryNameEncoding
void System::IO::Compression::ZipArchive::set_EntryNameEncoding(::System::Text::Encoding* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::set_EntryNameEncoding");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_EntryNameEncoding", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: System.IO.Compression.ZipArchive.CreateEntry
::System::IO::Compression::ZipArchiveEntry* System::IO::Compression::ZipArchive::CreateEntry(::StringW entryName) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::CreateEntry");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateEntry", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entryName)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::ZipArchiveEntry*, false>(this, ___internal__method, entryName);
}
// Autogenerated method: System.IO.Compression.ZipArchive.CreateEntry
::System::IO::Compression::ZipArchiveEntry* System::IO::Compression::ZipArchive::CreateEntry(::StringW entryName, ::System::IO::Compression::CompressionLevel compressionLevel) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::CreateEntry");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateEntry", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entryName), ::il2cpp_utils::ExtractType(compressionLevel)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::ZipArchiveEntry*, false>(this, ___internal__method, entryName, compressionLevel);
}
// Autogenerated method: System.IO.Compression.ZipArchive.Dispose
void System::IO::Compression::ZipArchive::Dispose(bool disposing) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(disposing)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, disposing);
}
// Autogenerated method: System.IO.Compression.ZipArchive.Dispose
void System::IO::Compression::ZipArchive::Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.DoCreateEntry
::System::IO::Compression::ZipArchiveEntry* System::IO::Compression::ZipArchive::DoCreateEntry(::StringW entryName, ::System::Nullable_1<::System::IO::Compression::CompressionLevel> compressionLevel) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::DoCreateEntry");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DoCreateEntry", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entryName), ::il2cpp_utils::ExtractType(compressionLevel)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::Compression::ZipArchiveEntry*, false>(this, ___internal__method, entryName, compressionLevel);
}
// Autogenerated method: System.IO.Compression.ZipArchive.AcquireArchiveStream
void System::IO::Compression::ZipArchive::AcquireArchiveStream(::System::IO::Compression::ZipArchiveEntry* entry) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::AcquireArchiveStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AcquireArchiveStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entry)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, entry);
}
// Autogenerated method: System.IO.Compression.ZipArchive.AddEntry
void System::IO::Compression::ZipArchive::AddEntry(::System::IO::Compression::ZipArchiveEntry* entry) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::AddEntry");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AddEntry", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entry)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, entry);
}
// Autogenerated method: System.IO.Compression.ZipArchive.ReleaseArchiveStream
void System::IO::Compression::ZipArchive::ReleaseArchiveStream(::System::IO::Compression::ZipArchiveEntry* entry) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::ReleaseArchiveStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReleaseArchiveStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entry)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, entry);
}
// Autogenerated method: System.IO.Compression.ZipArchive.RemoveEntry
void System::IO::Compression::ZipArchive::RemoveEntry(::System::IO::Compression::ZipArchiveEntry* entry) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::RemoveEntry");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RemoveEntry", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entry)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, entry);
}
// Autogenerated method: System.IO.Compression.ZipArchive.ThrowIfDisposed
void System::IO::Compression::ZipArchive::ThrowIfDisposed() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::ThrowIfDisposed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ThrowIfDisposed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.CloseStreams
void System::IO::Compression::ZipArchive::CloseStreams() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::CloseStreams");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CloseStreams", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.EnsureCentralDirectoryRead
void System::IO::Compression::ZipArchive::EnsureCentralDirectoryRead() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::EnsureCentralDirectoryRead");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnsureCentralDirectoryRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.Init
void System::IO::Compression::ZipArchive::Init(::System::IO::Stream* stream, ::System::IO::Compression::ZipArchiveMode mode, bool leaveOpen) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::Init");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Init", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(stream), ::il2cpp_utils::ExtractType(mode), ::il2cpp_utils::ExtractType(leaveOpen)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stream, mode, leaveOpen);
}
// Autogenerated method: System.IO.Compression.ZipArchive.ReadCentralDirectory
void System::IO::Compression::ZipArchive::ReadCentralDirectory() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::ReadCentralDirectory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReadCentralDirectory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory
void System::IO::Compression::ZipArchive::ReadEndOfCentralDirectory() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::ReadEndOfCentralDirectory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReadEndOfCentralDirectory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.WriteFile
void System::IO::Compression::ZipArchive::WriteFile() {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::WriteFile");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: System.IO.Compression.ZipArchive.WriteArchiveEpilogue
void System::IO::Compression::ZipArchive::WriteArchiveEpilogue(int64_t startOfCentralDirectory, int64_t sizeOfCentralDirectory) {
static auto ___internal__logger = ::Logger::get().WithContext("::System::IO::Compression::ZipArchive::WriteArchiveEpilogue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteArchiveEpilogue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(startOfCentralDirectory), ::il2cpp_utils::ExtractType(sizeOfCentralDirectory)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, startOfCentralDirectory, sizeOfCentralDirectory);
}
| 82.772157 | 478 | 0.774834 | RedBrumbler |
129decae7c2bfb652cde64569525de0b4d86450a | 6,855 | cpp | C++ | cinkciarzclient.cpp | dbautsch/CinkciarzClient | 077133f4b67bb567e753a297a9f08d6e865a9939 | [
"MIT"
] | null | null | null | cinkciarzclient.cpp | dbautsch/CinkciarzClient | 077133f4b67bb567e753a297a9f08d6e865a9939 | [
"MIT"
] | null | null | null | cinkciarzclient.cpp | dbautsch/CinkciarzClient | 077133f4b67bb567e753a297a9f08d6e865a9939 | [
"MIT"
] | null | null | null | #include "cinkciarzclient.h"
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QFile>
#include <QDebug>
#include <QCoreApplication>
static const QString currenciesUrl = "https://cinkciarz.pl/kantor/kursy-walut-cinkciarz-pl";
CinkciarzClient::CinkciarzClient(QNetworkAccessManager *networkManager,
QObject *parent)
: QObject(parent),
networkManager(networkManager)
{
}
void CinkciarzClient::FetchCurrencies()
{
/*
* (SLOT)
*/
HttpGet(currenciesUrl);
}
void CinkciarzClient::HttpGet(QString url)
{
auto * reply = networkManager->get(QNetworkRequest(QUrl(url)));
connect(reply,
&QNetworkReply::finished,
this,
&CinkciarzClient::HttpGetFinished);
}
void CinkciarzClient::HttpGetFinished()
{
auto * reply = qobject_cast<QNetworkReply*>(QObject::sender());
QString data = reply->readAll();
reply->deleteLater();
CurrencyInformationList currenciesInformation50k;
CurrencyInformationList currenciesInformation;
ParseNetworkReply(currenciesInformation50k,
currenciesInformation,
data);
emit CurrenciesReady(currenciesInformation50k, currenciesInformation);
}
void CinkciarzClient::ParseNetworkReply(CurrencyInformationList ¤ciesInformation50k,
CurrencyInformationList & currenciesInformation,
QString data)
{
#ifdef DUMP_RESPONSES
QFile f(QCoreApplication::applicationDirPath() + "/response.html");
if (f.open(QIODevice::WriteOnly | QIODevice::Text) == false)
{
qDebug() << "Unable to create response.html file";
}
else
{
QTextStream s(&f);
s << data;
s.flush();
f.close();
}
#endif // DUMP_RESPONSES defined
if (data.length() == 0)
{
return;
}
QString currencyData50k, currencyData;
Get50kUnitsCurrencyData(data, currencyData50k);
ParseCurrencyData(currencyData50k, currenciesInformation50k);
Get1UnitCurrencyData(data, currencyData);
ParseCurrencyData(currencyData, currenciesInformation);
}
void CinkciarzClient::ParseCurrencyData(QString currencyData,
CurrencyInformationList & currencyInformation)
{
int previousLocation = -1;
int lastPos;
CurrencyInformation info;
while (GetNextCurrencyInformation(currencyData,
previousLocation,
info,
lastPos))
{
currencyInformation.push_back(info);
previousLocation = lastPos;
}
}
void CinkciarzClient::Get50kUnitsCurrencyData(QString data, QString & currencyData)
{
currencyData = ExtractElementFromString(data,
"<div role=\"tabpanel\"",
"id=\"for-50k\">",
"</tbody>");
}
void CinkciarzClient::Get1UnitCurrencyData(QString data, QString & currencyData)
{
currencyData = ExtractElementFromString(data,
"<div role=\"tabpanel\"",
"id=\"for-1\">",
"</tbody>");
}
QString CinkciarzClient::ExtractElementFromString(QString data,
QString first,
QString second,
QString third,
int startFrom,
int *firstOccurencePos)
{
auto firstPos = data.indexOf(first, startFrom);
if (firstPos < 0)
{
return QString();
}
if (firstOccurencePos != nullptr)
{
*firstOccurencePos = firstPos;
}
auto secondPos = data.indexOf(second, firstPos + first.length());
if (secondPos < 0)
{
return QString();
}
auto thirdPos = data.indexOf(third, secondPos + second.length());
if (thirdPos < 0)
{
return QString();
}
return data.mid(secondPos + second.length(),
thirdPos - (secondPos + second.length()));
}
bool CinkciarzClient::GetNextCurrencyInformation(QString data,
int previousLocation,
CurrencyInformation & currencyInformation,
int &lastPos)
{
if (previousLocation < 0)
{
previousLocation = 0;
}
int occurencePos;
currencyInformation.name = (ExtractElementFromString(data,
"<td data-label=\"Nazwa\">",
"\">",
"</a>",
previousLocation,
&occurencePos)).trimmed();
previousLocation = occurencePos;
currencyInformation.code = (ExtractElementFromString(data,
"\"Kod waluty\">",
"</strong>",
"</td>",
previousLocation,
&occurencePos)).trimmed();
previousLocation = occurencePos;
currencyInformation.buyingValue = (ExtractElementFromString(data,
"data-buy=\"true",
"\">",
"</td>",
previousLocation,
&occurencePos)).trimmed();
previousLocation = occurencePos;
currencyInformation.sellingValue = (ExtractElementFromString(data,
"data-sell=\"true",
"\">",
"</td>",
previousLocation,
&occurencePos)).trimmed();
currencyInformation.timestampUTC = QDateTime::currentDateTimeUtc();
lastPos = occurencePos;
return currencyInformation.IsValid();
}
| 32.334906 | 92 | 0.47469 | dbautsch |
129e460f38f866384518f5430ab009c38ac67265 | 695 | cpp | C++ | 2018/day-02/2b.cpp | Valokoodari/advent-of-code | c664987f739e0b07ddad34bad87d56768556a5a5 | [
"MIT"
] | 2 | 2021-12-27T18:59:11.000Z | 2022-01-10T02:31:36.000Z | 2018/day-02/2b.cpp | Valokoodari/advent-of-code-2019 | c664987f739e0b07ddad34bad87d56768556a5a5 | [
"MIT"
] | null | null | null | 2018/day-02/2b.cpp | Valokoodari/advent-of-code-2019 | c664987f739e0b07ddad34bad87d56768556a5a5 | [
"MIT"
] | 2 | 2021-12-23T17:29:10.000Z | 2021-12-24T03:21:49.000Z | #include <iostream>
#include <vector>
#include <string>
std::string x;
std::vector<std::string> ids;
int a,s;
bool d = false;
int main() {
freopen("2_input", "r", stdin);
freopen("2b_output", "w", stdout);
while (std::cin >> x && !d) {
for (int i = 0; i < ids.size(); i++) {
s = 0;
for (int j = 0; j < x.size(); j++) {
if (x[j] != ids[i][j])
s++;
}
if (s == 1) {
d = true;
a = i;
break;
}
}
ids.push_back(x);
}
std::cout << ids[ids.size() - 1] << "\n";
std::cout << ids[a] << "\n";
return 0;
} | 19.857143 | 48 | 0.37554 | Valokoodari |
12a18af74dd0a37690d9b20827f4d7381cef0dfc | 287 | hpp | C++ | src/scene/Entity_Base.hpp | IsraelEfraim/cpp-engine | 039bcad97d55635a7a8f31d0d80ce59095ebb6cb | [
"MIT"
] | null | null | null | src/scene/Entity_Base.hpp | IsraelEfraim/cpp-engine | 039bcad97d55635a7a8f31d0d80ce59095ebb6cb | [
"MIT"
] | null | null | null | src/scene/Entity_Base.hpp | IsraelEfraim/cpp-engine | 039bcad97d55635a7a8f31d0d80ce59095ebb6cb | [
"MIT"
] | 2 | 2021-03-15T18:51:32.000Z | 2021-07-19T23:45:49.000Z | #ifndef CPP_ENGINE_ENTITY_BASE_HPP
#define CPP_ENGINE_ENTITY_BASE_HPP
namespace engine {
class Entity_Base {
public:
virtual auto render() -> void {}
virtual auto update(float seconds) -> void {}
virtual ~Entity_Base() = default;
};
}
#endif //CPP_ENGINE_ENTITY_BASE_HPP
| 17.9375 | 49 | 0.735192 | IsraelEfraim |
12a3059c8153d30898927ad57381d829df24a176 | 1,634 | cpp | C++ | CppFBPComponents/Components/ThFileWt.cpp | nyue/cppfbp | f3cc99236db5a59a09f3d8924b2d1b95f2111741 | [
"Artistic-2.0"
] | 58 | 2015-01-01T15:33:56.000Z | 2022-01-14T07:29:20.000Z | CppFBPComponents/Components/ThFileWt.cpp | nyue/cppfbp | f3cc99236db5a59a09f3d8924b2d1b95f2111741 | [
"Artistic-2.0"
] | 8 | 2015-12-29T17:38:01.000Z | 2019-10-12T14:01:01.000Z | CppFBPComponents/Components/ThFileWt.cpp | nyue/cppfbp | f3cc99236db5a59a09f3d8924b2d1b95f2111741 | [
"Artistic-2.0"
] | 15 | 2015-01-20T04:02:35.000Z | 2022-01-14T07:30:00.000Z | //#pragma comment(lib, "CppFBPCore")
#include "StdAfx.h"
#include <string.h>
#include "compsvcs.h"
/* THFILEWT writes incoming entities to the file named on port OPT and
optionally passes the entities on to an output stream.
CALLING THFILEWT:
"filename.ext" -> OPT write_ents(THFILEWT),
input data stream -> IN write_ents [ OUT -> output data stream ];
LIMITATIONS:
Any special characters which cause problems for C's PUTC will not
be written properly.
DEFAULTS:
None
*/
//#include <setjmp.h>
#include <stdio.h>
THRCOMP ThFileWt(_anchor proc_anchor) {
void *ptr;
char *dptr;
int value, i;
long size;
char *type;
char fname[256];
int ch;
port_ent port_tab[3];
FILE *fp;
//char buffer[256];
value = dfsdfpt(proc_anchor, 3, port_tab, "OPT", "IN", "OUT");
/*obtain filename parameter
*/
value = dfsrecv(proc_anchor, &ptr, &port_tab[0], 0, &size, &type);
memcpy(fname, ptr, size);
value = dfsdrop(proc_anchor, &ptr);
fname[size] = '\0';
#ifdef WIN32
errno_t err;
if ((err = fopen_s(&fp, fname, "w")) != 0) {
#else
if ((f = fopen(fname, "w")) == NULL) {
#endif
fprintf(stderr, "Cannot open file %s!\n", fname);
return(8);
}
value = dfsrecv(proc_anchor, &ptr, &port_tab[1], 0, &size, &type);
while (value == 0)
{
dptr = (char *)ptr;
for (i = 0; i < size; i++) {
ch = (int)* (dptr + i);
value = fputc(ch, fp);
}
value = fputc('\n', fp);
value = dfssend(proc_anchor, &ptr, &port_tab[2], 0);
if (value == 2)
value = dfsdrop(proc_anchor, &ptr);
value = dfsrecv(proc_anchor, &ptr, &port_tab[1], 0, &size, &type);
}
fclose(fp);
return(0);
}
| 22.383562 | 70 | 0.626683 | nyue |
12aa92bab64fdd221368582102e9b94384639095 | 1,040 | cpp | C++ | core-tests/src/rbtree.cpp | Inokinoki/swoole-src | 4cd91a50bdc0f3784f0d0aa555f36733fc1977bc | [
"Apache-2.0"
] | 9 | 2018-03-26T08:55:42.000Z | 2020-01-20T06:24:18.000Z | core-tests/src/rbtree.cpp | Inokinoki/swoole-src | 4cd91a50bdc0f3784f0d0aa555f36733fc1977bc | [
"Apache-2.0"
] | null | null | null | core-tests/src/rbtree.cpp | Inokinoki/swoole-src | 4cd91a50bdc0f3784f0d0aa555f36733fc1977bc | [
"Apache-2.0"
] | 1 | 2020-04-10T05:58:10.000Z | 2020-04-10T05:58:10.000Z | #include "tests.h"
#include "rbtree.h"
#include <set>
TEST(rbtree, insert)
{
swRbtree *tree = swRbtree_new();
int i;
std::set<uint32_t> lists;
for (i = 1; i < 20000; i++)
{
uint32_t key = i * 37;
swRbtree_insert(tree, key, (void *) (long) (i * 8));
}
for (i = 1; i < 1024; i++)
{
uint32_t key = ((rand() % 19999) + 1) * 37;
int ret = (int) (long) swRbtree_find(tree, key);
ASSERT_GT(ret, 0);
lists.insert(key);
}
for (i = 1; i < 1024; i++)
{
uint32_t key = (rand() % (20000 * 37));
if (key % 37 == 0)
{
continue;
}
int ret = (int) (long) swRbtree_find(tree, key);
ASSERT_EQ(ret, 0);
}
for (auto i = lists.begin(); i != lists.end(); i++)
{
int ret = swRbtree_delete(tree, *i);
ASSERT_EQ(ret, 0);
}
for (auto i = lists.begin(); i != lists.end(); i++)
{
int ret = (int) (long) swRbtree_find(tree, *i);
ASSERT_EQ(ret, 0);
}
}
| 21.666667 | 60 | 0.467308 | Inokinoki |
12abb2f888aea44ae9c68deabdee5c0b5c32b480 | 939 | cpp | C++ | pawnfield.cpp | mdziubich/chessGame_cpp | 80ff8adc17d6fa72441400e80a715f516e5b2989 | [
"MIT"
] | 2 | 2019-08-25T09:09:42.000Z | 2022-03-26T22:49:10.000Z | pawnfield.cpp | mdziubich/chessGame_cpp | 80ff8adc17d6fa72441400e80a715f516e5b2989 | [
"MIT"
] | 1 | 2019-10-13T02:50:45.000Z | 2019-11-06T20:31:37.000Z | pawnfield.cpp | mdziubich/chessGame_cpp | 80ff8adc17d6fa72441400e80a715f516e5b2989 | [
"MIT"
] | null | null | null | #include "pawnfield.h"
#include <QGraphicsProxyWidget>
#include "boardfield.h"
#include "boardposition.h"
#include "gameview.h"
#include "utils.h"
extern GameView *game;
PawnField::PawnField(BoardPosition position,
QString imagePath,
QGraphicsItem *parent): QGraphicsRectItem(parent) {
this->position = position;
imageLabel = new QLabel();
image = QPixmap(imagePath);
QGraphicsProxyWidget *pMyProxy = new QGraphicsProxyWidget(this);
imageLabel->setPixmap(image);
imageLabel->setAttribute(Qt::WA_TranslucentBackground);
pMyProxy->setWidget(imageLabel);
setPen(Qt::NoPen);
}
void PawnField::setPosition(BoardPosition position) {
this->position = position;
}
void PawnField::setImage(QString imagePath) {
image.load(imagePath);
imageLabel->clear();
imageLabel->setPixmap(image);
}
BoardPosition PawnField::getPosition() {
return position;
}
| 24.710526 | 72 | 0.702875 | mdziubich |
12b0148867faeccf65a37e3c35a5cbb3da8c31dc | 567 | cpp | C++ | src/mutex.cpp | PokIsemaine/fishjoy | 97d9e2f0c04a9e4c770d87c8bb6f7fdb2de2d239 | [
"Unlicense"
] | null | null | null | src/mutex.cpp | PokIsemaine/fishjoy | 97d9e2f0c04a9e4c770d87c8bb6f7fdb2de2d239 | [
"Unlicense"
] | null | null | null | src/mutex.cpp | PokIsemaine/fishjoy | 97d9e2f0c04a9e4c770d87c8bb6f7fdb2de2d239 | [
"Unlicense"
] | null | null | null | //
// Created by zsl on 5/31/22.
//
#include "fishjoy/mutex.hpp"
namespace fishjoy {
Semaphore::Semaphore(uint32_t count) {
if (sem_init(&m_semaphore, 0, count) != 0) {
throw std::logic_error("sem_init error");
}
}
Semaphore::~Semaphore() { sem_destroy(&m_semaphore); }
void Semaphore::wait() {
if (sem_wait(&m_semaphore) != 0) {
throw std::logic_error("sem_wait error");
}
}
void Semaphore::notify() {
if (sem_post(&m_semaphore) != 0) {
throw std::logic_error("sem_post error");
}
}
} // namespace fishjoy | 21.807692 | 56 | 0.613757 | PokIsemaine |
12b16e5dca09f1c5669a60b05bcd585e4d6cdd9c | 2,040 | cpp | C++ | src/target/main.cpp | anxri/gateway | cdfc7c13b5e08296c11618fc07185c6be467163f | [
"MIT"
] | null | null | null | src/target/main.cpp | anxri/gateway | cdfc7c13b5e08296c11618fc07185c6be467163f | [
"MIT"
] | null | null | null | src/target/main.cpp | anxri/gateway | cdfc7c13b5e08296c11618fc07185c6be467163f | [
"MIT"
] | null | null | null | #include <iostream>
#include <string>
#include "../../include/UdpSocket.h"
#include "../../include/aes.hpp"
#include "../read_single_conf.h"
using std::cout;
using std::endl;
using std::string;
using toolbox::UdpSocket;
string fetch_ip()
{
FILE *fp;
char path[10000];
fp = popen("curl -s ifconfig.me", "r");
if (fp == NULL)
{
printf("Failed to run command\n" );
exit(1);
}
string output = "";
while ( fgets(path, sizeof( path ), fp ) != NULL )
{
output += path;
}
/* close */
pclose(fp);
return output;
}
int main( int argc, char *argv[] )
{
string server_ip = read_single_conf( "/home/noxx/.config/lacus/target/ip" );
string server_port = read_single_conf( "/home/noxx/.config/lacus/target/port" );
string secret = read_single_conf( "/home/noxx/.config/lacus/target/key" );
if(secret == "")\
return 10;
int pid = fork();
if( pid < 0 )
{
return 271;
}
else if ( pid == 0 )
{
int curl_exit_code = execl("$1 > /dev/null 2>&1\n"
"status=$?\n"
"echo ${status}\n"
"exit ${status}", "--version", NULL );
if( curl_exit_code == -1 )
return 270;
cout << "curl exit code is: " << curl_exit_code << endl;
}
string my_ip = fetch_ip();
cout << my_ip << endl;
UdpSocket sock = UdpSocket();
sock.udp_create();
std::vector<uint8_t> secret_vec(secret.begin(), secret.end());
uint8_t * key = &secret_vec[0];
std::vector<uint8_t> ip_vec(my_ip.begin(), my_ip.end());
uint8_t * in = &ip_vec[0];
uint8_t iv[16] = { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff };
struct AES_ctx ctx;
AES_init_ctx_iv(&ctx, key, iv);
AES_CTR_xcrypt_buffer(&ctx, in, strlen((char*)in));
sock.udp_send((char*)in, server_ip, server_port );
sock.close();
return 0;
}
| 22.666667 | 120 | 0.542157 | anxri |
12b1d0c523273c4d97a80b767298a0c04644c33f | 1,788 | cpp | C++ | catkin_ws/action_client_pkg/src/ardrone_action_client.cpp | BV-Pradeep/RIA-ROS-Basics-with-CPP-in-5-days | 2c33397de94a5d35cd9bb5d957fb0a15dd0b70b1 | [
"MIT"
] | 5 | 2019-08-09T03:07:30.000Z | 2021-12-09T15:51:09.000Z | catkin_ws/action_client_pkg/src/ardrone_action_client.cpp | BV-Pradeep/RIA-ROS-Basics-with-CPP-in-5-days | 2c33397de94a5d35cd9bb5d957fb0a15dd0b70b1 | [
"MIT"
] | null | null | null | catkin_ws/action_client_pkg/src/ardrone_action_client.cpp | BV-Pradeep/RIA-ROS-Basics-with-CPP-in-5-days | 2c33397de94a5d35cd9bb5d957fb0a15dd0b70b1 | [
"MIT"
] | 3 | 2019-07-22T07:43:46.000Z | 2021-07-12T14:23:24.000Z | #include <actionlib/client/simple_action_client.h>
#include <ardrone_as/ArdroneAction.h> // Note: "Action" is appended
#include <ros/ros.h>
int nImage = 0; // Initialization of a global variable
// Definition of the done calback. It is called once when the goal completes
void doneCb(const actionlib::SimpleClientGoalState &state,
const ardrone_as::ArdroneResultConstPtr &result) {
ROS_INFO("The Action has been completed");
ros::shutdown();
}
// Definition of the active callback. It is called once when the goal becomes
// active
void activeCb() { ROS_INFO("Goal just went active"); }
// Definition of the feedback callback. This will be called when feedback is
// received from the action server. It just // prints a message indicating a new
// message has been received
void feedbackCb(const ardrone_as::ArdroneFeedbackConstPtr &feedback) {
ROS_INFO("[Feedback] image n.%d received", nImage);
++nImage;
}
int main(int argc, char **argv) {
ros::init(argc, argv,
"drone_action_client"); // Initializes the action client node
// Create the connection to the action server
actionlib::SimpleActionClient<ardrone_as::ArdroneAction> client(
"ardrone_action_server", true);
client.waitForServer(); // Waits until the action server is up and running
ardrone_as::ArdroneGoal goal; // Creates a goal to send to the action server
goal.nseconds =
10; // Fills the goal. Indicates, take pictures along 10 seconds
client.sendGoal(
goal, &doneCb, &activeCb,
&feedbackCb); // sends the goal to the action server, specifying which //
// functions to call when the goal completes, when the //
// goal becames active, and when feedback is received
client.waitForResult();
return 0;
} | 39.733333 | 80 | 0.713087 | BV-Pradeep |
12b23575180bb10d817c24cf6002947aa122889c | 1,438 | cpp | C++ | exec/readCircuitFile.cpp | zghodsi/TinyGarble2.0 | aa0c8a56848ee3f6d2354988028ec715d5e73e25 | [
"MIT"
] | null | null | null | exec/readCircuitFile.cpp | zghodsi/TinyGarble2.0 | aa0c8a56848ee3f6d2354988028ec715d5e73e25 | [
"MIT"
] | null | null | null | exec/readCircuitFile.cpp | zghodsi/TinyGarble2.0 | aa0c8a56848ee3f6d2354988028ec715d5e73e25 | [
"MIT"
] | null | null | null | #include <emp-tool-tg/emp-tool/emp-tool.h>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <cstdlib>
#include <fstream>
using namespace std;
namespace po = boost::program_options;
int main(int argc, char** argv) {
string netlist_address_in, netlist_address_out;
po::options_description desc{"Read EMP circuit and write to binary file. \nAllowed options"};
desc.add_options() //
("help,h", "produce help message") //
("input,i", po::value<string>(&netlist_address_in), "input text file address.");
po::variables_map vm;
try {
po::parsed_options parsed = po::command_line_parser(argc, argv).options(desc).allow_unregistered().run();
po::store(parsed, vm);
if (vm.count("help")) {
cout << desc << endl;
return 0;
}
po::notify(vm);
}catch (po::error& e) {
cout << "ERROR: " << e.what() << endl << endl;
cout << desc << endl;
return -1;
}
netlist_address_out = netlist_address_in + ".bin";
Timer T;
uint64_t dc_t, dc_b;
double dt_t, dt_b;
T.start();
CircuitFile cf (netlist_address_in.c_str());
T.get(dc_t, dt_t);
cf.toBinary(netlist_address_out.c_str());
T.start();
CircuitFile cf1 (netlist_address_out.c_str(), true);
T.get(dc_b, dt_b);
cout << "text file: " << netlist_address_in << " >> binary file: " << netlist_address_out << "| speed-up: " << dt_t/dt_b << endl;
return 0;
}
| 25.22807 | 132 | 0.6363 | zghodsi |
12b5ad10c0130c27b492beb204bbf20e7a1c6d63 | 2,367 | cpp | C++ | deps/opencolorio-2.0.0/src/OpenColorIO/transforms/builtins/PanasonicCameras.cpp | julescmay/LuxCore | 3a6233f37afaf064300f52854715c0ab9ca2103e | [
"Apache-2.0"
] | 826 | 2017-12-12T15:38:16.000Z | 2022-03-28T07:12:40.000Z | deps/opencolorio-2.0.0/src/OpenColorIO/transforms/builtins/PanasonicCameras.cpp | julescmay/LuxCore | 3a6233f37afaf064300f52854715c0ab9ca2103e | [
"Apache-2.0"
] | 655 | 2019-04-16T15:15:31.000Z | 2022-03-31T18:05:52.000Z | deps/opencolorio-2.0.0/src/OpenColorIO/transforms/builtins/PanasonicCameras.cpp | julescmay/LuxCore | 3a6233f37afaf064300f52854715c0ab9ca2103e | [
"Apache-2.0"
] | 181 | 2018-12-22T15:39:52.000Z | 2022-03-22T09:52:27.000Z | // SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenColorIO Project.
#include <cmath>
#include <OpenColorIO/OpenColorIO.h>
#include "ops/matrix/MatrixOp.h"
#include "ops/log/LogOp.h"
#include "transforms/builtins/ACES.h"
#include "transforms/builtins/BuiltinTransformRegistry.h"
#include "transforms/builtins/ColorMatrixHelpers.h"
#include "transforms/builtins/OpHelpers.h"
#include "transforms/builtins/PanasonicCameras.h"
namespace OCIO_NAMESPACE
{
namespace PANASONIC_VLOG_VGAMUT
{
static const Chromaticities red_xy(0.730, 0.280);
static const Chromaticities grn_xy(0.165, 0.840);
static const Chromaticities blu_xy(0.100, -0.030);
static const Chromaticities wht_xy(0.3127, 0.3290);
const Primaries primaries(red_xy, grn_xy, blu_xy, wht_xy);
}
namespace PANASONIC_VLOG_VGAMUT_to_LINEAR
{
static constexpr double cut1 = 0.01;
static constexpr double b = 0.00873;
static constexpr double c = 0.241514;
static constexpr double d = 0.598206;
static constexpr double linSideSlope = 1.;
static constexpr double linSideOffset = b;
static constexpr double logSideSlope = c;
static constexpr double logSideOffset = d;
static constexpr double linSideBreak = cut1;
static constexpr double base = 10.;
static const LogOpData::Params
params { logSideSlope, logSideOffset, linSideSlope, linSideOffset, linSideBreak };
static const LogOpData log(base, params, params, params, TRANSFORM_DIR_INVERSE);
}
namespace CAMERA
{
namespace PANASONIC
{
void RegisterAll(BuiltinTransformRegistryImpl & registry) noexcept
{
{
auto PANASONIC_VLOG_VGAMUT_to_ACES2065_1_Functor = [](OpRcPtrVec & ops)
{
LogOpDataRcPtr log = PANASONIC_VLOG_VGAMUT_to_LINEAR::log.clone();
CreateLogOp(ops, log, TRANSFORM_DIR_FORWARD);
MatrixOpData::MatrixArrayPtr matrix
= build_conversion_matrix(PANASONIC_VLOG_VGAMUT::primaries, ACES_AP0::primaries, ADAPTATION_BRADFORD);
CreateMatrixOp(ops, matrix, TRANSFORM_DIR_FORWARD);
};
registry.addBuiltin("PANASONIC_VLOG-VGAMUT_to_ACES2065-1",
"Convert Panasonic Varicam V-Log V-Gamut to ACES2065-1",
PANASONIC_VLOG_VGAMUT_to_ACES2065_1_Functor);
}
}
} // namespace PANASONIC
} // namespace CAMERA
} // namespace OCIO_NAMESPACE
| 28.865854 | 118 | 0.73553 | julescmay |
12b9dca9a6084bc1ff852988a0fbd49f06015415 | 1,364 | cpp | C++ | module04/ex01/PlasmaRifle.cpp | selysse/CPP-Piscine | 72884c60ac5007d34874b006e37dad7a04e846bb | [
"MIT"
] | 1 | 2021-09-17T13:25:47.000Z | 2021-09-17T13:25:47.000Z | module04/ex01/PlasmaRifle.cpp | selysse/CPP-Piscine | 72884c60ac5007d34874b006e37dad7a04e846bb | [
"MIT"
] | null | null | null | module04/ex01/PlasmaRifle.cpp | selysse/CPP-Piscine | 72884c60ac5007d34874b006e37dad7a04e846bb | [
"MIT"
] | null | null | null | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PlasmaRifle.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gselyse <gselyse@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/03/05 03:33:08 by gselyse #+# #+# */
/* Updated: 2021/03/07 19:42:56 by gselyse ### ########.fr */
/* */
/* ************************************************************************** */
#include "PlasmaRifle.hpp"
PlasmaRifle::PlasmaRifle() : AWeapon("Plasma Rifle", 5, 21)
{
}
PlasmaRifle::PlasmaRifle(PlasmaRifle const ©) : AWeapon(copy)
{
}
PlasmaRifle &PlasmaRifle::operator=(PlasmaRifle const ©)
{
this->_name = copy.getName();
this->_apcost = copy.getAPCost();
this->_damage = copy.getDamage();
return (*this);
}
PlasmaRifle::~PlasmaRifle()
{
}
void PlasmaRifle::attack()const
{
std::cout << "* piouuu piouuu piouuu *" << std::endl;
} | 35.894737 | 80 | 0.313783 | selysse |
12bd1a3ad6148b1f94e4885b69761a9722bab38f | 1,317 | cpp | C++ | src/py/wrapper/wrapper_08568636c5a25349ad6ad5335ed1718e.cpp | StatisKit/Core | 79d8ec07c203eb7973a6cf482852ddb2e8e1e93e | [
"Apache-2.0"
] | null | null | null | src/py/wrapper/wrapper_08568636c5a25349ad6ad5335ed1718e.cpp | StatisKit/Core | 79d8ec07c203eb7973a6cf482852ddb2e8e1e93e | [
"Apache-2.0"
] | 7 | 2018-03-20T14:23:16.000Z | 2019-04-09T11:57:57.000Z | src/py/wrapper/wrapper_08568636c5a25349ad6ad5335ed1718e.cpp | StatisKit/Core | 79d8ec07c203eb7973a6cf482852ddb2e8e1e93e | [
"Apache-2.0"
] | 7 | 2017-04-28T07:41:01.000Z | 2021-03-15T18:17:20.000Z | #include "_core.h"
namespace autowig {
}
void wrapper_08568636c5a25349ad6ad5335ed1718e(pybind11::module& module)
{
pybind11::class_<class ::statiskit::LazyEstimation< struct ::statiskit::MultivariateMixtureDistribution< struct ::statiskit::ContinuousMultivariateDistribution >, struct ::statiskit::ContinuousMultivariateDistributionEstimation >, autowig::HolderType< class ::statiskit::LazyEstimation< struct ::statiskit::MultivariateMixtureDistribution< struct ::statiskit::ContinuousMultivariateDistribution >, struct ::statiskit::ContinuousMultivariateDistributionEstimation > >::Type, struct ::statiskit::ContinuousMultivariateDistributionEstimation > class_08568636c5a25349ad6ad5335ed1718e(module, "_LazyEstimation_08568636c5a25349ad6ad5335ed1718e", "");
class_08568636c5a25349ad6ad5335ed1718e.def(pybind11::init< >());
class_08568636c5a25349ad6ad5335ed1718e.def(pybind11::init< struct ::statiskit::MultivariateMixtureDistribution< struct ::statiskit::ContinuousMultivariateDistribution > const * >());
class_08568636c5a25349ad6ad5335ed1718e.def(pybind11::init< class ::statiskit::LazyEstimation< struct ::statiskit::MultivariateMixtureDistribution< struct ::statiskit::ContinuousMultivariateDistribution >, struct ::statiskit::ContinuousMultivariateDistributionEstimation > const & >());
} | 87.8 | 648 | 0.826879 | StatisKit |
5215e913d12581541240d67e27f5932fcbfa89bf | 146,702 | cpp | C++ | soap4/DV-DPfunctions.cpp | HKU-BAL/MegaPath | b81796024f864af5fd44deb5812f34704c570160 | [
"BSD-3-Clause"
] | 6 | 2021-10-06T07:47:04.000Z | 2022-01-25T05:09:08.000Z | soap4/DV-DPfunctions.cpp | edwwlui/MegaPath | b81796024f864af5fd44deb5812f34704c570160 | [
"BSD-3-Clause"
] | null | null | null | soap4/DV-DPfunctions.cpp | edwwlui/MegaPath | b81796024f864af5fd44deb5812f34704c570160 | [
"BSD-3-Clause"
] | null | null | null | /*
*
* DV-DPfunctions.cu
* Soap3(gpu)
*
* Copyright (C) 2011, HKU
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include <iostream>
#include <queue>
#include <omp.h>
#include "DV-DPfunctions.h"
#include "OutputDPResult.h"
#include <assert.h>
#include <pthread.h>
#include <algorithm>
#include <parallel/algorithm>
#include "kxsort.h"
#include <tuple>
using namespace std;
const unsigned long long kMaxULL = 0xFFFFFFFFFFFFFFFFULL;
//////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////// For output ////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
AlgnmtFlags::AlgnmtFlags ( uint range )
{
size = ( range + 31 ) / 32;
MC_CheckMalloc ( flags, uint, size );
for ( int i = 0; i < 32; i++ )
{
MASK[i] = 1 << i;
}
pthread_mutex_init ( &occupy_mutex, NULL );
clear();
}
void AlgnmtFlags::clear()
{
memset ( flags, 0, size * sizeof ( uint ) );
}
void AlgnmtFlags::increaseSize ( uint newSize )
{
uint * oldFlags = flags;
uint oldSize = size;
size = newSize;
MC_CheckMalloc ( flags, uint, size );
memcpy ( flags, oldFlags, oldSize * sizeof ( uint ) );
memset ( flags + oldSize, 0, ( newSize - oldSize ) * sizeof ( uint ) );
free ( oldFlags );
}
void AlgnmtFlags::set ( int readID )
{
pthread_mutex_lock ( &occupy_mutex );
uint offset = readID >> 5;
if ( offset >= size )
{
uint newSize = size * 2;
while ( offset >= newSize )
{ newSize *= 2; }
increaseSize ( newSize );
}
flags[offset] |= MASK[readID & 0x1F];
pthread_mutex_unlock ( &occupy_mutex );
}
#define AlgnmtFlags_Get(in_flag, int32Offset, diff) { \
uint flag = in_flag; \
if (flag != 0) { \
int offset = int32Offset << 5; \
for (int j = 0; flag != 0; j++) { \
if (flag & 1) { \
diff->push_back(offset + j); \
} \
flag >>= 1; \
} \
} \
}
void AlgnmtFlags::get ( vector<int> * diff )
{
for ( int i = 0; i < size; i++ )
{
AlgnmtFlags_Get ( flags[i], i, diff );
}
}
inline void AlgnmtFlags::reserveSize ( AlgnmtFlags * algnFlags )
{
if ( size < algnFlags->size )
{
this->increaseSize ( algnFlags->size );
}
else if ( size > algnFlags->size )
{
algnFlags->increaseSize ( size );
}
}
void AlgnmtFlags::getXOR ( AlgnmtFlags * algnFlags, vector<int> * diff )
{
reserveSize ( algnFlags );
for ( int i = 0; i < size; i++ )
{
AlgnmtFlags_Get ( flags[i] ^ algnFlags->flags[i], i, diff );
}
}
void AlgnmtFlags::AND ( AlgnmtFlags * algnFlags )
{
reserveSize ( algnFlags );
for ( int i = 0; i < size; i++ )
{
flags[i] &= algnFlags->flags[i];
}
}
void AlgnmtFlags::XOR ( AlgnmtFlags * algnFlags )
{
reserveSize ( algnFlags );
for ( int i = 0; i < size; i++ )
{
flags[i] ^= algnFlags->flags[i];
}
}
AlgnmtFlags::~AlgnmtFlags()
{
free ( flags );
}
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// Alignment modules //////////////////////////////////////
/////////////////// The following code better be placed in a seperate file ///////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// standard space ///////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
template <>
int isValid ( AlgnmtDPResult & a )
{
return ( a.whichFromDP < 2 );
}
template <>
int ScoreCompare ( AlgnmtDPResult & a, AlgnmtDPResult & b )
{
#define MC_DPScoreCompare_SetValue(result, aligned, mismatch, score) { \
if (result.whichFromDP == 0) { \
aligned = 1; \
mismatch = result.score_2; \
score = result.score_1; \
} \
else \
if (result.whichFromDP == 1) { \
aligned = 1; \
mismatch = result.score_1; \
score = result.score_2; \
} \
else { \
aligned = 0; \
if (result.algnmt_1 != kMaxULL) \
mismatch = result.score_1; \
else \
mismatch = result.score_2; \
score = 0; \
} \
}
uint aligned_a, mismatch_a, score_a;
uint aligned_b, mismatch_b, score_b;
MC_DPScoreCompare_SetValue ( a, aligned_a, mismatch_a, score_a );
MC_DPScoreCompare_SetValue ( b, aligned_b, mismatch_b, score_b );
uint64 value_a = ( ( uint64 ) aligned_a << 63 ) | ( ( uint64 ) ( 0x1FFFFFFF - mismatch_a ) << 32 ) | ( score_a + 0x1FFFFFFF );
uint64 value_b = ( ( uint64 ) aligned_b << 63 ) | ( ( uint64 ) ( 0x1FFFFFFF - mismatch_b ) << 32 ) | ( score_b + 0x1FFFFFFF );
if ( value_a > value_b )
{ return 1; }
else if ( value_a < value_b )
{ return -1; }
else
{ return 0; }
}
template <>
int ScoreCompare ( SingleAlgnmtResult & a, SingleAlgnmtResult & b )
{
if ( a.score > b.score )
{ return 1; }
else if ( a.score < b.score )
{ return -1; }
else
{ return 0; }
}
template <>
int ScoreCompare ( DeepDPAlignResult & a, DeepDPAlignResult & b )
{
int score_a = a.score_1 + a.score_2;
int score_b = b.score_1 + b.score_2;
if ( score_a > score_b )
{ return 1; }
else if ( score_a < score_b )
{ return -1; }
else
{ return 0; }
}
template <>
bool ResultCompare ( const AlgnmtDPResult & a, const AlgnmtDPResult & b )
{
return make_tuple(a.algnmt_1, a.algnmt_2, a.score_1, a.score_2) < make_tuple(b.algnmt_1, b.algnmt_2, b.score_1, b.score_2);
}
template <>
bool ResultCompare ( const SingleAlgnmtResult & a, const SingleAlgnmtResult & b )
{
return make_tuple(a.algnmt, a.score) < make_tuple(b.algnmt, b.score);
}
template <>
bool ResultCompare ( const DeepDPAlignResult & a, const DeepDPAlignResult & b )
{
return make_tuple(a.algnmt_1, a.algnmt_2, a.score_1, a.score_2) < make_tuple(b.algnmt_1, b.algnmt_2, b.score_1, b.score_2);
//return ( a.algnmt_1 == b.algnmt_1 ? ( a.score_1 == b.score_1 ? ( a.algnmt_2 == b.algnmt_2 ? a.score_2 > b.score_2 : a.algnmt_2 < b.algnmt_2 ) : a.score_1 > b.score_1 ) : a.algnmt_1 < b.algnmt_1 );
}
//////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// single-dp space //////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
using namespace SingleDP_Space;
#define DPS_SEEDING_BATCH_SIZE 256 * 1024
#define DPS_MARGIN(l) ((l>100) ? 30 : 25)
CandidateStream::CandidateStream()
{
pthread_mutex_init ( &occupy_mutex, NULL );
}
void CandidateStream::append ( vector<CandidateInfo> * canInfo, AlgnmtFlags * alignFlags )
{
pthread_mutex_lock ( &occupy_mutex );
for ( vector<CandidateInfo>::iterator it = canInfo->begin();
it < canInfo->end(); ++it )
{
data.push_back ( *it );
alignFlags->set ( it->readID );
}
pthread_mutex_unlock ( &occupy_mutex );
}
SingleEndSeedingEngine::SingleEndSeedingEngine() {}
struct LongerSeedLength {
bool operator() (const SeedPos &a, const SeedPos &b) {
return a.seedAlignmentLength > b.seedAlignmentLength;
}
};
vector<CandidateInfo> * SingleEndSeedingEngine::singleMerge (
SingleDP_Space::SeedPos * readPos, QueryIDStream * eliminatedReadIDs
)
{
vector<CandidateInfo> * canInfo = new vector<CandidateInfo>();
SingleDP_Space::SeedPos * p = readPos;
uint seedReadCnt = 0;
uint lastReadID = 0x7FFFFFFF;
// TODO: omp this part; may be significant
while ( p->readID != 0x7FFFFFFF )
{
uint readID = p->readID;
bool keepReads = false;
size_t oldSize = canInfo->size();
for (; p->readID == readID; p++ )
{
if (p->seedAlignmentLength < 17) {
continue;
}
keepReads = true;
canInfo->push_back(*p);
while ((p+1)->readID == readID) {
if ((p+1)->pos < canInfo->back().pos + DPS_DIVIDE_GAP && canInfo->back().strand == (p+1)->strand){
if ((p+1)->seedAlignmentLength > canInfo->back().seedAlignmentLength)
canInfo->back() = *(p+1);
} else {
break;
}
++p;
}
}
if (!keepReads && eliminatedReadIDs != NULL) {
eliminatedReadIDs->data->push_back(readID);
}
++seedReadCnt;
std::sort(canInfo->begin() + oldSize, canInfo->end(), LongerSeedLength());
if (oldSize < canInfo->size()) {
while (canInfo->back().seedAlignmentLength < (*canInfo)[oldSize].seedAlignmentLength * 0.6) {
canInfo->pop_back();
}
}
}
return canInfo;
}
// ****
SingleEndAlignmentEngine::SingleEndAlgnBatch::SingleEndAlgnBatch (
int batchSize, DPParameters * dpPara,
int maxReadLength, int maxDNALength, int maxDPTableLength, int patternLength,
Soap3Index * index, uint * queries, uint inputMaxReadLength, uint * upkdLengths,
DPInfoForReads * dpInfoForReads
)
{
MC_MemberCopy5 ( this->, , batchSize, maxReadLength, maxDNALength, maxDPTableLength, patternLength );
MC_MemberCopy3 ( this->, , queries, inputMaxReadLength, upkdLengths );
MC_MemberCopy ( this->, , dpInfoForReads );
MC_MemberCopy2 ( this->, dpPara->, softClipLeft, softClipRight );
this->wordPerOldQuery = getWordPerQuery ( inputMaxReadLength );
this->wordPerQuery = MC_CeilDivide16 ( maxReadLength );
this->wordPerDNA = MC_CeilDivide16 ( maxDNALength );
this->packedDNA = index->sraIndex->hsp->packedDNA;
this->fullDNALength = index->sraIndex->hsp->dnaLength;
this->index = index;
MC_CheckMalloc ( canInfos, CandidateInfo, batchSize );
MC_CheckMalloc ( DNALengths, uint, batchSize );
MC_CheckMalloc ( lengths, uint, batchSize );
MC_CheckMalloc ( packedDNASeq, uint, batchSize * MC_CeilDivide16 ( maxDNALength ) );
MC_CheckMalloc ( packedReadSeq, uint, batchSize * MC_CeilDivide16 ( maxReadLength ) );
MC_CheckMalloc ( scores, int, batchSize );
MC_CheckMalloc ( cutoffThresholds, int, batchSize );
MC_CheckMalloc ( softClipLtSizes, uint, batchSize );
MC_CheckMalloc ( softClipRtSizes, uint, batchSize );
MC_CheckMalloc ( peLeftAnchorLocs, uint, batchSize );
MC_CheckMalloc ( peRightAnchorLocs, uint, batchSize );
MC_CheckMalloc ( hitLocs, uint, batchSize );
MC_CheckMalloc ( pattern, uchar, batchSize * patternLength );
MC_CheckMalloc ( maxScoreCounts, uint, batchSize );
clear();
}
SingleEndAlignmentEngine::SingleEndAlgnBatch::~SingleEndAlgnBatch()
{
free ( canInfos );
free ( DNALengths );
free ( lengths );
free ( packedDNASeq );
free ( packedReadSeq );
free ( scores );
free ( cutoffThresholds );
free ( softClipLtSizes );
free ( softClipRtSizes );
free ( peLeftAnchorLocs );
free ( peRightAnchorLocs );
free ( hitLocs );
free ( pattern );
free ( maxScoreCounts );
}
void SingleEndAlignmentEngine::SingleEndAlgnBatch::clear()
{
numOfThreads = 0;
}
int SingleEndAlignmentEngine::SingleEndAlgnBatch::pack (
CandidateInfo & canInfo
)
{
if ( numOfThreads >= batchSize )
{
return 0;
}
uint readID = canInfo.readID;
uint readLength = upkdLengths[readID];
int margin = DPS_MARGIN ( readLength );
unsigned long long DNAStart = canInfo.pos - margin;
if ( DNAStart >= fullDNALength )
{
DNAStart = 0;
}
uint DNALength = readLength + margin * 2;
if ( DNAStart + DNALength > fullDNALength )
{
DNALength = fullDNALength - DNAStart;
}
packRead ( packedReadSeq, numOfThreads,
readID, readLength,
canInfo.strand );
repackDNA ( packedDNASeq, numOfThreads,
packedDNA, DNAStart, DNALength );
softClipLtSizes[numOfThreads] = ( canInfo.strand == 1 ) ?
softClipLeft : softClipRight;
softClipRtSizes[numOfThreads] = ( canInfo.strand == 1 ) ?
softClipRight : softClipLeft;
peLeftAnchorLocs[numOfThreads] = maxDNALength;
peRightAnchorLocs[numOfThreads] = 0;
DNALengths[numOfThreads] = DNALength;
lengths[numOfThreads] = readLength;
cutoffThresholds[numOfThreads] = std::max(DP_SCORE_THRESHOLD_RATIO * readLength, DP_SCORE_THRESHOLD_LOWER_BOUND);
canInfo.pos = DNAStart;
canInfos[numOfThreads] = canInfo;
++numOfThreads;
return 1;
}
inline void SingleEndAlignmentEngine::SingleEndAlgnBatch::packRead (
uint * packedSeq, uint threadId,
uint readID, uint length, int strand
)
{
#define MC_OldReadUnpack(X,i) ((X[oldReadTPARA + (((i)>>4)<<5)] >> (((i) & 0xF) << 1)) & 0x3)
uint oldReadTPARA = ( readID / 32 ) * 32 * wordPerOldQuery + ( readID % 32 );
uint readTPARA = ( threadId / 32 ) * 32 * wordPerQuery + ( threadId % 32 );
for ( uint i = 0; i <= ( length / CHAR_PER_WORD ); i++ )
{
packedSeq[readTPARA + ( i << 5 )] = 0;
}
if ( strand == 1 )
{
for ( int i = 1; i <= length; i++ )
{
int fwd_i = i - 1;
register uint c_nucleotide = ( uint ) MC_OldReadUnpack ( queries, fwd_i );
#ifdef BS_MOD
c_nucleotide = c_nucleotide ^ ( ( c_nucleotide == index->sraIndex->hsp->flag ) << 1 );
#endif
packedSeq[readTPARA + ( ( i >> 4 ) << 5 )] |= c_nucleotide << ( ( 15 - ( i & 0xF ) ) << 1 );
}
}
else // strand == 2
{
for ( int i = 1; i <= length; i++ )
{
int rev_i = length - i;
register uint c_nucleotide = soap3DnaComplement[( uint ) MC_OldReadUnpack ( queries, rev_i )];
#ifdef BS_MOD
c_nucleotide = c_nucleotide ^ ( ( c_nucleotide == index->sraIndex->hsp->flag ) << 1 );
#endif
packedSeq[readTPARA + ( ( i >> 4 ) << 5 )] |= c_nucleotide << ( ( 15 - ( i & 0xF ) ) << 1 );
}
}
}
inline void SingleEndAlignmentEngine::SingleEndAlgnBatch::repackDNA (
uint * packedSeq, uint threadId,
uint * seq, unsigned long long start, uint length
)
{
size_t dnaTPARA = ( threadId / 32 ) * 32 * wordPerDNA + ( threadId & 0x1F );
uint *src = seq + start / 16;
uint src_ofs = start % 16;
uint *dst = packedSeq + dnaTPARA;
uint dst_ofs = 1;
*dst = 0;
// we need a 0 at the beginning to reserve the first column of DP table
while (length > 0) {
uint len = min(min(16 - dst_ofs, 16 - src_ofs), length);
*dst |= *src << (src_ofs * 2) >> (32 - len*2) << (32-(dst_ofs+len)*2);
length -= len;
dst_ofs += len;
src_ofs += len;
if (src_ofs == 16) { ++src; src_ofs = 0; }
if (dst_ofs == 16) { dst += 32; dst_ofs = 0; *dst = 0; }
}
}
// ****
void SingleEndAlignmentEngine::SingleEndAlgnThreadContext::init ( SingleEndAlgnBatch * batch )
{
int batchSize = engine->DPS_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK;
semiGlobalAligner.init ( batchSize, engine->maxReadLength,
engine->maxDNALength, engine->maxDPTableLength, * ( engine->dpPara ) );
sem_init ( &ACKSem, 0, 0 );
sem_init ( &GPUFinishSem, 0, 0 );
sem_init ( &outputACKSem, 0, 0 );
this->batch = batch;
}
void SingleEndAlignmentEngine::SingleEndAlgnThreadContext::freeMemory()
{
semiGlobalAligner.freeMemory();
delete batch;
}
// ****
SingleDP_Space::AlgnmtResultStream::AlgnmtResultStream()
{
numOut = 0;
pthread_mutex_init ( &occupy_mutex, NULL );
}
SingleDP_Space::AlgnmtResultStream::~AlgnmtResultStream()
{
for ( int i = 0; i < dpSResult.size(); i++ )
{
SingleDPResultBatch & resultBatch = * ( dpSResult[i] );
for ( int j = 0; j < resultBatch.size(); j++ )
{
free ( resultBatch[j].cigarString );
}
delete dpSResult[i];
}
dpSResult.clear();
}
// ****
void SingleEndAlignmentEngine::performAlignment (
uint & numDPAlignedRead, uint & numDPAlignment
)
{
/* initialize */
algnBatchCount = 0;
dpSAlignedRead = 0;
dpSAlignment = 0;
lastReadID = -1;
inputFlags = new AlgnmtFlags;
alignFlags = new AlgnmtFlags;
resultStream = new AlgnmtResultStream;
outputBuf = new OutputBuffer<SingleAlgnmtResult>();
outputBuf->setAlignmentType ( alignmentType );
maxReadLength = ( inputMaxReadLength / 4 + 1 ) * 4;
maxDNALength = maxReadLength + 2 * DPS_MARGIN ( inputMaxReadLength ) + 8;
semiGlobalAligner.decideConfiguration ( maxReadLength, maxDNALength,
maxDPTableLength, DPS_ALGN_NUM_OF_BLOCKS,
patternLength, *dpPara );
algnSwapBatch =
new SingleEndAlgnBatch ( DPS_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK, dpPara,
maxReadLength, maxDNALength, maxDPTableLength, patternLength,
index, queries, inputMaxReadLength, upkdReadLengths,
dpInfoForReads );
algnThreadContext = new SingleEndAlgnThreadContext[dpPara->numOfCPUThreads];
for ( int i = 0; i < dpPara->numOfCPUThreads; i++ )
{
SingleEndAlgnBatch * batch =
new SingleEndAlgnBatch ( DPS_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK, dpPara,
maxReadLength, maxDNALength, maxDPTableLength, patternLength,
index, queries, inputMaxReadLength, upkdReadLengths,
dpInfoForReads );
algnThreadContext[i].init ( batch );
}
outputThreadDelegator.init ( 1, DPSOutputThread,
NULL, DPSOutputThreadFinalize );
algnmtCPUThreadDelegator.init ( dpPara->numOfCPUThreads, algnmtCPUThread );
/* perform alignment */
int threadId;
void * empty;
for ( uint i = 0; i < canStream->data.size(); i++ )
{
CandidateInfo & info = canStream->data[i];
inputFlags->set ( info.readID );
if ( !algnSwapBatch->pack ( info ) )
{
// launch one batch
threadId = algnmtCPUThreadDelegator.schedule ( empty );
sem_wait ( & ( algnThreadContext[threadId].ACKSem ) );
algnSwapBatch->clear();
algnSwapBatch->pack ( info );
}
}
// last batch
if ( algnSwapBatch->numOfThreads > 0 )
{
threadId = algnmtCPUThreadDelegator.schedule ( empty );
sem_wait ( & ( algnThreadContext[threadId].ACKSem ) );
}
/* finalize */
algnmtCPUThreadDelegator.finalize();
outputThreadDelegator.finalize();
alignFlags->getXOR ( inputFlags, unalignedIDStream->data );
delete inputFlags;
delete alignFlags;
delete algnSwapBatch;
for ( int i = 0; i < dpPara->numOfCPUThreads; i++ )
{
algnThreadContext[i].freeMemory();
}
delete[] algnThreadContext;
delete outputBuf;
// resultStream is used as an output
// delete resultStream;
int cnt=0;
for ( int i=0;i<resultStream->dpSResult.size(); ++i)
cnt += (*((resultStream->dpSResult)[i])).size();
numDPAlignedRead = this->dpSAlignedRead;
numDPAlignment = this->dpSAlignment;
}
void SingleEndAlignmentEngine::performAlignment (
/* input */
CandidateStream * canStream,
DPParameters * dpPara,
uint * queries, uint * upkdReadLengths, int inputMaxReadLength,
char ** queryNames, char ** queryComments, uint * origReadIDs, char * upkdQualities,
DPInfoForReads * dpInfoForReads,
Soap3Index * index,
int alignmentType,
uint accumReadNum, int outputFormat, samfile_t * samOutputDPFilePtr,
/* output */
QueryIDStream * unalignedIDStream,
uint & numDPAlignedRead,
uint & numDPAlignment,
AlgnmtResultStream * &resultStream
)
{
engine = new SingleEndAlignmentEngine();
MC_MemberCopy2 ( engine->, , canStream, dpPara );
MC_MemberCopy4 ( engine->, , queries, queryNames, upkdReadLengths, inputMaxReadLength );
MC_MemberCopy ( engine->, , queryComments);
MC_MemberCopy2 ( engine->, , origReadIDs, upkdQualities );
MC_MemberCopy ( engine->, , dpInfoForReads );
MC_MemberCopy ( engine->, , index );
MC_MemberCopy3 ( engine->, , accumReadNum, outputFormat, samOutputDPFilePtr );
MC_MemberCopy2 ( engine->, , alignmentType, unalignedIDStream );
engine->performAlignment ( numDPAlignedRead, numDPAlignment );
resultStream = engine->resultStream;
delete engine;
}
SingleEndAlignmentEngine * SingleEndAlignmentEngine::engine;
void SingleDP_Space::algnmtCPUThread ( int threadId, void *& empty )
{
//printf("singledp cpu thread %d start\n",threadId);
SingleEndAlignmentEngine * engine = SingleEndAlignmentEngine::engine;
SingleEndAlignmentEngine::SingleEndAlgnBatch * batch = engine->algnSwapBatch;
engine->algnSwapBatch = engine->algnThreadContext[threadId].batch;
engine->algnThreadContext[threadId].batchID = engine->algnBatchCount++;
sem_post ( & ( engine->algnThreadContext[threadId].ACKSem ) );
engine->algnThreadContext[threadId].batch = batch;
int * pThreadId = &threadId;
//engine->algnmtGPUThreadDelegator.schedule ( pThreadId );
//sem_wait ( & ( engine->algnThreadContext[threadId].GPUFinishSem ) );
engine->algnThreadContext[threadId].semiGlobalAligner.performAlignment (
batch->packedDNASeq, batch->DNALengths,
batch->packedReadSeq, batch->lengths,
batch->cutoffThresholds, batch->scores, batch->hitLocs,
batch->maxScoreCounts,
batch->pattern, batch->numOfThreads,
batch->softClipLtSizes, batch->softClipRtSizes,
batch->peLeftAnchorLocs, batch->peRightAnchorLocs );
MC_MemberCopy2 ( int, engine->dpPara->, matchScore, mismatchScore );
MC_MemberCopy2 ( int, engine->dpPara->, openGapScore, extendGapScore );
// Rearrange result and Output
SingleDPResultBatch * resultBatch = new SingleDPResultBatch;
for ( int i = 0; i < batch->numOfThreads; i++ )
{
if ( batch->scores[i] >= batch->cutoffThresholds[i] )
{
CigarStringEncoder<void> encoder;
uchar lastType = 'N';
for ( uchar * p = batch->pattern + i * engine->patternLength; *p != 0; p++ )
{
if ( *p == 'V' )
{
encoder.append ( lastType, ( int ) ( * ( ++p ) ) - 1 );
}
else
{
encoder.append ( *p, 1 );
lastType = *p;
}
}
SingleAlgnmtResult result;
result.readID = batch->canInfos[i].readID;
result.strand = batch->canInfos[i].strand;
result.seedAlignmentLength = batch->canInfos[i].seedAlignmentLength;
result.algnmt = batch->canInfos[i].pos + batch->hitLocs[i];
result.score = batch->scores[i];
result.startPos = batch->canInfos[i].pos;
result.refDpLength = batch->DNALengths[i];
result.peLeftAnchor = batch->peLeftAnchorLocs[i];
result.peRightAnchor = batch->peRightAnchorLocs[i];
encoder.encodeCigarString ( openGapScore, extendGapScore );
result.cigarString = encoder.cigarString;
int L = batch->lengths[i] - encoder.charCount['I'] - encoder.charCount['S'];
int numOfMismatch = ( L * matchScore + encoder.gapPenalty - batch->scores[i] ) /
( matchScore - mismatchScore );
result.editdist = encoder.charCount['I'] + encoder.charCount['D'] + numOfMismatch;
result.num_sameScore = batch->maxScoreCounts[i]; // TODO
resultBatch->push_back ( result );
}
}
// Output
engine->algnThreadContext[threadId].resultBatch = resultBatch;
int * pid = &threadId;
engine->outputThreadDelegator.schedule ( pid );
// fprintf(stderr, "ALgn CPU Thread done.\n");
sem_wait ( & ( engine->algnThreadContext[threadId].outputACKSem ) );
//printf("singledp cpu thread %d end\n",threadId);
}
void SingleDP_Space::DPSOutputThread ( int threadId, int *& pCallThreadId )
{
int callThreadId = *pCallThreadId;
SingleEndAlignmentEngine * engine = SingleEndAlignmentEngine::engine;
int batchID = engine->algnThreadContext[callThreadId].batchID;
SingleDPResultBatch * resultBatch = engine->algnThreadContext[callThreadId].resultBatch;
sem_post ( & ( engine->algnThreadContext[callThreadId].outputACKSem ) );
vector<SingleDPResultBatch *> & dpResult = engine->resultStream->dpSResult;
while ( dpResult.size() <= batchID )
{
dpResult.push_back ( NULL );
}
dpResult[batchID] = resultBatch;
/**/
#define MC_DPSOutputRead() { \
engine->outputBuf->ready(); \
if (engine->outputBuf->size > 0) { \
engine->dpSAlignedRead += 1; \
engine->dpSAlignment += engine->outputBuf->size; \
engine->alignFlags->set(engine->lastReadID); \
} \
}
/**/
uint numOut = engine->resultStream->numOut;
while ( numOut < dpResult.size() && dpResult[numOut] != NULL )
{
//OUTPUT HERE
SingleDPResultBatch & batch = *dpResult[numOut];
for ( int i = 0; i < batch.size(); i++ )
{
SingleAlgnmtResult & result = batch[i];
int readID = result.readID;
if ( readID != engine->lastReadID )
{
MC_DPSOutputRead();
engine->outputBuf->clear();
engine->lastReadID = readID;
}
engine->outputBuf->add ( result );
}
++numOut;
}
engine->resultStream->numOut = numOut;
}
void SingleDP_Space::DPSOutputThreadFinalize()
{
SingleEndAlignmentEngine * engine = SingleEndAlignmentEngine::engine;
MC_DPSOutputRead();
engine->outputBuf->clear();
}
SingleAlgnmtResult * SingleDP_Space::fetchNextSingleDPResult ( SingleDP_Space::AlgnmtResultStream * singleDPResultStream,
uint &singleDPResultStreamIdx, uint &singleDPResultBatchIdx)
{
while(true) {
if ( singleDPResultStreamIdx < singleDPResultStream->dpSResult.size() )
{
SingleDPResultBatch & singleDPResultBatch = *(singleDPResultStream->dpSResult[singleDPResultStreamIdx]);
if (singleDPResultBatch.size() == 0) {
++singleDPResultStreamIdx;
singleDPResultBatchIdx = 0;
continue;
} else if ( singleDPResultBatchIdx < singleDPResultBatch.size() )
{
SingleAlgnmtResult * singleAlgnmtResult = &(singleDPResultBatch[singleDPResultBatchIdx]);
++singleDPResultBatchIdx;
if ( singleDPResultBatchIdx == singleDPResultBatch.size() )
{
++singleDPResultStreamIdx;
singleDPResultBatchIdx = 0;
}
if (singleAlgnmtResult)
return singleAlgnmtResult;
else
continue;
}
} else return NULL;
}
}
// both of singleDPResultStream and unalignedSingleReads are sorted by readID
void SingleDP_Space::DPSOutputUnpairedAlignment ( SingleDP_Space::AlgnmtResultStream * singleDPResultStream, UnalignedSingles * unalignedSingleReads,
uint * queries, uint * upkdReadLengths, uint * origReadIDs,
char ** queryNames, char ** queryComments, char * upkdQualities, int inputMaxReadLength,
uint accumReadNum, int outputFormat, samfile_t * samOutputDPFilePtr,
Soap3Index * index,
int alignmentType,
uint & dpSAlignedRead,
uint & dpSAlignment )
{
OutputBuffer<SingleAlgnmtResult> * outputBuf = new OutputBuffer<SingleAlgnmtResult>();
outputBuf->setAlignmentType ( alignmentType );
#define MC_DPSUnpairedOutputRead() { \
outputBuf->ready(); \
if (outputBuf->size > 0) { \
outputDPSingleResult2( \
outputBuf->elements, outputBuf->size, \
queries, upkdReadLengths, origReadIDs, \
queryNames, queryComments, upkdQualities, \
inputMaxReadLength, accumReadNum, outputFormat, \
samOutputDPFilePtr, index); \
dpSAlignedRead += 1; \
dpSAlignment += outputBuf->size; \
} \
}
uint singleDPResultStreamIdx = 0, singleDPResultBatchIdx = 0, unalignedIter = 0;
SingleAlgnmtResult * singleAlgnmtResult = fetchNextSingleDPResult ( singleDPResultStream, singleDPResultStreamIdx, singleDPResultBatchIdx );
QueryIDStream * unalignedIDStream = new QueryIDStream;
while ( true )
{
while ( singleAlgnmtResult != NULL && singleAlgnmtResult->readID < unalignedSingleReads->readIDs[unalignedIter] )
{ singleAlgnmtResult = fetchNextSingleDPResult ( singleDPResultStream, singleDPResultStreamIdx, singleDPResultBatchIdx); }
if ( singleAlgnmtResult == NULL )
{ break; }
while ( unalignedIter < unalignedSingleReads->totalNum && unalignedSingleReads->readIDs[unalignedIter] < singleAlgnmtResult->readID )
{
unalignedIDStream->data->push_back( unalignedSingleReads->readIDs[unalignedIter] );
++unalignedIter;
}
if ( unalignedIter == unalignedSingleReads->totalNum )
{ break; }
if ( singleAlgnmtResult->readID == unalignedSingleReads->readIDs[unalignedIter] )
{
while ( singleAlgnmtResult != NULL && singleAlgnmtResult->readID == unalignedSingleReads->readIDs[unalignedIter] )
{
SingleAlgnmtResult & tmp = *singleAlgnmtResult ;
outputBuf->add ( tmp );
singleAlgnmtResult = fetchNextSingleDPResult ( singleDPResultStream, singleDPResultStreamIdx, singleDPResultBatchIdx);
}
MC_DPSUnpairedOutputRead();
outputBuf->clear();
++unalignedIter;
}
if ( unalignedIter == unalignedSingleReads->totalNum )
{ break; }
}
for ( ; unalignedIter < unalignedSingleReads->totalNum; ++unalignedIter )
{
unalignedIDStream->data->push_back( unalignedSingleReads->readIDs[unalignedIter] );
}
DPSOutputUnalignedReads ( unalignedIDStream,
queries, upkdReadLengths, inputMaxReadLength,
index,
queryNames, queryComments, origReadIDs, upkdQualities,
accumReadNum, outputFormat,
samOutputDPFilePtr );
delete outputBuf;
delete unalignedIDStream;
return;
}
void SingleDP_Space::DPSOutputUnalignedReads (
QueryIDStream * unalignedIDStream,
uint * queries, uint * upkdReadLengths, int inputMaxReadLength,
Soap3Index * index,
char ** queryNames, char ** queryComments, uint * origReadIDs, char * upkdQualities,
uint accumReadNum, int outputFormat, samfile_t * samOutputDPFilePtr
)
{
// output unaligned result
#define MC_DPSOutputUnalgnRead() { \
outputDPSingleResult2(buf, idx, \
queries, upkdReadLengths, origReadIDs, \
queryNames, queryComments, upkdQualities, \
inputMaxReadLength, accumReadNum, outputFormat, \
samOutputDPFilePtr, index); }
SingleAlgnmtResult * buf;
MC_CheckMalloc ( buf, SingleAlgnmtResult, 1024 );
int idx = 0;
for ( uint i = 0; i < unalignedIDStream->data->size(); i++ )
{
buf[idx].readID = ( * ( unalignedIDStream->data ) ) [i];
buf[idx].algnmt = kMaxULL;
buf[idx].cigarString = NULL;
++idx;
if ( idx >= 1024 )
{
MC_DPSOutputUnalgnRead();
idx = 0;
}
}
if ( idx > 0 )
{ MC_DPSOutputUnalgnRead(); }
free ( buf );
}
//////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// default-dp space /////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
using namespace DP_Space;
// ****
HalfEndOccStream::HalfEndOccStream ( ReadInputForDPArrays * input, BWT * bwt )
{
this->data = input;
this->bwt = bwt;
arrayIndex = 0;
iter_readInput = data->inputArrays[arrayIndex];
iter_occ = iter_readInput->occ_list;
end_occ = iter_occ + iter_readInput->occTotalNum;
iter_sa = iter_readInput->sa_list;
end_sa = iter_sa + iter_readInput->saRangeTotalNum;
nextSAIndex = -1;
}
HalfEndOccStream::HalfEndOccStream ( SingleDP_Space::AlgnmtResultStream * input )
{
this->data = NULL;
this->singleDPData = input;
this->singleDPDataArrayIndex=0;
this->iter_singleDPData = 0;
}
int HalfEndOccStream::fetchNextOcc ( SRAOccurrence & occ )
{
while ( true )
{
#define SA2OCC() { \
occ.readID = iter_sa->readID; \
occ.mismatchCount = iter_sa->mismatchCount; \
occ.strand = iter_sa->strand; \
occ.ambPosition = BWTSaValue(bwt, nextSAIndex++); \
if (nextSAIndex > iter_sa->saIndexRight) { \
nextSAIndex = -1; \
++iter_sa; \
} \
}
if ( nextSAIndex != -1 )
{
SA2OCC();
}
else if ( iter_occ == end_occ )
{
if ( iter_sa == end_sa )
{
++arrayIndex;
if ( arrayIndex >= data->numArrays )
{ return 0; } // finished
else
{
iter_readInput = data->inputArrays[arrayIndex];
iter_occ = iter_readInput->occ_list;
end_occ = iter_occ + iter_readInput->occTotalNum;
iter_sa = iter_readInput->sa_list;
end_sa = iter_sa + iter_readInput->saRangeTotalNum;
continue;
}
}
else
{
nextSAIndex = iter_sa->saIndexLeft;
SA2OCC();
}
}
else
{
if ( iter_sa == end_sa )
{
occ = * ( iter_occ++ );
}
else
{
if ( ( iter_occ->readID >> 1 ) < ( iter_sa->readID >> 1 ) )
{ occ = * ( iter_occ++ ); }
else
{
nextSAIndex = iter_sa->saIndexLeft;
SA2OCC();
}
}
}
return 1;
}
}
int HalfEndOccStream::fetchNextSingleAlgnResult( SingleAlgnmtResult & singleAlgnmtResult)
{
if ( singleDPDataArrayIndex >= singleDPData->dpSResult.size() )
{ return 0; }
int limit = 4;
while ( iter_singleDPData + limit < singleDPData->dpSResult[singleDPDataArrayIndex]->size() && ((*(singleDPData->dpSResult[singleDPDataArrayIndex]))[iter_singleDPData]).readID == ((*(singleDPData->dpSResult[singleDPDataArrayIndex]))[iter_singleDPData + limit]).readID )
{ ++iter_singleDPData; }
if ( singleDPDataArrayIndex < singleDPData->dpSResult.size() )
{
memcpy( &singleAlgnmtResult, &((*(singleDPData->dpSResult[singleDPDataArrayIndex]))[iter_singleDPData]), sizeof( SingleAlgnmtResult ) );
if ( lastFetchReadID == singleAlgnmtResult.readID )
{ ++lastFetchReadIDCount; }
else
{
lastFetchReadID = singleAlgnmtResult.readID;
lastFetchReadIDCount = 0;
}
iter_singleDPData++;
++counter;
while ( singleDPDataArrayIndex < singleDPData->dpSResult.size() && iter_singleDPData >= singleDPData->dpSResult[singleDPDataArrayIndex]->size() )
{
++singleDPDataArrayIndex;
iter_singleDPData = 0;
}
return 1;
}
else // finished
{
return 0;
}
}
// ****
HalfEndAlignmentEngine::HalfEndAlgnBatch::HalfEndAlgnBatch (
int batchSize, DPParameters * dpPara,
int peStrandLeftLeg, int peStrandRightLeg, int insert_high, int insert_low,
int maxReadLength, int maxDNALength, int maxDPTableLength, int patternLength,
Soap3Index * index, uint * queries, int inputMaxReadLength, uint * upkdReadLengths, int dPFromSingleEndDPResult
)
{
MC_MemberCopy5 ( this->, , batchSize, peStrandLeftLeg, peStrandRightLeg, insert_high, insert_low );
MC_MemberCopy4 ( this->, , maxReadLength, maxDNALength, maxDPTableLength, patternLength );
MC_MemberCopy4 ( this->, , index, queries, inputMaxReadLength, upkdReadLengths );
MC_MemberCopy2 ( this->, dpPara->, softClipLeft, softClipRight );
this->isDoubleStrand = ( peStrandLeftLeg == peStrandRightLeg );
this->fullDNALength = index->sraIndex->hsp->dnaLength;
this->wordPerOldQuery = getWordPerQuery ( inputMaxReadLength );
this->wordPerQuery = MC_CeilDivide16 ( maxReadLength );
this->wordPerDNA = MC_CeilDivide16 ( maxDNALength );
if ( dPFromSingleEndDPResult )
{
MC_CheckMalloc ( singleEndDPCandidateInfo, SingleEndDPCandidateInfo, batchSize);
canInfo = NULL;
}
else
{
MC_CheckMalloc ( canInfo, CandidateInfo, batchSize );
singleEndDPCandidateInfo = NULL;
}
MC_CheckMalloc ( DNALengths, uint, batchSize );
MC_CheckMalloc ( lengths, uint, batchSize );
MC_CheckMalloc ( packedDNASequence, uint, batchSize * wordPerDNA );
MC_CheckMalloc ( packedReadSequence, uint, batchSize * wordPerQuery );
MC_CheckMalloc ( startLocs, unsigned long long, batchSize );
MC_CheckMalloc ( hitLocs, uint, batchSize );
MC_CheckMalloc ( scores, int, batchSize );
MC_CheckMalloc ( cutoffThresholds, int, batchSize );
MC_CheckMalloc ( softClipLtSizes, uint, batchSize );
MC_CheckMalloc ( softClipRtSizes, uint, batchSize );
MC_CheckMalloc ( peLeftAnchorLocs, uint, batchSize );
MC_CheckMalloc ( peRightAnchorLocs, uint, batchSize );
MC_CheckMalloc ( pattern, uchar, batchSize * patternLength );
MC_CheckMalloc ( maxScoreCounts, uint, batchSize );
clear();
}
HalfEndAlignmentEngine::HalfEndAlgnBatch::~HalfEndAlgnBatch()
{
free ( canInfo );
free ( singleEndDPCandidateInfo );
free ( DNALengths );
free ( packedDNASequence );
free ( lengths );
free ( packedReadSequence );
free ( startLocs );
free ( hitLocs );
free ( scores );
free ( cutoffThresholds );
free ( softClipLtSizes );
free ( softClipRtSizes );
free ( peLeftAnchorLocs );
free ( peRightAnchorLocs );
free ( pattern );
free ( maxScoreCounts );
}
void HalfEndAlignmentEngine::HalfEndAlgnBatch::clear()
{
numOfThreads = 0;
}
int HalfEndAlignmentEngine::HalfEndAlgnBatch::pack (
SingleAlgnmtResult & singleAlgnmtResult
)
{
uint alignedStrand = singleAlgnmtResult.strand;
if ( alignedStrand != peStrandLeftLeg && alignedStrand != peStrandRightLeg )
{ return -2; }
else
{
if ( numOfThreads + 1 + isDoubleStrand > batchSize )
{ return -1; }
}
uint alignedReadID = singleAlgnmtResult.readID;
unsigned long long alignedPos = singleAlgnmtResult.algnmt;
uint alignedReadLength = upkdReadLengths[alignedReadID];
int unalignedIsReadOrMate = 1 - ( alignedReadID & 1 );
uint unalignedReadID = ( unalignedIsReadOrMate == 0 ?
alignedReadID - 1 : alignedReadID + 1 );
uint unalignedReadLength = upkdReadLengths[unalignedReadID];
#define MC_SetRead(strand) { \
packRead(packedReadSequence, numOfThreads, \
unalignedReadID, unalignedReadLength, strand); \
cutoffThresholds[numOfThreads] = std::max(DP_SCORE_THRESHOLD_RATIO * unalignedReadLength, DP_SCORE_THRESHOLD_LOWER_BOUND); \
softClipLtSizes[numOfThreads] = (strand == 1) ? softClipLeft : softClipRight; \
softClipRtSizes[numOfThreads] = (strand == 1) ? softClipRight : softClipLeft; \
}
if ( peStrandLeftLeg == alignedStrand )
{
//aligned read: at left, unaligned read: at right
unsigned long long rightEnd = alignedPos + insert_high;
unsigned long long rightStart = alignedPos + insert_low - unalignedReadLength;
// rightStart has to be >= alignedPos
if (rightStart < alignedPos)
rightStart = alignedPos;
if ( rightStart < fullDNALength && rightEnd <= fullDNALength )
{
singleEndDPCandidateInfo[numOfThreads].refer = singleAlgnmtResult;
singleEndDPCandidateInfo[numOfThreads].leftOrRight = 1;
lengths[numOfThreads] = unalignedReadLength;
startLocs[numOfThreads] = rightStart;
DNALengths[numOfThreads] = rightEnd - rightStart;
peLeftAnchorLocs[numOfThreads] = maxDNALength;
peRightAnchorLocs[numOfThreads] = unalignedReadLength;
repackDNA ( packedDNASequence, numOfThreads,
( uint * ) index->sraIndex->hsp->packedDNA, rightStart, DNALengths[numOfThreads] );
MC_SetRead ( peStrandRightLeg );
++numOfThreads;
}
}
if ( peStrandRightLeg == alignedStrand )
{
//aligned read: at right, unaligned read: at left
unsigned long long leftStart = alignedPos + alignedReadLength - insert_high;
unsigned long long leftEnd = alignedPos + alignedReadLength - insert_low + unalignedReadLength;
// leftEnd has to be < alignedPos + alignedReadLength
if (leftEnd >= alignedPos + alignedReadLength)
leftEnd = alignedPos + alignedReadLength - 1;
if ( leftStart < fullDNALength && leftEnd <= fullDNALength )
{
singleEndDPCandidateInfo[numOfThreads].refer = singleAlgnmtResult;
singleEndDPCandidateInfo[numOfThreads].leftOrRight = 0;
lengths[numOfThreads] = unalignedReadLength;
startLocs[numOfThreads] = leftStart;
DNALengths[numOfThreads] = leftEnd - leftStart;
peLeftAnchorLocs[numOfThreads] = insert_high - insert_low + 1;
peRightAnchorLocs[numOfThreads] = 0;
repackDNA ( packedDNASequence, numOfThreads,
( uint * ) index->sraIndex->hsp->packedDNA, leftStart, DNALengths[numOfThreads] );
MC_SetRead ( peStrandLeftLeg );
++numOfThreads;
}
}
return numOfThreads;
}
inline void HalfEndAlignmentEngine::HalfEndAlgnBatch::packRead (
uint * packedSeq, uint threadId,
uint readID, uint length, int strand
)
{
#define MC_OldReadUnpack(X,i) ((X[oldReadTPARA + (((i)>>4)<<5)] >> (((i) & 0xF) << 1)) & 0x3)
uint oldReadTPARA = ( readID / 32 ) * 32 * wordPerOldQuery + ( readID % 32 );
uint readTPARA = ( threadId / 32 ) * 32 * wordPerQuery + ( threadId % 32 );
for ( uint i = 0; i <= ( length / CHAR_PER_WORD ); i++ )
{
packedSeq[readTPARA + ( i << 5 )] = 0;
}
if ( strand == 1 )
{
for ( int i = 1; i <= length; i++ )
{
int fwd_i = i - 1;
register uint c_nucleotide = ( uint ) MC_OldReadUnpack ( queries, fwd_i );
#ifdef BS_MOD
c_nucleotide = c_nucleotide ^ ( ( c_nucleotide == index->sraIndex->hsp->flag ) << 1 );
#endif
packedSeq[readTPARA + ( ( i >> 4 ) << 5 )] |= c_nucleotide << ( ( 15 - ( i & 0xF ) ) << 1 );
}
}
else // strand == 2
{
for ( int i = 1; i <= length; i++ )
{
int rev_i = length - i;
register uint c_nucleotide = soap3DnaComplement[( uint ) MC_OldReadUnpack ( queries, rev_i )];
#ifdef BS_MOD
c_nucleotide = c_nucleotide ^ ( ( c_nucleotide == index->sraIndex->hsp->flag ) << 1 );
#endif
packedSeq[readTPARA + ( ( i >> 4 ) << 5 )] |= c_nucleotide << ( ( 15 - ( i & 0xF ) ) << 1 );
}
}
}
inline void HalfEndAlignmentEngine::HalfEndAlgnBatch::repackDNA (
uint * packedSeq, uint threadId,
uint * seq, unsigned long long start, uint length
)
{
size_t dnaTPARA = ( threadId / 32 ) * 32 * wordPerDNA + ( threadId & 0x1F );
uint *src = seq + start / 16;
uint src_ofs = start % 16;
uint *dst = packedSeq + dnaTPARA;
uint dst_ofs = 1;
*dst = 0;
// we need a 0 at the beginning to reserve the first column of DP table
while (length > 0) {
uint len = min(min(16 - dst_ofs, 16 - src_ofs), length);
*dst |= *src << (src_ofs * 2) >> (32 - len*2) << (32-(dst_ofs+len)*2);
length -= len;
dst_ofs += len;
src_ofs += len;
if (src_ofs == 16) { ++src; src_ofs = 0; }
if (dst_ofs == 16) { dst += 32; dst_ofs = 0; *dst = 0; }
}
}
// ****
void HalfEndAlignmentEngine::HalfEndAlgnThreadContext::init (
HalfEndAlgnBatch * batch
)
{
int batchSize = engine->DP_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK;
semiGlobalAligner.init ( batchSize, engine->maxReadLength,
engine->maxDNALength, engine->maxDPTableLength, * ( engine->dpPara ) );
sem_init ( &dispatchACKSem, 0, 0 );
sem_init ( &GPUFinishSem, 0, 0 );
sem_init ( &outputACKSem, 0, 0 );
this->batch = batch;
}
void HalfEndAlignmentEngine::HalfEndAlgnThreadContext::freeMemory()
{
semiGlobalAligner.freeMemory ( );
delete batch;
}
// ****
HalfEndAlignmentEngine::AlgnmtResultStream::AlgnmtResultStream()
{
numOut = 0;
pthread_mutex_init ( &occupy_mutex, NULL );
}
HalfEndAlignmentEngine::AlgnmtResultStream::~AlgnmtResultStream()
{
}
// ****
void HalfEndAlignmentEngine::performAlignment ( uint & numDPAlignedRead, uint & numDPAlignment )
{
/* initialize */
algnBatchCount = 0;
dpAlignedRead = 0;
dpAlignment = 0;
inputFlags = new AlgnmtFlags;
alignFlags = new AlgnmtFlags;
resultStream = new AlgnmtResultStream;
maxReadLength = ( inputMaxReadLength / 4 + 1 ) * 4;
maxDNALength = insert_high - insert_low + inputMaxReadLength + 1;
semiGlobalAligner.decideConfiguration ( maxReadLength, maxDNALength,
maxDPTableLength, DP_ALGN_NUM_OF_BLOCKS,
patternLength, *dpPara );
algnSwapBatch =
new HalfEndAlgnBatch ( DP_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK, dpPara,
peStrandLeftLeg, peStrandRightLeg, insert_high, insert_low,
maxReadLength, maxDNALength, maxDPTableLength, patternLength,
index, queries, inputMaxReadLength, upkdReadLengths, engine->canStream->singleDPData != NULL);
algnThreadContext = new HalfEndAlgnThreadContext[dpPara->numOfCPUThreads];
for ( int i = 0; i < dpPara->numOfCPUThreads; i++ )
{
HalfEndAlgnBatch * batch =
new HalfEndAlgnBatch ( DP_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK, dpPara,
peStrandLeftLeg, peStrandRightLeg, insert_high, insert_low,
maxReadLength, maxDNALength, maxDPTableLength, patternLength,
index, queries, inputMaxReadLength, upkdReadLengths, engine->canStream->singleDPData != NULL );
// fprintf(stderr, "[%s] Batch size: %d\n", __func__, DP_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK);
algnThreadContext[i].init ( batch );
}
algnmtCPUThreadDelegator.init ( dpPara->numOfCPUThreads, algnmtCPUThread );
numDPAlignedReads = ( uint * ) malloc ( dpPara->numOfCPUThreads * sizeof ( uint ) );
memset ( numDPAlignedReads, 0, dpPara->numOfCPUThreads * sizeof ( uint ) );
numDPAlignments = ( uint * ) malloc ( dpPara->numOfCPUThreads * sizeof ( uint ) );
memset ( numDPAlignments, 0, dpPara->numOfCPUThreads * sizeof ( uint ) );
/* perform alignment */
int threadId;
void * empty;
if ( canStream->data != NULL )
{
assert(false);
}
else
{
SingleAlgnmtResult singleAlgnmtResult;
canStream->lastFetchReadID = -1;
canStream->lastFetchReadIDCount = 0;
canStream->counter = 0;
SingleAlgnmtResult result;
queue<SingleAlgnmtResult> results;
int ret = canStream -> fetchNextSingleAlgnResult(result);
while (ret) {
results.push(result);
uint readID = result.readID/2*2;
while (ret = canStream->fetchNextSingleAlgnResult(result)) {
if (result.readID/2*2==readID)
results.push(result);
else
break;
}
if (results.size() > algnSwapBatch->batchSize - algnSwapBatch->numOfThreads) {
//launch one batch
threadId = algnmtCPUThreadDelegator.schedule ( empty );
sem_wait ( & ( algnThreadContext[threadId].dispatchACKSem ) );
algnSwapBatch->clear();
}
while (!results.empty()) {
SingleAlgnmtResult tmp = results.front();
results.pop();
inputFlags->set ((tmp.readID >> 1 ) << 1);
algnSwapBatch->pack(tmp);
}
}
}
// last batch
if ( algnSwapBatch->numOfThreads > 0 )
{
threadId = algnmtCPUThreadDelegator.schedule ( empty );
sem_wait ( & ( algnThreadContext[threadId].dispatchACKSem ) );
}
/* finalize */
algnmtCPUThreadDelegator.finalize();
alignFlags->getXOR ( inputFlags, unalignedIDStream->data );
delete inputFlags;
delete alignFlags;
delete algnSwapBatch;
for ( int i = 0; i < dpPara->numOfCPUThreads; i++ )
{
algnThreadContext[i].freeMemory();
}
delete[] algnThreadContext;
delete resultStream;
for ( int i = 0; i < dpPara->numOfCPUThreads; i++ )
{
numDPAlignedRead += numDPAlignedReads[i];
numDPAlignment += numDPAlignments[i];
}
free ( numDPAlignedReads );
free ( numDPAlignments );
}
void HalfEndAlignmentEngine::performAlignment (
/* input */
HalfEndOccStream * canStream,
DPParameters * dpPara,
uint * queries, uint * upkdReadLengths, int inputMaxReadLength,
DPInfoForReads * dpInfoForReads,
int insert_high, int insert_low,
int peStrandLeftLeg, int peStrandRightLeg,
char ** queryNames, char ** queryComments, uint * origReadIDs, char * upkdQualities,
Soap3Index * index,
int alignmentType,
uint accumReadNum, int outputFormat,
samfile_t * samOutputDPFilePtr, samfile_t ** currSamOutputFilePtr,
/* output */
QueryIDStream * unalignedIDStream,
uint & numDPAlignedRead,
uint & numDPAlignment
)
{
engine = new HalfEndAlignmentEngine();
MC_MemberCopy2 ( engine->, , canStream, dpPara );
MC_MemberCopy4 ( engine->, , queries, queryNames, upkdReadLengths, inputMaxReadLength );
MC_MemberCopy ( engine->, , queryComments);
MC_MemberCopy ( engine->, , dpInfoForReads );
MC_MemberCopy4 ( engine->, , insert_high, insert_low, peStrandLeftLeg, peStrandRightLeg );
MC_MemberCopy2 ( engine->, , origReadIDs, upkdQualities );
MC_MemberCopy ( engine->, , index );
MC_MemberCopy3 ( engine->, , accumReadNum, outputFormat, samOutputDPFilePtr );
MC_MemberCopy2 ( engine->, , alignmentType, unalignedIDStream );
engine->currSamOutputFilePtr = currSamOutputFilePtr;
engine->performAlignment ( numDPAlignedRead, numDPAlignment );
delete engine;
}
HalfEndAlignmentEngine * HalfEndAlignmentEngine::engine;
// ****
void DP_Space::algnmtCPUThread ( int threadId, void *& empty )
{
//printf("dp space cpu thread %d start\n",threadId);
// Copy data, then ACK to dispatching thread
HalfEndAlignmentEngine * engine = HalfEndAlignmentEngine::engine;
engine->algnThreadContext[threadId].batchID = engine->algnBatchCount++;
HalfEndAlignmentEngine::HalfEndAlgnBatch * batch = engine->algnSwapBatch;
engine->algnSwapBatch = engine->algnThreadContext[threadId].batch;
sem_post ( & ( engine->algnThreadContext[threadId].dispatchACKSem ) );
engine->algnThreadContext[threadId].batch = batch;
// launch kernel
int * pThreadId = &threadId;
// engine->algnmtGPUThreadDelegator.schedule ( pThreadId );
// sem_wait ( & ( engine->algnThreadContext[threadId].GPUFinishSem ) );
// timeRecorder.appendStart("GPUTime");
engine->algnThreadContext[threadId].semiGlobalAligner.performAlignment ( batch->packedDNASequence, batch->DNALengths,
batch->packedReadSequence, batch->lengths,
batch->cutoffThresholds, batch->scores, batch->hitLocs,
batch->maxScoreCounts,
batch->pattern, batch->numOfThreads,
batch->softClipLtSizes, batch->softClipRtSizes,
batch->peLeftAnchorLocs, batch->peRightAnchorLocs );
// rearrange result and Output
MC_MemberCopy2 ( int, engine->, peStrandLeftLeg, peStrandRightLeg );
MC_MemberCopy2 ( uint *, batch->, hitLocs, DNALengths );
MC_MemberCopy ( unsigned long long *, batch->, startLocs );
MC_MemberCopy2 ( uint *, batch->, peLeftAnchorLocs, peRightAnchorLocs );
MC_MemberCopy2 ( int, engine->dpPara->, matchScore, mismatchScore );
MC_MemberCopy2 ( int, engine->dpPara->, openGapScore, extendGapScore );
uchar * pattern = batch->pattern;
CandidateInfo * canInfo = batch->canInfo;
SingleEndDPCandidateInfo * singleEndDPCandidateInfo = batch->singleEndDPCandidateInfo;
DPResultBatch * resultBatch = &( engine->algnThreadContext[threadId].resultBatch );
for ( int id = 0; id < batch->numOfThreads; id++ )
{
//Create record for AlgnmtDPResult;
AlgnmtDPResult result;
uint alignedID = (canInfo != NULL?canInfo[id].refer.readID:singleEndDPCandidateInfo[id].refer.readID);
uint canInfoAmbPosition = (canInfo!=NULL?canInfo[id].refer.ambPosition : singleEndDPCandidateInfo[id].refer.algnmt );
char canStrand = ( canInfo!=NULL?canInfo[id].refer.strand : singleEndDPCandidateInfo[id].refer.strand);
uint canLeftOrRight = (canInfo!=NULL?canInfo[id].leftOrRight: singleEndDPCandidateInfo[id].leftOrRight );
int canScore = ( canInfo!=NULL? canInfo[id].refer.mismatchCount: singleEndDPCandidateInfo[id].refer.score );
uint alignedIsReadOrMate = alignedID & 1;
result.readID = alignedID - alignedIsReadOrMate;
unsigned long long dpAlgnmtPos;
if ( batch->scores[id] >= batch->cutoffThresholds[id])
{
CigarStringEncoder<void> encoder;
uchar lastType = 'N';
for ( uchar * p = pattern + id * engine->patternLength; *p != 0; p++ )
{
if ( *p == 'V' )
{
encoder.append ( lastType, ( int ) ( * ( ++p ) ) - 1 );
}
else
{
encoder.append ( *p, 1 );
lastType = *p;
}
}
encoder.encodeCigarString ( openGapScore, extendGapScore );
result.cigarString = encoder.cigarString;
// To get edit distance
int L = batch->lengths[id] - encoder.charCount['I'] - encoder.charCount['S'];
int numOfMismatch = ( L * matchScore + encoder.gapPenalty - batch->scores[id] ) /
( matchScore - mismatchScore );
result.editdist = encoder.charCount['I'] + encoder.charCount['D'] + numOfMismatch;
result.whichFromDP = 1 - alignedIsReadOrMate;
dpAlgnmtPos = startLocs[id] + hitLocs[id];
if ( dpAlgnmtPos < canInfoAmbPosition )
{
// dp is on left
result.insertSize = canInfoAmbPosition - dpAlgnmtPos +
engine->upkdReadLengths[alignedID];
}
else
{
// dp is on right
result.insertSize = dpAlgnmtPos - canInfoAmbPosition +
batch->lengths[id] + encoder.charCount['D'] -
encoder.charCount['I'] - encoder.charCount['S'];
}
result.startPos = startLocs[id];
result.refDpLength = DNALengths[id];
result.peLeftAnchor = peLeftAnchorLocs[id];
result.peRightAnchor = peRightAnchorLocs[id];
result.num_sameScore = batch->maxScoreCounts[id]; //TODO
}
else
{
result.cigarString = NULL;
result.whichFromDP = 2;
dpAlgnmtPos = kMaxULL;
}
if ( alignedIsReadOrMate == 0 )
{
// aligned is read, unaligned is mate
result.algnmt_1 = canInfoAmbPosition;
result.algnmt_2 = dpAlgnmtPos;
result.score_1 = canScore;
result.score_2 = batch->scores[id];
result.strand_1 = canStrand;
result.strand_2 = ( canLeftOrRight == 0 ? peStrandLeftLeg : peStrandRightLeg );
if ( canInfo == NULL )
{
result.result_1 = ( SingleAlgnmtResult * ) malloc ( sizeof ( SingleAlgnmtResult ) );
memcpy ( result.result_1, &(singleEndDPCandidateInfo[id].refer), sizeof ( SingleAlgnmtResult ) );
// result.result_1 = &(singleEndDPCandidateInfo[id].refer);
}
else
{ result.result_1 = NULL; }
result.result_2 = NULL;
}
else
{
// aligned is mate, unaligned is read
result.algnmt_1 = dpAlgnmtPos;
result.algnmt_2 = canInfoAmbPosition;
result.score_1 = batch->scores[id];
result.score_2 = canScore;
result.strand_1 = ( canLeftOrRight == 0 ? peStrandLeftLeg : peStrandRightLeg );
result.strand_2 = canStrand;
result.result_1 = NULL;
if ( canInfo == NULL )
{
result.result_2 = ( SingleAlgnmtResult * ) malloc ( sizeof ( SingleAlgnmtResult ) );
memcpy ( result.result_2, &(singleEndDPCandidateInfo[id].refer), sizeof ( SingleAlgnmtResult ) );
// result.result_2 = &(singleEndDPCandidateInfo[id].refer);
}
else
{ result.result_2 = NULL; }
}
resultBatch->push_back ( result );
}
// output thread
int *pid = &threadId;
DPOutputThread( threadId, pid );
//printf("dp space cpu thread %d end\n",threadId);
}
void DP_Space::DPOutputThread ( int outputThreadId, int *& pCallThreadId )
{
int threadId = *pCallThreadId;
HalfEndAlignmentEngine * engine = HalfEndAlignmentEngine::engine;
DPResultBatch * resultBatch = &(engine->algnThreadContext[threadId].resultBatch);
DeepDPAlignResult * tmpBestResult = NULL;
#define MC_OutputRead() { \
outputBuf->ready(1); \
DeepDPAlignResult * alignResult = (DeepDPAlignResult *)malloc(outputBuf->size*sizeof(DeepDPAlignResult)); \
AlgnmtDPResult * tmpDPPairResult = (AlgnmtDPResult *) outputBuf->elements; \
if (outputBuf->size > 0 ) { \
if ( tmpDPPairResult[0].result_1 == NULL && tmpDPPairResult[0].result_2 == NULL) { \
assert(false); \
} \
else { \
int validResult = 0; \
for (int k=0,l=0;k<outputBuf->size;++k) { \
if ( outputBuf->elements[0].whichFromDP < 2 ) \
{ \
alignResult[l].readID = tmpDPPairResult[k].readID; \
alignResult[l].insertSize = tmpDPPairResult[k].insertSize; \
if ( tmpDPPairResult[k].result_1 != NULL ) { \
alignResult[l].algnmt_1 = tmpDPPairResult[k].result_1->algnmt; \
alignResult[l].strand_1 = tmpDPPairResult[k].result_1->strand; \
alignResult[l].score_1 = tmpDPPairResult[k].result_1->score; \
alignResult[l].editdist_1 = tmpDPPairResult[k].result_1->editdist; \
alignResult[l].cigarString_1 = tmpDPPairResult[k].result_1->cigarString; \
alignResult[l].num_sameScore_1 = tmpDPPairResult[k].result_1->num_sameScore; \
alignResult[l].startPos_1 = tmpDPPairResult[k].result_1->startPos; \
alignResult[l].refDpLength_1 = tmpDPPairResult[k].result_1->refDpLength; \
alignResult[l].peLeftAnchor_1 = tmpDPPairResult[k].result_1->peLeftAnchor; \
alignResult[l].peRightAnchor_1 = tmpDPPairResult[k].result_1->peRightAnchor; \
alignResult[l].algnmt_2 = tmpDPPairResult[k].algnmt_2; \
alignResult[l].strand_2 = tmpDPPairResult[k].strand_2; \
alignResult[l].score_2 = tmpDPPairResult[k].score_2; \
alignResult[l].editdist_2 = tmpDPPairResult[k].editdist; \
alignResult[l].cigarString_2 = tmpDPPairResult[k].cigarString; \
alignResult[l].num_sameScore_2 = tmpDPPairResult[k].num_sameScore; \
alignResult[l].startPos_2 = tmpDPPairResult[k].startPos; \
alignResult[l].refDpLength_2 = tmpDPPairResult[k].refDpLength; \
alignResult[l].peLeftAnchor_2 = tmpDPPairResult[k].peLeftAnchor; \
alignResult[l].peRightAnchor_2 = tmpDPPairResult[k].peRightAnchor; \
} \
else if ( tmpDPPairResult[k].result_2 != NULL ) { \
alignResult[l].algnmt_1 = tmpDPPairResult[k].algnmt_1; \
alignResult[l].strand_1 = tmpDPPairResult[k].strand_1; \
alignResult[l].score_1 = tmpDPPairResult[k].score_1; \
alignResult[l].editdist_1 = tmpDPPairResult[k].editdist; \
alignResult[l].cigarString_1 = tmpDPPairResult[k].cigarString; \
alignResult[l].num_sameScore_1 = tmpDPPairResult[k].num_sameScore; \
alignResult[l].startPos_1 = tmpDPPairResult[k].startPos; \
alignResult[l].refDpLength_1 = tmpDPPairResult[k].refDpLength; \
alignResult[l].peLeftAnchor_1 = tmpDPPairResult[k].peLeftAnchor; \
alignResult[l].peRightAnchor_1 = tmpDPPairResult[k].peRightAnchor; \
alignResult[l].algnmt_2 = tmpDPPairResult[k].result_2->algnmt; \
alignResult[l].strand_2 = tmpDPPairResult[k].result_2->strand; \
alignResult[l].score_2 = tmpDPPairResult[k].result_2->score; \
alignResult[l].editdist_2 = tmpDPPairResult[k].result_2->editdist; \
alignResult[l].cigarString_2 = tmpDPPairResult[k].result_2->cigarString; \
alignResult[l].num_sameScore_2 = tmpDPPairResult[k].result_2->num_sameScore; \
alignResult[l].startPos_2 = tmpDPPairResult[k].result_2->startPos; \
alignResult[l].refDpLength_2 = tmpDPPairResult[k].result_2->refDpLength; \
alignResult[l].peLeftAnchor_2 = tmpDPPairResult[k].result_2->peLeftAnchor; \
alignResult[l].peRightAnchor_2 = tmpDPPairResult[k].result_2->peRightAnchor; \
} \
++l; \
} \
validResult = l; \
} \
if ( validResult ) \
{ \
tmpBestResult = outputDeepDPResult2(alignResult, outputBuf->size, \
engine->queries, engine->upkdReadLengths, \
engine->origReadIDs, engine->queryNames, engine->queryComments, engine->upkdQualities, \
engine->inputMaxReadLength, engine->accumReadNum, engine->outputFormat, \
engine->currSamOutputFilePtr[threadId], engine->index, \
engine->peStrandLeftLeg, engine->peStrandRightLeg, NULL); \
engine->dpInfoForReads->startPositions[tmpBestResult->readID] = tmpBestResult->startPos_1; \
engine->dpInfoForReads->strand_dpLengths[tmpBestResult->readID] = ( ( ( tmpBestResult->strand_1 - 1 ) << 15 ) | ( tmpBestResult->refDpLength_1 ) ); \
engine->dpInfoForReads->peLeftAnchors[tmpBestResult->readID] = tmpBestResult->peLeftAnchor_1; \
engine->dpInfoForReads->peRightAnchors[tmpBestResult->readID] = tmpBestResult->peRightAnchor_1; \
engine->dpInfoForReads->startPositions[tmpBestResult->readID + 1] = tmpBestResult->startPos_2; \
engine->dpInfoForReads->strand_dpLengths[tmpBestResult->readID + 1] = ( ( ( tmpBestResult->strand_2 - 1 ) << 15 ) | ( tmpBestResult->refDpLength_2 ) ); \
engine->dpInfoForReads->peLeftAnchors[tmpBestResult->readID+1] = tmpBestResult->peLeftAnchor_2; \
engine->dpInfoForReads->peRightAnchors[tmpBestResult->readID+1] = tmpBestResult->peRightAnchor_2; \
} \
} \
engine->numDPAlignedReads[threadId] += 1; \
engine->numDPAlignments[threadId] += outputBuf->size; \
engine->alignFlags->set(lastReadID); \
} \
free (alignResult) ; \
}
OutputBuffer<AlgnmtDPResult> *outputBuf;
outputBuf = new OutputBuffer<AlgnmtDPResult>();
outputBuf->setAlignmentType ( engine->alignmentType );
DPResultBatch & batch = *resultBatch;
int lastReadID = -1;
for ( int i = 0; i < batch.size(); i++ )
{
AlgnmtDPResult & result = batch[i];
if ( result.readID != lastReadID )
{
MC_OutputRead();
outputBuf->clear();
lastReadID = result.readID;
}
outputBuf->add ( result );
}
MC_OutputRead();
outputBuf->clear();
delete outputBuf;
for ( int i=0;i<batch.size();++i )
{
free ( batch[i].cigarString );
}
batch.clear();
}
void DP_Space::DPOutputThreadFinalize()
{
}
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////// deep-dp space ///////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
using namespace DeepDP_Space;
#define DP2_SEEDING_BATCH_SIZE 4 * 1024 * 1024
#define DP2_MARGIN(l) ((l>100) ? 30 : 25)
// ****
DeepDP_Space::CandidateStream::CandidateStream()
{
pthread_mutex_init ( &occupy_mutex, NULL );
}
void DeepDP_Space::CandidateStream::append ( vector<CandidateInfo> * canInfo, AlgnmtFlags * alignFlags )
{
pthread_mutex_lock ( &occupy_mutex );
for ( vector<CandidateInfo>::iterator it = canInfo->begin();
it < canInfo->end(); ++it )
{
data.push_back ( *it );
alignFlags->set ( ( it->readIDLeft >> 1 ) << 1 );
}
pthread_mutex_unlock ( &occupy_mutex );
}
// ****
PairEndSeedingEngine::PairEndSeedingBatch::PairEndSeedingBatch (
uint batchSize, DPParameters * dpPara,
uint * queries, uint * readLengths, uint inputMaxReadLength,
int insert_high, int insert_low,
int peStrandLeftLeg, int peStrandRightLeg, BWT * bwt, PairEndSeedingEngine * home
)
{
numberOfShortcut = 0;
lazyCnt = 0;
this->home = home;
MC_MemberCopy4 ( this->, , batchSize, queries, readLengths, bwt );
MC_MemberCopy4 ( this->, , insert_high, insert_low, peStrandLeftLeg, peStrandRightLeg );
this->numOfCPUForSeeding = dpPara->numOfCPUForSeeding;
for ( int i = 0; i < 2; i++ )
{
this->maxHitNum[i] = dpPara->paramRead[i].maxHitNum;
}
this->maxSeedLength = inputMaxReadLength;
this->wordPerSeed = MC_CeilDivide16 ( maxSeedLength );
this->wordPerQuery = getWordPerQuery ( inputMaxReadLength );
for ( int lOr = 0; lOr < 2; lOr++ )
{
MC_CheckMalloc ( readIDs[lOr], uint, batchSize );
MC_CheckMalloc ( lengths[lOr], uint, batchSize );
MC_CheckMalloc ( minLengths[lOr], uint, batchSize );
MC_CheckMalloc ( offsets[lOr], uint, batchSize );
MC_CheckMalloc ( seeds[lOr], uint, batchSize * wordPerSeed );
}
this->numNBMismatch = dpPara->seedProperties.numNBMismatch;
this->restrictedNBM = dpPara->seedProperties.restrictedNBM ;
MC_CheckMalloc ( seedPositions, int, inputMaxReadLength );
clear();
}
PairEndSeedingEngine::PairEndSeedingBatch::~PairEndSeedingBatch()
{
for ( int lOr = 0; lOr < 2; lOr++ )
{
free ( readIDs[lOr] );
free ( lengths[lOr] );
free ( minLengths[lOr] );
free ( offsets[lOr] );
free ( seeds[lOr] );
}
free ( seedPositions );
}
void PairEndSeedingEngine::PairEndSeedingBatch::clear()
{
for ( int i = 0; i < 2; i++ )
{
numQueries[i] = 0;
inPosArr[i].clear();
}
lastPairID = -1;
}
uint PairEndSeedingEngine::PairEndSeedingBatch::findRevStart (
SeedPos * arr, uint len
)
{
if ( len == 0 || ! ( arr[len - 1].strand_readID >> 31 ) )
{ return len; }
uint start = 0;
uint end = len - 1;
while ( start < end )
{
uint mid = ( start + end ) / 2;
if ( ( arr[mid].strand_readID >> 31 ) )
{
// reverse
end = mid;
}
else
{
// forward
start = mid + 1;
}
}
return start;
}
inline void PairEndSeedingEngine::PairEndSeedingBatch::pack (
uint evenReadID, uint readID, int off, int seedLength, int varMinLength, int readOrMate
)
{
int seedID = numQueries[readOrMate];
readIDs[readOrMate][seedID] = evenReadID;
lengths[readOrMate][seedID] = seedLength;
minLengths[readOrMate][seedID] = varMinLength;
offsets[readOrMate][seedID] = off;
#define MC_OldReadUnpackIn(X,i) ((X[oldReadTPARA + ((i>>4)<<5)] >> ((i & 0xF) << 1)) & 0x3)
uint oldReadTPARA = ( readID / 32 ) * 32 * wordPerQuery + ( readID % 32 );
uint seedTPARA = ( seedID / 32 ) * 32 * wordPerSeed + ( seedID % 32 );
for ( int i = 0; i < wordPerSeed; i++ )
{
seeds[readOrMate][seedTPARA + ( i << 5 )] = 0;
}
for ( int i = 0; i < seedLength; i++ )
{
int pos = off + i;
seeds[readOrMate][seedTPARA + ( ( i >> 4 ) << 5 )] |= ( uint ) MC_OldReadUnpackIn ( queries, pos ) << ( ( i & 0xF ) << 1 ) ;
}
++numQueries[readOrMate];
}
inline void PairEndSeedingEngine::PairEndSeedingBatch::packForMmpSeeding ( QueryIDStream * queryIDStream, int readOrMate )
{
vector<int> & evenReadIDs = *(queryIDStream->data);
for ( int i=0;i<evenReadIDs.size(); ++i )
{
readIDs[readOrMate][i] = evenReadIDs[i];
home->inputFlags->set( evenReadIDs[i] );
}
numQueries[readOrMate] = evenReadIDs.size();
}
int PairEndSeedingEngine::PairEndSeedingBatch::packSeeds (
uint evenReadID, int stage
)
{
for ( int i = 0; i < 2; i++ )
{
uint readID = evenReadID + i;
uint readLength = readLengths[readID];
int seedNum, seedLength;
// getSeedPositions ( STAGE_DEEP_DP_ROUND1, readLength, &seedLength, seedPositions, &seedNum );
SeedingProperties * seedingProperties = &(home->dpPara->seedProperties);
seedNum = seedingProperties->numberOfSeed;
if ( numQueries[i] + seedNum > batchSize )
{
return 0;
}
for ( int j = 0; j < seedNum; j++ )
{
if ( seedingProperties->seedPos[j] + seedingProperties->maxSeedLength[j] <= readLength )
{
// normal seeding
pack (evenReadID, readID, seedingProperties->seedPos[j], seedingProperties->maxSeedLength[j], seedingProperties->minSeedLength[j], i);
lastPairID = evenReadID >> 1;
}
// pack ( evenReadID, readID, seedPositions[j], seedLength, HALF_SEED_SIZE_FOR_V_LONG_READ_LB<<1, i );
}
}
return 1;
}
int PairEndSeedingEngine::PairEndSeedingBatch::packSeeds (
SRAOccurrence & occ, int stage
)
{
uint readID = occ.readID;
uint pairID = readID >> 1;
int readOrMate = readID & 1;
uint evenReadID = readID - readOrMate;
if ( pairID != lastPairID )
{
if ( !packSeeds ( evenReadID, stage ) )
{
return 0;
}
}
SeedPos pos;
pos.pos = occ.ambPosition;
pos.strand_readID = ( ( occ.strand - 1 ) << 31 ) | evenReadID;
inPosArr[readOrMate].push_back ( pos );
return 1;
}
void PairEndSeedingEngine::PairEndSeedingBatch::pairEndMerge (
vector<CandidateInfo> * &pairEndPos,
SeedPos * readPos, SeedPos * matePos,
int isMatePositive
)
{
#define MC_DecodePos(x) ((x)->pos)
#define MC_DecodeID(x) ((x)->strand_readID & 0x7FFFFFFF)
#define MC_ReadID() MC_DecodeID(readIter)
#define MC_MateID() MC_DecodeID(mateIter)
SeedPos * readIter = readPos;
SeedPos * mateIter = matePos;
uint readID;
uint mateID;
uint roundNum = engine->dpPara->roundNum;
while ( true )
{
mateID = MC_MateID();
while ( MC_ReadID() < mateID )
{ ++readIter; }
readID = MC_ReadID();
while ( MC_MateID() < readID )
{ ++mateIter; }
mateID = MC_MateID();
if ( mateID == 0x7FFFFFFF )
{ break; }
else if ( readID < mateID )
{ continue; }
SeedPos * readStart = readIter;
SeedPos * mateStart = mateIter;
// assert : readID == mateID
while ( MC_ReadID() == readID )
{ ++readIter; }
while ( MC_MateID() == mateID )
{ ++mateIter; }
SeedPos * readEnd = readIter;
SeedPos * mateEnd = mateIter;
#define MC_Compress(start, end, divideGap) { \
SeedPos *cmprReadIter = start; \
register unsigned long long prevLoc = MC_DecodePos(cmprReadIter); \
for (SeedPos* p = start+1; p < end; p++) { \
register unsigned long long curLoc = MC_DecodePos(p); \
if (prevLoc + divideGap < curLoc) { \
*(++cmprReadIter) = *p; \
prevLoc = curLoc; \
} \
} \
end = cmprReadIter + 1; \
}
MC_Compress ( readStart, readEnd, DP2_DIVIDE_GAP );
// get the read length of negative strand !
int readLength = readLengths[readID /2*2 + 1 - isMatePositive];
//fprintf(stderr,"my readlen %d wrong readlen !! %d\n", readLength, readLengths[readID]);
int margin = DP2_MARGIN ( readLength );
int length_low = insert_low - readLength - margin;
if (length_low < 0 )
length_low = 0;
int length_high = insert_high - readLength + margin;
SeedPos * readP = readStart;
SeedPos * mateP = mateStart;
register unsigned long long readLoc = MC_DecodePos ( readP );
register unsigned long long mateLoc = MC_DecodePos ( mateP );
SeedPos * matePreStart = mateP;
while ( readP < readEnd )
{
bool updatePreStart = false;
readLoc = MC_DecodePos ( readP );
for ( SeedPos * matei = matePreStart; matei < mateEnd; ++matei )
{
mateLoc = MC_DecodePos ( matei );
if ( readLoc + length_high < mateLoc )
{
break;
}
else if ( readLoc + length_low <= mateLoc )
{
CandidateInfo ci;
ci.pos[0] = readLoc;
ci.pos[1] = mateLoc;
ci.readIDLeft = MC_DecodeID ( readP ) + isMatePositive;
pairEndPos->push_back ( ci );
if ( !updatePreStart )
{
matePreStart = matei;
}
}
}
++readP;
readLoc = MC_DecodePos( readP );
}
}
}
struct RadixTraitsCandInfo {
static const int nBytes = 4;
int kth_byte(const DeepDP_Space::CandidateInfo &x, int k) {
return x.readIDLeft >> (k << 3) & 0xFF;
}
bool compare(const DeepDP_Space::CandidateInfo &x, const DeepDP_Space::CandidateInfo &y) {
return x.readIDLeft < y.readIDLeft;
}
};
struct CompareCandInfo {
bool operator()(const DeepDP_Space::CandidateInfo &x, const DeepDP_Space::CandidateInfo &y) {
return x.readIDLeft < y.readIDLeft;
}
};
vector<DeepDP_Space::CandidateInfo> * PairEndSeedingEngine::PairEndSeedingBatch::mergeAndPairPairedEnd ( SeedPos * readPos, SeedPos * matePos, int readPosLen, int matePosLen )
{
SeedPos * readArr[2], *mateArr[2];
// 0 -- forward, 1 -- reverse
readArr[0] = readPos;
mateArr[0] = matePos;
readArr[1] = readPos + findRevStart ( readPos, readPosLen );
mateArr[1] = matePos + findRevStart ( matePos, matePosLen );
vector<CandidateInfo> * canInfo = new vector<CandidateInfo>;
// pair positvie read and negative mate
pairEndMerge ( canInfo, readArr[peStrandLeftLeg - 1], mateArr[peStrandRightLeg - 1], 0 );
// pair positive mate and negative read
pairEndMerge ( canInfo, mateArr[peStrandLeftLeg - 1], readArr[peStrandRightLeg - 1], 1 );
free ( readPos );
free ( matePos );
// for ( int i=0;i<canInfo->size();++i )
// { fprintf( stderr, "%u %u\n", (*canInfo)[i].pos[0], (*canInfo)[i].pos[1] ); }
// Sort the candidates so that readID will be in order
// To be revised
vector<CandidateInfo> & candArr = *canInfo;
uint arrLength = candArr.size();
double start_time = setStartTime();
// kx::radix_sort(candArr.begin(), candArr.end(), RadixTraitsCandInfo());
__gnu_parallel::stable_sort(candArr.begin(), candArr.end(), CompareCandInfo());
// CandidateInfo * auxCandArr;
// stable sort looks more faster after sorting. so do not use kxsort here
// MC_CheckMalloc ( auxCandArr, CandidateInfo, arrLength );
// MC_RadixSort_32_16 ( candArr, readIDLeft, auxCandArr, arrLength );
// free ( auxCandArr );
fprintf(stderr, "[%s] Sorting n & time: %u, %f\n", __func__, candArr.size(), getElapsedTime(start_time));
return canInfo;
}
// ****
void PairEndSeedingEngine::PairEndSeedingThreadContext::init (
PairEndSeedingBatch * batch
)
{
sem_init ( &ACKSem, 0, 0 );
sem_init ( &GPUFinishSem, 0, 0 );
this->batch = batch;
this->batch->clear();
}
void PairEndSeedingEngine::PairEndSeedingThreadContext::freeMemory()
{
delete batch;
}
// ****
PairEndSeedingEngine::PairEndSeedingEngine()
{
queryIDStream = NULL;
halfEndOccStream = NULL;
tooManyHitIDStream = NULL;
}
struct SeedAlign {
unsigned long long offset;
uint multiplicity : 16;
int length : 16;
uint query_offset : 16;
SeedAlign() {}
SeedAlign(unsigned long long o, uint m, int l, uint qo) {
offset = o;
multiplicity = m;
length = l;
query_offset = qo;
}
bool operator< (const SeedAlign &rhs) const {
return offset < rhs.offset;
}
};
struct SeedSAalign {
uint query_offset : 10;
unsigned long long sa_l;
uint sa_diff : 10;
uint seed_len : 12;
SeedSAalign (uint qo = 0, unsigned long long sa_l = 0, uint sa_diff = 0, uint seed_len = 0)
: query_offset(qo), sa_l(sa_l), sa_diff(sa_diff), seed_len(seed_len) {}
bool valid() { return seed_len > 0; }
};
#define QUERY_BLOCK 32
template <int T>
void mmp(uint*, vector<SeedSAalign>&, BWT*, LT *lkt, int, int, unsigned long long, MmpProperties);
#define DEBUG_RESEED do { \
string s; \
for (int i = 0; i < len; ++i) {\
char c = (query[i/CHAR_PER_WORD] >> ( i % CHAR_PER_WORD * BIT_PER_CHAR)) & CHAR_MASK; \
s.push_back("ACGT"[c]); \
} \
fprintf(stderr, "[%s] %s Reseeding: Len %d->%d, range %d->%d\n", __func__, s.c_str(), seed_len, last_seed_len, r-l+1, last_r-last_l+1); \
} while (0)
#define CHECK_AND_SET_LAST \
do { \
if (seed_len >= mmpPara.seedMinLength && nextr - nextl < r - l) { \
last_r = r; \
last_l = l; \
last_seed_len = seed_len; \
} \
} while (0)
#define CHECK_AND_ADD_RANGE(_x_) \
do { \
int diff = 0; \
int x = _x_; \
if (seed_len >= mmpPara.seedMinLength) { \
if (seed_len >= mmpPara.reseedLen && last_r - last_l + 1 <= mmpPara.seedSAsizeThreshold && \
(seed_len - last_seed_len <= mmpPara.reseedAbsDiff || seed_len * mmpPara.reseedRLTratio < last_seed_len)) { \
diff = seed_len - last_seed_len; \
l = last_l, r = last_r, seed_len = last_seed_len;\
} \
result.emplace_back(SeedSAalign(x, l, min(1ULL * mmpPara.seedSAsizeThreshold, r - l), seed_len)); \
if (false) fprintf(stderr, "[%s] i: %d, x: %d, sl: %d, l: %llu, r: %llu\n", __func__, i, x, seed_len, l, r); \
} /* else discard this range */ \
i -= diff; \
i -= min(seed_len, mmpPara.seedMinLength); \
if (false) fprintf(stderr, "[%s] i: %d, sl: %d, r-l: %d, diff: %d\n", __func__, i, seed_len, r-l, diff); \
l = 0; \
r = text_length; \
revl = 0; \
revr = text_length; \
seed_len = 0; \
last_l = l, last_r = r, last_seed_len = 0; \
} while (0)
#define BIT_PER_CHAR LOOKUP_BIT_PER_CHAR
#define CHAR_MASK LOOKUP_CHAR_MASK
template<>
//positive strand backward
void mmp<0>(uint* query, vector<SeedSAalign> &result, BWT* bwt, LT *lkt, int start, int len, unsigned long long text_length, MmpProperties mmpPara) {
unsigned char c;
int i = 0, seed_len = 0, n_ranges = 0;
unsigned long long l = 0, r = text_length, nextl, nextr, revl, revr;
unsigned long long last_l = l, last_r = r, last_seed_len = 0;
vector<int> lkp(start + len);
for (int i = start, p = 0; i < start + len; ++i) {
int j = start+len-(i-start)-1;
int c = (query[j/CHAR_PER_WORD] >> ( j % CHAR_PER_WORD * BIT_PER_CHAR)) & CHAR_MASK;
p = (p >> LOOKUP_BIT_PER_CHAR) | (c << LOOKUP_BIT_PER_CHAR * (LOOKUP_SIZE-1));
if (i >= LOOKUP_SIZE - 1) {
lkp[i-LOOKUP_SIZE+1] = p;
}
}
for (i=start; i<start+len ; ++i) {
if (seed_len == 0) {
if (start + len - i < mmpPara.seedMinLength) { break; }
nextl = lkp[i] == 0 ? 1 : (lkt->table[lkp[i]-1]+1);
nextr = lkt->table[lkp[i]];
i += LOOKUP_SIZE - 1;
seed_len = LOOKUP_SIZE - 1;
} else {
int j = start+len-(i-start)-1;
c = (query[j/CHAR_PER_WORD] >> ( j % CHAR_PER_WORD * BIT_PER_CHAR)) & CHAR_MASK;
nextl = bwt->cumulativeFreq[c] + BWTOccValue(bwt, l, c) + 1;
nextr = bwt->cumulativeFreq[c] + BWTOccValue(bwt, r+1, c);
}
if (nextl <= nextr) {
CHECK_AND_SET_LAST;
l = nextl;
r = nextr;
++seed_len;
} else {
CHECK_AND_ADD_RANGE(start+len-(i-start));
}
}
CHECK_AND_ADD_RANGE(start);
}
template<>
//positive strand forward
void mmp<1>(uint* query, vector<SeedSAalign> &result, BWT* bwt, LT *lkt, int start, int len, unsigned long long text_length, MmpProperties mmpPara) {
unsigned char c;
int i = 0, seed_len = 0, n_ranges = 0;
unsigned long long l = 0, r = text_length, revl = 0, revr = text_length, nextl, nextr, oL[4], oR[4], oCount[4];
unsigned long long last_l = l, last_r = r, last_seed_len = 0;
vector<int> lkp(start + len);
for (int i = start, p = 0; i < start + len; ++i) {
int c = (query[i/CHAR_PER_WORD] >> ( i % CHAR_PER_WORD * BIT_PER_CHAR)) & CHAR_MASK;
p = (p >> LOOKUP_BIT_PER_CHAR) | (c << LOOKUP_BIT_PER_CHAR * (LOOKUP_SIZE-1));
if (i >= LOOKUP_SIZE - 1) {
lkp[i-LOOKUP_SIZE+1] = p;
}
}
for (i=start; i<start+len; ++i) {
if (seed_len == 0) {
if (start + len - i < mmpPara.seedMinLength) { break; }
nextl = lkp[i] == 0 ? 1 : (lkt->table[lkp[i]-1]+1);
nextr = lkt->table[lkp[i]];
i += LOOKUP_SIZE - 1;
seed_len = LOOKUP_SIZE - 1;
} else {
c = (query[i/CHAR_PER_WORD] >> ( i % CHAR_PER_WORD * BIT_PER_CHAR)) & CHAR_MASK;
BWTAllOccValue(bwt,revl,oL);
BWTAllOccValue(bwt,revr+1,oR);
oCount[3] = 0;
for (int k=2;k>=0;k--) oCount[k] = oCount[k+1]+oR[k+1] - oL[k+1];
nextl = bwt->cumulativeFreq[c] + oL[c] + 1;
nextr = bwt->cumulativeFreq[c] + oR[c];
}
if (nextl <= nextr) {
CHECK_AND_SET_LAST;
revl = nextl;
revr = nextr;
r = r - oCount[c];
l = r - (revr-revl);
++seed_len;
} else {
CHECK_AND_ADD_RANGE(i-seed_len);
}
}
CHECK_AND_ADD_RANGE(start+len-seed_len);
}
template<>
//negative strand backward
void mmp<2>(uint* query, vector<SeedSAalign> &result, BWT* bwt, LT *lkt, int start, int len, unsigned long long text_length, MmpProperties mmpPara) {
unsigned char c;
int i = 0, seed_len = 0, n_ranges = 0;
unsigned long long l = 0, r = text_length, nextl, nextr, revl, revr;
unsigned long long last_l = l, last_r = r, last_seed_len = 0;
vector<int> lkp(start + len);
for (int i = start, p = 0; i < start + len; ++i) {
int c = (query[i/CHAR_PER_WORD] >> ( i % CHAR_PER_WORD * BIT_PER_CHAR)) & CHAR_MASK;
p = (p >> LOOKUP_BIT_PER_CHAR) | ((3-c) << LOOKUP_BIT_PER_CHAR * (LOOKUP_SIZE-1));
if (i >= LOOKUP_SIZE - 1) {
lkp[i-LOOKUP_SIZE+1] = p;
}
}
for (i=start; i<start+len ; ++i) {
if (seed_len == 0) {
if (start + len - i < mmpPara.seedMinLength) { break; }
nextl = lkp[i] == 0 ? 1 : (lkt->table[lkp[i]-1]+1);
nextr = lkt->table[lkp[i]];
// validate correctness of LKT
// unsigned long long l = 0, r = text_length;
// for (int k = 0; k < LOOKUP_SIZE; ++k) {
// char a = (lkp[i] >> LOOKUP_BIT_PER_CHAR * k) & CHAR_MASK;
// char b = (query[(i+k)/CHAR_PER_WORD] >> ( (i+k) % CHAR_PER_WORD * BIT_PER_CHAR)) & CHAR_MASK;
// b = 3 - b;
// assert(a == b);
// l = bwt->cumulativeFreq[a] + BWTOccValue(bwt, l, a) + 1;
// r = bwt->cumulativeFreq[a] + BWTOccValue(bwt, r+1, a);
// }
// fprintf(stderr, "lktL: %llu, lktR: %llu, bwtL: %llu, bwtR: %llu\n", nextl, nextr, l, r);
// for (unsigned k = 0; k < 1 << LOOKUP_BIT_PER_CHAR * LOOKUP_SIZE; ++k) {
// if (lkt->table[k] == r) {
// fprintf(stderr, "%x <--> %x\n", k, lkp[i]);
// }
// }
i += LOOKUP_SIZE - 1;
seed_len = LOOKUP_SIZE - 1;
} else {
c = (query[i/CHAR_PER_WORD] >> ( i % CHAR_PER_WORD * BIT_PER_CHAR)) & CHAR_MASK;
c = 3-c;
nextl = bwt->cumulativeFreq[c] + BWTOccValue(bwt, l, c) + 1;
nextr = bwt->cumulativeFreq[c] + BWTOccValue(bwt, r+1, c);
}
if (nextl <= nextr) {
CHECK_AND_SET_LAST;
l = nextl;
r = nextr;
++seed_len;
} else {
CHECK_AND_ADD_RANGE(i-seed_len);
}
}
CHECK_AND_ADD_RANGE(start+len-seed_len);
}
typedef struct MMP_ARG {
BWT* lbwt;
BWT* rbwt;
LT* lkt;
LT* rlkt;
unsigned long long text_len;
uint* read_lens;
uint wpq;
uint* queries;
vector<vector<vector<SeedSAalign> > >* results;
uint st;
uint ed;
MmpProperties mmpPara;
} MMP_ARG;
void* mmp_worker(void* mmp_args) {
MMP_ARG* args = (MMP_ARG*) mmp_args;
for (int i=args->st;i<args->ed;++i) {
int read_len = args->read_lens[i];
mmp<0>(args->queries+i * args->wpq, (*(args->results))[1][i], args->lbwt, args->lkt, 0, read_len, args->text_len, args->mmpPara);
mmp<2>(args->queries+i * args->wpq, (*(args->results))[2][i], args->lbwt, args->lkt, 0, read_len, args->text_len, args->mmpPara);
}
}
uint64_t PairEndSeedingEngine::PairEndSeedingBatch::mmpSeeding( int words_per_query, SeedPos** readPos, SeedPos** matePos, int n_threads, SeedPool *seedPool, MmpProperties mmpPara) {
BWT *lbwt = bwt;
BWT *rbwt = engine->index->sraIndex->rev_bwt;
unsigned long long text_len = lbwt->textLength;
// build queries
uint nQ0 = numQueries[0];
uint nQ1 = numQueries[1];
uint nQ = nQ0 + nQ1;
uint nQ_round = nQ;
uint *packedQueries = (uint*) malloc( nQ_round * words_per_query * sizeof(uint) ); // is actually unpacked queries!
uint *read_lens = (uint*) malloc( nQ_round * sizeof(uint) );
// pack even-numbered reads
omp_set_num_threads(n_threads);
#pragma omp parallel for
for (uint i = 0; i < nQ0; ++i) {
int id = readIDs[0][i];
uint *src_p = queries + (id / QUERY_BLOCK * QUERY_BLOCK * words_per_query + id % QUERY_BLOCK);
uint *dst_p = packedQueries + words_per_query * i;
for (uint j = 0; j < words_per_query; ++j) {
*(dst_p + j) = *(src_p + QUERY_BLOCK * j);
}
read_lens[i] = readLengths[id];
}
// pack odd-numbered reads. note that read IDs give are even, so need +1
#pragma omp parallel for
for (uint i = 0; i < nQ1; ++i) {
int id = readIDs[1][i] + 1;
uint *src_p = queries + (id / QUERY_BLOCK * QUERY_BLOCK * words_per_query + id % QUERY_BLOCK);
uint *dst_p = packedQueries + words_per_query * (i+nQ0);
for (uint j = 0; j < words_per_query; ++j) {
*(dst_p + j) = *(src_p + QUERY_BLOCK * j);
}
read_lens[i+nQ0] = readLengths[id];
}
vector<vector<vector<SeedSAalign> > > results(4, vector<vector<SeedSAalign> >(nQ));
pthread_t* threads = new pthread_t[n_threads];
MMP_ARG* args = new MMP_ARG[n_threads];
int pp = nQ / n_threads;
for (int i=0;i<n_threads;++i) {
args[i].queries = packedQueries;
args[i].results = &results;
args[i].lbwt = lbwt;
args[i].rbwt = rbwt;
args[i].lkt = engine->index->sraIndex->lookupTable;
args[i].rlkt = engine->index->sraIndex->rev_lookupTable;
args[i].read_lens = read_lens;
args[i].text_len = text_len;
args[i].wpq = words_per_query;
args[i].st = pp * i ;
args[i].ed = pp * (i+1);
args[i].mmpPara = mmpPara;
}
args[n_threads-1].ed = nQ;
for (int i=0;i<n_threads;i++)
pthread_create(&threads[i], NULL, mmp_worker, (void*) &args[i]);
for (int i=0;i<n_threads;++i)
pthread_join(threads[i],NULL);
vector<vector<SeedPos> > vReadPos(n_threads);
vector<vector<SeedPos> > vMatePos(n_threads);
vector<vector<SeedPos> > vReadNeg(n_threads);
vector<vector<SeedPos> > vMateNeg(n_threads);
#pragma omp parallel for schedule(static) // must be static to reserve the order of read id
for (int i = 0 ;i < nQ; ++i) {
vector<SeedAlign> seed_aligns[4];
for (int a = 1; a <= 2; ++a) { // a=1 pos; a=2 neg
for (size_t j=0;j<results[a][i].size();++j) {
auto &res = results[a][i][j];
unsigned long long l = res.sa_l;
unsigned long long r = res.sa_l + res.sa_diff;
if (r > l + mmpPara.seedSAsizeThreshold) { r = mmpPara.seedSAsizeThreshold + l - 1; }
uint off = res.query_offset;
uint seedlen = res.seed_len;
for (unsigned long long k=l; k<=r; ++k) {
unsigned long long target_ofs = a == 1 ? (BWTSaValue (lbwt, k) - off) : (BWTSaValue (lbwt, k) - (read_lens[i] - seedlen - off));
if (seedlen >= mmpPara.goodSeedLen || seedlen >= read_lens[i] / 2) { // treat it as unique if seed is long enough
seed_aligns[a].push_back(SeedAlign(target_ofs, 1, seedlen, off));
} else {
seed_aligns[a].push_back(SeedAlign(target_ofs, r-l+1, seedlen, off));
}
}
}
} // end seed collection
sort(seed_aligns[1].begin(), seed_aligns[1].end());
sort(seed_aligns[2].begin(), seed_aligns[2].end());
vector<SeedPos> s_pos;
uint max_seed_len = 0;
// merge the seed alignments
for (int a = 1; a <= 2; ++a) {
for (size_t m = 0 ; m < seed_aligns[a].size(); ++m) {
bool has_unique = seed_aligns[a][m].multiplicity <= mmpPara.uniqThreshold && seed_aligns[a][m].length >= mmpPara.seedMinLength;
SeedPos sp;
sp.pos = seed_aligns[a][m].offset;
vector<pair<uint, uint> > itv(1, std::make_pair((uint)seed_aligns[a][m].query_offset, seed_aligns[a][m].length + seed_aligns[a][m].query_offset));
while (m+1 < seed_aligns[a].size() && seed_aligns[a][m+1].offset <= sp.pos + mmpPara.indelFuzz) {
++m;
has_unique |= seed_aligns[a][m].multiplicity <= mmpPara.uniqThreshold && seed_aligns[a][m].length >= mmpPara.seedMinLength;
itv.push_back(std::make_pair((uint)seed_aligns[a][m].query_offset, seed_aligns[a][m].length + seed_aligns[a][m].query_offset));
}
sort(itv.begin(), itv.end());
uint total_len = 0;
uint cur_start = 0;
uint cur_end = 0;
for (uint i = 0; i < itv.size(); ++i) {
if (itv[i].first >= cur_end) {
total_len += cur_end - cur_start;
cur_start = itv[i].first;
}
cur_end = max(cur_end, itv[i].second);
}
total_len += cur_end - cur_start;
if (max_seed_len < total_len) { max_seed_len = total_len; }
if (has_unique || total_len >= mmpPara.goodSeedLen) { // filtering criteria
sp.paired_seedLength = total_len;
sp.strand_readID = i < nQ0 ? readIDs[0][i] : readIDs[1][i-nQ0];
sp.strand_readID |= (a != 1) * 1ULL << 31;
s_pos.push_back(sp);
}
}
}
uint strand_readID = i < nQ0 ? readIDs[0][i] : readIDs[1][i-nQ0];
int tid = omp_get_thread_num();
for (size_t j = 0; j < s_pos.size(); ++j) {
if (s_pos[j].paired_seedLength >= mmpPara.shortSeedRatio * max_seed_len) {
bool isNeg = (s_pos[j].strand_readID >> 31);
auto &v = i < nQ0 ? (isNeg ? vReadNeg[tid] : vReadPos[tid]) : (isNeg ? vMateNeg[tid] : vMatePos[tid]);
v.push_back(s_pos[j]);
}
}
}
// sentinels
SeedPos t;
t.pos = kMaxULL;
t.paired_seedLength = 0xffffffff;
// merge all results
uint n_read_pos = 0, n_mate_pos = 0;
for (int i = 0; i < n_threads; ++i) {
n_read_pos += vReadPos[i].size() + vReadNeg[i].size();
n_mate_pos += vMatePos[i].size() + vMateNeg[i].size();
}
*readPos = (SeedPos*) malloc( (n_read_pos + 2) * sizeof(SeedPos) );
*matePos = (SeedPos*) malloc( (n_mate_pos + 2) * sizeof(SeedPos) );
uint nr_cur = 0, mr_cur = 0;
for (int i = 0; i < n_threads; ++i) {
memcpy(*readPos + nr_cur, &vReadPos[i][0], vReadPos[i].size() * sizeof(SeedPos));
nr_cur += vReadPos[i].size();
memcpy(*matePos + mr_cur, &vMatePos[i][0], vMatePos[i].size() * sizeof(SeedPos));
mr_cur += vMatePos[i].size();
}
t.strand_readID = 0x7fffffff;
(*readPos)[nr_cur++] = t;
(*matePos)[mr_cur++] = t;
for (int i = 0; i < n_threads; ++i) {
memcpy(*readPos + nr_cur, &vReadNeg[i][0], vReadNeg[i].size() * sizeof(SeedPos));
nr_cur += vReadNeg[i].size();
memcpy(*matePos + mr_cur, &vMateNeg[i][0], vMateNeg[i].size() * sizeof(SeedPos));
mr_cur += vMateNeg[i].size();
}
t.strand_readID = 0xffffffff;
(*readPos)[nr_cur++] = t;
(*matePos)[mr_cur++] = t;
fprintf(stderr, "[%s] read: %u, mate %u\n", __func__, n_read_pos, n_mate_pos);
free(read_lens);
free(packedQueries);
delete[] threads;
delete[] args;
double start_time = setStartTime();
// add to seed pool
for (int i = 0; i < n_threads; ++i) {
addSeedPosToSeedPool(seedPool, &vReadPos[i][0], 0, 0, vReadPos[i].size());
addSeedPosToSeedPool(seedPool, &vReadNeg[i][0], 0, 0, vReadNeg[i].size());
addSeedPosToSeedPool(seedPool, &vMatePos[i][0], 1, 0, vMatePos[i].size());
addSeedPosToSeedPool(seedPool, &vMateNeg[i][0], 1, 0, vMateNeg[i].size());
}
fprintf(stderr, "[%s] %u %u %u %u\n", __func__, vReadPos[0].size(), vReadNeg[0].size(), vMatePos[0].size(), vMateNeg[0].size());
fprintf(stderr, "[%s] Add to seed pool: %f\n", __func__, getElapsedTime(start_time));
return (uint64_t(n_mate_pos + 1) << 32 | (n_read_pos + 1));
}
void PairEndSeedingEngine::performMmpSeeding()
{
double start_time = setStartTime();
inputFlags = new AlgnmtFlags;
alignFlags = new AlgnmtFlags;
int word_per_query = getWordPerQuery( inputMaxReadLength );
seedingSwapBatch =
new PairEndSeedingBatch ( queryIDStream->data->size(), dpPara,
queries, queryLengths, inputMaxReadLength,
insert_high, insert_low,
peStrandLeftLeg, peStrandRightLeg, index->sraIndex->bwt, this );
seedingSwapBatch->packForMmpSeeding( queryIDStream, 0 );
seedingSwapBatch->packForMmpSeeding( queryIDStream, 1 );
fprintf(stderr, "[%s] Pre-seeding time: %f\n", __func__, getElapsedTime(start_time));
start_time = setStartTime();
// Necessary Parameters && Input
// ======================================================================================
// [Variable Name]: [Description]
// ======================================================================================
// seedingSwapBatch: it is PairEndSeedingBatch which has set the readIDs and numQueries
// this->soap3Wrapper: contains _bwt, _revBwt, _occ, _revOcc which are already malloc in GPU
// word_per_query: as its name
// ======================================================================================
// Expected Output
// ======================================================================================
// struct SeedPos
// {
// uint pos; // position
// uint strand_readID; // ( (strand<<31) | evenReadID ), strand: 0 = '+' and 1 = '-'
// uint paired_seedLength; // ( (0<<31) | seedLength), seedLength = seed alignment Length, paired part is determined in pairing stage
// };
// ======================================================================================
// SeedPos * readPos;
// SeedPos * matePos;
//
// Note:
// Please push two SeedPos, one with strand_readID=0x7fffffff and one with strand_readID=0xffffffff into the end of readPos
// and also for matePos
// They will be then used to seperate SeedPos by strand and the length of readPos/matePos can be found
//
// Chun will write the code for sorting them
// Maybe we can call mmpSeeding as follows
SeedPos * readPos;
SeedPos * matePos;
uint64_t arrayLens = seedingSwapBatch->mmpSeeding( word_per_query, &readPos, &matePos, dpPara->numOfCPUThreads, engine->seedPool, dpPara->mmpProperties);
fprintf(stderr, "[%s] Seeding time: %f\n", __func__, getElapsedTime(start_time));
start_time = setStartTime();
vector<CandidateInfo> * candidates = seedingSwapBatch->mergeAndPairPairedEnd ( readPos, matePos, arrayLens & 0xffffffff, arrayLens >> 32);
fprintf(stderr, "[%s] MergePE time: %f\n", __func__, getElapsedTime(start_time));
start_time = setStartTime();
engine->canStream->append ( candidates, engine->alignFlags );
alignFlags->getXOR ( inputFlags, unseededIDStream->data );
fprintf(stderr, "[%s] Post-seeding time: %f\n", __func__, getElapsedTime(start_time));
start_time = setStartTime();
delete candidates;
delete inputFlags;
delete alignFlags;
delete seedingSwapBatch;
}
void PairEndSeedingEngine::performMmpSeeding (
/* input */
QueryIDStream * queryIDStream,
DPParameters * dpPara,
uint * queries, uint * queryLengths, int inputMaxReadLength,
int insert_high, int insert_low,
int peStrandLeftLeg, int peStrandRightLeg,
/* soap3 seeding related */
SOAP3Wrapper<void> * soap3Wrapper,
Soap3Index * index,
SeedPool * seedPool,
/* output */
CandidateStream * canStream,
QueryIDStream * unseededIDStream
)
{
engine = new PairEndSeedingEngine();
MC_MemberCopy5 ( engine->, , queryIDStream, dpPara, queries, queryLengths, inputMaxReadLength );
MC_MemberCopy4 ( engine->, , insert_high, insert_low, peStrandLeftLeg, peStrandRightLeg );
MC_MemberCopy4 ( engine->, , soap3Wrapper, index, canStream, unseededIDStream );
engine->seedPool = seedPool;
engine->performMmpSeeding();
delete engine;
}
PairEndSeedingEngine * PairEndSeedingEngine::engine;
void DeepDP_Space::SeedingGPUThreadInit()
{
// showGPUMemInfo("seeding enter");
}
void DeepDP_Space::SeedingGPUThread ( int threadId, int *& pCallThreadId )
{
assert(false);
}
void DeepDP_Space::SeedingGPUThreadFinalize()
{
// showGPUMemInfo("seeding exit");
}
void DeepDP_Space::SeedingCPUThread ( int threadId, void *& empty )
{
assert(false);
}
void DeepDP_Space::DPExtensionPassUnalignedReads (
QueryIDStream * unalignedIDStream,
uint * queries, uint * upkdReadLengths, int inputMaxReadLength,
Soap3Index * index, int peStrandLeftLeg, int peStrandRightLeg,
char ** queryNames, char ** queryComments, uint * origReadIDs, char * upkdQualities,
uint accumReadNum, int outputFormat, samfile_t * samOutputDPFilePtr,
unsigned int maxHitNumForDP, unsigned int maxHitNumForDP2,
ReadInputForDP * dpInput, ReadInputForDP * dpInputForNewDefault,
ReadInputForDP * otherSoap3Result, BothUnalignedPairs * bothUnalignedPairs)
{
assert(false);
}
void DeepDP_Space::DP2OutputUnalignedReads (
QueryIDStream * unalignedIDStream, SeedPool * seedPool,
uint * queries, uint * upkdReadLengths, int inputMaxReadLength,
Soap3Index * index, int peStrandLeftLeg, int peStrandRightLeg,
char ** queryNames, char ** queryComments, uint * origReadIDs, char * upkdQualities,
uint accumReadNum, int outputFormat, samfile_t * samOutputDPFilePtr
)
{
// output unaligned result
#define MC_DP2OutputUnalgnRead() { \
outputDeepDPResult2(buf, idx, \
queries, upkdReadLengths, \
origReadIDs, queryNames, queryComments, upkdQualities, \
inputMaxReadLength, accumReadNum, outputFormat, \
samOutputDPFilePtr, index, \
peStrandLeftLeg, peStrandRightLeg, NULL); }
DeepDPAlignResult * buf;
MC_CheckMalloc ( buf, DeepDPAlignResult, 1024 );
int idx = 0;
for ( uint i = 0; i < unalignedIDStream->data->size(); i++ )
{
buf[idx].readID = ( * ( unalignedIDStream->data ) ) [i];
buf[idx].algnmt_1 = kMaxULL;
buf[idx].algnmt_2 = kMaxULL;
buf[idx].cigarString_1 = NULL;
buf[idx].cigarString_2 = NULL;
++idx;
if ( idx >= 1024 )
{
MC_DP2OutputUnalgnRead();
idx = 0;
}
}
if ( idx > 0 )
{ MC_DP2OutputUnalgnRead(); }
free ( buf );
}
// ****
PairEndAlignmentEngine::PairEndAlgnBatch::PairEndAlgnBatch (
int batchSize, DPParameters * dpPara,
int peStrandLeftLeg, int peStrandRightLeg, int insert_high, int insert_low,
int maxReadLength, int maxDNALength, int maxDPTableLength, int patternLength,
Soap3Index * index, uint * queries, uint inputMaxReadLength, uint * upkdLengths,
DPInfoForReads * dpInfoForReads
)
{
MC_MemberCopy5 ( this->, , batchSize, maxReadLength, maxDNALength, maxDPTableLength, patternLength );
MC_MemberCopy4 ( this->, , peStrandLeftLeg, peStrandRightLeg, insert_high, insert_low );
MC_MemberCopy3 ( this->, , queries, inputMaxReadLength, upkdLengths );
MC_MemberCopy ( this->, , dpInfoForReads );
MC_MemberCopy2 ( this->, dpPara->, softClipLeft, softClipRight );
this->wordPerOldQuery = getWordPerQuery ( inputMaxReadLength );
this->wordPerQuery = MC_CeilDivide16 ( maxReadLength );
this->wordPerDNA = MC_CeilDivide16 ( maxDNALength );
this->packedDNA = index->sraIndex->hsp->packedDNA;
this->fullDNALength = index->sraIndex->hsp->dnaLength;
this->index = index;
MC_CheckMalloc ( packedDNASeq, uint, batchSize * wordPerDNA );
MC_CheckMalloc ( packedReadSeq, uint, batchSize * wordPerQuery );
MC_CheckMalloc ( canInfos, CandidateInfo, batchSize );
MC_CheckMalloc ( DNALengths, uint, batchSize );
MC_CheckMalloc ( lengths, uint, batchSize );
MC_CheckMalloc ( cutoffThresholds, int, batchSize );
for ( int lOr = 0; lOr < 2; lOr++ )
{
MC_CheckMalloc ( scores[lOr], int, batchSize );
MC_CheckMalloc ( hitLocs[lOr], uint, batchSize );
MC_CheckMalloc ( pattern[lOr], uchar, batchSize * patternLength );
MC_CheckMalloc ( maxScoreCounts[lOr], uint, batchSize );
}
MC_CheckMalloc ( softClipLtSizes, uint, batchSize );
MC_CheckMalloc ( softClipRtSizes, uint, batchSize );
MC_CheckMalloc ( peLeftAnchorLocs, uint, batchSize );
MC_CheckMalloc ( peRightAnchorLocs, uint, batchSize );
clear();
}
PairEndAlignmentEngine::PairEndAlgnBatch::~PairEndAlgnBatch()
{
free ( packedDNASeq );
free ( packedReadSeq );
free ( canInfos );
free ( DNALengths );
free ( lengths );
free ( cutoffThresholds );
for ( int lOr = 0; lOr < 2; lOr++ )
{
free ( scores[lOr] );
free ( hitLocs[lOr] );
free ( pattern[lOr] );
free ( maxScoreCounts[lOr] );
}
free ( softClipLtSizes );
free ( softClipRtSizes );
free ( peLeftAnchorLocs );
free ( peRightAnchorLocs );
}
void PairEndAlignmentEngine::PairEndAlgnBatch::clear()
{
numOfThreads = 0;
}
int PairEndAlignmentEngine::PairEndAlgnBatch::packLeft (
CandidateInfo & canInfo
)
{
if ( numOfThreads >= batchSize )
{
return 0;
}
uint readIDLeft = canInfo.readIDLeft;
uint readLength = upkdLengths[readIDLeft];
int margin = DP2_MARGIN ( readLength );
unsigned long long DNAStartLeft = ( engine->dpPara->isExtensionDP ? canInfo.pos[0] : ( canInfo.pos[0] - margin ) );
if ( DNAStartLeft >= fullDNALength )
{
DNAStartLeft = 0;
}
uint DNALength = readLength + margin * 2;
if ( DNAStartLeft + DNALength > fullDNALength )
{
DNALength = fullDNALength - DNAStartLeft;
}
// no anchor requirement
peLeftAnchorLocs[numOfThreads] = maxDNALength;
peRightAnchorLocs[numOfThreads] = 0;
if ( engine->dpPara->isExtensionDP )
{
packRead ( packedReadSeq, numOfThreads,
readIDLeft, readLength, 1 );
if ( peStrandLeftLeg == 1 )
{
repackDNA ( packedDNASeq, numOfThreads,
packedDNA, DNAStartLeft, DNALength );
}
else
{
repackDNA_Reverse_Complement ( packedDNASeq, numOfThreads,
packedDNA, DNAStartLeft + readLength, DNALength);
DNAStartLeft += readLength;
}
}
else
{
packRead ( packedReadSeq, numOfThreads,
readIDLeft, readLength, peStrandLeftLeg );
repackDNA ( packedDNASeq, numOfThreads,
packedDNA, DNAStartLeft, DNALength );
}
softClipLtSizes[numOfThreads] = ( peStrandLeftLeg == 1 ) ?
softClipLeft : softClipRight;
softClipRtSizes[numOfThreads] = ( peStrandLeftLeg == 1 ) ?
softClipRight : softClipLeft;
DNALengths[numOfThreads] = DNALength;
lengths[numOfThreads] = readLength;
cutoffThresholds[numOfThreads] = std::max(DP_SCORE_THRESHOLD_RATIO * readLength, DP_SCORE_THRESHOLD_LOWER_BOUND);
canInfo.pos[0] = DNAStartLeft;
canInfo.dnaLength[0] = DNALength;
canInfo.peLeftAnchor[0] = peLeftAnchorLocs[numOfThreads];
canInfo.peRightAnchor[0] = peRightAnchorLocs[numOfThreads];
canInfos[numOfThreads] = canInfo;
++numOfThreads;
return 1;
}
void PairEndAlignmentEngine::PairEndAlgnBatch::packRight()
{
for ( int i = 0; i < numOfThreads; i++ )
{
uint readIDLeft = canInfos[i].readIDLeft;
uint leftIsOdd = readIDLeft & 1;
if ( scores[0][i] >= cutoffThresholds[i] )
{
uint readIDLeft = canInfos[i].readIDLeft;
uint readIDRight = ( leftIsOdd ) ? ( readIDLeft - 1 ) : ( readIDLeft + 1 );
uint readLength = upkdLengths[readIDRight];
// fprintf(stderr, "%d: %u\n", readIDRight, readLength);
uint margin = DP2_MARGIN ( readLength );
unsigned long long DNAStartRight = ( engine->dpPara->isExtensionDP ? canInfos[i].pos[1] : ( canInfos[i].pos[1] - margin ) );
if ( DNAStartRight >= fullDNALength )
{
DNAStartRight = 0;
}
uint DNALength = readLength + margin * 2;
if ( DNAStartRight + DNALength > fullDNALength )
{
DNALength = fullDNALength - DNAStartRight;
}
unsigned long long hitPosLeft = canInfos[i].pos[0] + hitLocs[0][i];
// restrict maximum insert size
unsigned long long boundedLength = hitPosLeft + insert_high - DNAStartRight;
if ( boundedLength < DNALength ) \
DNALength = boundedLength;
if ( engine->dpPara->isExtensionDP )
{
// set pair-end anchor boundary, restrict minimum insert size
packRead ( packedReadSeq, i,
readIDRight, readLength, 1 );
if ( peStrandRightLeg == 1 )
{
repackDNA ( packedDNASeq, i,
packedDNA, DNAStartRight, DNALength );
}
else
{
repackDNA_Reverse_Complement ( packedDNASeq, i,
packedDNA, DNAStartRight + readLength, DNALength);
DNAStartRight += readLength;
}
// assume no anchor for DP Extension
peLeftAnchorLocs[i] = maxDNALength;
peRightAnchorLocs[i] = 0;
}
else
{
// set pair-end anchor boundary, restrict minimum insert size
peLeftAnchorLocs[i] = maxDNALength;
long long rightAnchor = hitPosLeft + insert_low - DNAStartRight;
peRightAnchorLocs[i] = rightAnchor > 0 ? rightAnchor : 0;
packRead ( packedReadSeq, i,
readIDRight, readLength, peStrandRightLeg );
repackDNA ( packedDNASeq, i,
packedDNA, DNAStartRight, DNALength );
}
softClipLtSizes[i] = ( peStrandRightLeg == 1 ) ?
softClipLeft : softClipRight;
softClipRtSizes[i] = ( peStrandRightLeg == 1 ) ?
softClipRight : softClipLeft;
DNALengths[i] = DNALength;
lengths[i] = readLength;
cutoffThresholds[i] = std::max(DP_SCORE_THRESHOLD_RATIO * readLength, DP_SCORE_THRESHOLD_LOWER_BOUND);
canInfos[i].pos[1] = DNAStartRight;
canInfos[i].dnaLength[1] = DNALength;
canInfos[i].peLeftAnchor[1] = peLeftAnchorLocs[i];
canInfos[i].peRightAnchor[1] = peRightAnchorLocs[i];
}
}
}
inline void PairEndAlignmentEngine::PairEndAlgnBatch::packRead (
uint * packedSeq, uint threadId,
uint readID, uint length, int strand
)
{
#define MC_OldReadUnpack(X,i) ((X[oldReadTPARA + (((i)>>4)<<5)] >> (((i) & 0xF) << 1)) & 0x3)
uint oldReadTPARA = ( readID / 32 ) * 32 * wordPerOldQuery + ( readID % 32 );
uint readTPARA = ( threadId / 32 ) * 32 * wordPerQuery + ( threadId % 32 );
for ( uint i = 0; i <= ( length / CHAR_PER_WORD ); i++ )
{
packedSeq[readTPARA + ( i << 5 )] = 0;
}
if ( strand == 1 )
{
for ( int i = 1; i <= length; i++ )
{
int fwd_i = i - 1;
register uint c_nucleotide = ( uint ) MC_OldReadUnpack ( queries, fwd_i );
#ifdef BS_MOD
c_nucleotide = c_nucleotide ^ ( ( c_nucleotide == index->sraIndex->hsp->flag ) << 1 );
#endif
packedSeq[readTPARA + ( ( i >> 4 ) << 5 )] |= c_nucleotide << ( ( 15 - ( i & 0xF ) ) << 1 );
}
}
else // strand == 2
{
for ( int i = 1; i <= length; i++ )
{
int rev_i = length - i;
register uint c_nucleotide = soap3DnaComplement[( uint ) MC_OldReadUnpack ( queries, rev_i )];
#ifdef BS_MOD
c_nucleotide = c_nucleotide ^ ( ( c_nucleotide == index->sraIndex->hsp->flag ) << 1 );
#endif
packedSeq[readTPARA + ( ( i >> 4 ) << 5 )] |= c_nucleotide << ( ( 15 - ( i & 0xF ) ) << 1 );
}
}
}
inline void PairEndAlignmentEngine::PairEndAlgnBatch::repackDNA (
uint * packedSeq, uint threadId,
uint * seq, unsigned long long start, uint length
)
{
size_t dnaTPARA = ( threadId / 32 ) * 32 * wordPerDNA + ( threadId & 0x1F );
uint *src = seq + start / 16;
uint src_ofs = start % 16;
uint *dst = packedSeq + dnaTPARA;
uint dst_ofs = 1;
*dst = 0;
// we need a 0 at the beginning to reserve the first column of DP table
while (length > 0) {
uint len = min(min(16 - dst_ofs, 16 - src_ofs), length);
*dst |= *src << (src_ofs * 2) >> (32 - len*2) << (32-(dst_ofs+len)*2);
length -= len;
dst_ofs += len;
src_ofs += len;
if (src_ofs == 16) { ++src; src_ofs = 0; }
if (dst_ofs == 16) { dst += 32; dst_ofs = 0; *dst = 0; }
}
}
// Variable:
// start : is the last position of positive strand DNA
inline void PairEndAlignmentEngine::PairEndAlgnBatch::repackDNA_Reverse_Complement (
uint * packedSeq, uint threadId,
uint * seq, unsigned long long start, uint length
)
{
#define MC_OldDnaUnpack(X,i) ((X[(i)>>4] >> ((15-((i)&0xF))<<1)) & 3)
size_t dnaTPARA = ( threadId / 32 ) * 32 * wordPerDNA + ( threadId & 0x1F );
for ( uint i = 0; i <= ( length / CHAR_PER_WORD ); i++ )
{
packedSeq[dnaTPARA + ( i << 5 )] = 0;
}
const char dnaMap[] = {'A','C','G','T'};
for ( int i = 1; i <= length; i++ )
{ packedSeq[dnaTPARA + ( ( i >> 4 ) << 5 )] |= ( uint ) ( ( 3 - MC_OldDnaUnpack ( seq, start - i ) ) ) << ( ( 15 - ( i & 0xF ) ) << 1 ); }
}
// ****
void PairEndAlignmentEngine::PairEndAlgnThreadContext::init (
PairEndAlgnBatch * batch
)
{
int batchSize = engine->DP2_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK;
semiGlobalAligner.init ( batchSize, engine->maxReadLength,
engine->maxDNALength, engine->maxDPTableLength, * ( engine->dpPara ) );
batchID = -1;
this->dp2AlignedRead = 0;
this->dp2Alignment = 0;
this->lastReadID = -1;
this->alignFlag = new AlgnmtFlags;
sem_init ( &ACKSem, 0, 0 );
sem_init ( &GPUFinishSem, 0, 0 );
sem_init ( &outputACKSem, 0, 0 );
this->batch = batch;
}
void PairEndAlignmentEngine::PairEndAlgnThreadContext::freeMemory()
{
semiGlobalAligner.freeMemory();
delete this->alignFlag;
delete batch;
}
// ****
PairEndAlignmentEngine::AlgnmtResultStream::AlgnmtResultStream()
{
numOut = 0;
pthread_mutex_init ( &occupy_mutex, NULL );
}
PairEndAlignmentEngine::AlgnmtResultStream::~AlgnmtResultStream()
{
for ( int i = 0; i < dp2Result.size(); i++ )
{
DP2ResultBatch & resultBatch = * ( dp2Result[i] );
for ( int j = 0; j < resultBatch.size(); j++ )
{
free ( resultBatch[j].cigarString_1 );
free ( resultBatch[j].cigarString_2 );
}
delete dp2Result[i];
}
dp2Result.clear();
}
// ****
PairEndAlignmentEngine::PairEndAlignmentEngine() {}
void PairEndAlignmentEngine::performAlignment ( uint & numDPAlignedRead, uint & numDPAlignment )
{
/* initialize */
algnBatchCount = 0;
dp2AlignedRead = 0;
dp2Alignment = 0;
lastReadID = -1;
inputFlags = new AlgnmtFlags;
alignFlags = new AlgnmtFlags;
resultStream = new AlgnmtResultStream;
outputBuf = new OutputBuffer<DeepDPAlignResult>();
/**/
resultStreams = ( AlgnmtResultStream ** ) malloc ( dpPara->numOfCPUThreads * sizeof ( AlgnmtResultStream * ) );
outputBufs = ( OutputBuffer<DeepDPAlignResult> ** ) malloc ( dpPara->numOfCPUThreads * sizeof ( OutputBuffer<DeepDPAlignResult> * ) );
resultOutputStrings = ( char *** ) malloc ( dpPara->numOfCPUThreads * sizeof ( char ** ) );
numberOfResultOutputString = ( int * ) malloc ( dpPara->numOfCPUThreads * sizeof ( int ) );
/**/
outputBuf->setAlignmentType ( alignmentType );
maxReadLength = ( inputMaxReadLength / 4 + 1 ) * 4;
maxDNALength = maxReadLength + 2 * DP2_MARGIN ( inputMaxReadLength ) + 8;
semiGlobalAligner.decideConfiguration ( maxReadLength, maxDNALength,
maxDPTableLength, DP2_ALGN_NUM_OF_BLOCKS,
patternLength, *dpPara );
resultOutputStringBufferIter = 0;
resultOutputStringBufferSize = DP2_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK * 2 * 7;
resultOutputStringBuffer = ( char ** ) malloc ( resultOutputStringBufferSize * sizeof ( char * ) );
for ( int i=0; i<dpPara->numOfCPUThreads; ++i )
{
resultStreams[i] = new AlgnmtResultStream;
outputBufs[i] = new OutputBuffer<DeepDPAlignResult>();
outputBufs[i]->setAlignmentType( alignmentType );
resultOutputStrings[i] = ( char ** ) malloc ( DP2_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK * 2 * sizeof ( char * ) );
numberOfResultOutputString[i] = 0;
}
algnSwapBatch =
new PairEndAlgnBatch ( DP2_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK, dpPara,
peStrandLeftLeg, peStrandRightLeg, insert_high, insert_low,
maxReadLength, maxDNALength, maxDPTableLength, patternLength,
index, queries, inputMaxReadLength, upkdReadLengths,
dpInfoForReads );
algnThreadContext = new PairEndAlgnThreadContext[dpPara->numOfCPUThreads];
for ( int i = 0; i < dpPara->numOfCPUThreads; i++ )
{
PairEndAlgnBatch * batch =
new PairEndAlgnBatch ( DP2_ALGN_NUM_OF_BLOCKS * DP_THREADS_PER_BLOCK, dpPara,
peStrandLeftLeg, peStrandRightLeg, insert_high, insert_low,
maxReadLength, maxDNALength, maxDPTableLength, patternLength,
index, queries, inputMaxReadLength, upkdReadLengths,
dpInfoForReads
);
algnThreadContext[i].init ( batch );
}
if ( !( samOutputDPFilePtr != NULL && samOutputDPFilePtr->type & TYPE_BAM ) )
{
outputThreadDelegator.init ( 1, DP2OutputThread2,
NULL, DP2OutputThread2Finalize );
}
else
{
outputThreadDelegator.init ( 1, DP2OutputThread,
NULL, DP2OutputThreadFinalize );
}
algnmtCPUThreadDelegator.init ( dpPara->numOfCPUThreads, DP2CPUAlgnThread );
/* perform alignment */
int threadId;
void * empty;
int cntRound=0,cntPairs=0,cntP=0;
double startTime=setStartTime(), lastEventTime=0,elapsedTime, maxWait=0, minWait=100, tmp, totalWait=0;
int numberOfDPInstancesRemainedOfCurrentReadPair = 0;
int lastReadId=-1;
fprintf(stderr, "[PairEndAlignmentEngine::performAlignment] Candidate: %d\n", canStream->data.size());
for ( uint i = 0; i < canStream->data.size(); i++ )
{
if ( lastReadId != canStream->data[i].readIDLeft )
{ lastReadId = canStream->data[i].readIDLeft; ++cntP; }
if ( numberOfDPInstancesRemainedOfCurrentReadPair == 0 )
{
uint j=i;
for ( j=i; j < canStream->data.size() && ( canStream->data[j].readIDLeft & 0xfffffffe ) == (canStream->data[i].readIDLeft & 0xfffffffe); ++j );
numberOfDPInstancesRemainedOfCurrentReadPair = j-i;
++cntPairs;
}
CandidateInfo & info = canStream->data[i];
inputFlags->set ( ( info.readIDLeft >> 1 ) << 1 );
#ifdef ALIGNMENT_DEBUG
assert ( numberOfDPInstancesRemainedOfCurrentReadPair <= algnSwapBatch->batchSize );
#else
if ( numberOfDPInstancesRemainedOfCurrentReadPair > algnSwapBatch->batchSize )
{
fprintf(stderr, "[PairEndAlignmentEngine::performAlignment] Wrong configuration between GPU batch size and Max. # of seed alignment pairs for each read pair\n");
}
#endif
uint availableNumberOfCaninfoForThisBatch = algnSwapBatch->batchSize - algnSwapBatch->numOfThreads;
if ( numberOfDPInstancesRemainedOfCurrentReadPair > availableNumberOfCaninfoForThisBatch )
{
lastEventTime = getElapsedTime(startTime) ;
// launch one batch
threadId = algnmtCPUThreadDelegator.schedule ( empty );
sem_wait ( & ( algnThreadContext[threadId].ACKSem ) );
tmp = getElapsedTime (startTime);
if ( maxWait < tmp - lastEventTime )
maxWait = tmp - lastEventTime;
if ( minWait > tmp - lastEventTime )
minWait = tmp -lastEventTime;
totalWait += tmp - lastEventTime;
lastEventTime = tmp;
++cntRound;
algnSwapBatch->clear();
}
algnSwapBatch->packLeft ( info ) ;
--numberOfDPInstancesRemainedOfCurrentReadPair;
}
/*
fprintf(stderr, "Min wait: %f seconds\n", minWait);
fprintf(stderr, "Max wait: %f seconds\n", maxWait);
fprintf(stderr, "Total wait: %f seconds\n", totalWait);
fprintf(stderr, "Avg wait: %f seconds\n", totalWait*1.0/cntRound);
fprintf(stderr, "%d rounds for %d pairs among %d pairs\n", cntRound, cntPairs, cntP);
*/
// last batch
if ( algnSwapBatch->numOfThreads > 0 )
{
threadId = algnmtCPUThreadDelegator.schedule ( empty );
sem_wait ( & ( algnThreadContext[threadId].ACKSem ) );
}
/* finalize */
algnmtCPUThreadDelegator.finalize();
outputThreadDelegator.finalize();
/**/
for ( int i=0;i<dpPara->numOfCPUThreads;++i )
{ alignFlags->XOR ( algnThreadContext[i].alignFlag ); }
/**/
alignFlags->getXOR ( inputFlags, unalignedIDStream->data );
delete inputFlags;
delete alignFlags;
delete algnSwapBatch;
/**/
for ( int i=0;i<dpPara->numOfCPUThreads;++i )
{
dp2AlignedRead += algnThreadContext[i].dp2AlignedRead;
dp2Alignment += algnThreadContext[i].dp2Alignment;
delete outputBufs[i];
delete resultStreams[i];
free ( resultOutputStrings[i] );
}
free ( outputBufs );
free ( resultStreams );
free ( resultOutputStrings );
free ( resultOutputStringBuffer );
free ( numberOfResultOutputString );
/**/
for ( int i = 0; i < dpPara->numOfCPUThreads; i++ )
{
algnThreadContext[i].freeMemory();
}
delete[] algnThreadContext;
delete outputBuf;
delete resultStream;
// fprintf(stderr, "GPU %f seconds\n",gpuAlignmentTime);
numDPAlignedRead = this->dp2AlignedRead;
numDPAlignment = this->dp2Alignment;
}
void PairEndAlignmentEngine::performAlignment (
/* input */
CandidateStream * canStream,
DPParameters * dpPara,
bool shortDnaLength,
uint * queries, uint * upkdReadLengths, int inputMaxReadLength,
int insert_high, int insert_low,
int peStrandLeftLeg, int peStrandRightLeg,
char ** queryNames, char ** queryComments, uint * origReadIDs, char * upkdQualities,
DPInfoForReads * dpInfoForReads,
Soap3Index * index,
int alignmentType,
uint accumReadNum, int outputFormat, samfile_t * samOutputDPFilePtr, SeedPool * seedPool, samfile_t ** samOutputDPFilePtrs,
/* output */
QueryIDStream * unalignedIDStream,
uint & numDPAlignedRead,
uint & numDPAlignment
)
{
engine = new PairEndAlignmentEngine();
MC_MemberCopy2 ( engine->, , canStream, dpPara );
MC_MemberCopy4 ( engine->, , queries, queryNames, upkdReadLengths, inputMaxReadLength );
MC_MemberCopy ( engine->, , queryComments);
MC_MemberCopy4 ( engine->, , insert_high, insert_low, peStrandLeftLeg, peStrandRightLeg );
MC_MemberCopy2 ( engine->, , origReadIDs, upkdQualities );
MC_MemberCopy ( engine->, , dpInfoForReads );
MC_MemberCopy ( engine->, , index );
MC_MemberCopy4 ( engine->, , accumReadNum, outputFormat, samOutputDPFilePtrs, samOutputDPFilePtr );
MC_MemberCopy2 ( engine->, , alignmentType, unalignedIDStream );
MC_MemberCopy2 ( engine->, , shortDnaLength, seedPool);
engine->performAlignment ( numDPAlignedRead, numDPAlignment );
delete engine;
}
PairEndAlignmentEngine * PairEndAlignmentEngine::engine;
// ****
inline void DeepDP_Space::reverseCigarString ( char * cigar )
{
#define SWAP_TWO_CHAR(a,b) (a^=b^=a^=b)
// reverse the cigar String
int length = strlen (cigar);
int i, j;
for ( i=0;i<(length>>1);++i )
{ SWAP_TWO_CHAR ( cigar[i], cigar[length-i-1] ); }
for ( i=length-1, j = length; i >= 0; --i )
{
if ( !( '0' <= cigar[i] && cigar[i] <= '9' ) )
{
for ( int ll = 0; ll < ( j-i ) >> 1 ; ++ll )
{ SWAP_TWO_CHAR ( cigar[i+ll], cigar[j-ll-1] ); }
j = i;
}
}
}
inline int DeepDP_Space::cigarAlignmentLength_Extension ( char * cigar )
{
int l=0, range=0;
for ( int i=0;cigar[i];++i )
{
if ( '0' <= cigar[i] && cigar[i] <= '9' )
{ range = range * 10 + cigar[i] - '0'; }
else if ( cigar[i] == 'M' || cigar[i] == 'D' || ( cigar[i+1] == 0 && cigar[i] == 'S' ) )
{ l += range; range = 0; }
else
{ range = 0; }
}
return l;
}
void DeepDP_Space::DP2CPUAlgnThread ( int threadId, void *& empty )
{
//fprintf(stderr,"deepdp cpu thread %d start\n", threadId);
PairEndAlignmentEngine * engine = PairEndAlignmentEngine::engine;
PairEndAlignmentEngine::PairEndAlgnBatch * batch = engine->algnSwapBatch;
engine->algnSwapBatch = engine->algnThreadContext[threadId].batch;
if ( !( engine->samOutputDPFilePtr != NULL && engine->samOutputDPFilePtr->type & TYPE_BAM ) )
{ engine->algnThreadContext[threadId].batchID++; }
else
{ engine->algnThreadContext[threadId].batchID = engine->algnBatchCount++; }
sem_post ( & ( engine->algnThreadContext[threadId].ACKSem ) );
engine->algnThreadContext[threadId].batch = batch;
int * pThreadId = &threadId;
// align left side
batch->leftOrRight = 0;
engine->algnThreadContext[threadId].semiGlobalAligner.performAlignment (
batch->packedDNASeq, batch->DNALengths,
batch->packedReadSeq, batch->lengths,
batch->cutoffThresholds, batch->scores[batch->leftOrRight], batch->hitLocs[batch->leftOrRight],
batch->maxScoreCounts[batch->leftOrRight],
batch->pattern[batch->leftOrRight], batch->numOfThreads,
batch->softClipLtSizes, batch->softClipRtSizes,
batch->peLeftAnchorLocs, batch->peRightAnchorLocs
);
// align right side
batch->packRight();
batch->leftOrRight = 1;
engine->algnThreadContext[threadId].semiGlobalAligner.performAlignment (
batch->packedDNASeq, batch->DNALengths,
batch->packedReadSeq, batch->lengths,
batch->cutoffThresholds, batch->scores[batch->leftOrRight], batch->hitLocs[batch->leftOrRight],
batch->maxScoreCounts[batch->leftOrRight],
batch->pattern[batch->leftOrRight], batch->numOfThreads,
batch->softClipLtSizes, batch->softClipRtSizes,
batch->peLeftAnchorLocs, batch->peRightAnchorLocs
);
MC_MemberCopy2 ( int, engine->dpPara->, matchScore, mismatchScore );
MC_MemberCopy2 ( int, engine->dpPara->, openGapScore, extendGapScore );
// rearrange result and Output
vector<DeepDPAlignResult> * resultBatch = new vector<DeepDPAlignResult>();
for ( int i = 0; i < batch->numOfThreads; i++ )
{
int readSide = batch->canInfos[i].readIDLeft & 1;
int mateSide = 1 - readSide;
// DO NOT USE values in batch->packedDNASeq, packedReadSeq, DNALengths, length, cutoffThresholds
// they are overwritten in packRight()
if ( batch->scores[0][i] >= (int)std::max(DP_SCORE_THRESHOLD_RATIO * engine->upkdReadLengths[batch->canInfos[i].readIDLeft], DP_SCORE_THRESHOLD_LOWER_BOUND) &&
batch->scores[1][i] >= (int)std::max(DP_SCORE_THRESHOLD_RATIO * engine->upkdReadLengths[batch->canInfos[i].readIDLeft ^1], DP_SCORE_THRESHOLD_LOWER_BOUND))
{
char * cigarString[2];
int editdist[2], DIS[2];
for ( int lOr = 0; lOr < 2; lOr++ )
{
CigarStringEncoder<void> encoder;
uchar lastType = 'N';
for ( uchar * p = batch->pattern[lOr] + i * engine->patternLength; *p != 0; p++ )
{
if ( *p == 'V' )
{
encoder.append ( lastType, ( int ) ( * ( ++p ) ) - 1 );
}
else
{
encoder.append ( *p, 1 );
lastType = *p;
}
}
encoder.encodeCigarString ( openGapScore, extendGapScore );
cigarString[lOr] = encoder.cigarString;
// To get edit distance
int L = batch->lengths[i] - encoder.charCount['I'] - encoder.charCount['S'];
int numOfMismatch = ( L * matchScore + encoder.gapPenalty - batch->scores[lOr][i] ) /
( matchScore - mismatchScore );
editdist[lOr] = encoder.charCount['I'] + encoder.charCount['D'] + numOfMismatch;
DIS[lOr] = encoder.charCount['D'] - encoder.charCount['I'] - encoder.charCount['S'];
}
//#define MC_GetMateID(x) (((x)&1)?((x)-1):((x)+1))
DeepDPAlignResult result;
result.readID = batch->canInfos[i].readIDLeft - readSide;
result.strand_1 = ( ( readSide == 0 ) ? engine->peStrandLeftLeg : engine->peStrandRightLeg );
result.strand_2 = ( ( mateSide == 0 ) ? engine->peStrandLeftLeg : engine->peStrandRightLeg );
if ( engine->dpPara->isExtensionDP )
{
if ( result.strand_1 != 1 )
{
reverseCigarString ( cigarString[readSide] );
result.algnmt_1 = batch->canInfos[i].pos[readSide] - cigarAlignmentLength_Extension ( cigarString[readSide] );
}
else
{
result.algnmt_1 = batch->canInfos[i].pos[readSide] + batch->hitLocs[readSide][i];
}
if ( result.strand_2 != 1 )
{
reverseCigarString ( cigarString[mateSide] );
result.algnmt_2 = batch->canInfos[i].pos[mateSide] - cigarAlignmentLength_Extension ( cigarString[mateSide] );
}
else
{
result.algnmt_2 = batch->canInfos[i].pos[mateSide] + batch->hitLocs[mateSide][i];
}
}
else
{
result.algnmt_1 = batch->canInfos[i].pos[readSide] + batch->hitLocs[readSide][i];
result.algnmt_2 = batch->canInfos[i].pos[mateSide] + batch->hitLocs[mateSide][i];
}
result.cigarString_1 = cigarString[readSide];
result.cigarString_2 = cigarString[mateSide];
result.score_1 = batch->scores[readSide][i];
result.score_2 = batch->scores[mateSide][i];
result.editdist_1 = editdist[readSide];
result.editdist_2 = editdist[mateSide];
result.startPos_1 = batch->canInfos[i].pos[readSide];
result.startPos_2 = batch->canInfos[i].pos[mateSide];
result.refDpLength_1 = batch->canInfos[i].dnaLength[readSide];
result.refDpLength_2 = batch->canInfos[i].dnaLength[mateSide];
result.peLeftAnchor_1 = batch->canInfos[i].peLeftAnchor[readSide];
result.peLeftAnchor_2 = batch->canInfos[i].peLeftAnchor[mateSide];
result.peRightAnchor_1 = batch->canInfos[i].peRightAnchor[readSide];
result.peRightAnchor_2 = batch->canInfos[i].peRightAnchor[mateSide];
if ( result.algnmt_1 < result.algnmt_2 )
result.insertSize = result.algnmt_2 - result.algnmt_1 +
batch->lengths[i] + DIS[1];
else
result.insertSize = result.algnmt_1 - result.algnmt_2 +
batch->lengths[i] + DIS[1];
result.num_sameScore_1 = batch->maxScoreCounts[readSide][i]; //TODO
result.num_sameScore_2 = batch->maxScoreCounts[mateSide][i];
resultBatch->push_back ( result );
}
}
// Output
engine->algnThreadContext[threadId].resultBatch = resultBatch;
int * pid = &threadId;
if ( !( engine->samOutputDPFilePtr != NULL && engine->samOutputDPFilePtr->type & TYPE_BAM ) )
{ engine->DP2Output( pid ); }
engine->outputThreadDelegator.schedule ( pid );
sem_wait ( & ( engine->algnThreadContext[threadId].outputACKSem ) );
//fprintf(stderr, "deepdp cpu thread %d end\n", threadId);
}
void DeepDP_Space::DP2OutputThread ( int threadId, int *& pCallThreadId )
{
double startTime = setStartTime(), elapsedTime;
PairEndAlignmentEngine * engine = PairEndAlignmentEngine::engine;
int callThreadId = *pCallThreadId;
int batchID = engine->algnThreadContext[callThreadId].batchID;
DP2ResultBatch * resultBatch = engine->algnThreadContext[callThreadId].resultBatch;
sem_post ( & ( engine->algnThreadContext[callThreadId].outputACKSem ) );
vector<DP2ResultBatch *> & dpResult = engine->resultStream->dp2Result;
OCC * occ = OCCConstruct();
while ( dpResult.size() <= batchID )
{
dpResult.push_back ( NULL );
}
DeepDPAlignResult * tmpBestAlgn = NULL;
dpResult[batchID] = resultBatch;
#define MC_DP2OutputRead() { \
engine->outputBuf->ready(); \
if (engine->outputBuf->size > 0) { \
occ->occPositionCacheCount = 0; \
tmpBestAlgn = outputDeepDPResult2(engine->outputBuf->elements, engine->outputBuf->size, \
engine->queries, engine->upkdReadLengths, \
engine->origReadIDs, engine->queryNames, engine->queryComments, engine->upkdQualities, \
engine->inputMaxReadLength, engine->accumReadNum, engine->outputFormat, \
engine->samOutputDPFilePtr, engine->index, \
engine->peStrandLeftLeg, engine->peStrandRightLeg, engine->seedPool, occ ); \
engine->dp2AlignedRead += 1; \
engine->dp2Alignment += engine->outputBuf->size; \
engine->alignFlags->set(engine->lastReadID << 1); \
engine->dpInfoForReads->startPositions[tmpBestAlgn->readID] = tmpBestAlgn->startPos_1; \
engine->dpInfoForReads->strand_dpLengths[tmpBestAlgn->readID] = ( ( ( tmpBestAlgn->strand_1 - 1 ) << 15 ) | ( tmpBestAlgn->refDpLength_1 ) ); \
engine->dpInfoForReads->peLeftAnchors[tmpBestAlgn->readID] = tmpBestAlgn->peLeftAnchor_1; \
engine->dpInfoForReads->peRightAnchors[tmpBestAlgn->readID] = tmpBestAlgn->peRightAnchor_1; \
engine->dpInfoForReads->startPositions[tmpBestAlgn->readID+1] = tmpBestAlgn->startPos_2; \
engine->dpInfoForReads->strand_dpLengths[tmpBestAlgn->readID+1] = ( ( ( tmpBestAlgn->strand_2 - 1 ) << 15 ) | ( tmpBestAlgn->refDpLength_2 ) ); \
engine->dpInfoForReads->peLeftAnchors[tmpBestAlgn->readID+1] = tmpBestAlgn->peLeftAnchor_2; \
engine->dpInfoForReads->peRightAnchors[tmpBestAlgn->readID+1] = tmpBestAlgn->peRightAnchor_2; \
} \
}
uint numOut = engine->resultStream->numOut;
while ( numOut < dpResult.size() && dpResult[numOut] != NULL )
{
//OUTPUT HERE
DP2ResultBatch & batch = *dpResult[numOut];
for ( int i = 0; i < batch.size(); i++ )
{
DeepDPAlignResult & result = batch[i];
int pairID = result.readID >> 1;
if ( pairID != engine->lastReadID )
{
MC_DP2OutputRead();
engine->outputBuf->clear();
engine->lastReadID = pairID;
}
engine->outputBuf->add ( result );
}
++numOut;
}
OCCFree( occ );
engine->resultStream->numOut = numOut;
elapsedTime = getElapsedTime ( startTime );
// fprintf(stderr, "Output thread: %f %d\n",elapsedTime, callThreadId);
}
void DeepDP_Space::DP2OutputThreadFinalize()
{
PairEndAlignmentEngine * engine = PairEndAlignmentEngine::engine;
// last read
OCC * occ = OCCConstruct();
DeepDPAlignResult * tmpBestAlgn = NULL;
MC_DP2OutputRead();
OCCFree( occ );
engine->outputBuf->clear();
}
void PairEndAlignmentEngine::DP2Output ( int *& threadId )
{
PairEndAlignmentEngine * engine = PairEndAlignmentEngine::engine;
int callThreadId = *threadId;
int batchID = engine->algnThreadContext[callThreadId].batchID;
DP2ResultBatch * resultBatch = engine->algnThreadContext[callThreadId].resultBatch;
vector<DP2ResultBatch *> & dpResult = engine->resultStreams[callThreadId]->dp2Result;
engine->outputBufs[callThreadId]->clear();
while ( dpResult.size() <= batchID )
{
dpResult.push_back ( NULL );
}
OCC * occ = OCCConstruct();
DynamicUint8Array * charArray = DynamicUint8ArrayConstruct();
DeepDPAlignResult * tmpBestAlgn = NULL;
engine->numberOfResultOutputString[callThreadId] = 0;
dpResult[batchID] = resultBatch;
#define MC_DP2OutputReads(tid) { \
engine->outputBufs[tid]->ready(); \
if (engine->outputBufs[tid]->size > 0) { \
OCCReset( occ );\
DynamicUint8ArrayReset( charArray ); \
tmpBestAlgn = outputDeepDPResult2(engine->outputBufs[tid]->elements, engine->outputBufs[tid]->size, \
engine->queries, engine->upkdReadLengths, \
engine->origReadIDs, engine->queryNames, engine->queryComments, engine->upkdQualities, \
engine->inputMaxReadLength, engine->accumReadNum, engine->outputFormat, \
engine->samOutputDPFilePtrs[tid], engine->index, \
engine->peStrandLeftLeg, engine->peStrandRightLeg, engine->seedPool, \
occ, charArray, engine->resultOutputStrings[tid] + engine->numberOfResultOutputString[tid], tid ); \
engine->algnThreadContext[tid].dp2AlignedRead += 1; \
engine->algnThreadContext[tid].dp2Alignment += engine->outputBufs[tid]->size; \
engine->algnThreadContext[tid].alignFlag->set(engine->algnThreadContext[tid].lastReadID << 1); \
engine->dpInfoForReads->startPositions[tmpBestAlgn->readID] = tmpBestAlgn->startPos_1; \
engine->dpInfoForReads->strand_dpLengths[tmpBestAlgn->readID] = ( ( ( tmpBestAlgn->strand_1 - 1 ) << 15 ) | ( tmpBestAlgn->refDpLength_1 ) ); \
engine->dpInfoForReads->peLeftAnchors[tmpBestAlgn->readID] = tmpBestAlgn->peLeftAnchor_1; \
engine->dpInfoForReads->peRightAnchors[tmpBestAlgn->readID] = tmpBestAlgn->peRightAnchor_1; \
engine->dpInfoForReads->startPositions[tmpBestAlgn->readID+1] = tmpBestAlgn->startPos_2; \
engine->dpInfoForReads->strand_dpLengths[tmpBestAlgn->readID+1] = ( ( ( tmpBestAlgn->strand_2 - 1 ) << 15 ) | ( tmpBestAlgn->refDpLength_2 ) ); \
engine->dpInfoForReads->peLeftAnchors[tmpBestAlgn->readID+1] = tmpBestAlgn->peLeftAnchor_2; \
engine->dpInfoForReads->peRightAnchors[tmpBestAlgn->readID+1] = tmpBestAlgn->peRightAnchor_2; \
engine->numberOfResultOutputString[tid] += 2; \
} \
}
uint numOut = engine->resultStreams[callThreadId]->numOut;
while ( numOut < dpResult.size() && dpResult[numOut] != NULL )
{
//OUTPUT HERE
DP2ResultBatch & batch = *dpResult[numOut];
for ( int i = 0; i < batch.size(); i++ )
{
DeepDPAlignResult & result = batch[i];
int pairID = result.readID >> 1;
if ( pairID != engine->algnThreadContext[callThreadId].lastReadID )
{
MC_DP2OutputReads( callThreadId );
engine->outputBufs[callThreadId]->clear();
engine->algnThreadContext[callThreadId].lastReadID = pairID;
}
engine->outputBufs[callThreadId]->add ( result );
}
MC_DP2OutputReads( callThreadId );
engine->outputBufs[callThreadId]->clear();
++numOut;
}
OCCFree( occ );
DynamicUint8ArrayFree( charArray );
// fprintf(stderr, "callThreadId: %d, NumOut: %d, batchID: %d #: %d\n",callThreadId,numOut,batchID, engine->numberOfResultOutputString[callThreadId]);
engine->resultStreams[callThreadId]->numOut = numOut;
}
void DeepDP_Space::DP2OutputThread2 ( int threadId, int *& pCallThreadId )
{
PairEndAlignmentEngine * engine = PairEndAlignmentEngine::engine;
int callThreadId = *pCallThreadId;
#define MC_DP2OutputAllSamStrings() do { \
if (!engine->index->sraIndex->hspaux->megapathMode) { \
for ( int i=0;i<engine->resultOutputStringBufferIter; ++i) \
{ \
fputs ( engine->resultOutputStringBuffer[i], engine->samOutputDPFilePtr->x.tamw); fputc('\n', engine->samOutputDPFilePtr->x.tamw); \
free ( engine->resultOutputStringBuffer[i] ); \
} \
} \
engine->resultOutputStringBufferIter = 0; \
} while (0);
for ( int i=0; i < engine->numberOfResultOutputString[callThreadId]; ++i )
{
if ( engine->resultOutputStringBufferIter == engine->resultOutputStringBufferSize )
{ MC_DP2OutputAllSamStrings(); }
engine->resultOutputStringBuffer[engine->resultOutputStringBufferIter++] = engine->resultOutputStrings[callThreadId][i];
}
sem_post ( & ( engine->algnThreadContext[callThreadId].outputACKSem ) );
}
void DeepDP_Space::DP2OutputThread2Finalize()
{
PairEndAlignmentEngine * engine = PairEndAlignmentEngine::engine;
MC_DP2OutputAllSamStrings ();
}
| 39.414831 | 273 | 0.583455 | HKU-BAL |
5218035825223ce4786ee19dc99369445d29e6e9 | 30,176 | cxx | C++ | smtk/extension/qt/qtSimpleExpressionView.cxx | yumin/SMTK | d280f10c5b70953b2a0196f71832955c7fc75e7f | [
"BSD-3-Clause-Clear"
] | null | null | null | smtk/extension/qt/qtSimpleExpressionView.cxx | yumin/SMTK | d280f10c5b70953b2a0196f71832955c7fc75e7f | [
"BSD-3-Clause-Clear"
] | 4 | 2016-11-10T15:49:51.000Z | 2017-02-06T23:24:16.000Z | smtk/extension/qt/qtSimpleExpressionView.cxx | yumin/SMTK | d280f10c5b70953b2a0196f71832955c7fc75e7f | [
"BSD-3-Clause-Clear"
] | null | null | null | //=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#include "smtk/extension/qt/qtSimpleExpressionView.h"
#include "smtk/extension/qt/qtUIManager.h"
#include "smtk/extension/qt/qtTableWidget.h"
#include "smtk/extension/qt/qtAttribute.h"
#include "smtk/attribute/Attribute.h"
#include "smtk/attribute/Definition.h"
#include "smtk/attribute/System.h"
#include "smtk/attribute/GroupItem.h"
#include "smtk/attribute/GroupItemDefinition.h"
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/IntItemDefinition.h"
#include "smtk/attribute/DoubleItem.h"
#include "smtk/attribute/DoubleItemDefinition.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/attribute/StringItemDefinition.h"
#include "smtk/common/View.h"
#include <QFileDialog>
#include <QGridLayout>
#include <QListWidget>
#include <QListWidgetItem>
#include <QString>
#include <QStringList>
#include <QTextStream>
#include <QVariant>
#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QSpinBox>
#include <QKeyEvent>
#include <QModelIndex>
#include <QModelIndexList>
#include <QMessageBox>
#include <QSplitter>
#include <QLineEdit>
#include <QLabel>
#include <QGroupBox>
#include <QPointer>
#include <sstream>
#define MAX_NUMBEWR_FUNC_POINTS 10000
using namespace smtk::attribute;
//----------------------------------------------------------------------------
class qtSimpleExpressionViewInternals
{
public:
qtSimpleExpressionViewInternals()
{
this->FunctionParserDescription = 0;
}
~qtSimpleExpressionViewInternals()
{
if(this->FunctionParserDescription)
{
delete [] this->FunctionParserDescription;
this->FunctionParserDescription = 0;
}
}
const char* getFunctionParserDescription()
{
if(!this->FunctionParserDescription)
{
std::stringstream ss;
ss << "Example Function: f(X) = cos(X).\n";
ss << "(Note: Use capital X as variable!)\n";
ss << " \n";
ss << "Standard constants available:\n";
ss << " PI = 3.1415926535\n";
ss << " \n";
ss << "Standard operations available:\n";
ss << " + - * / ^\n";
ss << " \n";
ss << "Standard functions available:\n";
ss << " abs acos asin atan ceil cos cosh\n";
ss << " exp floor log mag min max norm\n";
ss << " sign sin sinh sqrt tan tanh\n";
this->FunctionParserDescription = new char[ss.str().length() + 1];
strcpy(this->FunctionParserDescription, ss.str().c_str());
}
return this->FunctionParserDescription;
}
qtTableWidget* FuncTable;
QListWidget* FuncList;
QPushButton* AddButton;
QPushButton* DeleteButton;
QPushButton* CopyButton;
QPushButton* LoadCSVButton;
QSpinBox* NumberBox;
QLineEdit* ExpressionInput;
QLineEdit* DeltaInput;
QLineEdit* InitValueInput;
QPushButton* AddValueButton;
QPushButton* RemoveValueButton;
QGroupBox* EditorGroup;
char* FunctionParserDescription;
smtk::attribute::DefinitionPtr m_attDefinition;
};
//----------------------------------------------------------------------------
qtBaseView *
qtSimpleExpressionView::createViewWidget(smtk::common::ViewPtr dataObj,
QWidget* p, qtUIManager* uiman)
{
qtSimpleExpressionView *view = new qtSimpleExpressionView(dataObj, p, uiman);
view->buildUI();
return view;
}
//----------------------------------------------------------------------------
qtSimpleExpressionView::
qtSimpleExpressionView(smtk::common::ViewPtr dataObj, QWidget* p, qtUIManager* uiman) :
qtBaseView(dataObj, p, uiman)
{
this->Internals = new qtSimpleExpressionViewInternals;
}
//----------------------------------------------------------------------------
qtSimpleExpressionView::~qtSimpleExpressionView()
{
delete this->Internals;
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::createWidget()
{
if(!this->getObject())
{
return;
}
// Create a frame to contain all gui components for this object
// Create a list box for the group entries
// Create a table widget
// Add link from the listbox selection to the table widget
// A common add/delete/(copy/paste ??) widget
QSplitter* frame = new QSplitter(this->parentWidget());
QFrame* leftFrame = new QFrame(frame);
QFrame* rightFrame = new QFrame(frame);
//QGridLayout* gridLayout = new QGridLayout(frame);
//gridLayout->setMargin(0);
QVBoxLayout* leftLayout = new QVBoxLayout(leftFrame);
leftLayout->setMargin(0);
QVBoxLayout* rightLayout = new QVBoxLayout(rightFrame);
rightLayout->setMargin(0);
QSizePolicy sizeFixedPolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
// create a list box for all the array entries
this->Internals->FuncList = new QListWidget(frame);
this->Internals->FuncTable = new qtTableWidget(frame);
QSizePolicy tableSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
this->Internals->FuncTable->setSizePolicy(tableSizePolicy);
this->Internals->AddButton = new QPushButton("New", frame);
this->Internals->AddButton->setSizePolicy(sizeFixedPolicy);
this->Internals->NumberBox = new QSpinBox(frame);
this->Internals->NumberBox->setSizePolicy(sizeFixedPolicy);
this->Internals->NumberBox->setRange(1, MAX_NUMBEWR_FUNC_POINTS);
this->Internals->NumberBox->setValue(10);
// Editor UI
QDoubleValidator *validator = new QDoubleValidator(frame);
this->Internals->ExpressionInput = new QLineEdit(frame);
this->Internals->DeltaInput = new QLineEdit(frame);
this->Internals->DeltaInput->setValidator(validator);
this->Internals->InitValueInput = new QLineEdit(frame);
this->Internals->InitValueInput->setValidator(validator);
QGridLayout* editorLayout = new QGridLayout();
editorLayout->addWidget(new QLabel("Initial Value",frame), 0, 0);
editorLayout->addWidget(new QLabel("Delta",frame), 0, 1);
editorLayout->addWidget(new QLabel("Number of Values",frame), 0, 2);
editorLayout->addWidget(this->Internals->InitValueInput, 1, 0);
editorLayout->addWidget(this->Internals->DeltaInput, 1, 1);
editorLayout->addWidget(this->Internals->NumberBox, 1, 2);
this->Internals->InitValueInput->setText("0.0");
this->Internals->DeltaInput->setText("1.0");
this->Internals->EditorGroup = new QGroupBox("Use Function Expression", frame);
this->Internals->EditorGroup->setCheckable(1);
this->Internals->EditorGroup->setChecked(0);
this->Internals->EditorGroup->setToolTip(
this->Internals->getFunctionParserDescription());
QVBoxLayout* addLayout = new QVBoxLayout(this->Internals->EditorGroup);
QHBoxLayout* exprLayout = new QHBoxLayout();
exprLayout->addWidget(new QLabel("f(X)=",frame));
exprLayout->addWidget(this->Internals->ExpressionInput);
addLayout->addLayout(exprLayout);
addLayout->addLayout(editorLayout);
QHBoxLayout* copyLayout = new QHBoxLayout();
this->Internals->DeleteButton = new QPushButton("Delete", frame);
this->Internals->DeleteButton->setSizePolicy(sizeFixedPolicy);
this->Internals->CopyButton = new QPushButton("Copy", frame);
this->Internals->CopyButton->setSizePolicy(sizeFixedPolicy);
copyLayout->addWidget(this->Internals->AddButton);
copyLayout->addWidget(this->Internals->CopyButton);
copyLayout->addWidget(this->Internals->DeleteButton);
QHBoxLayout* rowButtonLayout = new QHBoxLayout();
this->Internals->AddValueButton = new QPushButton("Add", frame);
this->Internals->AddValueButton->setSizePolicy(sizeFixedPolicy);
this->Internals->RemoveValueButton = new QPushButton("Remove", frame);
this->Internals->RemoveValueButton->setSizePolicy(sizeFixedPolicy);
this->Internals->LoadCSVButton = new QPushButton("Load CSV", frame);
this->Internals->LoadCSVButton->setSizePolicy(sizeFixedPolicy);
rowButtonLayout->addWidget(this->Internals->LoadCSVButton);
rowButtonLayout->addWidget(this->Internals->AddValueButton);
rowButtonLayout->addWidget(this->Internals->RemoveValueButton);
leftLayout->addLayout(copyLayout);//, 2, 0,1,1);
leftLayout->addWidget(this->Internals->FuncList);//, 0, 0,1,1);
//leftLayout->addWidget(this->Internals->AddButton);
leftLayout->addWidget(this->Internals->EditorGroup);//, 1, 0,1,1);
//leftLayout->addLayout(editorLayout);
rightLayout->addLayout(rowButtonLayout);//, 2, 1,1,1);
rightLayout->addWidget(this->Internals->FuncTable);//, 0, 1, 2, 1);
frame->addWidget(leftFrame);
frame->addWidget(rightFrame);
QObject::connect(this->Internals->FuncList,
SIGNAL(currentItemChanged (QListWidgetItem * , QListWidgetItem * )),
this, SLOT(onFuncSelectionChanged(QListWidgetItem * , QListWidgetItem * )));
QObject::connect(this->Internals->FuncList,
SIGNAL(itemChanged (QListWidgetItem *)),
this, SLOT(onFuncNameChanged(QListWidgetItem * )));
QObject::connect(this->Internals->AddButton,
SIGNAL(clicked()), this, SLOT(onCreateNew()));
QObject::connect(this->Internals->CopyButton,
SIGNAL(clicked()), this, SLOT(onCopySelected()));
QObject::connect(this->Internals->DeleteButton,
SIGNAL(clicked()), this, SLOT(onDeleteSelected()));
QObject::connect(this->Internals->AddValueButton,
SIGNAL(clicked()), this, SLOT(onAddValue()));
QObject::connect(this->Internals->RemoveValueButton,
SIGNAL(clicked()), this, SLOT(onRemoveSelectedValues()));
QObject::connect(this->Internals->LoadCSVButton,
SIGNAL(clicked()), this, SLOT(onCSVLoad()));
QObject::connect(this->Internals->FuncTable,
SIGNAL(itemChanged (QTableWidgetItem *)),
this, SLOT(onFuncValueChanged(QTableWidgetItem * )));
QObject::connect(this->Internals->FuncTable,
SIGNAL(keyPressed (QKeyEvent *)),
this, SLOT(onFuncTableKeyPress(QKeyEvent * )));
this->Internals->FuncTable->setSelectionBehavior(QAbstractItemView::SelectRows);
this->Internals->FuncList->setSelectionMode(QAbstractItemView::SingleSelection);
this->Widget = frame;
this->initFunctionList();
}
//-----------------------------------------------------------------------------
smtk::attribute::GroupItemPtr qtSimpleExpressionView::getArrayDataFromItem(QListWidgetItem * item)
{
return this->getFunctionArrayData(this->getFunctionFromItem(item));
}
//-----------------------------------------------------------------------------
smtk::attribute::ValueItemPtr qtSimpleExpressionView::getStringDataFromItem(QListWidgetItem * item)
{
return this->getFunctionStringData(this->getFunctionFromItem(item));
}
//-----------------------------------------------------------------------------
smtk::attribute::AttributePtr qtSimpleExpressionView::getFunctionFromItem(
QListWidgetItem * item)
{
Attribute* rawPtr = item ?
static_cast<Attribute*>(item->data(Qt::UserRole).value<void *>()) : NULL;
return rawPtr ? rawPtr->pointer() : smtk::attribute::AttributePtr();
}
//-----------------------------------------------------------------------------
smtk::attribute::GroupItemPtr qtSimpleExpressionView::getSelectedArrayData()
{
return this->getFunctionArrayData(this->getSelectedFunction());
}
//-----------------------------------------------------------------------------
smtk::attribute::ValueItemPtr qtSimpleExpressionView::getSelectedStringData()
{
return this->getFunctionStringData(this->getSelectedFunction());
}
//-----------------------------------------------------------------------------
smtk::attribute::AttributePtr qtSimpleExpressionView::getSelectedFunction()
{
return this->getFunctionFromItem(this->getSelectedItem());
}
//-----------------------------------------------------------------------------
QListWidgetItem *qtSimpleExpressionView::getSelectedItem()
{
return this->Internals->FuncList->currentItem();
}
//-----------------------------------------------------------------------------
smtk::attribute::GroupItemPtr qtSimpleExpressionView::getFunctionArrayData(
smtk::attribute::AttributePtr func)
{
return func ? dynamic_pointer_cast<GroupItem>(func->item(0)) :
smtk::attribute::GroupItemPtr();
}
//-----------------------------------------------------------------------------
smtk::attribute::ValueItemPtr qtSimpleExpressionView::getFunctionStringData(
smtk::attribute::AttributePtr func)
{
if(func && func->numberOfItems()==2)// Kind of Hack
{
return dynamic_pointer_cast<ValueItem>(func->item(1));
}
return smtk::attribute::ValueItemPtr();
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onFuncSelectionChanged(
QListWidgetItem * current, QListWidgetItem * /*previous*/)
{
smtk::attribute::GroupItemPtr dataItem = this->getArrayDataFromItem(current);
this->Internals->FuncTable->blockSignals(true);
if(dataItem)
{
this->uiManager()->updateArrayTableWidget(dataItem,
this->Internals->FuncTable);
this->Internals->FuncTable->resizeColumnsToContents();
this->updateTableHeader();
}
else
{
this->Internals->FuncTable->clear();
this->Internals->FuncTable->setRowCount(0);
this->Internals->FuncTable->setColumnCount(0);
}
this->Internals->FuncTable->blockSignals(false);
// Now set up the function editor UI
smtk::attribute::ValueItemPtr expressionItem = this->getStringDataFromItem(current);
this->updateFunctionEditorUI(expressionItem, dataItem);
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::updateFunctionEditorUI(
smtk::attribute::ValueItemPtr expressionItem, smtk::attribute::GroupItemPtr arrayItem)
{
this->Internals->ExpressionInput->setText("");
this->Internals->NumberBox->setValue(10);
this->Internals->DeltaInput->setText("1.0");
this->Internals->InitValueInput->setText("0.0");
if(!expressionItem)
{
return;
}
this->Internals->ExpressionInput->setText(
expressionItem->valueAsString().c_str());
if(arrayItem)
{
int n = static_cast<int>(arrayItem->numberOfGroups());
int m = static_cast<int>(arrayItem->numberOfItemsPerGroup());
if(!m || !n)
{
return;
}
smtk::attribute::ValueItemPtr valueItem =dynamic_pointer_cast<ValueItem>(arrayItem->item(0,0));
smtk::attribute::DoubleItemPtr dItem =dynamic_pointer_cast<DoubleItem>(arrayItem->item(0,0));
smtk::attribute::IntItemPtr iItem =dynamic_pointer_cast<IntItem>(arrayItem->item(0,0));
if(valueItem && valueItem->numberOfValues())
{
int numValues = static_cast<int>(valueItem->numberOfValues());
this->Internals->InitValueInput->setText(valueItem->valueAsString(0).c_str());
this->Internals->DeltaInput->setText(valueItem->valueAsString(0).c_str());
this->Internals->NumberBox->setValue(numValues);
if(numValues>1 && n==2 && (dItem || iItem))
{
double deltaVal = dItem ? (dItem->value(1)-dItem->value(0)) :
(iItem->value(1)-iItem->value(0));
this->Internals->DeltaInput->setText(QString::number(deltaVal));
}
}
}
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onFuncNameChanged(QListWidgetItem* item)
{
smtk::attribute::AttributePtr func = this->getFunctionFromItem(item);
if(func)
{
System *attSystem = func->definition()->system();
attSystem->rename(func, item->text().toAscii().constData());
}
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onFuncValueChanged(QTableWidgetItem* item)
{
smtk::attribute::GroupItemPtr dataItem = this->getSelectedArrayData();
if(!dataItem)
{
return;
}
this->uiManager()->updateArrayDataValue(dataItem, item);
this->clearFuncExpression();
}
//----------------------------------------------------------------------------
int qtSimpleExpressionView::getNumberOfComponents()
{
if (!this->Internals->m_attDefinition)
{
return -1;
}
if(!this->Internals->m_attDefinition->numberOfItemDefinitions())
{
return -1;
}
const GroupItemDefinition *itemDefinition =
dynamic_cast<const GroupItemDefinition *>
(this->Internals->m_attDefinition->itemDefinition(0).get());
if(!itemDefinition)
{
return -1;
}
return static_cast<int>(itemDefinition->numberOfItemDefinitions());
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onCreateNew()
{
QStringList strVals;
int numRows = this->Internals->NumberBox->value();
int numberOfComponents = this->getNumberOfComponents();
if (numberOfComponents == -1)
{
return; //This does not support expressions!
}
for(int i=0; i < numRows; i++)
{
for(int c=0; c<numberOfComponents-1; c++)
{
strVals << "0.0" << "\t";
}
strVals << "0.0" << LINE_BREAKER_STRING
}
QString valuesText = strVals.join(" ");
smtk::attribute::ValueItemPtr expressionItem =
this->getStringDataFromItem(this->Internals->FuncList->currentItem());
QString funcExp = expressionItem ?
expressionItem->valueAsString().c_str() : "";
this->buildSimpleExpression(funcExp, valuesText,numberOfComponents);
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::displayExpressionError(
std::string& errorMsg, int errorPos)
{
QString strMessage = QString(errorMsg.c_str()) +
"\nThe function expression has some syntax error at entityref position: " +
QString::number(errorPos);
QMessageBox::warning(this->parentWidget(), tr("SimBuilder Functions"),strMessage);
this->Internals->ExpressionInput->setFocus();
this->Internals->ExpressionInput->setCursorPosition(errorPos);
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::createFunctionWithExpression()
{
QString funcExpr = this->Internals->ExpressionInput->text();
if(funcExpr.isEmpty())
{
funcExpr = "X";
}
this->Internals->ExpressionInput->setText(funcExpr);
double initVal = this->Internals->InitValueInput->text().toDouble();
double deltaVal = this->Internals->DeltaInput->text().toDouble();
int numValues = this->Internals->NumberBox->value();
emit this->onCreateFunctionWithExpression(
funcExpr, initVal, deltaVal, numValues);
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::createNewFunction(
smtk::attribute::DefinitionPtr attDef)
{
if(!attDef)
{
return;
}
this->Internals->FuncList->blockSignals(true);
System *attSystem = attDef->system();
smtk::attribute::AttributePtr newFunc = attSystem->createAttribute(attDef->type());
QListWidgetItem* item = this->addFunctionListItem(newFunc);
if(item)
{
this->Internals->FuncList->setCurrentItem(item);
}
this->Internals->FuncList->blockSignals(false);
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::buildSimpleExpression(
QString& funcExpr, QString& funcVals, int numberOfComponents)
{
if (!this->Internals->m_attDefinition)
{
return;
}
this->createNewFunction(this->Internals->m_attDefinition);
smtk::attribute::ValueItemPtr expressionItem = this->getStringDataFromItem(
this->Internals->FuncList->currentItem());
if(expressionItem && !funcExpr.isEmpty())
{
smtk::attribute::StringItemPtr sItem =dynamic_pointer_cast<StringItem>(expressionItem);
if(sItem)
{
sItem->setValue(funcExpr.toStdString());
this->Internals->ExpressionInput->setText(
sItem->valueAsString().c_str());
}
}
this->Internals->FuncTable->blockSignals(true);
this->Internals->FuncTable->clear();
this->Internals->FuncTable->setRowCount(0);
this->Internals->FuncTable->setColumnCount(numberOfComponents);
this->pasteFunctionValues(funcVals, false);
this->updateTableHeader();
this->Internals->FuncTable->blockSignals(false);
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::updateTableHeader()
{
if(this->Internals->FuncTable->columnCount()>=2)
{
this->Internals->FuncTable->setHorizontalHeaderLabels(
QStringList() << tr("x") << tr("f(x)") );
}
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onCSVLoad()
{
int numberOfComponents = this->getNumberOfComponents();
if (numberOfComponents == -1)
{
return; //This does not support expressions!
}
QString fname = QFileDialog::getOpenFileName(this->Widget, tr("Open CSV File"),
QString(),
tr("CSV Files (*.csv);; All Files(*.*)"));
if (fname == "")
{
return;
}
std::cout << "Got File\n";
QFile f(fname);
QString line;
if (!f.open(QIODevice::ReadOnly | QIODevice::Text))
{
// Should add error message!
return;
}
QTextStream in(&f);
int i;
QStringList tableVals, rowVals;
while (!in.atEnd())
{
line = in.readLine();
QStringList vals = line.split(',');
if (vals.size() != numberOfComponents)
{
continue;
}
// Clear the row of vals
rowVals.clear();
for (i = 0; i < numberOfComponents; i++)
{
// Is this a number - if not skip the row!
bool ok;
vals.at(i).toDouble(&ok);
if (!ok)
{
rowVals.clear();
break;
}
rowVals << vals.at(i);
if (i < (numberOfComponents -1))
{
rowVals << "\t";
}
else
{
rowVals << LINE_BREAKER_STRING;
}
}
tableVals.append(rowVals);
}
if (tableVals.size())
{
QString tableString = tableVals.join(" ");
QString dummy;
this->buildSimpleExpression(dummy, tableString, numberOfComponents);
}
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onCopySelected()
{
smtk::attribute::AttributePtr dataItem = this->getSelectedFunction();
if(dataItem && dataItem->numberOfItems())
{
smtk::attribute::GroupItemPtr groupItem = dynamic_pointer_cast<GroupItem>(dataItem->item(0));
QString valuesText;
if(groupItem && this->uiManager()->getExpressionArrayString(groupItem, valuesText))
{
smtk::attribute::ValueItemPtr expressionItem = this->getStringDataFromItem(
this->Internals->FuncList->currentItem());
QString funcExp = expressionItem ?
expressionItem->valueAsString().c_str() : "";
this->buildSimpleExpression(funcExp, valuesText,
static_cast<int>(groupItem->numberOfItemsPerGroup()));
}
}
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onDeleteSelected()
{
QListWidgetItem* selItem = this->getSelectedItem();
if(selItem)
{
if (!this->Internals->m_attDefinition)
{
return;
}
smtk::attribute::System *sys = this->uiManager()->attSystem();
sys->removeAttribute(this->getFunctionFromItem(selItem));
this->Internals->FuncList->takeItem(this->Internals->FuncList->row(selItem));
}
}
//----------------------------------------------------------------------------
QListWidgetItem* qtSimpleExpressionView::addFunctionListItem(
smtk::attribute::AttributePtr childData)
{
if(!this->uiManager()->passAdvancedCheck(
childData->definition()->advanceLevel()) ||
!this->uiManager()->passAttributeCategoryCheck(
childData->definition()))
{
return NULL;
}
QListWidgetItem* item = NULL;
smtk::attribute::GroupItemPtr dataItem = this->getFunctionArrayData(childData);
if(dataItem)
{
item = new QListWidgetItem(
QString::fromUtf8(childData->name().c_str()),
this->Internals->FuncList, smtk_USER_DATA_TYPE);
QVariant vdata;
vdata.setValue(static_cast<void*>(childData.get()));
item->setData(Qt::UserRole, vdata);
if(childData->definition()->advanceLevel())
{
item->setFont(this->uiManager()->advancedFont());
}
item->setFlags(item->flags() | Qt::ItemIsEditable);
this->Internals->FuncList->addItem(item);
}
return item;
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onFuncTableKeyPress(QKeyEvent* e)
{
// Allow paste
if(e->key() == Qt::Key_V && e->modifiers() == Qt::ControlModifier)
{
QString values = this->uiManager()->clipBoardText();
this->pasteFunctionValues(values);
e->accept();
return;
}
// Allow copying
if(e->key() == Qt::Key_C && e->modifiers() == Qt::ControlModifier)
{
QStringList list ;
for(int r=0; r<this->Internals->FuncTable->rowCount(); r++)
{
if(this->Internals->FuncTable->item(r, 0)->isSelected())
{
for (int c=0; c<this->Internals->FuncTable->columnCount(); c++)
{
list << this->Internals->FuncTable->item(r, c)->text();
if(c<this->Internals->FuncTable->columnCount()-1)
{
list << "\t";
}
}
list << LINE_BREAKER_STRING;
}
}
QString tempText = list.join(" ");
this->uiManager()->setClipBoardText( tempText ) ;
e->accept();
return;
}
// Allow delete
if(e->key() == Qt::Key_Delete)
{
this->onRemoveSelectedValues();
e->accept();
return;
}
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::pasteFunctionValues(QString& str, bool clearExp)
{
if(str.isNull())
{
return;
}
QString strSep=LINE_BREAKER_STRING;
QStringList rows = str.split(strSep);
int numRows = rows.count()-1;
int numColumns = rows.first().count('\t') + 1;
QTableWidget* table = this->Internals->FuncTable;
if (table->columnCount() != numColumns)
{
QMessageBox::warning(this->parentWidget(), tr("SimBuilder Functions"),
tr("The information cannot be pasted because the copy "
"and paste columns aren't the same size."));
return;
}
// add all the pasted rows
for (int i = 0; i < numRows; ++i)
{
QStringList columns = rows[i].split('\t');
if(columns.count() != numColumns)
{
continue;
}
double* vals = new double[numColumns];
for (int j = 0; j < numColumns; ++j)
{
vals[j] = columns[j].toDouble();
}
this->addNewValue(vals, numColumns);
delete[] vals;
}
this->Internals->FuncTable->resizeColumnsToContents();
if(clearExp)
{
this->clearFuncExpression();
}
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onAddValue()
{
int numVals = this->Internals->FuncTable->columnCount();
double zero = 0.;
std::vector<double> vals(numVals, zero);
// this->uiManager()->updateArrayDataValue(dataItem, item);
this->addNewValue(&vals[0], numVals);
this->clearFuncExpression();
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::addNewValue(double* vals, int numVals)
{
smtk::attribute::GroupItemPtr dataItem = this->getSelectedArrayData();
if(!dataItem)
{
return;
}
this->Internals->FuncTable->blockSignals(true);
this->uiManager()->addNewTableValues(dataItem,
this->Internals->FuncTable, vals, numVals);
this->Internals->FuncTable->blockSignals(false);
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::onRemoveSelectedValues()
{
smtk::attribute::GroupItemPtr dataItem = this->getSelectedArrayData();
if(!dataItem)
{
return;
}
this->Internals->FuncTable->blockSignals(true);
this->uiManager()->removeSelectedTableValues(dataItem,
this->Internals->FuncTable);
this->Internals->FuncTable->blockSignals(false);
this->clearFuncExpression();
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::initFunctionList()
{
smtk::common::ViewPtr view = this->getObject();
if (!view)
{
return;
}
smtk::attribute::System *sys = this->uiManager()->attSystem();
// There should be only 1 child component called Type
if ((view->details().numberOfChildren() != 1) ||
(view->details().child(0).name() != "Att"))
{
return;
}
std::string defType;
if (!view->details().child(0).attribute("Type", defType))
{
return;
}
this->Internals->m_attDefinition = sys->findDefinition(defType);
std::vector<smtk::attribute::AttributePtr> result;
sys->findAttributes(this->Internals->m_attDefinition, result);
std::vector<smtk::attribute::AttributePtr>::iterator it;
this->Internals->FuncList->blockSignals(true);
this->Internals->FuncList->clear();
for (it=result.begin(); it!=result.end(); ++it)
{
this->addFunctionListItem(*it);
}
this->Internals->FuncList->blockSignals(false);
if(this->Internals->FuncList->count())
{
this->Internals->FuncList->setCurrentRow(0);
}
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::clearFuncExpression()
{
smtk::attribute::ValueItemPtr strItem = this->getSelectedStringData();
if(strItem)
{
strItem->unset();
}
this->Internals->ExpressionInput->setText("");
}
//----------------------------------------------------------------------------
void qtSimpleExpressionView::getAllDefinitions(
QList<smtk::attribute::DefinitionPtr>& defs)
{
if (this->Internals->m_attDefinition)
{
this->qtBaseView::getDefinitions(this->Internals->m_attDefinition, defs);
}
}
| 33.867565 | 99 | 0.620526 | yumin |
521b63acf85353db0afe89d9c8532d4aef68487f | 3,836 | cc | C++ | flens/lapack/interface/src/gels.cc | stip/FLENS | 80495fa97dda42a0acafc8f83fc9639ae36d2e10 | [
"BSD-3-Clause"
] | 98 | 2015-01-26T20:31:37.000Z | 2021-09-09T15:51:37.000Z | flens/lapack/interface/src/gels.cc | stip/FLENS | 80495fa97dda42a0acafc8f83fc9639ae36d2e10 | [
"BSD-3-Clause"
] | 16 | 2015-01-21T07:43:45.000Z | 2021-12-06T12:08:36.000Z | flens/lapack/interface/src/gels.cc | stip/FLENS | 80495fa97dda42a0acafc8f83fc9639ae36d2e10 | [
"BSD-3-Clause"
] | 31 | 2015-01-05T08:06:45.000Z | 2022-01-26T20:12:00.000Z | #define STR(x) #x
#define STRING(x) STR(x)
#include <flens/lapack/interface/include/config.h>
namespace flens { namespace lapack {
extern "C" {
//-- dgels ---------------------------------------------------------------------
void
LAPACK_DECL(dgels)(const char *TRANS,
const INTEGER *M,
const INTEGER *N,
const INTEGER *NRHS,
DOUBLE *A,
const INTEGER *LDA,
DOUBLE *B,
const INTEGER *LDB,
DOUBLE *WORK,
const INTEGER *LWORK,
INTEGER *INFO)
{
//
// Test the input parameters so that we pass LAPACK error checks
//
const bool lQuery = (*LWORK==0);
const INTEGER mn = std::min(*M, *N);
*INFO = 0;
if (*TRANS!='N' && *TRANS!='T' && *TRANS!='C') {
*INFO = -1;
} else if (*M<0) {
*INFO = -2;
} else if (*N<0) {
*INFO = -3;
} else if (*NRHS<0) {
*INFO = -4;
} else if (*LDA<std::max(INTEGER(1), *M)) {
*INFO = -6;
} else if (*LDB<flens::max(INTEGER(1), *M, *N)) {
*INFO = -8;
} else if (*LWORK<std::max(INTEGER(1), mn+std::max(mn, *NRHS)) && !lQuery) {
*INFO = -10;
}
if (*INFO!=0) {
*INFO = -(*INFO);
LAPACK_ERROR("DGELS", INFO);
*INFO = -(*INFO);
return;
}
//
// Call FLENS implementation
//
Transpose trans = convertTo<Transpose>(*TRANS);
DGeMatrixView _A = DFSView(*M, *N, A, *LDA);
const INTEGER numRowsB = std::max(*M,*N);
DGeMatrixView _B = DFSView(numRowsB, *NRHS, B, *LDB);
DDenseVectorView _WORK = DArrayView(*LWORK, WORK, 1);
ls(trans, _A, _B, _WORK);
}
//-- zgels ---------------------------------------------------------------------
void
LAPACK_DECL(zgels)(const char *TRANS,
const INTEGER *M,
const INTEGER *N,
const INTEGER *NRHS,
DOUBLE_COMPLEX *A,
const INTEGER *LDA,
DOUBLE_COMPLEX *B,
const INTEGER *LDB,
DOUBLE_COMPLEX *WORK,
const INTEGER *LWORK,
INTEGER *INFO)
{
//
// Test the input parameters so that we pass LAPACK error checks
//
const bool lQuery = (*LWORK==0);
const INTEGER mn = std::min(*M, *N);
*INFO = 0;
if (*TRANS!='N' && *TRANS!='T' && *TRANS!='C') {
*INFO = -1;
} else if (*M<0) {
*INFO = -2;
} else if (*N<0) {
*INFO = -3;
} else if (*NRHS<0) {
*INFO = -4;
} else if (*LDA<std::max(INTEGER(1), *M)) {
*INFO = -6;
} else if (*LDB<flens::max(INTEGER(1), *M, *N)) {
*INFO = -8;
} else if (*LWORK<std::max(INTEGER(1), mn+std::max(mn, *NRHS)) && !lQuery) {
*INFO = -10;
}
if (*INFO!=0) {
*INFO = -(*INFO);
LAPACK_ERROR("ZGELS", INFO);
*INFO = -(*INFO);
return;
}
//
// Call FLENS implementation
//
auto zA = reinterpret_cast<CXX_DOUBLE_COMPLEX *>(A);
auto zB = reinterpret_cast<CXX_DOUBLE_COMPLEX *>(B);
auto zWORK = reinterpret_cast<CXX_DOUBLE_COMPLEX *>(WORK);
Transpose trans = convertTo<Transpose>(*TRANS);
ZGeMatrixView _A = ZFSView(*M, *N, zA, *LDA);
const INTEGER numRowsB = std::max(*M,*N);
ZGeMatrixView _B = ZFSView(numRowsB, *NRHS, zB, *LDB);
ZDenseVectorView _WORK = ZArrayView(*LWORK, zWORK, 1);
ls(trans, _A, _B, _WORK);
}
} // extern "C"
} } // namespace lapack, flens
| 29.507692 | 80 | 0.441084 | stip |
521f2233f56e5c7a14f0b1a79a087a2a3e3d21de | 3,399 | cpp | C++ | SDKs/CryCode/3.8.1/GameDll/AnimActionAIAimPose.cpp | amrhead/FireNET | 34d439aa0157b0c895b20b2b664fddf4f9b84af1 | [
"BSD-2-Clause"
] | 4 | 2017-12-18T20:10:16.000Z | 2021-02-07T21:21:24.000Z | SDKs/CryCode/3.7.0/GameDll/AnimActionAIAimPose.cpp | amrhead/FireNET | 34d439aa0157b0c895b20b2b664fddf4f9b84af1 | [
"BSD-2-Clause"
] | null | null | null | SDKs/CryCode/3.7.0/GameDll/AnimActionAIAimPose.cpp | amrhead/FireNET | 34d439aa0157b0c895b20b2b664fddf4f9b84af1 | [
"BSD-2-Clause"
] | 3 | 2019-03-11T21:36:15.000Z | 2021-02-07T21:21:26.000Z | ////////////////////////////////////////////////////////////////////////////
//
// Crytek Engine Source File.
// Copyright (C), Crytek Studios, 2011.
//
////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "AnimActionAIAimPose.h"
#include <ICryAnimation.h>
#include <IAnimationPoseModifier.h>
#include "PlayerAnimation.h"
//////////////////////////////////////////////////////////////////////////
#define MAN_AIAIMPOSE_FRAGMENTS( x ) \
x( AimPose )
#define MAN_AIAIMPOSE_TAGS( x )
#define MAN_AIAIMPOSE_TAGGROUPS( x )
#define MAN_AIAIMPOSE_SCOPES( x )
#define MAN_AIAIMPOSE_CONTEXTS( x )
#define MAN_AIAIMPOSE_CHANGEFRAGMENT_FRAGMENT_TAGS( x )
#define MAN_AIAIMPOSE_FRAGMENT_TAGS( x )
MANNEQUIN_USER_PARAMS( SMannequinAiAimPoseUserParams, MAN_AIAIMPOSE_FRAGMENTS, MAN_AIAIMPOSE_TAGS, MAN_AIAIMPOSE_TAGGROUPS, MAN_AIAIMPOSE_SCOPES, MAN_AIAIMPOSE_CONTEXTS, MAN_AIAIMPOSE_FRAGMENT_TAGS );
//////////////////////////////////////////////////////////////////////////
FragmentID CAnimActionAIAimPose::FindFragmentId( const SAnimationContext& context )
{
const SMannequinAiAimPoseUserParams* pUserParams = GetMannequinUserParams< SMannequinAiAimPoseUserParams >( context );
CRY_ASSERT( pUserParams != NULL );
return pUserParams->fragmentIDs.AimPose;
}
//////////////////////////////////////////////////////////////////////////
CAnimActionAIAimPose::CAnimActionAIAimPose()
: TBase( PP_Lowest, FRAGMENT_ID_INVALID, TAG_STATE_EMPTY, IAction::NoAutoBlendOut | IAction::Interruptable )
{
}
//////////////////////////////////////////////////////////////////////////
void CAnimActionAIAimPose::OnInitialise()
{
const FragmentID fragmentId = FindFragmentId( *m_context );
CRY_ASSERT( fragmentId != FRAGMENT_ID_INVALID );
SetFragment( fragmentId );
}
//////////////////////////////////////////////////////////////////////////
void CAnimActionAIAimPose::Install()
{
TBase::Install();
InitialiseAimPoseBlender();
}
//////////////////////////////////////////////////////////////////////////
void CAnimActionAIAimPose::InitialiseAimPoseBlender()
{
IScope& rootScope = GetRootScope();
ICharacterInstance* pCharacterInstance = rootScope.GetCharInst();
CRY_ASSERT( pCharacterInstance );
if ( ! pCharacterInstance )
{
return;
}
ISkeletonPose* pSkeletonPose = pCharacterInstance->GetISkeletonPose();
CRY_ASSERT( pSkeletonPose );
IAnimationPoseBlenderDir* pPoseBlenderAim = pSkeletonPose->GetIPoseBlenderAim();
CRY_ASSERT( pPoseBlenderAim );
if ( ! pPoseBlenderAim )
{
return;
}
const uint32 aimPoseAnimationLayer = rootScope.GetBaseLayer();
pPoseBlenderAim->SetLayer( aimPoseAnimationLayer );
}
//////////////////////////////////////////////////////////////////////////
IAction::EStatus CAnimActionAIAimPose::Update( float timePassed )
{
TBase::Update( timePassed );
const IScope& rootScope = GetRootScope();
const bool foundNewBestMatchingFragment = rootScope.IsDifferent( m_fragmentID, m_fragTags );
if ( foundNewBestMatchingFragment )
{
SetFragment( m_fragmentID, m_fragTags );
}
return m_eStatus;
}
//////////////////////////////////////////////////////////////////////////
bool CAnimActionAIAimPose::IsSupported( const SAnimationContext& context )
{
const FragmentID fragmentId = FindFragmentId( context );
const bool isSupported = ( fragmentId != FRAGMENT_ID_INVALID );
return isSupported;
} | 28.563025 | 200 | 0.61165 | amrhead |
521f24836e25552823cc789e4c2065d7ebdc20c2 | 4,248 | cpp | C++ | Strings/KMR/KMR.cpp | CStanKonrad/Algorithms | 494d86bc2a9248d71a0f9008d8d678386f9ca906 | [
"MIT"
] | null | null | null | Strings/KMR/KMR.cpp | CStanKonrad/Algorithms | 494d86bc2a9248d71a0f9008d8d678386f9ca906 | [
"MIT"
] | null | null | null | Strings/KMR/KMR.cpp | CStanKonrad/Algorithms | 494d86bc2a9248d71a0f9008d8d678386f9ca906 | [
"MIT"
] | null | null | null | /*
The MIT License (MIT)
Copyright (c) 2016 CStanKonrad
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include <iostream>
#include <algorithm>
#include <string>
#include <assert.h>
const int MAX_INPUT_SIZE = 2097152;
const int LOG2_MAX_INPUT_SIZE = 21;
struct SIdentifier
{
int first = 0;
int second = 0;
int inputId; //position before sorting by <
SIdentifier() {}
SIdentifier(int _first, int _second, int _inputId)
{
first = _first;
second = _second;
inputId = _inputId;
}
bool operator < (const SIdentifier &_b) const
{
if (first < _b.first)
return true;
else if (first > _b.first)
return false;
else
return second < _b.second;
}
bool operator > (const SIdentifier &_b) const
{
if (first > _b.first)
return true;
else if (first < _b.first)
return false;
else
return second > _b.second;
}
};
bool idSort(const SIdentifier &_a, const SIdentifier &_b)
{
return (_a.inputId < _b.inputId);
}
SIdentifier kmr_id[LOG2_MAX_INPUT_SIZE + 1][MAX_INPUT_SIZE + 7];
void calcNewId(int _i, const std::string &_text)
{
bool flag;
int currentId = 0;
for (int j = 0; j + (1<<_i) - 1 < _text.size(); ++j)
{
flag = false;
if (j + 1 + (1<<_i) - 1 < _text.size() && (kmr_id[_i][j + 1].first != kmr_id[_i][j].first || kmr_id[_i][j + 1].second != kmr_id[_i][j].second))
flag = true;
kmr_id[_i][j].first = currentId;
kmr_id[_i][j].second = 0;
if (flag)
++currentId;
}
}
void kmrPreProc(std::string _text)
{
for (unsigned i = 0; i < _text.size(); ++i)
{
kmr_id[0][i] = SIdentifier(_text[i], 0, i);
}
std::sort(kmr_id[0], &kmr_id[0][_text.size()]);
calcNewId(0, _text);
std::sort(kmr_id[0], &kmr_id[0][_text.size()], idSort);
for (int i = 1, j; (1<<i) <= _text.size(); ++i)
{
for (j = 0; j + (1<<i) - 1 < _text.size(); ++j)
{
kmr_id[i][j] = SIdentifier(kmr_id[i - 1][j].first, kmr_id[i - 1][j + (1<<(i - 1))].first, j);
}
std::sort(kmr_id[i], &kmr_id[i][j]);
calcNewId(i, _text);
std::sort(kmr_id[i], &kmr_id[i][j], idSort);
}
}
/* [_b1;_e1] ...; 0 means equal; -1 first is smaller; 1 first is bigger*/
int kmrCompare(int _b1, int _e1, int _b2, int _e2)
{
int len = std::min(_e1 - _b1 + 1, _e2 - _b2 + 1);
int p2 = 0;
while ((1 << (p2 + 1)) <= len)
++p2;
assert(_b1+len-1 - (1 << p2) + 1 >=0 && _b2+len-1 - (1 << p2) + 1 >= 0);
SIdentifier a(kmr_id[p2][_b1].first, kmr_id[p2][_b1+len-1 - (1 << p2) + 1].first, 0);
SIdentifier b(kmr_id[p2][_b2].first, kmr_id[p2][_b2+len-1 - (1 << p2) + 1].first, 0);
if (a < b)
return -1;
else if (a > b)
return 1;
else
{
if (_e1 - _b1 + 1 < _e2 - _b2 + 1)
return -1;
else if (_e1 - _b1 + 1 > _e2 - _b2 + 1)
return 1;
else
return 0;
}
}
std::string pattern, text;
int main()
{
std::cin >> pattern >> text;
std::string combined = pattern + std::string("#") + text;
kmrPreProc(combined);
int howManyOccurr = 0;
for (int i = pattern.size() + 1; i < combined.size(); ++i)
{
if (kmrCompare(0, pattern.size() - 1, i, i + pattern.size() - 1) == 0)
++howManyOccurr;
}
std::cout << howManyOccurr << std::endl;
int t;
std::cin >> t;
for (int i = 0, b1, e1, b2, e2; i < t; ++i)
{
std::cin >> b1 >> e1 >> b2 >> e2;
std::cout << kmrCompare(b1, e1, b2, e2) << std::endl;
}
return 0;
} | 25.745455 | 145 | 0.636064 | CStanKonrad |
5220a2f46152146270b19398bbbf379b739a5e2d | 1,226 | cpp | C++ | sparsewrite.cpp | pibara/blake2pp | 91261a0592e8dd38390d8d86d9f7d2d897d75b17 | [
"BSD-3-Clause"
] | null | null | null | sparsewrite.cpp | pibara/blake2pp | 91261a0592e8dd38390d8d86d9f7d2d897d75b17 | [
"BSD-3-Clause"
] | null | null | null | sparsewrite.cpp | pibara/blake2pp | 91261a0592e8dd38390d8d86d9f7d2d897d75b17 | [
"BSD-3-Clause"
] | null | null | null | #include "mattock-ohash.hpp"
#include <iostream>
template <typename OHash>
std::string sparse(bool skip) {
OHash oh(true); //Writing assuming sparse.
char buf[4096];
for (int index=0;index<4096;index++) {
buf[index]=index%128;
}
for (int index=1024;index<3073;index++) {
buf[index]=0;
}
oh.written_chunk(buf,1024,0); //First part
if (not skip) {
oh.written_chunk(buf+1024,1024,1024); //Second part
oh.written_chunk(buf+2048,1024,2048); //Third part
}
oh.written_chunk(buf+3072,1024,3072); //Last part
oh.done();
return oh.result();
};
template <typename OHash>
bool testsparse() {
return sparse<OHash>(false) == sparse<OHash>(true);
};
int main(int argc,char **argv) {
bool ok=true;
if (testsparse<mattock::ohash_legacy>() == false) {
std::cerr << "Sparsetest failed for legacy." << std::endl;
ok=false;
}
if (testsparse<mattock::ohash_transitional>() == false) {
std::cerr << "Sparsetest failed for transitional." << std::endl;
ok=false;
}
if (testsparse<mattock::ohash>() == false) {
std::cerr << "Sparsetest failed for new." << std::endl;
ok=false;
}
if (ok == false) {
return -1;
}
std::cerr << "OK" << std::endl;
return 0;
}
| 25.020408 | 68 | 0.630506 | pibara |
5220c25e4fb8fb839f96f0303bb664840a2fce72 | 3,611 | cc | C++ | ports/www/chromium-legacy/newport/files/patch-chrome_browser_flag__descriptions.cc | danielfojt/DeltaPorts | 5710b4af4cacca5eb1ac577df304c788c07c4217 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ports/www/chromium-legacy/newport/files/patch-chrome_browser_flag__descriptions.cc | danielfojt/DeltaPorts | 5710b4af4cacca5eb1ac577df304c788c07c4217 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ports/www/chromium-legacy/newport/files/patch-chrome_browser_flag__descriptions.cc | danielfojt/DeltaPorts | 5710b4af4cacca5eb1ac577df304c788c07c4217 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | --- chrome/browser/flag_descriptions.cc.orig 2019-10-21 19:06:22 UTC
+++ chrome/browser/flag_descriptions.cc
@@ -3632,7 +3632,7 @@ const char kZeroStateFilesDescription[] =
#endif // defined(OS_CHROMEOS)
-#if defined(OS_CHROMEOS) || defined(OS_LINUX)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD)
const char kTerminalSystemAppName[] = "Terminal System App";
const char kTerminalSystemAppDescription[] =
"Enables the Terminal System App at chrome://terminal which is used for "
@@ -3645,7 +3645,7 @@ const char kDynamicTcmallocDescription[] =
"utilization.";
#endif // BUILDFLAG(USE_TCMALLOC)
-#endif // #if defined(OS_CHROMEOS) || defined(OS_LINUX)
+#endif // #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_BSD)
// All views-based platforms --------------------------------------------------
@@ -3670,15 +3670,15 @@ const char kReopenTabInProductHelpDescription[] =
// Random platform combinations -----------------------------------------------
-#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
const char kWebGL2ComputeContextName[] = "WebGL 2.0 Compute";
const char kWebGL2ComputeContextDescription[] =
"Enable the use of WebGL 2.0 Compute API.";
-#endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS)
+#endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \
defined(OS_CHROMEOS)
const char kClickToCallContextMenuForSelectedTextName[] =
@@ -3693,10 +3693,10 @@ const char kClickToCallUIDescription[] =
"Enables click to call feature signals to be handled on desktop by showing "
"a list of user's available devices with telephony functionality.";
-#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) ||
+#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) ||
// defined(OS_CHROMEOS)
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
const char kDirectManipulationStylusName[] = "Direct Manipulation Stylus";
const char kDirectManipulationStylusDescription[] =
@@ -3715,7 +3715,7 @@ const char kSyncClipboardServiceName[] = "Sync Clipboa
const char kSyncClipboardServiceDescription[] =
"Enables clipboard syncing via Chrome Sync.";
-#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
+#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
@@ -3825,7 +3825,7 @@ extern const char kWebrtcPipeWireCapturerDescription[]
#endif // #if defined(WEBRTC_USE_PIPEWIRE)
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
const char kEnableDbusAndX11StatusIconsName[] =
"Enable DBus and X11 status icons";
@@ -3834,7 +3834,7 @@ const char kEnableDbusAndX11StatusIconsDescription[] =
"(X11) implementations of status icons. Otherwise, uses libappindicator's "
"and GTK's implementations.";
-#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#endif // (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
const char kAvoidFlashBetweenNavigationName[] =
"Enable flash avoidance between same-origin navigations";
| 45.1375 | 92 | 0.697314 | danielfojt |
5221751c7c41914e8388c0db2b91bfcbb5af2852 | 539 | cpp | C++ | software/src/master/src/kernel/Vca_Registry.cpp | c-kuhlman/vision | 46b25f7c0da703c059acc8f0a2eac1d5badf9f6d | [
"BSD-3-Clause"
] | 30 | 2016-10-07T15:23:35.000Z | 2020-03-25T20:01:30.000Z | src/kernel/Vca_Registry.cpp | MichaelJCaruso/vision-software-src-master | 12b1b4f12a7531fe6e3cbb6861b40ac8e1985b92 | [
"BSD-3-Clause"
] | 30 | 2016-10-31T19:48:08.000Z | 2021-04-28T01:31:53.000Z | software/src/master/src/kernel/Vca_Registry.cpp | c-kuhlman/vision | 46b25f7c0da703c059acc8f0a2eac1d5badf9f6d | [
"BSD-3-Clause"
] | 15 | 2016-10-07T16:44:13.000Z | 2021-06-21T18:47:55.000Z | /***** Vca_Registry Implementation *****/
#define Vca_Registry_Implementation
/************************
************************
***** Interfaces *****
************************
************************/
/********************
***** System *****
********************/
#include "Vk.h"
/******************
***** Self *****
******************/
#include "Vca_Registry.h"
/************************
***** Supporting *****
************************/
#include "Vca_CompilerHappyPill.h"
#include "Vca_Registry_VAuthority.h"
| 19.25 | 43 | 0.332096 | c-kuhlman |
522200dba4645d5fd4874e674d965d3a81eb3a0e | 3,505 | cpp | C++ | src/run.cpp | SlausB/fos | 75c647da335925fd5e0bb956acc4db895004fc79 | [
"MIT"
] | null | null | null | src/run.cpp | SlausB/fos | 75c647da335925fd5e0bb956acc4db895004fc79 | [
"MIT"
] | null | null | null | src/run.cpp | SlausB/fos | 75c647da335925fd5e0bb956acc4db895004fc79 | [
"MIT"
] | null | null | null |
#include "run.h"
#include "dispatcher.h"
#include "colonel/colonel.h"
#include "colonel_imp/handlers/exit_h.h"
#include "colonel_imp/handlers/dbstats_h.h"
#include "colonel_imp/handlers/conns_h.h"
#include "colonel_imp/handlers/clients_h.h"
#include "colonel_imp/handlers/seg_fault_h.h"
#include "colonel_imp/requesters/con_req.h"
#include "memdbg_start.h"
namespace fos
{
#ifdef FOS_NO_DB
void Run(MetersFactory* metersFactory,
BatchFactory* batchFactory,
StartingHandler startingHandler,
TickHandler tickHandler,
const double tickPeriod,
ConnectionHandler connectionHandler,
MessageHandler messageHandler,
DisconnectionHandler disconnectionHandler,
ExitingHandler exitingHandler,
int clientsPort,
void* clientData)
{
setlocale(LC_CTYPE, "");
{
Dispatcher dispatcher(metersFactory,
batchFactory,
startingHandler,
tickHandler,
tickPeriod,
connectionHandler,
messageHandler,
disconnectionHandler,
exitingHandler,
clientsPort,
clientData);
ContextLock* contextLock = new ContextLock;
{
Colonel colonel;
Exit_Handler exit_Handler;
colonel.PushHandler(&exit_Handler);
Conns_Handler conns_Handler( dispatcher.AllocateCommonTime() );
colonel.PushHandler(&conns_Handler);
Clients_Handler clients_Handler(&dispatcher);
colonel.PushHandler(&clients_Handler);
SegFault_Handler segFault_Handler;
colonel.PushHandler( &segFault_Handler );
ConsoleRequester consoleRequester(&colonel, Globals::messenger, contextLock);
contextLock->Stop();
}
}
#if defined(WINDOWS) || defined(WIN32) || defined(WIN64)
_CrtDumpMemoryLeaks();
#endif
}
#else
void Run(const char* dbName,
const char* dbLogin,
const char* dbPassword,
MetersFactory* metersFactory,
BatchFactory* batchFactory,
StartingHandler startingHandler,
TickHandler tickHandler,
const double tickPeriod,
ConnectionHandler connectionHandler,
MessageHandler messageHandler,
DisconnectionHandler disconnectionHandler,
ExitingHandler exitingHandler,
int clientsPort,
void* clientData)
{
setlocale(LC_CTYPE, "");
{
Dispatcher dispatcher(dbName,
dbLogin,
dbPassword,
metersFactory,
batchFactory,
startingHandler,
tickHandler,
tickPeriod,
connectionHandler,
messageHandler,
disconnectionHandler,
exitingHandler,
clientsPort,
clientData);
ContextLock* contextLock = new ContextLock;
{
Colonel colonel;
Exit_Handler exit_Handler;
colonel.PushHandler(&exit_Handler);
DBStats_Handler dbStats_Handler(dispatcher.AllocateCommonTime());
colonel.PushHandler(&dbStats_Handler);
Conns_Handler conns_Handler(dispatcher.AllocateCommonTime());
colonel.PushHandler(&conns_Handler);
Clients_Handler clients_Handler(&dispatcher);
colonel.PushHandler(&clients_Handler);
SegFault_Handler segFault_Handler;
colonel.PushHandler( &segFault_Handler );
ConsoleRequester consoleRequester(&colonel, Globals::messenger, contextLock);
contextLock->Stop();
}
}
#if defined(WINDOWS) || defined(WIN32) || defined(WIN64)
_CrtDumpMemoryLeaks();
#endif
}
#endif//#ifdef FOS_NO_DB
}//namespace fos
#include "memdbg_end.h"
| 23.211921 | 81 | 0.689586 | SlausB |
5225bf3849487f746201d0be7fb1f8b312123aa5 | 15,574 | hpp | C++ | Nacro/SDK/FN_EnemyPawn_Parent_parameters.hpp | Milxnor/Nacro | eebabf662bbce6d5af41820ea0342d3567a0aecc | [
"BSD-2-Clause"
] | 11 | 2021-08-08T23:25:10.000Z | 2022-02-19T23:07:22.000Z | Nacro/SDK/FN_EnemyPawn_Parent_parameters.hpp | Milxnor/Nacro | eebabf662bbce6d5af41820ea0342d3567a0aecc | [
"BSD-2-Clause"
] | 1 | 2022-01-01T22:51:59.000Z | 2022-01-08T16:14:15.000Z | Nacro/SDK/FN_EnemyPawn_Parent_parameters.hpp | Milxnor/Nacro | eebabf662bbce6d5af41820ea0342d3567a0aecc | [
"BSD-2-Clause"
] | 8 | 2021-08-09T13:51:54.000Z | 2022-01-26T20:33:37.000Z | #pragma once
// Fortnite (1.8) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "../SDK.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Parameters
//---------------------------------------------------------------------------
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.Orphaned
struct AEnemyPawn_Parent_C_Orphaned_Params
{
bool IsOrphaned; // (Parm, OutParm, ZeroConstructor, IsPlainOldData)
class AFortPawn* AttachedPawn; // (Parm, OutParm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OnRep_SpecialEventHalloweenPumpkinHeadApplied
struct AEnemyPawn_Parent_C_OnRep_SpecialEventHalloweenPumpkinHeadApplied_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.SpecialEventHalloweenPumpkinHeadHusk
struct AEnemyPawn_Parent_C_SpecialEventHalloweenPumpkinHeadHusk_Params
{
bool ApplyPumpkinHeadMesh; // (Parm, ZeroConstructor, IsPlainOldData)
bool DebugApplicationOrRemoval_; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.SpawnMeshAttachedToCharacter
struct AEnemyPawn_Parent_C_SpawnMeshAttachedToCharacter_Params
{
class UStaticMesh* Static_Mesh; // (Parm, ZeroConstructor, IsPlainOldData)
struct FName Socket_Name; // (Parm, ZeroConstructor, IsPlainOldData)
struct FTransform Relative_Transform; // (Parm, IsPlainOldData)
bool Absolute_Location; // (Parm, ZeroConstructor, IsPlainOldData)
bool Absolute_Rotation; // (Parm, ZeroConstructor, IsPlainOldData)
bool Absolute_Scale; // (Parm, ZeroConstructor, IsPlainOldData)
class UStaticMeshComponent* Static_Mesh_Component_Reference; // (Parm, OutParm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.RestorePreviousMaterialOnCharacterMesh
struct AEnemyPawn_Parent_C_RestorePreviousMaterialOnCharacterMesh_Params
{
float Delay_in_Seconds; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.CharacterSpawnInSafetyCheck
struct AEnemyPawn_Parent_C_CharacterSpawnInSafetyCheck_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.SetCharacterEyeColors
struct AEnemyPawn_Parent_C_SetCharacterEyeColors_Params
{
struct FLinearColor Eye_Color_Inner; // (Parm, IsPlainOldData)
struct FLinearColor Eye_Color_Outer; // (Parm, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.SetCharacterFresnelGlowColors
struct AEnemyPawn_Parent_C_SetCharacterFresnelGlowColors_Params
{
struct FLinearColor Inner_Color; // (Parm, IsPlainOldData)
struct FLinearColor Outer_Color; // (Parm, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.SpawnParticleSystemOnCharacterMesh
struct AEnemyPawn_Parent_C_SpawnParticleSystemOnCharacterMesh_Params
{
class UParticleSystem* ParticleSystemTemplate; // (Parm, ZeroConstructor, IsPlainOldData)
class UParticleSystemComponent* ParticleSystemComponentReferenceVar; // (Parm, ZeroConstructor, IsPlainOldData)
struct FName AttachPointName; // (Parm, ZeroConstructor, IsPlainOldData)
struct FVector Location; // (Parm, IsPlainOldData)
struct FRotator Rotation; // (Parm, IsPlainOldData)
TArray<struct FParticleSysParam> InstanceParameters; // (Parm, OutParm, ZeroConstructor, ReferenceParm)
bool AutoActivate; // (Parm, ZeroConstructor, IsPlainOldData)
bool AutoDestroy; // (Parm, ZeroConstructor, IsPlainOldData)
bool AbsoluteLocation; // (Parm, ZeroConstructor, IsPlainOldData)
bool AbsoluteRotation; // (Parm, ZeroConstructor, IsPlainOldData)
bool AbsoluteScale; // (Parm, ZeroConstructor, IsPlainOldData)
class UParticleSystemComponent* PSComponentReference; // (Parm, OutParm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OverridePhysicalMaterialOnCharacterMesh
struct AEnemyPawn_Parent_C_OverridePhysicalMaterialOnCharacterMesh_Params
{
class UPhysicalMaterial* Physical_Material_Override; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.DestroyAwokenSkeletalMesh
struct AEnemyPawn_Parent_C_DestroyAwokenSkeletalMesh_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OverrideMaterialAndCopyParametersOnCharacterMesh
struct AEnemyPawn_Parent_C_OverrideMaterialAndCopyParametersOnCharacterMesh_Params
{
class UMaterial* New_Material_To_Apply; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.PlayAdditiveHitReacts
struct AEnemyPawn_Parent_C_PlayAdditiveHitReacts_Params
{
struct FVector Hit_Direction; // (Parm, IsPlainOldData)
class UAnimMontage* Anim_Montage; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.SetActiveParticlesOnCharacterMesh
struct AEnemyPawn_Parent_C_SetActiveParticlesOnCharacterMesh_Params
{
bool Active; // (Parm, ZeroConstructor, IsPlainOldData)
bool Reset; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.SetScalarParameterOnAllCharacterMIDs
struct AEnemyPawn_Parent_C_SetScalarParameterOnAllCharacterMIDs_Params
{
struct FName Parameter_Name; // (Parm, ZeroConstructor, IsPlainOldData)
float Scalar_Value; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.SetVectorParameterOnAllCharacterMIDs
struct AEnemyPawn_Parent_C_SetVectorParameterOnAllCharacterMIDs_Params
{
struct FName Parameter_Name; // (Parm, ZeroConstructor, IsPlainOldData)
struct FLinearColor Linear_Color; // (Parm, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.PickColorFromAnArrayOfColors
struct AEnemyPawn_Parent_C_PickColorFromAnArrayOfColors_Params
{
TArray<struct FLinearColor> ArrayOfColors; // (Parm, OutParm, ZeroConstructor, ReferenceParm)
struct FLinearColor Color; // (Parm, OutParm, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.StopDeathFX
struct AEnemyPawn_Parent_C_StopDeathFX_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.StopMaterialTimeline
struct AEnemyPawn_Parent_C_StopMaterialTimeline_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.EnemyDeathVisuals
struct AEnemyPawn_Parent_C_EnemyDeathVisuals_Params
{
bool HQ; // (Parm, OutParm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.UserConstructionScript
struct AEnemyPawn_Parent_C_UserConstructionScript_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.DeathMaterialParamsTL__FinishedFunc
struct AEnemyPawn_Parent_C_DeathMaterialParamsTL__FinishedFunc_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.DeathMaterialParamsTL__UpdateFunc
struct AEnemyPawn_Parent_C_DeathMaterialParamsTL__UpdateFunc_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.Enemy Spawn Out TL__FinishedFunc
struct AEnemyPawn_Parent_C_Enemy_Spawn_Out_TL__FinishedFunc_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.Enemy Spawn Out TL__UpdateFunc
struct AEnemyPawn_Parent_C_Enemy_Spawn_Out_TL__UpdateFunc_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.EnemySpawnInTL__FinishedFunc
struct AEnemyPawn_Parent_C_EnemySpawnInTL__FinishedFunc_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.EnemySpawnInTL__UpdateFunc
struct AEnemyPawn_Parent_C_EnemySpawnInTL__UpdateFunc_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.EnemySpawnInTL__Spawn__EventFunc
struct AEnemyPawn_Parent_C_EnemySpawnInTL__Spawn__EventFunc_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.ReceiveBeginPlay
struct AEnemyPawn_Parent_C_ReceiveBeginPlay_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OnDeathPlayEffects
struct AEnemyPawn_Parent_C_OnDeathPlayEffects_Params
{
float* Damage; // (Parm, ZeroConstructor, IsPlainOldData)
struct FGameplayTagContainer* DamageTags; // (ConstParm, Parm, OutParm, ReferenceParm)
struct FVector* Momentum; // (Parm, IsPlainOldData)
struct FHitResult* HitInfo; // (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData)
class AFortPawn** InstigatedBy; // (Parm, ZeroConstructor, IsPlainOldData)
class AActor** DamageCauser; // (Parm, ZeroConstructor, IsPlainOldData)
struct FGameplayEffectContextHandle* EffectContext; // (Parm)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.BeginDeathFX
struct AEnemyPawn_Parent_C_BeginDeathFX_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.PostSpawnIn
struct AEnemyPawn_Parent_C_PostSpawnIn_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.DespawnEnemy
struct AEnemyPawn_Parent_C_DespawnEnemy_Params
{
struct FVector RiftLocationWS; // (Parm, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.DebugEnemySpawnIn
struct AEnemyPawn_Parent_C_DebugEnemySpawnIn_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OnFinishedEncounterSpawn
struct AEnemyPawn_Parent_C_OnFinishedEncounterSpawn_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OnStartedEncounterSpawn
struct AEnemyPawn_Parent_C_OnStartedEncounterSpawn_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.PawnUniqueIDSet
struct AEnemyPawn_Parent_C_PawnUniqueIDSet_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OnDamagePlayEffects
struct AEnemyPawn_Parent_C_OnDamagePlayEffects_Params
{
float* Damage; // (Parm, ZeroConstructor, IsPlainOldData)
struct FGameplayTagContainer* DamageTags; // (ConstParm, Parm, OutParm, ReferenceParm)
struct FVector* Momentum; // (Parm, IsPlainOldData)
struct FHitResult* HitInfo; // (ConstParm, Parm, OutParm, ReferenceParm, IsPlainOldData)
class AFortPawn** InstigatedBy; // (Parm, ZeroConstructor, IsPlainOldData)
class AActor** DamageCauser; // (Parm, ZeroConstructor, IsPlainOldData)
struct FGameplayEffectContextHandle* EffectContext; // (Parm)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.AdditiveHitReactDelay
struct AEnemyPawn_Parent_C_AdditiveHitReactDelay_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OnBeginSleepEffects
struct AEnemyPawn_Parent_C_OnBeginSleepEffects_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OnEndSleepEffects
struct AEnemyPawn_Parent_C_OnEndSleepEffects_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.RestorePreviousMaterialDelayCompleted
struct AEnemyPawn_Parent_C_RestorePreviousMaterialDelayCompleted_Params
{
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.RestorePreviousMaterialDelay
struct AEnemyPawn_Parent_C_RestorePreviousMaterialDelay_Params
{
float Delay_Amount; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.OnCheatUpdateSpecialEventGE
struct AEnemyPawn_Parent_C_OnCheatUpdateSpecialEventGE_Params
{
bool* bShouldUseSpecialEventGE; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function EnemyPawn_Parent.EnemyPawn_Parent_C.ExecuteUbergraph_EnemyPawn_Parent
struct AEnemyPawn_Parent_C_ExecuteUbergraph_EnemyPawn_Parent_Params
{
int EntryPoint; // (Parm, ZeroConstructor, IsPlainOldData)
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| 50.895425 | 170 | 0.589508 | Milxnor |
5226c84c51392b3591dcbb5a1d94511fc91b275c | 5,709 | cpp | C++ | src/lib/elf/relocation.cpp | epochx64/epochx64 | 15dd18ef0708000c8ac123dc59c8416db4c56e6b | [
"MIT"
] | null | null | null | src/lib/elf/relocation.cpp | epochx64/epochx64 | 15dd18ef0708000c8ac123dc59c8416db4c56e6b | [
"MIT"
] | null | null | null | src/lib/elf/relocation.cpp | epochx64/epochx64 | 15dd18ef0708000c8ac123dc59c8416db4c56e6b | [
"MIT"
] | null | null | null | #include <elf/relocation.h>
namespace elf
{
UINT64 GetSymbolValue(Elf64_Ehdr *ELFHeader, int Table, UINT64 Index)
{
using namespace log;
auto SymbolTableHeader = GetSectionHeader(ELFHeader, Table);
Elf64_Sym *Symbol = &((Elf64_Sym*)((UINT64)ELFHeader + SymbolTableHeader->sh_offset))[Index];
Elf64_Shdr *StringTable = GetSectionHeader(ELFHeader, SymbolTableHeader->sh_link);
auto Name = (char*)((UINT64)ELFHeader + StringTable->sh_offset + Symbol->st_name);
if(Symbol->st_shndx == SHN_UNDEF)
{
kout << "External symbol found: " << Name << "\n";
return 0;
}
else if(Symbol->st_shndx == SHN_ABS)
{
kout << "Absolute symbol found: " << Name << " (value 0x"<<HEX<< Symbol->st_value << ")\n";
return Symbol->st_value;
}
Elf64_Shdr *Target = GetSectionHeader(ELFHeader, Symbol->st_shndx);
UINT64 Value = (UINT64)ELFHeader + Target->sh_offset + Symbol->st_value;
kout << "Internally defined symbol found: " << Name << "\n";
return Value;
}
UINT64 GetProgramSize(Elf64_Ehdr *ELFHeader)
{
/*
* All ELFs must order sections first->last .text->.data->.bss
*/
UINT64 Size = 0;
auto SectionHeaders = (Elf64_Shdr *)((UINT64)ELFHeader + ELFHeader->e_shoff);
for(UINT64 i = 1; i < ELFHeader->e_shnum; i++)
{
Size += SectionHeaders[i].sh_size;
auto iSectionName = GetString(ELFHeader, SectionHeaders[i].sh_name);
if(string::strncmp((unsigned char*)iSectionName, (unsigned char*)".bss", 4))
return SectionHeaders[i].sh_addr + SectionHeaders[i].sh_size;
}
return 0;
}
void ProcessRELA(Elf64_Ehdr *ELFHeader, Elf64_Shdr *RELASection, UINT64 pProgramStart)
{
auto RELAEntries = (Elf64_Rela*)((UINT64)ELFHeader + RELASection->sh_offset);
UINT64 nEntries = RELASection->sh_size / RELASection->sh_entsize;
auto RELALinkedSection = GetSectionHeader(ELFHeader, RELASection->sh_info);
for(UINT64 i = 0; i < nEntries; i++)
{
auto RELAType = ELF64_R_TYPE(RELAEntries[i].r_info);
auto RELALocation = (UINT64*)((UINT64)ELFHeader + RELALinkedSection->sh_offset + RELAEntries[i].r_offset);
auto SymVal = GetSymbolValue(ELFHeader,
RELASection->sh_link,
ELF64_R_SYM(RELAEntries[i].r_info));
log::kout << "RELALocation 0x" <<HEX<< (UINT64)RELALocation << "\n";
if(RELAType == X86_64_64)
*RELALocation = R_X86_64_64(SymVal, RELAEntries[i].r_addend);
if(RELAType == X86_64_PC32)
*(UINT32*)RELALocation = R_X86_64_PC32(SymVal, RELAEntries[i].r_addend, (UINT64)RELALocation);
if(RELAType == X86_64_32S)
*(UINT32*)RELALocation = R_X86_64_32S(SymVal, RELAEntries[i].r_addend);
if(RELAType == X86_64_RELATIVE)
*(UINT64*)RELALocation = R_X86_64_RELATIVE(pProgramStart, RELAEntries[i].r_addend);
log::kout << "Relocation (type 0x" <<HEX<< RELAType << ") applied: 0x" <<HEX<< *RELALocation << "\n";
}
}
void *LoadELF64(Elf64_Ehdr *ELFHeader)
{
UINT64 ProgramSize = GetProgramSize(ELFHeader);
auto SectionHeaders = (Elf64_Shdr *)((UINT64)ELFHeader + ELFHeader->e_shoff);
auto pProgram = KeSysMalloc(ProgramSize);
// Zero out the memory we just allocated
for(UINT64 i = 0; i < ProgramSize; i+=8) *(UINT64*)((UINT64)pProgram + i) = 0;
log::kout << "ELF size: 0x"<<HEX<<ProgramSize << " loaded\n";
for(UINT64 i = 1; i < ELFHeader->e_shnum; i++)
{
auto iSectionName = GetString(ELFHeader, SectionHeaders[i].sh_name);
/*
* linker script must place .bss after all PT_LOAD segments
*/
if(string::strncmp((unsigned char*)iSectionName, (unsigned char*)".bss", 4)) break;
for(UINT64 j = 0; j < SectionHeaders[i].sh_size; j+=8)
{
*(UINT64*)((UINT64)pProgram + SectionHeaders[i].sh_addr + j)
= *(UINT64*)((UINT64)ELFHeader + SectionHeaders[i].sh_offset + j);
}
/*
* Might be useful sometime in the future
*
auto iSectionType = SectionHeaders[i].sh_type;
if(iSectionType == SHT_RELA)
{
ProcessRELA(ELFHeader, &SectionHeaders[i], (UINT64)pProgram);
log::kout << "\n";
}*/
}
return (void*)((UINT64)pProgram + ELFHeader->e_entry);
/*
* This is an alternate way of loading the elf to memory but I opted to use the janky method
* no surprise there
*
* But will keep here in case of unforeseen issues caused by the jank method
auto ProgramHeaders = (Elf64_Phdr *)((UINT64)ELFHeader + ELFHeader->e_phoff);
for(Elf64_Phdr *iProgramHeader = ProgramHeaders;
(UINT64)iProgramHeader < (UINT64)ProgramHeaders + ELFHeader->e_phnum*ELFHeader->e_phentsize;
iProgramHeader = (Elf64_Phdr*)((UINT64)iProgramHeader + ELFHeader->e_phentsize))
{
if(iProgramHeader->p_type != PT_LOAD) continue;
log::kout << "PROGRAMHEADER size 0x" <<HEX<< iProgramHeader->p_filesz << "\n";
for(UINT64 j = 0; j < iProgramHeader->p_filesz; j+=8)
*(UINT64*)((UINT64)pProgram + iProgramHeader->p_vaddr + j) = *(UINT64*)((UINT64)ELFHeader + iProgramHeader->p_offset + j);
}
*/
}
} | 38.836735 | 138 | 0.586267 | epochx64 |
52279cf266d281ccc0746f369ce0dac107c859fa | 36,524 | hxx | C++ | main/svx/inc/svx/svdmodel.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 679 | 2015-01-06T06:34:58.000Z | 2022-03-30T01:06:03.000Z | main/svx/inc/svx/svdmodel.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 102 | 2017-11-07T08:51:31.000Z | 2022-03-17T12:13:49.000Z | main/svx/inc/svx/svdmodel.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 331 | 2015-01-06T11:40:55.000Z | 2022-03-14T04:07:51.000Z | /**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 _SVDMODEL_HXX
#define _SVDMODEL_HXX
#include <com/sun/star/uno/Sequence.hxx>
#include <cppuhelper/weakref.hxx>
#include <sot/storage.hxx>
#include <tools/link.hxx>
#include <tools/contnr.hxx>
#include <tools/weakbase.hxx>
#include <vcl/mapmod.hxx>
#include <svl/brdcst.hxx>
#include <tools/string.hxx>
#include <tools/datetime.hxx>
#include <svl/hint.hxx>
#include <svl/style.hxx>
#include <svx/pageitem.hxx>
#include <vcl/field.hxx>
#include <boost/shared_ptr.hpp>
#include <svx/svdtypes.hxx> // fuer enum RepeatFuncts
#include <vcl/field.hxx>
#include "svx/svxdllapi.h"
#include <vos/ref.hxx>
#include <svx/xtable.hxx>
#if defined(UNX) || defined(WNT)
#define DEGREE_CHAR ((sal_Unicode)176) /* 0xB0 = Ansi */
#endif
#if defined(OS2)
#define DEGREE_CHAR ((sal_Unicode)248) /* 0xF8 = IBM PC (Erw. ASCII) */
#endif
#ifndef DEGREE_CHAR
#error unbekannte Plattrorm
#endif
class OutputDevice;
class SdrOutliner;
class SdrLayerAdmin;
class SdrObjList;
class SdrObject;
class SdrPage;
class SdrPageView;
class SdrTextObj;
class SdrUndoAction;
class SdrUndoGroup;
class AutoTimer;
class SfxItemPool;
class SfxItemSet;
class SfxRepeatTarget;
class SfxStyleSheet;
class SfxUndoAction;
class SfxUndoManager;
class SvxForbiddenCharactersTable;
class SvNumberFormatter;
class SotStorage;
class SdrOutlinerCache;
class SotStorageRef;
class SdrUndoFactory;
namespace comphelper{
class IEmbeddedHelper;
}
class ImageMap;
namespace sfx2{
class LinkManager;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
#define SDR_SWAPGRAPHICSMODE_NONE 0x00000000
#define SDR_SWAPGRAPHICSMODE_TEMP 0x00000001
#define SDR_SWAPGRAPHICSMODE_DOC 0x00000002
#define SDR_SWAPGRAPHICSMODE_PURGE 0x00000100
#define SDR_SWAPGRAPHICSMODE_DEFAULT (SDR_SWAPGRAPHICSMODE_TEMP|SDR_SWAPGRAPHICSMODE_DOC|SDR_SWAPGRAPHICSMODE_PURGE)
////////////////////////////////////////////////////////////////////////////////////////////////////
enum SdrHintKind
{
HINT_UNKNOWN, // Unbekannt
HINT_LAYERCHG, // Layerdefinition geaendert
HINT_LAYERORDERCHG, // Layerreihenfolge geaendert (Insert/Remove/ChangePos)
HINT_PAGEORDERCHG, // Reihenfolge der Seiten (Zeichenseiten oder Masterpages) geaendert (Insert/Remove/ChangePos)
HINT_OBJCHG, // Objekt geaendert
HINT_OBJINSERTED, // Neues Zeichenobjekt eingefuegt
HINT_OBJREMOVED, // Zeichenobjekt aus Liste entfernt
HINT_MODELCLEARED, // gesamtes Model geloescht (keine Pages mehr da). not impl.
HINT_REFDEVICECHG, // RefDevice geaendert
HINT_DEFAULTTABCHG, // Default Tabulatorweite geaendert
HINT_DEFFONTHGTCHG, // Default FontHeight geaendert
HINT_MODELSAVED, // Dokument wurde gesichert
HINT_SWITCHTOPAGE, // #94278# UNDO/REDO at an object evtl. on another page
HINT_BEGEDIT, // Is called after the object has entered text edit mode
HINT_ENDEDIT // Is called after the object has left text edit mode
};
class SVX_DLLPUBLIC SdrHint: public SfxHint
{
public:
Rectangle maRectangle;
const SdrPage* mpPage;
const SdrObject* mpObj;
const SdrObjList* mpObjList;
SdrHintKind meHint;
public:
TYPEINFO();
SdrHint();
SdrHint(SdrHintKind eNewHint);
SdrHint(const SdrObject& rNewObj);
SdrHint(const SdrObject& rNewObj, const Rectangle& rRect);
void SetPage(const SdrPage* pNewPage);
void SetObjList(const SdrObjList* pNewOL);
void SetObject(const SdrObject* pNewObj);
void SetKind(SdrHintKind eNewKind);
void SetRect(const Rectangle& rNewRect);
const SdrPage* GetPage() const;
const SdrObjList* GetObjList() const;
const SdrObject* GetObject() const;
SdrHintKind GetKind() const;
const Rectangle& GetRect() const;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
// Flag um nach dem Laden des Pools Aufzuraeumen (d.h. die RefCounts
// neu zu bestimmen und unbenutztes wegzuwerfen). sal_False == aktiv
#define LOADREFCOUNTS (sal_False)
struct SdrDocumentStreamInfo
{
FASTBOOL mbDeleteAfterUse;
String maUserData;
com::sun::star::uno::Reference < com::sun::star::embed::XStorage > mxStorageRef;
sal_Bool mbDummy1 : 1;
};
struct SdrModelImpl;
class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< SdrModel >
{
protected:
DateTime aReadDate; // Datum des Einstreamens
Container maMaPag; // StammSeiten (Masterpages)
Container maPages;
Link aUndoLink; // Link fuer einen NotifyUndo-Handler
Link aIOProgressLink;
String aTablePath;
Size aMaxObjSize; // z.B. fuer Autogrowing Text
Fraction aObjUnit; // Beschreibung der Koordinateneinheiten fuer ClipBoard, Drag&Drop, ...
MapUnit eObjUnit; // see above
FieldUnit eUIUnit; // Masseinheit, Masstab (z.B. 1/1000) fuer die UI (Statuszeile) wird von ImpSetUIUnit() gesetzt
Fraction aUIScale; // see above
String aUIUnitStr; // see above
Fraction aUIUnitFact; // see above
int nUIUnitKomma; // see above
FASTBOOL bUIOnlyKomma; // see above
SdrLayerAdmin* pLayerAdmin;
SfxItemPool* pItemPool;
FASTBOOL bMyPool; // zum Aufraeumen von pMyPool ab 303a
comphelper::IEmbeddedHelper*
m_pEmbeddedHelper; // helper for embedded objects to get rid of the SfxObjectShell
SdrOutliner* pDrawOutliner; // ein Outliner zur Textausgabe
SdrOutliner* pHitTestOutliner;// ein Outliner fuer den HitTest
sal_uIntPtr nDefTextHgt; // Default Texthoehe in logischen Einheiten
OutputDevice* pRefOutDev; // ReferenzDevice fuer die EditEngine
sal_uIntPtr nProgressAkt; // fuer den
sal_uIntPtr nProgressMax; // ProgressBar-
sal_uIntPtr nProgressOfs; // -Handler
rtl::Reference< SfxStyleSheetBasePool > mxStyleSheetPool;
SfxStyleSheet* pDefaultStyleSheet;
SfxStyleSheet* mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; // #119287#
sfx2::LinkManager* pLinkManager; // LinkManager
Container* pUndoStack;
Container* pRedoStack;
SdrUndoGroup* pAktUndoGroup; // Fuer mehrstufige
sal_uInt16 nUndoLevel; // Undo-Klammerung
bool mbUndoEnabled; // If false no undo is recorded or we are during the execution of an undo action
sal_uInt16 nProgressPercent; // fuer den ProgressBar-Handler
sal_uInt16 nLoadVersion; // Versionsnummer der geladenen Datei
sal_Bool mbChanged;
FASTBOOL bInfoChanged;
FASTBOOL bPagNumsDirty;
FASTBOOL bMPgNumsDirty;
FASTBOOL bPageNotValid; // sal_True=Doc ist nur ObjektTraeger. Page ist nicht gueltig.
FASTBOOL bSavePortable; // Metafiles portabel speichern
FASTBOOL bNoBitmapCaching; // Bitmaps fuer Screenoutput cachen
FASTBOOL bReadOnly;
FASTBOOL bTransparentTextFrames;
FASTBOOL bSaveCompressed;
FASTBOOL bSwapGraphics;
FASTBOOL bPasteResize; // Objekte werden gerade resized wegen Paste mit anderem MapMode
FASTBOOL bSaveOLEPreview; // save preview metafile of OLE objects
sal_uInt16 nStreamCompressMode; // Komprimiert schreiben?
sal_uInt16 nStreamNumberFormat;
sal_uInt16 nDefaultTabulator;
sal_uInt32 nMaxUndoCount;
FASTBOOL bSaveNative;
sal_Bool bStarDrawPreviewMode;
bool mbDisableTextEditUsesCommonUndoManager;
//////////////////////////////////////////////////////////////////////////////
// sdr::Comment interface
private:
// the next unique comment ID, used for counting added comments. Initialized
// to 0. UI shows one more due to the fact that 0 is a no-no for users.
sal_uInt32 mnUniqueCommentID;
public:
// create a new, unique comment ID
sal_uInt32 GetNextUniqueCommentID();
// get the author name
::rtl::OUString GetDocumentAuthorName() const;
// for export
sal_uInt32 GetUniqueCommentID() const { return mnUniqueCommentID; }
// for import
void SetUniqueCommentID(sal_uInt32 nNewID) { if(nNewID != mnUniqueCommentID) { mnUniqueCommentID = nNewID; } }
/** cl: added this for OJ to complete his reporting engine, does not work
correctly so only enable it for his model */
bool IsAllowShapePropertyChangeListener() const;
void SetAllowShapePropertyChangeListener( bool bAllow );
sal_uInt16 nStarDrawPreviewMasterPageNum;
// Reserven fuer kompatible Erweiterungen
//-/ SfxItemPool* pUndoItemPool;
SotStorage* pModelStorage;
SvxForbiddenCharactersTable* mpForbiddenCharactersTable;
sal_uIntPtr nSwapGraphicsMode;
SdrOutlinerCache* mpOutlinerCache;
SdrModelImpl* mpImpl;
sal_uInt16 mnCharCompressType;
sal_uInt16 mnHandoutPageCount;
sal_uInt16 nReserveUInt6;
sal_uInt16 nReserveUInt7;
FASTBOOL mbModelLocked;
FASTBOOL mbKernAsianPunctuation;
FASTBOOL mbAddExtLeading;
FASTBOOL mbInDestruction;
// lists for colors, dashes, lineends, hatches, gradients and bitmaps for this model
XColorListSharedPtr maColorTable;
XDashListSharedPtr maDashList;
XLineEndListSharedPtr maLineEndList;
XHatchListSharedPtr maHatchList;
XGradientListSharedPtr maGradientList;
XBitmapListSharedPtr maBitmapList;
// New src638: NumberFormatter for drawing layer and
// method for getting it. It is constructed on demand
// and destroyed when destroying the SdrModel.
SvNumberFormatter* mpNumberFormatter;
public:
const SvNumberFormatter& GetNumberFormatter() const;
sal_uInt16 getHandoutPageCount() const { return mnHandoutPageCount; }
void setHandoutPageCount( sal_uInt16 nHandoutPageCount ) { mnHandoutPageCount = nHandoutPageCount; }
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
private:
// Nicht implementiert:
SVX_DLLPRIVATE SdrModel(const SdrModel& rSrcModel);
SVX_DLLPRIVATE void operator=(const SdrModel& rSrcModel);
SVX_DLLPRIVATE FASTBOOL operator==(const SdrModel& rCmpModel) const;
//#if 0 // _SOLAR__PRIVATE
SVX_DLLPRIVATE void ImpPostUndoAction(SdrUndoAction* pUndo);
SVX_DLLPRIVATE void ImpSetUIUnit();
SVX_DLLPRIVATE void ImpSetOutlinerDefaults( SdrOutliner* pOutliner, sal_Bool bInit = sal_False );
SVX_DLLPRIVATE void ImpReformatAllTextObjects();
SVX_DLLPRIVATE void ImpReformatAllEdgeObjects(); // #103122#
SVX_DLLPRIVATE void ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bLoadRefCounts = true);
//#endif // __PRIVATE
// this is a weak reference to a possible living api wrapper for this model
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoModel;
public:
//#if 0 // _SOLAR__PRIVATE
FASTBOOL IsPasteResize() const { return bPasteResize; }
void SetPasteResize(FASTBOOL bOn) { bPasteResize=bOn; }
//#endif // __PRIVATE
TYPEINFO();
// Steckt man hier seinen eigenen Pool rein, so wird die Klasse auch
// Aktionen an ihm vornehmen (Put(),Remove()). Bei Zerstoerung von
// SdrModel wird dieser Pool ver delete geloescht!
// Gibt man den Konstruktor stattdessen eine NULL mit, so macht sich
// die Klasse einen eigenen Pool (SdrItemPool), den sie dann auch im
// Destruktor zerstoert.
// Bei Verwendung eines eigenen Pools ist darauf zu achten, dass dieser
// von SdrItemPool abgeleitet ist, falls man von SdrAttrObj abgeleitete
// Zeichenobjekte verwenden moechte. Setzt man degegen nur vom abstrakten
// Basisobjekt SdrObject abgeleitete Objekte ein, so ist man frei in der
// Wahl des Pools.
SdrModel(SfxItemPool* pPool=NULL, ::comphelper::IEmbeddedHelper* pPers=NULL, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
SdrModel(const String& rPath, SfxItemPool* pPool=NULL, ::comphelper::IEmbeddedHelper* pPers=NULL, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
virtual ~SdrModel();
void ClearModel(sal_Bool bCalledFromDestructor);
// Hier kann man erfragen, ob das Model gerade eingrstreamt wird
FASTBOOL IsLoading() const { return sal_False /*BFS01 bLoading */; }
// Muss z.B. ueberladen werden, um das Swappen/LoadOnDemand von Grafiken
// zu ermoeglichen. Wird rbDeleteAfterUse auf sal_True gesetzt, so wird
// die SvStream-Instanz vom Aufrufer nach Gebrauch destruiert.
// Wenn diese Methode NULL liefert, wird zum Swappen eine temporaere
// Datei angelegt.
// Geliefert werden muss der Stream, aus dem das Model geladen wurde
// bzw. in den es zuletzt gespeichert wurde.
virtual SvStream* GetDocumentStream( SdrDocumentStreamInfo& rStreamInfo ) const;
// Die Vorlagenattribute der Zeichenobjekte in harte Attribute verwandeln.
void BurnInStyleSheetAttributes();
// Wer sich von SdrPage ableitet muss sich auch von SdrModel ableiten
// und diese beiden VM AllocPage() und AllocModel() ueberladen...
virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
virtual SdrModel* AllocModel() const;
// Aenderungen an den Layern setzen das Modified-Flag und broadcasten am Model!
const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; }
SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; }
const SfxItemPool& GetItemPool() const { return *pItemPool; }
SfxItemPool& GetItemPool() { return *pItemPool; }
SdrOutliner& GetDrawOutliner(const SdrTextObj* pObj=NULL) const;
/** returns a new created and non shared outliner.
The outliner will not get updated when the SdrModel is changed.
*/
boost::shared_ptr< SdrOutliner > CreateDrawOutliner(const SdrTextObj* pObj=NULL);
SdrOutliner& GetHitTestOutliner() const { return *pHitTestOutliner; }
const SdrTextObj* GetFormattingTextObj() const;
// Die TextDefaults (Font,Hoehe,Farbe) in ein Set putten
void SetTextDefaults() const;
static void SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt );
// ReferenzDevice fuer die EditEngine
void SetRefDevice(OutputDevice* pDev);
OutputDevice* GetRefDevice() const { return pRefOutDev; }
// Wenn ein neuer MapMode am RefDevice gesetzt wird o.ae.
void RefDeviceChanged(); // noch nicht implementiert
// Default-Schrifthoehe in logischen Einheiten
void SetDefaultFontHeight(sal_uIntPtr nVal);
sal_uIntPtr GetDefaultFontHeight() const { return nDefTextHgt; }
// Default-Tabulatorweite fuer die EditEngine
void SetDefaultTabulator(sal_uInt16 nVal);
sal_uInt16 GetDefaultTabulator() const { return nDefaultTabulator; }
// Der DefaultStyleSheet wird jedem Zeichenobjekt verbraten das in diesem
// Model eingefuegt wird und kein StyleSheet gesetzt hat.
SfxStyleSheet* GetDefaultStyleSheet() const { return pDefaultStyleSheet; }
void SetDefaultStyleSheet(SfxStyleSheet* pDefSS) { pDefaultStyleSheet = pDefSS; }
// #119287# default StyleSheet for SdrGrafObj and SdrOle2Obj
SfxStyleSheet* GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj() const { return mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; }
void SetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(SfxStyleSheet* pDefSS) { mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj = pDefSS; }
sfx2::LinkManager* GetLinkManager() { return pLinkManager; }
void SetLinkManager( sfx2::LinkManager* pLinkMgr ) { pLinkManager = pLinkMgr; }
::comphelper::IEmbeddedHelper* GetPersist() const { return m_pEmbeddedHelper; }
void ClearPersist() { m_pEmbeddedHelper = 0; }
void SetPersist( ::comphelper::IEmbeddedHelper *p ) { m_pEmbeddedHelper = p; }
// Masseinheit fuer die Zeichenkoordinaten.
// Default ist 1 logische Einheit = 1/100mm (Unit=MAP_100TH_MM, Fract=(1,1)).
// Beispiele:
// MAP_POINT, Fraction(72,1) : 1 log Einh = 72 Point = 1 Inch
// MAP_POINT, Fraction(1,20) : 1 log Einh = 1/20 Point = 1 Twip
// MAP_TWIP, Fraction(1,1) : 1 log Einh = 1 Twip
// MAP_100TH_MM, Fraction(1,10) : 1 log Einh = 1/1000mm
// MAP_MM, Fraction(1000,1) : 1 log Einh = 1000mm = 1m
// MAP_CM, Fraction(100,1) : 1 log Einh = 100cm = 1m
// MAP_CM, Fraction(100,1) : 1 log Einh = 100cm = 1m
// MAP_CM, Fraction(100000,1): 1 log Einh = 100000cm = 1km
// (PS: Lichtjahre sind somit also nicht darstellbar).
// Die Skalierungseinheit wird benoetigt, damit die Engine das Clipboard
// mit den richtigen Groessen beliefern kann.
MapUnit GetScaleUnit() const { return eObjUnit; }
void SetScaleUnit(MapUnit eMap);
const Fraction& GetScaleFraction() const { return aObjUnit; }
void SetScaleFraction(const Fraction& rFrac);
// Beides gleichzeitig setzen ist etwas performanter
void SetScaleUnit(MapUnit eMap, const Fraction& rFrac);
// Maximale Groesse z.B. fuer Autogrowing-Texte
const Size& GetMaxObjSize() const { return aMaxObjSize; }
void SetMaxObjSize(const Size& rSiz) { aMaxObjSize=rSiz; }
// Damit die View! in der Statuszeile vernuenftige Zahlen anzeigen kann:
// Default ist mm.
void SetUIUnit(FieldUnit eUnit);
FieldUnit GetUIUnit() const { return eUIUnit; }
// Der Masstab der Zeichnung. Default 1/1.
void SetUIScale(const Fraction& rScale);
const Fraction& GetUIScale() const { return aUIScale; }
// Beides gleichzeitig setzen ist etwas performanter
void SetUIUnit(FieldUnit eUnit, const Fraction& rScale);
const Fraction& GetUIUnitFact() const { return aUIUnitFact; }
const String& GetUIUnitStr() const { return aUIUnitStr; }
int GetUIUnitKomma() const { return nUIUnitKomma; }
FASTBOOL IsUIOnlyKomma() const { return bUIOnlyKomma; }
static void TakeUnitStr(FieldUnit eUnit, String& rStr);
void TakeMetricStr(long nVal, String& rStr, FASTBOOL bNoUnitChars=sal_False, sal_Int32 nNumDigits = -1) const;
void TakeWinkStr(long nWink, String& rStr, FASTBOOL bNoDegChar=sal_False) const;
void TakePercentStr(const Fraction& rVal, String& rStr, FASTBOOL bNoPercentChar=sal_False) const;
// RecalcPageNums wird idR. nur von der Page gerufen.
FASTBOOL IsPagNumsDirty() const { return bPagNumsDirty; };
FASTBOOL IsMPgNumsDirty() const { return bMPgNumsDirty; };
void RecalcPageNums(FASTBOOL bMaster);
// Nach dem Insert gehoert die Page dem SdrModel.
virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
virtual void DeletePage(sal_uInt16 nPgNum);
// Remove bedeutet Eigentumsuebereignung an den Aufrufer (Gegenteil von Insert)
virtual SdrPage* RemovePage(sal_uInt16 nPgNum);
virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
const SdrPage* GetPage(sal_uInt16 nPgNum) const;
SdrPage* GetPage(sal_uInt16 nPgNum);
sal_uInt16 GetPageCount() const;
// #109538#
virtual void PageListChanged();
// Masterpages
virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
virtual void DeleteMasterPage(sal_uInt16 nPgNum);
// Remove bedeutet Eigentumsuebereignung an den Aufrufer (Gegenteil von Insert)
virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
virtual void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
const SdrPage* GetMasterPage(sal_uInt16 nPgNum) const;
SdrPage* GetMasterPage(sal_uInt16 nPgNum);
sal_uInt16 GetMasterPageCount() const;
// #109538#
virtual void MasterPageListChanged();
// Modified-Flag. Wird automatisch gesetzt, wenn an den Pages oder
// Zeichenobjekten was geaendert wird. Zuruecksetzen muss man es
// jedoch selbst (z.B. bei Save() ...).
sal_Bool IsChanged() const { return mbChanged; }
virtual void SetChanged(sal_Bool bFlg = sal_True);
// PageNotValid bedeutet, dass das Model lediglich Objekte traegt die zwar
// auf einer Page verankert sind, die Page aber nicht gueltig ist. Diese
// Kennzeichnung wird fuers Clipboard/Drag&Drop benoetigt.
FASTBOOL IsPageNotValid() const { return bPageNotValid; }
void SetPageNotValid(FASTBOOL bJa=sal_True) { bPageNotValid=bJa; }
// Schaltet man dieses Flag auf sal_True, so werden Grafikobjekte
// portabel gespeichert. Es findet dann beim Speichern ggf.
// eine implizite Wandlung von Metafiles statt.
// Default=FALSE. Flag ist nicht persistent.
FASTBOOL IsSavePortable() const { return bSavePortable; }
void SetSavePortable(FASTBOOL bJa=sal_True) { bSavePortable=bJa; }
// Schaltet man dieses Flag auf sal_True, so werden
// Pixelobjekte (stark) komprimiert gespeichert.
// Default=FALSE. Flag ist nicht persistent.
FASTBOOL IsSaveCompressed() const { return bSaveCompressed; }
void SetSaveCompressed(FASTBOOL bJa=sal_True) { bSaveCompressed=bJa; }
// Schaltet man dieses Flag auf sal_True, so werden
// Grafikobjekte mit gesetztem Native-Link
// native gespeichert.
// Default=FALSE. Flag ist nicht persistent.
FASTBOOL IsSaveNative() const { return bSaveNative; }
void SetSaveNative(FASTBOOL bJa=sal_True) { bSaveNative=bJa; }
// Schaltet man dieses Flag auf sal_True, so werden die Grafiken
// von Grafikobjekten:
// - beim Laden eines Dokuments nicht sofort mitgeladen,
// sondern erst wenn sie gebraucht (z.B. angezeigt) werden.
// - ggf. wieder aus dem Speicher geworfen, falls Sie gerade
// nicht benoetigt werden.
// Damit das funktioniert, muss die virtuelle Methode
// GetDocumentStream() ueberladen werden.
// Default=FALSE. Flag ist nicht persistent.
FASTBOOL IsSwapGraphics() const { return bSwapGraphics; }
void SetSwapGraphics(FASTBOOL bJa=sal_True);
void SetSwapGraphicsMode(sal_uIntPtr nMode) { nSwapGraphicsMode = nMode; }
sal_uIntPtr GetSwapGraphicsMode() const { return nSwapGraphicsMode; }
FASTBOOL IsSaveOLEPreview() const { return bSaveOLEPreview; }
void SetSaveOLEPreview( FASTBOOL bSet) { bSaveOLEPreview = bSet; }
// Damit die Bildschirmausgabe von Bitmaps (insbesondere bei gedrehten)
// etwas schneller wird, werden sie gecachet. Diesen Cache kann man mit
// diesem Flag ein-/ausschalten. Beim naechsten Paint wird an den Objekten
// dann ggf. ein Image gemerkt bzw. freigegeben. Wandert ein Bitmapobjekt
// in's Undo, so wird der Cache fuer dieses Objekt sofort ausgeschaltet
// (Speicher sparen).
// Default=Cache eingeschaltet. Flag ist nicht persistent.
FASTBOOL IsBitmapCaching() const { return !bNoBitmapCaching; }
void SetBitmapCaching(FASTBOOL bJa=sal_True) { bNoBitmapCaching=!bJa; }
// Defaultmaessig (sal_False) kann man Textrahmen ohne Fuellung durch
// Mausklick selektieren. Nach Aktivierung dieses Flags trifft man sie
// nur noch in dem Bereich, wo sich auch tatsaechlich Text befindet.
FASTBOOL IsPickThroughTransparentTextFrames() const { return bTransparentTextFrames; }
void SetPickThroughTransparentTextFrames(FASTBOOL bOn) { bTransparentTextFrames=bOn; }
// Darf denn das Model ueberhaupt veraendert werden?
// Wird nur von den Possibility-Methoden der View ausgewerdet.
// Direkte Manipulationen am Model, ... berueksichtigen dieses Flag nicht.
// Sollte ueberladen werden und entsprechend des ReadOnly-Status des Files
// sal_True oder sal_False liefern (Methode wird oeffters gerufen, also ein Flag
// verwenden!).
virtual FASTBOOL IsReadOnly() const;
virtual void SetReadOnly(FASTBOOL bYes);
// Vermischen zweier SdrModel. Zu beachten sei, dass rSourceModel nicht
// const ist. Die Pages werden beim einfuegen nicht kopiert, sondern gemoved.
// rSourceModel ist anschliessend u.U. weitgehend leer.
// nFirstPageNum,nLastPageNum: Die aus rSourceModel zu uebernehmenden Seiten
// nDestPos..................: Einfuegeposition
// bMergeMasterPages.........: sal_True =benoetigte MasterPages werden aus
// rSourceModel ebenfalls uebernommen
// sal_False=Die MasterPageDescriptoren der Seiten
// aus rSourceModel werden auf die
// vorhandenen MasterPages gemappt.
// bUndo.....................: Fuer das Merging wird eine UndoAction generiert.
// Undo ist nur fuer das ZielModel, nicht fuer
// rSourceModel.
// bTreadSourceAsConst.......: sal_True=Das SourceModel wird nicht veraendert,.
// d.h die Seiten werden kopiert.
virtual void Merge(SdrModel& rSourceModel,
sal_uInt16 nFirstPageNum=0, sal_uInt16 nLastPageNum=0xFFFF,
sal_uInt16 nDestPos=0xFFFF,
FASTBOOL bMergeMasterPages=sal_False, FASTBOOL bAllMasterPages=sal_False,
FASTBOOL bUndo=sal_True, FASTBOOL bTreadSourceAsConst=sal_False);
// Ist wie Merge(SourceModel=DestModel,nFirst,nLast,nDest,sal_False,sal_False,bUndo,!bMoveNoCopy);
void CopyPages(sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
sal_uInt16 nDestPos,
FASTBOOL bUndo=sal_True, FASTBOOL bMoveNoCopy=sal_False);
// Mit BegUndo() / EndUndo() ist es moeglich beliebig viele UndoActions
// beliebig tief zu klammern. Als Kommentar der
// UndoAction wird der des ersten BegUndo(String) aller Klammerungen
// verwendet. Der NotifyUndoActionHdl wird in diesem Fall erst beim letzten
// EndUndo() gerufen. Bei einer leeren Klammerung wird keine UndoAction
// generiert.
// Alle direkten Aktionen am SdrModel erzeugen keine UndoActions, die
// Aktionen an der SdrView dagegen generieren solche.
void BegUndo(); // Undo-Klammerung auf
void BegUndo(const String& rComment); // Undo-Klammerung auf
void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE); // Undo-Klammerung auf
void BegUndo(SdrUndoGroup* pUndoGrp); // Undo-Klammerung auf
void EndUndo(); // Undo-Klammerung zu
void AddUndo(SdrUndoAction* pUndo);
sal_uInt16 GetUndoBracketLevel() const { return nUndoLevel; }
const SdrUndoGroup* GetAktUndoGroup() const { return pAktUndoGroup; }
// nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
void SetUndoComment(const String& rComment);
void SetUndoComment(const String& rComment, const String& rObjDescr);
// Das Undo-Managment findet nur statt, wenn kein NotifyUndoAction-Handler
// gesetzt ist.
// Default ist 16. Minimaler MaxUndoActionCount ist 1!
void SetMaxUndoActionCount(sal_uIntPtr nAnz);
sal_uIntPtr GetMaxUndoActionCount() const { return nMaxUndoCount; }
void ClearUndoBuffer();
// UndoAction(0) ist die aktuelle (also die zuletzt eingegangene)
sal_uIntPtr GetUndoActionCount() const { return pUndoStack!=NULL ? pUndoStack->Count() : 0; }
const SfxUndoAction* GetUndoAction(sal_uIntPtr nNum) const { return (SfxUndoAction*)(pUndoStack!=NULL ? pUndoStack->GetObject(nNum) : NULL); }
// RedoAction(0) ist die aktuelle (also die des letzten Undo)
sal_uIntPtr GetRedoActionCount() const { return pRedoStack!=NULL ? pRedoStack->Count() : 0; }
const SfxUndoAction* GetRedoAction(sal_uIntPtr nNum) const { return (SfxUndoAction*)(pRedoStack!=NULL ? pRedoStack->GetObject(nNum) : NULL); }
FASTBOOL Undo();
FASTBOOL Redo();
FASTBOOL Repeat(SfxRepeatTarget&);
// Hier kann die Applikation einen Handler setzen, der die auflaufenden
// UndoActions einsammelt. Der Handler hat folgendes Aussehen:
// void __EXPORT NotifyUndoActionHdl(SfxUndoAction* pUndoAction);
// Beim Aufruf des Handlers findet eine Eigentumsuebereignung statt; die
// UndoAction gehoert somit dem Handler, nicht mehr dem SdrModel.
void SetNotifyUndoActionHdl(const Link& rLink) { aUndoLink=rLink; }
const Link& GetNotifyUndoActionHdl() const { return aUndoLink; }
/** application can set it's own undo manager, BegUndo, EndUndo and AddUndoAction
calls are routet to this interface if given */
void SetSdrUndoManager( SfxUndoManager* pUndoManager );
SfxUndoManager* GetSdrUndoManager() const;
/** applications can set their own undo factory to overide creation of
undo actions. The SdrModel will become owner of the given SdrUndoFactory
and delete it upon its destruction. */
void SetSdrUndoFactory( SdrUndoFactory* pUndoFactory );
/** returns the models undo factory. This must be used to create
undo actions for this model. */
SdrUndoFactory& GetSdrUndoFactory() const;
// Hier kann man einen Handler setzen der beim Streamen mehrfach gerufen
// wird und ungefaehre Auskunft ueber den Fortschreitungszustand der
// Funktion gibt. Der Handler muss folgendes Aussehen haben:
// void __EXPORT class::IOProgressHdl(const sal_uInt16& nPercent);
// Der erste Aufruf des Handlers erfolgt grundsaetzlich mit 0, der letzte
// mit 100. Dazwischen erfolgen maximal 99 Aufrufe mit Werten 1...99.
// Man kann also durchaus bei 0 den Progressbar Initiallisieren und bei
// 100 wieder schliessen. Zu beachten sei, dass der Handler auch gerufen
// wird, wenn die App Draw-Daten im officeweiten Draw-Exchange-Format
// bereitstellt, denn dies geschieht durch streamen in einen MemoryStream.
void SetIOProgressHdl(const Link& rLink) { aIOProgressLink=rLink; }
const Link& GetIOProgressHdl() const { return aIOProgressLink; }
// Zugriffsmethoden fuer Paletten, Listen und Tabellen
void SetColorTableAtSdrModel(XColorListSharedPtr aTable);
XColorListSharedPtr GetColorTableFromSdrModel() const;
void SetDashListAtSdrModel(XDashListSharedPtr aList);
XDashListSharedPtr GetDashListFromSdrModel() const;
void SetLineEndListAtSdrModel(XLineEndListSharedPtr aList);
XLineEndListSharedPtr GetLineEndListFromSdrModel() const;
void SetHatchListAtSdrModel(XHatchListSharedPtr aList);
XHatchListSharedPtr GetHatchListFromSdrModel() const;
void SetGradientListAtSdrModel(XGradientListSharedPtr aList);
XGradientListSharedPtr GetGradientListFromSdrModel() const;
void SetBitmapListAtSdrModel(XBitmapListSharedPtr aList);
XBitmapListSharedPtr GetBitmapListFromSdrModel() const;
// Der StyleSheetPool wird der DrawingEngine nur bekanntgemacht.
// Zu loeschen hat ihn schliesslich der, der ihn auch konstruiert hat.
SfxStyleSheetBasePool* GetStyleSheetPool() const { return mxStyleSheetPool.get(); }
void SetStyleSheetPool(SfxStyleSheetBasePool* pPool) { mxStyleSheetPool=pPool; }
// Diese Methode fuert einen Konsistenzcheck auf die Struktur des Models
// durch. Geprueft wird insbesondere die Verkettung von Verschachtelten
// Gruppenobjekten, aber auch Stati wie bInserted sowie Model* und Page*
// der Objects, SubLists und Pages. Bei korrekter Struktur liefert die
// Methode sal_True, andernfalls FALSE.
// Dieser Check steht nur zur Verfuegung, wenn die Engine mit DBG_UTIL
// uebersetzt wurde. Andernfalls liefert die Methode immer TRUE. (ni)
FASTBOOL CheckConsistence() const;
void SetStarDrawPreviewMode(sal_Bool bPreview);
sal_Bool IsStarDrawPreviewMode() { return bStarDrawPreviewMode; }
bool GetDisableTextEditUsesCommonUndoManager() const { return mbDisableTextEditUsesCommonUndoManager; }
void SetDisableTextEditUsesCommonUndoManager(bool bNew) { mbDisableTextEditUsesCommonUndoManager = bNew; }
SotStorage* GetModelStorage() const { return pModelStorage; }
void SetModelStorage( SotStorage* pStor ) { pModelStorage = pStor; }
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoModel();
void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel );
// these functions are used by the api to disable repaints during a
// set of api calls.
sal_Bool isLocked() const { return (sal_Bool)mbModelLocked; }
void setLock( sal_Bool bLock );
void SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars );
vos::ORef<SvxForbiddenCharactersTable> GetForbiddenCharsTable() const;
void SetCharCompressType( sal_uInt16 nType );
sal_uInt16 GetCharCompressType() const { return mnCharCompressType; }
void SetKernAsianPunctuation( sal_Bool bEnabled );
sal_Bool IsKernAsianPunctuation() const { return (sal_Bool)mbKernAsianPunctuation; }
void SetAddExtLeading( sal_Bool bEnabled );
sal_Bool IsAddExtLeading() const { return (sal_Bool)mbAddExtLeading; }
void ReformatAllTextObjects();
FASTBOOL HasTransparentObjects( sal_Bool bCheckForAlphaChannel = sal_False ) const;
SdrOutliner* createOutliner( sal_uInt16 nOutlinerMode );
void disposeOutliner( SdrOutliner* pOutliner );
sal_Bool IsWriter() const { return !bMyPool; }
/** returns the numbering type that is used to format page fields in drawing shapes */
virtual SvxNumType GetPageNumType() const;
/** copies the items from the source set to the destination set. Both sets must have
same ranges but can have different pools. If pNewModel is optional. If it is null,
this model is used. */
void MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel* pNewModel );
bool IsInDestruction() const;
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelImplementationId();
virtual ImageMap* GetImageMapForObject(SdrObject*){return NULL;};
virtual sal_Int32 GetHyperlinkCount(SdrObject*){return 0;}
/** enables (true) or disables (false) recording of undo actions
If undo actions are added while undo is disabled, they are deleted.
Disabling undo does not clear the current undo buffer! */
void EnableUndo( bool bEnable );
/** returns true if undo is currently enabled
This returns false if undo was disabled using EnableUndo( false ) and
also during the runtime of the Undo() and Redo() methods. */
bool IsUndoEnabled() const;
};
typedef tools::WeakReference< SdrModel > SdrModelWeakRef;
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif //_SVDMODEL_HXX
/* /////////////////////////////////////////////////////////////////////////////////////////////////
+-----------+
| SdrModel |
+--+------+-+
| +-----------+
+----+-----+ |
| ... | |
+----+---+ +----+---+ +-----+--------+
|SdrPage | |SdrPage | |SdrLayerAdmin |
+---+----+ +-+--+--++ +---+-------+--+
| | | | | +-------------------+
+----+----+ +-----+-----+ +-------+-------+
| ... | | ... | | ... |
+---+---+ +---+---+ +----+----+ +----+----+ +-----+------+ +------+-----+
|SdrObj | |SdrObj | |SdrLayer | |SdrLayer | |SdrLayerSet | |SdrLayerSet |
+-------+ +-------+ +---------+ +---------+ +------------+ +------------+
Die Klasse SdrModel ist der Kopf des Datenmodells der StarView Drawing-Engine.
///////////////////////////////////////////////////////////////////////////////////////////////// */
| 47.495449 | 144 | 0.695543 | Grosskopf |
5228253d064f2db22c65931c585f39df2fff05e2 | 4,509 | cpp | C++ | src/libmeasurement_kit/ooni/http_invalid_request_line.cpp | measurement-kit/debian-packaging | ed8b0575d8b487c8981c37cc790449b034028894 | [
"BSD-2-Clause"
] | null | null | null | src/libmeasurement_kit/ooni/http_invalid_request_line.cpp | measurement-kit/debian-packaging | ed8b0575d8b487c8981c37cc790449b034028894 | [
"BSD-2-Clause"
] | null | null | null | src/libmeasurement_kit/ooni/http_invalid_request_line.cpp | measurement-kit/debian-packaging | ed8b0575d8b487c8981c37cc790449b034028894 | [
"BSD-2-Clause"
] | null | null | null | // Part of measurement-kit <https://measurement-kit.github.io/>.
// Measurement-kit is free software. See AUTHORS and LICENSE for more
// information on the copying conditions.
#include "../common/utils.hpp"
#include <measurement_kit/ooni.hpp>
namespace mk {
namespace ooni {
static const int timeout = 5;
static void send_receive_invalid_request_line(Var<report::Entry> entry,
http::Url backend_url,
std::string request_line,
Callback<> cb, Settings settings,
Var<Reactor> reactor,
Var<Logger> logger) {
settings["host"] = backend_url.address;
settings["port"] = backend_url.port;
templates::tcp_connect(settings, [=](Error err, Var<net::Transport> txp) {
if (err) {
logger->debug("http_invalid_request_line: error connecting");
cb();
return;
}
Var<std::string> received_data(new std::string);
txp->on_data([=](net::Buffer data) {
logger->debug("http_invalid_request_line: on_data");
*received_data += data.read();
logger->debug("%s", received_data->c_str());
});
txp->write(request_line);
// We assume to have received all the data after a timeout
// of 5 seconds.
reactor->call_later(timeout, [=]() {
if (*received_data != request_line) {
logger->info("Tampering detected!");
logger->info("%s != %s", received_data->c_str(),
request_line.c_str());
(*entry)["tampering"] = true;
} else if ((*entry)["tampering"] == nullptr) {
logger->info("Tampering not detected.");
(*entry)["tampering"] = false;
}
(*entry)["sent"].push_back(request_line);
(*entry)["received"].push_back(*received_data);
txp->close([=]() { cb(); });
});
}, reactor, logger);
}
void http_invalid_request_line(Settings options,
Callback<Var<report::Entry>> cb,
Var<Reactor> reactor, Var<Logger> logger) {
Var<report::Entry> entry(new report::Entry);
(*entry)["tampering"] = nullptr;
(*entry)["received"] = report::Entry::array();
(*entry)["sent"] = report::Entry::array();
Var<int> tests_run(new int(0));
ErrorOr<http::Url> backend_url =
mk::http::parse_url_noexcept(options["backend"]);
if (!backend_url) {
logger->debug("Invalid backend url.");
cb(entry);
return;
}
auto handle_response = [=]() {
*tests_run += 1;
if (*tests_run == 4) {
cb(entry);
}
};
// test_random_invalid_method
// randomSTR(4) + " / HTTP/1.1\n\r"
std::string test_random_invalid_method(mk::random_str_uppercase(4));
test_random_invalid_method += " / HTTP/1.1\n\r";
send_receive_invalid_request_line(
entry, *backend_url, test_random_invalid_method, handle_response,
options, reactor, logger);
// test_random_invalid_field_count
// ' '.join(randomStr(5) for x in range(4)) + '\n\r'
std::string test_random_invalid_field_count(mk::random_str_uppercase(5));
for (int i = 0; i < 3; i++) {
test_random_invalid_field_count += " " + mk::random_str_uppercase(5);
}
test_random_invalid_field_count += "\n\r";
send_receive_invalid_request_line(
entry, *backend_url, test_random_invalid_field_count, handle_response,
options, reactor, logger);
// test_random_big_request_method
// randomStr(1024) + ' / HTTP/1.1\n\r'
std::string test_random_big_request_method(mk::random_str_uppercase(1024));
test_random_big_request_method += " / HTTP/1.1\n\r";
send_receive_invalid_request_line(
entry, *backend_url, test_random_big_request_method, handle_response,
options, reactor, logger);
// test_random_invalid_version_number
// 'GET / HTTP/' + randomStr(3)
std::string test_random_invalid_version_number("GET / HTTP/");
test_random_invalid_version_number += mk::random_str_uppercase(3);
send_receive_invalid_request_line(
entry, *backend_url, test_random_invalid_version_number,
handle_response, options, reactor, logger);
}
} // namespace ooni
} // namespace mk
| 38.538462 | 79 | 0.586605 | measurement-kit |
52285d7a96eb64f3068aa46586cd7e88c7aae12b | 1,347 | hpp | C++ | boost/network/uri/uri_concept.hpp | mclow/cpp-netlib | 12c62f7402c585b0619412704db7a3e7280b960c | [
"BSL-1.0"
] | 1 | 2019-06-19T13:42:33.000Z | 2019-06-19T13:42:33.000Z | boost/network/uri/uri_concept.hpp | mclow/cpp-netlib | 12c62f7402c585b0619412704db7a3e7280b960c | [
"BSL-1.0"
] | null | null | null | boost/network/uri/uri_concept.hpp | mclow/cpp-netlib | 12c62f7402c585b0619412704db7a3e7280b960c | [
"BSL-1.0"
] | null | null | null | #ifndef BOOST_NETWORK_URL_URL_CONCEPT_HPP_
#define BOOST_NETWORK_URL_URL_CONCEPT_HPP_
// Copyright 2009 Dean Michael Berris, Jeroen Habraken.
// 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/concept_check.hpp>
namespace boost { namespace network { namespace uri {
template <class U>
struct URI : DefaultConstructible<U>, EqualityComparable<U> {
typedef typename U::string_type string_type;
BOOST_CONCEPT_USAGE(URI)
{
U uri_(uri); // copy constructable
U temp;
swap(temp, uri_); // swappable
string_type scheme_ = scheme(uri); // support functions
string_type user_info_ = user_info(uri);
string_type host_ = host(uri);
uint16_t port_ = port(uri);
port_ = 0;
string_type path_ = path(uri);
string_type query_ = query(uri);
string_type fragment_ = fragment(uri);
bool valid_ = valid(uri);
valid_ = false;
}
private:
U uri;
};
} // namespace uri
} // namespace network
} // namespace boost
#endif
| 27.489796 | 71 | 0.576837 | mclow |
522896c791d85e9a04432d5560ae9b9fe1f5ae0e | 4,063 | cpp | C++ | .emacs.d/cedet/semantic/tests/testsubclass.cpp | littletwolee/emacs-configure | 6fe0f3e99cab1c40de8e32e50740ff5d0d765fa3 | [
"MIT"
] | 6 | 2019-01-06T05:55:47.000Z | 2021-05-28T09:29:58.000Z | .emacs.d/cedet/semantic/tests/testsubclass.cpp | littletwolee/emacs-configure | 6fe0f3e99cab1c40de8e32e50740ff5d0d765fa3 | [
"MIT"
] | null | null | null | .emacs.d/cedet/semantic/tests/testsubclass.cpp | littletwolee/emacs-configure | 6fe0f3e99cab1c40de8e32e50740ff5d0d765fa3 | [
"MIT"
] | 2 | 2015-12-09T19:06:16.000Z | 2021-12-02T14:41:31.000Z | /* Special test file for Semantic Analyzer and complex C++ inheritance.
*/
//#include <iostream>
#include "testsubclass.hh"
void animal::moose::setFeet(int numfeet) //^1^
{
if (numfeet > 4) {
std::cerr << "Why would a moose have more than 4 feet?" << std::endl;
return;
}
fFeet = numfeet;
}
int animal::moose::getFeet() //^2^
{
return fFeet;
}
void animal::moose::doNothing() //^3^
{
animal::moose foo();
fFeet = N// -15-
; // #15# ( "NAME1" "NAME2" "NAME3" )
}
void deer::moose::setAntlers(bool have_antlers) //^4^
{
fAntlers = have_antlers;
}
bool deer::moose::getAntlers() //^5^
// %1% ( ( "testsubclass.cpp" "testsubclass.hh" ) ( "deer::moose::doSomething" "deer::moose::getAntlers" "moose" ) )
{
return fAntlers;
}
bool i_dont_have_symrefs()
// %2% ( ("testsubclass.cpp" ) ("i_dont_have_symrefs"))
{
}
void deer::moose::doSomething() //^6^
{
// All these functions should be identified by semantic analyzer.
getAntlers();
setAntlers(true);
getFeet();
setFeet(true);
doNothing();
fSomeField = true;
fIsValid = true;
}
void deer::alces::setLatin(bool l) {
fLatin = l;
}
bool deer::alces::getLatin() {
return fLatin;
}
void deer::alces::doLatinStuff(moose moosein) {
// All these functions should be identified by semantic analyzer.
getFeet();
setFeet(true);
getLatin();
setLatin(true);
doNothing();
deer::moose foo();
}
moose deer::alces::createMoose()
{
moose MooseVariableName;
bool tmp;
int itmp;
bool fool;
int fast;
MooseVariableName = createMoose();
doLatinStuff(MooseVariableName);
tmp = this.f// -1-
// #1# ( "fAlcesBool" "fIsValid" "fLatin" )
;
itmp = this.f// -2-
// #2# ( "fAlcesInt" "fGreek" "fIsProtectedInt" )
;
tmp = f// -3-
// #3# ( "fAlcesBool" "fIsValid" "fLatin" "fool" )
;
itmp = f// -4-
// #4# ( "fAlcesInt" "fGreek" "fIsProtectedInt" "fast" )
;
MooseVariableName = m// -5-
// #5# ( "moose" )
return MooseVariableName;
}
/** Test Scope Changes
*
* This function is rigged to make sure the scope changes to account
* for different locations in local variable parsing.
*/
int someFunction(int mPickle)
{
moose mMoose = deer::alces::createMoose();
if (mPickle == 1) {
int mOption1 = 2;
m// -5-
// #5# ( "mMoose" "mOption1" "mPickle" )
;
} else {
int mOption2 = 2;
m// -6-
// #6# ( "mMoose" "mOption2" "mPickle" )
;
}
}
// Thanks Ming-Wei Chang for this next example.
namespace pub_priv {
class A{
private:
void private_a(){}
public:
void public_a();
};
void A::public_a() {
A other_a;
other_a.p// -7-
// #7# ( "private_a" "public_a" )
;
}
int some_regular_function(){
A a;
a.p// -8-
// #8# ( "public_a" )
;
return 0;
}
}
/** Test Scope w/in a function (non-method) with classes using
* different levels of inheritance.
*/
int otherFunction()
{
sneaky::antelope Antelope(1);
sneaky::jackalope Jackalope(1);
sneaky::bugalope Bugalope(1);
Antelope.// -9-
// #9# ( "fAntyPublic" "fQuadPublic" "testAccess")
;
Jackalope.// -10-
// #10# ( "fBunnyPublic" "testAccess")
;
Jackalope// @1@ 6
;
Jackalope;
Jackalope;
Jackalope;
Bugalope.// -11-
// #11# ( "fBugPublic" "testAccess")
;
Bugalope// @2@ 3
;
}
/** Test methods within each class for types of access to the baseclass.
*/
bool sneaky::antelope::testAccess() //^7^
{
this.// -12-
// #12# ( "fAntyPrivate" "fAntyProtected" "fAntyPublic" "fQuadProtected" "fQuadPublic" "testAccess" )
;
}
bool sneaky::jackalope::testAccess() //^8^
{
this.// -13-
// #13# ( "fBunnyPrivate" "fBunnyProtected" "fBunnyPublic" "fQuadProtected" "fQuadPublic" "testAccess" )
;
}
bool sneaky::bugalope::testAccess() //^9^
{
this.// -14-
// #14# ( "fBugPrivate" "fBugProtected" "fBugPublic" "fQuadPublic" "testAccess" )
;
}
namespace deer {
moose::moose() : fAntlers(false) //^10^
{
}
moose::~moose() //^11^
{
}
}
| 16.789256 | 116 | 0.592912 | littletwolee |
522b43b15778403761c0c07aa93e0696ad7de1f8 | 8,293 | cpp | C++ | ADApp/pluginSrc/NDPluginScatter.cpp | pheest/ADCore | 66b1352efe93c28b48bce37249f19db40181692a | [
"MIT"
] | 20 | 2015-01-07T09:02:42.000Z | 2021-07-27T14:35:19.000Z | ADApp/pluginSrc/NDPluginScatter.cpp | pheest/ADCore | 66b1352efe93c28b48bce37249f19db40181692a | [
"MIT"
] | 400 | 2015-01-06T14:44:30.000Z | 2022-02-07T17:45:32.000Z | ADApp/pluginSrc/NDPluginScatter.cpp | pheest/ADCore | 66b1352efe93c28b48bce37249f19db40181692a | [
"MIT"
] | 72 | 2015-01-23T23:23:02.000Z | 2022-02-07T15:14:35.000Z | /*
* NDPluginScatter.cpp
*
* Do callback only to next registered client, not to all clients
* Author: Mark Rivers
*
* March 2014.
*/
#include <stdlib.h>
#include <iocsh.h>
#include "NDPluginScatter.h"
#include <epicsExport.h>
static const char *driverName="NDPluginScatter";
/**
* \param[in] pArray The NDArray from the callback.
*/
void NDPluginScatter::processCallbacks(NDArray *pArray)
{
/*
* This function is called with the mutex already locked. It unlocks it during long calculations when private
* structures don't need to be protected.
*/
int arrayCallbacks;
static const char *functionName = "NDPluginScatter::processCallbacks";
/* Call the base class method */
NDPluginDriver::beginProcessCallbacks(pArray);
getIntegerParam(NDArrayCallbacks, &arrayCallbacks);
if (arrayCallbacks == 1) {
NDArray *pArrayOut = this->pNDArrayPool->copy(pArray, NULL, 1);
if (NULL != pArrayOut) {
this->getAttributes(pArrayOut->pAttributeList);
this->unlock();
doNDArrayCallbacks(pArrayOut, NDArrayData, 0);
this->lock();
if (this->pArrays[0]) this->pArrays[0]->release();
this->pArrays[0] = pArrayOut;
}
else {
asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR,
"%s::%s: Couldn't allocate output array. Further processing terminated.\n",
driverName, functionName);
}
}
}
/** Called by driver to do the callbacks to the next registered client on the asynGenericPointer interface.
* \param[in] pArray Pointer to the NDArray
* \param[in] reason A client will be called if reason matches pasynUser->reason registered for that client.
* \param[in] address A client will be called if address matches the address registered for that client. */
asynStatus NDPluginScatter::doNDArrayCallbacks(NDArray *pArray, int reason, int address)
{
ELLLIST *pclientList;
interruptNode *pnode;
int addr;
int numNodes;
int i;
//static const char *functionName = "doNDArrayCallbacks";
pasynManager->interruptStart(this->asynStdInterfaces.genericPointerInterruptPvt, &pclientList);
numNodes = ellCount(pclientList);
for (i=0; i<numNodes; i++) {
if (nextClient_ > numNodes) nextClient_ = 1;
pnode = (interruptNode *)ellNth(pclientList, nextClient_);
nextClient_++;
asynGenericPointerInterrupt *pInterrupt = (asynGenericPointerInterrupt *)pnode->drvPvt;
pasynManager->getAddr(pInterrupt->pasynUser, &addr);
/* If this is not a multi-device then address is -1, change to 0 */
if (addr == -1) addr = 0;
if ((pInterrupt->pasynUser->reason != reason) || (address != addr)) continue;
/* Set pasynUser->auxStatus to asynOverflow.
* This is a flag that means return without generating an error if the queue is full.
* We don't set this for the last node because if the last node cannot queue the array
* then the array will be dropped */
pInterrupt->pasynUser->auxStatus = asynOverflow;
if (i == numNodes-1) pInterrupt->pasynUser->auxStatus = asynSuccess;
pInterrupt->callback(pInterrupt->userPvt, pInterrupt->pasynUser, pArray);
if (pInterrupt->pasynUser->auxStatus == asynSuccess) break;
}
pasynManager->interruptEnd(this->asynStdInterfaces.genericPointerInterruptPvt);
return asynSuccess;
}
/** Constructor for NDPluginScatter; most parameters are simply passed to NDPluginDriver::NDPluginDriver.
*
* \param[in] portName The name of the asyn port driver to be created.
* \param[in] queueSize The number of NDArrays that the input queue for this plugin can hold when
* NDPluginDriverBlockingCallbacks=0. Larger queues can decrease the number of dropped arrays,
* at the expense of more NDArray buffers being allocated from the underlying driver's NDArrayPool.
* \param[in] blockingCallbacks Initial setting for the NDPluginDriverBlockingCallbacks flag.
* 0=callbacks are queued and executed by the callback thread; 1 callbacks execute in the thread
* of the driver doing the callbacks.
* \param[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
* \param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
* \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is
* allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
* \param[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is
* allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
* \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
* \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
*/
NDPluginScatter::NDPluginScatter(const char *portName, int queueSize, int blockingCallbacks,
const char *NDArrayPort, int NDArrayAddr,
int maxBuffers, size_t maxMemory,
int priority, int stackSize)
/* Invoke the base class constructor */
: NDPluginDriver(portName, queueSize, blockingCallbacks,
NDArrayPort, NDArrayAddr, 1, maxBuffers, maxMemory,
asynInt32ArrayMask | asynFloat64Mask | asynFloat64ArrayMask | asynGenericPointerMask,
asynInt32ArrayMask | asynFloat64Mask | asynFloat64ArrayMask | asynGenericPointerMask,
ASYN_MULTIDEVICE, 1, priority, stackSize, 1),
nextClient_(1)
{
//static const char *functionName = "NDPluginScatter::NDPluginScatter";
createParam(NDPluginScatterMethodString, asynParamInt32, &NDPluginScatterMethod);
/* Set the plugin type string */
setStringParam(NDPluginDriverPluginType, "NDPluginScatter");
/* Try to connect to the array port */
connectToArrayPort();
}
/** Configuration command */
extern "C" int NDScatterConfigure(const char *portName, int queueSize, int blockingCallbacks,
const char *NDArrayPort, int NDArrayAddr,
int maxBuffers, size_t maxMemory,
int priority, int stackSize)
{
NDPluginScatter *pPlugin = new NDPluginScatter(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr,
maxBuffers, maxMemory, priority, stackSize);
return pPlugin->start();
}
/* EPICS iocsh shell commands */
static const iocshArg initArg0 = { "portName",iocshArgString};
static const iocshArg initArg1 = { "frame queue size",iocshArgInt};
static const iocshArg initArg2 = { "blocking callbacks",iocshArgInt};
static const iocshArg initArg3 = { "NDArrayPort",iocshArgString};
static const iocshArg initArg4 = { "NDArrayAddr",iocshArgInt};
static const iocshArg initArg5 = { "maxBuffers",iocshArgInt};
static const iocshArg initArg6 = { "maxMemory",iocshArgInt};
static const iocshArg initArg7 = { "priority",iocshArgInt};
static const iocshArg initArg8 = { "stackSize",iocshArgInt};
static const iocshArg * const initArgs[] = {&initArg0,
&initArg1,
&initArg2,
&initArg3,
&initArg4,
&initArg5,
&initArg6,
&initArg7,
&initArg8};
static const iocshFuncDef initFuncDef = {"NDScatterConfigure",9,initArgs};
static void initCallFunc(const iocshArgBuf *args)
{
NDScatterConfigure(args[0].sval, args[1].ival, args[2].ival,
args[3].sval, args[4].ival, args[5].ival,
args[6].ival, args[7].ival, args[8].ival);
}
extern "C" void NDScatterRegister(void)
{
iocshRegister(&initFuncDef,initCallFunc);
}
extern "C" {
epicsExportRegistrar(NDScatterRegister);
}
| 46.072222 | 116 | 0.654769 | pheest |
522c5313aada0e5bea3ce2c4fa782c8bd7db5521 | 292 | cpp | C++ | c++11/understanding-cpp11/chapter4/4-2-7.cpp | cuiwm/choe_lib | 6992c7bf551e7d6d633399b21b028e6873d5e6e8 | [
"MIT"
] | null | null | null | c++11/understanding-cpp11/chapter4/4-2-7.cpp | cuiwm/choe_lib | 6992c7bf551e7d6d633399b21b028e6873d5e6e8 | [
"MIT"
] | null | null | null | c++11/understanding-cpp11/chapter4/4-2-7.cpp | cuiwm/choe_lib | 6992c7bf551e7d6d633399b21b028e6873d5e6e8 | [
"MIT"
] | null | null | null | template<typename T1, typename T2>
double Sum(T1 & t1, T2 & t2) {
auto s = t1 + t2; // s的类型会在模板实例化时被推导出来
return s;
}
int main() {
int a = 3;
long b = 5;
float c = 1.0f, d = 2.3f;
auto e = Sum(a, b); // s的类型被推导为long
auto f = Sum(c, d); // s的类型被推导为float
}
| 19.466667 | 44 | 0.527397 | cuiwm |
522eb8453a31b7dcbe8a86ca576f39f829689c26 | 2,112 | cpp | C++ | Algorithms/Implementation/Sequence Equation/solution.cpp | kitarp29/ds-algo-solutions | c06effdaec2ff014248ca399268934cd8a639b5a | [
"MIT"
] | 48 | 2020-12-04T17:48:47.000Z | 2022-02-26T17:56:52.000Z | Algorithms/Implementation/Sequence Equation/solution.cpp | kitarp29/ds-algo-solutions | c06effdaec2ff014248ca399268934cd8a639b5a | [
"MIT"
] | 465 | 2020-12-04T02:12:56.000Z | 2021-12-07T16:09:51.000Z | Algorithms/Implementation/Sequence Equation/solution.cpp | kitarp29/ds-algo-solutions | c06effdaec2ff014248ca399268934cd8a639b5a | [
"MIT"
] | 199 | 2020-12-04T02:39:56.000Z | 2021-12-07T10:10:50.000Z | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
// Implementation Part
vector<int> permutationEquation(vector<int> p) {
// decreasing value by 1 for element of vector p
vector<int> result;
for(int i = 0;i < p.size();i++)
p[i]--;
// then matching for p(p(x)) = y using two loops
// first for x and second for y
// as we have started from index 0, then we push index
// after increment by it 1
for(int i = 0; i < p.size(); i++) {
for (int j = 0; j < p.size(); j++) {
if (p[p[j]] == i) {
result.push_back(j+1);
break;
}
}
}
return result;
}
int main()
{
ofstream fout(getenv("OUTPUT_PATH"));
int n;
cin >> n;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
string p_temp_temp;
getline(cin, p_temp_temp);
vector<string> p_temp = split_string(p_temp_temp);
vector<int> p(n);
for (int i = 0; i < n; i++) {
int p_item = stoi(p_temp[i]);
p[i] = p_item;
}
vector<int> result = permutationEquation(p);
for (int i = 0; i < result.size(); i++) {
fout << result[i];
if (i != result.size() - 1) {
fout << "\n";
}
}
fout << "\n";
fout.close();
return 0;
}
vector<string> split_string(string input_string) {
string::iterator new_end = unique(input_string.begin(), input_string.end(), [] (const char &x, const char &y) {
return x == y and x == ' ';
});
input_string.erase(new_end, input_string.end());
while (input_string[input_string.length() - 1] == ' ') {
input_string.pop_back();
}
vector<string> splits;
char delimiter = ' ';
size_t i = 0;
size_t pos = input_string.find(delimiter);
while (pos != string::npos) {
splits.push_back(input_string.substr(i, pos - i));
i = pos + 1;
pos = input_string.find(delimiter, i);
}
splits.push_back(input_string.substr(i, min(pos, input_string.length()) - i + 1));
return splits;
}
| 21.773196 | 115 | 0.544508 | kitarp29 |
52350d14d43a3e383034075d0bc251212dba4bc7 | 3,632 | cpp | C++ | Source/Renderer/Deferred/DeferredFrameBuffer.cpp | pgrabas/MoonGlare | 25807680700697023d04830402af168f624ffb35 | [
"MIT"
] | 1 | 2018-03-18T16:29:16.000Z | 2018-03-18T16:29:16.000Z | Source/Renderer/Deferred/DeferredFrameBuffer.cpp | pgrabas/MoonGlare | 25807680700697023d04830402af168f624ffb35 | [
"MIT"
] | null | null | null | Source/Renderer/Deferred/DeferredFrameBuffer.cpp | pgrabas/MoonGlare | 25807680700697023d04830402af168f624ffb35 | [
"MIT"
] | null | null | null | #include "DeferredFrameBuffer.h"
namespace MoonGlare::Renderer::Deferred {
DeferredFrameBuffer::DeferredFrameBuffer() {
memset(m_Textures, 0, sizeof(m_Textures));
}
DeferredFrameBuffer::~DeferredFrameBuffer() {
Free();
}
void DeferredFrameBuffer::Free() {
FreeFrameBuffer();
if (m_Textures[0]) {
glDeleteTextures(Buffers::MaxValue, m_Textures);
}
if (m_DepthTexture) {
glDeleteTextures(1, &m_DepthTexture);
}
//if (m_FinalTexture) {
// glDeleteTextures(1, &m_FinalTexture);
//}
}
bool DeferredFrameBuffer::FreeFrameBuffer() {
if (m_FrameBuffer != 0)
glDeleteFramebuffers(1, &m_FrameBuffer);
m_FrameBuffer = 0;
return true;
}
bool DeferredFrameBuffer::NewFrameBuffer() {
if (m_FrameBuffer)
FreeFrameBuffer();
glGenFramebuffers(1, &m_FrameBuffer);
Bind();
return true;
}
bool DeferredFrameBuffer::FinishFrameBuffer() {
GLenum Status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (Status != GL_FRAMEBUFFER_COMPLETE) {
AddLogf(Error, "FB error, status: 0x%x\n", Status);
return false;
}
return true;
}
void DeferredFrameBuffer::BeginFrame() {
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FrameBuffer);
glDrawBuffer(GL_COLOR_ATTACHMENT4);
glClear(GL_COLOR_BUFFER_BIT);
}
void DeferredFrameBuffer::BeginGeometryPass() {
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FrameBuffer);
static const GLenum DrawBuffers[] = {
GL_COLOR_ATTACHMENT0,
GL_COLOR_ATTACHMENT1,
GL_COLOR_ATTACHMENT2,
GL_COLOR_ATTACHMENT3,
};
glDrawBuffers(4, DrawBuffers);
}
void DeferredFrameBuffer::BeginLightingPass() {
glDrawBuffer(GL_COLOR_ATTACHMENT4);
for (unsigned int i = 0; i < Buffers::MaxValue; i++) {
glActiveTexture(GL_TEXTURE0 + i);
glBindTexture(GL_TEXTURE_2D, m_Textures[i]);
}
}
void DeferredFrameBuffer::BeginFinalPass() {
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_FrameBuffer);
glReadBuffer(GL_COLOR_ATTACHMENT4);
}
bool DeferredFrameBuffer::Reset(const emath::fvec2 &ScreenSize) {
Free();
NewFrameBuffer();
auto s = ScreenSize;
glGenTextures(Buffers::MaxValue, m_Textures);
glGenTextures(1, &m_DepthTexture);
//glGenTextures(1, &m_FinalTexture);
for (unsigned int i = 0; i < Buffers::MaxValue; i++) {
glBindTexture(GL_TEXTURE_2D, m_Textures[i]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, (GLsizei)s[0], (GLsizei)s[1], 0, GL_RGBA, GL_FLOAT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, m_Textures[i], 0);
}
// depth
glBindTexture(GL_TEXTURE_2D, m_DepthTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH32F_STENCIL8, (GLsizei)s[0], (GLsizei)s[1], 0, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, NULL);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_DepthTexture, 0);
//final
//glBindTexture(GL_TEXTURE_2D, m_FinalTexture);
//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)s[0], (GLsizei)s[1], 0, GL_RGBA, GL_FLOAT, NULL);
//glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + Buffers::MaxValue, GL_TEXTURE_2D, m_FinalTexture, 0);
FinishFrameBuffer();
UnBind();
return true;
}
}
| 30.779661 | 149 | 0.686123 | pgrabas |
5235415c3ea86dad482acefe69a4e828025357a0 | 8,839 | cc | C++ | content/browser/service_worker/service_worker_register_job.cc | Acidburn0zzz/chromium-1 | 4c08f442d2588a2c7cfaa117a55bd87d2ac32f9a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | content/browser/service_worker/service_worker_register_job.cc | Acidburn0zzz/chromium-1 | 4c08f442d2588a2c7cfaa117a55bd87d2ac32f9a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | content/browser/service_worker/service_worker_register_job.cc | Acidburn0zzz/chromium-1 | 4c08f442d2588a2c7cfaa117a55bd87d2ac32f9a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/service_worker/service_worker_register_job.h"
#include <vector>
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_job_coordinator.h"
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/browser/service_worker/service_worker_storage.h"
namespace content {
typedef ServiceWorkerRegisterJobBase::RegistrationJobType RegistrationJobType;
ServiceWorkerRegisterJob::ServiceWorkerRegisterJob(
base::WeakPtr<ServiceWorkerContextCore> context,
const GURL& pattern,
const GURL& script_url)
: context_(context),
pattern_(pattern),
script_url_(script_url),
weak_factory_(this) {}
ServiceWorkerRegisterJob::~ServiceWorkerRegisterJob() {}
void ServiceWorkerRegisterJob::AddCallback(const RegistrationCallback& callback,
int process_id) {
// If we've created a pending version, associate source_provider it with that,
// otherwise queue it up.
callbacks_.push_back(callback);
DCHECK_NE(-1, process_id);
if (pending_version_) {
pending_version_->AddProcessToWorker(process_id);
} else {
pending_process_ids_.push_back(process_id);
}
}
void ServiceWorkerRegisterJob::Start() {
context_->storage()->FindRegistrationForPattern(
pattern_,
base::Bind(
&ServiceWorkerRegisterJob::HandleExistingRegistrationAndContinue,
weak_factory_.GetWeakPtr()));
}
bool ServiceWorkerRegisterJob::Equals(ServiceWorkerRegisterJobBase* job) {
if (job->GetType() != GetType())
return false;
ServiceWorkerRegisterJob* register_job =
static_cast<ServiceWorkerRegisterJob*>(job);
return register_job->pattern_ == pattern_ &&
register_job->script_url_ == script_url_;
}
RegistrationJobType ServiceWorkerRegisterJob::GetType() {
return REGISTER;
}
// This function corresponds to the steps in Register following
// "Let serviceWorkerRegistration be _GetRegistration(scope)"
// |registration| corresponds to serviceWorkerRegistration.
// Throughout this file, comments in quotes are excerpts from the spec.
void ServiceWorkerRegisterJob::HandleExistingRegistrationAndContinue(
ServiceWorkerStatusCode status,
const scoped_refptr<ServiceWorkerRegistration>& registration) {
// On unexpected error, abort this registration job.
if (status != SERVICE_WORKER_ERROR_NOT_FOUND && status != SERVICE_WORKER_OK) {
Complete(status);
return;
}
// "If serviceWorkerRegistration is not null and script is equal to
// serviceWorkerRegistration.scriptUrl..." resolve with the existing
// registration and abort.
if (registration.get() && registration->script_url() == script_url_) {
registration_ = registration;
// If there's no active version, go ahead to Update (this isn't in the spec
// but seems reasonable, and without SoftUpdate implemented we can never
// Update otherwise).
if (!registration_->active_version()) {
UpdateAndContinue(status);
return;
}
Complete(SERVICE_WORKER_OK);
return;
}
// "If serviceWorkerRegistration is null..." create a new registration.
if (!registration.get()) {
RegisterAndContinue(SERVICE_WORKER_OK);
return;
}
// On script URL mismatch, "set serviceWorkerRegistration.scriptUrl to
// script." We accomplish this by deleting the existing registration and
// registering a new one.
// TODO(falken): Match the spec. We now throw away the active_version_ and
// pending_version_ of the existing registration, which isn't in the spec.
registration->Shutdown();
context_->storage()->DeleteRegistration(
pattern_,
base::Bind(&ServiceWorkerRegisterJob::RegisterAndContinue,
weak_factory_.GetWeakPtr()));
}
// Registers a new ServiceWorkerRegistration.
void ServiceWorkerRegisterJob::RegisterAndContinue(
ServiceWorkerStatusCode status) {
DCHECK(!registration_);
if (status != SERVICE_WORKER_OK) {
// Abort this registration job.
Complete(status);
return;
}
registration_ = new ServiceWorkerRegistration(
pattern_, script_url_, context_->storage()->NewRegistrationId(),
context_);
context_->storage()->StoreRegistration(
registration_.get(),
base::Bind(&ServiceWorkerRegisterJob::UpdateAndContinue,
weak_factory_.GetWeakPtr()));
}
// This function corresponds to the spec's _Update algorithm.
void ServiceWorkerRegisterJob::UpdateAndContinue(
ServiceWorkerStatusCode status) {
DCHECK(registration_);
if (status != SERVICE_WORKER_OK) {
// Abort this registration job.
Complete(status);
return;
}
// TODO: "If serviceWorkerRegistration.pendingWorker is not null..." then
// terminate the pending worker. It doesn't make sense to implement yet since
// we always activate the worker if install completed, so there can be no
// pending worker at this point.
DCHECK(!registration_->pending_version());
// TODO: Script fetching and comparing the old and new script belongs here.
// "Let serviceWorker be a newly-created ServiceWorker object..." and start
// the worker.
pending_version_ = new ServiceWorkerVersion(
registration_, context_->storage()->NewVersionId(), context_);
for (std::vector<int>::const_iterator it = pending_process_ids_.begin();
it != pending_process_ids_.end();
++it)
pending_version_->AddProcessToWorker(*it);
pending_version_->StartWorker(
base::Bind(&ServiceWorkerRegisterJob::OnStartWorkerFinished,
weak_factory_.GetWeakPtr()));
}
void ServiceWorkerRegisterJob::OnStartWorkerFinished(
ServiceWorkerStatusCode status) {
// "If serviceWorker fails to start up..." then reject the promise with an
// error and abort.
if (status != SERVICE_WORKER_OK) {
Complete(status);
return;
}
// "Resolve promise with serviceWorker."
// Although the spec doesn't set pendingWorker until after resolving the
// promise, our system's resolving works by passing ServiceWorkerRegistration
// to the callbacks, so pendingWorker must be set first.
DCHECK(!registration_->pending_version());
registration_->set_pending_version(pending_version_);
RunCallbacks(status);
InstallAndContinue();
}
// This function corresponds to the spec's _Install algorithm.
void ServiceWorkerRegisterJob::InstallAndContinue() {
// "Set serviceWorkerRegistration.pendingWorker._state to installing."
// "Fire install event on the associated ServiceWorkerGlobalScope object."
pending_version_->DispatchInstallEvent(
-1,
base::Bind(&ServiceWorkerRegisterJob::OnInstallFinished,
weak_factory_.GetWeakPtr()));
}
void ServiceWorkerRegisterJob::OnInstallFinished(
ServiceWorkerStatusCode status) {
// "If any handler called waitUntil()..." and the resulting promise
// is rejected, abort.
if (status != SERVICE_WORKER_OK) {
registration_->set_pending_version(NULL);
Complete(status);
return;
}
// TODO: Per spec, only activate if no document is using the registration.
ActivateAndContinue();
}
// This function corresponds to the spec's _Activate algorithm.
void ServiceWorkerRegisterJob::ActivateAndContinue() {
// "Set serviceWorkerRegistration.pendingWorker to null."
registration_->set_pending_version(NULL);
// TODO: Dispatch the activate event.
// TODO(michaeln): Persist the newly ACTIVE version.
pending_version_->SetStatus(ServiceWorkerVersion::ACTIVE);
DCHECK(!registration_->active_version());
registration_->set_active_version(pending_version_);
pending_version_ = NULL;
Complete(SERVICE_WORKER_OK);
}
void ServiceWorkerRegisterJob::Complete(ServiceWorkerStatusCode status) {
RunCallbacks(status);
// If |pending_version_| exists, it was not activated, so we are the sole
// owner of it, so it will be destroyed when this job ends, so Shutdown here.
// We should be able to remove this code later, when something else holds a
// reference to |pending_version_|.
// TODO(kinuko): Fix these ownership and shutdown semantics.
if (pending_version_) {
DCHECK(!registration_->pending_version());
DCHECK(!registration_->active_version());
pending_version_->Shutdown();
}
context_->job_coordinator()->FinishJob(pattern_, this);
}
void ServiceWorkerRegisterJob::RunCallbacks(ServiceWorkerStatusCode status) {
for (std::vector<RegistrationCallback>::iterator it = callbacks_.begin();
it != callbacks_.end();
++it) {
it->Run(status, status == SERVICE_WORKER_OK ? registration_ : NULL);
}
callbacks_.clear();
}
} // namespace content
| 35.930894 | 80 | 0.739111 | Acidburn0zzz |
5235e52e272885ee0b8bb7f2051006ce4ee424bd | 1,260 | cpp | C++ | BITRURQ.cpp | akshay31057/Competitive-Programming-Repository | bb4e61df348803795d0bf24c11000b2e02ab8cda | [
"MIT"
] | 1 | 2020-10-09T15:07:36.000Z | 2020-10-09T15:07:36.000Z | BITRURQ.cpp | akshay31057/Competitive-Programming-Repository | bb4e61df348803795d0bf24c11000b2e02ab8cda | [
"MIT"
] | null | null | null | BITRURQ.cpp | akshay31057/Competitive-Programming-Repository | bb4e61df348803795d0bf24c11000b2e02ab8cda | [
"MIT"
] | 1 | 2018-10-25T15:07:12.000Z | 2018-10-25T15:07:12.000Z | /**
* Description: BIT RURQ (Support range queries and range updates of 1-D array)
* Usage: query O(lg(N)), update O(lg(N))
* Source: https://github.com/dragonslayerx
*/
// Remember to use 1 based indexing
class BIT {
static const int MAX = 100005;
public:
static long long query(long long *bit, int indx)
{
long long sum = 0;
while (indx) {
sum += bit[indx];
indx -= (indx & -indx);
}
return sum;
}
static void update(long long *bit, int indx, long long x)
{
while (indx < MAX) {
bit[indx] += x;
indx += (indx & -indx);
}
}
};
class BitRPRQ {
static const int MAX = 100005;
long long B1[MAX];
long long B2[MAX];
public:
BitRPRQ() {
memset(B1, 0, sizeof(B1));
memset(B2, 0, sizeof(B2));
}
long long Rquery(int p)
{
long long tempB1 = BIT::query(B1, p);
long long tempB2 = BIT::query(B2, p);
long long sum = tempB1 * p + tempB2;
return sum;
}
long long Rupdate(int l, int r, long long v)
{
BIT::update(B1, l, v);
BIT::update(B1, r+1, -v);
BIT::update(B2, l, -((l-1)*v));
BIT::update(B2, r+1, r*v);
}
}; | 22.105263 | 79 | 0.511111 | akshay31057 |