text
stringlengths
5
1.04M
// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Darin Adler 2001 - 2002. // (C) Copyright Peter Dimov 2001. // (C) Copyright Aleksey Gurtovoy 2002. // (C) Copyright David Abrahams 2002 - 2003. // (C) Copyright Beman Dawes 2002 - 2003. // Use, modification and distribution are 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) // See http://www.boost.org for most recent version. // Microsoft Visual C++ compiler setup: #define BOOST_MSVC _MSC_VER // turn off the warnings before we #include anything #pragma warning( disable : 4503 ) // warning: decorated name length exceeded #if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4 # pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS # define BOOST_NO_VOID_RETURNS # define BOOST_NO_EXCEPTION_STD_NAMESPACE // disable min/max macro defines on vc6: // #endif #if (_MSC_VER <= 1300) // 1300 == VC++ 7.0 # if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS # endif # define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS # define BOOST_NO_INCLASS_MEMBER_INITIALIZATION # define BOOST_NO_PRIVATE_IN_AGGREGATE # define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP # define BOOST_NO_INTEGRAL_INT64_T # define BOOST_NO_DEDUCED_TYPENAME # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE // VC++ 6/7 has member templates but they have numerous problems including // cases of silent failure, so for safety we define: # define BOOST_NO_MEMBER_TEMPLATES // For VC++ experts wishing to attempt workarounds, we define: # define BOOST_MSVC6_MEMBER_TEMPLATES # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # define BOOST_NO_CV_VOID_SPECIALIZATIONS # define BOOST_NO_FUNCTION_TEMPLATE_ORDERING # define BOOST_NO_USING_TEMPLATE # define BOOST_NO_SWPRINTF # define BOOST_NO_TEMPLATE_TEMPLATES # define BOOST_NO_SFINAE # define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS # define BOOST_NO_IS_ABSTRACT # define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS // TODO: what version is meant here? Have there really been any fixes in cl 12.01 (as e.g. shipped with eVC4)? # if (_MSC_VER > 1200) # define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS # endif #endif #if _MSC_VER < 1400 // although a conforming signature for swprint exists in VC7.1 // it appears not to actually work: # define BOOST_NO_SWPRINTF #endif #if defined(UNDER_CE) // Windows CE does not have a conforming signature for swprintf # define BOOST_NO_SWPRINTF #endif #if _MSC_VER <= 1400 // 1400 == VC++ 8.0 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS #endif #if _MSC_VER <= 1500 // 1500 == VC++ 9.0 # define BOOST_NO_TWO_PHASE_NAME_LOOKUP #endif #ifndef _NATIVE_WCHAR_T_DEFINED # define BOOST_NO_INTRINSIC_WCHAR_T #endif #if defined(_WIN32_WCE) || defined(UNDER_CE) # define BOOST_NO_THREADEX # define BOOST_NO_GETSYSTEMTIMEASFILETIME # define BOOST_NO_SWPRINTF #endif // // check for exception handling support: #ifndef _CPPUNWIND # define BOOST_NO_EXCEPTIONS #endif // // __int64 support: // #if (_MSC_VER >= 1200) # define BOOST_HAS_MS_INT64 #endif #if (_MSC_VER >= 1310) && defined(_MSC_EXTENSIONS) # define BOOST_HAS_LONG_LONG #endif #if (_MSC_VER >= 1400) && !defined(_DEBUG) # define BOOST_HAS_NRVO #endif // // disable Win32 API's if compiler extentions are // turned off: // #ifndef _MSC_EXTENSIONS # define BOOST_DISABLE_WIN32 #endif // // all versions support __declspec: // #define BOOST_HAS_DECLSPEC // // prefix and suffix headers: // #ifndef BOOST_ABI_PREFIX # define BOOST_ABI_PREFIX "boost/config/abi/msvc_prefix.hpp" #endif #ifndef BOOST_ABI_SUFFIX # define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp" #endif // TODO: // these things are mostly bogus. 1200 means version 12.0 of the compiler. The // artificial versions assigned to them only refer to the versions of some IDE // these compilers have been shipped with, and even that is not all of it. Some // were shipped with freely downloadable SDKs, others as crosscompilers in eVC. // IOW, you can't use these 'versions' in any sensible way. Sorry. # if defined(UNDER_CE) # if _MSC_VER < 1200 // Note: these are so far off, they are not really supported # elif _MSC_VER < 1300 // eVC++ 4 comes with 1200-1202 # define BOOST_COMPILER_VERSION evc4.0 # elif _MSC_VER == 1400 # define BOOST_COMPILER_VERSION evc8 # else # if defined(BOOST_ASSERT_CONFIG) # error "Unknown EVC++ compiler version - please run the configure tests and report the results" # else # pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results") # endif # endif # else # if _MSC_VER < 1200 // Note: these are so far off, they are not really supported # define BOOST_COMPILER_VERSION 5.0 # elif _MSC_VER < 1300 # define BOOST_COMPILER_VERSION 6.0 # elif _MSC_VER == 1300 # define BOOST_COMPILER_VERSION 7.0 # elif _MSC_VER == 1310 # define BOOST_COMPILER_VERSION 7.1 # elif _MSC_VER == 1400 # define BOOST_COMPILER_VERSION 8.0 # elif _MSC_VER == 1500 # define BOOST_COMPILER_VERSION 9.0 # else # define BOOST_COMPILER_VERSION _MSC_VER # endif # endif #define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) // // versions check: // we don't support Visual C++ prior to version 6: #if _MSC_VER < 1200 #error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version is 1400 (VC8): #if (_MSC_VER > 1500) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else # pragma message("Unknown compiler version - please run the configure tests and report the results") # endif #endif
// Copyright 2015, Tobias Hermann and the FunctionalPlus contributors. // https://github.com/Dobiasd/FunctionalPlus // 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) #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include "doctest/doctest.h" #include <fplus/fplus.hpp> namespace { typedef std::vector<int> IntVector; bool is_odd_int(int x) { return (x % 2 == 1); } bool is_even_int(int x) { return (x % 2 == 0); } int times_3(int x) { return 3 * x; } int as_string_length(int i) { return static_cast<int>(std::to_string(i).size()); } const auto times_3_lambda = [](int x){return times_3(x);}; const auto is_odd_int_lambda = [](int x){return is_odd_int(x);}; const auto as_string_length_lambda = [](int x){return as_string_length(x);}; int (*times_3_fn_ptr)(int) = &times_3; struct times_3_struct { int operator() (const int x) { return times_3(x); } static int sttcMemF(int x) { return times_3(x); } }; std::function<int(int)> times_3_std_function = times_3_lambda; } TEST_CASE("fwd_test, apply") { using namespace fplus; const auto result_old_style = sum( transform(as_string_length, drop_if(is_odd_int, transform(times_3, numbers(0, 10))))); const auto result_new_style = fwd::apply( numbers(0, 10) , fwd::transform(times_3) , fwd::drop_if(is_odd_int) , fwd::transform(as_string_length) , fwd::sum()); REQUIRE_EQ(result_old_style, result_new_style); } TEST_CASE("fwd_test, compose") { using namespace fplus; const auto function_chain_old_style = compose( bind_1st_of_2(transform<decltype(times_3), const std::vector<int>&, std::vector<int>>, times_3), bind_1st_of_2(drop_if<decltype(is_odd_int), const std::vector<int>&>, is_odd_int), bind_1st_of_2(transform<decltype(as_string_length_lambda), const std::vector<int>&>, as_string_length_lambda), sum<std::vector<int>>); const auto function_chain_new_style = fwd::compose( fwd::transform(times_3), fwd::drop_if(is_odd_int_lambda), fwd::transform(as_string_length), fwd::sum()); const auto xs = numbers(0, 10); REQUIRE_EQ(function_chain_old_style(xs), function_chain_new_style(xs)); } TEST_CASE("fwd_test, and_then_maybe") { using namespace fplus; const auto sqrtToMaybeInt = [](int x) -> fplus::maybe<int> { return x < 0 ? fplus::nothing<int>() : fplus::just(fplus::round(sqrt(static_cast<float>(x)))); }; REQUIRE_EQ( fwd::apply(just(4) , fwd::and_then_maybe(sqrtToMaybeInt)) , just(2)); } TEST_CASE("fwd_test, fold_left") { using namespace fplus; const auto fold_result_old_style = fold_left(std::plus<int>(), 0, numbers(0, 10)); const auto fold_result_new_style = fwd::apply( numbers(0, 10) , fwd::fold_left(std::plus<int>(), 0)); REQUIRE_EQ(fold_result_old_style, fold_result_new_style); } TEST_CASE("fwd_test, transform_nested") { using namespace fplus; typedef std::vector<int> ints; const std::vector<ints> nested_ints = {{1,2,3},{4,5,6}}; const auto nested_transformed_old_style = transform( bind_1st_of_2(transform<decltype(times_3), const std::vector<int>&, std::vector<int>>, times_3), nested_ints); const auto nested_transformed_new_style = fwd::apply( nested_ints , fwd::transform(fwd::transform(times_3_lambda))); REQUIRE_EQ(nested_transformed_old_style, nested_transformed_new_style); } TEST_CASE("fwd_test, different_function_types_apply") { using namespace fplus; const std::vector<int> xs = {1,2,3}; const auto result = transform(times_3, xs); REQUIRE_EQ(fwd::apply(xs, fwd::transform(times_3)), result); REQUIRE_EQ(fwd::apply(xs, fwd::transform(times_3_lambda)), result); REQUIRE_EQ(fwd::apply(xs, fwd::transform(times_3_std_function)), result); REQUIRE_EQ(fwd::apply(xs, fwd::transform(times_3_fn_ptr)), result); REQUIRE_EQ(fwd::apply(xs, fwd::transform(&times_3_struct::sttcMemF)), result); REQUIRE_EQ(fwd::apply(xs, fwd::transform(times_3_struct())), result); } TEST_CASE("fwd_test, different_function_types_compose") { using namespace fplus; const std::vector<int> xs = {1,2,3}; const auto result = transform(times_3, transform(times_3, xs)); REQUIRE_EQ(fwd::transform(fwd::compose(times_3, times_3))(xs), result); REQUIRE_EQ(fwd::transform(fwd::compose(times_3_lambda, times_3_lambda))(xs), result); REQUIRE_EQ(fwd::transform(fwd::compose(times_3_std_function, times_3_std_function))(xs), result); REQUIRE_EQ(fwd::transform(fwd::compose(&times_3_struct::sttcMemF, &times_3_struct::sttcMemF))(xs), result); REQUIRE_EQ(fwd::transform(fwd::compose(times_3_fn_ptr, times_3_fn_ptr))(xs), result); //const auto times_3_instance = times_3_struct(); //REQUIRE_EQ(fwd::transform(fwd::compose(times_3_instance, times_3_instance))(xs), result); } std::list<int> collatz_seq(int x) { std::list<int> result; while (x > 1) { result.push_back(x); if (x % 2 == 0) x = x / 2; else x = 3 * x + 1; } result.push_back(x); return result; } TEST_CASE("fwd_test, collatz") { using namespace fplus; auto collatz_dict = fwd::apply( fplus::numbers<int>(0, 20) , fwd::create_map_with(fwd::compose( collatz_seq, fwd::show_cont_with(" => "))) ); } TEST_CASE("fwd_test, fwd_flip") { using namespace fplus; std::vector<std::vector<std::size_t>> idxs = {{0,1,2}, {2,0}}; const std::vector<int> xs = {0,10,20}; const std::vector<int> ys = fwd::transform_and_concat(fwd::flip::elems_at_idxs(xs))(idxs); const std::vector<int> result = {0,10,20,20,0}; REQUIRE_EQ(ys, result); } TEST_CASE("fwd_test, keep_if") { const std::vector<int> v = { 1, 2, 3, 2, 4, 5 }; auto result = fplus::fwd::keep_if(is_even_int)(v); REQUIRE_EQ(result, std::vector<int>({2, 2, 4})); } TEST_CASE("fwd_test, keep_if_r_value") { auto result = fplus::fwd::keep_if(is_even_int)(std::vector<int>({1,2,3,2,4,5})); REQUIRE_EQ(result, std::vector<int>({2, 2, 4})); } TEST_CASE("fwd_test, zip_with") { using namespace fplus; const auto multiply_int = [](int x, int y) -> int { return x * y; }; const auto multiply_generic = [](auto x, auto y){ return x * y; }; IntVector xs = {1,2,3,4,2}; IntVector ys = {2,2,3,1}; IntVector xs_mult_ys = {2,4,9,4}; REQUIRE_EQ(fwd::zip_with(multiply_int, ys)(xs), xs_mult_ys); REQUIRE_EQ(fwd::zip_with(multiply_generic, ys)(xs), xs_mult_ys); } TEST_CASE("fwd_test, append") { using namespace fplus; IntVector xs = {1,2,3,4,2}; IntVector ys = {2,2,3,1}; IntVector xs_append_ys = {1,2,3,4,2,2,2,3,1}; REQUIRE_EQ(fwd::append(xs)(ys), xs_append_ys); }
// Copyright (c) YugaByte, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed under the License // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express // or implied. See the License for the specific language governing permissions and limitations // under the License. // #include <atomic> #include "yb/client/client.h" #include "yb/client/permissions.h" DECLARE_int32(update_permissions_cache_msecs); namespace yb { namespace client { namespace internal { using yb::master::GetPermissionsResponsePB; RolePermissions::RolePermissions(const master::RolePermissionInfoPB& role_permission_info_pb) { DCHECK(role_permission_info_pb.has_all_keyspaces_permissions()); DCHECK(role_permission_info_pb.has_all_roles_permissions()); all_keyspaces_permissions_ = role_permission_info_pb.all_keyspaces_permissions(); all_roles_permissions_ = role_permission_info_pb.all_roles_permissions(); // For each resource, extract its permissions and store it in the role's permissions map. for (const auto &resource_permissions : role_permission_info_pb.resource_permissions()) { DCHECK(resource_permissions.has_permissions()); resource_permissions_[resource_permissions.canonical_resource()] = resource_permissions.permissions(); } } bool RolePermissions::HasCanonicalResourcePermission(const std::string& canonical_resource, PermissionType permission) const { const auto& resource_permissions_itr = resource_permissions_.find(canonical_resource); if (resource_permissions_itr == resource_permissions_.end()) { return false; } const Permissions& resource_permissions_bitset = resource_permissions_itr->second; return resource_permissions_bitset.test(permission); } bool RolePermissions::HasAllKeyspacesPermission(PermissionType permission) const { return all_keyspaces_permissions_.test(permission); } bool RolePermissions::HasAllRolesPermission(PermissionType permission) const { return all_roles_permissions_.test(permission); } PermissionsCache::PermissionsCache(client::YBClient* client, bool automatically_update_cache) : client_(client) { if (!automatically_update_cache) { return; } LOG(INFO) << "Creating permissions cache"; pool_ = std::make_unique<yb::rpc::IoThreadPool>("permissions_cache_updater", 1); scheduler_ = std::make_unique<yb::rpc::Scheduler>(&pool_->io_service()); // This will send many concurrent requests to the master for the permission data. // Queries done before a master leader is elected are all going to fail. This shouldn't be // an issue if the default refresh value is low enough. // TODO(hector): Add logic to retry failed requests so we don't depend on automatic // rescheduling to refresh the permissions cache. ScheduleGetPermissionsFromMaster(true); } PermissionsCache::~PermissionsCache() { if (pool_) { scheduler_->Shutdown(); pool_->Shutdown(); pool_->Join(); } } bool PermissionsCache::WaitUntilReady(MonoDelta wait_for) { std::unique_lock<std::mutex> l(mtx_); return cond_.wait_for(l, wait_for.ToSteadyDuration(), [this] { return this->ready_.load(std::memory_order_acquire); }); } void PermissionsCache::ScheduleGetPermissionsFromMaster(bool now) { if (FLAGS_update_permissions_cache_msecs <= 0) { return; } DCHECK(pool_); DCHECK(scheduler_); scheduler_->Schedule([this](const Status &s) { if (!s.ok()) { LOG(INFO) << "Permissions cache updater scheduler was shutdown: " << s.ToString(); return; } this->GetPermissionsFromMaster(); }, std::chrono::milliseconds(now ? 0 : FLAGS_update_permissions_cache_msecs)); } void PermissionsCache::UpdateRolesPermissions(const GetPermissionsResponsePB& resp) { auto new_roles_permissions_map = std::make_shared<RolesPermissionsMap>(); // Populate the cache. // Get all the roles in the response. They should have at least one piece of information: // the permissions for 'ALL ROLES' and 'ALL KEYSPACES' for (const auto& role_permissions : resp.role_permissions()) { auto result = new_roles_permissions_map->emplace(role_permissions.role(), RolePermissions(role_permissions)); LOG_IF(DFATAL, !result.second) << "Error inserting permissions for role " << role_permissions.role(); } { std::unique_lock<simple_spinlock> l(permissions_cache_lock_); // It's possible that another thread already updated the cache with a more recent version. if (version_ < resp.version()) { std::atomic_store_explicit(&roles_permissions_map_, std::move(new_roles_permissions_map), std::memory_order_release); // Set the permissions cache's version. version_ = resp.version(); } } { // We need to hold the mutex before modifying ready_ to avoid a race condition with cond_. std::lock_guard<std::mutex> l(mtx_); ready_.store(true, std::memory_order_release); } cond_.notify_all(); } void PermissionsCache::GetPermissionsFromMaster() { // Schedule the cache update before we start processing anything because we want to stay as close // as possible to the refresh rate specified by the update_permissions_cache_msecs flag. // TODO(hector): Add a variable to track the last time that the cache was updated and have a // metric exposed for it, per-server. ScheduleGetPermissionsFromMaster(false); Status s = client_->GetPermissions(this); if (!s.ok()) { LOG(WARNING) << "Unable to refresh permissions cache. Received error: " << s.ToString(); // TODO(hector): If we received an error, then our cache will become stale. We need to allow // users to specify the max staleness that they are willing to tolerate. // For now it's safe to ignore the error since we always check } } bool PermissionsCache::HasCanonicalResourcePermission(const std::string& canonical_resource, const ql::ObjectType& object_type, const RoleName& role_name, const PermissionType& permission) { std::shared_ptr<RolesPermissionsMap> roles_permissions_map; roles_permissions_map = std::atomic_load_explicit(&roles_permissions_map_, std::memory_order_acquire); const auto& role_permissions_iter = roles_permissions_map->find(role_name); if (role_permissions_iter == roles_permissions_map->end()) { VLOG(1) << "Role " << role_name << " not found"; // Role doesn't exist. return false; } // Check if the requested permission has been granted to 'ALL KEYSPACES' or to 'ALL ROLES'. const auto& role_permissions = role_permissions_iter->second; if (object_type == ql::ObjectType::OBJECT_SCHEMA || object_type == ql::ObjectType::OBJECT_TABLE) { if (role_permissions.HasAllKeyspacesPermission(permission)) { // Found. return true; } } else if (object_type == ql::ObjectType::OBJECT_ROLE) { if (role_permissions.HasAllRolesPermission(permission)) { // Found. return true; } } // If we didn't find the permission by checking all_permissions, then the queried permission was // not granted to 'ALL KEYSPACES' or to 'ALL ROLES'. if (canonical_resource == kRolesDataResource || canonical_resource == kRolesRoleResource) { return false; } return role_permissions.HasCanonicalResourcePermission(canonical_resource, permission); } } // namespace namespace internal } // namespace client } // namespace yb
// Copyright (c) 2011-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The BASE developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "utilitydialog.h" #include "ui_helpmessagedialog.h" #include "bitcoingui.h" #include "clientmodel.h" #include "guiconstants.h" #include "intro.h" #include "guiutil.h" #include "clientversion.h" #include "init.h" #include "util.h" #include <stdio.h> #include <QCloseEvent> #include <QLabel> #include <QRegExp> #include <QTextTable> #include <QTextCursor> #include <QVBoxLayout> /** "Help message" or "About" dialog box */ HelpMessageDialog::HelpMessageDialog(QWidget* parent, bool about) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), ui(new Ui::HelpMessageDialog) { ui->setupUi(this); GUIUtil::restoreWindowGeometry("nHelpMessageDialogWindow", this->size(), this); QString version = tr("BASE Core") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()); /* On x86 add a bit specifier to the version so that users can distinguish between * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambigious. */ #if defined(__x86_64__) version += " " + tr("(%1-bit)").arg(64); #elif defined(__i386__) version += " " + tr("(%1-bit)").arg(32); #endif if (about) { setWindowTitle(tr("About BASE Core")); /// HTML-format the license message from the core QString licenseInfo = QString::fromStdString(LicenseInfo()); QString licenseInfoHTML = licenseInfo; // Make URLs clickable QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2); uri.setMinimal(true); // use non-greedy matching licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>"); // Replace newlines with HTML breaks licenseInfoHTML.replace("\n\n", "<br><br>"); ui->aboutMessage->setTextFormat(Qt::RichText); ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); text = version + "\n" + licenseInfo; ui->aboutMessage->setText(version + "<br><br>" + licenseInfoHTML); ui->aboutMessage->setWordWrap(true); ui->helpMessage->setVisible(false); } else { setWindowTitle(tr("Command-line options")); QString header = tr("Usage:") + "\n" + " base-qt [" + tr("command-line options") + "] " + "\n"; QTextCursor cursor(ui->helpMessage->document()); cursor.insertText(version); cursor.insertBlock(); cursor.insertText(header); cursor.insertBlock(); std::string strUsage = HelpMessage(HMM_BITCOIN_QT); strUsage += HelpMessageGroup(tr("UI Options:").toStdString()); strUsage += HelpMessageOpt("-choosedatadir", strprintf(tr("Choose data directory on startup (default: %u)").toStdString(), DEFAULT_CHOOSE_DATADIR)); strUsage += HelpMessageOpt("-lang=<lang>", tr("Set language, for example \"de_DE\" (default: system locale)").toStdString()); strUsage += HelpMessageOpt("-min", tr("Start minimized").toStdString()); strUsage += HelpMessageOpt("-rootcertificates=<file>", tr("Set SSL root certificates for payment request (default: -system-)").toStdString()); strUsage += HelpMessageOpt("-splash", strprintf(tr("Show splash screen on startup (default: %u)").toStdString(), DEFAULT_SPLASHSCREEN)); QString coreOptions = QString::fromStdString(strUsage); text = version + "\n" + header + "\n" + coreOptions; QTextTableFormat tf; tf.setBorderStyle(QTextFrameFormat::BorderStyle_None); tf.setCellPadding(2); QVector<QTextLength> widths; widths << QTextLength(QTextLength::PercentageLength, 35); widths << QTextLength(QTextLength::PercentageLength, 65); tf.setColumnWidthConstraints(widths); QTextCharFormat bold; bold.setFontWeight(QFont::Bold); Q_FOREACH (const QString &line, coreOptions.split("\n")) { if (line.startsWith(" -")) { cursor.currentTable()->appendRows(1); cursor.movePosition(QTextCursor::PreviousCell); cursor.movePosition(QTextCursor::NextRow); cursor.insertText(line.trimmed()); cursor.movePosition(QTextCursor::NextCell); } else if (line.startsWith(" ")) { cursor.insertText(line.trimmed()+' '); } else if (line.size() > 0) { //Title of a group if (cursor.currentTable()) cursor.currentTable()->appendRows(1); cursor.movePosition(QTextCursor::Down); cursor.insertText(line.trimmed(), bold); cursor.insertTable(1, 2, tf); } } ui->helpMessage->moveCursor(QTextCursor::Start); ui->scrollArea->setVisible(false); } } HelpMessageDialog::~HelpMessageDialog() { GUIUtil::saveWindowGeometry("nHelpMessageDialogWindow", this); delete ui; } void HelpMessageDialog::printToConsole() { // On other operating systems, the expected action is to print the message to the console. fprintf(stdout, "%s\n", qPrintable(text)); } void HelpMessageDialog::showOrPrint() { #if defined(WIN32) // On Windows, show a message box, as there is no stderr/stdout in windowed applications exec(); #else // On other operating systems, print help text to console printToConsole(); #endif } void HelpMessageDialog::on_okButton_accepted() { close(); } /** "Shutdown" window */ ShutdownWindow::ShutdownWindow(QWidget* parent, Qt::WindowFlags f) : QWidget(parent, f) { QVBoxLayout* layout = new QVBoxLayout(); layout->addWidget(new QLabel( tr("BASE Core is shutting down...") + "<br /><br />" + tr("Do not shut down the computer until this window disappears."))); setLayout(layout); } void ShutdownWindow::showShutdownWindow(BitcoinGUI* window) { if (!window) return; // Show a simple window indicating shutdown status QWidget* shutdownWindow = new ShutdownWindow(); // We don't hold a direct pointer to the shutdown window after creation, so use // Qt::WA_DeleteOnClose to make sure that the window will be deleted eventually. shutdownWindow->setAttribute(Qt::WA_DeleteOnClose); shutdownWindow->setWindowTitle(window->windowTitle()); // Center shutdown window at where main window was const QPoint global = window->mapToGlobal(window->rect().center()); shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2); shutdownWindow->show(); } void ShutdownWindow::closeEvent(QCloseEvent* event) { event->ignore(); }
/* * Copyright (c) 2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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 "mbed.h" #include "TLSSocket.h" #include "greentea-client/test_env.h" #include "unity/unity.h" #include "utest.h" #include "tls_tests.h" using namespace utest::v1; #if defined(MBEDTLS_SSL_CLI_C) namespace { static const int SIGNAL_SIGIO = 0x1; static const int SIGIO_TIMEOUT = 20000; //[ms] } static void _sigio_handler(osThreadId id) { osSignalSet(id, SIGNAL_SIGIO); } void TLSSOCKET_RECV_TIMEOUT() { SKIP_IF_TCP_UNSUPPORTED(); static const int DATA_LEN = 100; char buff[DATA_LEN] = {0}; int time_allotted = split2half_rmng_tls_test_time(); // [s] Timer tc_exec_time; tc_exec_time.start(); TLSSocket sock; tlssocket_connect_to_echo_srv(sock); sock.set_timeout(100); sock.sigio(callback(_sigio_handler, ThisThread::get_id())); int recvd = 0; int pkt_unrecvd; Timer timer; for (int i = 0; i < 5; i++) { pkt_unrecvd = DATA_LEN; TEST_ASSERT_EQUAL(DATA_LEN, sock.send(buff, DATA_LEN)); while (pkt_unrecvd) { timer.reset(); timer.start(); recvd = sock.recv(&(buff[DATA_LEN - pkt_unrecvd]), pkt_unrecvd); timer.stop(); if (recvd == NSAPI_ERROR_WOULD_BLOCK) { if (tc_exec_time.read() >= time_allotted || (osSignalWait(SIGNAL_SIGIO, SIGIO_TIMEOUT).status == osEventTimeout)) { TEST_FAIL(); goto CLEANUP; } printf("MBED: recv() took: %dus\n", timer.read_us()); continue; } else if (recvd < 0) { printf("[pkt#%02d] network error %d\n", i, recvd); TEST_FAIL(); goto CLEANUP; } pkt_unrecvd -= recvd; } } CLEANUP: tc_exec_time.stop(); TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.close()); } #endif // defined(MBEDTLS_SSL_CLI_C)
// Copyright 2020 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 "http2/decoder/payload_decoders/priority_update_payload_decoder.h" #include <stddef.h> #include "absl/base/macros.h" #include "http2/decoder/decode_buffer.h" #include "http2/decoder/http2_frame_decoder_listener.h" #include "http2/http2_constants.h" #include "http2/http2_structures.h" #include "http2/platform/api/http2_bug_tracker.h" #include "http2/platform/api/http2_logging.h" namespace http2 { std::ostream& operator<<(std::ostream& out, PriorityUpdatePayloadDecoder::PayloadState v) { switch (v) { case PriorityUpdatePayloadDecoder::PayloadState::kStartDecodingFixedFields: return out << "kStartDecodingFixedFields"; case PriorityUpdatePayloadDecoder::PayloadState::kResumeDecodingFixedFields: return out << "kResumeDecodingFixedFields"; case PriorityUpdatePayloadDecoder::PayloadState::kHandleFixedFieldsStatus: return out << "kHandleFixedFieldsStatus"; case PriorityUpdatePayloadDecoder::PayloadState::kReadPriorityFieldValue: return out << "kReadPriorityFieldValue"; } // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. int unknown = static_cast<int>(v); HTTP2_BUG(http2_bug_173_1) << "Invalid PriorityUpdatePayloadDecoder::PayloadState: " << unknown; return out << "PriorityUpdatePayloadDecoder::PayloadState(" << unknown << ")"; } DecodeStatus PriorityUpdatePayloadDecoder::StartDecodingPayload( FrameDecoderState* state, DecodeBuffer* db) { HTTP2_DVLOG(2) << "PriorityUpdatePayloadDecoder::StartDecodingPayload: " << state->frame_header(); QUICHE_DCHECK_EQ(Http2FrameType::PRIORITY_UPDATE, state->frame_header().type); QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length); QUICHE_DCHECK_EQ(0, state->frame_header().flags); state->InitializeRemainders(); payload_state_ = PayloadState::kStartDecodingFixedFields; return ResumeDecodingPayload(state, db); } DecodeStatus PriorityUpdatePayloadDecoder::ResumeDecodingPayload( FrameDecoderState* state, DecodeBuffer* db) { HTTP2_DVLOG(2) << "PriorityUpdatePayloadDecoder::ResumeDecodingPayload: " "remaining_payload=" << state->remaining_payload() << ", db->Remaining=" << db->Remaining(); const Http2FrameHeader& frame_header = state->frame_header(); QUICHE_DCHECK_EQ(Http2FrameType::PRIORITY_UPDATE, frame_header.type); QUICHE_DCHECK_LE(db->Remaining(), frame_header.payload_length); QUICHE_DCHECK_NE(PayloadState::kHandleFixedFieldsStatus, payload_state_); // |status| has to be initialized to some value to avoid compiler error in // case PayloadState::kHandleFixedFieldsStatus below, but value does not // matter, see QUICHE_DCHECK_NE above. DecodeStatus status = DecodeStatus::kDecodeError; size_t avail; while (true) { HTTP2_DVLOG(2) << "PriorityUpdatePayloadDecoder::ResumeDecodingPayload payload_state_=" << payload_state_; switch (payload_state_) { case PayloadState::kStartDecodingFixedFields: status = state->StartDecodingStructureInPayload( &priority_update_fields_, db); ABSL_FALLTHROUGH_INTENDED; case PayloadState::kHandleFixedFieldsStatus: if (status == DecodeStatus::kDecodeDone) { state->listener()->OnPriorityUpdateStart(frame_header, priority_update_fields_); } else { // Not done decoding the structure. Either we've got more payload // to decode, or we've run out because the payload is too short, // in which case OnFrameSizeError will have already been called. QUICHE_DCHECK((status == DecodeStatus::kDecodeInProgress && state->remaining_payload() > 0) || (status == DecodeStatus::kDecodeError && state->remaining_payload() == 0)) << "\n status=" << status << "; remaining_payload=" << state->remaining_payload(); payload_state_ = PayloadState::kResumeDecodingFixedFields; return status; } ABSL_FALLTHROUGH_INTENDED; case PayloadState::kReadPriorityFieldValue: // Anything left in the decode buffer is the Priority Field Value. avail = db->Remaining(); if (avail > 0) { state->listener()->OnPriorityUpdatePayload(db->cursor(), avail); db->AdvanceCursor(avail); state->ConsumePayload(avail); } if (state->remaining_payload() > 0) { payload_state_ = PayloadState::kReadPriorityFieldValue; return DecodeStatus::kDecodeInProgress; } state->listener()->OnPriorityUpdateEnd(); return DecodeStatus::kDecodeDone; case PayloadState::kResumeDecodingFixedFields: status = state->ResumeDecodingStructureInPayload( &priority_update_fields_, db); payload_state_ = PayloadState::kHandleFixedFieldsStatus; continue; } HTTP2_BUG(http2_bug_173_2) << "PayloadState: " << payload_state_; } } } // namespace http2
#include "i18n.hpp" #include <fstream> #include <memory> #include "config.hpp" #include "defines.hpp" #include "elona.hpp" #include "filesystem.hpp" #include "lua_env/mod_manager.hpp" #include "random.hpp" #include "variables.hpp" namespace elona { namespace i18n { void Store::init() { for (const auto& mod_id : lua::lua->get_mod_manager().sorted_mods()) { lua::lua->get_i18n_manager().load( *lua::lua->get_mod_manager().get_mod(mod_id)); } } void Store::load_from_string(const std::string& src, const std::string& mod_id) { lua::lua->get_i18n_manager().load_string( src, *lua::lua->get_mod_manager().get_mod(mod_id)); } std::string space_if_needed() { if (jp) { return ""; } else { return u8" "; } } } // namespace i18n } // namespace elona
/** * \file DrmControllerDataConverter.cpp * \version 3.2.2.0 * \date May 2019 * \brief Class DrmController is used as a top level component in the user application. * It provides top level procedures related to the DRM Controller component. * \copyright 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 <DrmControllerDataConverter.hpp> // namespace usage using namespace DrmControllerLibrary; /************************************************************/ /** PUBLIC MEMBER FUNCTIONS **/ /************************************************************/ /** hexStringToBinary * \brief Convert a hexadecimal representation into a list of binary values. * \param[in] hexString is the hexadecimal representation. * \return Returns the list of binary values. **/ const std::vector<unsigned int> DrmControllerDataConverter::hexStringToBinary(const std::string &hexString) { // create the result vector std::vector<unsigned int> result; // loop for each element from the hex string for(unsigned int ii = 0; ii < hexString.size(); ii+=(DRM_CONTROLLER_SYSTEM_BUS_DATA_SIZE/DRM_CONTROLLER_NIBBLE_SIZE)) { // get a substring std::string subString = hexString.substr(ii, DRM_CONTROLLER_SYSTEM_BUS_DATA_SIZE/DRM_CONTROLLER_NIBBLE_SIZE); // set the current word unsigned int currentWord = (unsigned int)strtoul(subString.c_str(), NULL, 16); // push the current word result.push_back(currentWord); } // return the result return result; } /** binaryToHexString * \brief Convert a list of binary values into a hexadecimal representation. * \param[in] binary is the list of binary values. * \return Returns the hexadecimal representation. **/ const std::string DrmControllerDataConverter::binaryToHexString(const std::vector<unsigned int> &binary) { // create the result string std::string result(""); // get each element from the input list for (std::vector<unsigned int>::const_iterator it = binary.begin(); it != binary.end(); it++) { result += binaryToHexString(*it); } // return the result return result; } /** hexStringListToBinary * \brief Convert a list of list of hexadecimal string representation into a binary values. * \param[in] hexString is the list of hexadecimal string representation. * \return Returns the list of binary values. **/ const std::vector<unsigned int> DrmControllerDataConverter::hexStringListToBinary(const std::vector<std::string> &hexString) { std::vector<unsigned int> result; result.clear(); for (std::vector<std::string>::const_iterator it = hexString.begin(); it != hexString.end(); it++) { std::vector<unsigned int> convertedData = DrmControllerDataConverter::hexStringToBinary(*it); result.insert(result.end(), convertedData.begin(), convertedData.end()); } return result; } /** binaryToHexString * \brief Convert a binary value into a hexadecimal representation. * \param[in] binary is the binary value. * \return Returns the hexadecimal representation. **/ const std::string DrmControllerDataConverter::binaryToHexString(const unsigned int &binary) { // create a string stream std::stringstream stringStream; // push into the string stream the binary value // but we need to have to fills with 0 if the size // of the value is not system bus data size stringStream << std::setfill('0') << std::setw(DRM_CONTROLLER_SYSTEM_BUS_DATA_SIZE/DRM_CONTROLLER_NIBBLE_SIZE) << std::hex << binary; // get the result string std::string result = stringStream.str(); // transform the string to have only upper case chars std::transform(result.begin(), result.end(), result.begin(), ::toupper); // return the result string return result; } /** binaryToHexStringList * \brief Convert a list of binary values into a list of hexadecimal string representation. * \param[in] binary is the binary value. * \param[in] wordsNumber is the number of words to push per string. * \return Returns the list of hexadecimal string representation. **/ const std::vector<std::string> DrmControllerDataConverter::binaryToHexStringList(const std::vector<unsigned int> &binary, const unsigned int &wordsNumber) { std::vector<std::string> stringList; stringList.clear(); for (unsigned int ii = 0; ii < binary.size(); ii+=wordsNumber) { // fill the vector if (binary.begin()+ii < binary.end() && binary.begin()+ii+wordsNumber <= binary.end()) stringList.push_back(DrmControllerDataConverter::binaryToHexString(std::vector<unsigned int>(binary.begin()+ii, binary.begin()+ii+wordsNumber))); else stringList.push_back(DrmControllerDataConverter::binaryToHexString(std::vector<unsigned int>(binary.begin(), binary.end()))); } return stringList; } /** binaryToVersionString * \brief Convert a binary value into a formated string for the version where each digit * are separated by a dot. The string is in the form major.minor.correction. * \param[in] binary is the binary value. * \return Returns the formated version. **/ const std::string DrmControllerDataConverter::binaryToVersionString(const unsigned int &binary) { // create a string stream std::stringstream stringStream; // create 3 bytes for each digit unsigned char digits[DRM_CONTROLLER_VERSION_NUMBER_OF_DIGIT]; // create mask and shifter unsigned int mask = 0x00FF0000; unsigned int shift = DRM_CONTROLLER_VERSION_DIGIT_SIZE_BITS*(DRM_CONTROLLER_VERSION_NUMBER_OF_DIGIT-1); // fill each digit for (unsigned int ii = 0; ii < DRM_CONTROLLER_VERSION_NUMBER_OF_DIGIT; ii++) { digits[ii] = (unsigned char)((binary & mask) >> shift); // shift the mask and decrement the shift mask = mask >> DRM_CONTROLLER_VERSION_DIGIT_SIZE_BITS; shift -= DRM_CONTROLLER_VERSION_DIGIT_SIZE_BITS; // push into the string stream each the generated digit stringStream << std::dec << (unsigned int)digits[ii]; // append a dot if needed if (ii < (DRM_CONTROLLER_VERSION_NUMBER_OF_DIGIT-1)) { stringStream << "."; } } // get the result string std::string result = stringStream.str(); // transform the string to have only upper case chars std::transform(result.begin(), result.end(), result.begin(), ::toupper); // return the result string return result; } /** binStringToBinary * \brief Convert a binary representation into a list of binary values. * \param[in] binString is the binary representation. * \return Returns the list of binary values. **/ const std::vector<unsigned int> DrmControllerDataConverter::binStringToBinary(const std::string &binString) { // create the result vector std::vector<unsigned int> result; // loop for each element from the bin string for(unsigned int ii = 0; ii < binString.size(); ii+=DRM_CONTROLLER_SYSTEM_BUS_DATA_SIZE) { // create the current word std::bitset<DRM_CONTROLLER_SYSTEM_BUS_DATA_SIZE> currentWord(binString.substr(ii, DRM_CONTROLLER_SYSTEM_BUS_DATA_SIZE)); // push the current word result.push_back((unsigned int)currentWord.to_ulong()); } // return the result return result; } /** binaryToBinString * \brief Convert a list of binary values into a binary representation. * \param[in] binary is the list of binary values. * \return Returns the binary representation. **/ const std::string DrmControllerDataConverter::binaryToBinString(const std::vector<unsigned int> &binary) { // create the result string std::string result(""); // get each element from the input list for (std::vector<unsigned int>::const_iterator it = binary.begin(); it != binary.end(); it++) { result += binaryToBinString(*it); } // return the result return result; } /** binaryToBinString * \brief Convert a binary value into a binary representation. * \param[in] binary is binary value. * \return Returns the binary representation. **/ const std::string DrmControllerDataConverter::binaryToBinString(const unsigned int &binary) { // convert the binary value into a binary string std::string result = std::bitset<DRM_CONTROLLER_SYSTEM_BUS_DATA_SIZE>(binary).to_string(); // transform the string to have only upper case chars std::transform(result.begin(), result.end(), result.begin(), ::toupper); // return the result string return result; } /** hexStringToBinString * \brief Convert a hexadecimal representation into a binary representation. * \param[in] hexString is the hexadecimal representation. * \return Returns the binary representation. **/ const std::string DrmControllerDataConverter::hexStringToBinString(const std::string &hexString) { // return the converted value return binaryToBinString(hexStringToBinary(hexString)); } /** binStringToHexString * \brief Convert a binary representation into a hexadecimal representation. * \param[in] binString is the binary representation. * \return Returns the hexadecimal representation. **/ const std::string DrmControllerDataConverter::binStringToHexString(const std::string &binString) { // return the converted value return binaryToHexString(binStringToBinary(binString)); } /** asciiStringToBinary * \brief Convert an ASCII string into a list of binary values. * \param[in] asciiString is the ASCII string. * \param[in] asciiStringLen is the length of the ascii string. * \return Returns a list of binary values. **/ const std::vector<unsigned int> DrmControllerDataConverter::asciiStringToBinary(const unsigned char *asciiString, const unsigned int &asciiStringLen) { // create the result std::vector<unsigned int> result; // the current binary value, index and mask unsigned int currentVal = 0; int currentIndex = 24; unsigned int currentMask = 0xFF000000; // loop for each element of the ascii string for (unsigned int ii = 0; ii < asciiStringLen; ii++) { // set the current value currentVal += ((asciiString[ii] << currentIndex) & currentMask); // update the index and the mask currentIndex -= 8; currentMask = currentMask >> 8; // check the index if (currentIndex < 0) { // push the current value result.push_back(currentVal); // reset the index, the current value and the mask currentVal = 0; currentIndex = 24; currentMask = 0xFF000000; } } // return the result return result; } /** binaryToAsciiString * \brief Convert a list of binary values into an ASCII string. * \param[in] binary is the list of binary values. * \param[out] asciiStringLen is the length of the ascii string. * \return Returns the ASCII string. **/ unsigned char* DrmControllerDataConverter::binaryToAsciiString(const std::vector<unsigned int> &binary, unsigned int &asciiStringLen) { // define the size of the ascii string as // the number of element from binary multiplied by the size of an unsigned int // and divided by the size of an unsigned char const size_t len = (binary.size()*sizeof(unsigned int))/sizeof(unsigned char); // create the result string and allocate enough size unsigned char *result = new unsigned char[len]; // initialize the length asciiStringLen = 0; // loop on each element of the binary list for (std::vector<unsigned int>::const_iterator it = binary.cbegin(); it != binary.cend(); it++) { // the current index and mask int currentIndex = 24; unsigned int currentMask = 0xFF000000; // loop while index is positive while (currentIndex >= 0) { // update the result result[asciiStringLen++] = (unsigned char)(((*it) & currentMask) >> currentIndex); // update the index and the mask currentIndex -= 8; currentMask = currentMask >> 8; } } // return the result return result; } /** base64ToBinary * \brief Convert a base64 encoded string into a list of binary values. * \param[in] base64 is the base64 encoded string. * \return Returns the list of binary values. **/ const std::vector<unsigned int> DrmControllerDataConverter::base64ToBinary(const std::string &base64) { // converter string const std::string converterString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // input char array unsigned char input[4]; // the buffer std::string buffer; // input element index unsigned int inputIndex = 0; // iterate on each element from the input parameter for (std::string::const_iterator it = base64.begin(); it != base64.end(); it++) { // break whenether the element is the char '=' or the element is not a base64 char if (*it == '=' || isBase64(*it) == false) { break; } // set the input element input[inputIndex++] = (unsigned char)converterString.find(*it); // when the input array is ready if (inputIndex == 4) { // fill the buffer buffer += (input[0] << 2) + ((input[1] & 0x30) >> 4); buffer += ((input[1] & 0xf) << 4) + ((input[2] & 0x3c) >> 2); buffer += ((input[2] & 0x3) << 6) + input[3]; // reset input index inputIndex = 0; } } // check input index not empty if (inputIndex > 0) { for (unsigned int jj = inputIndex; jj < 4; jj++) input[jj] = (unsigned char) converterString.find((char)0); for (unsigned int jj = 0; (jj < inputIndex - 1); jj++) { if (jj == 0) { buffer += (input[0] << 2) + ((input[1] & 0x30) >> 4); } else if (jj == 1) { buffer += ((input[1] & 0xf) << 4) + ((input[2] & 0x3c) >> 2); } else if (jj == 2) { buffer += ((input[2] & 0x3) << 6) + input[3]; } } } // convert from ascii to binary return asciiStringToBinary((const unsigned char*)buffer.c_str(), (unsigned int) buffer.size()); } /** binaryToBase64 * \brief Convert a list of binary values into a base64 encoded string. * \param[in] binary is the list of binary values. * \return Returns the base64 encoded string. **/ const std::string DrmControllerDataConverter::binaryToBase64(const std::vector<unsigned int> &binary) { // convert the binary list into an ascii string unsigned int len = 0; unsigned char *buffer = binaryToAsciiString(binary, len); // converter string const std::string converterString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // input char array unsigned char input[3]; // input index unsigned int inputIndex = 0; // the result string std::string result; // iterate on each element of the buffer for (unsigned int ii = 0; ii < len; ii++) { // set the input array input[inputIndex++] = buffer[ii]; // the input array is filled if (inputIndex == 3) { result += converterString[(input[0] & 0xfc) >> 2]; result += converterString[((input[0] & 0x03) << 4) + ((input[1] & 0xf0) >> 4)]; result += converterString[((input[1] & 0x0f) << 2) + ((input[2] & 0xc0) >> 6)]; result += converterString[input[2] & 0x3f]; // reset the input index inputIndex = 0; } } // delete the buffer delete[] buffer; // check input index if (inputIndex > 0) { // reset unused chars for (unsigned int jj = inputIndex; jj < 3; jj++) { input[jj] = 0; } // update the result for (unsigned int jj = 0; (jj < inputIndex + 1); jj++) { if (jj == 0) { result += converterString[(input[0] & 0xfc) >> 2]; } else if (jj == 1) { result += converterString[((input[0] & 0x03) << 4) + ((input[1] & 0xf0) >> 4)]; } else if (jj == 2) { result += converterString[((input[1] & 0x0f) << 2) + ((input[2] & 0xc0) >> 6)]; } else if (jj == 3) { result += converterString[input[2] & 0x3f]; } } // add '=' char if needed while (inputIndex++ < 3) { result += '='; } } // return the result return result; } /** base64ToHexString * \brief Convert a base64 encoded string into its hexadecimal representation. * \param[in] base64 is the base64 encoded string. * \return Returns the hexadecimal representation. **/ const std::string DrmControllerDataConverter::base64ToHexString(const std::string &base64) { // return the converted value return binaryToHexString(base64ToBinary(base64)); } /** hexStringToBase64 * \brief Convert a hexadecimal representation into its base64 encoded string. * \param[in] hexString is the hexadecimal representation. * \return Returns the base64 encoded string. **/ const std::string DrmControllerDataConverter::hexStringToBase64(const std::string &hexString) { // return the converted value return binaryToBase64(hexStringToBinary(hexString)); } /** base64ToBinString * \brief Convert a base64 encoded string into its binary representation. * \param[in] base64 is the base64 encoded string. * \return Returns the binary representation. **/ const std::string DrmControllerDataConverter::base64ToBinString(const std::string &base64) { // return the converted value return binaryToBinString(base64ToBinary(base64)); } /** binStringToBase64 * \brief Convert a binary representation into its base64 encoded string. * \param[in] binString is the binary representation. * \return Returns the base64 encoded string. **/ const std::string DrmControllerDataConverter::binStringToBase64(const std::string &binString) { // return the converted value return binaryToBase64(binStringToBinary(binString)); } /************************************************************/ /** PROTECTED MEMBER FUNCTIONS **/ /************************************************************/ /************************************************************/ /** PRIVATE MEMBER FUNCTIONS **/ /************************************************************/ /** DrmControllerDataConverter * \brief Class constructor. **/ DrmControllerDataConverter::DrmControllerDataConverter() {} /** ~DrmControllerDataConverter * \brief Class destructor. **/ DrmControllerDataConverter::~DrmControllerDataConverter() {} /** isBase64 * \brief Check the input byte is from a base64 encoded string. * \param[in] byte is the byte to check. * \return Returns true when the byte is from a base64 encoded string, false otherwise. **/ bool DrmControllerDataConverter::isBase64(unsigned char byte) { return (isalnum(byte) || (byte == '+') || (byte == '/')); }
//================================================================================================== /*! Copyright 2015 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) */ //================================================================================================== #include <boost/simd/constant/sqrt_1o_5.hpp> #include <boost/simd/as.hpp> #include <simd_test.hpp> STF_CASE_TPL( "Check sqrt_1o_5 behavior for integral types" , (std::uint8_t)(std::uint16_t)(std::uint32_t)(std::uint64_t) (std::int8_t)(std::int16_t)(std::int32_t)(std::int64_t) ) { using boost::simd::as; using boost::simd::detail::sqrt_1o_5; using boost::simd::Sqrt_1o_5; STF_TYPE_IS(decltype(Sqrt_1o_5<T>()), T); STF_EQUAL(Sqrt_1o_5<T>(), T(0)); STF_EQUAL(sqrt_1o_5( as(T{}) ),T(0)); } STF_CASE_TPL( "Check sqrt_1o_5 behavior for floating types" , (double)(float) ) { using boost::simd::as; using boost::simd::detail::sqrt_1o_5; using boost::simd::Sqrt_1o_5; STF_TYPE_IS(decltype(Sqrt_1o_5<T>()), T); auto z1 = Sqrt_1o_5<T>(); STF_ULP_EQUAL(z1*z1, T(1/5.0), 0.5); auto z2 = sqrt_1o_5( as(T{}) ); STF_ULP_EQUAL(z2*z2, T(1/5.0), 0.5); }
/*There is a robot starting at position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves. The move sequence is represented by a string, and the character moves[i] represents its ith move. Valid moves are R (right), L (left), U (up), and D (down). If the robot returns to the origin after it finishes all of its moves, return true. Otherwise, return false. Note: The way that the robot is "facing" is irrelevant. "R" will always make the robot move to the right once, "L" will always make it move left, etc. Also, assume that the magnitude of the robot's movement is the same for each move. Example 1: Input: "UD" Output: true Explanation: The robot moves up once, and then down once. All moves have the same magnitude, so it ended up at the origin where it started. Therefore, we return true.   Example 2: Input: "LL" Output: false Explanation: The robot moves left twice. It ends up two "moves" to the left of the origin. We return false because it is not at the origin at the end of its moves. 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/robot-return-to-origin 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。*/ class Solution { public: bool judgeCircle(string moves) { vector<int> flag(2,0); for(auto t:moves){ switch(t){ case 'R': flag[0]++; break; case 'L': flag[0]--; break; case 'U': flag[1]++; break; case 'D': flag[1]--; break; } } return !flag[0] && !flag[1]; } };
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <string> // Call front() on empty container. #if _LIBCPP_DEBUG >= 1 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) #include <string> #include <cassert> #include <iterator> #include <exception> #include <cstdlib> #include "min_allocator.h" int main() { { typedef std::string S; S s(1, '\0'); assert(s.front() == 0); s.clear(); assert(s.front() == 0); assert(false); } #if __cplusplus >= 201103L { typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; S s(1, '\0'); assert(s.front() == 0); s.clear(); assert(s.front() == 0); assert(false); } #endif } #else int main() { } #endif
/****************************************************************************/ /* */ /* Projet : Reconstruction 3D */ /* */ /* Date : Avril-Septembre 1994 */ /* */ /* Auteur : Stephane Christy */ /* */ /* Module : Valeurs propres et vecteurs propres d'une matrice */ /* (Numerical Recipes) */ /* */ /****************************************************************************/ #include <math.h> #include "matrix.h" static void eigsrt(Vector& d, Matrix& V) { int i, j, k, n; double p; n = d.nbRows(); for(i = 1; i < n; i++) { p = d(k = i); for(j = i + 1; j <= n; j++) if(d(j) >= p) p = d(k = j); if (k != i) { d(k) = d(i); d(i) = p; for(j = 1; j <= n; j++) { p = V(j, i); V(j, i) = V(j, k); V(j, k) = p; } } } } #define ROTATE(a,i,j,k,l) g=a(i,j);h=a(k,l);a(i,j)=g-s*(h+g*tau);\ a(k,l)=h+s*(g-h*tau); void Matrix::jacobi(Vector& d, Matrix& V) const { int j, iq, ip, i, n, nrot; double tresh, theta, tau, t, sm, s, h, g, c; Vector b, z; Matrix A = *this; n = A.nbRows(); b.create(n); z.create(n); d.create(n); V.create(n, n); for(ip = 1; ip <= n; ip++) { for (iq = 1; iq <= n; iq++) V(ip, iq) = 0.0; V(ip, ip) = 1.0; } for(ip = 1; ip <= n; ip++) { b(ip) = d(ip) = A(ip, ip); z(ip) = 0.0; } nrot = 0; for(i = 1; i <= 50; i++) { sm = 0.0; for(ip = 1; ip <= n - 1; ip++) { for(iq = ip + 1; iq <= n; iq++) sm += fabs(A(ip, iq)); } if (sm == 0.0) { eigsrt(d, V); return; } if (i < 4) tresh = 0.2 * sm / (n * n); else tresh = 0.0; for(ip = 1; ip <= n - 1; ip++) { for(iq = ip + 1; iq <= n; iq++) { g = 100.0 * fabs(A(ip, iq)); if (i > 4 && fabs(d(ip)) + g == fabs(d(ip)) && fabs(d(iq)) + g == fabs(d(iq))) A(ip, iq) = 0.0; else if (fabs(A(ip, iq)) > tresh) { h = d(iq) - d(ip); if (fabs(h) + g == fabs(h)) t = (A(ip, iq)) / h; else { theta = 0.5 * h / (A(ip, iq)); t = 1.0 / (fabs(theta) + sqrt(1.0 + theta * theta)); if (theta < 0.0) t = -t; } c = 1.0 / sqrt(1 + t * t); s = t * c; tau = s / (1.0 + c); h = t * A(ip, iq); z(ip) -= h; z(iq) += h; d(ip) -= h; d(iq) += h; A(ip, iq) = 0.0; for(j = 1; j <= ip - 1; j++) { ROTATE(A, j, ip, j, iq); } for(j = ip + 1; j <= iq - 1; j++) { ROTATE(A, ip, j, j, iq); } for(j = iq + 1; j <= n; j++) { ROTATE(A, ip, j, iq, j); } for(j = 1; j <= n; j++) { ROTATE(V, j, ip, j, iq); } ++nrot; } } } for(ip = 1; ip <= n; ip++) { b(ip) += z(ip); d(ip) = b(ip); z(ip) = 0.0; } } A.error("Too many iterations in routine JACOBI"); } #undef ROTATE
#include "MaxDataModel.h" #include <QtCore/QJsonValue> #include <QtGui/QDoubleValidator> #include "DataFloat.h" #include "DataVector2.h" #include "DataVector3.h" #include "DataVector4.h" #include "DataInvalid.h" #include "ShaderScene.h" #include "OperationRules.h" namespace DataFlowProgramming { MaxDataModel::MaxDataModel() { m_inputDataTypes = { {"any", "A"}, {"any", "B"}, }; m_inputs.resize(m_inputDataTypes.size()); m_outputs.resize(1); m_outputs[0] = std::make_shared<DataInvalid>(this); m_outputs[0]->setVariableName(getVariableName()); } QJsonObject MaxDataModel::save() const { QJsonObject modelJson = NodeDataModel::save(); return modelJson; } void MaxDataModel::restore(QJsonObject const &p) { } void MaxDataModel::setInData(std::shared_ptr<NodeData> nodeData, PortIndex portIndex) { m_inputs[portIndex] = std::dynamic_pointer_cast<ShaderData>(nodeData); if (m_inputs[0] && m_inputs[1]) { m_outputs[0] = OperationRules::instance().NewMaxOutput( DataAny::getInternalData(m_inputs[0])->type().id, DataAny::getInternalData(m_inputs[1])->type().id, this); m_outputs[0]->setVariableName(getVariableName()); } else { m_outputs[0] = std::make_shared<DataInvalid>(this); m_outputs[0]->setVariableName(getVariableName()); } checkValidation(); Q_EMIT dataUpdated(0); } bool MaxDataModel::generateCode(ShaderCompiler& compiler) { if (m_inputs[0] && m_inputs[1]) { compiler.addCode(Echo::StringUtil::Format("\t%s %s = max(%s, %s);\n", m_outputs[0]->type().id.c_str(), m_outputs[0]->getVariableName().c_str(), DataAny::getInternalData(m_inputs[0])->getVariableName().c_str(), DataAny::getInternalData(m_inputs[1])->getVariableName().c_str())); } return true; } }
#include <iostream> #include "stackInt.h" using namespace std; void stackTest() { Stack* stack = createStack(); push(5, stack); push(9, stack); TypeElement elem = pop(stack); cout << elem << endl; cout << "isEmpty: " << isEmpty(stack) << endl; cout << top(stack) << endl; bool flag = true; cout << pop(stack, &flag) << " flag = " << flag << endl; // flag = 1 тк << ,видимо, правоассоциированная операция cout << top(stack, &flag) << " flag = " << flag << endl; cout << "flag = " << flag << endl; cout << "isEmpty: " << isEmpty(stack) << endl; cout << "OK\n"; deleteStack(stack); } int main() { // test stackTest(); return 0; }
//***************************************************************************** // Copyright 2017-2020 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //***************************************************************************** #include <random> #include <sstream> #include <string> #include <vector> #include "gtest/gtest.h" #include "ngraph/file_util.hpp" using namespace std; using namespace ngraph; TEST(file_util, path_join) { { string s1 = ""; string s2 = ""; EXPECT_STREQ("", file_util::path_join(s1, s2).c_str()); } { string s1 = ""; string s2 = "/test1/test2"; EXPECT_STREQ("/test1/test2", file_util::path_join(s1, s2).c_str()); } { string s1 = ""; string s2 = "/test1/test2/"; EXPECT_STREQ("/test1/test2/", file_util::path_join(s1, s2).c_str()); } { string s1 = ""; string s2 = "test1/test2"; EXPECT_STREQ("test1/test2", file_util::path_join(s1, s2).c_str()); } { string s1 = "/x1/x2"; string s2 = ""; EXPECT_STREQ("/x1/x2", file_util::path_join(s1, s2).c_str()); } { string s1 = "/x1/x2/"; string s2 = "/"; EXPECT_STREQ("/", file_util::path_join(s1, s2).c_str()); } { string s1 = "/x1/x2"; string s2 = "/test1/test2"; EXPECT_STREQ("/test1/test2", file_util::path_join(s1, s2).c_str()); } { string s1 = "/x1/x2/"; string s2 = "test1/test2"; EXPECT_STREQ("/x1/x2/test1/test2", file_util::path_join(s1, s2).c_str()); } { string s1 = "/x1/x2"; string s2 = "test1/test2"; EXPECT_STREQ("/x1/x2/test1/test2", file_util::path_join(s1, s2).c_str()); } { string s1 = "/"; string s2 = "test1/test2"; EXPECT_STREQ("/test1/test2", file_util::path_join(s1, s2).c_str()); } }
// // Rvalues should not implicitly convert to a reference_wrapper // // Copyright 2014 Peter Dimov // // 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/ref.hpp> void f( boost::reference_wrapper< int const > ) { } int main() { f( 1 ); // should fail }
#include "pch-cpp.hpp" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include <limits> #include "vm/CachedCCWBase.h" #include "utils/New.h" // System.Func`4<System.String,System.String,Microsoft.Extensions.Logging.LogLevel,System.Boolean> struct Func_4_t56452C46E14D791233E4D4725185281A89F20BC8; // System.Collections.Generic.HashSet`1<System.Object> struct HashSet_1_t680119C7ED8D82AED56CDB83DF6F0E9149852A9B; // System.Collections.Generic.HashSet`1<UnityEngine.Object> struct HashSet_1_t658A4F799C39BCEF71EEB383AC1FCCFDC8447673; // System.Collections.Generic.HashSet`1<System.Linq.Expressions.ParameterExpression> struct HashSet_1_t42A3AC337CA15FAC250AA5DA438F909806C72CB0; // System.Collections.Generic.HashSet`1<UnityEngine.Renderer> struct HashSet_1_t29AE451AF3792A7A6741732B896B4D841EC86054; // System.Collections.Generic.HashSet`1<Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite> struct HashSet_1_tABC0E73268E54BBE58E35D93218AB0C734249265; // System.Collections.Generic.HashSet`1<System.String> struct HashSet_1_t45F75268054D01D9E70EB33D7F6D2FA609DB9229; // System.Collections.Generic.List`1<UnityEngine.MeshRenderer> struct List_1_tC57263F48ADF56B702DF7112B29D6B6A1ED7332D; // System.Collections.Generic.List`1<Microsoft.Extensions.Logging.MessageLogger> struct List_1_tE47E9256D6281C56D1EC2AFBCEFA509D1CCB5A5B; // System.Collections.Generic.List`1<System.Reflection.MethodBase> struct List_1_tB44C7B5F349493CA4773841848542C6C7AA7BC41; // System.Collections.Generic.List`1<System.Reflection.MethodInfo> struct List_1_t110010ECD885734BF7EEAE609A01E1C757A363C4; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction> struct List_1_t07AA017BC5D27C28FE12A525E226CFD4CD3C444A; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.MixedRealityToolkit> struct List_1_t9A515F799E0BF2C22F0A5126C6218D126A8A5D67; // System.Collections.Generic.List`1<Microsoft.Maps.Unity.ModelTileLayer> struct List_1_t2B566AA13A8DCEBADFE6EE0AD269C538E9A107FA; // System.Collections.Generic.List`1<System.ModifierSpec> struct List_1_tF0C12A80ED2228F19412CFF80CBDD6C9D3C7021E; // System.Collections.Generic.List`1<System.Reflection.Module> struct List_1_tDCBFF7CC97E93320F1E0D7BB75506E610A3B21E6; // System.Collections.Generic.List`1<UnityEngine.InputSystem.Utilities.NameAndParameters> struct List_1_tA5271CFF4C2EEEDEC0AE06FC0EBAB9579053A0E1; // System.Collections.Generic.List`1<System.Net.Http.Headers.NameValueHeaderValue> struct List_1_t691D15165F1892D11210DB2AA498EEE4ACA54806; // System.Collections.Generic.List`1<System.Net.Http.Headers.NameValueWithParametersHeaderValue> struct List_1_t0DC70AE225961ECB1330C0A47271A83D450275C7; // System.Collections.Generic.List`1<UnityEngine.InputSystem.Utilities.NamedValue> struct List_1_t12D38EC9E753EE3B986D36479D7983E0A28E26D8; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.NearInteractionTouchableUnityUI> struct List_1_t5CC7153B06726AA568974DECD09BB55832EFC5E3; // System.Collections.Generic.List`1<System.Object> struct List_1_t3F94120C77410A62EAE48421CF166B83AB95A2F5; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Utilities.ObjectCollectionNode> struct List_1_t29393CFCB0863D330AB372BF797A6414AAF9361A; // System.Collections.Generic.List`1<UnityEngine.ResourceManagement.Util.ObjectInitializationData> struct List_1_t0DF9D498983B77B207A7E6FC612A1E79C607F026; // System.Collections.Generic.List`1<UnityEngine.XR.OpenXR.Features.OpenXRFeature> struct List_1_t69CEC00F595A8BB73301BF89074DA3A4B55C3AB8; // System.Collections.Generic.List`1<System.Linq.Expressions.ParameterExpression> struct List_1_tCDDF33E8793E2DD752E38CC326B13F8F35B1493B; // System.Collections.Generic.List`1<System.Reflection.ParameterInfo> struct List_1_t9F7FFCE36BD167865BC8C0D36E0A99541B5053A4; // System.Collections.Generic.List`1<System.Text.Json.ParameterRef> struct List_1_tDB80B88112CB405F5EF227040AD5ACDE7537AF9B; // System.Collections.Generic.List`1<Newtonsoft.Json.Linq.JsonPath.PathFilter> struct List_1_t6E23A1B057D30F5DC1DBAEFD42471C547DACF7D1; // System.Collections.Generic.List`1<UnityEngine.Events.PersistentCall> struct List_1_t0AA6B1123983D70EF4686E9230A4AE3DC192BB3E; // System.Collections.Generic.List`1<System.Net.Http.Headers.ProductHeaderValue> struct List_1_t6C24F1F02C5782B86B66A6539B9C36772CFD0F27; // System.Collections.Generic.List`1<System.Net.Http.Headers.ProductInfoHeaderValue> struct List_1_t1C2D8D12CF00CD88F5713BAFCA3B09384DFF1876; // System.Collections.Generic.List`1<System.Diagnostics.Tracing.PropertyAnalysis> struct List_1_tBEBB5482A4BC53228DC48B4E63129118D3FF13F9; // System.Collections.Generic.List`1<System.Reflection.PropertyInfo> struct List_1_t6D217E5C7E8FD2DA6CE90941A9E364AEFB622521; // System.Collections.Generic.List`1<System.Text.Json.PropertyRef> struct List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Utilities.ProximityLight> struct List_1_t2A7ED3D3BFD624EA6915FD97FACD1BAF8588F3C8; // System.Collections.Generic.List`1<Newtonsoft.Json.Linq.JsonPath.QueryExpression> struct List_1_tD64A321002D591A55E27DE10BDE1C4E0703E541D; // System.Collections.Generic.List`1<System.Net.Http.Headers.RangeItemHeaderValue> struct List_1_t5906750D1FA9DF16B29D9BBB3DF4A7D967849E9D; // System.Collections.Generic.List`1<System.Xml.Schema.RangePositionInfo> struct List_1_t13B1332790E09F181E14718B9800D8D500D6508A; // System.Collections.Generic.List`1<UnityEngine.Ray> struct List_1_tDBBF8003D7BAC756EE5262C1DF03096EB730DF2B; // System.Collections.Generic.List`1<UnityEngine.RaycastHit2D> struct List_1_t3926283FA9AE49778D95220056CEBFB01D034379; // System.Collections.Generic.List`1<UnityEngine.EventSystems.RaycastResult> struct List_1_t367B604D3EA3D6A9EC95A32A521EF83F5DA9B447; // System.Collections.Generic.List`1<System.Text.Json.ReadStackFrame> struct List_1_t814EF893AA45ADB5DD8897F915DAADC58EBB5CDD; // System.Collections.Generic.List`1<UnityEngine.Rect> struct List_1_t7AFC5094F7C1D24DAAA8893B11B1743A7A0D2CFE; // System.Collections.Generic.List`1<UnityEngine.UI.RectMask2D> struct List_1_t5709CD2CBFF795FF126CD146B019D4F8EC972EA0; // System.Collections.Generic.List`1<UnityEngine.RectTransform> struct List_1_t432BA4439FC00E108A9A351BD7FBCD9242270BB3; // System.Collections.Generic.List`1<Newtonsoft.Json.Utilities.ReflectionObject> struct List_1_t04A11A365D1B0F4481DE8D0B98866FF3448D2190; // System.Collections.Generic.List`1<System.Text.RegularExpressions.RegexNode> struct List_1_t692D260BEBA1E69864C98DEEDB3E9256C38CD9B9; // System.Collections.Generic.List`1<System.Text.RegularExpressions.RegexOptions> struct List_1_tE931333A40AB4E57F72E00F9F23D19057C78120A; // System.Collections.Generic.List`1<UnityEngine.Renderer> struct List_1_tB73BF10E0869BDB4D391E61BA46B75BECA4DCDBE; // System.Collections.Generic.List`1<UnityEngine.AddressableAssets.ResourceLocators.ResourceLocationData> struct List_1_tBDF311CB6BA8AF1C9046A9DAC3502AC9DF88EF55; // System.Collections.Generic.List`1<UnityEngine.Rigidbody2D> struct List_1_t61A36FEC0532A7CC39DB1770BFA5C1967348FAC1; // System.Collections.Generic.List`1<System.RuntimeType> struct List_1_tEEBD8E5ADEDE83E8B8DE9EC2D7E51CC1CA3781FB; // System.Collections.Generic.List`1<System.SByte> struct List_1_t7F0E10DCBF1EBD7FBCA81F990C2A8D07D7A611F7; // System.Collections.Generic.List`1<UnityEngine.SceneManagement.Scene> struct List_1_tF5A06610AC52E0ED9B7CE8B210E3276277D82AB2; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo> struct List_1_t200C70CE862FA6E0DBEFF218216B9F2457FF8AA7; // System.Collections.Generic.List`1<Microsoft.Extensions.Logging.ScopeLogger> struct List_1_t457B983379D6AAAF8C7055865C97247A7692EBA0; // System.Collections.Generic.List`1<UnityEngine.UI.Selectable> struct List_1_tD50A05AC44A86F2E776026D9FDC324209732D596; // System.Collections.Generic.List`1<Newtonsoft.Json.Serialization.SerializationCallback> struct List_1_t034C805F39B6FA51E477B0FC504E4B759DD04E6A; // System.Collections.Generic.List`1<Newtonsoft.Json.Serialization.SerializationErrorCallback> struct List_1_tDBA82B94AA0D0574EF603767BE27018AAB64E33D; // System.Collections.Generic.List`1<System.Runtime.Serialization.SerializationFieldInfo> struct List_1_t9DC8C84A6776E660211AF51D23AA261ACEF28030; // System.Collections.Generic.List`1<Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey> struct List_1_t5F6F03390AD79E0AD57F69CF0CC51BA82A6B93AD; // System.Collections.Generic.List`1<Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite> struct List_1_tCDFC27E0CDAC23F07DAB9B7F9ADAED42B49E33CF; // System.Collections.Generic.List`1<Microsoft.Extensions.DependencyInjection.ServiceDescriptor> struct List_1_tA289FD70F5721465B88F8C1FAC5171E21FDD40BF; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Utilities.Facades.ServiceFacade> struct List_1_tA177816BB2C4270956C0BC6AB7A9EDA8F1C90418; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.ShaderProperties> struct List_1_tE24CFD96194A4B94700B89080849B94C2BD4A200; // System.Collections.Generic.List`1<System.Single> struct List_1_t6726F9309570A0BDC5D42E10777F3E2931C487AA; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Utilities.Solvers.Solver> struct List_1_t45DC9F83BCA4BF8675443CB5EBCC9C8F3AC0BD48; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessPlanarObject> struct List_1_t3562C0F493A7820942DA03A973792E34EE1BD2BA; // System.Collections.Generic.List`1<UnityEngine.Sprite> struct List_1_t99B54448C695C6F7103A0DE4320F1A7EF7B30880; // System.Collections.Generic.List`1<System.Diagnostics.StackFrame> struct List_1_t2E01C571E733112C39E0970BF9193E00B487FF86; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.State> struct List_1_tE73297D82D6BE8DCD12F5123B82E10CBBFE29EFE; // System.Collections.Generic.List`1<System.String> struct List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3; // System.Collections.Generic.List`1<System.Net.Http.Headers.StringWithQualityHeaderValue> struct List_1_t9D9209E4EC339A2F86E05CF8E2C24BF784FB7F0C; // System.Collections.Generic.List`1<UnityEngine.Rendering.SubMeshDescriptor> struct List_1_t91F626A5901913D170F5E6735038E9D7A51C33E9; // System.Collections.Generic.List`1<UnityEngine.InputSystem.Utilities.Substring> struct List_1_tAB9856DBE14D81F1CC9D0D573006894E79EB7FF9; // System.Collections.Generic.List`1<UnityEngine.Subsystem> struct List_1_t58BB84B47855540E6D2640B387506E01436DCF82; // System.Collections.Generic.List`1<Microsoft.MixedReality.OpenXR.SubsystemController> struct List_1_tEEECEA57D9B6B750155ECE903A717AD8724B6CB4; // System.Collections.Generic.List`1<UnityEngine.SubsystemDescriptor> struct List_1_t32E50BD66297C6541AEA401E1C13D4EC530CC56B; // System.Collections.Generic.List`1<UnityEngine.SubsystemsImplementation.SubsystemDescriptorWithProvider> struct List_1_t4DCA5C48F3390AC8CD79C7AD8D0963D5DAE5CF2E; // System.Collections.Generic.List`1<UnityEngine.SubsystemsImplementation.SubsystemWithProvider> struct List_1_t6E613DAFFAFE896B759F1C5260D6234F04C9DD41; // System.Collections.Generic.List`1<TMPro.TMP_Character> struct List_1_tE8F1656A7A5AF5AEE27ED7B656B56CACB417FEB8; // System.Collections.Generic.List`1<TMPro.TMP_FontAsset> struct List_1_tBE22F0B6C1EBDB760862FAD201AFE75E3DEBBBFD; // System.Collections.Generic.List`1<TMPro.TMP_GlyphPairAdjustmentRecord> struct List_1_tDFE35C4D82EC736078A1C899175E5F6747C41D60; // System.Collections.Generic.List`1<TMPro.TMP_SpriteAsset> struct List_1_tD057592B5C6E2EF6CBE5ADC501E5D58919E8B364; // System.Collections.Generic.List`1<TMPro.TMP_SpriteCharacter> struct List_1_t7850FCF22796079854614A9268CE558E34108A02; // System.Collections.Generic.List`1<TMPro.TMP_SpriteGlyph> struct List_1_tF7848685CB961B42606831D4C30E1C31069D91C8; // System.Collections.Generic.List`1<TMPro.TMP_Style> struct List_1_t45639C9CAC14492B91832F71F3BE40F75A336649; // System.Collections.Generic.Queue`1<System.String> struct Queue_1_tD2C03A5990B5958D85846D872A22AA67F3E8F97D; // System.Collections.Generic.Stack`1<System.Object> struct Stack_1_t92AC5F573A3C00899B24B775A71B4327D588E981; // System.Collections.Generic.Stack`1<System.Linq.Expressions.ParameterExpression> struct Stack_1_t5A78D7BE355DFAF5BE94ADF12FB8288AE28D4B4F; // System.Byte[] struct ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726; // System.Char[] struct CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34; // System.Decimal[] struct DecimalU5BU5D_tAA3302A4A6ACCE77638A2346993A0FAAE2F9FDBA; // UnityEngine.InputSystem.Utilities.NamedValue[] struct NamedValueU5BU5D_t14E74CFBB3D0ED7EC9222CFA9E959246B9E4DB15; // System.Text.Json.ArgumentState struct ArgumentState_t12473DA2560B3F7D67458F48D08F0C78FBE42AC5; // UnityEngine.EventSystems.BaseRaycaster struct BaseRaycaster_tBC0FB2CBE6D3D40991EC20F689C43F76AD82A876; // System.Xml.Schema.BitSet struct BitSet_t36CD5E21CDE8972A6BCEF9E414933DD893966438; // UnityEngine.GameObject struct GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319; // Microsoft.Extensions.Logging.IExternalScopeProvider struct IExternalScopeProvider_t534D89246C018937B01103D64920F459956EEB97; // Microsoft.Extensions.Logging.ILogger struct ILogger_tEAA0D727D491847F2FE185047B16B6C5B185AF53; // System.Text.Json.JsonClassInfo struct JsonClassInfo_tD68347CE667BE8A8421B64672918C17B63087226; // System.Text.Json.JsonParameterInfo struct JsonParameterInfo_tFDA8A76E9154953FFDFB9EAB8583541C789A374A; // System.Text.Json.JsonPropertyInfo struct JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B; // UnityEngine.MeshRenderer struct MeshRenderer_tCD983A2F635E12BCB0BAA2E635D96A318757908B; // System.Reflection.MethodBase struct MethodBase_t; // System.Reflection.MethodInfo struct MethodInfo_t; // Microsoft.MixedReality.Toolkit.MixedRealityToolkit struct MixedRealityToolkit_t87D960E87DD2CA82936E4D50BC26D499B5A6B1CE; // Microsoft.Maps.Unity.ModelTileLayer struct ModelTileLayer_t9E88CC357A18680DBAC99AF1275B66322FAC7214; // System.ModifierSpec struct ModifierSpec_t329130037E411891DCA0029BE3125EDD8E477F29; // System.Reflection.Module struct Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7; // System.Net.Http.Headers.NameValueHeaderValue struct NameValueHeaderValue_t9CE55B6AF43CC0DCB99913858925E353A54ED14F; // System.Net.Http.Headers.NameValueWithParametersHeaderValue struct NameValueWithParametersHeaderValue_t5B8F9049E051990877FE8CBC6D4E5D19FDCF6E7A; // Microsoft.MixedReality.Toolkit.Input.NearInteractionTouchableUnityUI struct NearInteractionTouchableUnityUI_tEA3FADBF358FC42279B1AF7C296AE278EA902001; // UnityEngine.Object struct Object_tF2F3778131EFF286AF62B7B013A170F95A91571A; // Microsoft.MixedReality.Toolkit.Utilities.ObjectCollectionNode struct ObjectCollectionNode_t812FA3C17957FD7687D595FFF579B534E1347F8E; // UnityEngine.XR.OpenXR.Features.OpenXRFeature struct OpenXRFeature_tBDE19E44A01E5E54925EAF67574691F11E88CDAA; // System.Linq.Expressions.ParameterExpression struct ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE; // System.Reflection.ParameterInfo struct ParameterInfo_t9D9DBDD93E685815E35F4F6D6F58E90EBC8852B7; // Newtonsoft.Json.Linq.JsonPath.PathFilter struct PathFilter_t0D185940B506CC37399A67EED25738F24A94846D; // UnityEngine.Events.PersistentCall struct PersistentCall_tD4B4BC3A0C50BD829EB4511AEB9862EF8045C8E9; // System.Net.Http.Headers.ProductHeaderValue struct ProductHeaderValue_t1B44332AC0C0BDA9F22C46B5958065BAE1A3A466; // System.Net.Http.Headers.ProductInfoHeaderValue struct ProductInfoHeaderValue_t059252673D4DBB03580187CE9E7F4BF07A6D763A; // System.Diagnostics.Tracing.PropertyAnalysis struct PropertyAnalysis_tADEA699C2962F2D6E63C2818A7C5E24BFADE61E8; // System.Reflection.PropertyInfo struct PropertyInfo_t; // Microsoft.MixedReality.Toolkit.Utilities.ProximityLight struct ProximityLight_t719C5F260C41BB12FDEF5C8CC99B65A459777E08; // Newtonsoft.Json.Linq.JsonPath.QueryExpression struct QueryExpression_t8D8090F4AFDEC9493D2C8ECB42B8BEE65AC701FE; // System.Net.Http.Headers.RangeItemHeaderValue struct RangeItemHeaderValue_t3D0E66AE657E94419D7FEBFF8E2B29FAFCB1BDAF; // UnityEngine.UI.RectMask2D struct RectMask2D_tD909811991B341D752E4C978C89EFB80FA7A2B15; // UnityEngine.RectTransform struct RectTransform_t8A6A306FB29A6C8C22010CF9040E319753571072; // Newtonsoft.Json.Utilities.ReflectionObject struct ReflectionObject_t5D0E8101861B20103042D9ED10ADF480B794B862; // System.Text.RegularExpressions.RegexNode struct RegexNode_t0C22422611EBAF941144402F8CAB0FA1A0AE7D43; // UnityEngine.Renderer struct Renderer_t58147AB5B00224FE1460FD47542DC0DA7EC9378C; // UnityEngine.AddressableAssets.ResourceLocators.ResourceLocationData struct ResourceLocationData_tDE44E4FB8CCDB61F532FCA1140616ED8D31A2FE4; // UnityEngine.Rigidbody2D struct Rigidbody2D_tD23204FEE9CB4A36737043B97FD409DE05D5DCE5; // System.RuntimeType struct RuntimeType_t4F49C0B3B2871AECF65AF5FA3E42BAB5B0C1FD07; // UnityEngine.UI.Selectable struct Selectable_t34088A3677CC9D344F81B0D91999D8C5963D7DBD; // Newtonsoft.Json.Serialization.SerializationCallback struct SerializationCallback_t42429ABF00EBB89529A12C31EF19D19CA1A5E3B0; // Newtonsoft.Json.Serialization.SerializationErrorCallback struct SerializationErrorCallback_t9BE7F921E784C3B63A03DFDF679CBA907F7F56F8; // System.Runtime.Serialization.SerializationFieldInfo struct SerializationFieldInfo_t0D5EE593AFBF37E72513E2979070B344BCBD8C55; // Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite struct ServiceCallSite_tF7B1C139E2FCE9624A78A8E5530E0DB24C442469; // Microsoft.Extensions.DependencyInjection.ServiceDescriptor struct ServiceDescriptor_t47B920FA078FBF60386AD4FC94F6549F7FFDFD2C; // Microsoft.MixedReality.Toolkit.Utilities.Facades.ServiceFacade struct ServiceFacade_tE88BCA105B985B6599454D2144C9D6C864B66D15; // Microsoft.MixedReality.Toolkit.Utilities.Solvers.Solver struct Solver_t8BBDA74686483C111074BE6BE588AB31E74B2971; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessPlanarObject struct SpatialAwarenessPlanarObject_t548FB81C44BB10562EBA2CD41024B3A84ED7BDEE; // UnityEngine.Sprite struct Sprite_t5B10B1178EC2E6F53D33FFD77557F31C08A51ED9; // System.Diagnostics.StackFrame struct StackFrame_t6018A5362C2E8F6F80F153F3D40623D213094E0F; // Microsoft.MixedReality.Toolkit.UI.State struct State_t8BC3593EACE0EB077EF575219685CFDB44245AB4; // System.String struct String_t; // System.Net.Http.Headers.StringWithQualityHeaderValue struct StringWithQualityHeaderValue_t921EEF897C63829C493FB11E76613C1E23021066; // UnityEngine.Subsystem struct Subsystem_t2D97454A946149D608974CB6B674F5F5C613A6A4; // Microsoft.MixedReality.OpenXR.SubsystemController struct SubsystemController_t65D69698981F54C67583A1ABFDC0E5259676D77B; // UnityEngine.SubsystemDescriptor struct SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245; // UnityEngine.SubsystemsImplementation.SubsystemDescriptorWithProvider struct SubsystemDescriptorWithProvider_t32DD334657CFBA22F2FBA399258B087104A29C3E; // UnityEngine.SubsystemsImplementation.SubsystemWithProvider struct SubsystemWithProvider_t1C1868CF8676F5596C1AD20A7CE69BDF7C7DE73E; // TMPro.TMP_Character struct TMP_Character_tE7A98584C4DDFC9E1A1D883F4A5DE99E5DE7CC0C; // TMPro.TMP_FontAsset struct TMP_FontAsset_tDD8F58129CF4A9094C82DD209531E9E71F9837B2; // TMPro.TMP_GlyphPairAdjustmentRecord struct TMP_GlyphPairAdjustmentRecord_t79F65D973582F66AF3787F0C63E6E6575C8E0C10; // TMPro.TMP_SpriteAsset struct TMP_SpriteAsset_t0746714D8A56C0A27AE56DC6897CC1A129220714; // TMPro.TMP_SpriteCharacter struct TMP_SpriteCharacter_t77E119FE8164154A682A4F70E7787B2C56A0E9BE; // TMPro.TMP_SpriteGlyph struct TMP_SpriteGlyph_t5DF3D3BFFC0D0A72ABEBA3490F804B591BF1F25D; // TMPro.TMP_Style struct TMP_Style_t078D8A76F4A60B868298420272B7089582EF53AB; // System.Type struct Type_t; // System.Void struct Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5; struct Decimal_t2978B229CA86D3B7BA66A0AEEE014E0DE4F940D7 ; struct Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_marshaled_com; IL2CPP_EXTERN_C_BEGIN IL2CPP_EXTERN_C_END #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Windows.Foundation.IClosable struct NOVTABLE IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() = 0; }; // System.Object // System.ValueType struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52 : public RuntimeObject { public: public: }; // Native definition for P/Invoke marshalling of System.ValueType struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_pinvoke { }; // Native definition for COM marshalling of System.ValueType struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_com { }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.MeshRenderer> struct Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tC57263F48ADF56B702DF7112B29D6B6A1ED7332D * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current MeshRenderer_tCD983A2F635E12BCB0BAA2E635D96A318757908B * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D, ___list_0)); } inline List_1_tC57263F48ADF56B702DF7112B29D6B6A1ED7332D * get_list_0() const { return ___list_0; } inline List_1_tC57263F48ADF56B702DF7112B29D6B6A1ED7332D ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tC57263F48ADF56B702DF7112B29D6B6A1ED7332D * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D, ___current_3)); } inline MeshRenderer_tCD983A2F635E12BCB0BAA2E635D96A318757908B * get_current_3() const { return ___current_3; } inline MeshRenderer_tCD983A2F635E12BCB0BAA2E635D96A318757908B ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(MeshRenderer_tCD983A2F635E12BCB0BAA2E635D96A318757908B * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Reflection.MethodBase> struct Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tB44C7B5F349493CA4773841848542C6C7AA7BC41 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current MethodBase_t * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0, ___list_0)); } inline List_1_tB44C7B5F349493CA4773841848542C6C7AA7BC41 * get_list_0() const { return ___list_0; } inline List_1_tB44C7B5F349493CA4773841848542C6C7AA7BC41 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tB44C7B5F349493CA4773841848542C6C7AA7BC41 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0, ___current_3)); } inline MethodBase_t * get_current_3() const { return ___current_3; } inline MethodBase_t ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(MethodBase_t * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Reflection.MethodInfo> struct Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t110010ECD885734BF7EEAE609A01E1C757A363C4 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current MethodInfo_t * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F, ___list_0)); } inline List_1_t110010ECD885734BF7EEAE609A01E1C757A363C4 * get_list_0() const { return ___list_0; } inline List_1_t110010ECD885734BF7EEAE609A01E1C757A363C4 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t110010ECD885734BF7EEAE609A01E1C757A363C4 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F, ___current_3)); } inline MethodInfo_t * get_current_3() const { return ___current_3; } inline MethodInfo_t ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(MethodInfo_t * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.MixedRealityToolkit> struct Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t9A515F799E0BF2C22F0A5126C6218D126A8A5D67 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current MixedRealityToolkit_t87D960E87DD2CA82936E4D50BC26D499B5A6B1CE * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D, ___list_0)); } inline List_1_t9A515F799E0BF2C22F0A5126C6218D126A8A5D67 * get_list_0() const { return ___list_0; } inline List_1_t9A515F799E0BF2C22F0A5126C6218D126A8A5D67 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t9A515F799E0BF2C22F0A5126C6218D126A8A5D67 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D, ___current_3)); } inline MixedRealityToolkit_t87D960E87DD2CA82936E4D50BC26D499B5A6B1CE * get_current_3() const { return ___current_3; } inline MixedRealityToolkit_t87D960E87DD2CA82936E4D50BC26D499B5A6B1CE ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(MixedRealityToolkit_t87D960E87DD2CA82936E4D50BC26D499B5A6B1CE * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.Maps.Unity.ModelTileLayer> struct Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t2B566AA13A8DCEBADFE6EE0AD269C538E9A107FA * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ModelTileLayer_t9E88CC357A18680DBAC99AF1275B66322FAC7214 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A, ___list_0)); } inline List_1_t2B566AA13A8DCEBADFE6EE0AD269C538E9A107FA * get_list_0() const { return ___list_0; } inline List_1_t2B566AA13A8DCEBADFE6EE0AD269C538E9A107FA ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t2B566AA13A8DCEBADFE6EE0AD269C538E9A107FA * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A, ___current_3)); } inline ModelTileLayer_t9E88CC357A18680DBAC99AF1275B66322FAC7214 * get_current_3() const { return ___current_3; } inline ModelTileLayer_t9E88CC357A18680DBAC99AF1275B66322FAC7214 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ModelTileLayer_t9E88CC357A18680DBAC99AF1275B66322FAC7214 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.ModifierSpec> struct Enumerator_t57DFAB26A5F13837E75358368035928D516359B7 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tF0C12A80ED2228F19412CFF80CBDD6C9D3C7021E * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RuntimeObject* ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t57DFAB26A5F13837E75358368035928D516359B7, ___list_0)); } inline List_1_tF0C12A80ED2228F19412CFF80CBDD6C9D3C7021E * get_list_0() const { return ___list_0; } inline List_1_tF0C12A80ED2228F19412CFF80CBDD6C9D3C7021E ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tF0C12A80ED2228F19412CFF80CBDD6C9D3C7021E * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t57DFAB26A5F13837E75358368035928D516359B7, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t57DFAB26A5F13837E75358368035928D516359B7, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t57DFAB26A5F13837E75358368035928D516359B7, ___current_3)); } inline RuntimeObject* get_current_3() const { return ___current_3; } inline RuntimeObject** get_address_of_current_3() { return &___current_3; } inline void set_current_3(RuntimeObject* value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Reflection.Module> struct Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tDCBFF7CC97E93320F1E0D7BB75506E610A3B21E6 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050, ___list_0)); } inline List_1_tDCBFF7CC97E93320F1E0D7BB75506E610A3B21E6 * get_list_0() const { return ___list_0; } inline List_1_tDCBFF7CC97E93320F1E0D7BB75506E610A3B21E6 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tDCBFF7CC97E93320F1E0D7BB75506E610A3B21E6 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050, ___current_3)); } inline Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7 * get_current_3() const { return ___current_3; } inline Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.NameValueHeaderValue> struct Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t691D15165F1892D11210DB2AA498EEE4ACA54806 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current NameValueHeaderValue_t9CE55B6AF43CC0DCB99913858925E353A54ED14F * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7, ___list_0)); } inline List_1_t691D15165F1892D11210DB2AA498EEE4ACA54806 * get_list_0() const { return ___list_0; } inline List_1_t691D15165F1892D11210DB2AA498EEE4ACA54806 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t691D15165F1892D11210DB2AA498EEE4ACA54806 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7, ___current_3)); } inline NameValueHeaderValue_t9CE55B6AF43CC0DCB99913858925E353A54ED14F * get_current_3() const { return ___current_3; } inline NameValueHeaderValue_t9CE55B6AF43CC0DCB99913858925E353A54ED14F ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(NameValueHeaderValue_t9CE55B6AF43CC0DCB99913858925E353A54ED14F * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.NameValueWithParametersHeaderValue> struct Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t0DC70AE225961ECB1330C0A47271A83D450275C7 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current NameValueWithParametersHeaderValue_t5B8F9049E051990877FE8CBC6D4E5D19FDCF6E7A * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB, ___list_0)); } inline List_1_t0DC70AE225961ECB1330C0A47271A83D450275C7 * get_list_0() const { return ___list_0; } inline List_1_t0DC70AE225961ECB1330C0A47271A83D450275C7 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t0DC70AE225961ECB1330C0A47271A83D450275C7 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB, ___current_3)); } inline NameValueWithParametersHeaderValue_t5B8F9049E051990877FE8CBC6D4E5D19FDCF6E7A * get_current_3() const { return ___current_3; } inline NameValueWithParametersHeaderValue_t5B8F9049E051990877FE8CBC6D4E5D19FDCF6E7A ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(NameValueWithParametersHeaderValue_t5B8F9049E051990877FE8CBC6D4E5D19FDCF6E7A * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Input.NearInteractionTouchableUnityUI> struct Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t5CC7153B06726AA568974DECD09BB55832EFC5E3 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current NearInteractionTouchableUnityUI_tEA3FADBF358FC42279B1AF7C296AE278EA902001 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87, ___list_0)); } inline List_1_t5CC7153B06726AA568974DECD09BB55832EFC5E3 * get_list_0() const { return ___list_0; } inline List_1_t5CC7153B06726AA568974DECD09BB55832EFC5E3 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t5CC7153B06726AA568974DECD09BB55832EFC5E3 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87, ___current_3)); } inline NearInteractionTouchableUnityUI_tEA3FADBF358FC42279B1AF7C296AE278EA902001 * get_current_3() const { return ___current_3; } inline NearInteractionTouchableUnityUI_tEA3FADBF358FC42279B1AF7C296AE278EA902001 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(NearInteractionTouchableUnityUI_tEA3FADBF358FC42279B1AF7C296AE278EA902001 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.HashSet`1/Enumerator<System.Object> struct Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A { public: // System.Collections.Generic.HashSet`1<T> System.Collections.Generic.HashSet`1/Enumerator::_set HashSet_1_t680119C7ED8D82AED56CDB83DF6F0E9149852A9B * ____set_0; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_index int32_t ____index_1; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_version int32_t ____version_2; // T System.Collections.Generic.HashSet`1/Enumerator::_current RuntimeObject * ____current_3; public: inline static int32_t get_offset_of__set_0() { return static_cast<int32_t>(offsetof(Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A, ____set_0)); } inline HashSet_1_t680119C7ED8D82AED56CDB83DF6F0E9149852A9B * get__set_0() const { return ____set_0; } inline HashSet_1_t680119C7ED8D82AED56CDB83DF6F0E9149852A9B ** get_address_of__set_0() { return &____set_0; } inline void set__set_0(HashSet_1_t680119C7ED8D82AED56CDB83DF6F0E9149852A9B * value) { ____set_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____set_0), (void*)value); } inline static int32_t get_offset_of__index_1() { return static_cast<int32_t>(offsetof(Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A, ____index_1)); } inline int32_t get__index_1() const { return ____index_1; } inline int32_t* get_address_of__index_1() { return &____index_1; } inline void set__index_1(int32_t value) { ____index_1 = value; } inline static int32_t get_offset_of__version_2() { return static_cast<int32_t>(offsetof(Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A, ____version_2)); } inline int32_t get__version_2() const { return ____version_2; } inline int32_t* get_address_of__version_2() { return &____version_2; } inline void set__version_2(int32_t value) { ____version_2 = value; } inline static int32_t get_offset_of__current_3() { return static_cast<int32_t>(offsetof(Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A, ____current_3)); } inline RuntimeObject * get__current_3() const { return ____current_3; } inline RuntimeObject ** get_address_of__current_3() { return &____current_3; } inline void set__current_3(RuntimeObject * value) { ____current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Object> struct Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t3F94120C77410A62EAE48421CF166B83AB95A2F5 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RuntimeObject * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6, ___list_0)); } inline List_1_t3F94120C77410A62EAE48421CF166B83AB95A2F5 * get_list_0() const { return ___list_0; } inline List_1_t3F94120C77410A62EAE48421CF166B83AB95A2F5 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t3F94120C77410A62EAE48421CF166B83AB95A2F5 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6, ___current_3)); } inline RuntimeObject * get_current_3() const { return ___current_3; } inline RuntimeObject ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(RuntimeObject * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.Stack`1/Enumerator<System.Object> struct Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514 { public: // System.Collections.Generic.Stack`1<T> System.Collections.Generic.Stack`1/Enumerator::_stack Stack_1_t92AC5F573A3C00899B24B775A71B4327D588E981 * ____stack_0; // System.Int32 System.Collections.Generic.Stack`1/Enumerator::_version int32_t ____version_1; // System.Int32 System.Collections.Generic.Stack`1/Enumerator::_index int32_t ____index_2; // T System.Collections.Generic.Stack`1/Enumerator::_currentElement RuntimeObject * ____currentElement_3; public: inline static int32_t get_offset_of__stack_0() { return static_cast<int32_t>(offsetof(Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514, ____stack_0)); } inline Stack_1_t92AC5F573A3C00899B24B775A71B4327D588E981 * get__stack_0() const { return ____stack_0; } inline Stack_1_t92AC5F573A3C00899B24B775A71B4327D588E981 ** get_address_of__stack_0() { return &____stack_0; } inline void set__stack_0(Stack_1_t92AC5F573A3C00899B24B775A71B4327D588E981 * value) { ____stack_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____stack_0), (void*)value); } inline static int32_t get_offset_of__version_1() { return static_cast<int32_t>(offsetof(Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514, ____version_1)); } inline int32_t get__version_1() const { return ____version_1; } inline int32_t* get_address_of__version_1() { return &____version_1; } inline void set__version_1(int32_t value) { ____version_1 = value; } inline static int32_t get_offset_of__index_2() { return static_cast<int32_t>(offsetof(Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514, ____index_2)); } inline int32_t get__index_2() const { return ____index_2; } inline int32_t* get_address_of__index_2() { return &____index_2; } inline void set__index_2(int32_t value) { ____index_2 = value; } inline static int32_t get_offset_of__currentElement_3() { return static_cast<int32_t>(offsetof(Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514, ____currentElement_3)); } inline RuntimeObject * get__currentElement_3() const { return ____currentElement_3; } inline RuntimeObject ** get_address_of__currentElement_3() { return &____currentElement_3; } inline void set__currentElement_3(RuntimeObject * value) { ____currentElement_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____currentElement_3), (void*)value); } }; // System.Collections.Generic.HashSet`1/Enumerator<UnityEngine.Object> struct Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E { public: // System.Collections.Generic.HashSet`1<T> System.Collections.Generic.HashSet`1/Enumerator::_set HashSet_1_t658A4F799C39BCEF71EEB383AC1FCCFDC8447673 * ____set_0; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_index int32_t ____index_1; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_version int32_t ____version_2; // T System.Collections.Generic.HashSet`1/Enumerator::_current Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * ____current_3; public: inline static int32_t get_offset_of__set_0() { return static_cast<int32_t>(offsetof(Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E, ____set_0)); } inline HashSet_1_t658A4F799C39BCEF71EEB383AC1FCCFDC8447673 * get__set_0() const { return ____set_0; } inline HashSet_1_t658A4F799C39BCEF71EEB383AC1FCCFDC8447673 ** get_address_of__set_0() { return &____set_0; } inline void set__set_0(HashSet_1_t658A4F799C39BCEF71EEB383AC1FCCFDC8447673 * value) { ____set_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____set_0), (void*)value); } inline static int32_t get_offset_of__index_1() { return static_cast<int32_t>(offsetof(Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E, ____index_1)); } inline int32_t get__index_1() const { return ____index_1; } inline int32_t* get_address_of__index_1() { return &____index_1; } inline void set__index_1(int32_t value) { ____index_1 = value; } inline static int32_t get_offset_of__version_2() { return static_cast<int32_t>(offsetof(Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E, ____version_2)); } inline int32_t get__version_2() const { return ____version_2; } inline int32_t* get_address_of__version_2() { return &____version_2; } inline void set__version_2(int32_t value) { ____version_2 = value; } inline static int32_t get_offset_of__current_3() { return static_cast<int32_t>(offsetof(Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E, ____current_3)); } inline Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * get__current_3() const { return ____current_3; } inline Object_tF2F3778131EFF286AF62B7B013A170F95A91571A ** get_address_of__current_3() { return &____current_3; } inline void set__current_3(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * value) { ____current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Utilities.ObjectCollectionNode> struct Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t29393CFCB0863D330AB372BF797A6414AAF9361A * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ObjectCollectionNode_t812FA3C17957FD7687D595FFF579B534E1347F8E * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F, ___list_0)); } inline List_1_t29393CFCB0863D330AB372BF797A6414AAF9361A * get_list_0() const { return ___list_0; } inline List_1_t29393CFCB0863D330AB372BF797A6414AAF9361A ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t29393CFCB0863D330AB372BF797A6414AAF9361A * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F, ___current_3)); } inline ObjectCollectionNode_t812FA3C17957FD7687D595FFF579B534E1347F8E * get_current_3() const { return ___current_3; } inline ObjectCollectionNode_t812FA3C17957FD7687D595FFF579B534E1347F8E ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ObjectCollectionNode_t812FA3C17957FD7687D595FFF579B534E1347F8E * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.XR.OpenXR.Features.OpenXRFeature> struct Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t69CEC00F595A8BB73301BF89074DA3A4B55C3AB8 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current OpenXRFeature_tBDE19E44A01E5E54925EAF67574691F11E88CDAA * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C, ___list_0)); } inline List_1_t69CEC00F595A8BB73301BF89074DA3A4B55C3AB8 * get_list_0() const { return ___list_0; } inline List_1_t69CEC00F595A8BB73301BF89074DA3A4B55C3AB8 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t69CEC00F595A8BB73301BF89074DA3A4B55C3AB8 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C, ___current_3)); } inline OpenXRFeature_tBDE19E44A01E5E54925EAF67574691F11E88CDAA * get_current_3() const { return ___current_3; } inline OpenXRFeature_tBDE19E44A01E5E54925EAF67574691F11E88CDAA ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(OpenXRFeature_tBDE19E44A01E5E54925EAF67574691F11E88CDAA * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.HashSet`1/Enumerator<System.Linq.Expressions.ParameterExpression> struct Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F { public: // System.Collections.Generic.HashSet`1<T> System.Collections.Generic.HashSet`1/Enumerator::_set HashSet_1_t42A3AC337CA15FAC250AA5DA438F909806C72CB0 * ____set_0; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_index int32_t ____index_1; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_version int32_t ____version_2; // T System.Collections.Generic.HashSet`1/Enumerator::_current ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE * ____current_3; public: inline static int32_t get_offset_of__set_0() { return static_cast<int32_t>(offsetof(Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F, ____set_0)); } inline HashSet_1_t42A3AC337CA15FAC250AA5DA438F909806C72CB0 * get__set_0() const { return ____set_0; } inline HashSet_1_t42A3AC337CA15FAC250AA5DA438F909806C72CB0 ** get_address_of__set_0() { return &____set_0; } inline void set__set_0(HashSet_1_t42A3AC337CA15FAC250AA5DA438F909806C72CB0 * value) { ____set_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____set_0), (void*)value); } inline static int32_t get_offset_of__index_1() { return static_cast<int32_t>(offsetof(Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F, ____index_1)); } inline int32_t get__index_1() const { return ____index_1; } inline int32_t* get_address_of__index_1() { return &____index_1; } inline void set__index_1(int32_t value) { ____index_1 = value; } inline static int32_t get_offset_of__version_2() { return static_cast<int32_t>(offsetof(Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F, ____version_2)); } inline int32_t get__version_2() const { return ____version_2; } inline int32_t* get_address_of__version_2() { return &____version_2; } inline void set__version_2(int32_t value) { ____version_2 = value; } inline static int32_t get_offset_of__current_3() { return static_cast<int32_t>(offsetof(Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F, ____current_3)); } inline ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE * get__current_3() const { return ____current_3; } inline ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE ** get_address_of__current_3() { return &____current_3; } inline void set__current_3(ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE * value) { ____current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Linq.Expressions.ParameterExpression> struct Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tCDDF33E8793E2DD752E38CC326B13F8F35B1493B * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315, ___list_0)); } inline List_1_tCDDF33E8793E2DD752E38CC326B13F8F35B1493B * get_list_0() const { return ___list_0; } inline List_1_tCDDF33E8793E2DD752E38CC326B13F8F35B1493B ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tCDDF33E8793E2DD752E38CC326B13F8F35B1493B * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315, ___current_3)); } inline ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE * get_current_3() const { return ___current_3; } inline ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.Stack`1/Enumerator<System.Linq.Expressions.ParameterExpression> struct Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2 { public: // System.Collections.Generic.Stack`1<T> System.Collections.Generic.Stack`1/Enumerator::_stack Stack_1_t5A78D7BE355DFAF5BE94ADF12FB8288AE28D4B4F * ____stack_0; // System.Int32 System.Collections.Generic.Stack`1/Enumerator::_version int32_t ____version_1; // System.Int32 System.Collections.Generic.Stack`1/Enumerator::_index int32_t ____index_2; // T System.Collections.Generic.Stack`1/Enumerator::_currentElement ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE * ____currentElement_3; public: inline static int32_t get_offset_of__stack_0() { return static_cast<int32_t>(offsetof(Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2, ____stack_0)); } inline Stack_1_t5A78D7BE355DFAF5BE94ADF12FB8288AE28D4B4F * get__stack_0() const { return ____stack_0; } inline Stack_1_t5A78D7BE355DFAF5BE94ADF12FB8288AE28D4B4F ** get_address_of__stack_0() { return &____stack_0; } inline void set__stack_0(Stack_1_t5A78D7BE355DFAF5BE94ADF12FB8288AE28D4B4F * value) { ____stack_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____stack_0), (void*)value); } inline static int32_t get_offset_of__version_1() { return static_cast<int32_t>(offsetof(Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2, ____version_1)); } inline int32_t get__version_1() const { return ____version_1; } inline int32_t* get_address_of__version_1() { return &____version_1; } inline void set__version_1(int32_t value) { ____version_1 = value; } inline static int32_t get_offset_of__index_2() { return static_cast<int32_t>(offsetof(Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2, ____index_2)); } inline int32_t get__index_2() const { return ____index_2; } inline int32_t* get_address_of__index_2() { return &____index_2; } inline void set__index_2(int32_t value) { ____index_2 = value; } inline static int32_t get_offset_of__currentElement_3() { return static_cast<int32_t>(offsetof(Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2, ____currentElement_3)); } inline ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE * get__currentElement_3() const { return ____currentElement_3; } inline ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE ** get_address_of__currentElement_3() { return &____currentElement_3; } inline void set__currentElement_3(ParameterExpression_tA7B24F1DE0F013DA4BD55F76DB43B06DB33D8BEE * value) { ____currentElement_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____currentElement_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Reflection.ParameterInfo> struct Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t9F7FFCE36BD167865BC8C0D36E0A99541B5053A4 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ParameterInfo_t9D9DBDD93E685815E35F4F6D6F58E90EBC8852B7 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B, ___list_0)); } inline List_1_t9F7FFCE36BD167865BC8C0D36E0A99541B5053A4 * get_list_0() const { return ___list_0; } inline List_1_t9F7FFCE36BD167865BC8C0D36E0A99541B5053A4 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t9F7FFCE36BD167865BC8C0D36E0A99541B5053A4 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B, ___current_3)); } inline ParameterInfo_t9D9DBDD93E685815E35F4F6D6F58E90EBC8852B7 * get_current_3() const { return ___current_3; } inline ParameterInfo_t9D9DBDD93E685815E35F4F6D6F58E90EBC8852B7 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ParameterInfo_t9D9DBDD93E685815E35F4F6D6F58E90EBC8852B7 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Linq.JsonPath.PathFilter> struct Enumerator_tC6B320324247259556EC345BE12B28C551102BB1 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t6E23A1B057D30F5DC1DBAEFD42471C547DACF7D1 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current PathFilter_t0D185940B506CC37399A67EED25738F24A94846D * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tC6B320324247259556EC345BE12B28C551102BB1, ___list_0)); } inline List_1_t6E23A1B057D30F5DC1DBAEFD42471C547DACF7D1 * get_list_0() const { return ___list_0; } inline List_1_t6E23A1B057D30F5DC1DBAEFD42471C547DACF7D1 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t6E23A1B057D30F5DC1DBAEFD42471C547DACF7D1 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tC6B320324247259556EC345BE12B28C551102BB1, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tC6B320324247259556EC345BE12B28C551102BB1, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tC6B320324247259556EC345BE12B28C551102BB1, ___current_3)); } inline PathFilter_t0D185940B506CC37399A67EED25738F24A94846D * get_current_3() const { return ___current_3; } inline PathFilter_t0D185940B506CC37399A67EED25738F24A94846D ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(PathFilter_t0D185940B506CC37399A67EED25738F24A94846D * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.Events.PersistentCall> struct Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t0AA6B1123983D70EF4686E9230A4AE3DC192BB3E * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current PersistentCall_tD4B4BC3A0C50BD829EB4511AEB9862EF8045C8E9 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9, ___list_0)); } inline List_1_t0AA6B1123983D70EF4686E9230A4AE3DC192BB3E * get_list_0() const { return ___list_0; } inline List_1_t0AA6B1123983D70EF4686E9230A4AE3DC192BB3E ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t0AA6B1123983D70EF4686E9230A4AE3DC192BB3E * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9, ___current_3)); } inline PersistentCall_tD4B4BC3A0C50BD829EB4511AEB9862EF8045C8E9 * get_current_3() const { return ___current_3; } inline PersistentCall_tD4B4BC3A0C50BD829EB4511AEB9862EF8045C8E9 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(PersistentCall_tD4B4BC3A0C50BD829EB4511AEB9862EF8045C8E9 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.ProductHeaderValue> struct Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t6C24F1F02C5782B86B66A6539B9C36772CFD0F27 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ProductHeaderValue_t1B44332AC0C0BDA9F22C46B5958065BAE1A3A466 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1, ___list_0)); } inline List_1_t6C24F1F02C5782B86B66A6539B9C36772CFD0F27 * get_list_0() const { return ___list_0; } inline List_1_t6C24F1F02C5782B86B66A6539B9C36772CFD0F27 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t6C24F1F02C5782B86B66A6539B9C36772CFD0F27 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1, ___current_3)); } inline ProductHeaderValue_t1B44332AC0C0BDA9F22C46B5958065BAE1A3A466 * get_current_3() const { return ___current_3; } inline ProductHeaderValue_t1B44332AC0C0BDA9F22C46B5958065BAE1A3A466 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ProductHeaderValue_t1B44332AC0C0BDA9F22C46B5958065BAE1A3A466 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.ProductInfoHeaderValue> struct Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t1C2D8D12CF00CD88F5713BAFCA3B09384DFF1876 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ProductInfoHeaderValue_t059252673D4DBB03580187CE9E7F4BF07A6D763A * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360, ___list_0)); } inline List_1_t1C2D8D12CF00CD88F5713BAFCA3B09384DFF1876 * get_list_0() const { return ___list_0; } inline List_1_t1C2D8D12CF00CD88F5713BAFCA3B09384DFF1876 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t1C2D8D12CF00CD88F5713BAFCA3B09384DFF1876 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360, ___current_3)); } inline ProductInfoHeaderValue_t059252673D4DBB03580187CE9E7F4BF07A6D763A * get_current_3() const { return ___current_3; } inline ProductInfoHeaderValue_t059252673D4DBB03580187CE9E7F4BF07A6D763A ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ProductInfoHeaderValue_t059252673D4DBB03580187CE9E7F4BF07A6D763A * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Diagnostics.Tracing.PropertyAnalysis> struct Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tBEBB5482A4BC53228DC48B4E63129118D3FF13F9 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current PropertyAnalysis_tADEA699C2962F2D6E63C2818A7C5E24BFADE61E8 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088, ___list_0)); } inline List_1_tBEBB5482A4BC53228DC48B4E63129118D3FF13F9 * get_list_0() const { return ___list_0; } inline List_1_tBEBB5482A4BC53228DC48B4E63129118D3FF13F9 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tBEBB5482A4BC53228DC48B4E63129118D3FF13F9 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088, ___current_3)); } inline PropertyAnalysis_tADEA699C2962F2D6E63C2818A7C5E24BFADE61E8 * get_current_3() const { return ___current_3; } inline PropertyAnalysis_tADEA699C2962F2D6E63C2818A7C5E24BFADE61E8 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(PropertyAnalysis_tADEA699C2962F2D6E63C2818A7C5E24BFADE61E8 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Reflection.PropertyInfo> struct Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t6D217E5C7E8FD2DA6CE90941A9E364AEFB622521 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current PropertyInfo_t * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA, ___list_0)); } inline List_1_t6D217E5C7E8FD2DA6CE90941A9E364AEFB622521 * get_list_0() const { return ___list_0; } inline List_1_t6D217E5C7E8FD2DA6CE90941A9E364AEFB622521 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t6D217E5C7E8FD2DA6CE90941A9E364AEFB622521 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA, ___current_3)); } inline PropertyInfo_t * get_current_3() const { return ___current_3; } inline PropertyInfo_t ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(PropertyInfo_t * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Utilities.ProximityLight> struct Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t2A7ED3D3BFD624EA6915FD97FACD1BAF8588F3C8 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ProximityLight_t719C5F260C41BB12FDEF5C8CC99B65A459777E08 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856, ___list_0)); } inline List_1_t2A7ED3D3BFD624EA6915FD97FACD1BAF8588F3C8 * get_list_0() const { return ___list_0; } inline List_1_t2A7ED3D3BFD624EA6915FD97FACD1BAF8588F3C8 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t2A7ED3D3BFD624EA6915FD97FACD1BAF8588F3C8 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856, ___current_3)); } inline ProximityLight_t719C5F260C41BB12FDEF5C8CC99B65A459777E08 * get_current_3() const { return ___current_3; } inline ProximityLight_t719C5F260C41BB12FDEF5C8CC99B65A459777E08 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ProximityLight_t719C5F260C41BB12FDEF5C8CC99B65A459777E08 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Linq.JsonPath.QueryExpression> struct Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tD64A321002D591A55E27DE10BDE1C4E0703E541D * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current QueryExpression_t8D8090F4AFDEC9493D2C8ECB42B8BEE65AC701FE * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16, ___list_0)); } inline List_1_tD64A321002D591A55E27DE10BDE1C4E0703E541D * get_list_0() const { return ___list_0; } inline List_1_tD64A321002D591A55E27DE10BDE1C4E0703E541D ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tD64A321002D591A55E27DE10BDE1C4E0703E541D * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16, ___current_3)); } inline QueryExpression_t8D8090F4AFDEC9493D2C8ECB42B8BEE65AC701FE * get_current_3() const { return ___current_3; } inline QueryExpression_t8D8090F4AFDEC9493D2C8ECB42B8BEE65AC701FE ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(QueryExpression_t8D8090F4AFDEC9493D2C8ECB42B8BEE65AC701FE * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.RangeItemHeaderValue> struct Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t5906750D1FA9DF16B29D9BBB3DF4A7D967849E9D * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RangeItemHeaderValue_t3D0E66AE657E94419D7FEBFF8E2B29FAFCB1BDAF * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2, ___list_0)); } inline List_1_t5906750D1FA9DF16B29D9BBB3DF4A7D967849E9D * get_list_0() const { return ___list_0; } inline List_1_t5906750D1FA9DF16B29D9BBB3DF4A7D967849E9D ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t5906750D1FA9DF16B29D9BBB3DF4A7D967849E9D * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2, ___current_3)); } inline RangeItemHeaderValue_t3D0E66AE657E94419D7FEBFF8E2B29FAFCB1BDAF * get_current_3() const { return ___current_3; } inline RangeItemHeaderValue_t3D0E66AE657E94419D7FEBFF8E2B29FAFCB1BDAF ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(RangeItemHeaderValue_t3D0E66AE657E94419D7FEBFF8E2B29FAFCB1BDAF * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.UI.RectMask2D> struct Enumerator_t68772D98408D302178181766E34604592D707472 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t5709CD2CBFF795FF126CD146B019D4F8EC972EA0 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RectMask2D_tD909811991B341D752E4C978C89EFB80FA7A2B15 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t68772D98408D302178181766E34604592D707472, ___list_0)); } inline List_1_t5709CD2CBFF795FF126CD146B019D4F8EC972EA0 * get_list_0() const { return ___list_0; } inline List_1_t5709CD2CBFF795FF126CD146B019D4F8EC972EA0 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t5709CD2CBFF795FF126CD146B019D4F8EC972EA0 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t68772D98408D302178181766E34604592D707472, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t68772D98408D302178181766E34604592D707472, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t68772D98408D302178181766E34604592D707472, ___current_3)); } inline RectMask2D_tD909811991B341D752E4C978C89EFB80FA7A2B15 * get_current_3() const { return ___current_3; } inline RectMask2D_tD909811991B341D752E4C978C89EFB80FA7A2B15 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(RectMask2D_tD909811991B341D752E4C978C89EFB80FA7A2B15 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.RectTransform> struct Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t432BA4439FC00E108A9A351BD7FBCD9242270BB3 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RectTransform_t8A6A306FB29A6C8C22010CF9040E319753571072 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6, ___list_0)); } inline List_1_t432BA4439FC00E108A9A351BD7FBCD9242270BB3 * get_list_0() const { return ___list_0; } inline List_1_t432BA4439FC00E108A9A351BD7FBCD9242270BB3 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t432BA4439FC00E108A9A351BD7FBCD9242270BB3 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6, ___current_3)); } inline RectTransform_t8A6A306FB29A6C8C22010CF9040E319753571072 * get_current_3() const { return ___current_3; } inline RectTransform_t8A6A306FB29A6C8C22010CF9040E319753571072 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(RectTransform_t8A6A306FB29A6C8C22010CF9040E319753571072 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Utilities.ReflectionObject> struct Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t04A11A365D1B0F4481DE8D0B98866FF3448D2190 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ReflectionObject_t5D0E8101861B20103042D9ED10ADF480B794B862 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60, ___list_0)); } inline List_1_t04A11A365D1B0F4481DE8D0B98866FF3448D2190 * get_list_0() const { return ___list_0; } inline List_1_t04A11A365D1B0F4481DE8D0B98866FF3448D2190 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t04A11A365D1B0F4481DE8D0B98866FF3448D2190 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60, ___current_3)); } inline ReflectionObject_t5D0E8101861B20103042D9ED10ADF480B794B862 * get_current_3() const { return ___current_3; } inline ReflectionObject_t5D0E8101861B20103042D9ED10ADF480B794B862 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ReflectionObject_t5D0E8101861B20103042D9ED10ADF480B794B862 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Text.RegularExpressions.RegexNode> struct Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t692D260BEBA1E69864C98DEEDB3E9256C38CD9B9 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RegexNode_t0C22422611EBAF941144402F8CAB0FA1A0AE7D43 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C, ___list_0)); } inline List_1_t692D260BEBA1E69864C98DEEDB3E9256C38CD9B9 * get_list_0() const { return ___list_0; } inline List_1_t692D260BEBA1E69864C98DEEDB3E9256C38CD9B9 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t692D260BEBA1E69864C98DEEDB3E9256C38CD9B9 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C, ___current_3)); } inline RegexNode_t0C22422611EBAF941144402F8CAB0FA1A0AE7D43 * get_current_3() const { return ___current_3; } inline RegexNode_t0C22422611EBAF941144402F8CAB0FA1A0AE7D43 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(RegexNode_t0C22422611EBAF941144402F8CAB0FA1A0AE7D43 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.HashSet`1/Enumerator<UnityEngine.Renderer> struct Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3 { public: // System.Collections.Generic.HashSet`1<T> System.Collections.Generic.HashSet`1/Enumerator::_set HashSet_1_t29AE451AF3792A7A6741732B896B4D841EC86054 * ____set_0; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_index int32_t ____index_1; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_version int32_t ____version_2; // T System.Collections.Generic.HashSet`1/Enumerator::_current Renderer_t58147AB5B00224FE1460FD47542DC0DA7EC9378C * ____current_3; public: inline static int32_t get_offset_of__set_0() { return static_cast<int32_t>(offsetof(Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3, ____set_0)); } inline HashSet_1_t29AE451AF3792A7A6741732B896B4D841EC86054 * get__set_0() const { return ____set_0; } inline HashSet_1_t29AE451AF3792A7A6741732B896B4D841EC86054 ** get_address_of__set_0() { return &____set_0; } inline void set__set_0(HashSet_1_t29AE451AF3792A7A6741732B896B4D841EC86054 * value) { ____set_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____set_0), (void*)value); } inline static int32_t get_offset_of__index_1() { return static_cast<int32_t>(offsetof(Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3, ____index_1)); } inline int32_t get__index_1() const { return ____index_1; } inline int32_t* get_address_of__index_1() { return &____index_1; } inline void set__index_1(int32_t value) { ____index_1 = value; } inline static int32_t get_offset_of__version_2() { return static_cast<int32_t>(offsetof(Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3, ____version_2)); } inline int32_t get__version_2() const { return ____version_2; } inline int32_t* get_address_of__version_2() { return &____version_2; } inline void set__version_2(int32_t value) { ____version_2 = value; } inline static int32_t get_offset_of__current_3() { return static_cast<int32_t>(offsetof(Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3, ____current_3)); } inline Renderer_t58147AB5B00224FE1460FD47542DC0DA7EC9378C * get__current_3() const { return ____current_3; } inline Renderer_t58147AB5B00224FE1460FD47542DC0DA7EC9378C ** get_address_of__current_3() { return &____current_3; } inline void set__current_3(Renderer_t58147AB5B00224FE1460FD47542DC0DA7EC9378C * value) { ____current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.Renderer> struct Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tB73BF10E0869BDB4D391E61BA46B75BECA4DCDBE * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Renderer_t58147AB5B00224FE1460FD47542DC0DA7EC9378C * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72, ___list_0)); } inline List_1_tB73BF10E0869BDB4D391E61BA46B75BECA4DCDBE * get_list_0() const { return ___list_0; } inline List_1_tB73BF10E0869BDB4D391E61BA46B75BECA4DCDBE ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tB73BF10E0869BDB4D391E61BA46B75BECA4DCDBE * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72, ___current_3)); } inline Renderer_t58147AB5B00224FE1460FD47542DC0DA7EC9378C * get_current_3() const { return ___current_3; } inline Renderer_t58147AB5B00224FE1460FD47542DC0DA7EC9378C ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(Renderer_t58147AB5B00224FE1460FD47542DC0DA7EC9378C * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.AddressableAssets.ResourceLocators.ResourceLocationData> struct Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tBDF311CB6BA8AF1C9046A9DAC3502AC9DF88EF55 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ResourceLocationData_tDE44E4FB8CCDB61F532FCA1140616ED8D31A2FE4 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D, ___list_0)); } inline List_1_tBDF311CB6BA8AF1C9046A9DAC3502AC9DF88EF55 * get_list_0() const { return ___list_0; } inline List_1_tBDF311CB6BA8AF1C9046A9DAC3502AC9DF88EF55 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tBDF311CB6BA8AF1C9046A9DAC3502AC9DF88EF55 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D, ___current_3)); } inline ResourceLocationData_tDE44E4FB8CCDB61F532FCA1140616ED8D31A2FE4 * get_current_3() const { return ___current_3; } inline ResourceLocationData_tDE44E4FB8CCDB61F532FCA1140616ED8D31A2FE4 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ResourceLocationData_tDE44E4FB8CCDB61F532FCA1140616ED8D31A2FE4 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.Rigidbody2D> struct Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t61A36FEC0532A7CC39DB1770BFA5C1967348FAC1 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Rigidbody2D_tD23204FEE9CB4A36737043B97FD409DE05D5DCE5 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F, ___list_0)); } inline List_1_t61A36FEC0532A7CC39DB1770BFA5C1967348FAC1 * get_list_0() const { return ___list_0; } inline List_1_t61A36FEC0532A7CC39DB1770BFA5C1967348FAC1 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t61A36FEC0532A7CC39DB1770BFA5C1967348FAC1 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F, ___current_3)); } inline Rigidbody2D_tD23204FEE9CB4A36737043B97FD409DE05D5DCE5 * get_current_3() const { return ___current_3; } inline Rigidbody2D_tD23204FEE9CB4A36737043B97FD409DE05D5DCE5 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(Rigidbody2D_tD23204FEE9CB4A36737043B97FD409DE05D5DCE5 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.RuntimeType> struct Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tEEBD8E5ADEDE83E8B8DE9EC2D7E51CC1CA3781FB * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RuntimeType_t4F49C0B3B2871AECF65AF5FA3E42BAB5B0C1FD07 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42, ___list_0)); } inline List_1_tEEBD8E5ADEDE83E8B8DE9EC2D7E51CC1CA3781FB * get_list_0() const { return ___list_0; } inline List_1_tEEBD8E5ADEDE83E8B8DE9EC2D7E51CC1CA3781FB ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tEEBD8E5ADEDE83E8B8DE9EC2D7E51CC1CA3781FB * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42, ___current_3)); } inline RuntimeType_t4F49C0B3B2871AECF65AF5FA3E42BAB5B0C1FD07 * get_current_3() const { return ___current_3; } inline RuntimeType_t4F49C0B3B2871AECF65AF5FA3E42BAB5B0C1FD07 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(RuntimeType_t4F49C0B3B2871AECF65AF5FA3E42BAB5B0C1FD07 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.SByte> struct Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t7F0E10DCBF1EBD7FBCA81F990C2A8D07D7A611F7 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current int8_t ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD, ___list_0)); } inline List_1_t7F0E10DCBF1EBD7FBCA81F990C2A8D07D7A611F7 * get_list_0() const { return ___list_0; } inline List_1_t7F0E10DCBF1EBD7FBCA81F990C2A8D07D7A611F7 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t7F0E10DCBF1EBD7FBCA81F990C2A8D07D7A611F7 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD, ___current_3)); } inline int8_t get_current_3() const { return ___current_3; } inline int8_t* get_address_of_current_3() { return &___current_3; } inline void set_current_3(int8_t value) { ___current_3 = value; } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.UI.Selectable> struct Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tD50A05AC44A86F2E776026D9FDC324209732D596 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Selectable_t34088A3677CC9D344F81B0D91999D8C5963D7DBD * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349, ___list_0)); } inline List_1_tD50A05AC44A86F2E776026D9FDC324209732D596 * get_list_0() const { return ___list_0; } inline List_1_tD50A05AC44A86F2E776026D9FDC324209732D596 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tD50A05AC44A86F2E776026D9FDC324209732D596 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349, ___current_3)); } inline Selectable_t34088A3677CC9D344F81B0D91999D8C5963D7DBD * get_current_3() const { return ___current_3; } inline Selectable_t34088A3677CC9D344F81B0D91999D8C5963D7DBD ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(Selectable_t34088A3677CC9D344F81B0D91999D8C5963D7DBD * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Serialization.SerializationCallback> struct Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t034C805F39B6FA51E477B0FC504E4B759DD04E6A * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SerializationCallback_t42429ABF00EBB89529A12C31EF19D19CA1A5E3B0 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E, ___list_0)); } inline List_1_t034C805F39B6FA51E477B0FC504E4B759DD04E6A * get_list_0() const { return ___list_0; } inline List_1_t034C805F39B6FA51E477B0FC504E4B759DD04E6A ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t034C805F39B6FA51E477B0FC504E4B759DD04E6A * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E, ___current_3)); } inline SerializationCallback_t42429ABF00EBB89529A12C31EF19D19CA1A5E3B0 * get_current_3() const { return ___current_3; } inline SerializationCallback_t42429ABF00EBB89529A12C31EF19D19CA1A5E3B0 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(SerializationCallback_t42429ABF00EBB89529A12C31EF19D19CA1A5E3B0 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Serialization.SerializationErrorCallback> struct Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tDBA82B94AA0D0574EF603767BE27018AAB64E33D * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SerializationErrorCallback_t9BE7F921E784C3B63A03DFDF679CBA907F7F56F8 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528, ___list_0)); } inline List_1_tDBA82B94AA0D0574EF603767BE27018AAB64E33D * get_list_0() const { return ___list_0; } inline List_1_tDBA82B94AA0D0574EF603767BE27018AAB64E33D ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tDBA82B94AA0D0574EF603767BE27018AAB64E33D * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528, ___current_3)); } inline SerializationErrorCallback_t9BE7F921E784C3B63A03DFDF679CBA907F7F56F8 * get_current_3() const { return ___current_3; } inline SerializationErrorCallback_t9BE7F921E784C3B63A03DFDF679CBA907F7F56F8 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(SerializationErrorCallback_t9BE7F921E784C3B63A03DFDF679CBA907F7F56F8 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Runtime.Serialization.SerializationFieldInfo> struct Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t9DC8C84A6776E660211AF51D23AA261ACEF28030 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SerializationFieldInfo_t0D5EE593AFBF37E72513E2979070B344BCBD8C55 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50, ___list_0)); } inline List_1_t9DC8C84A6776E660211AF51D23AA261ACEF28030 * get_list_0() const { return ___list_0; } inline List_1_t9DC8C84A6776E660211AF51D23AA261ACEF28030 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t9DC8C84A6776E660211AF51D23AA261ACEF28030 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50, ___current_3)); } inline SerializationFieldInfo_t0D5EE593AFBF37E72513E2979070B344BCBD8C55 * get_current_3() const { return ___current_3; } inline SerializationFieldInfo_t0D5EE593AFBF37E72513E2979070B344BCBD8C55 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(SerializationFieldInfo_t0D5EE593AFBF37E72513E2979070B344BCBD8C55 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.HashSet`1/Enumerator<Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite> struct Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E { public: // System.Collections.Generic.HashSet`1<T> System.Collections.Generic.HashSet`1/Enumerator::_set HashSet_1_tABC0E73268E54BBE58E35D93218AB0C734249265 * ____set_0; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_index int32_t ____index_1; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_version int32_t ____version_2; // T System.Collections.Generic.HashSet`1/Enumerator::_current ServiceCallSite_tF7B1C139E2FCE9624A78A8E5530E0DB24C442469 * ____current_3; public: inline static int32_t get_offset_of__set_0() { return static_cast<int32_t>(offsetof(Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E, ____set_0)); } inline HashSet_1_tABC0E73268E54BBE58E35D93218AB0C734249265 * get__set_0() const { return ____set_0; } inline HashSet_1_tABC0E73268E54BBE58E35D93218AB0C734249265 ** get_address_of__set_0() { return &____set_0; } inline void set__set_0(HashSet_1_tABC0E73268E54BBE58E35D93218AB0C734249265 * value) { ____set_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____set_0), (void*)value); } inline static int32_t get_offset_of__index_1() { return static_cast<int32_t>(offsetof(Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E, ____index_1)); } inline int32_t get__index_1() const { return ____index_1; } inline int32_t* get_address_of__index_1() { return &____index_1; } inline void set__index_1(int32_t value) { ____index_1 = value; } inline static int32_t get_offset_of__version_2() { return static_cast<int32_t>(offsetof(Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E, ____version_2)); } inline int32_t get__version_2() const { return ____version_2; } inline int32_t* get_address_of__version_2() { return &____version_2; } inline void set__version_2(int32_t value) { ____version_2 = value; } inline static int32_t get_offset_of__current_3() { return static_cast<int32_t>(offsetof(Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E, ____current_3)); } inline ServiceCallSite_tF7B1C139E2FCE9624A78A8E5530E0DB24C442469 * get__current_3() const { return ____current_3; } inline ServiceCallSite_tF7B1C139E2FCE9624A78A8E5530E0DB24C442469 ** get_address_of__current_3() { return &____current_3; } inline void set__current_3(ServiceCallSite_tF7B1C139E2FCE9624A78A8E5530E0DB24C442469 * value) { ____current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite> struct Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tCDFC27E0CDAC23F07DAB9B7F9ADAED42B49E33CF * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ServiceCallSite_tF7B1C139E2FCE9624A78A8E5530E0DB24C442469 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820, ___list_0)); } inline List_1_tCDFC27E0CDAC23F07DAB9B7F9ADAED42B49E33CF * get_list_0() const { return ___list_0; } inline List_1_tCDFC27E0CDAC23F07DAB9B7F9ADAED42B49E33CF ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tCDFC27E0CDAC23F07DAB9B7F9ADAED42B49E33CF * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820, ___current_3)); } inline ServiceCallSite_tF7B1C139E2FCE9624A78A8E5530E0DB24C442469 * get_current_3() const { return ___current_3; } inline ServiceCallSite_tF7B1C139E2FCE9624A78A8E5530E0DB24C442469 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ServiceCallSite_tF7B1C139E2FCE9624A78A8E5530E0DB24C442469 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.DependencyInjection.ServiceDescriptor> struct Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tA289FD70F5721465B88F8C1FAC5171E21FDD40BF * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ServiceDescriptor_t47B920FA078FBF60386AD4FC94F6549F7FFDFD2C * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF, ___list_0)); } inline List_1_tA289FD70F5721465B88F8C1FAC5171E21FDD40BF * get_list_0() const { return ___list_0; } inline List_1_tA289FD70F5721465B88F8C1FAC5171E21FDD40BF ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tA289FD70F5721465B88F8C1FAC5171E21FDD40BF * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF, ___current_3)); } inline ServiceDescriptor_t47B920FA078FBF60386AD4FC94F6549F7FFDFD2C * get_current_3() const { return ___current_3; } inline ServiceDescriptor_t47B920FA078FBF60386AD4FC94F6549F7FFDFD2C ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ServiceDescriptor_t47B920FA078FBF60386AD4FC94F6549F7FFDFD2C * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Utilities.Facades.ServiceFacade> struct Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tA177816BB2C4270956C0BC6AB7A9EDA8F1C90418 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ServiceFacade_tE88BCA105B985B6599454D2144C9D6C864B66D15 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3, ___list_0)); } inline List_1_tA177816BB2C4270956C0BC6AB7A9EDA8F1C90418 * get_list_0() const { return ___list_0; } inline List_1_tA177816BB2C4270956C0BC6AB7A9EDA8F1C90418 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tA177816BB2C4270956C0BC6AB7A9EDA8F1C90418 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3, ___current_3)); } inline ServiceFacade_tE88BCA105B985B6599454D2144C9D6C864B66D15 * get_current_3() const { return ___current_3; } inline ServiceFacade_tE88BCA105B985B6599454D2144C9D6C864B66D15 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(ServiceFacade_tE88BCA105B985B6599454D2144C9D6C864B66D15 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Single> struct Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t6726F9309570A0BDC5D42E10777F3E2931C487AA * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current float ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783, ___list_0)); } inline List_1_t6726F9309570A0BDC5D42E10777F3E2931C487AA * get_list_0() const { return ___list_0; } inline List_1_t6726F9309570A0BDC5D42E10777F3E2931C487AA ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t6726F9309570A0BDC5D42E10777F3E2931C487AA * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783, ___current_3)); } inline float get_current_3() const { return ___current_3; } inline float* get_address_of_current_3() { return &___current_3; } inline void set_current_3(float value) { ___current_3 = value; } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Utilities.Solvers.Solver> struct Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t45DC9F83BCA4BF8675443CB5EBCC9C8F3AC0BD48 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Solver_t8BBDA74686483C111074BE6BE588AB31E74B2971 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE, ___list_0)); } inline List_1_t45DC9F83BCA4BF8675443CB5EBCC9C8F3AC0BD48 * get_list_0() const { return ___list_0; } inline List_1_t45DC9F83BCA4BF8675443CB5EBCC9C8F3AC0BD48 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t45DC9F83BCA4BF8675443CB5EBCC9C8F3AC0BD48 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE, ___current_3)); } inline Solver_t8BBDA74686483C111074BE6BE588AB31E74B2971 * get_current_3() const { return ___current_3; } inline Solver_t8BBDA74686483C111074BE6BE588AB31E74B2971 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(Solver_t8BBDA74686483C111074BE6BE588AB31E74B2971 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessPlanarObject> struct Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t3562C0F493A7820942DA03A973792E34EE1BD2BA * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SpatialAwarenessPlanarObject_t548FB81C44BB10562EBA2CD41024B3A84ED7BDEE * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA, ___list_0)); } inline List_1_t3562C0F493A7820942DA03A973792E34EE1BD2BA * get_list_0() const { return ___list_0; } inline List_1_t3562C0F493A7820942DA03A973792E34EE1BD2BA ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t3562C0F493A7820942DA03A973792E34EE1BD2BA * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA, ___current_3)); } inline SpatialAwarenessPlanarObject_t548FB81C44BB10562EBA2CD41024B3A84ED7BDEE * get_current_3() const { return ___current_3; } inline SpatialAwarenessPlanarObject_t548FB81C44BB10562EBA2CD41024B3A84ED7BDEE ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(SpatialAwarenessPlanarObject_t548FB81C44BB10562EBA2CD41024B3A84ED7BDEE * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.Sprite> struct Enumerator_tAF21232E555CF5021E1A738792635D00943518BE { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t99B54448C695C6F7103A0DE4320F1A7EF7B30880 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Sprite_t5B10B1178EC2E6F53D33FFD77557F31C08A51ED9 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tAF21232E555CF5021E1A738792635D00943518BE, ___list_0)); } inline List_1_t99B54448C695C6F7103A0DE4320F1A7EF7B30880 * get_list_0() const { return ___list_0; } inline List_1_t99B54448C695C6F7103A0DE4320F1A7EF7B30880 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t99B54448C695C6F7103A0DE4320F1A7EF7B30880 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tAF21232E555CF5021E1A738792635D00943518BE, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tAF21232E555CF5021E1A738792635D00943518BE, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tAF21232E555CF5021E1A738792635D00943518BE, ___current_3)); } inline Sprite_t5B10B1178EC2E6F53D33FFD77557F31C08A51ED9 * get_current_3() const { return ___current_3; } inline Sprite_t5B10B1178EC2E6F53D33FFD77557F31C08A51ED9 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(Sprite_t5B10B1178EC2E6F53D33FFD77557F31C08A51ED9 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Diagnostics.StackFrame> struct Enumerator_t4681FB486D573990C716F84603F54B87801CBB09 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t2E01C571E733112C39E0970BF9193E00B487FF86 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current StackFrame_t6018A5362C2E8F6F80F153F3D40623D213094E0F * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t4681FB486D573990C716F84603F54B87801CBB09, ___list_0)); } inline List_1_t2E01C571E733112C39E0970BF9193E00B487FF86 * get_list_0() const { return ___list_0; } inline List_1_t2E01C571E733112C39E0970BF9193E00B487FF86 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t2E01C571E733112C39E0970BF9193E00B487FF86 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t4681FB486D573990C716F84603F54B87801CBB09, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t4681FB486D573990C716F84603F54B87801CBB09, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t4681FB486D573990C716F84603F54B87801CBB09, ___current_3)); } inline StackFrame_t6018A5362C2E8F6F80F153F3D40623D213094E0F * get_current_3() const { return ___current_3; } inline StackFrame_t6018A5362C2E8F6F80F153F3D40623D213094E0F ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(StackFrame_t6018A5362C2E8F6F80F153F3D40623D213094E0F * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.UI.State> struct Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tE73297D82D6BE8DCD12F5123B82E10CBBFE29EFE * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current State_t8BC3593EACE0EB077EF575219685CFDB44245AB4 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F, ___list_0)); } inline List_1_tE73297D82D6BE8DCD12F5123B82E10CBBFE29EFE * get_list_0() const { return ___list_0; } inline List_1_tE73297D82D6BE8DCD12F5123B82E10CBBFE29EFE ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tE73297D82D6BE8DCD12F5123B82E10CBBFE29EFE * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F, ___current_3)); } inline State_t8BC3593EACE0EB077EF575219685CFDB44245AB4 * get_current_3() const { return ___current_3; } inline State_t8BC3593EACE0EB077EF575219685CFDB44245AB4 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(State_t8BC3593EACE0EB077EF575219685CFDB44245AB4 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.HashSet`1/Enumerator<System.String> struct Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9 { public: // System.Collections.Generic.HashSet`1<T> System.Collections.Generic.HashSet`1/Enumerator::_set HashSet_1_t45F75268054D01D9E70EB33D7F6D2FA609DB9229 * ____set_0; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_index int32_t ____index_1; // System.Int32 System.Collections.Generic.HashSet`1/Enumerator::_version int32_t ____version_2; // T System.Collections.Generic.HashSet`1/Enumerator::_current String_t* ____current_3; public: inline static int32_t get_offset_of__set_0() { return static_cast<int32_t>(offsetof(Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9, ____set_0)); } inline HashSet_1_t45F75268054D01D9E70EB33D7F6D2FA609DB9229 * get__set_0() const { return ____set_0; } inline HashSet_1_t45F75268054D01D9E70EB33D7F6D2FA609DB9229 ** get_address_of__set_0() { return &____set_0; } inline void set__set_0(HashSet_1_t45F75268054D01D9E70EB33D7F6D2FA609DB9229 * value) { ____set_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____set_0), (void*)value); } inline static int32_t get_offset_of__index_1() { return static_cast<int32_t>(offsetof(Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9, ____index_1)); } inline int32_t get__index_1() const { return ____index_1; } inline int32_t* get_address_of__index_1() { return &____index_1; } inline void set__index_1(int32_t value) { ____index_1 = value; } inline static int32_t get_offset_of__version_2() { return static_cast<int32_t>(offsetof(Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9, ____version_2)); } inline int32_t get__version_2() const { return ____version_2; } inline int32_t* get_address_of__version_2() { return &____version_2; } inline void set__version_2(int32_t value) { ____version_2 = value; } inline static int32_t get_offset_of__current_3() { return static_cast<int32_t>(offsetof(Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9, ____current_3)); } inline String_t* get__current_3() const { return ____current_3; } inline String_t** get_address_of__current_3() { return &____current_3; } inline void set__current_3(String_t* value) { ____current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.String> struct Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current String_t* ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B, ___list_0)); } inline List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3 * get_list_0() const { return ___list_0; } inline List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B, ___current_3)); } inline String_t* get_current_3() const { return ___current_3; } inline String_t** get_address_of_current_3() { return &___current_3; } inline void set_current_3(String_t* value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.Queue`1/Enumerator<System.String> struct Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601 { public: // System.Collections.Generic.Queue`1<T> System.Collections.Generic.Queue`1/Enumerator::_q Queue_1_tD2C03A5990B5958D85846D872A22AA67F3E8F97D * ____q_0; // System.Int32 System.Collections.Generic.Queue`1/Enumerator::_version int32_t ____version_1; // System.Int32 System.Collections.Generic.Queue`1/Enumerator::_index int32_t ____index_2; // T System.Collections.Generic.Queue`1/Enumerator::_currentElement String_t* ____currentElement_3; public: inline static int32_t get_offset_of__q_0() { return static_cast<int32_t>(offsetof(Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601, ____q_0)); } inline Queue_1_tD2C03A5990B5958D85846D872A22AA67F3E8F97D * get__q_0() const { return ____q_0; } inline Queue_1_tD2C03A5990B5958D85846D872A22AA67F3E8F97D ** get_address_of__q_0() { return &____q_0; } inline void set__q_0(Queue_1_tD2C03A5990B5958D85846D872A22AA67F3E8F97D * value) { ____q_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____q_0), (void*)value); } inline static int32_t get_offset_of__version_1() { return static_cast<int32_t>(offsetof(Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601, ____version_1)); } inline int32_t get__version_1() const { return ____version_1; } inline int32_t* get_address_of__version_1() { return &____version_1; } inline void set__version_1(int32_t value) { ____version_1 = value; } inline static int32_t get_offset_of__index_2() { return static_cast<int32_t>(offsetof(Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601, ____index_2)); } inline int32_t get__index_2() const { return ____index_2; } inline int32_t* get_address_of__index_2() { return &____index_2; } inline void set__index_2(int32_t value) { ____index_2 = value; } inline static int32_t get_offset_of__currentElement_3() { return static_cast<int32_t>(offsetof(Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601, ____currentElement_3)); } inline String_t* get__currentElement_3() const { return ____currentElement_3; } inline String_t** get_address_of__currentElement_3() { return &____currentElement_3; } inline void set__currentElement_3(String_t* value) { ____currentElement_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____currentElement_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.StringWithQualityHeaderValue> struct Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t9D9209E4EC339A2F86E05CF8E2C24BF784FB7F0C * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current StringWithQualityHeaderValue_t921EEF897C63829C493FB11E76613C1E23021066 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640, ___list_0)); } inline List_1_t9D9209E4EC339A2F86E05CF8E2C24BF784FB7F0C * get_list_0() const { return ___list_0; } inline List_1_t9D9209E4EC339A2F86E05CF8E2C24BF784FB7F0C ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t9D9209E4EC339A2F86E05CF8E2C24BF784FB7F0C * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640, ___current_3)); } inline StringWithQualityHeaderValue_t921EEF897C63829C493FB11E76613C1E23021066 * get_current_3() const { return ___current_3; } inline StringWithQualityHeaderValue_t921EEF897C63829C493FB11E76613C1E23021066 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(StringWithQualityHeaderValue_t921EEF897C63829C493FB11E76613C1E23021066 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.Subsystem> struct Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t58BB84B47855540E6D2640B387506E01436DCF82 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Subsystem_t2D97454A946149D608974CB6B674F5F5C613A6A4 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360, ___list_0)); } inline List_1_t58BB84B47855540E6D2640B387506E01436DCF82 * get_list_0() const { return ___list_0; } inline List_1_t58BB84B47855540E6D2640B387506E01436DCF82 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t58BB84B47855540E6D2640B387506E01436DCF82 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360, ___current_3)); } inline Subsystem_t2D97454A946149D608974CB6B674F5F5C613A6A4 * get_current_3() const { return ___current_3; } inline Subsystem_t2D97454A946149D608974CB6B674F5F5C613A6A4 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(Subsystem_t2D97454A946149D608974CB6B674F5F5C613A6A4 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.OpenXR.SubsystemController> struct Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tEEECEA57D9B6B750155ECE903A717AD8724B6CB4 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SubsystemController_t65D69698981F54C67583A1ABFDC0E5259676D77B * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D, ___list_0)); } inline List_1_tEEECEA57D9B6B750155ECE903A717AD8724B6CB4 * get_list_0() const { return ___list_0; } inline List_1_tEEECEA57D9B6B750155ECE903A717AD8724B6CB4 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tEEECEA57D9B6B750155ECE903A717AD8724B6CB4 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D, ___current_3)); } inline SubsystemController_t65D69698981F54C67583A1ABFDC0E5259676D77B * get_current_3() const { return ___current_3; } inline SubsystemController_t65D69698981F54C67583A1ABFDC0E5259676D77B ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(SubsystemController_t65D69698981F54C67583A1ABFDC0E5259676D77B * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.SubsystemDescriptor> struct Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t32E50BD66297C6541AEA401E1C13D4EC530CC56B * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405, ___list_0)); } inline List_1_t32E50BD66297C6541AEA401E1C13D4EC530CC56B * get_list_0() const { return ___list_0; } inline List_1_t32E50BD66297C6541AEA401E1C13D4EC530CC56B ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t32E50BD66297C6541AEA401E1C13D4EC530CC56B * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405, ___current_3)); } inline SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 * get_current_3() const { return ___current_3; } inline SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.SubsystemsImplementation.SubsystemDescriptorWithProvider> struct Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t4DCA5C48F3390AC8CD79C7AD8D0963D5DAE5CF2E * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SubsystemDescriptorWithProvider_t32DD334657CFBA22F2FBA399258B087104A29C3E * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0, ___list_0)); } inline List_1_t4DCA5C48F3390AC8CD79C7AD8D0963D5DAE5CF2E * get_list_0() const { return ___list_0; } inline List_1_t4DCA5C48F3390AC8CD79C7AD8D0963D5DAE5CF2E ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t4DCA5C48F3390AC8CD79C7AD8D0963D5DAE5CF2E * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0, ___current_3)); } inline SubsystemDescriptorWithProvider_t32DD334657CFBA22F2FBA399258B087104A29C3E * get_current_3() const { return ___current_3; } inline SubsystemDescriptorWithProvider_t32DD334657CFBA22F2FBA399258B087104A29C3E ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(SubsystemDescriptorWithProvider_t32DD334657CFBA22F2FBA399258B087104A29C3E * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.SubsystemsImplementation.SubsystemWithProvider> struct Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t6E613DAFFAFE896B759F1C5260D6234F04C9DD41 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SubsystemWithProvider_t1C1868CF8676F5596C1AD20A7CE69BDF7C7DE73E * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E, ___list_0)); } inline List_1_t6E613DAFFAFE896B759F1C5260D6234F04C9DD41 * get_list_0() const { return ___list_0; } inline List_1_t6E613DAFFAFE896B759F1C5260D6234F04C9DD41 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t6E613DAFFAFE896B759F1C5260D6234F04C9DD41 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E, ___current_3)); } inline SubsystemWithProvider_t1C1868CF8676F5596C1AD20A7CE69BDF7C7DE73E * get_current_3() const { return ___current_3; } inline SubsystemWithProvider_t1C1868CF8676F5596C1AD20A7CE69BDF7C7DE73E ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(SubsystemWithProvider_t1C1868CF8676F5596C1AD20A7CE69BDF7C7DE73E * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<TMPro.TMP_Character> struct Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tE8F1656A7A5AF5AEE27ED7B656B56CACB417FEB8 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current TMP_Character_tE7A98584C4DDFC9E1A1D883F4A5DE99E5DE7CC0C * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F, ___list_0)); } inline List_1_tE8F1656A7A5AF5AEE27ED7B656B56CACB417FEB8 * get_list_0() const { return ___list_0; } inline List_1_tE8F1656A7A5AF5AEE27ED7B656B56CACB417FEB8 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tE8F1656A7A5AF5AEE27ED7B656B56CACB417FEB8 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F, ___current_3)); } inline TMP_Character_tE7A98584C4DDFC9E1A1D883F4A5DE99E5DE7CC0C * get_current_3() const { return ___current_3; } inline TMP_Character_tE7A98584C4DDFC9E1A1D883F4A5DE99E5DE7CC0C ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(TMP_Character_tE7A98584C4DDFC9E1A1D883F4A5DE99E5DE7CC0C * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<TMPro.TMP_FontAsset> struct Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tBE22F0B6C1EBDB760862FAD201AFE75E3DEBBBFD * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current TMP_FontAsset_tDD8F58129CF4A9094C82DD209531E9E71F9837B2 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98, ___list_0)); } inline List_1_tBE22F0B6C1EBDB760862FAD201AFE75E3DEBBBFD * get_list_0() const { return ___list_0; } inline List_1_tBE22F0B6C1EBDB760862FAD201AFE75E3DEBBBFD ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tBE22F0B6C1EBDB760862FAD201AFE75E3DEBBBFD * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98, ___current_3)); } inline TMP_FontAsset_tDD8F58129CF4A9094C82DD209531E9E71F9837B2 * get_current_3() const { return ___current_3; } inline TMP_FontAsset_tDD8F58129CF4A9094C82DD209531E9E71F9837B2 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(TMP_FontAsset_tDD8F58129CF4A9094C82DD209531E9E71F9837B2 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<TMPro.TMP_GlyphPairAdjustmentRecord> struct Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tDFE35C4D82EC736078A1C899175E5F6747C41D60 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current TMP_GlyphPairAdjustmentRecord_t79F65D973582F66AF3787F0C63E6E6575C8E0C10 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED, ___list_0)); } inline List_1_tDFE35C4D82EC736078A1C899175E5F6747C41D60 * get_list_0() const { return ___list_0; } inline List_1_tDFE35C4D82EC736078A1C899175E5F6747C41D60 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tDFE35C4D82EC736078A1C899175E5F6747C41D60 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED, ___current_3)); } inline TMP_GlyphPairAdjustmentRecord_t79F65D973582F66AF3787F0C63E6E6575C8E0C10 * get_current_3() const { return ___current_3; } inline TMP_GlyphPairAdjustmentRecord_t79F65D973582F66AF3787F0C63E6E6575C8E0C10 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(TMP_GlyphPairAdjustmentRecord_t79F65D973582F66AF3787F0C63E6E6575C8E0C10 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<TMPro.TMP_SpriteAsset> struct Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tD057592B5C6E2EF6CBE5ADC501E5D58919E8B364 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current TMP_SpriteAsset_t0746714D8A56C0A27AE56DC6897CC1A129220714 * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571, ___list_0)); } inline List_1_tD057592B5C6E2EF6CBE5ADC501E5D58919E8B364 * get_list_0() const { return ___list_0; } inline List_1_tD057592B5C6E2EF6CBE5ADC501E5D58919E8B364 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tD057592B5C6E2EF6CBE5ADC501E5D58919E8B364 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571, ___current_3)); } inline TMP_SpriteAsset_t0746714D8A56C0A27AE56DC6897CC1A129220714 * get_current_3() const { return ___current_3; } inline TMP_SpriteAsset_t0746714D8A56C0A27AE56DC6897CC1A129220714 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(TMP_SpriteAsset_t0746714D8A56C0A27AE56DC6897CC1A129220714 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<TMPro.TMP_SpriteCharacter> struct Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t7850FCF22796079854614A9268CE558E34108A02 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current TMP_SpriteCharacter_t77E119FE8164154A682A4F70E7787B2C56A0E9BE * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F, ___list_0)); } inline List_1_t7850FCF22796079854614A9268CE558E34108A02 * get_list_0() const { return ___list_0; } inline List_1_t7850FCF22796079854614A9268CE558E34108A02 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t7850FCF22796079854614A9268CE558E34108A02 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F, ___current_3)); } inline TMP_SpriteCharacter_t77E119FE8164154A682A4F70E7787B2C56A0E9BE * get_current_3() const { return ___current_3; } inline TMP_SpriteCharacter_t77E119FE8164154A682A4F70E7787B2C56A0E9BE ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(TMP_SpriteCharacter_t77E119FE8164154A682A4F70E7787B2C56A0E9BE * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<TMPro.TMP_SpriteGlyph> struct Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tF7848685CB961B42606831D4C30E1C31069D91C8 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current TMP_SpriteGlyph_t5DF3D3BFFC0D0A72ABEBA3490F804B591BF1F25D * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867, ___list_0)); } inline List_1_tF7848685CB961B42606831D4C30E1C31069D91C8 * get_list_0() const { return ___list_0; } inline List_1_tF7848685CB961B42606831D4C30E1C31069D91C8 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tF7848685CB961B42606831D4C30E1C31069D91C8 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867, ___current_3)); } inline TMP_SpriteGlyph_t5DF3D3BFFC0D0A72ABEBA3490F804B591BF1F25D * get_current_3() const { return ___current_3; } inline TMP_SpriteGlyph_t5DF3D3BFFC0D0A72ABEBA3490F804B591BF1F25D ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(TMP_SpriteGlyph_t5DF3D3BFFC0D0A72ABEBA3490F804B591BF1F25D * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // System.Collections.Generic.List`1/Enumerator<TMPro.TMP_Style> struct Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t45639C9CAC14492B91832F71F3BE40F75A336649 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current TMP_Style_t078D8A76F4A60B868298420272B7089582EF53AB * ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654, ___list_0)); } inline List_1_t45639C9CAC14492B91832F71F3BE40F75A336649 * get_list_0() const { return ___list_0; } inline List_1_t45639C9CAC14492B91832F71F3BE40F75A336649 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t45639C9CAC14492B91832F71F3BE40F75A336649 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654, ___current_3)); } inline TMP_Style_t078D8A76F4A60B868298420272B7089582EF53AB * get_current_3() const { return ___current_3; } inline TMP_Style_t078D8A76F4A60B868298420272B7089582EF53AB ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(TMP_Style_t078D8A76F4A60B868298420272B7089582EF53AB * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_3), (void*)value); } }; // UnityEngine.InputSystem.Utilities.ReadOnlyArray`1<UnityEngine.InputSystem.Utilities.NamedValue> struct ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE { public: // TValue[] UnityEngine.InputSystem.Utilities.ReadOnlyArray`1::m_Array NamedValueU5BU5D_t14E74CFBB3D0ED7EC9222CFA9E959246B9E4DB15* ___m_Array_0; // System.Int32 UnityEngine.InputSystem.Utilities.ReadOnlyArray`1::m_StartIndex int32_t ___m_StartIndex_1; // System.Int32 UnityEngine.InputSystem.Utilities.ReadOnlyArray`1::m_Length int32_t ___m_Length_2; public: inline static int32_t get_offset_of_m_Array_0() { return static_cast<int32_t>(offsetof(ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE, ___m_Array_0)); } inline NamedValueU5BU5D_t14E74CFBB3D0ED7EC9222CFA9E959246B9E4DB15* get_m_Array_0() const { return ___m_Array_0; } inline NamedValueU5BU5D_t14E74CFBB3D0ED7EC9222CFA9E959246B9E4DB15** get_address_of_m_Array_0() { return &___m_Array_0; } inline void set_m_Array_0(NamedValueU5BU5D_t14E74CFBB3D0ED7EC9222CFA9E959246B9E4DB15* value) { ___m_Array_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Array_0), (void*)value); } inline static int32_t get_offset_of_m_StartIndex_1() { return static_cast<int32_t>(offsetof(ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE, ___m_StartIndex_1)); } inline int32_t get_m_StartIndex_1() const { return ___m_StartIndex_1; } inline int32_t* get_address_of_m_StartIndex_1() { return &___m_StartIndex_1; } inline void set_m_StartIndex_1(int32_t value) { ___m_StartIndex_1 = value; } inline static int32_t get_offset_of_m_Length_2() { return static_cast<int32_t>(offsetof(ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE, ___m_Length_2)); } inline int32_t get_m_Length_2() const { return ___m_Length_2; } inline int32_t* get_address_of_m_Length_2() { return &___m_Length_2; } inline void set_m_Length_2(int32_t value) { ___m_Length_2 = value; } }; // System.Enum struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA : public ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52 { public: public: }; struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields { public: // System.Char[] System.Enum::enumSeperatorCharArray CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* ___enumSeperatorCharArray_0; public: inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields, ___enumSeperatorCharArray_0)); } inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; } inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; } inline void set_enumSeperatorCharArray_0(CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* value) { ___enumSeperatorCharArray_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Enum struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_pinvoke { }; // Native definition for COM marshalling of System.Enum struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_com { }; // System.IntPtr struct IntPtr_t { public: // System.Void* System.IntPtr::m_value void* ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); } inline void* get_m_value_0() const { return ___m_value_0; } inline void** get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(void* value) { ___m_value_0 = value; } }; struct IntPtr_t_StaticFields { public: // System.IntPtr System.IntPtr::Zero intptr_t ___Zero_1; public: inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); } inline intptr_t get_Zero_1() const { return ___Zero_1; } inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; } inline void set_Zero_1(intptr_t value) { ___Zero_1 = value; } }; // System.Text.Json.ParameterRef struct ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D { public: // System.UInt64 System.Text.Json.ParameterRef::Key uint64_t ___Key_0; // System.Text.Json.JsonParameterInfo System.Text.Json.ParameterRef::Info JsonParameterInfo_tFDA8A76E9154953FFDFB9EAB8583541C789A374A * ___Info_1; // System.Byte[] System.Text.Json.ParameterRef::NameFromJson ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* ___NameFromJson_2; public: inline static int32_t get_offset_of_Key_0() { return static_cast<int32_t>(offsetof(ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D, ___Key_0)); } inline uint64_t get_Key_0() const { return ___Key_0; } inline uint64_t* get_address_of_Key_0() { return &___Key_0; } inline void set_Key_0(uint64_t value) { ___Key_0 = value; } inline static int32_t get_offset_of_Info_1() { return static_cast<int32_t>(offsetof(ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D, ___Info_1)); } inline JsonParameterInfo_tFDA8A76E9154953FFDFB9EAB8583541C789A374A * get_Info_1() const { return ___Info_1; } inline JsonParameterInfo_tFDA8A76E9154953FFDFB9EAB8583541C789A374A ** get_address_of_Info_1() { return &___Info_1; } inline void set_Info_1(JsonParameterInfo_tFDA8A76E9154953FFDFB9EAB8583541C789A374A * value) { ___Info_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___Info_1), (void*)value); } inline static int32_t get_offset_of_NameFromJson_2() { return static_cast<int32_t>(offsetof(ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D, ___NameFromJson_2)); } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* get_NameFromJson_2() const { return ___NameFromJson_2; } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726** get_address_of_NameFromJson_2() { return &___NameFromJson_2; } inline void set_NameFromJson_2(ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* value) { ___NameFromJson_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___NameFromJson_2), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Text.Json.ParameterRef struct ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D_marshaled_pinvoke { uint64_t ___Key_0; JsonParameterInfo_tFDA8A76E9154953FFDFB9EAB8583541C789A374A * ___Info_1; Il2CppSafeArray/*NONE*/* ___NameFromJson_2; }; // Native definition for COM marshalling of System.Text.Json.ParameterRef struct ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D_marshaled_com { uint64_t ___Key_0; JsonParameterInfo_tFDA8A76E9154953FFDFB9EAB8583541C789A374A * ___Info_1; Il2CppSafeArray/*NONE*/* ___NameFromJson_2; }; // System.Text.Json.PropertyRef struct PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11 { public: // System.UInt64 System.Text.Json.PropertyRef::Key uint64_t ___Key_0; // System.Text.Json.JsonPropertyInfo System.Text.Json.PropertyRef::Info JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * ___Info_1; // System.Byte[] System.Text.Json.PropertyRef::NameFromJson ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* ___NameFromJson_2; public: inline static int32_t get_offset_of_Key_0() { return static_cast<int32_t>(offsetof(PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11, ___Key_0)); } inline uint64_t get_Key_0() const { return ___Key_0; } inline uint64_t* get_address_of_Key_0() { return &___Key_0; } inline void set_Key_0(uint64_t value) { ___Key_0 = value; } inline static int32_t get_offset_of_Info_1() { return static_cast<int32_t>(offsetof(PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11, ___Info_1)); } inline JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * get_Info_1() const { return ___Info_1; } inline JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B ** get_address_of_Info_1() { return &___Info_1; } inline void set_Info_1(JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * value) { ___Info_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___Info_1), (void*)value); } inline static int32_t get_offset_of_NameFromJson_2() { return static_cast<int32_t>(offsetof(PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11, ___NameFromJson_2)); } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* get_NameFromJson_2() const { return ___NameFromJson_2; } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726** get_address_of_NameFromJson_2() { return &___NameFromJson_2; } inline void set_NameFromJson_2(ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* value) { ___NameFromJson_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___NameFromJson_2), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Text.Json.PropertyRef struct PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11_marshaled_pinvoke { uint64_t ___Key_0; JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * ___Info_1; Il2CppSafeArray/*NONE*/* ___NameFromJson_2; }; // Native definition for COM marshalling of System.Text.Json.PropertyRef struct PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11_marshaled_com { uint64_t ___Key_0; JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * ___Info_1; Il2CppSafeArray/*NONE*/* ___NameFromJson_2; }; // System.Xml.Schema.RangePositionInfo struct RangePositionInfo_tB46C25982A33E1DF36005E89A4A1EA3D397DB8BB { public: // System.Xml.Schema.BitSet System.Xml.Schema.RangePositionInfo::curpos BitSet_t36CD5E21CDE8972A6BCEF9E414933DD893966438 * ___curpos_0; // System.Decimal[] System.Xml.Schema.RangePositionInfo::rangeCounters DecimalU5BU5D_tAA3302A4A6ACCE77638A2346993A0FAAE2F9FDBA* ___rangeCounters_1; public: inline static int32_t get_offset_of_curpos_0() { return static_cast<int32_t>(offsetof(RangePositionInfo_tB46C25982A33E1DF36005E89A4A1EA3D397DB8BB, ___curpos_0)); } inline BitSet_t36CD5E21CDE8972A6BCEF9E414933DD893966438 * get_curpos_0() const { return ___curpos_0; } inline BitSet_t36CD5E21CDE8972A6BCEF9E414933DD893966438 ** get_address_of_curpos_0() { return &___curpos_0; } inline void set_curpos_0(BitSet_t36CD5E21CDE8972A6BCEF9E414933DD893966438 * value) { ___curpos_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___curpos_0), (void*)value); } inline static int32_t get_offset_of_rangeCounters_1() { return static_cast<int32_t>(offsetof(RangePositionInfo_tB46C25982A33E1DF36005E89A4A1EA3D397DB8BB, ___rangeCounters_1)); } inline DecimalU5BU5D_tAA3302A4A6ACCE77638A2346993A0FAAE2F9FDBA* get_rangeCounters_1() const { return ___rangeCounters_1; } inline DecimalU5BU5D_tAA3302A4A6ACCE77638A2346993A0FAAE2F9FDBA** get_address_of_rangeCounters_1() { return &___rangeCounters_1; } inline void set_rangeCounters_1(DecimalU5BU5D_tAA3302A4A6ACCE77638A2346993A0FAAE2F9FDBA* value) { ___rangeCounters_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___rangeCounters_1), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Xml.Schema.RangePositionInfo struct RangePositionInfo_tB46C25982A33E1DF36005E89A4A1EA3D397DB8BB_marshaled_pinvoke { BitSet_t36CD5E21CDE8972A6BCEF9E414933DD893966438 * ___curpos_0; Decimal_t2978B229CA86D3B7BA66A0AEEE014E0DE4F940D7 * ___rangeCounters_1; }; // Native definition for COM marshalling of System.Xml.Schema.RangePositionInfo struct RangePositionInfo_tB46C25982A33E1DF36005E89A4A1EA3D397DB8BB_marshaled_com { BitSet_t36CD5E21CDE8972A6BCEF9E414933DD893966438 * ___curpos_0; Decimal_t2978B229CA86D3B7BA66A0AEEE014E0DE4F940D7 * ___rangeCounters_1; }; // UnityEngine.Rect struct Rect_t7D9187DB6339DBA5741C09B6CCEF2F54F1966878 { public: // System.Single UnityEngine.Rect::m_XMin float ___m_XMin_0; // System.Single UnityEngine.Rect::m_YMin float ___m_YMin_1; // System.Single UnityEngine.Rect::m_Width float ___m_Width_2; // System.Single UnityEngine.Rect::m_Height float ___m_Height_3; public: inline static int32_t get_offset_of_m_XMin_0() { return static_cast<int32_t>(offsetof(Rect_t7D9187DB6339DBA5741C09B6CCEF2F54F1966878, ___m_XMin_0)); } inline float get_m_XMin_0() const { return ___m_XMin_0; } inline float* get_address_of_m_XMin_0() { return &___m_XMin_0; } inline void set_m_XMin_0(float value) { ___m_XMin_0 = value; } inline static int32_t get_offset_of_m_YMin_1() { return static_cast<int32_t>(offsetof(Rect_t7D9187DB6339DBA5741C09B6CCEF2F54F1966878, ___m_YMin_1)); } inline float get_m_YMin_1() const { return ___m_YMin_1; } inline float* get_address_of_m_YMin_1() { return &___m_YMin_1; } inline void set_m_YMin_1(float value) { ___m_YMin_1 = value; } inline static int32_t get_offset_of_m_Width_2() { return static_cast<int32_t>(offsetof(Rect_t7D9187DB6339DBA5741C09B6CCEF2F54F1966878, ___m_Width_2)); } inline float get_m_Width_2() const { return ___m_Width_2; } inline float* get_address_of_m_Width_2() { return &___m_Width_2; } inline void set_m_Width_2(float value) { ___m_Width_2 = value; } inline static int32_t get_offset_of_m_Height_3() { return static_cast<int32_t>(offsetof(Rect_t7D9187DB6339DBA5741C09B6CCEF2F54F1966878, ___m_Height_3)); } inline float get_m_Height_3() const { return ___m_Height_3; } inline float* get_address_of_m_Height_3() { return &___m_Height_3; } inline void set_m_Height_3(float value) { ___m_Height_3 = value; } }; // UnityEngine.SceneManagement.Scene struct Scene_t5495AD2FDC587DB2E94D9BDE2B85868BFB9A92EE { public: // System.Int32 UnityEngine.SceneManagement.Scene::m_Handle int32_t ___m_Handle_0; public: inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(Scene_t5495AD2FDC587DB2E94D9BDE2B85868BFB9A92EE, ___m_Handle_0)); } inline int32_t get_m_Handle_0() const { return ___m_Handle_0; } inline int32_t* get_address_of_m_Handle_0() { return &___m_Handle_0; } inline void set_m_Handle_0(int32_t value) { ___m_Handle_0 = value; } }; // Microsoft.Extensions.Logging.ScopeLogger struct ScopeLogger_t02B3B8FB31EC53E1637DFE7CDFF2AC6E4C04F0DC { public: // Microsoft.Extensions.Logging.ILogger Microsoft.Extensions.Logging.ScopeLogger::<Logger>k__BackingField RuntimeObject* ___U3CLoggerU3Ek__BackingField_0; // Microsoft.Extensions.Logging.IExternalScopeProvider Microsoft.Extensions.Logging.ScopeLogger::<ExternalScopeProvider>k__BackingField RuntimeObject* ___U3CExternalScopeProviderU3Ek__BackingField_1; public: inline static int32_t get_offset_of_U3CLoggerU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(ScopeLogger_t02B3B8FB31EC53E1637DFE7CDFF2AC6E4C04F0DC, ___U3CLoggerU3Ek__BackingField_0)); } inline RuntimeObject* get_U3CLoggerU3Ek__BackingField_0() const { return ___U3CLoggerU3Ek__BackingField_0; } inline RuntimeObject** get_address_of_U3CLoggerU3Ek__BackingField_0() { return &___U3CLoggerU3Ek__BackingField_0; } inline void set_U3CLoggerU3Ek__BackingField_0(RuntimeObject* value) { ___U3CLoggerU3Ek__BackingField_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CLoggerU3Ek__BackingField_0), (void*)value); } inline static int32_t get_offset_of_U3CExternalScopeProviderU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(ScopeLogger_t02B3B8FB31EC53E1637DFE7CDFF2AC6E4C04F0DC, ___U3CExternalScopeProviderU3Ek__BackingField_1)); } inline RuntimeObject* get_U3CExternalScopeProviderU3Ek__BackingField_1() const { return ___U3CExternalScopeProviderU3Ek__BackingField_1; } inline RuntimeObject** get_address_of_U3CExternalScopeProviderU3Ek__BackingField_1() { return &___U3CExternalScopeProviderU3Ek__BackingField_1; } inline void set_U3CExternalScopeProviderU3Ek__BackingField_1(RuntimeObject* value) { ___U3CExternalScopeProviderU3Ek__BackingField_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CExternalScopeProviderU3Ek__BackingField_1), (void*)value); } }; // Native definition for P/Invoke marshalling of Microsoft.Extensions.Logging.ScopeLogger struct ScopeLogger_t02B3B8FB31EC53E1637DFE7CDFF2AC6E4C04F0DC_marshaled_pinvoke { RuntimeObject* ___U3CLoggerU3Ek__BackingField_0; RuntimeObject* ___U3CExternalScopeProviderU3Ek__BackingField_1; }; // Native definition for COM marshalling of Microsoft.Extensions.Logging.ScopeLogger struct ScopeLogger_t02B3B8FB31EC53E1637DFE7CDFF2AC6E4C04F0DC_marshaled_com { RuntimeObject* ___U3CLoggerU3Ek__BackingField_0; RuntimeObject* ___U3CExternalScopeProviderU3Ek__BackingField_1; }; // UnityEngine.ResourceManagement.Util.SerializedType struct SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B { public: // System.String UnityEngine.ResourceManagement.Util.SerializedType::m_AssemblyName String_t* ___m_AssemblyName_0; // System.String UnityEngine.ResourceManagement.Util.SerializedType::m_ClassName String_t* ___m_ClassName_1; // System.Type UnityEngine.ResourceManagement.Util.SerializedType::m_CachedType Type_t * ___m_CachedType_2; // System.Boolean UnityEngine.ResourceManagement.Util.SerializedType::<ValueChanged>k__BackingField bool ___U3CValueChangedU3Ek__BackingField_3; public: inline static int32_t get_offset_of_m_AssemblyName_0() { return static_cast<int32_t>(offsetof(SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B, ___m_AssemblyName_0)); } inline String_t* get_m_AssemblyName_0() const { return ___m_AssemblyName_0; } inline String_t** get_address_of_m_AssemblyName_0() { return &___m_AssemblyName_0; } inline void set_m_AssemblyName_0(String_t* value) { ___m_AssemblyName_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_AssemblyName_0), (void*)value); } inline static int32_t get_offset_of_m_ClassName_1() { return static_cast<int32_t>(offsetof(SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B, ___m_ClassName_1)); } inline String_t* get_m_ClassName_1() const { return ___m_ClassName_1; } inline String_t** get_address_of_m_ClassName_1() { return &___m_ClassName_1; } inline void set_m_ClassName_1(String_t* value) { ___m_ClassName_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_ClassName_1), (void*)value); } inline static int32_t get_offset_of_m_CachedType_2() { return static_cast<int32_t>(offsetof(SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B, ___m_CachedType_2)); } inline Type_t * get_m_CachedType_2() const { return ___m_CachedType_2; } inline Type_t ** get_address_of_m_CachedType_2() { return &___m_CachedType_2; } inline void set_m_CachedType_2(Type_t * value) { ___m_CachedType_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_CachedType_2), (void*)value); } inline static int32_t get_offset_of_U3CValueChangedU3Ek__BackingField_3() { return static_cast<int32_t>(offsetof(SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B, ___U3CValueChangedU3Ek__BackingField_3)); } inline bool get_U3CValueChangedU3Ek__BackingField_3() const { return ___U3CValueChangedU3Ek__BackingField_3; } inline bool* get_address_of_U3CValueChangedU3Ek__BackingField_3() { return &___U3CValueChangedU3Ek__BackingField_3; } inline void set_U3CValueChangedU3Ek__BackingField_3(bool value) { ___U3CValueChangedU3Ek__BackingField_3 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.ResourceManagement.Util.SerializedType struct SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B_marshaled_pinvoke { char* ___m_AssemblyName_0; char* ___m_ClassName_1; Type_t * ___m_CachedType_2; int32_t ___U3CValueChangedU3Ek__BackingField_3; }; // Native definition for COM marshalling of UnityEngine.ResourceManagement.Util.SerializedType struct SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B_marshaled_com { Il2CppChar* ___m_AssemblyName_0; Il2CppChar* ___m_ClassName_1; Type_t * ___m_CachedType_2; int32_t ___U3CValueChangedU3Ek__BackingField_3; }; // Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey struct ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C { public: // System.Type Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey::<Type>k__BackingField Type_t * ___U3CTypeU3Ek__BackingField_1; // System.Int32 Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey::<Slot>k__BackingField int32_t ___U3CSlotU3Ek__BackingField_2; public: inline static int32_t get_offset_of_U3CTypeU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C, ___U3CTypeU3Ek__BackingField_1)); } inline Type_t * get_U3CTypeU3Ek__BackingField_1() const { return ___U3CTypeU3Ek__BackingField_1; } inline Type_t ** get_address_of_U3CTypeU3Ek__BackingField_1() { return &___U3CTypeU3Ek__BackingField_1; } inline void set_U3CTypeU3Ek__BackingField_1(Type_t * value) { ___U3CTypeU3Ek__BackingField_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CTypeU3Ek__BackingField_1), (void*)value); } inline static int32_t get_offset_of_U3CSlotU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C, ___U3CSlotU3Ek__BackingField_2)); } inline int32_t get_U3CSlotU3Ek__BackingField_2() const { return ___U3CSlotU3Ek__BackingField_2; } inline int32_t* get_address_of_U3CSlotU3Ek__BackingField_2() { return &___U3CSlotU3Ek__BackingField_2; } inline void set_U3CSlotU3Ek__BackingField_2(int32_t value) { ___U3CSlotU3Ek__BackingField_2 = value; } }; struct ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C_StaticFields { public: // Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey::<Empty>k__BackingField ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C ___U3CEmptyU3Ek__BackingField_0; public: inline static int32_t get_offset_of_U3CEmptyU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C_StaticFields, ___U3CEmptyU3Ek__BackingField_0)); } inline ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C get_U3CEmptyU3Ek__BackingField_0() const { return ___U3CEmptyU3Ek__BackingField_0; } inline ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C * get_address_of_U3CEmptyU3Ek__BackingField_0() { return &___U3CEmptyU3Ek__BackingField_0; } inline void set_U3CEmptyU3Ek__BackingField_0(ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C value) { ___U3CEmptyU3Ek__BackingField_0 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___U3CEmptyU3Ek__BackingField_0))->___U3CTypeU3Ek__BackingField_1), (void*)NULL); } }; // Native definition for P/Invoke marshalling of Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey struct ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C_marshaled_pinvoke { Type_t * ___U3CTypeU3Ek__BackingField_1; int32_t ___U3CSlotU3Ek__BackingField_2; }; // Native definition for COM marshalling of Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey struct ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C_marshaled_com { Type_t * ___U3CTypeU3Ek__BackingField_1; int32_t ___U3CSlotU3Ek__BackingField_2; }; // UnityEngine.InputSystem.Utilities.Substring struct Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB { public: // System.String UnityEngine.InputSystem.Utilities.Substring::m_String String_t* ___m_String_0; // System.Int32 UnityEngine.InputSystem.Utilities.Substring::m_Index int32_t ___m_Index_1; // System.Int32 UnityEngine.InputSystem.Utilities.Substring::m_Length int32_t ___m_Length_2; public: inline static int32_t get_offset_of_m_String_0() { return static_cast<int32_t>(offsetof(Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB, ___m_String_0)); } inline String_t* get_m_String_0() const { return ___m_String_0; } inline String_t** get_address_of_m_String_0() { return &___m_String_0; } inline void set_m_String_0(String_t* value) { ___m_String_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_String_0), (void*)value); } inline static int32_t get_offset_of_m_Index_1() { return static_cast<int32_t>(offsetof(Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB, ___m_Index_1)); } inline int32_t get_m_Index_1() const { return ___m_Index_1; } inline int32_t* get_address_of_m_Index_1() { return &___m_Index_1; } inline void set_m_Index_1(int32_t value) { ___m_Index_1 = value; } inline static int32_t get_offset_of_m_Length_2() { return static_cast<int32_t>(offsetof(Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB, ___m_Length_2)); } inline int32_t get_m_Length_2() const { return ___m_Length_2; } inline int32_t* get_address_of_m_Length_2() { return &___m_Length_2; } inline void set_m_Length_2(int32_t value) { ___m_Length_2 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.InputSystem.Utilities.Substring struct Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB_marshaled_pinvoke { char* ___m_String_0; int32_t ___m_Index_1; int32_t ___m_Length_2; }; // Native definition for COM marshalling of UnityEngine.InputSystem.Utilities.Substring struct Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB_marshaled_com { Il2CppChar* ___m_String_0; int32_t ___m_Index_1; int32_t ___m_Length_2; }; // UnityEngine.Vector2 struct Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 { public: // System.Single UnityEngine.Vector2::x float ___x_0; // System.Single UnityEngine.Vector2::y float ___y_1; public: inline static int32_t get_offset_of_x_0() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9, ___x_0)); } inline float get_x_0() const { return ___x_0; } inline float* get_address_of_x_0() { return &___x_0; } inline void set_x_0(float value) { ___x_0 = value; } inline static int32_t get_offset_of_y_1() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9, ___y_1)); } inline float get_y_1() const { return ___y_1; } inline float* get_address_of_y_1() { return &___y_1; } inline void set_y_1(float value) { ___y_1 = value; } }; struct Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields { public: // UnityEngine.Vector2 UnityEngine.Vector2::zeroVector Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___zeroVector_2; // UnityEngine.Vector2 UnityEngine.Vector2::oneVector Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___oneVector_3; // UnityEngine.Vector2 UnityEngine.Vector2::upVector Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___upVector_4; // UnityEngine.Vector2 UnityEngine.Vector2::downVector Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___downVector_5; // UnityEngine.Vector2 UnityEngine.Vector2::leftVector Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___leftVector_6; // UnityEngine.Vector2 UnityEngine.Vector2::rightVector Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___rightVector_7; // UnityEngine.Vector2 UnityEngine.Vector2::positiveInfinityVector Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___positiveInfinityVector_8; // UnityEngine.Vector2 UnityEngine.Vector2::negativeInfinityVector Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___negativeInfinityVector_9; public: inline static int32_t get_offset_of_zeroVector_2() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___zeroVector_2)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_zeroVector_2() const { return ___zeroVector_2; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_zeroVector_2() { return &___zeroVector_2; } inline void set_zeroVector_2(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___zeroVector_2 = value; } inline static int32_t get_offset_of_oneVector_3() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___oneVector_3)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_oneVector_3() const { return ___oneVector_3; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_oneVector_3() { return &___oneVector_3; } inline void set_oneVector_3(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___oneVector_3 = value; } inline static int32_t get_offset_of_upVector_4() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___upVector_4)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_upVector_4() const { return ___upVector_4; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_upVector_4() { return &___upVector_4; } inline void set_upVector_4(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___upVector_4 = value; } inline static int32_t get_offset_of_downVector_5() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___downVector_5)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_downVector_5() const { return ___downVector_5; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_downVector_5() { return &___downVector_5; } inline void set_downVector_5(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___downVector_5 = value; } inline static int32_t get_offset_of_leftVector_6() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___leftVector_6)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_leftVector_6() const { return ___leftVector_6; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_leftVector_6() { return &___leftVector_6; } inline void set_leftVector_6(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___leftVector_6 = value; } inline static int32_t get_offset_of_rightVector_7() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___rightVector_7)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_rightVector_7() const { return ___rightVector_7; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_rightVector_7() { return &___rightVector_7; } inline void set_rightVector_7(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___rightVector_7 = value; } inline static int32_t get_offset_of_positiveInfinityVector_8() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___positiveInfinityVector_8)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_positiveInfinityVector_8() const { return ___positiveInfinityVector_8; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_positiveInfinityVector_8() { return &___positiveInfinityVector_8; } inline void set_positiveInfinityVector_8(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___positiveInfinityVector_8 = value; } inline static int32_t get_offset_of_negativeInfinityVector_9() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___negativeInfinityVector_9)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_negativeInfinityVector_9() const { return ___negativeInfinityVector_9; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_negativeInfinityVector_9() { return &___negativeInfinityVector_9; } inline void set_negativeInfinityVector_9(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___negativeInfinityVector_9 = value; } }; // UnityEngine.Vector3 struct Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E { public: // System.Single UnityEngine.Vector3::x float ___x_2; // System.Single UnityEngine.Vector3::y float ___y_3; // System.Single UnityEngine.Vector3::z float ___z_4; public: inline static int32_t get_offset_of_x_2() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E, ___x_2)); } inline float get_x_2() const { return ___x_2; } inline float* get_address_of_x_2() { return &___x_2; } inline void set_x_2(float value) { ___x_2 = value; } inline static int32_t get_offset_of_y_3() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E, ___y_3)); } inline float get_y_3() const { return ___y_3; } inline float* get_address_of_y_3() { return &___y_3; } inline void set_y_3(float value) { ___y_3 = value; } inline static int32_t get_offset_of_z_4() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E, ___z_4)); } inline float get_z_4() const { return ___z_4; } inline float* get_address_of_z_4() { return &___z_4; } inline void set_z_4(float value) { ___z_4 = value; } }; struct Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields { public: // UnityEngine.Vector3 UnityEngine.Vector3::zeroVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___zeroVector_5; // UnityEngine.Vector3 UnityEngine.Vector3::oneVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___oneVector_6; // UnityEngine.Vector3 UnityEngine.Vector3::upVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___upVector_7; // UnityEngine.Vector3 UnityEngine.Vector3::downVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___downVector_8; // UnityEngine.Vector3 UnityEngine.Vector3::leftVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___leftVector_9; // UnityEngine.Vector3 UnityEngine.Vector3::rightVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___rightVector_10; // UnityEngine.Vector3 UnityEngine.Vector3::forwardVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___forwardVector_11; // UnityEngine.Vector3 UnityEngine.Vector3::backVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___backVector_12; // UnityEngine.Vector3 UnityEngine.Vector3::positiveInfinityVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___positiveInfinityVector_13; // UnityEngine.Vector3 UnityEngine.Vector3::negativeInfinityVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___negativeInfinityVector_14; public: inline static int32_t get_offset_of_zeroVector_5() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___zeroVector_5)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_zeroVector_5() const { return ___zeroVector_5; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_zeroVector_5() { return &___zeroVector_5; } inline void set_zeroVector_5(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___zeroVector_5 = value; } inline static int32_t get_offset_of_oneVector_6() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___oneVector_6)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_oneVector_6() const { return ___oneVector_6; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_oneVector_6() { return &___oneVector_6; } inline void set_oneVector_6(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___oneVector_6 = value; } inline static int32_t get_offset_of_upVector_7() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___upVector_7)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_upVector_7() const { return ___upVector_7; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_upVector_7() { return &___upVector_7; } inline void set_upVector_7(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___upVector_7 = value; } inline static int32_t get_offset_of_downVector_8() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___downVector_8)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_downVector_8() const { return ___downVector_8; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_downVector_8() { return &___downVector_8; } inline void set_downVector_8(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___downVector_8 = value; } inline static int32_t get_offset_of_leftVector_9() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___leftVector_9)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_leftVector_9() const { return ___leftVector_9; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_leftVector_9() { return &___leftVector_9; } inline void set_leftVector_9(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___leftVector_9 = value; } inline static int32_t get_offset_of_rightVector_10() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___rightVector_10)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_rightVector_10() const { return ___rightVector_10; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_rightVector_10() { return &___rightVector_10; } inline void set_rightVector_10(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___rightVector_10 = value; } inline static int32_t get_offset_of_forwardVector_11() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___forwardVector_11)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_forwardVector_11() const { return ___forwardVector_11; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_forwardVector_11() { return &___forwardVector_11; } inline void set_forwardVector_11(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___forwardVector_11 = value; } inline static int32_t get_offset_of_backVector_12() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___backVector_12)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_backVector_12() const { return ___backVector_12; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_backVector_12() { return &___backVector_12; } inline void set_backVector_12(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___backVector_12 = value; } inline static int32_t get_offset_of_positiveInfinityVector_13() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___positiveInfinityVector_13)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_positiveInfinityVector_13() const { return ___positiveInfinityVector_13; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_positiveInfinityVector_13() { return &___positiveInfinityVector_13; } inline void set_positiveInfinityVector_13(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___positiveInfinityVector_13 = value; } inline static int32_t get_offset_of_negativeInfinityVector_14() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___negativeInfinityVector_14)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_negativeInfinityVector_14() const { return ___negativeInfinityVector_14; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_negativeInfinityVector_14() { return &___negativeInfinityVector_14; } inline void set_negativeInfinityVector_14(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___negativeInfinityVector_14 = value; } }; // System.Collections.Generic.List`1/Enumerator<System.Text.Json.ParameterRef> struct Enumerator_t19BED566B36736755CD9571FCD126DE30F299754 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tDB80B88112CB405F5EF227040AD5ACDE7537AF9B * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t19BED566B36736755CD9571FCD126DE30F299754, ___list_0)); } inline List_1_tDB80B88112CB405F5EF227040AD5ACDE7537AF9B * get_list_0() const { return ___list_0; } inline List_1_tDB80B88112CB405F5EF227040AD5ACDE7537AF9B ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tDB80B88112CB405F5EF227040AD5ACDE7537AF9B * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t19BED566B36736755CD9571FCD126DE30F299754, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t19BED566B36736755CD9571FCD126DE30F299754, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t19BED566B36736755CD9571FCD126DE30F299754, ___current_3)); } inline ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D get_current_3() const { return ___current_3; } inline ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D * get_address_of_current_3() { return &___current_3; } inline void set_current_3(ParameterRef_tEA61F1C234BF44C299BFEB2B67ECBDD97498439D value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___Info_1), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___NameFromJson_2), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<System.Text.Json.PropertyRef> struct Enumerator_t547DA271F10673317FFB796780E06232D5713341 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t547DA271F10673317FFB796780E06232D5713341, ___list_0)); } inline List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 * get_list_0() const { return ___list_0; } inline List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t547DA271F10673317FFB796780E06232D5713341, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t547DA271F10673317FFB796780E06232D5713341, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t547DA271F10673317FFB796780E06232D5713341, ___current_3)); } inline PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11 get_current_3() const { return ___current_3; } inline PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(PropertyRef_t1CB52AB7A7858CE4D420F655167E58CC279C6D11 value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___Info_1), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___NameFromJson_2), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<System.Xml.Schema.RangePositionInfo> struct Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t13B1332790E09F181E14718B9800D8D500D6508A * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RangePositionInfo_tB46C25982A33E1DF36005E89A4A1EA3D397DB8BB ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1, ___list_0)); } inline List_1_t13B1332790E09F181E14718B9800D8D500D6508A * get_list_0() const { return ___list_0; } inline List_1_t13B1332790E09F181E14718B9800D8D500D6508A ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t13B1332790E09F181E14718B9800D8D500D6508A * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1, ___current_3)); } inline RangePositionInfo_tB46C25982A33E1DF36005E89A4A1EA3D397DB8BB get_current_3() const { return ___current_3; } inline RangePositionInfo_tB46C25982A33E1DF36005E89A4A1EA3D397DB8BB * get_address_of_current_3() { return &___current_3; } inline void set_current_3(RangePositionInfo_tB46C25982A33E1DF36005E89A4A1EA3D397DB8BB value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___curpos_0), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___rangeCounters_1), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.Rect> struct Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t7AFC5094F7C1D24DAAA8893B11B1743A7A0D2CFE * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Rect_t7D9187DB6339DBA5741C09B6CCEF2F54F1966878 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C, ___list_0)); } inline List_1_t7AFC5094F7C1D24DAAA8893B11B1743A7A0D2CFE * get_list_0() const { return ___list_0; } inline List_1_t7AFC5094F7C1D24DAAA8893B11B1743A7A0D2CFE ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t7AFC5094F7C1D24DAAA8893B11B1743A7A0D2CFE * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C, ___current_3)); } inline Rect_t7D9187DB6339DBA5741C09B6CCEF2F54F1966878 get_current_3() const { return ___current_3; } inline Rect_t7D9187DB6339DBA5741C09B6CCEF2F54F1966878 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(Rect_t7D9187DB6339DBA5741C09B6CCEF2F54F1966878 value) { ___current_3 = value; } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.SceneManagement.Scene> struct Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tF5A06610AC52E0ED9B7CE8B210E3276277D82AB2 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Scene_t5495AD2FDC587DB2E94D9BDE2B85868BFB9A92EE ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551, ___list_0)); } inline List_1_tF5A06610AC52E0ED9B7CE8B210E3276277D82AB2 * get_list_0() const { return ___list_0; } inline List_1_tF5A06610AC52E0ED9B7CE8B210E3276277D82AB2 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tF5A06610AC52E0ED9B7CE8B210E3276277D82AB2 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551, ___current_3)); } inline Scene_t5495AD2FDC587DB2E94D9BDE2B85868BFB9A92EE get_current_3() const { return ___current_3; } inline Scene_t5495AD2FDC587DB2E94D9BDE2B85868BFB9A92EE * get_address_of_current_3() { return &___current_3; } inline void set_current_3(Scene_t5495AD2FDC587DB2E94D9BDE2B85868BFB9A92EE value) { ___current_3 = value; } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.Logging.ScopeLogger> struct Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t457B983379D6AAAF8C7055865C97247A7692EBA0 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ScopeLogger_t02B3B8FB31EC53E1637DFE7CDFF2AC6E4C04F0DC ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081, ___list_0)); } inline List_1_t457B983379D6AAAF8C7055865C97247A7692EBA0 * get_list_0() const { return ___list_0; } inline List_1_t457B983379D6AAAF8C7055865C97247A7692EBA0 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t457B983379D6AAAF8C7055865C97247A7692EBA0 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081, ___current_3)); } inline ScopeLogger_t02B3B8FB31EC53E1637DFE7CDFF2AC6E4C04F0DC get_current_3() const { return ___current_3; } inline ScopeLogger_t02B3B8FB31EC53E1637DFE7CDFF2AC6E4C04F0DC * get_address_of_current_3() { return &___current_3; } inline void set_current_3(ScopeLogger_t02B3B8FB31EC53E1637DFE7CDFF2AC6E4C04F0DC value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___U3CLoggerU3Ek__BackingField_0), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___U3CExternalScopeProviderU3Ek__BackingField_1), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey> struct Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t5F6F03390AD79E0AD57F69CF0CC51BA82A6B93AD * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8, ___list_0)); } inline List_1_t5F6F03390AD79E0AD57F69CF0CC51BA82A6B93AD * get_list_0() const { return ___list_0; } inline List_1_t5F6F03390AD79E0AD57F69CF0CC51BA82A6B93AD ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t5F6F03390AD79E0AD57F69CF0CC51BA82A6B93AD * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8, ___current_3)); } inline ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C get_current_3() const { return ___current_3; } inline ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C * get_address_of_current_3() { return &___current_3; } inline void set_current_3(ServiceCacheKey_tDA09D616862E0F4AAA3C30D7E68607229FBE3D8C value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___U3CTypeU3Ek__BackingField_1), (void*)NULL); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.InputSystem.Utilities.Substring> struct Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tAB9856DBE14D81F1CC9D0D573006894E79EB7FF9 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95, ___list_0)); } inline List_1_tAB9856DBE14D81F1CC9D0D573006894E79EB7FF9 * get_list_0() const { return ___list_0; } inline List_1_tAB9856DBE14D81F1CC9D0D573006894E79EB7FF9 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tAB9856DBE14D81F1CC9D0D573006894E79EB7FF9 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95, ___current_3)); } inline Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB get_current_3() const { return ___current_3; } inline Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB * get_address_of_current_3() { return &___current_3; } inline void set_current_3(Substring_tC798908C326D8A08CE2F8548E24B412BAF86CDAB value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___m_String_0), (void*)NULL); } }; // Unity.Collections.Allocator struct Allocator_t9888223DEF4F46F3419ECFCCD0753599BEE52A05 { public: // System.Int32 Unity.Collections.Allocator::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(Allocator_t9888223DEF4F46F3419ECFCCD0753599BEE52A05, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // Microsoft.MixedReality.Toolkit.Utilities.AxisType struct AxisType_tFA382360CBEDF34BB549410E81A1B1D1FA76A459 { public: // System.Int32 Microsoft.MixedReality.Toolkit.Utilities.AxisType::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(AxisType_tFA382360CBEDF34BB549410E81A1B1D1FA76A459, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.Bounds struct Bounds_t0F1F36D4F7AF49524B3C2A2259594412A3D3AE37 { public: // UnityEngine.Vector3 UnityEngine.Bounds::m_Center Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___m_Center_0; // UnityEngine.Vector3 UnityEngine.Bounds::m_Extents Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___m_Extents_1; public: inline static int32_t get_offset_of_m_Center_0() { return static_cast<int32_t>(offsetof(Bounds_t0F1F36D4F7AF49524B3C2A2259594412A3D3AE37, ___m_Center_0)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_m_Center_0() const { return ___m_Center_0; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_m_Center_0() { return &___m_Center_0; } inline void set_m_Center_0(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___m_Center_0 = value; } inline static int32_t get_offset_of_m_Extents_1() { return static_cast<int32_t>(offsetof(Bounds_t0F1F36D4F7AF49524B3C2A2259594412A3D3AE37, ___m_Extents_1)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_m_Extents_1() const { return ___m_Extents_1; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_m_Extents_1() { return &___m_Extents_1; } inline void set_m_Extents_1(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___m_Extents_1 = value; } }; // System.Text.Json.JsonTokenType struct JsonTokenType_t9210B7B6CDD0F0450BAC21C70FB4757BA3789C3F { public: // System.Byte System.Text.Json.JsonTokenType::value__ uint8_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(JsonTokenType_t9210B7B6CDD0F0450BAC21C70FB4757BA3789C3F, ___value___2)); } inline uint8_t get_value___2() const { return ___value___2; } inline uint8_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(uint8_t value) { ___value___2 = value; } }; // Microsoft.Extensions.Logging.LogLevel struct LogLevel_t23382BCAC93B8E023D5D6DE83BCD41312B4CB20C { public: // System.Int32 Microsoft.Extensions.Logging.LogLevel::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(LogLevel_t23382BCAC93B8E023D5D6DE83BCD41312B4CB20C, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.MeshTopology struct MeshTopology_tF37D1A0C174D5906B715580E7318A21B4263C1A6 { public: // System.Int32 UnityEngine.MeshTopology::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(MeshTopology_tF37D1A0C174D5906B715580E7318A21B4263C1A6, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.InputSystem.Utilities.NameAndParameters struct NameAndParameters_t2B86375E9882DEB71415B719608CB47EC457DFF4 { public: // System.String UnityEngine.InputSystem.Utilities.NameAndParameters::<name>k__BackingField String_t* ___U3CnameU3Ek__BackingField_0; // UnityEngine.InputSystem.Utilities.ReadOnlyArray`1<UnityEngine.InputSystem.Utilities.NamedValue> UnityEngine.InputSystem.Utilities.NameAndParameters::<parameters>k__BackingField ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE ___U3CparametersU3Ek__BackingField_1; public: inline static int32_t get_offset_of_U3CnameU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(NameAndParameters_t2B86375E9882DEB71415B719608CB47EC457DFF4, ___U3CnameU3Ek__BackingField_0)); } inline String_t* get_U3CnameU3Ek__BackingField_0() const { return ___U3CnameU3Ek__BackingField_0; } inline String_t** get_address_of_U3CnameU3Ek__BackingField_0() { return &___U3CnameU3Ek__BackingField_0; } inline void set_U3CnameU3Ek__BackingField_0(String_t* value) { ___U3CnameU3Ek__BackingField_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CnameU3Ek__BackingField_0), (void*)value); } inline static int32_t get_offset_of_U3CparametersU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(NameAndParameters_t2B86375E9882DEB71415B719608CB47EC457DFF4, ___U3CparametersU3Ek__BackingField_1)); } inline ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE get_U3CparametersU3Ek__BackingField_1() const { return ___U3CparametersU3Ek__BackingField_1; } inline ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE * get_address_of_U3CparametersU3Ek__BackingField_1() { return &___U3CparametersU3Ek__BackingField_1; } inline void set_U3CparametersU3Ek__BackingField_1(ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE value) { ___U3CparametersU3Ek__BackingField_1 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___U3CparametersU3Ek__BackingField_1))->___m_Array_0), (void*)NULL); } }; // Native definition for P/Invoke marshalling of UnityEngine.InputSystem.Utilities.NameAndParameters struct NameAndParameters_t2B86375E9882DEB71415B719608CB47EC457DFF4_marshaled_pinvoke { char* ___U3CnameU3Ek__BackingField_0; ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE ___U3CparametersU3Ek__BackingField_1; }; // Native definition for COM marshalling of UnityEngine.InputSystem.Utilities.NameAndParameters struct NameAndParameters_t2B86375E9882DEB71415B719608CB47EC457DFF4_marshaled_com { Il2CppChar* ___U3CnameU3Ek__BackingField_0; ReadOnlyArray_1_t6FE717AFD2F26F2DEB5FED5B30524738781C25CE ___U3CparametersU3Ek__BackingField_1; }; // UnityEngine.Object struct Object_tF2F3778131EFF286AF62B7B013A170F95A91571A : public RuntimeObject { public: // System.IntPtr UnityEngine.Object::m_CachedPtr intptr_t ___m_CachedPtr_0; public: inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A, ___m_CachedPtr_0)); } inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; } inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; } inline void set_m_CachedPtr_0(intptr_t value) { ___m_CachedPtr_0 = value; } }; struct Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_StaticFields { public: // System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1; public: inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); } inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; } inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; } inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value) { ___OffsetOfInstanceIDInCPlusPlusObject_1 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.Object struct Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_marshaled_pinvoke { intptr_t ___m_CachedPtr_0; }; // Native definition for COM marshalling of UnityEngine.Object struct Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_marshaled_com { intptr_t ___m_CachedPtr_0; }; // UnityEngine.ResourceManagement.Util.ObjectInitializationData struct ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3 { public: // System.String UnityEngine.ResourceManagement.Util.ObjectInitializationData::m_Id String_t* ___m_Id_0; // UnityEngine.ResourceManagement.Util.SerializedType UnityEngine.ResourceManagement.Util.ObjectInitializationData::m_ObjectType SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B ___m_ObjectType_1; // System.String UnityEngine.ResourceManagement.Util.ObjectInitializationData::m_Data String_t* ___m_Data_2; public: inline static int32_t get_offset_of_m_Id_0() { return static_cast<int32_t>(offsetof(ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3, ___m_Id_0)); } inline String_t* get_m_Id_0() const { return ___m_Id_0; } inline String_t** get_address_of_m_Id_0() { return &___m_Id_0; } inline void set_m_Id_0(String_t* value) { ___m_Id_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Id_0), (void*)value); } inline static int32_t get_offset_of_m_ObjectType_1() { return static_cast<int32_t>(offsetof(ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3, ___m_ObjectType_1)); } inline SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B get_m_ObjectType_1() const { return ___m_ObjectType_1; } inline SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B * get_address_of_m_ObjectType_1() { return &___m_ObjectType_1; } inline void set_m_ObjectType_1(SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B value) { ___m_ObjectType_1 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___m_ObjectType_1))->___m_AssemblyName_0), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___m_ObjectType_1))->___m_ClassName_1), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___m_ObjectType_1))->___m_CachedType_2), (void*)NULL); #endif } inline static int32_t get_offset_of_m_Data_2() { return static_cast<int32_t>(offsetof(ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3, ___m_Data_2)); } inline String_t* get_m_Data_2() const { return ___m_Data_2; } inline String_t** get_address_of_m_Data_2() { return &___m_Data_2; } inline void set_m_Data_2(String_t* value) { ___m_Data_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Data_2), (void*)value); } }; // Native definition for P/Invoke marshalling of UnityEngine.ResourceManagement.Util.ObjectInitializationData struct ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3_marshaled_pinvoke { char* ___m_Id_0; SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B_marshaled_pinvoke ___m_ObjectType_1; char* ___m_Data_2; }; // Native definition for COM marshalling of UnityEngine.ResourceManagement.Util.ObjectInitializationData struct ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3_marshaled_com { Il2CppChar* ___m_Id_0; SerializedType_t11D0506CAD7F8088F87CA851B3D4B24459086B2B_marshaled_com ___m_ObjectType_1; Il2CppChar* ___m_Data_2; }; // UnityEngine.Ray struct Ray_t2E9E67CC8B03EE6ED2BBF3D2C9C96DDF70E1D5E6 { public: // UnityEngine.Vector3 UnityEngine.Ray::m_Origin Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___m_Origin_0; // UnityEngine.Vector3 UnityEngine.Ray::m_Direction Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___m_Direction_1; public: inline static int32_t get_offset_of_m_Origin_0() { return static_cast<int32_t>(offsetof(Ray_t2E9E67CC8B03EE6ED2BBF3D2C9C96DDF70E1D5E6, ___m_Origin_0)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_m_Origin_0() const { return ___m_Origin_0; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_m_Origin_0() { return &___m_Origin_0; } inline void set_m_Origin_0(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___m_Origin_0 = value; } inline static int32_t get_offset_of_m_Direction_1() { return static_cast<int32_t>(offsetof(Ray_t2E9E67CC8B03EE6ED2BBF3D2C9C96DDF70E1D5E6, ___m_Direction_1)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_m_Direction_1() const { return ___m_Direction_1; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_m_Direction_1() { return &___m_Direction_1; } inline void set_m_Direction_1(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___m_Direction_1 = value; } }; // UnityEngine.RaycastHit2D struct RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4 { public: // UnityEngine.Vector2 UnityEngine.RaycastHit2D::m_Centroid Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___m_Centroid_0; // UnityEngine.Vector2 UnityEngine.RaycastHit2D::m_Point Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___m_Point_1; // UnityEngine.Vector2 UnityEngine.RaycastHit2D::m_Normal Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___m_Normal_2; // System.Single UnityEngine.RaycastHit2D::m_Distance float ___m_Distance_3; // System.Single UnityEngine.RaycastHit2D::m_Fraction float ___m_Fraction_4; // System.Int32 UnityEngine.RaycastHit2D::m_Collider int32_t ___m_Collider_5; public: inline static int32_t get_offset_of_m_Centroid_0() { return static_cast<int32_t>(offsetof(RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4, ___m_Centroid_0)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_m_Centroid_0() const { return ___m_Centroid_0; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_m_Centroid_0() { return &___m_Centroid_0; } inline void set_m_Centroid_0(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___m_Centroid_0 = value; } inline static int32_t get_offset_of_m_Point_1() { return static_cast<int32_t>(offsetof(RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4, ___m_Point_1)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_m_Point_1() const { return ___m_Point_1; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_m_Point_1() { return &___m_Point_1; } inline void set_m_Point_1(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___m_Point_1 = value; } inline static int32_t get_offset_of_m_Normal_2() { return static_cast<int32_t>(offsetof(RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4, ___m_Normal_2)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_m_Normal_2() const { return ___m_Normal_2; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_m_Normal_2() { return &___m_Normal_2; } inline void set_m_Normal_2(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___m_Normal_2 = value; } inline static int32_t get_offset_of_m_Distance_3() { return static_cast<int32_t>(offsetof(RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4, ___m_Distance_3)); } inline float get_m_Distance_3() const { return ___m_Distance_3; } inline float* get_address_of_m_Distance_3() { return &___m_Distance_3; } inline void set_m_Distance_3(float value) { ___m_Distance_3 = value; } inline static int32_t get_offset_of_m_Fraction_4() { return static_cast<int32_t>(offsetof(RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4, ___m_Fraction_4)); } inline float get_m_Fraction_4() const { return ___m_Fraction_4; } inline float* get_address_of_m_Fraction_4() { return &___m_Fraction_4; } inline void set_m_Fraction_4(float value) { ___m_Fraction_4 = value; } inline static int32_t get_offset_of_m_Collider_5() { return static_cast<int32_t>(offsetof(RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4, ___m_Collider_5)); } inline int32_t get_m_Collider_5() const { return ___m_Collider_5; } inline int32_t* get_address_of_m_Collider_5() { return &___m_Collider_5; } inline void set_m_Collider_5(int32_t value) { ___m_Collider_5 = value; } }; // UnityEngine.EventSystems.RaycastResult struct RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE { public: // UnityEngine.GameObject UnityEngine.EventSystems.RaycastResult::m_GameObject GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___m_GameObject_0; // UnityEngine.EventSystems.BaseRaycaster UnityEngine.EventSystems.RaycastResult::module BaseRaycaster_tBC0FB2CBE6D3D40991EC20F689C43F76AD82A876 * ___module_1; // System.Single UnityEngine.EventSystems.RaycastResult::distance float ___distance_2; // System.Single UnityEngine.EventSystems.RaycastResult::index float ___index_3; // System.Int32 UnityEngine.EventSystems.RaycastResult::depth int32_t ___depth_4; // System.Int32 UnityEngine.EventSystems.RaycastResult::sortingLayer int32_t ___sortingLayer_5; // System.Int32 UnityEngine.EventSystems.RaycastResult::sortingOrder int32_t ___sortingOrder_6; // UnityEngine.Vector3 UnityEngine.EventSystems.RaycastResult::worldPosition Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___worldPosition_7; // UnityEngine.Vector3 UnityEngine.EventSystems.RaycastResult::worldNormal Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___worldNormal_8; // UnityEngine.Vector2 UnityEngine.EventSystems.RaycastResult::screenPosition Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___screenPosition_9; // System.Int32 UnityEngine.EventSystems.RaycastResult::displayIndex int32_t ___displayIndex_10; public: inline static int32_t get_offset_of_m_GameObject_0() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___m_GameObject_0)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_m_GameObject_0() const { return ___m_GameObject_0; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_m_GameObject_0() { return &___m_GameObject_0; } inline void set_m_GameObject_0(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___m_GameObject_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_GameObject_0), (void*)value); } inline static int32_t get_offset_of_module_1() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___module_1)); } inline BaseRaycaster_tBC0FB2CBE6D3D40991EC20F689C43F76AD82A876 * get_module_1() const { return ___module_1; } inline BaseRaycaster_tBC0FB2CBE6D3D40991EC20F689C43F76AD82A876 ** get_address_of_module_1() { return &___module_1; } inline void set_module_1(BaseRaycaster_tBC0FB2CBE6D3D40991EC20F689C43F76AD82A876 * value) { ___module_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___module_1), (void*)value); } inline static int32_t get_offset_of_distance_2() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___distance_2)); } inline float get_distance_2() const { return ___distance_2; } inline float* get_address_of_distance_2() { return &___distance_2; } inline void set_distance_2(float value) { ___distance_2 = value; } inline static int32_t get_offset_of_index_3() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___index_3)); } inline float get_index_3() const { return ___index_3; } inline float* get_address_of_index_3() { return &___index_3; } inline void set_index_3(float value) { ___index_3 = value; } inline static int32_t get_offset_of_depth_4() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___depth_4)); } inline int32_t get_depth_4() const { return ___depth_4; } inline int32_t* get_address_of_depth_4() { return &___depth_4; } inline void set_depth_4(int32_t value) { ___depth_4 = value; } inline static int32_t get_offset_of_sortingLayer_5() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___sortingLayer_5)); } inline int32_t get_sortingLayer_5() const { return ___sortingLayer_5; } inline int32_t* get_address_of_sortingLayer_5() { return &___sortingLayer_5; } inline void set_sortingLayer_5(int32_t value) { ___sortingLayer_5 = value; } inline static int32_t get_offset_of_sortingOrder_6() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___sortingOrder_6)); } inline int32_t get_sortingOrder_6() const { return ___sortingOrder_6; } inline int32_t* get_address_of_sortingOrder_6() { return &___sortingOrder_6; } inline void set_sortingOrder_6(int32_t value) { ___sortingOrder_6 = value; } inline static int32_t get_offset_of_worldPosition_7() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___worldPosition_7)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_worldPosition_7() const { return ___worldPosition_7; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_worldPosition_7() { return &___worldPosition_7; } inline void set_worldPosition_7(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___worldPosition_7 = value; } inline static int32_t get_offset_of_worldNormal_8() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___worldNormal_8)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_worldNormal_8() const { return ___worldNormal_8; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_worldNormal_8() { return &___worldNormal_8; } inline void set_worldNormal_8(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___worldNormal_8 = value; } inline static int32_t get_offset_of_screenPosition_9() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___screenPosition_9)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_screenPosition_9() const { return ___screenPosition_9; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_screenPosition_9() { return &___screenPosition_9; } inline void set_screenPosition_9(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___screenPosition_9 = value; } inline static int32_t get_offset_of_displayIndex_10() { return static_cast<int32_t>(offsetof(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE, ___displayIndex_10)); } inline int32_t get_displayIndex_10() const { return ___displayIndex_10; } inline int32_t* get_address_of_displayIndex_10() { return &___displayIndex_10; } inline void set_displayIndex_10(int32_t value) { ___displayIndex_10 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.EventSystems.RaycastResult struct RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE_marshaled_pinvoke { GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___m_GameObject_0; BaseRaycaster_tBC0FB2CBE6D3D40991EC20F689C43F76AD82A876 * ___module_1; float ___distance_2; float ___index_3; int32_t ___depth_4; int32_t ___sortingLayer_5; int32_t ___sortingOrder_6; Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___worldPosition_7; Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___worldNormal_8; Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___screenPosition_9; int32_t ___displayIndex_10; }; // Native definition for COM marshalling of UnityEngine.EventSystems.RaycastResult struct RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE_marshaled_com { GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___m_GameObject_0; BaseRaycaster_tBC0FB2CBE6D3D40991EC20F689C43F76AD82A876 * ___module_1; float ___distance_2; float ___index_3; int32_t ___depth_4; int32_t ___sortingLayer_5; int32_t ___sortingOrder_6; Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___worldPosition_7; Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___worldNormal_8; Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___screenPosition_9; int32_t ___displayIndex_10; }; // System.Text.RegularExpressions.RegexOptions struct RegexOptions_t8F8CD5BC6C55FC2B657722FD09ABDFDF5BA6F6A4 { public: // System.Int32 System.Text.RegularExpressions.RegexOptions::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(RegexOptions_t8F8CD5BC6C55FC2B657722FD09ABDFDF5BA6F6A4, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // Microsoft.MixedReality.Toolkit.UI.ShaderPropertyType struct ShaderPropertyType_t90DBDDE00D272A01E6C0D6FFF937072D99E42CCF { public: // System.Int32 Microsoft.MixedReality.Toolkit.UI.ShaderPropertyType::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(ShaderPropertyType_t90DBDDE00D272A01E6C0D6FFF937072D99E42CCF, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.Text.Json.StackFrameObjectState struct StackFrameObjectState_tC32220B023A965598E785A9AA23DBBBCFC6EC934 { public: // System.Byte System.Text.Json.StackFrameObjectState::value__ uint8_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(StackFrameObjectState_tC32220B023A965598E785A9AA23DBBBCFC6EC934, ___value___2)); } inline uint8_t get_value___2() const { return ___value___2; } inline uint8_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(uint8_t value) { ___value___2 = value; } }; // System.Text.Json.StackFramePropertyState struct StackFramePropertyState_t8152BC103D8A28A5CD1B6DCBB22B49BA2F5A6B81 { public: // System.Byte System.Text.Json.StackFramePropertyState::value__ uint8_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(StackFramePropertyState_t8152BC103D8A28A5CD1B6DCBB22B49BA2F5A6B81, ___value___2)); } inline uint8_t get_value___2() const { return ___value___2; } inline uint8_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(uint8_t value) { ___value___2 = value; } }; // System.TypeCode struct TypeCode_tCB39BAB5CFB7A1E0BCB521413E3C46B81C31AA7C { public: // System.Int32 System.TypeCode::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(TypeCode_tCB39BAB5CFB7A1E0BCB521413E3C46B81C31AA7C, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.InputSystem.Utilities.NameAndParameters> struct Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tA5271CFF4C2EEEDEC0AE06FC0EBAB9579053A0E1 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current NameAndParameters_t2B86375E9882DEB71415B719608CB47EC457DFF4 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760, ___list_0)); } inline List_1_tA5271CFF4C2EEEDEC0AE06FC0EBAB9579053A0E1 * get_list_0() const { return ___list_0; } inline List_1_tA5271CFF4C2EEEDEC0AE06FC0EBAB9579053A0E1 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tA5271CFF4C2EEEDEC0AE06FC0EBAB9579053A0E1 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760, ___current_3)); } inline NameAndParameters_t2B86375E9882DEB71415B719608CB47EC457DFF4 get_current_3() const { return ___current_3; } inline NameAndParameters_t2B86375E9882DEB71415B719608CB47EC457DFF4 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(NameAndParameters_t2B86375E9882DEB71415B719608CB47EC457DFF4 value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___U3CnameU3Ek__BackingField_0), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&((&(((&___current_3))->___U3CparametersU3Ek__BackingField_1))->___m_Array_0), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.ResourceManagement.Util.ObjectInitializationData> struct Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t0DF9D498983B77B207A7E6FC612A1E79C607F026 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A, ___list_0)); } inline List_1_t0DF9D498983B77B207A7E6FC612A1E79C607F026 * get_list_0() const { return ___list_0; } inline List_1_t0DF9D498983B77B207A7E6FC612A1E79C607F026 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t0DF9D498983B77B207A7E6FC612A1E79C607F026 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A, ___current_3)); } inline ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3 get_current_3() const { return ___current_3; } inline ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(ObjectInitializationData_t4552E1504B7D6894C22177D7F4CEC1B2EE8F9BB3 value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___m_Id_0), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&((&(((&___current_3))->___m_ObjectType_1))->___m_AssemblyName_0), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&((&(((&___current_3))->___m_ObjectType_1))->___m_ClassName_1), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&((&(((&___current_3))->___m_ObjectType_1))->___m_CachedType_2), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___m_Data_2), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.Ray> struct Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tDBBF8003D7BAC756EE5262C1DF03096EB730DF2B * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current Ray_t2E9E67CC8B03EE6ED2BBF3D2C9C96DDF70E1D5E6 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657, ___list_0)); } inline List_1_tDBBF8003D7BAC756EE5262C1DF03096EB730DF2B * get_list_0() const { return ___list_0; } inline List_1_tDBBF8003D7BAC756EE5262C1DF03096EB730DF2B ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tDBBF8003D7BAC756EE5262C1DF03096EB730DF2B * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657, ___current_3)); } inline Ray_t2E9E67CC8B03EE6ED2BBF3D2C9C96DDF70E1D5E6 get_current_3() const { return ___current_3; } inline Ray_t2E9E67CC8B03EE6ED2BBF3D2C9C96DDF70E1D5E6 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(Ray_t2E9E67CC8B03EE6ED2BBF3D2C9C96DDF70E1D5E6 value) { ___current_3 = value; } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.RaycastHit2D> struct Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t3926283FA9AE49778D95220056CEBFB01D034379 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163, ___list_0)); } inline List_1_t3926283FA9AE49778D95220056CEBFB01D034379 * get_list_0() const { return ___list_0; } inline List_1_t3926283FA9AE49778D95220056CEBFB01D034379 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t3926283FA9AE49778D95220056CEBFB01D034379 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163, ___current_3)); } inline RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4 get_current_3() const { return ___current_3; } inline RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(RaycastHit2D_t210878DAEBC96C1F69DF9883C454758724A106A4 value) { ___current_3 = value; } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.EventSystems.RaycastResult> struct Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t367B604D3EA3D6A9EC95A32A521EF83F5DA9B447 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121, ___list_0)); } inline List_1_t367B604D3EA3D6A9EC95A32A521EF83F5DA9B447 * get_list_0() const { return ___list_0; } inline List_1_t367B604D3EA3D6A9EC95A32A521EF83F5DA9B447 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t367B604D3EA3D6A9EC95A32A521EF83F5DA9B447 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121, ___current_3)); } inline RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE get_current_3() const { return ___current_3; } inline RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE * get_address_of_current_3() { return &___current_3; } inline void set_current_3(RaycastResult_t9EFDE24B29650BD6DC8A49D954A3769E17146BCE value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___m_GameObject_0), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___module_1), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<System.Text.RegularExpressions.RegexOptions> struct Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tE931333A40AB4E57F72E00F9F23D19057C78120A * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current int32_t ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA, ___list_0)); } inline List_1_tE931333A40AB4E57F72E00F9F23D19057C78120A * get_list_0() const { return ___list_0; } inline List_1_tE931333A40AB4E57F72E00F9F23D19057C78120A ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tE931333A40AB4E57F72E00F9F23D19057C78120A * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA, ___current_3)); } inline int32_t get_current_3() const { return ___current_3; } inline int32_t* get_address_of_current_3() { return &___current_3; } inline void set_current_3(int32_t value) { ___current_3 = value; } }; // Unity.Collections.NativeArray`1<Microsoft.MixedReality.OpenXR.NativeAnchor> struct NativeArray_1_t948198436047057F87875A4F287B323C232637CA { public: // System.Void* Unity.Collections.NativeArray`1::m_Buffer void* ___m_Buffer_0; // System.Int32 Unity.Collections.NativeArray`1::m_Length int32_t ___m_Length_1; // Unity.Collections.Allocator Unity.Collections.NativeArray`1::m_AllocatorLabel int32_t ___m_AllocatorLabel_2; public: inline static int32_t get_offset_of_m_Buffer_0() { return static_cast<int32_t>(offsetof(NativeArray_1_t948198436047057F87875A4F287B323C232637CA, ___m_Buffer_0)); } inline void* get_m_Buffer_0() const { return ___m_Buffer_0; } inline void** get_address_of_m_Buffer_0() { return &___m_Buffer_0; } inline void set_m_Buffer_0(void* value) { ___m_Buffer_0 = value; } inline static int32_t get_offset_of_m_Length_1() { return static_cast<int32_t>(offsetof(NativeArray_1_t948198436047057F87875A4F287B323C232637CA, ___m_Length_1)); } inline int32_t get_m_Length_1() const { return ___m_Length_1; } inline int32_t* get_address_of_m_Length_1() { return &___m_Length_1; } inline void set_m_Length_1(int32_t value) { ___m_Length_1 = value; } inline static int32_t get_offset_of_m_AllocatorLabel_2() { return static_cast<int32_t>(offsetof(NativeArray_1_t948198436047057F87875A4F287B323C232637CA, ___m_AllocatorLabel_2)); } inline int32_t get_m_AllocatorLabel_2() const { return ___m_AllocatorLabel_2; } inline int32_t* get_address_of_m_AllocatorLabel_2() { return &___m_AllocatorLabel_2; } inline void set_m_AllocatorLabel_2(int32_t value) { ___m_AllocatorLabel_2 = value; } }; // Unity.Collections.NativeArray`1<Microsoft.MixedReality.OpenXR.NativePlane> struct NativeArray_1_tC70438C331D38EC8A19E41A28C518870C59FDEA9 { public: // System.Void* Unity.Collections.NativeArray`1::m_Buffer void* ___m_Buffer_0; // System.Int32 Unity.Collections.NativeArray`1::m_Length int32_t ___m_Length_1; // Unity.Collections.Allocator Unity.Collections.NativeArray`1::m_AllocatorLabel int32_t ___m_AllocatorLabel_2; public: inline static int32_t get_offset_of_m_Buffer_0() { return static_cast<int32_t>(offsetof(NativeArray_1_tC70438C331D38EC8A19E41A28C518870C59FDEA9, ___m_Buffer_0)); } inline void* get_m_Buffer_0() const { return ___m_Buffer_0; } inline void** get_address_of_m_Buffer_0() { return &___m_Buffer_0; } inline void set_m_Buffer_0(void* value) { ___m_Buffer_0 = value; } inline static int32_t get_offset_of_m_Length_1() { return static_cast<int32_t>(offsetof(NativeArray_1_tC70438C331D38EC8A19E41A28C518870C59FDEA9, ___m_Length_1)); } inline int32_t get_m_Length_1() const { return ___m_Length_1; } inline int32_t* get_address_of_m_Length_1() { return &___m_Length_1; } inline void set_m_Length_1(int32_t value) { ___m_Length_1 = value; } inline static int32_t get_offset_of_m_AllocatorLabel_2() { return static_cast<int32_t>(offsetof(NativeArray_1_tC70438C331D38EC8A19E41A28C518870C59FDEA9, ___m_AllocatorLabel_2)); } inline int32_t get_m_AllocatorLabel_2() const { return ___m_AllocatorLabel_2; } inline int32_t* get_address_of_m_AllocatorLabel_2() { return &___m_AllocatorLabel_2; } inline void set_m_AllocatorLabel_2(int32_t value) { ___m_AllocatorLabel_2 = value; } }; // Unity.Collections.NativeArray`1<UnityEngine.Plane> struct NativeArray_1_t527C586787ACD1AD75E3C78BFB024FFA9925662E { public: // System.Void* Unity.Collections.NativeArray`1::m_Buffer void* ___m_Buffer_0; // System.Int32 Unity.Collections.NativeArray`1::m_Length int32_t ___m_Length_1; // Unity.Collections.Allocator Unity.Collections.NativeArray`1::m_AllocatorLabel int32_t ___m_AllocatorLabel_2; public: inline static int32_t get_offset_of_m_Buffer_0() { return static_cast<int32_t>(offsetof(NativeArray_1_t527C586787ACD1AD75E3C78BFB024FFA9925662E, ___m_Buffer_0)); } inline void* get_m_Buffer_0() const { return ___m_Buffer_0; } inline void** get_address_of_m_Buffer_0() { return &___m_Buffer_0; } inline void set_m_Buffer_0(void* value) { ___m_Buffer_0 = value; } inline static int32_t get_offset_of_m_Length_1() { return static_cast<int32_t>(offsetof(NativeArray_1_t527C586787ACD1AD75E3C78BFB024FFA9925662E, ___m_Length_1)); } inline int32_t get_m_Length_1() const { return ___m_Length_1; } inline int32_t* get_address_of_m_Length_1() { return &___m_Length_1; } inline void set_m_Length_1(int32_t value) { ___m_Length_1 = value; } inline static int32_t get_offset_of_m_AllocatorLabel_2() { return static_cast<int32_t>(offsetof(NativeArray_1_t527C586787ACD1AD75E3C78BFB024FFA9925662E, ___m_AllocatorLabel_2)); } inline int32_t get_m_AllocatorLabel_2() const { return ___m_AllocatorLabel_2; } inline int32_t* get_address_of_m_AllocatorLabel_2() { return &___m_AllocatorLabel_2; } inline void set_m_AllocatorLabel_2(int32_t value) { ___m_AllocatorLabel_2 = value; } }; // System.Nullable`1<Microsoft.Extensions.Logging.LogLevel> struct Nullable_1_t94E89836758003D6AFF051A2A2119DB25B1ABC24 { public: // T System.Nullable`1::value int32_t ___value_0; // System.Boolean System.Nullable`1::has_value bool ___has_value_1; public: inline static int32_t get_offset_of_value_0() { return static_cast<int32_t>(offsetof(Nullable_1_t94E89836758003D6AFF051A2A2119DB25B1ABC24, ___value_0)); } inline int32_t get_value_0() const { return ___value_0; } inline int32_t* get_address_of_value_0() { return &___value_0; } inline void set_value_0(int32_t value) { ___value_0 = value; } inline static int32_t get_offset_of_has_value_1() { return static_cast<int32_t>(offsetof(Nullable_1_t94E89836758003D6AFF051A2A2119DB25B1ABC24, ___has_value_1)); } inline bool get_has_value_1() const { return ___has_value_1; } inline bool* get_address_of_has_value_1() { return &___has_value_1; } inline void set_has_value_1(bool value) { ___has_value_1 = value; } }; // Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction struct MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690 { public: // System.UInt32 Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction::id uint32_t ___id_1; // System.String Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction::description String_t* ___description_2; // Microsoft.MixedReality.Toolkit.Utilities.AxisType Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction::axisConstraint int32_t ___axisConstraint_3; public: inline static int32_t get_offset_of_id_1() { return static_cast<int32_t>(offsetof(MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690, ___id_1)); } inline uint32_t get_id_1() const { return ___id_1; } inline uint32_t* get_address_of_id_1() { return &___id_1; } inline void set_id_1(uint32_t value) { ___id_1 = value; } inline static int32_t get_offset_of_description_2() { return static_cast<int32_t>(offsetof(MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690, ___description_2)); } inline String_t* get_description_2() const { return ___description_2; } inline String_t** get_address_of_description_2() { return &___description_2; } inline void set_description_2(String_t* value) { ___description_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___description_2), (void*)value); } inline static int32_t get_offset_of_axisConstraint_3() { return static_cast<int32_t>(offsetof(MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690, ___axisConstraint_3)); } inline int32_t get_axisConstraint_3() const { return ___axisConstraint_3; } inline int32_t* get_address_of_axisConstraint_3() { return &___axisConstraint_3; } inline void set_axisConstraint_3(int32_t value) { ___axisConstraint_3 = value; } }; struct MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690_StaticFields { public: // Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction::<None>k__BackingField MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690 ___U3CNoneU3Ek__BackingField_0; public: inline static int32_t get_offset_of_U3CNoneU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690_StaticFields, ___U3CNoneU3Ek__BackingField_0)); } inline MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690 get_U3CNoneU3Ek__BackingField_0() const { return ___U3CNoneU3Ek__BackingField_0; } inline MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690 * get_address_of_U3CNoneU3Ek__BackingField_0() { return &___U3CNoneU3Ek__BackingField_0; } inline void set_U3CNoneU3Ek__BackingField_0(MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690 value) { ___U3CNoneU3Ek__BackingField_0 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___U3CNoneU3Ek__BackingField_0))->___description_2), (void*)NULL); } }; // Native definition for P/Invoke marshalling of Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction struct MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690_marshaled_pinvoke { uint32_t ___id_1; char* ___description_2; int32_t ___axisConstraint_3; }; // Native definition for COM marshalling of Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction struct MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690_marshaled_com { uint32_t ___id_1; Il2CppChar* ___description_2; int32_t ___axisConstraint_3; }; // UnityEngine.InputSystem.Utilities.PrimitiveValue struct PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8 { public: union { #pragma pack(push, tp, 1) struct { // System.TypeCode UnityEngine.InputSystem.Utilities.PrimitiveValue::m_Type int32_t ___m_Type_0; }; #pragma pack(pop, tp) struct { int32_t ___m_Type_0_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_BoolValue_1_OffsetPadding[4]; // System.Boolean UnityEngine.InputSystem.Utilities.PrimitiveValue::m_BoolValue bool ___m_BoolValue_1; }; #pragma pack(pop, tp) struct { char ___m_BoolValue_1_OffsetPadding_forAlignmentOnly[4]; bool ___m_BoolValue_1_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_CharValue_2_OffsetPadding[4]; // System.Char UnityEngine.InputSystem.Utilities.PrimitiveValue::m_CharValue Il2CppChar ___m_CharValue_2; }; #pragma pack(pop, tp) struct { char ___m_CharValue_2_OffsetPadding_forAlignmentOnly[4]; Il2CppChar ___m_CharValue_2_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_ByteValue_3_OffsetPadding[4]; // System.Byte UnityEngine.InputSystem.Utilities.PrimitiveValue::m_ByteValue uint8_t ___m_ByteValue_3; }; #pragma pack(pop, tp) struct { char ___m_ByteValue_3_OffsetPadding_forAlignmentOnly[4]; uint8_t ___m_ByteValue_3_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_SByteValue_4_OffsetPadding[4]; // System.SByte UnityEngine.InputSystem.Utilities.PrimitiveValue::m_SByteValue int8_t ___m_SByteValue_4; }; #pragma pack(pop, tp) struct { char ___m_SByteValue_4_OffsetPadding_forAlignmentOnly[4]; int8_t ___m_SByteValue_4_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_ShortValue_5_OffsetPadding[4]; // System.Int16 UnityEngine.InputSystem.Utilities.PrimitiveValue::m_ShortValue int16_t ___m_ShortValue_5; }; #pragma pack(pop, tp) struct { char ___m_ShortValue_5_OffsetPadding_forAlignmentOnly[4]; int16_t ___m_ShortValue_5_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_UShortValue_6_OffsetPadding[4]; // System.UInt16 UnityEngine.InputSystem.Utilities.PrimitiveValue::m_UShortValue uint16_t ___m_UShortValue_6; }; #pragma pack(pop, tp) struct { char ___m_UShortValue_6_OffsetPadding_forAlignmentOnly[4]; uint16_t ___m_UShortValue_6_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_IntValue_7_OffsetPadding[4]; // System.Int32 UnityEngine.InputSystem.Utilities.PrimitiveValue::m_IntValue int32_t ___m_IntValue_7; }; #pragma pack(pop, tp) struct { char ___m_IntValue_7_OffsetPadding_forAlignmentOnly[4]; int32_t ___m_IntValue_7_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_UIntValue_8_OffsetPadding[4]; // System.UInt32 UnityEngine.InputSystem.Utilities.PrimitiveValue::m_UIntValue uint32_t ___m_UIntValue_8; }; #pragma pack(pop, tp) struct { char ___m_UIntValue_8_OffsetPadding_forAlignmentOnly[4]; uint32_t ___m_UIntValue_8_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_LongValue_9_OffsetPadding[4]; // System.Int64 UnityEngine.InputSystem.Utilities.PrimitiveValue::m_LongValue int64_t ___m_LongValue_9; }; #pragma pack(pop, tp) struct { char ___m_LongValue_9_OffsetPadding_forAlignmentOnly[4]; int64_t ___m_LongValue_9_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_ULongValue_10_OffsetPadding[4]; // System.UInt64 UnityEngine.InputSystem.Utilities.PrimitiveValue::m_ULongValue uint64_t ___m_ULongValue_10; }; #pragma pack(pop, tp) struct { char ___m_ULongValue_10_OffsetPadding_forAlignmentOnly[4]; uint64_t ___m_ULongValue_10_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_FloatValue_11_OffsetPadding[4]; // System.Single UnityEngine.InputSystem.Utilities.PrimitiveValue::m_FloatValue float ___m_FloatValue_11; }; #pragma pack(pop, tp) struct { char ___m_FloatValue_11_OffsetPadding_forAlignmentOnly[4]; float ___m_FloatValue_11_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_DoubleValue_12_OffsetPadding[4]; // System.Double UnityEngine.InputSystem.Utilities.PrimitiveValue::m_DoubleValue double ___m_DoubleValue_12; }; #pragma pack(pop, tp) struct { char ___m_DoubleValue_12_OffsetPadding_forAlignmentOnly[4]; double ___m_DoubleValue_12_forAlignmentOnly; }; }; public: inline static int32_t get_offset_of_m_Type_0() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_Type_0)); } inline int32_t get_m_Type_0() const { return ___m_Type_0; } inline int32_t* get_address_of_m_Type_0() { return &___m_Type_0; } inline void set_m_Type_0(int32_t value) { ___m_Type_0 = value; } inline static int32_t get_offset_of_m_BoolValue_1() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_BoolValue_1)); } inline bool get_m_BoolValue_1() const { return ___m_BoolValue_1; } inline bool* get_address_of_m_BoolValue_1() { return &___m_BoolValue_1; } inline void set_m_BoolValue_1(bool value) { ___m_BoolValue_1 = value; } inline static int32_t get_offset_of_m_CharValue_2() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_CharValue_2)); } inline Il2CppChar get_m_CharValue_2() const { return ___m_CharValue_2; } inline Il2CppChar* get_address_of_m_CharValue_2() { return &___m_CharValue_2; } inline void set_m_CharValue_2(Il2CppChar value) { ___m_CharValue_2 = value; } inline static int32_t get_offset_of_m_ByteValue_3() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_ByteValue_3)); } inline uint8_t get_m_ByteValue_3() const { return ___m_ByteValue_3; } inline uint8_t* get_address_of_m_ByteValue_3() { return &___m_ByteValue_3; } inline void set_m_ByteValue_3(uint8_t value) { ___m_ByteValue_3 = value; } inline static int32_t get_offset_of_m_SByteValue_4() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_SByteValue_4)); } inline int8_t get_m_SByteValue_4() const { return ___m_SByteValue_4; } inline int8_t* get_address_of_m_SByteValue_4() { return &___m_SByteValue_4; } inline void set_m_SByteValue_4(int8_t value) { ___m_SByteValue_4 = value; } inline static int32_t get_offset_of_m_ShortValue_5() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_ShortValue_5)); } inline int16_t get_m_ShortValue_5() const { return ___m_ShortValue_5; } inline int16_t* get_address_of_m_ShortValue_5() { return &___m_ShortValue_5; } inline void set_m_ShortValue_5(int16_t value) { ___m_ShortValue_5 = value; } inline static int32_t get_offset_of_m_UShortValue_6() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_UShortValue_6)); } inline uint16_t get_m_UShortValue_6() const { return ___m_UShortValue_6; } inline uint16_t* get_address_of_m_UShortValue_6() { return &___m_UShortValue_6; } inline void set_m_UShortValue_6(uint16_t value) { ___m_UShortValue_6 = value; } inline static int32_t get_offset_of_m_IntValue_7() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_IntValue_7)); } inline int32_t get_m_IntValue_7() const { return ___m_IntValue_7; } inline int32_t* get_address_of_m_IntValue_7() { return &___m_IntValue_7; } inline void set_m_IntValue_7(int32_t value) { ___m_IntValue_7 = value; } inline static int32_t get_offset_of_m_UIntValue_8() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_UIntValue_8)); } inline uint32_t get_m_UIntValue_8() const { return ___m_UIntValue_8; } inline uint32_t* get_address_of_m_UIntValue_8() { return &___m_UIntValue_8; } inline void set_m_UIntValue_8(uint32_t value) { ___m_UIntValue_8 = value; } inline static int32_t get_offset_of_m_LongValue_9() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_LongValue_9)); } inline int64_t get_m_LongValue_9() const { return ___m_LongValue_9; } inline int64_t* get_address_of_m_LongValue_9() { return &___m_LongValue_9; } inline void set_m_LongValue_9(int64_t value) { ___m_LongValue_9 = value; } inline static int32_t get_offset_of_m_ULongValue_10() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_ULongValue_10)); } inline uint64_t get_m_ULongValue_10() const { return ___m_ULongValue_10; } inline uint64_t* get_address_of_m_ULongValue_10() { return &___m_ULongValue_10; } inline void set_m_ULongValue_10(uint64_t value) { ___m_ULongValue_10 = value; } inline static int32_t get_offset_of_m_FloatValue_11() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_FloatValue_11)); } inline float get_m_FloatValue_11() const { return ___m_FloatValue_11; } inline float* get_address_of_m_FloatValue_11() { return &___m_FloatValue_11; } inline void set_m_FloatValue_11(float value) { ___m_FloatValue_11 = value; } inline static int32_t get_offset_of_m_DoubleValue_12() { return static_cast<int32_t>(offsetof(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8, ___m_DoubleValue_12)); } inline double get_m_DoubleValue_12() const { return ___m_DoubleValue_12; } inline double* get_address_of_m_DoubleValue_12() { return &___m_DoubleValue_12; } inline void set_m_DoubleValue_12(double value) { ___m_DoubleValue_12 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.InputSystem.Utilities.PrimitiveValue struct PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8_marshaled_pinvoke { union { #pragma pack(push, tp, 1) struct { int32_t ___m_Type_0; }; #pragma pack(pop, tp) struct { int32_t ___m_Type_0_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_BoolValue_1_OffsetPadding[4]; int32_t ___m_BoolValue_1; }; #pragma pack(pop, tp) struct { char ___m_BoolValue_1_OffsetPadding_forAlignmentOnly[4]; int32_t ___m_BoolValue_1_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_CharValue_2_OffsetPadding[4]; uint8_t ___m_CharValue_2; }; #pragma pack(pop, tp) struct { char ___m_CharValue_2_OffsetPadding_forAlignmentOnly[4]; uint8_t ___m_CharValue_2_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_ByteValue_3_OffsetPadding[4]; uint8_t ___m_ByteValue_3; }; #pragma pack(pop, tp) struct { char ___m_ByteValue_3_OffsetPadding_forAlignmentOnly[4]; uint8_t ___m_ByteValue_3_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_SByteValue_4_OffsetPadding[4]; int8_t ___m_SByteValue_4; }; #pragma pack(pop, tp) struct { char ___m_SByteValue_4_OffsetPadding_forAlignmentOnly[4]; int8_t ___m_SByteValue_4_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_ShortValue_5_OffsetPadding[4]; int16_t ___m_ShortValue_5; }; #pragma pack(pop, tp) struct { char ___m_ShortValue_5_OffsetPadding_forAlignmentOnly[4]; int16_t ___m_ShortValue_5_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_UShortValue_6_OffsetPadding[4]; uint16_t ___m_UShortValue_6; }; #pragma pack(pop, tp) struct { char ___m_UShortValue_6_OffsetPadding_forAlignmentOnly[4]; uint16_t ___m_UShortValue_6_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_IntValue_7_OffsetPadding[4]; int32_t ___m_IntValue_7; }; #pragma pack(pop, tp) struct { char ___m_IntValue_7_OffsetPadding_forAlignmentOnly[4]; int32_t ___m_IntValue_7_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_UIntValue_8_OffsetPadding[4]; uint32_t ___m_UIntValue_8; }; #pragma pack(pop, tp) struct { char ___m_UIntValue_8_OffsetPadding_forAlignmentOnly[4]; uint32_t ___m_UIntValue_8_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_LongValue_9_OffsetPadding[4]; int64_t ___m_LongValue_9; }; #pragma pack(pop, tp) struct { char ___m_LongValue_9_OffsetPadding_forAlignmentOnly[4]; int64_t ___m_LongValue_9_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_ULongValue_10_OffsetPadding[4]; uint64_t ___m_ULongValue_10; }; #pragma pack(pop, tp) struct { char ___m_ULongValue_10_OffsetPadding_forAlignmentOnly[4]; uint64_t ___m_ULongValue_10_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_FloatValue_11_OffsetPadding[4]; float ___m_FloatValue_11; }; #pragma pack(pop, tp) struct { char ___m_FloatValue_11_OffsetPadding_forAlignmentOnly[4]; float ___m_FloatValue_11_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_DoubleValue_12_OffsetPadding[4]; double ___m_DoubleValue_12; }; #pragma pack(pop, tp) struct { char ___m_DoubleValue_12_OffsetPadding_forAlignmentOnly[4]; double ___m_DoubleValue_12_forAlignmentOnly; }; }; }; // Native definition for COM marshalling of UnityEngine.InputSystem.Utilities.PrimitiveValue struct PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8_marshaled_com { union { #pragma pack(push, tp, 1) struct { int32_t ___m_Type_0; }; #pragma pack(pop, tp) struct { int32_t ___m_Type_0_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_BoolValue_1_OffsetPadding[4]; int32_t ___m_BoolValue_1; }; #pragma pack(pop, tp) struct { char ___m_BoolValue_1_OffsetPadding_forAlignmentOnly[4]; int32_t ___m_BoolValue_1_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_CharValue_2_OffsetPadding[4]; uint8_t ___m_CharValue_2; }; #pragma pack(pop, tp) struct { char ___m_CharValue_2_OffsetPadding_forAlignmentOnly[4]; uint8_t ___m_CharValue_2_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_ByteValue_3_OffsetPadding[4]; uint8_t ___m_ByteValue_3; }; #pragma pack(pop, tp) struct { char ___m_ByteValue_3_OffsetPadding_forAlignmentOnly[4]; uint8_t ___m_ByteValue_3_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_SByteValue_4_OffsetPadding[4]; int8_t ___m_SByteValue_4; }; #pragma pack(pop, tp) struct { char ___m_SByteValue_4_OffsetPadding_forAlignmentOnly[4]; int8_t ___m_SByteValue_4_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_ShortValue_5_OffsetPadding[4]; int16_t ___m_ShortValue_5; }; #pragma pack(pop, tp) struct { char ___m_ShortValue_5_OffsetPadding_forAlignmentOnly[4]; int16_t ___m_ShortValue_5_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_UShortValue_6_OffsetPadding[4]; uint16_t ___m_UShortValue_6; }; #pragma pack(pop, tp) struct { char ___m_UShortValue_6_OffsetPadding_forAlignmentOnly[4]; uint16_t ___m_UShortValue_6_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_IntValue_7_OffsetPadding[4]; int32_t ___m_IntValue_7; }; #pragma pack(pop, tp) struct { char ___m_IntValue_7_OffsetPadding_forAlignmentOnly[4]; int32_t ___m_IntValue_7_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_UIntValue_8_OffsetPadding[4]; uint32_t ___m_UIntValue_8; }; #pragma pack(pop, tp) struct { char ___m_UIntValue_8_OffsetPadding_forAlignmentOnly[4]; uint32_t ___m_UIntValue_8_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_LongValue_9_OffsetPadding[4]; int64_t ___m_LongValue_9; }; #pragma pack(pop, tp) struct { char ___m_LongValue_9_OffsetPadding_forAlignmentOnly[4]; int64_t ___m_LongValue_9_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_ULongValue_10_OffsetPadding[4]; uint64_t ___m_ULongValue_10; }; #pragma pack(pop, tp) struct { char ___m_ULongValue_10_OffsetPadding_forAlignmentOnly[4]; uint64_t ___m_ULongValue_10_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_FloatValue_11_OffsetPadding[4]; float ___m_FloatValue_11; }; #pragma pack(pop, tp) struct { char ___m_FloatValue_11_OffsetPadding_forAlignmentOnly[4]; float ___m_FloatValue_11_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___m_DoubleValue_12_OffsetPadding[4]; double ___m_DoubleValue_12; }; #pragma pack(pop, tp) struct { char ___m_DoubleValue_12_OffsetPadding_forAlignmentOnly[4]; double ___m_DoubleValue_12_forAlignmentOnly; }; }; }; // System.Text.Json.ReadStackFrame struct ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3 { public: // System.Text.Json.JsonPropertyInfo System.Text.Json.ReadStackFrame::JsonPropertyInfo JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * ___JsonPropertyInfo_0; // System.Text.Json.StackFramePropertyState System.Text.Json.ReadStackFrame::PropertyState uint8_t ___PropertyState_1; // System.Boolean System.Text.Json.ReadStackFrame::UseExtensionProperty bool ___UseExtensionProperty_2; // System.Byte[] System.Text.Json.ReadStackFrame::JsonPropertyName ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* ___JsonPropertyName_3; // System.String System.Text.Json.ReadStackFrame::JsonPropertyNameAsString String_t* ___JsonPropertyNameAsString_4; // System.Int32 System.Text.Json.ReadStackFrame::OriginalDepth int32_t ___OriginalDepth_5; // System.Text.Json.JsonTokenType System.Text.Json.ReadStackFrame::OriginalTokenType uint8_t ___OriginalTokenType_6; // System.Object System.Text.Json.ReadStackFrame::ReturnValue RuntimeObject * ___ReturnValue_7; // System.Text.Json.JsonClassInfo System.Text.Json.ReadStackFrame::JsonClassInfo JsonClassInfo_tD68347CE667BE8A8421B64672918C17B63087226 * ___JsonClassInfo_8; // System.Text.Json.StackFrameObjectState System.Text.Json.ReadStackFrame::ObjectState uint8_t ___ObjectState_9; // System.String System.Text.Json.ReadStackFrame::MetadataId String_t* ___MetadataId_10; // System.Int32 System.Text.Json.ReadStackFrame::PropertyIndex int32_t ___PropertyIndex_11; // System.Collections.Generic.List`1<System.Text.Json.PropertyRef> System.Text.Json.ReadStackFrame::PropertyRefCache List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 * ___PropertyRefCache_12; // System.Object System.Text.Json.ReadStackFrame::AddMethodDelegate RuntimeObject * ___AddMethodDelegate_13; // System.Int32 System.Text.Json.ReadStackFrame::CtorArgumentStateIndex int32_t ___CtorArgumentStateIndex_14; // System.Text.Json.ArgumentState System.Text.Json.ReadStackFrame::CtorArgumentState ArgumentState_t12473DA2560B3F7D67458F48D08F0C78FBE42AC5 * ___CtorArgumentState_15; public: inline static int32_t get_offset_of_JsonPropertyInfo_0() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___JsonPropertyInfo_0)); } inline JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * get_JsonPropertyInfo_0() const { return ___JsonPropertyInfo_0; } inline JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B ** get_address_of_JsonPropertyInfo_0() { return &___JsonPropertyInfo_0; } inline void set_JsonPropertyInfo_0(JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * value) { ___JsonPropertyInfo_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___JsonPropertyInfo_0), (void*)value); } inline static int32_t get_offset_of_PropertyState_1() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___PropertyState_1)); } inline uint8_t get_PropertyState_1() const { return ___PropertyState_1; } inline uint8_t* get_address_of_PropertyState_1() { return &___PropertyState_1; } inline void set_PropertyState_1(uint8_t value) { ___PropertyState_1 = value; } inline static int32_t get_offset_of_UseExtensionProperty_2() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___UseExtensionProperty_2)); } inline bool get_UseExtensionProperty_2() const { return ___UseExtensionProperty_2; } inline bool* get_address_of_UseExtensionProperty_2() { return &___UseExtensionProperty_2; } inline void set_UseExtensionProperty_2(bool value) { ___UseExtensionProperty_2 = value; } inline static int32_t get_offset_of_JsonPropertyName_3() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___JsonPropertyName_3)); } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* get_JsonPropertyName_3() const { return ___JsonPropertyName_3; } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726** get_address_of_JsonPropertyName_3() { return &___JsonPropertyName_3; } inline void set_JsonPropertyName_3(ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* value) { ___JsonPropertyName_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___JsonPropertyName_3), (void*)value); } inline static int32_t get_offset_of_JsonPropertyNameAsString_4() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___JsonPropertyNameAsString_4)); } inline String_t* get_JsonPropertyNameAsString_4() const { return ___JsonPropertyNameAsString_4; } inline String_t** get_address_of_JsonPropertyNameAsString_4() { return &___JsonPropertyNameAsString_4; } inline void set_JsonPropertyNameAsString_4(String_t* value) { ___JsonPropertyNameAsString_4 = value; Il2CppCodeGenWriteBarrier((void**)(&___JsonPropertyNameAsString_4), (void*)value); } inline static int32_t get_offset_of_OriginalDepth_5() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___OriginalDepth_5)); } inline int32_t get_OriginalDepth_5() const { return ___OriginalDepth_5; } inline int32_t* get_address_of_OriginalDepth_5() { return &___OriginalDepth_5; } inline void set_OriginalDepth_5(int32_t value) { ___OriginalDepth_5 = value; } inline static int32_t get_offset_of_OriginalTokenType_6() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___OriginalTokenType_6)); } inline uint8_t get_OriginalTokenType_6() const { return ___OriginalTokenType_6; } inline uint8_t* get_address_of_OriginalTokenType_6() { return &___OriginalTokenType_6; } inline void set_OriginalTokenType_6(uint8_t value) { ___OriginalTokenType_6 = value; } inline static int32_t get_offset_of_ReturnValue_7() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___ReturnValue_7)); } inline RuntimeObject * get_ReturnValue_7() const { return ___ReturnValue_7; } inline RuntimeObject ** get_address_of_ReturnValue_7() { return &___ReturnValue_7; } inline void set_ReturnValue_7(RuntimeObject * value) { ___ReturnValue_7 = value; Il2CppCodeGenWriteBarrier((void**)(&___ReturnValue_7), (void*)value); } inline static int32_t get_offset_of_JsonClassInfo_8() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___JsonClassInfo_8)); } inline JsonClassInfo_tD68347CE667BE8A8421B64672918C17B63087226 * get_JsonClassInfo_8() const { return ___JsonClassInfo_8; } inline JsonClassInfo_tD68347CE667BE8A8421B64672918C17B63087226 ** get_address_of_JsonClassInfo_8() { return &___JsonClassInfo_8; } inline void set_JsonClassInfo_8(JsonClassInfo_tD68347CE667BE8A8421B64672918C17B63087226 * value) { ___JsonClassInfo_8 = value; Il2CppCodeGenWriteBarrier((void**)(&___JsonClassInfo_8), (void*)value); } inline static int32_t get_offset_of_ObjectState_9() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___ObjectState_9)); } inline uint8_t get_ObjectState_9() const { return ___ObjectState_9; } inline uint8_t* get_address_of_ObjectState_9() { return &___ObjectState_9; } inline void set_ObjectState_9(uint8_t value) { ___ObjectState_9 = value; } inline static int32_t get_offset_of_MetadataId_10() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___MetadataId_10)); } inline String_t* get_MetadataId_10() const { return ___MetadataId_10; } inline String_t** get_address_of_MetadataId_10() { return &___MetadataId_10; } inline void set_MetadataId_10(String_t* value) { ___MetadataId_10 = value; Il2CppCodeGenWriteBarrier((void**)(&___MetadataId_10), (void*)value); } inline static int32_t get_offset_of_PropertyIndex_11() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___PropertyIndex_11)); } inline int32_t get_PropertyIndex_11() const { return ___PropertyIndex_11; } inline int32_t* get_address_of_PropertyIndex_11() { return &___PropertyIndex_11; } inline void set_PropertyIndex_11(int32_t value) { ___PropertyIndex_11 = value; } inline static int32_t get_offset_of_PropertyRefCache_12() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___PropertyRefCache_12)); } inline List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 * get_PropertyRefCache_12() const { return ___PropertyRefCache_12; } inline List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 ** get_address_of_PropertyRefCache_12() { return &___PropertyRefCache_12; } inline void set_PropertyRefCache_12(List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 * value) { ___PropertyRefCache_12 = value; Il2CppCodeGenWriteBarrier((void**)(&___PropertyRefCache_12), (void*)value); } inline static int32_t get_offset_of_AddMethodDelegate_13() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___AddMethodDelegate_13)); } inline RuntimeObject * get_AddMethodDelegate_13() const { return ___AddMethodDelegate_13; } inline RuntimeObject ** get_address_of_AddMethodDelegate_13() { return &___AddMethodDelegate_13; } inline void set_AddMethodDelegate_13(RuntimeObject * value) { ___AddMethodDelegate_13 = value; Il2CppCodeGenWriteBarrier((void**)(&___AddMethodDelegate_13), (void*)value); } inline static int32_t get_offset_of_CtorArgumentStateIndex_14() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___CtorArgumentStateIndex_14)); } inline int32_t get_CtorArgumentStateIndex_14() const { return ___CtorArgumentStateIndex_14; } inline int32_t* get_address_of_CtorArgumentStateIndex_14() { return &___CtorArgumentStateIndex_14; } inline void set_CtorArgumentStateIndex_14(int32_t value) { ___CtorArgumentStateIndex_14 = value; } inline static int32_t get_offset_of_CtorArgumentState_15() { return static_cast<int32_t>(offsetof(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3, ___CtorArgumentState_15)); } inline ArgumentState_t12473DA2560B3F7D67458F48D08F0C78FBE42AC5 * get_CtorArgumentState_15() const { return ___CtorArgumentState_15; } inline ArgumentState_t12473DA2560B3F7D67458F48D08F0C78FBE42AC5 ** get_address_of_CtorArgumentState_15() { return &___CtorArgumentState_15; } inline void set_CtorArgumentState_15(ArgumentState_t12473DA2560B3F7D67458F48D08F0C78FBE42AC5 * value) { ___CtorArgumentState_15 = value; Il2CppCodeGenWriteBarrier((void**)(&___CtorArgumentState_15), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Text.Json.ReadStackFrame struct ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3_marshaled_pinvoke { JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * ___JsonPropertyInfo_0; uint8_t ___PropertyState_1; int32_t ___UseExtensionProperty_2; Il2CppSafeArray/*NONE*/* ___JsonPropertyName_3; char* ___JsonPropertyNameAsString_4; int32_t ___OriginalDepth_5; uint8_t ___OriginalTokenType_6; Il2CppIUnknown* ___ReturnValue_7; JsonClassInfo_tD68347CE667BE8A8421B64672918C17B63087226 * ___JsonClassInfo_8; uint8_t ___ObjectState_9; char* ___MetadataId_10; int32_t ___PropertyIndex_11; List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 * ___PropertyRefCache_12; Il2CppIUnknown* ___AddMethodDelegate_13; int32_t ___CtorArgumentStateIndex_14; ArgumentState_t12473DA2560B3F7D67458F48D08F0C78FBE42AC5 * ___CtorArgumentState_15; }; // Native definition for COM marshalling of System.Text.Json.ReadStackFrame struct ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3_marshaled_com { JsonPropertyInfo_tE0AB08AC3E012A61A1C683F4F64FA927F9B6465B * ___JsonPropertyInfo_0; uint8_t ___PropertyState_1; int32_t ___UseExtensionProperty_2; Il2CppSafeArray/*NONE*/* ___JsonPropertyName_3; Il2CppChar* ___JsonPropertyNameAsString_4; int32_t ___OriginalDepth_5; uint8_t ___OriginalTokenType_6; Il2CppIUnknown* ___ReturnValue_7; JsonClassInfo_tD68347CE667BE8A8421B64672918C17B63087226 * ___JsonClassInfo_8; uint8_t ___ObjectState_9; Il2CppChar* ___MetadataId_10; int32_t ___PropertyIndex_11; List_1_t9A5995EA5C036F8D411D4F04769DC9749A08D588 * ___PropertyRefCache_12; Il2CppIUnknown* ___AddMethodDelegate_13; int32_t ___CtorArgumentStateIndex_14; ArgumentState_t12473DA2560B3F7D67458F48D08F0C78FBE42AC5 * ___CtorArgumentState_15; }; // Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo struct SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7 { public: // System.String Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo::Name String_t* ___Name_1; // System.String Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo::Path String_t* ___Path_2; // System.Boolean Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo::Included bool ___Included_3; // System.Int32 Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo::BuildIndex int32_t ___BuildIndex_4; // System.String Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo::Tag String_t* ___Tag_5; // UnityEngine.Object Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo::Asset Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * ___Asset_6; public: inline static int32_t get_offset_of_Name_1() { return static_cast<int32_t>(offsetof(SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7, ___Name_1)); } inline String_t* get_Name_1() const { return ___Name_1; } inline String_t** get_address_of_Name_1() { return &___Name_1; } inline void set_Name_1(String_t* value) { ___Name_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___Name_1), (void*)value); } inline static int32_t get_offset_of_Path_2() { return static_cast<int32_t>(offsetof(SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7, ___Path_2)); } inline String_t* get_Path_2() const { return ___Path_2; } inline String_t** get_address_of_Path_2() { return &___Path_2; } inline void set_Path_2(String_t* value) { ___Path_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___Path_2), (void*)value); } inline static int32_t get_offset_of_Included_3() { return static_cast<int32_t>(offsetof(SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7, ___Included_3)); } inline bool get_Included_3() const { return ___Included_3; } inline bool* get_address_of_Included_3() { return &___Included_3; } inline void set_Included_3(bool value) { ___Included_3 = value; } inline static int32_t get_offset_of_BuildIndex_4() { return static_cast<int32_t>(offsetof(SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7, ___BuildIndex_4)); } inline int32_t get_BuildIndex_4() const { return ___BuildIndex_4; } inline int32_t* get_address_of_BuildIndex_4() { return &___BuildIndex_4; } inline void set_BuildIndex_4(int32_t value) { ___BuildIndex_4 = value; } inline static int32_t get_offset_of_Tag_5() { return static_cast<int32_t>(offsetof(SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7, ___Tag_5)); } inline String_t* get_Tag_5() const { return ___Tag_5; } inline String_t** get_address_of_Tag_5() { return &___Tag_5; } inline void set_Tag_5(String_t* value) { ___Tag_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___Tag_5), (void*)value); } inline static int32_t get_offset_of_Asset_6() { return static_cast<int32_t>(offsetof(SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7, ___Asset_6)); } inline Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * get_Asset_6() const { return ___Asset_6; } inline Object_tF2F3778131EFF286AF62B7B013A170F95A91571A ** get_address_of_Asset_6() { return &___Asset_6; } inline void set_Asset_6(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * value) { ___Asset_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___Asset_6), (void*)value); } }; struct SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7_StaticFields { public: // Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo::empty SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7 ___empty_0; public: inline static int32_t get_offset_of_empty_0() { return static_cast<int32_t>(offsetof(SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7_StaticFields, ___empty_0)); } inline SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7 get_empty_0() const { return ___empty_0; } inline SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7 * get_address_of_empty_0() { return &___empty_0; } inline void set_empty_0(SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7 value) { ___empty_0 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___empty_0))->___Name_1), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___empty_0))->___Path_2), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___empty_0))->___Tag_5), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___empty_0))->___Asset_6), (void*)NULL); #endif } }; // Native definition for P/Invoke marshalling of Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo struct SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7_marshaled_pinvoke { char* ___Name_1; char* ___Path_2; int32_t ___Included_3; int32_t ___BuildIndex_4; char* ___Tag_5; Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_marshaled_pinvoke ___Asset_6; }; // Native definition for COM marshalling of Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo struct SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7_marshaled_com { Il2CppChar* ___Name_1; Il2CppChar* ___Path_2; int32_t ___Included_3; int32_t ___BuildIndex_4; Il2CppChar* ___Tag_5; Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_marshaled_com* ___Asset_6; }; // Microsoft.MixedReality.Toolkit.UI.ShaderProperties struct ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB { public: // System.String Microsoft.MixedReality.Toolkit.UI.ShaderProperties::Name String_t* ___Name_0; // Microsoft.MixedReality.Toolkit.UI.ShaderPropertyType Microsoft.MixedReality.Toolkit.UI.ShaderProperties::Type int32_t ___Type_1; // UnityEngine.Vector2 Microsoft.MixedReality.Toolkit.UI.ShaderProperties::Range Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___Range_2; public: inline static int32_t get_offset_of_Name_0() { return static_cast<int32_t>(offsetof(ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB, ___Name_0)); } inline String_t* get_Name_0() const { return ___Name_0; } inline String_t** get_address_of_Name_0() { return &___Name_0; } inline void set_Name_0(String_t* value) { ___Name_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___Name_0), (void*)value); } inline static int32_t get_offset_of_Type_1() { return static_cast<int32_t>(offsetof(ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB, ___Type_1)); } inline int32_t get_Type_1() const { return ___Type_1; } inline int32_t* get_address_of_Type_1() { return &___Type_1; } inline void set_Type_1(int32_t value) { ___Type_1 = value; } inline static int32_t get_offset_of_Range_2() { return static_cast<int32_t>(offsetof(ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB, ___Range_2)); } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_Range_2() const { return ___Range_2; } inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_Range_2() { return &___Range_2; } inline void set_Range_2(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value) { ___Range_2 = value; } }; // Native definition for P/Invoke marshalling of Microsoft.MixedReality.Toolkit.UI.ShaderProperties struct ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB_marshaled_pinvoke { char* ___Name_0; int32_t ___Type_1; Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___Range_2; }; // Native definition for COM marshalling of Microsoft.MixedReality.Toolkit.UI.ShaderProperties struct ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB_marshaled_com { Il2CppChar* ___Name_0; int32_t ___Type_1; Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___Range_2; }; // UnityEngine.Rendering.SubMeshDescriptor struct SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81 { public: // UnityEngine.Bounds UnityEngine.Rendering.SubMeshDescriptor::<bounds>k__BackingField Bounds_t0F1F36D4F7AF49524B3C2A2259594412A3D3AE37 ___U3CboundsU3Ek__BackingField_0; // UnityEngine.MeshTopology UnityEngine.Rendering.SubMeshDescriptor::<topology>k__BackingField int32_t ___U3CtopologyU3Ek__BackingField_1; // System.Int32 UnityEngine.Rendering.SubMeshDescriptor::<indexStart>k__BackingField int32_t ___U3CindexStartU3Ek__BackingField_2; // System.Int32 UnityEngine.Rendering.SubMeshDescriptor::<indexCount>k__BackingField int32_t ___U3CindexCountU3Ek__BackingField_3; // System.Int32 UnityEngine.Rendering.SubMeshDescriptor::<baseVertex>k__BackingField int32_t ___U3CbaseVertexU3Ek__BackingField_4; // System.Int32 UnityEngine.Rendering.SubMeshDescriptor::<firstVertex>k__BackingField int32_t ___U3CfirstVertexU3Ek__BackingField_5; // System.Int32 UnityEngine.Rendering.SubMeshDescriptor::<vertexCount>k__BackingField int32_t ___U3CvertexCountU3Ek__BackingField_6; public: inline static int32_t get_offset_of_U3CboundsU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81, ___U3CboundsU3Ek__BackingField_0)); } inline Bounds_t0F1F36D4F7AF49524B3C2A2259594412A3D3AE37 get_U3CboundsU3Ek__BackingField_0() const { return ___U3CboundsU3Ek__BackingField_0; } inline Bounds_t0F1F36D4F7AF49524B3C2A2259594412A3D3AE37 * get_address_of_U3CboundsU3Ek__BackingField_0() { return &___U3CboundsU3Ek__BackingField_0; } inline void set_U3CboundsU3Ek__BackingField_0(Bounds_t0F1F36D4F7AF49524B3C2A2259594412A3D3AE37 value) { ___U3CboundsU3Ek__BackingField_0 = value; } inline static int32_t get_offset_of_U3CtopologyU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81, ___U3CtopologyU3Ek__BackingField_1)); } inline int32_t get_U3CtopologyU3Ek__BackingField_1() const { return ___U3CtopologyU3Ek__BackingField_1; } inline int32_t* get_address_of_U3CtopologyU3Ek__BackingField_1() { return &___U3CtopologyU3Ek__BackingField_1; } inline void set_U3CtopologyU3Ek__BackingField_1(int32_t value) { ___U3CtopologyU3Ek__BackingField_1 = value; } inline static int32_t get_offset_of_U3CindexStartU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81, ___U3CindexStartU3Ek__BackingField_2)); } inline int32_t get_U3CindexStartU3Ek__BackingField_2() const { return ___U3CindexStartU3Ek__BackingField_2; } inline int32_t* get_address_of_U3CindexStartU3Ek__BackingField_2() { return &___U3CindexStartU3Ek__BackingField_2; } inline void set_U3CindexStartU3Ek__BackingField_2(int32_t value) { ___U3CindexStartU3Ek__BackingField_2 = value; } inline static int32_t get_offset_of_U3CindexCountU3Ek__BackingField_3() { return static_cast<int32_t>(offsetof(SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81, ___U3CindexCountU3Ek__BackingField_3)); } inline int32_t get_U3CindexCountU3Ek__BackingField_3() const { return ___U3CindexCountU3Ek__BackingField_3; } inline int32_t* get_address_of_U3CindexCountU3Ek__BackingField_3() { return &___U3CindexCountU3Ek__BackingField_3; } inline void set_U3CindexCountU3Ek__BackingField_3(int32_t value) { ___U3CindexCountU3Ek__BackingField_3 = value; } inline static int32_t get_offset_of_U3CbaseVertexU3Ek__BackingField_4() { return static_cast<int32_t>(offsetof(SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81, ___U3CbaseVertexU3Ek__BackingField_4)); } inline int32_t get_U3CbaseVertexU3Ek__BackingField_4() const { return ___U3CbaseVertexU3Ek__BackingField_4; } inline int32_t* get_address_of_U3CbaseVertexU3Ek__BackingField_4() { return &___U3CbaseVertexU3Ek__BackingField_4; } inline void set_U3CbaseVertexU3Ek__BackingField_4(int32_t value) { ___U3CbaseVertexU3Ek__BackingField_4 = value; } inline static int32_t get_offset_of_U3CfirstVertexU3Ek__BackingField_5() { return static_cast<int32_t>(offsetof(SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81, ___U3CfirstVertexU3Ek__BackingField_5)); } inline int32_t get_U3CfirstVertexU3Ek__BackingField_5() const { return ___U3CfirstVertexU3Ek__BackingField_5; } inline int32_t* get_address_of_U3CfirstVertexU3Ek__BackingField_5() { return &___U3CfirstVertexU3Ek__BackingField_5; } inline void set_U3CfirstVertexU3Ek__BackingField_5(int32_t value) { ___U3CfirstVertexU3Ek__BackingField_5 = value; } inline static int32_t get_offset_of_U3CvertexCountU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81, ___U3CvertexCountU3Ek__BackingField_6)); } inline int32_t get_U3CvertexCountU3Ek__BackingField_6() const { return ___U3CvertexCountU3Ek__BackingField_6; } inline int32_t* get_address_of_U3CvertexCountU3Ek__BackingField_6() { return &___U3CvertexCountU3Ek__BackingField_6; } inline void set_U3CvertexCountU3Ek__BackingField_6(int32_t value) { ___U3CvertexCountU3Ek__BackingField_6 = value; } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction> struct Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t07AA017BC5D27C28FE12A525E226CFD4CD3C444A * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B, ___list_0)); } inline List_1_t07AA017BC5D27C28FE12A525E226CFD4CD3C444A * get_list_0() const { return ___list_0; } inline List_1_t07AA017BC5D27C28FE12A525E226CFD4CD3C444A ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t07AA017BC5D27C28FE12A525E226CFD4CD3C444A * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B, ___current_3)); } inline MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690 get_current_3() const { return ___current_3; } inline MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(MixedRealityInputAction_tF7F97EE20DEA505B55C4ACFDAE9DB4E9C27D2690 value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___description_2), (void*)NULL); } }; // Unity.Collections.NativeArray`1/Enumerator<Microsoft.MixedReality.OpenXR.NativeAnchor> struct Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F { public: // Unity.Collections.NativeArray`1<T> Unity.Collections.NativeArray`1/Enumerator::m_Array NativeArray_1_t948198436047057F87875A4F287B323C232637CA ___m_Array_0; // System.Int32 Unity.Collections.NativeArray`1/Enumerator::m_Index int32_t ___m_Index_1; public: inline static int32_t get_offset_of_m_Array_0() { return static_cast<int32_t>(offsetof(Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F, ___m_Array_0)); } inline NativeArray_1_t948198436047057F87875A4F287B323C232637CA get_m_Array_0() const { return ___m_Array_0; } inline NativeArray_1_t948198436047057F87875A4F287B323C232637CA * get_address_of_m_Array_0() { return &___m_Array_0; } inline void set_m_Array_0(NativeArray_1_t948198436047057F87875A4F287B323C232637CA value) { ___m_Array_0 = value; } inline static int32_t get_offset_of_m_Index_1() { return static_cast<int32_t>(offsetof(Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F, ___m_Index_1)); } inline int32_t get_m_Index_1() const { return ___m_Index_1; } inline int32_t* get_address_of_m_Index_1() { return &___m_Index_1; } inline void set_m_Index_1(int32_t value) { ___m_Index_1 = value; } }; // Unity.Collections.NativeArray`1/Enumerator<Microsoft.MixedReality.OpenXR.NativePlane> struct Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21 { public: // Unity.Collections.NativeArray`1<T> Unity.Collections.NativeArray`1/Enumerator::m_Array NativeArray_1_tC70438C331D38EC8A19E41A28C518870C59FDEA9 ___m_Array_0; // System.Int32 Unity.Collections.NativeArray`1/Enumerator::m_Index int32_t ___m_Index_1; public: inline static int32_t get_offset_of_m_Array_0() { return static_cast<int32_t>(offsetof(Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21, ___m_Array_0)); } inline NativeArray_1_tC70438C331D38EC8A19E41A28C518870C59FDEA9 get_m_Array_0() const { return ___m_Array_0; } inline NativeArray_1_tC70438C331D38EC8A19E41A28C518870C59FDEA9 * get_address_of_m_Array_0() { return &___m_Array_0; } inline void set_m_Array_0(NativeArray_1_tC70438C331D38EC8A19E41A28C518870C59FDEA9 value) { ___m_Array_0 = value; } inline static int32_t get_offset_of_m_Index_1() { return static_cast<int32_t>(offsetof(Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21, ___m_Index_1)); } inline int32_t get_m_Index_1() const { return ___m_Index_1; } inline int32_t* get_address_of_m_Index_1() { return &___m_Index_1; } inline void set_m_Index_1(int32_t value) { ___m_Index_1 = value; } }; // Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Plane> struct Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD { public: // Unity.Collections.NativeArray`1<T> Unity.Collections.NativeArray`1/Enumerator::m_Array NativeArray_1_t527C586787ACD1AD75E3C78BFB024FFA9925662E ___m_Array_0; // System.Int32 Unity.Collections.NativeArray`1/Enumerator::m_Index int32_t ___m_Index_1; public: inline static int32_t get_offset_of_m_Array_0() { return static_cast<int32_t>(offsetof(Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD, ___m_Array_0)); } inline NativeArray_1_t527C586787ACD1AD75E3C78BFB024FFA9925662E get_m_Array_0() const { return ___m_Array_0; } inline NativeArray_1_t527C586787ACD1AD75E3C78BFB024FFA9925662E * get_address_of_m_Array_0() { return &___m_Array_0; } inline void set_m_Array_0(NativeArray_1_t527C586787ACD1AD75E3C78BFB024FFA9925662E value) { ___m_Array_0 = value; } inline static int32_t get_offset_of_m_Index_1() { return static_cast<int32_t>(offsetof(Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD, ___m_Index_1)); } inline int32_t get_m_Index_1() const { return ___m_Index_1; } inline int32_t* get_address_of_m_Index_1() { return &___m_Index_1; } inline void set_m_Index_1(int32_t value) { ___m_Index_1 = value; } }; // System.Collections.Generic.List`1/Enumerator<System.Text.Json.ReadStackFrame> struct Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t814EF893AA45ADB5DD8897F915DAADC58EBB5CDD * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99, ___list_0)); } inline List_1_t814EF893AA45ADB5DD8897F915DAADC58EBB5CDD * get_list_0() const { return ___list_0; } inline List_1_t814EF893AA45ADB5DD8897F915DAADC58EBB5CDD ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t814EF893AA45ADB5DD8897F915DAADC58EBB5CDD * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99, ___current_3)); } inline ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3 get_current_3() const { return ___current_3; } inline ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(ReadStackFrame_t5DD00C0EABFD9B456A0F6715A6B448FE3A5936B3 value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___JsonPropertyInfo_0), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___JsonPropertyName_3), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___JsonPropertyNameAsString_4), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___ReturnValue_7), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___JsonClassInfo_8), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___MetadataId_10), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___PropertyRefCache_12), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___AddMethodDelegate_13), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___CtorArgumentState_15), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo> struct Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t200C70CE862FA6E0DBEFF218216B9F2457FF8AA7 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2, ___list_0)); } inline List_1_t200C70CE862FA6E0DBEFF218216B9F2457FF8AA7 * get_list_0() const { return ___list_0; } inline List_1_t200C70CE862FA6E0DBEFF218216B9F2457FF8AA7 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t200C70CE862FA6E0DBEFF218216B9F2457FF8AA7 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2, ___current_3)); } inline SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7 get_current_3() const { return ___current_3; } inline SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(SceneInfo_tDCFB3E6A0D58296674F0D5769C45BF3D2DDFEFB7 value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___Name_1), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___Path_2), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___Tag_5), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___Asset_6), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.UI.ShaderProperties> struct Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tE24CFD96194A4B94700B89080849B94C2BD4A200 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815, ___list_0)); } inline List_1_tE24CFD96194A4B94700B89080849B94C2BD4A200 * get_list_0() const { return ___list_0; } inline List_1_tE24CFD96194A4B94700B89080849B94C2BD4A200 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tE24CFD96194A4B94700B89080849B94C2BD4A200 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815, ___current_3)); } inline ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB get_current_3() const { return ___current_3; } inline ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB * get_address_of_current_3() { return &___current_3; } inline void set_current_3(ShaderProperties_tD6814D4A4774AAABFAAB773639D96C50A38CB3DB value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___Name_0), (void*)NULL); } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.Rendering.SubMeshDescriptor> struct Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t91F626A5901913D170F5E6735038E9D7A51C33E9 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E, ___list_0)); } inline List_1_t91F626A5901913D170F5E6735038E9D7A51C33E9 * get_list_0() const { return ___list_0; } inline List_1_t91F626A5901913D170F5E6735038E9D7A51C33E9 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t91F626A5901913D170F5E6735038E9D7A51C33E9 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E, ___current_3)); } inline SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81 get_current_3() const { return ___current_3; } inline SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(SubMeshDescriptor_t676438BEFC295AA3D3EF4FA7F1418ED5661ABD81 value) { ___current_3 = value; } }; // Microsoft.Extensions.Logging.MessageLogger struct MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC { public: // Microsoft.Extensions.Logging.ILogger Microsoft.Extensions.Logging.MessageLogger::<Logger>k__BackingField RuntimeObject* ___U3CLoggerU3Ek__BackingField_0; // System.String Microsoft.Extensions.Logging.MessageLogger::<Category>k__BackingField String_t* ___U3CCategoryU3Ek__BackingField_1; // System.String Microsoft.Extensions.Logging.MessageLogger::<ProviderTypeFullName>k__BackingField String_t* ___U3CProviderTypeFullNameU3Ek__BackingField_2; // System.Nullable`1<Microsoft.Extensions.Logging.LogLevel> Microsoft.Extensions.Logging.MessageLogger::<MinLevel>k__BackingField Nullable_1_t94E89836758003D6AFF051A2A2119DB25B1ABC24 ___U3CMinLevelU3Ek__BackingField_3; // System.Func`4<System.String,System.String,Microsoft.Extensions.Logging.LogLevel,System.Boolean> Microsoft.Extensions.Logging.MessageLogger::<Filter>k__BackingField Func_4_t56452C46E14D791233E4D4725185281A89F20BC8 * ___U3CFilterU3Ek__BackingField_4; public: inline static int32_t get_offset_of_U3CLoggerU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC, ___U3CLoggerU3Ek__BackingField_0)); } inline RuntimeObject* get_U3CLoggerU3Ek__BackingField_0() const { return ___U3CLoggerU3Ek__BackingField_0; } inline RuntimeObject** get_address_of_U3CLoggerU3Ek__BackingField_0() { return &___U3CLoggerU3Ek__BackingField_0; } inline void set_U3CLoggerU3Ek__BackingField_0(RuntimeObject* value) { ___U3CLoggerU3Ek__BackingField_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CLoggerU3Ek__BackingField_0), (void*)value); } inline static int32_t get_offset_of_U3CCategoryU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC, ___U3CCategoryU3Ek__BackingField_1)); } inline String_t* get_U3CCategoryU3Ek__BackingField_1() const { return ___U3CCategoryU3Ek__BackingField_1; } inline String_t** get_address_of_U3CCategoryU3Ek__BackingField_1() { return &___U3CCategoryU3Ek__BackingField_1; } inline void set_U3CCategoryU3Ek__BackingField_1(String_t* value) { ___U3CCategoryU3Ek__BackingField_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CCategoryU3Ek__BackingField_1), (void*)value); } inline static int32_t get_offset_of_U3CProviderTypeFullNameU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC, ___U3CProviderTypeFullNameU3Ek__BackingField_2)); } inline String_t* get_U3CProviderTypeFullNameU3Ek__BackingField_2() const { return ___U3CProviderTypeFullNameU3Ek__BackingField_2; } inline String_t** get_address_of_U3CProviderTypeFullNameU3Ek__BackingField_2() { return &___U3CProviderTypeFullNameU3Ek__BackingField_2; } inline void set_U3CProviderTypeFullNameU3Ek__BackingField_2(String_t* value) { ___U3CProviderTypeFullNameU3Ek__BackingField_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CProviderTypeFullNameU3Ek__BackingField_2), (void*)value); } inline static int32_t get_offset_of_U3CMinLevelU3Ek__BackingField_3() { return static_cast<int32_t>(offsetof(MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC, ___U3CMinLevelU3Ek__BackingField_3)); } inline Nullable_1_t94E89836758003D6AFF051A2A2119DB25B1ABC24 get_U3CMinLevelU3Ek__BackingField_3() const { return ___U3CMinLevelU3Ek__BackingField_3; } inline Nullable_1_t94E89836758003D6AFF051A2A2119DB25B1ABC24 * get_address_of_U3CMinLevelU3Ek__BackingField_3() { return &___U3CMinLevelU3Ek__BackingField_3; } inline void set_U3CMinLevelU3Ek__BackingField_3(Nullable_1_t94E89836758003D6AFF051A2A2119DB25B1ABC24 value) { ___U3CMinLevelU3Ek__BackingField_3 = value; } inline static int32_t get_offset_of_U3CFilterU3Ek__BackingField_4() { return static_cast<int32_t>(offsetof(MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC, ___U3CFilterU3Ek__BackingField_4)); } inline Func_4_t56452C46E14D791233E4D4725185281A89F20BC8 * get_U3CFilterU3Ek__BackingField_4() const { return ___U3CFilterU3Ek__BackingField_4; } inline Func_4_t56452C46E14D791233E4D4725185281A89F20BC8 ** get_address_of_U3CFilterU3Ek__BackingField_4() { return &___U3CFilterU3Ek__BackingField_4; } inline void set_U3CFilterU3Ek__BackingField_4(Func_4_t56452C46E14D791233E4D4725185281A89F20BC8 * value) { ___U3CFilterU3Ek__BackingField_4 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CFilterU3Ek__BackingField_4), (void*)value); } }; // Native definition for P/Invoke marshalling of Microsoft.Extensions.Logging.MessageLogger struct MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC_marshaled_pinvoke { RuntimeObject* ___U3CLoggerU3Ek__BackingField_0; char* ___U3CCategoryU3Ek__BackingField_1; char* ___U3CProviderTypeFullNameU3Ek__BackingField_2; Nullable_1_t94E89836758003D6AFF051A2A2119DB25B1ABC24 ___U3CMinLevelU3Ek__BackingField_3; Il2CppMethodPointer ___U3CFilterU3Ek__BackingField_4; }; // Native definition for COM marshalling of Microsoft.Extensions.Logging.MessageLogger struct MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC_marshaled_com { RuntimeObject* ___U3CLoggerU3Ek__BackingField_0; Il2CppChar* ___U3CCategoryU3Ek__BackingField_1; Il2CppChar* ___U3CProviderTypeFullNameU3Ek__BackingField_2; Nullable_1_t94E89836758003D6AFF051A2A2119DB25B1ABC24 ___U3CMinLevelU3Ek__BackingField_3; Il2CppMethodPointer ___U3CFilterU3Ek__BackingField_4; }; // UnityEngine.InputSystem.Utilities.NamedValue struct NamedValue_t0779F5798D434A96A43265D15168F9B9F4E5D489 { public: // System.String UnityEngine.InputSystem.Utilities.NamedValue::<name>k__BackingField String_t* ___U3CnameU3Ek__BackingField_1; // UnityEngine.InputSystem.Utilities.PrimitiveValue UnityEngine.InputSystem.Utilities.NamedValue::<value>k__BackingField PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8 ___U3CvalueU3Ek__BackingField_2; public: inline static int32_t get_offset_of_U3CnameU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(NamedValue_t0779F5798D434A96A43265D15168F9B9F4E5D489, ___U3CnameU3Ek__BackingField_1)); } inline String_t* get_U3CnameU3Ek__BackingField_1() const { return ___U3CnameU3Ek__BackingField_1; } inline String_t** get_address_of_U3CnameU3Ek__BackingField_1() { return &___U3CnameU3Ek__BackingField_1; } inline void set_U3CnameU3Ek__BackingField_1(String_t* value) { ___U3CnameU3Ek__BackingField_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CnameU3Ek__BackingField_1), (void*)value); } inline static int32_t get_offset_of_U3CvalueU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(NamedValue_t0779F5798D434A96A43265D15168F9B9F4E5D489, ___U3CvalueU3Ek__BackingField_2)); } inline PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8 get_U3CvalueU3Ek__BackingField_2() const { return ___U3CvalueU3Ek__BackingField_2; } inline PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8 * get_address_of_U3CvalueU3Ek__BackingField_2() { return &___U3CvalueU3Ek__BackingField_2; } inline void set_U3CvalueU3Ek__BackingField_2(PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8 value) { ___U3CvalueU3Ek__BackingField_2 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.InputSystem.Utilities.NamedValue struct NamedValue_t0779F5798D434A96A43265D15168F9B9F4E5D489_marshaled_pinvoke { char* ___U3CnameU3Ek__BackingField_1; PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8_marshaled_pinvoke ___U3CvalueU3Ek__BackingField_2; }; // Native definition for COM marshalling of UnityEngine.InputSystem.Utilities.NamedValue struct NamedValue_t0779F5798D434A96A43265D15168F9B9F4E5D489_marshaled_com { Il2CppChar* ___U3CnameU3Ek__BackingField_1; PrimitiveValue_tB787C76E9A37444599C45519DD7E4D3A1D4730C8_marshaled_com ___U3CvalueU3Ek__BackingField_2; }; // System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.Logging.MessageLogger> struct Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_tE47E9256D6281C56D1EC2AFBCEFA509D1CCB5A5B * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8, ___list_0)); } inline List_1_tE47E9256D6281C56D1EC2AFBCEFA509D1CCB5A5B * get_list_0() const { return ___list_0; } inline List_1_tE47E9256D6281C56D1EC2AFBCEFA509D1CCB5A5B ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_tE47E9256D6281C56D1EC2AFBCEFA509D1CCB5A5B * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8, ___current_3)); } inline MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC get_current_3() const { return ___current_3; } inline MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC * get_address_of_current_3() { return &___current_3; } inline void set_current_3(MessageLogger_tB83D7FF82E79D872E46A0BBF2045BAE6AD5D62CC value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___U3CLoggerU3Ek__BackingField_0), (void*)NULL); #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___U3CCategoryU3Ek__BackingField_1), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___U3CProviderTypeFullNameU3Ek__BackingField_2), (void*)NULL); #endif #if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___U3CFilterU3Ek__BackingField_4), (void*)NULL); #endif } }; // System.Collections.Generic.List`1/Enumerator<UnityEngine.InputSystem.Utilities.NamedValue> struct Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::list List_1_t12D38EC9E753EE3B986D36479D7983E0A28E26D8 * ___list_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::index int32_t ___index_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::version int32_t ___version_2; // T System.Collections.Generic.List`1/Enumerator::current NamedValue_t0779F5798D434A96A43265D15168F9B9F4E5D489 ___current_3; public: inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297, ___list_0)); } inline List_1_t12D38EC9E753EE3B986D36479D7983E0A28E26D8 * get_list_0() const { return ___list_0; } inline List_1_t12D38EC9E753EE3B986D36479D7983E0A28E26D8 ** get_address_of_list_0() { return &___list_0; } inline void set_list_0(List_1_t12D38EC9E753EE3B986D36479D7983E0A28E26D8 * value) { ___list_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___list_0), (void*)value); } inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297, ___index_1)); } inline int32_t get_index_1() const { return ___index_1; } inline int32_t* get_address_of_index_1() { return &___index_1; } inline void set_index_1(int32_t value) { ___index_1 = value; } inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297, ___version_2)); } inline int32_t get_version_2() const { return ___version_2; } inline int32_t* get_address_of_version_2() { return &___version_2; } inline void set_version_2(int32_t value) { ___version_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297, ___current_3)); } inline NamedValue_t0779F5798D434A96A43265D15168F9B9F4E5D489 get_current_3() const { return ___current_3; } inline NamedValue_t0779F5798D434A96A43265D15168F9B9F4E5D489 * get_address_of_current_3() { return &___current_3; } inline void set_current_3(NamedValue_t0779F5798D434A96A43265D15168F9B9F4E5D489 value) { ___current_3 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___U3CnameU3Ek__BackingField_1), (void*)NULL); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif il2cpp_hresult_t IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(RuntimeObject* __this); // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.MeshRenderer> struct Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t05969C2FA6EF4ED5DC34C555196FC5B00A6F391D_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.Logging.MessageLogger> struct Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t3132C64D16EA0094C38BDD99008F7795D1A014E8_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Reflection.MethodBase> struct Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tF70FD34B02F5124A7E22F832FD7DF2596A5F85D0_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Reflection.MethodInfo> struct Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t479E162619A8389640AAD50389C909E43CFD1F2F_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Input.MixedRealityInputAction> struct Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t10C965B553ACE6C2F8218F0D67AD420F8526CF2B_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.MixedRealityToolkit> struct Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t7BF35EA09AA7DCEC38A399B22B698C353DB8C76D_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.Maps.Unity.ModelTileLayer> struct Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t0530F3064655CD6FE81698307AA1E09D252B563A_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.ModifierSpec> struct Enumerator_t57DFAB26A5F13837E75358368035928D516359B7_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t57DFAB26A5F13837E75358368035928D516359B7_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t57DFAB26A5F13837E75358368035928D516359B7_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t57DFAB26A5F13837E75358368035928D516359B7_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t57DFAB26A5F13837E75358368035928D516359B7(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t57DFAB26A5F13837E75358368035928D516359B7_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t57DFAB26A5F13837E75358368035928D516359B7_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Reflection.Module> struct Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tDB36176992DD28F86BE9A3FB524FF1B38F3A5050_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.InputSystem.Utilities.NameAndParameters> struct Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tBBF3EE36FE062418B2C28A153D6AE39E897C5760_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.NameValueHeaderValue> struct Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t5E3EDEF54C69967080F563363AECBFB58B46A4E7_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.NameValueWithParametersHeaderValue> struct Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t874B2B93E8B4BE3900F122D325FF1F175D4074BB_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.InputSystem.Utilities.NamedValue> struct Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t54CE6166AF22A69F25FB46A8A1AFA2E56393A297_ComCallableWrapper(obj)); } // COM Callable Wrapper for Unity.Collections.NativeArray`1/Enumerator<Microsoft.MixedReality.OpenXR.NativeAnchor> struct Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t8AFAE1F3064234FAAE5D7F9D0CCFE4608BDF778F_ComCallableWrapper(obj)); } // COM Callable Wrapper for Unity.Collections.NativeArray`1/Enumerator<Microsoft.MixedReality.OpenXR.NativePlane> struct Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tE9BE824A7A849D5DBB8936C3B770EE99DFF66F21_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Input.NearInteractionTouchableUnityUI> struct Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tD0AE8289ADE80FCE228BBFC4E7DB7C41B75D1B87_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.HashSet`1/Enumerator<System.Object> struct Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t2430E2854B4328060EB6096AD1E4851E8DC45C3A_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Object> struct Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tB6009981BD4E3881E3EC83627255A24198F902D6_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.Stack`1/Enumerator<System.Object> struct Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tF6E3A9686966EF18B6DFA3748229B35E666CE514_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.HashSet`1/Enumerator<UnityEngine.Object> struct Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t14A4FB3BB8B09A964D562C321C53A3C28ED3832E_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Utilities.ObjectCollectionNode> struct Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t6EF306E6833850EED779ECB65459E57A21CEA76F_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.ResourceManagement.Util.ObjectInitializationData> struct Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t631D34D37E151E7B87BE720CBDE06AE9E9C7817A_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.XR.OpenXR.Features.OpenXRFeature> struct Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t8945B4169A5E3ACE16EA5D0C22176FFA542D428C_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.HashSet`1/Enumerator<System.Linq.Expressions.ParameterExpression> struct Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t2C2CEC9571E069DBD808144CF2CE46A26236FC9F_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Linq.Expressions.ParameterExpression> struct Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tF23DB2BD335CB863D2BF1222C1EC45E85E483315_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.Stack`1/Enumerator<System.Linq.Expressions.ParameterExpression> struct Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t10827A3A69AB80B281FFD250E2882F51969360A2_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Reflection.ParameterInfo> struct Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t1F03E72B3C58BC2B4023F0D0D94A25F52D4CBC5B_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Text.Json.ParameterRef> struct Enumerator_t19BED566B36736755CD9571FCD126DE30F299754_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t19BED566B36736755CD9571FCD126DE30F299754_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t19BED566B36736755CD9571FCD126DE30F299754_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t19BED566B36736755CD9571FCD126DE30F299754_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t19BED566B36736755CD9571FCD126DE30F299754(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t19BED566B36736755CD9571FCD126DE30F299754_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t19BED566B36736755CD9571FCD126DE30F299754_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Linq.JsonPath.PathFilter> struct Enumerator_tC6B320324247259556EC345BE12B28C551102BB1_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tC6B320324247259556EC345BE12B28C551102BB1_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tC6B320324247259556EC345BE12B28C551102BB1_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tC6B320324247259556EC345BE12B28C551102BB1_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tC6B320324247259556EC345BE12B28C551102BB1(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tC6B320324247259556EC345BE12B28C551102BB1_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tC6B320324247259556EC345BE12B28C551102BB1_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.Events.PersistentCall> struct Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t5677681B46B0D8461F5FAF27B1AF4AAB1F4EC9C9_ComCallableWrapper(obj)); } // COM Callable Wrapper for Unity.Collections.NativeArray`1/Enumerator<UnityEngine.Plane> struct Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tB4E0B1C6CFE4B8CF1DB4E5EBC03CC5EF4DD906AD_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.ProductHeaderValue> struct Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t8E77135C17000322A6974F41C95BBD7CA9634BE1_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.ProductInfoHeaderValue> struct Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tF8D2BE90172C1CC456156B25E5992695E49D8360_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Diagnostics.Tracing.PropertyAnalysis> struct Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t6076A6AE25BFB4D4EB791E81C9CB9750187C3088_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Reflection.PropertyInfo> struct Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t289FE346CE546B6FBC49C855C339DE78D9876BAA_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Text.Json.PropertyRef> struct Enumerator_t547DA271F10673317FFB796780E06232D5713341_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t547DA271F10673317FFB796780E06232D5713341_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t547DA271F10673317FFB796780E06232D5713341_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t547DA271F10673317FFB796780E06232D5713341_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t547DA271F10673317FFB796780E06232D5713341(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t547DA271F10673317FFB796780E06232D5713341_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t547DA271F10673317FFB796780E06232D5713341_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Utilities.ProximityLight> struct Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tBA7BD3893CA66B688F5C10D62156BB4AB4D01856_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Linq.JsonPath.QueryExpression> struct Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tDCBB25C528E6A783F635AD7C403FB80F8A29BE16_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.RangeItemHeaderValue> struct Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tD4AE5B2AD613B8B85BF7CD4F9329DF58A41535B2_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Xml.Schema.RangePositionInfo> struct Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tCA6C568460315219AF21DD035A7E50E9EE2ED8F1_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.Ray> struct Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t559B6D6D3113FF8834FF99E540A765371AFFE657_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.RaycastHit2D> struct Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tD10587C18BD28BBFAE424E87042045A702B5B163_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.EventSystems.RaycastResult> struct Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t485F49ED036E6B3589D90FC60EE9E7B5BB479121_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Text.Json.ReadStackFrame> struct Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tF7A9662765C6263FC15CD4323336C4EEF58C5D99_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.Rect> struct Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t7D5C86A49956EEC5B26302673C3F13485E02C43C_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.UI.RectMask2D> struct Enumerator_t68772D98408D302178181766E34604592D707472_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t68772D98408D302178181766E34604592D707472_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t68772D98408D302178181766E34604592D707472_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t68772D98408D302178181766E34604592D707472_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t68772D98408D302178181766E34604592D707472(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t68772D98408D302178181766E34604592D707472_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t68772D98408D302178181766E34604592D707472_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.RectTransform> struct Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t4CC8DAA796A06AD92BB0BFC7E5BB17E003EC9CF6_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Utilities.ReflectionObject> struct Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t4AD37CA09AC9CB5B7623E73982D570B37D8ACB60_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Text.RegularExpressions.RegexNode> struct Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t9CCB73A9DA013351C77B368588B93566F28D8E7C_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Text.RegularExpressions.RegexOptions> struct Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tBA6BAF50CBBC1DCE06F00F0F2C4738D32D1256DA_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.HashSet`1/Enumerator<UnityEngine.Renderer> struct Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t0267F8DB9F9DACC16C4FD84350995AF533C89DE3_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.Renderer> struct Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tCE118F2B842C1E8EE20DD0C1365C163899F59E72_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.AddressableAssets.ResourceLocators.ResourceLocationData> struct Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t2CDBD36690A32B487441AD11B48F8A32BA52C08D_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.Rigidbody2D> struct Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t2BE1C49D9C4AA64690B90C40A6696F8C8C85CF9F_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.RuntimeType> struct Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tCED0D3FD7BE9CC3BFEB2FD4B19259E5AD7594D42_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.SByte> struct Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tAAC5925CD0D89670C1B7AAF369FEB2C6F9945ADD_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.SceneManagement.Scene> struct Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tF3170CD4641424EB96F89EFC159EA9CC33212551_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.SceneSystem.SceneInfo> struct Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t6EC953625FD8F7AF3B889AF0987E5D87D33E48F2_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.Logging.ScopeLogger> struct Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t4E909A84670FA1A09D82944EC366D4619BCCC081_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.UI.Selectable> struct Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tFE83EFB05C273560F442A7111AA79CB3C912B349_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Serialization.SerializationCallback> struct Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tEED6B0DF319F6D5201E194A3F050DAAAB976B52E_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Newtonsoft.Json.Serialization.SerializationErrorCallback> struct Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t0F2E1CE0D0CC87BA38016532D9DA85CEE1328528_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Runtime.Serialization.SerializationFieldInfo> struct Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tEA6FE2BE02EC7712729DF56DDA7E057C7B63AF50_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCacheKey> struct Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t1B9D2AE78D4BBEAEEC58346B7D8BB7F9BFB13DE8_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.HashSet`1/Enumerator<Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite> struct Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t065934F1AE48415840408D8C0C91BB92E2B6B35E_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite> struct Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tF4342E85D2C732D2506868BD21EEE784AC190820_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.Extensions.DependencyInjection.ServiceDescriptor> struct Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t9C3AC8D3823CF98D2CD193E10BA2DEB72581A9FF_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Utilities.Facades.ServiceFacade> struct Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tA7B205644CD73C6C30C102CCD2DA5EB9A28DF6A3_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.UI.ShaderProperties> struct Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t42FAEE9CFB05F0C5FEE5E4B37BF999C0A2B55815_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Single> struct Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tC1FD01C8BB5327D442D71FD022B4338ACD701783_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.Utilities.Solvers.Solver> struct Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tFA9F8DEE9537CFB2698FF1DEFBACAAF6A9D475FE_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessPlanarObject> struct Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t24C7751772047716E6CDCE7EA8956518FDD349FA_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.Sprite> struct Enumerator_tAF21232E555CF5021E1A738792635D00943518BE_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tAF21232E555CF5021E1A738792635D00943518BE_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tAF21232E555CF5021E1A738792635D00943518BE_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tAF21232E555CF5021E1A738792635D00943518BE_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tAF21232E555CF5021E1A738792635D00943518BE(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tAF21232E555CF5021E1A738792635D00943518BE_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tAF21232E555CF5021E1A738792635D00943518BE_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Diagnostics.StackFrame> struct Enumerator_t4681FB486D573990C716F84603F54B87801CBB09_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t4681FB486D573990C716F84603F54B87801CBB09_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t4681FB486D573990C716F84603F54B87801CBB09_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t4681FB486D573990C716F84603F54B87801CBB09_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t4681FB486D573990C716F84603F54B87801CBB09(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t4681FB486D573990C716F84603F54B87801CBB09_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t4681FB486D573990C716F84603F54B87801CBB09_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.Toolkit.UI.State> struct Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t8E210B77F4D08C75017323F215FE992DE0913C5F_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.HashSet`1/Enumerator<System.String> struct Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t06E200F1C75B09C9CF29C6E71ED179BE702A5FF9_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.String> struct Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tCDCE241581BD00D8EDB03C9DC4133A65ADABF67B_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.Queue`1/Enumerator<System.String> struct Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t0DF0FF93D8D90DD7115644D15EE434F751A07601_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<System.Net.Http.Headers.StringWithQualityHeaderValue> struct Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tF8287D106CD977CE1BC331495B83C6865E549640_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.Rendering.SubMeshDescriptor> struct Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tB98FB1ED592D063A5AE525C94A4EBD3FBB5EEE7E_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.InputSystem.Utilities.Substring> struct Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t46DB2F0C02790F0AC2B678AB969D3EB20EBC7E95_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.Subsystem> struct Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tC5AC2334AE85534553205DC297307A64A7D8F360_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<Microsoft.MixedReality.OpenXR.SubsystemController> struct Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t2658AB86FE9D7E22D46C539B8DBA9E56D1AE452D_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.SubsystemDescriptor> struct Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tB4E862B6274B38C2ED9E89BD170A583913DB5405_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.SubsystemsImplementation.SubsystemDescriptorWithProvider> struct Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t0D0639B966DFD44888571D56F04CE4A50FD0EDF0_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<UnityEngine.SubsystemsImplementation.SubsystemWithProvider> struct Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t019989D57D9D016D96679D1838F0D0C84367523E_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<TMPro.TMP_Character> struct Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t3AD4D947DA6EF47A94E83331D47EF4941975EB7F_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<TMPro.TMP_FontAsset> struct Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tC81AF8BF3853B6C2714B84CF23C1F1E9365B2A98_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<TMPro.TMP_GlyphPairAdjustmentRecord> struct Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t2929A4F2E168CE315974FAD30BDCB078C1CDD9ED_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<TMPro.TMP_SpriteAsset> struct Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t3CA8565A30BAD418C7C157460DC2C82D972E9571_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<TMPro.TMP_SpriteCharacter> struct Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tBA071D15427E266E335ED277380FA89B2424B35F_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<TMPro.TMP_SpriteGlyph> struct Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_t33996B8F4E0F93D919C3DC91EF8B1D00CDF61867_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1/Enumerator<TMPro.TMP_Style> struct Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654_ComCallableWrapper>, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) Enumerator_tC824CFA1B18C7C15B764EC26C3BE5FF1E32F7654_ComCallableWrapper(obj)); }
#if !defined(BOOST_PP_IS_ITERATING) ///// header body #ifndef BOOST_MPL_AUX_TEMPLATE_ARITY_HPP_INCLUDED #define BOOST_MPL_AUX_TEMPLATE_ARITY_HPP_INCLUDED // Copyright Aleksey Gurtovoy 2001-2004 // // 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) // // See http://www.boost.org/libs/mpl for documentation. // $Id$ // $Date$ // $Revision$ #include <boost_1_56_0/mpl/aux_/config/ttp.hpp> #include <boost_1_56_0/mpl/aux_/config/lambda.hpp> #if !defined(BOOST_MPL_PREPROCESSING_MODE) # include <boost_1_56_0/mpl/aux_/template_arity_fwd.hpp> # include <boost_1_56_0/mpl/int.hpp> # if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) # if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) # include <boost_1_56_0/mpl/aux_/type_wrapper.hpp> # endif # else # include <boost_1_56_0/mpl/aux_/has_rebind.hpp> # endif #endif #include <boost_1_56_0/mpl/aux_/config/static_constant.hpp> #include <boost_1_56_0/mpl/aux_/config/use_preprocessed.hpp> #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ && !defined(BOOST_MPL_PREPROCESSING_MODE) # define BOOST_MPL_PREPROCESSED_HEADER template_arity.hpp # include <boost_1_56_0/mpl/aux_/include_preprocessed.hpp> #else # if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) # if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) # include <boost_1_56_0/mpl/limits/arity.hpp> # include <boost_1_56_0/mpl/aux_/preprocessor/range.hpp> # include <boost_1_56_0/mpl/aux_/preprocessor/repeat.hpp> # include <boost_1_56_0/mpl/aux_/preprocessor/params.hpp> # include <boost_1_56_0/mpl/aux_/nttp_decl.hpp> # include <boost_1_56_0/preprocessor/seq/fold_left.hpp> # include <boost_1_56_0/preprocessor/comma_if.hpp> # include <boost_1_56_0/preprocessor/iterate.hpp> # include <boost_1_56_0/preprocessor/inc.hpp> # include <boost_1_56_0/preprocessor/cat.hpp> # define AUX778076_ARITY BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY) namespace boost_1_56_0 { namespace mpl { namespace aux { template< BOOST_MPL_AUX_NTTP_DECL(int, N) > struct arity_tag { typedef char (&type)[N + 1]; }; # define AUX778076_MAX_ARITY_OP(unused, state, i_) \ ( BOOST_PP_CAT(C,i_) > 0 ? BOOST_PP_CAT(C,i_) : state ) \ /**/ template< BOOST_MPL_PP_PARAMS(AUX778076_ARITY, BOOST_MPL_AUX_NTTP_DECL(int, C)) > struct max_arity { BOOST_STATIC_CONSTANT(int, value = BOOST_PP_SEQ_FOLD_LEFT( AUX778076_MAX_ARITY_OP , -1 , BOOST_MPL_PP_RANGE(1, AUX778076_ARITY) ) ); }; # undef AUX778076_MAX_ARITY_OP arity_tag<0>::type arity_helper(...); # define BOOST_PP_ITERATION_LIMITS (1, AUX778076_ARITY) # define BOOST_PP_FILENAME_1 <boost_1_56_0/mpl/aux_/template_arity.hpp> # include BOOST_PP_ITERATE() template< typename F, BOOST_MPL_AUX_NTTP_DECL(int, N) > struct template_arity_impl { BOOST_STATIC_CONSTANT(int, value = sizeof(::boost_1_56_0::mpl::aux::arity_helper(type_wrapper<F>(),arity_tag<N>())) - 1 ); }; # define AUX778076_TEMPLATE_ARITY_IMPL_INVOCATION(unused, i_, F) \ BOOST_PP_COMMA_IF(i_) template_arity_impl<F,BOOST_PP_INC(i_)>::value \ /**/ template< typename F > struct template_arity { BOOST_STATIC_CONSTANT(int, value = ( max_arity< BOOST_MPL_PP_REPEAT( AUX778076_ARITY , AUX778076_TEMPLATE_ARITY_IMPL_INVOCATION , F ) >::value )); typedef mpl::int_<value> type; }; # undef AUX778076_TEMPLATE_ARITY_IMPL_INVOCATION # undef AUX778076_ARITY }}} # endif // BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING # else // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT # include <boost_1_56_0/mpl/aux_/config/eti.hpp> namespace boost_1_56_0 { namespace mpl { namespace aux { template< bool > struct template_arity_impl { template< typename F > struct result_ : mpl::int_<-1> { }; }; template<> struct template_arity_impl<true> { template< typename F > struct result_ : F::arity { }; }; template< typename F > struct template_arity : template_arity_impl< ::boost_1_56_0::mpl::aux::has_rebind<F>::value > ::template result_<F> { }; #if defined(BOOST_MPL_CFG_MSVC_ETI_BUG) template<> struct template_arity<int> : mpl::int_<-1> { }; #endif }}} # endif // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS #endif // BOOST_MPL_AUX_TEMPLATE_ARITY_HPP_INCLUDED ///// iteration #else #define i_ BOOST_PP_FRAME_ITERATION(1) template< template< BOOST_MPL_PP_PARAMS(i_, typename P) > class F , BOOST_MPL_PP_PARAMS(i_, typename T) > typename arity_tag<i_>::type arity_helper(type_wrapper< F<BOOST_MPL_PP_PARAMS(i_, T)> >, arity_tag<i_>); #undef i_ #endif // BOOST_PP_IS_ITERATING
#include <iostream> #include<stdio.h> #include <climits> using namespace std; void swap(int *x, int *y); class MinHeap { int *harr; int capacity; int heap_size; public: MinHeap(int capacity); void MinHeapify(int ); int parent(int i) { return (i-1)/2; } int left(int i) { return (2*i + 1); } int right(int i) { return (2*i + 2); } int extractMin(); void decreaseKey(int i, int new_val); int getMin() { return harr[0]; } void deleteKey(int i); void insertKey(int k); }; MinHeap::MinHeap(int cap) { heap_size = 0; capacity = cap; harr = new int[cap]; } void MinHeap::insertKey(int k) { if (heap_size == capacity) { cout << "\nOverflow: Could not insertKey\n"; return; } heap_size++; int i = heap_size - 1; harr[i] = k; while (i != 0 && harr[parent(i)] > harr[i]) { swap(&harr[i], &harr[parent(i)]); i = parent(i); } } void MinHeap::decreaseKey(int i, int new_val) { harr[i] = new_val; while (i != 0 && harr[parent(i)] > harr[i]) { swap(&harr[i], &harr[parent(i)]); i = parent(i); } } int MinHeap::extractMin() { if (heap_size <= 0) return INT_MAX; if (heap_size == 1) { heap_size--; return harr[0]; } int root = harr[0]; harr[0] = harr[heap_size-1]; heap_size--; MinHeapify(0); return root; } void MinHeap::deleteKey(int i) { decreaseKey(i, INT_MIN); extractMin(); } void MinHeap::MinHeapify(int i) { int l = left(i); int r = right(i); int smallest = i; if (l < heap_size && harr[l] < harr[i]) smallest = l; if (r < heap_size && harr[r] < harr[smallest]) smallest = r; if (smallest != i) { swap(&harr[i], &harr[smallest]); MinHeapify(smallest); } } void swap(int *x, int *y) { int temp = *x; *x = *y; *y = temp; } int main() { MinHeap h(11); printf("1. insertKey \n2. deleteKey \n3.extractMin \n4.getMin \n5. decreaseKey \n6. exit \n"); int x,t,c; do{ cin>>x; if(x == 1){ cin>>t; h.insertKey(t); } else if(x == 2){ cin>>t; h.deleteKey(t); } if(x == 3){ cout<<h.extractMin(); } if(x == 4){ cout<<h.getMin(); } if(x == 5){ cin>>t>>c; h.decreaseKey(t,c); } }while(x!=6); return 0; }
// Copyright (c) 2019 Graphcore Ltd. All rights reserved. #define BOOST_TEST_MODULE Namescope0LogicalIf #include <../test_runner.hpp> #include <boost/test/unit_test.hpp> #include <filereader.hpp> #include <popart/builder.hpp> #include <popart/inputshapeinfo.hpp> #include <popart/tensorinfo.hpp> #include <popart/tensornames.hpp> using namespace popart; BOOST_AUTO_TEST_CASE(LogicalIf_namescope0) { TensorInfo info{"FLOAT", std::vector<int64_t>{2, 2}}; TensorInfo infoBool{"BOOL", std::vector<int64_t>{}}; std::vector<TestTensor> inputs; std::vector<TestTensor> outputs; TestRunner runner; runner.patterns.enableInPlace(false); runner.buildModel([&](Builder &builder) { auto aiOnnx = builder.aiOnnxOpset9(); auto in0 = builder.addInputTensor(info); auto in1 = builder.addInputTensor(info); auto in_condition = builder.addInputTensor(infoBool); // in0 + in1 auto &then_branch = [in0, in1](Builder &parent_builder) -> Builder & { Builder &builder = parent_builder.createSubgraphBuilder(); auto aiOnnx = builder.aiOnnxOpset9(); builder.addInputTensorFromParentGraph(in0); builder.addInputTensorFromParentGraph(in1); // could get identical name as else_branch auto out0 = aiOnnx.add({in0, in1}); builder.addOutputTensor(out0); return builder; }(builder); // 2*(in0 + in1) auto &else_branch = [in0, in1](Builder &parent_builder) -> Builder & { Builder &builder = parent_builder.createSubgraphBuilder(); auto aiOnnx = builder.aiOnnxOpset9(); auto aiGraphcore = builder.aiGraphcoreOpset1(); builder.addInputTensorFromParentGraph(in0); builder.addInputTensorFromParentGraph(in1); // could get identical name as then_branch auto out0 = aiOnnx.add({in0, in1}); auto out1 = aiGraphcore.scale({out0}, 2); builder.addOutputTensor(out1); return builder; }(builder); auto out = aiOnnx.logical_if({in_condition}, 1, else_branch, then_branch)[0]; inputs.push_back( TestTensor::create<float>(in0, {1, 2, 3, 4}, info.shape())); inputs.push_back( TestTensor::create<float>(in1, {2, 3, 4, 5}, info.shape())); inputs.push_back(TestTensor::create<bool>(in_condition, infoBool.shape())); outputs.push_back(TestTensor::create<float>(out, info.shape())); return out; }); // Check true branch inputs.back().setData<char>({1}); runner.checkResult( [](TestTensor &result) { auto data = result.getDataCopy<float>(); std::vector<float> expected{3, 5, 7, 9}; BOOST_CHECK(data == expected); }, inputs, outputs); // Check false branch inputs.back().setData<char>({0}); runner.checkResult( [](TestTensor &result) { auto data = result.getDataCopy<float>(); std::vector<float> expected{6, 10, 14, 18}; BOOST_CHECK(data == expected); }, inputs, outputs); }
#ifndef _ZCPROOF_H_ #define _ZCPROOF_H_ #include "../serialize.h" #include "../uint256.h" namespace libzcash { const unsigned char G1_PREFIX_MASK = 0x02; const unsigned char G2_PREFIX_MASK = 0x0a; // Element in the base field class Fq { private: base_blob<256> data; public: Fq() : data() { } template<typename libsnark_Fq> Fq(libsnark_Fq element); template<typename libsnark_Fq> libsnark_Fq to_libsnark_fq() const; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(data); } friend bool operator==(const Fq& a, const Fq& b) { return ( a.data == b.data ); } friend bool operator!=(const Fq& a, const Fq& b) { return !(a == b); } }; // Element in the extension field class Fq2 { private: base_blob<512> data; public: Fq2() : data() { } template<typename libsnark_Fq2> Fq2(libsnark_Fq2 element); template<typename libsnark_Fq2> libsnark_Fq2 to_libsnark_fq2() const; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(data); } friend bool operator==(const Fq2& a, const Fq2& b) { return ( a.data == b.data ); } friend bool operator!=(const Fq2& a, const Fq2& b) { return !(a == b); } }; // Compressed point in G1 class CompressedG1 { private: bool y_lsb; Fq x; public: CompressedG1() : y_lsb(false), x() { } template<typename libsnark_G1> CompressedG1(libsnark_G1 point); template<typename libsnark_G1> libsnark_G1 to_libsnark_g1() const; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { unsigned char leadingByte = G1_PREFIX_MASK; if (y_lsb) { leadingByte |= 1; } READWRITE(leadingByte); if ((leadingByte & (~1)) != G1_PREFIX_MASK) { throw std::ios_base::failure("lead byte of G1 point not recognized"); } y_lsb = leadingByte & 1; READWRITE(x); } friend bool operator==(const CompressedG1& a, const CompressedG1& b) { return ( a.y_lsb == b.y_lsb && a.x == b.x ); } friend bool operator!=(const CompressedG1& a, const CompressedG1& b) { return !(a == b); } }; // Compressed point in G2 class CompressedG2 { private: bool y_gt; Fq2 x; public: CompressedG2() : y_gt(false), x() { } template<typename libsnark_G2> CompressedG2(libsnark_G2 point); template<typename libsnark_G2> libsnark_G2 to_libsnark_g2() const; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { unsigned char leadingByte = G2_PREFIX_MASK; if (y_gt) { leadingByte |= 1; } READWRITE(leadingByte); if ((leadingByte & (~1)) != G2_PREFIX_MASK) { throw std::ios_base::failure("lead byte of G2 point not recognized"); } y_gt = leadingByte & 1; READWRITE(x); } friend bool operator==(const CompressedG2& a, const CompressedG2& b) { return ( a.y_gt == b.y_gt && a.x == b.x ); } friend bool operator!=(const CompressedG2& a, const CompressedG2& b) { return !(a == b); } }; // Compressed zkSNARK proof class ZCProof { private: CompressedG1 g_A; CompressedG1 g_A_prime; CompressedG2 g_B; CompressedG1 g_B_prime; CompressedG1 g_C; CompressedG1 g_C_prime; CompressedG1 g_K; CompressedG1 g_H; public: ZCProof() : g_A(), g_A_prime(), g_B(), g_B_prime(), g_C(), g_C_prime(), g_K(), g_H() { } // Produces a compressed proof using a libsnark zkSNARK proof template<typename libsnark_proof> ZCProof(const libsnark_proof& proof); // Produces a libsnark zkSNARK proof out of this proof, // or throws an exception if it is invalid. template<typename libsnark_proof> libsnark_proof to_libsnark_proof() const; static ZCProof random_invalid(); ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(g_A); READWRITE(g_A_prime); READWRITE(g_B); READWRITE(g_B_prime); READWRITE(g_C); READWRITE(g_C_prime); READWRITE(g_K); READWRITE(g_H); } friend bool operator==(const ZCProof& a, const ZCProof& b) { return ( a.g_A == b.g_A && a.g_A_prime == b.g_A_prime && a.g_B == b.g_B && a.g_B_prime == b.g_B_prime && a.g_C == b.g_C && a.g_C_prime == b.g_C_prime && a.g_K == b.g_K && a.g_H == b.g_H ); } friend bool operator!=(const ZCProof& a, const ZCProof& b) { return !(a == b); } }; } #endif // _ZCPROOF_H_
/** * @author Jacob Schloss <jacob.schloss@suburbanmarine.io> * @copyright Copyright (c) 2021 Suburban Marine, Inc. All rights reserved. * @license Licensed under the 3-Clause BSD LICENSE. See LICENSE.txt for details. */ #pragma once #include "pipeline/GST_element_base.hpp" #include <gstreamermm/caps.h> #include <gstreamermm/capsfilter.h> #include <gstreamermm/queue.h> class autovideosink_pipe : public GST_element_base { public: autovideosink_pipe(); void add_to_bin(const Glib::RefPtr<Gst::Bin>& bin) override; bool link_front(const Glib::RefPtr<Gst::Element>& node) override; bool link_back(const Glib::RefPtr<Gst::Element>& node) override; bool init(const char name[]) override; Glib::RefPtr<Gst::Element> front() override { return m_in_queue; } protected: Glib::RefPtr<Gst::Bin> m_bin; Glib::RefPtr<Gst::Queue> m_in_queue; Glib::RefPtr<Gst::Element> m_videoconvert; Glib::RefPtr<Gst::Queue> m_disp_queue; Glib::RefPtr<Gst::Element> m_autovideosink; };
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/compiler/xla/service/gpu/ir_emitter.h" #include "tensorflow/core/platform/logging.h" // IWYU pragma: no_include "llvm/IR/Intrinsics.gen.inc" #include "absl/algorithm/container.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" #include "tensorflow/compiler/xla/primitive_util.h" #include "tensorflow/compiler/xla/service/elemental_ir_emitter.h" #include "tensorflow/compiler/xla/service/gpu/elemental_ir_emitter.h" #include "tensorflow/compiler/xla/service/gpu/ir_emitter_nested.h" #include "tensorflow/compiler/xla/service/gpu/ir_emitter_unnested.h" #include "tensorflow/compiler/xla/service/gpu/launch_dimensions.h" #include "tensorflow/compiler/xla/service/hlo_computation.h" #include "tensorflow/compiler/xla/service/hlo_instructions.h" #include "tensorflow/compiler/xla/service/llvm_ir/fused_ir_emitter.h" #include "tensorflow/compiler/xla/service/llvm_ir/ir_array.h" #include "tensorflow/compiler/xla/service/llvm_ir/llvm_loop.h" #include "tensorflow/compiler/xla/service/llvm_ir/llvm_util.h" #include "tensorflow/compiler/xla/service/llvm_ir/loop_emitter.h" #include "tensorflow/compiler/xla/service/llvm_ir/tuple_ops.h" #include "tensorflow/compiler/xla/service/name_uniquer.h" #include "tensorflow/compiler/xla/shape_util.h" #include "tensorflow/compiler/xla/status_macros.h" #include "tensorflow/compiler/xla/types.h" #include "tensorflow/compiler/xla/util.h" #include "tensorflow/compiler/xla/window_util.h" #include "tensorflow/core/lib/core/errors.h" // Convenient function to cast the provided llvm::Value* using IRBuilder // to default address space. This is useful in particular for generating // IR for AMDGPU target, as its kernel variables are in address space 5 // instead of the default address space. static llvm::Value* AddrCastToDefault(llvm::Value* arg, llvm::IRBuilder<>& b) { llvm::Type* arg_type = arg->getType(); CHECK(arg_type->isPointerTy()); if (arg_type->getPointerAddressSpace() != 0) { llvm::Type* generic_arg_type = arg_type->getPointerElementType()->getPointerTo(0); llvm::Value* addrspacecast_arg = b.CreateAddrSpaceCast(arg, generic_arg_type); return addrspacecast_arg; } return arg; } namespace xla { using llvm_ir::IrName; using llvm_ir::SetToFirstInsertPoint; namespace gpu { IrEmitter::IrEmitter(const HloModuleConfig& hlo_module_config, IrEmitterContext* ir_emitter_context, bool is_nested) : ir_emitter_context_(ir_emitter_context), module_(ir_emitter_context->llvm_module()), b_(module_->getContext()), bindings_(&b_, module_, is_nested), hlo_module_config_(hlo_module_config) {} Status IrEmitter::DefaultAction(HloInstruction* hlo) { ElementalIrEmitter::HloToElementGeneratorMap operand_to_generator; for (const HloInstruction* operand : hlo->operands()) { operand_to_generator[operand] = [=](const llvm_ir::IrArray::Index& index) { return GetIrArray(*operand, *hlo) .EmitReadArrayElement(index, &b_, operand->name()); }; } return EmitTargetElementLoop( *hlo, GpuElementalIrEmitter(hlo_module_config_, module_, &b_, GetNestedComputer()) .MakeElementGenerator(hlo, operand_to_generator)); } Status IrEmitter::HandleConstant(HloInstruction* constant) { return Status::OK(); } Status IrEmitter::HandleAddDependency(HloInstruction* add_dependency) { VLOG(2) << "HandleAddDependency: " << add_dependency->ToString(); const HloInstruction* operand = add_dependency->operand(0); // Add_Dependency is a no-op, but we still want to bind it to an llvm::Value // sometimes, e.g., when it's operand is a constant or a bitcast of a // constant. if (bindings_.BoundToIrValue(*operand)) { bindings_.BindHloToIrValue(*add_dependency, GetBasePointer(*operand)); } return Status::OK(); } Status IrEmitter::HandleGetTupleElement(HloInstruction* get_tuple_element) { auto operand = get_tuple_element->operand(0); CHECK(bindings_.BoundToIrValue(*operand)); bindings_.BindHloToIrValue( *get_tuple_element, llvm_ir::EmitGetTupleElement( get_tuple_element->shape(), get_tuple_element->tuple_index(), // TODO(b/26344050): tighten the alignment here // based on the real element type. /*alignment=*/1, GetBasePointer(*operand), &b_)); return Status::OK(); } Status IrEmitter::HandleSend(HloInstruction*) { return Unimplemented("Send is not implemented on GPU"); } Status IrEmitter::HandleSendDone(HloInstruction*) { return Unimplemented("Send-Done is not implemented on GPU"); } Status IrEmitter::HandleRecv(HloInstruction*) { return Unimplemented("Recv is not implemented on GPU"); } Status IrEmitter::HandleRecvDone(HloInstruction*) { return Unimplemented("Recv-done is not implemented on GPU"); } Status IrEmitter::HandleScatter(HloInstruction*) { return Unimplemented("Scatter is not implemented on GPUs."); } Status IrEmitter::HandleTuple(HloInstruction* tuple) { std::vector<llvm::Value*> base_ptrs; for (const HloInstruction* operand : tuple->operands()) { base_ptrs.push_back(GetBasePointer(*operand)); } llvm_ir::EmitTuple(GetIrArray(*tuple, *tuple), base_ptrs, &b_); return Status::OK(); } Status IrEmitter::EmitCallToNestedComputation( const HloComputation& nested_computation, absl::Span<llvm::Value* const> operands, llvm::Value* output) { TF_RET_CHECK(nested_computation.num_parameters() > 0); llvm::Function*& emitted_function = computation_to_ir_function_[&nested_computation]; if (emitted_function == nullptr) { TF_ASSIGN_OR_RETURN( auto ir_emitter_nested, IrEmitterNested::Create(hlo_module_config_, nested_computation, ir_emitter_context_)); TF_RETURN_IF_ERROR(ir_emitter_nested->CodegenNestedComputation()); emitted_function = ir_emitter_nested->GetEmittedFunction(); } // Operands are in default address space for non-AMDGPU target. // However for AMDGPU target, addrspacecast alloca variables from // addrspace 5 to addrspace 0 is needed. std::vector<llvm::Value*> arguments; absl::c_transform( operands, std::back_inserter(arguments), [this](llvm::Value* arg) { return AddrCastToDefault(arg, b_); }); llvm::Value* casted_output = AddrCastToDefault(output, b_); arguments.push_back(casted_output); Call(emitted_function, arguments); return Status::OK(); } bool IrEmitter::MaybeEmitDirectAtomicOperation( const HloComputation& computation, llvm::Value* output_address, llvm::Value* source_address) { CHECK_EQ(2, computation.num_parameters()); HloOpcode root_opcode = computation.root_instruction()->opcode(); PrimitiveType element_type = computation.root_instruction()->shape().element_type(); bool is_atomic_integral = element_type == S32 || element_type == U32 || element_type == S64 || element_type == U64; llvm::Value* source = Load(source_address, "source"); // Just passing along RHS -> atomic store. if (computation.instruction_count() == 2 && root_opcode == HloOpcode::kParameter && (element_type == F32 || is_atomic_integral) && computation.root_instruction()->parameter_number() == 1) { llvm::StoreInst* store = Store(source, output_address); store->setAtomic(llvm::AtomicOrdering::Unordered); // Derive a minimum alignment from the type. The optimizer can increase it // later. store->setAlignment( llvm::Align(ShapeUtil::ByteSizeOfPrimitiveType(element_type))); return true; } if (computation.instruction_count() != 3) { // We special-case only computations with one computing instruction for now. // Such computation has exactly three instructions given it has two // parameters. return false; } if (root_opcode == HloOpcode::kAdd) { llvm::Triple target_triple = llvm::Triple(module_->getTargetTriple()); // NVPTX supports atomicAdd on F32 and integer types. if (target_triple.isNVPTX()) { // "atom.add.f64 requires sm_60 or higher." // https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-atom bool f64_atomic_add_supported = ir_emitter_context_->cuda_compute_capability().IsAtLeast(6); bool atomic_add_supported = element_type == F32 || (f64_atomic_add_supported && element_type == F64); if (atomic_add_supported) { AtomicRMW(llvm::AtomicRMWInst::FAdd, output_address, source, llvm::MaybeAlign(), llvm::AtomicOrdering::SequentiallyConsistent); return true; } } if (is_atomic_integral) { // integral + integral AtomicRMW(llvm::AtomicRMWInst::Add, output_address, source, llvm::MaybeAlign(), llvm::AtomicOrdering::SequentiallyConsistent); return true; } } // NVPTX supports atomicMax and atomicMin only on integer types. if (root_opcode == HloOpcode::kMaximum && is_atomic_integral) { // max(integral, integral) auto opcode = primitive_util::IsSignedIntegralType(element_type) ? llvm::AtomicRMWInst::Max : llvm::AtomicRMWInst::UMax; AtomicRMW(opcode, output_address, source, llvm::MaybeAlign(), llvm::AtomicOrdering::SequentiallyConsistent); return true; } if (root_opcode == HloOpcode::kMinimum && is_atomic_integral) { // min(integral, integral) auto opcode = primitive_util::IsSignedIntegralType(element_type) ? llvm::AtomicRMWInst::Min : llvm::AtomicRMWInst::UMin; AtomicRMW(opcode, output_address, source, llvm::MaybeAlign(), llvm::AtomicOrdering::SequentiallyConsistent); return true; } return false; } // Implements atomic binary operations using atomic compare-and-swap // (atomicCAS) as follows: // 1. Reads the value from the memory pointed to by output_address and // records it as old_output. // 2. Uses old_output as one of the source operand to perform the binary // operation and stores the result in new_output. // 3. Calls atomicCAS which implements compare-and-swap as an atomic // operation. In particular, atomicCAS reads the value from the memory // pointed to by output_address, and compares the value with old_output. If // the two values equal, new_output is written to the same memory location // and true is returned to indicate that the atomic operation succeeds. // Otherwise, the new value read from the memory is returned. In this case, // the new value is copied to old_output, and steps 2. and 3. are repeated // until atomicCAS succeeds. // // On Nvidia GPUs, atomicCAS can only operate on 32 bit and 64 bit integers. If // the element type of the binary operation is 32 bits or 64 bits, the integer // type of the same size is used for the atomicCAS operation. On the other hand, // if the element type is smaller than 32 bits, int32_t is used for the // atomicCAS operation. In this case, atomicCAS reads and writes 32 bit values // from the memory, which is larger than the memory size required by the // original atomic binary operation. We mask off the last two bits of the // output_address and use the result as an address to read the 32 bit values // from the memory. This can avoid out of bound memory accesses if tensor // buffers are 4 byte aligned and have a size of 4N, an assumption that the // runtime can guarantee. // // The pseudo code is shown below. Variables *_address are pointers to a memory // region with a size equal to the size of the atomicCAS operation, with the // exception that new_output_address is a pointer to a memory region with a size // equal to the element size of the binary operation. // // element_size = sizeof(element_type); // atomic_size = max(32, element_size); // cas_new_output_address = alloca(atomic_size); // cas_old_output_address = alloca(atomic_size); // if (atomic_size != element_size) { // atomic_address = output_address & ((int64_t)(-4)); // new_output_address = cas_new_output_address + (output_address & 3); // } else { // atomic_address = output_address; // new_output_address = cas_new_output_address; // } // // *cas_old_output_address = *atomic_address; // do { // *cas_new_output_address = *cas_old_output_address; // *new_output_address = operation(*new_output_address, *source_address); // (*cas_old_output_address, success) = // atomicCAS(atomic_address, *cas_old_output_address, // *cas_new_output_address); // } while (!success); // Status IrEmitter::EmitAtomicOperationUsingCAS(const HloComputation& computation, llvm::Value* output_address, llvm::Value* source_address) { llvm::PointerType* output_address_type = llvm::dyn_cast<llvm::PointerType>(output_address->getType()); CHECK_NE(output_address_type, nullptr); // element_type is the data type for the binary operation. llvm::Type* element_type = output_address_type->getPointerElementType(); int element_size = llvm_ir::GetSizeInBits(element_type); int atomic_size = (element_size < 32) ? 32 : element_size; llvm::Type* atomic_type = b_.getIntNTy(atomic_size); llvm::Type* atomic_address_type = atomic_type->getPointerTo(output_address_type->getPointerAddressSpace()); // cas_old_output_address and cas_new_output_address point to the scratch // memory where we store the old and new values for the repeated atomicCAS // operations. llvm::Value* cas_old_output_address = llvm_ir::EmitAllocaAtFunctionEntry( atomic_type, "cas_old_output_address", &b_); llvm::Value* cas_new_output_address = llvm_ir::EmitAllocaAtFunctionEntry( atomic_type, "cas_new_output_address", &b_); // Emit preparation code to the preheader. llvm::BasicBlock* loop_preheader_bb = b_.GetInsertBlock(); llvm::Value* atomic_memory_address; // binop_output_address points to the scratch memory that stores the // result of the binary operation. llvm::Value* binop_output_address; if (element_size < 32) { // Assume the element size is an integer number of bytes. CHECK_EQ((element_size % sizeof(char)), 0); llvm::Type* address_int_type = module_->getDataLayout().getIntPtrType(output_address_type); atomic_memory_address = PtrToInt(output_address, address_int_type); llvm::Value* mask = llvm::ConstantInt::get(address_int_type, 3); llvm::Value* offset = And(atomic_memory_address, mask); mask = llvm::ConstantInt::get(address_int_type, -4); atomic_memory_address = And(atomic_memory_address, mask); atomic_memory_address = IntToPtr(atomic_memory_address, atomic_address_type); binop_output_address = Add(PtrToInt(cas_new_output_address, address_int_type), offset); binop_output_address = IntToPtr( binop_output_address, llvm::PointerType::get( element_type, cas_new_output_address->getType()->getPointerAddressSpace())); } else { atomic_memory_address = b_.CreatePointerBitCastOrAddrSpaceCast( output_address, atomic_address_type); binop_output_address = b_.CreatePointerBitCastOrAddrSpaceCast( cas_new_output_address, llvm::PointerType::get( element_type, cas_new_output_address->getType()->getPointerAddressSpace())); } // Use the value from the memory that atomicCAS operates on to initialize // cas_old_output. llvm::Value* cas_old_output = Load(atomic_memory_address, "cas_old_output"); Store(cas_old_output, cas_old_output_address); llvm::BasicBlock* loop_exit_bb = loop_preheader_bb->splitBasicBlock( b_.GetInsertPoint(), "atomic_op_loop_exit"); llvm::BasicBlock* loop_body_bb = llvm::BasicBlock::Create( b_.getContext(), "atomic_op_loop_body", b_.GetInsertBlock()->getParent()); b_.SetInsertPoint(loop_body_bb); // Change preheader's successor from loop_exit_bb to loop_body_bb. loop_preheader_bb->getTerminator()->setSuccessor(0, loop_body_bb); // Emit the body of the loop that repeatedly invokes atomicCAS. // // Use cas_old_output to initialize cas_new_output. cas_old_output = Load(cas_old_output_address, "cas_old_output"); Store(cas_old_output, cas_new_output_address); // Emits code to calculate new_output = operation(old_output, source); TF_RETURN_IF_ERROR(EmitCallToNestedComputation( computation, {binop_output_address, source_address}, binop_output_address)); llvm::Value* cas_new_output = Load(cas_new_output_address, "cas_new_output"); // If cas_new_output == cas_old_output, we're not asking for anything to // change, so we're done here! llvm::Value* old_eq_new = ICmpEQ(cas_old_output, cas_new_output); llvm::BasicBlock* loop_cas_bb = llvm::BasicBlock::Create( b_.getContext(), "atomic_op_loop_cas", b_.GetInsertBlock()->getParent()); CondBr(old_eq_new, loop_exit_bb, loop_cas_bb); b_.SetInsertPoint(loop_cas_bb); // Emit code to perform the atomicCAS operation // (cas_old_output, success) = atomicCAS(memory_address, cas_old_output, // cas_new_output); llvm::Value* ret_value = AtomicCmpXchg( atomic_memory_address, cas_old_output, cas_new_output, llvm::MaybeAlign(), llvm::AtomicOrdering::SequentiallyConsistent, llvm::AtomicOrdering::SequentiallyConsistent); // Extract the memory value returned from atomicCAS and store it as // cas_old_output. Store(ExtractValue(ret_value, 0, "cas_old_output"), cas_old_output_address); // Extract the success bit returned from atomicCAS and generate a // conditional branch on the success bit. CondBr(ExtractValue(ret_value, 1, "success"), loop_exit_bb, loop_body_bb); // Set the insertion point to the exit basic block so that the caller of // this method can continue emitting code to the right place. SetToFirstInsertPoint(loop_exit_bb, &b_); return Status::OK(); } Status IrEmitter::EmitAtomicOperationForNestedComputation( const HloComputation& computation, llvm::Value* output_address, llvm::Value* source_address) { if (computation.num_parameters() != 2) { // TODO(b/30258929): We only accept binary computations so far. return Unimplemented( "We only support atomic functions with exactly two parameters, but " "computation %s has %d.", computation.name(), computation.num_parameters()); } if (MaybeEmitDirectAtomicOperation(computation, output_address, source_address)) { return Status::OK(); } return EmitAtomicOperationUsingCAS(computation, output_address, source_address); } Status IrEmitter::HandleTupleSelect(HloInstruction* tuple_select) { return InternalError( "Dynamic selection of tuples is not supported. Please file a bug against " "XLA/GPU if you need it"); } namespace { llvm::Value* Real(llvm::Value* x, llvm::IRBuilder<>* b) { return b->CreateExtractValue(x, {0}); } llvm::Value* Imag(llvm::Value* x, llvm::IRBuilder<>* b) { return b->CreateExtractValue(x, {1}); } std::pair<llvm::Value*, llvm::Value*> MultiplyComplex(llvm::Value* lhs_value, llvm::Value* rhs_value, llvm::IRBuilder<>* b) { llvm::Value* lhs_real = Real(lhs_value, b); llvm::Value* lhs_imag = Imag(lhs_value, b); llvm::Value* rhs_real = Real(rhs_value, b); llvm::Value* rhs_imag = Imag(rhs_value, b); llvm::Value* real_result1 = b->CreateFMul(lhs_real, rhs_real); llvm::Value* real_result2 = b->CreateFMul(lhs_imag, rhs_imag); llvm::Value* real_result = b->CreateFSub(real_result1, real_result2); llvm::Value* imag_result1 = b->CreateFMul(lhs_real, rhs_imag); llvm::Value* imag_result2 = b->CreateFMul(lhs_imag, rhs_real); llvm::Value* imag_result = b->CreateFAdd(imag_result1, imag_result2); return {real_result, imag_result}; } } // namespace Status IrEmitter::HandleConvolution(HloInstruction* convolution) { if (ShapeUtil::IsZeroElementArray(convolution->shape())) { // Emit no code for an empty output. return Status::OK(); } // TODO(b/31409998): Support convolution with dilation. return Unimplemented( "Hit a case for convolution that is not implemented on GPU."); } Status IrEmitter::HandleFft(HloInstruction* fft) { if (ShapeUtil::IsZeroElementArray(fft->shape())) { // Emit no code for an empty output. return Status::OK(); } return Unimplemented("Hit a case for fft that is not implemented on GPU."); } Status IrEmitter::HandleAllReduce(HloInstruction* crs) { return Unimplemented( "AllReduce cannot be nested inside of fusion, map, etc."); } Status IrEmitter::HandleParameter(HloInstruction* parameter) { return Status::OK(); } Status IrEmitter::HandleFusion(HloInstruction* fusion) { // kFusion for library calls should be handled by // IrEmitterUnnested::HandleFusion. CHECK_EQ(HloInstruction::FusionKind::kLoop, fusion->fusion_kind()); GpuElementalIrEmitter elemental_emitter(hlo_module_config_, module_, &b_, GetNestedComputer()); FusedIrEmitter fused_emitter(&elemental_emitter); BindFusionArguments(fusion, &fused_emitter); TF_ASSIGN_OR_RETURN(auto generator, fused_emitter.GetGenerator( fusion->fused_expression_root())); return EmitTargetElementLoop(*fusion, generator); } Status IrEmitter::HandleCall(HloInstruction* call) { std::vector<llvm::Value*> operand_addresses; for (HloInstruction* operand : call->operands()) { operand_addresses.push_back(GetBasePointer(*operand)); } return EmitCallToNestedComputation(*call->to_apply(), operand_addresses, GetBasePointer(*call)); } Status IrEmitter::HandleCustomCall(HloInstruction*) { return Unimplemented("custom-call"); } Status IrEmitter::HandleInfeed(HloInstruction*) { // TODO(b/30467474): Implement infeed on GPU. return Unimplemented("Infeed is not supported on GPU."); } Status IrEmitter::HandleOutfeed(HloInstruction*) { // TODO(b/34359662): Implement outfeed on GPU. return Unimplemented("Outfeed is not supported on GPU."); } Status IrEmitter::HandleBatchNormInference(HloInstruction*) { return Unimplemented( "The GPU backend does not implement BatchNormInference directly. It " "should be lowered before IR emission to HLO-soup using " "BatchNormRewriter."); } Status IrEmitter::HandleBatchNormTraining(HloInstruction*) { return Unimplemented( "The GPU backend does not implement BatchNormTraining directly. It " "should be lowered before IR emission to HLO-soup using " "BatchNormRewriter."); } Status IrEmitter::HandleBatchNormGrad(HloInstruction*) { return Unimplemented( "The GPU backend does not implement BatchNormGrad directly. It should " "be lowered before IR emission to HLO-soup using BatchNormRewriter."); } StatusOr<std::vector<llvm::Value*>> IrEmitter::ComputeNestedElement( const HloComputation& computation, absl::Span<llvm::Value* const> parameter_elements) { std::vector<llvm::Value*> parameter_buffers; for (llvm::Value* parameter_element : parameter_elements) { parameter_buffers.push_back(llvm_ir::EmitAllocaAtFunctionEntry( parameter_element->getType(), "parameter_buffer", &b_)); Store(parameter_element, parameter_buffers.back()); } return ComputeNestedElementFromAddrs(computation, parameter_buffers); } StatusOr<std::vector<llvm::Value*>> IrEmitter::ComputeNestedElementFromAddrs( const HloComputation& computation, absl::Span<llvm::Value* const> parameter_elements_addrs) { const Shape& return_shape = computation.root_instruction()->shape(); llvm::Value* return_buffer = llvm_ir::EmitAllocaAtFunctionEntry( llvm_ir::ShapeToIrType(return_shape, module_), "return_buffer", &b_); std::vector<llvm::Value*> allocas_for_returned_scalars; if (!return_shape.IsTuple()) { allocas_for_returned_scalars.push_back(return_buffer); } else { allocas_for_returned_scalars = llvm_ir::EmitTupleAllocasAtFunctionEntry(return_shape, &b_); llvm_ir::IrArray tuple_array(return_buffer, return_shape); EmitTuple(tuple_array, allocas_for_returned_scalars, &b_); } TF_RETURN_IF_ERROR(EmitCallToNestedComputation( computation, parameter_elements_addrs, return_buffer)); std::vector<llvm::Value*> returned_scalars; returned_scalars.reserve(allocas_for_returned_scalars.size()); for (llvm::Value* addr : allocas_for_returned_scalars) { returned_scalars.push_back(Load(addr)); } return returned_scalars; } std::vector<llvm_ir::IrArray> IrEmitter::ConstructIrArrayForOutputs( const HloInstruction& hlo) { std::vector<llvm_ir::IrArray> output_arrays; if (hlo.shape().IsTuple()) { int64_t num_outputs = ShapeUtil::TupleElementCount(hlo.shape()); output_arrays.reserve(num_outputs); for (int64_t i = 0; i < num_outputs; ++i) { output_arrays.push_back(GetIrArray(hlo, hlo, {i})); } } else { output_arrays.push_back(GetIrArray(hlo, hlo)); } return output_arrays; } void IrEmitter::BindFusionArguments(const HloInstruction* fusion, FusedIrEmitter* fused_emitter) { for (int i = 0; i < fusion->operand_count(); i++) { const HloInstruction* operand = fusion->operand(i); fused_emitter->BindGenerator( fusion->fused_parameter(i), [this, operand, fusion](llvm_ir::IrArray::Index index) { return GetIrArray(*operand, *fusion) .EmitReadArrayElement(index, &b_, operand->name()); }); } } } // namespace gpu } // namespace xla
/* WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. This file was generated from AddDiagnostics_Response_.idl using "rtiddsgen". The rtiddsgen tool is part of the RTI Connext distribution. For more information, type 'rtiddsgen -help' at a command shell or consult the RTI Connext manual. */ #ifndef NDDS_STANDALONE_TYPE #ifndef ndds_cpp_h #include "ndds/ndds_cpp.h" #endif #ifndef dds_c_log_impl_h #include "dds_c/dds_c_log_impl.h" #endif #ifndef cdr_type_h #include "cdr/cdr_type.h" #endif #ifndef osapi_heap_h #include "osapi/osapi_heap.h" #endif #else #include "ndds_standalone_type.h" #endif #include "AddDiagnostics_Response_.h" #include <new> namespace diagnostic_msgs { namespace srv { namespace dds_ { /* ========================================================================= */ const char *AddDiagnostics_Response_TYPENAME = "diagnostic_msgs::srv::dds_::AddDiagnostics_Response_"; DDS_TypeCode* AddDiagnostics_Response__get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode AddDiagnostics_Response__g_tc_message__string = DDS_INITIALIZE_STRING_TYPECODE(RTI_INT32_MAX); static DDS_TypeCode_Member AddDiagnostics_Response__g_tc_members[2]= { { (char *)"success_",/* Member name */ { 0,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL/* Ignored */ }, { (char *)"message_",/* Member name */ { 1,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL/* Ignored */ } }; static DDS_TypeCode AddDiagnostics_Response__g_tc = {{ DDS_TK_STRUCT,/* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"diagnostic_msgs::srv::dds_::AddDiagnostics_Response_", /* Name */ NULL, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 2, /* Number of members */ AddDiagnostics_Response__g_tc_members, /* Members */ DDS_VM_NONE /* Ignored */ }}; /* Type code for AddDiagnostics_Response_*/ if (is_initialized) { return &AddDiagnostics_Response__g_tc; } AddDiagnostics_Response__g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_boolean; AddDiagnostics_Response__g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)&AddDiagnostics_Response__g_tc_message__string; is_initialized = RTI_TRUE; return &AddDiagnostics_Response__g_tc; } RTIBool AddDiagnostics_Response__initialize( AddDiagnostics_Response_* sample) { return diagnostic_msgs::srv::dds_::AddDiagnostics_Response__initialize_ex(sample,RTI_TRUE,RTI_TRUE); } RTIBool AddDiagnostics_Response__initialize_ex( AddDiagnostics_Response_* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return diagnostic_msgs::srv::dds_::AddDiagnostics_Response__initialize_w_params( sample,&allocParams); } RTIBool AddDiagnostics_Response__initialize_w_params( AddDiagnostics_Response_* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } if (!RTICdrType_initBoolean(&sample->success_)) { return RTI_FALSE; } if (allocParams->allocate_memory){ sample->message_= DDS_String_alloc ((0)); if (sample->message_ == NULL) { return RTI_FALSE; } } else { if (sample->message_!= NULL) { sample->message_[0] = '\0'; } } return RTI_TRUE; } void AddDiagnostics_Response__finalize( AddDiagnostics_Response_* sample) { diagnostic_msgs::srv::dds_::AddDiagnostics_Response__finalize_ex(sample,RTI_TRUE); } void AddDiagnostics_Response__finalize_ex( AddDiagnostics_Response_* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; diagnostic_msgs::srv::dds_::AddDiagnostics_Response__finalize_w_params( sample,&deallocParams); } void AddDiagnostics_Response__finalize_w_params( AddDiagnostics_Response_* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } if (sample->message_ != NULL) { DDS_String_free(sample->message_); sample->message_=NULL; } } void AddDiagnostics_Response__finalize_optional_members( AddDiagnostics_Response_* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; } RTIBool AddDiagnostics_Response__copy( AddDiagnostics_Response_* dst, const AddDiagnostics_Response_* src) { try { if (dst == NULL || src == NULL) { return RTI_FALSE; } if (!RTICdrType_copyBoolean ( &dst->success_, &src->success_)) { return RTI_FALSE; } if (!RTICdrType_copyStringEx ( &dst->message_, src->message_, (RTI_INT32_MAX-1) + 1,RTI_TRUE)){ return RTI_FALSE; } return RTI_TRUE; } catch (std::bad_alloc&) { return RTI_FALSE; } } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'AddDiagnostics_Response_' sequence class. */ #define T AddDiagnostics_Response_ #define TSeq AddDiagnostics_Response_Seq #define T_initialize_w_params diagnostic_msgs::srv::dds_::AddDiagnostics_Response__initialize_w_params #define T_finalize_w_params diagnostic_msgs::srv::dds_::AddDiagnostics_Response__finalize_w_params #define T_copy diagnostic_msgs::srv::dds_::AddDiagnostics_Response__copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #include "dds_cpp/generic/dds_cpp_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #include "dds_cpp_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T } /* namespace dds_ */ } /* namespace srv */ } /* namespace diagnostic_msgs */
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "jitpch.h" #ifdef _MSC_VER #pragma hdrstop #endif #include "phase.h" //------------------------------------------------------------------------ // Run: execute a phase and any before and after actions // void Phase::Run() { PrePhase(); DoPhase(); PostPhase(); } //------------------------------------------------------------------------ // PrePhase: perform dumps and checks before a phase executes // void Phase::PrePhase() { comp->BeginPhase(m_phase); #ifdef DEBUG // To help in the incremental conversion of jit activity to phases // without greatly increasing dump size or checked jit time, we // currently whitelist the phases that do pre-phase checks and // dumps via the phase object, and not via explicit calls from // the various methods in the phase. // // In the long run the aim is to get rid of all pre-phase checks // and dumps, relying instead on post-phase checks and dumps from // the preceeding phase. // // Currently the list is just the set of phases that have custom // derivations from the Phase class. static Phases s_whitelist[] = {PHASE_ALLOCATE_OBJECTS, PHASE_BUILD_SSA, PHASE_RATIONALIZE, PHASE_LOWERING, PHASE_STACK_LEVEL_SETTER}; bool doPrePhase = false; for (int i = 0; i < sizeof(s_whitelist) / sizeof(Phases); i++) { if (m_phase == s_whitelist[i]) { doPrePhase = true; break; } } if (VERBOSE) { if (doPrePhase) { printf("Trees before %s\n", m_name); comp->fgDispBasicBlocks(true); } if (comp->compIsForInlining()) { printf("\n*************** Inline @[%06u] Starting PHASE %s\n", Compiler::dspTreeID(comp->impInlineInfo->iciCall), m_name); } else { printf("\n*************** Starting PHASE %s\n", m_name); } } if (doPrePhase) { if ((comp->activePhaseChecks == PhaseChecks::CHECK_ALL) && (comp->expensiveDebugCheckLevel >= 2)) { // If everyone used the Phase class, this would duplicate the PostPhase() from the previous phase. // But, not everyone does, so go ahead and do the check here, too. comp->fgDebugCheckBBlist(); comp->fgDebugCheckLinks(); } } #endif // DEBUG } //------------------------------------------------------------------------ // PostPhase: perform dumps and checks after a phase executes // void Phase::PostPhase() { #ifdef DEBUG // To help in the incremental conversion of jit activity to phases // without greatly increasing dump size or checked jit time, we // currently whitelist the phases that do post-phase checks and // dumps via the phase object, and not via explicit calls from // the various methods in the phase. // // As we remove the explicit checks and dumps from each phase, we // will add to thist list; once all phases are updated, we can // remove the list entirely. // // Currently the list is just the set of phases that have custom // derivations from the Phase class. static Phases s_whitelist[] = {PHASE_ALLOCATE_OBJECTS, PHASE_BUILD_SSA, PHASE_RATIONALIZE, PHASE_LOWERING, PHASE_STACK_LEVEL_SETTER}; bool doPostPhase = false; for (int i = 0; i < sizeof(s_whitelist) / sizeof(Phases); i++) { if (m_phase == s_whitelist[i]) { doPostPhase = true; break; } } if (VERBOSE) { if (comp->compIsForInlining()) { printf("\n*************** Inline @[%06u] Finishing PHASE %s\n", Compiler::dspTreeID(comp->impInlineInfo->iciCall), m_name); } else { printf("\n*************** Finishing PHASE %s\n", m_name); } if (doPostPhase) { printf("Trees after %s\n", m_name); comp->fgDispBasicBlocks(true); } #if DUMP_FLOWGRAPHS comp->fgDumpFlowGraph(m_phase); #endif // DUMP_FLOWGRAPHS } if (doPostPhase) { if (comp->activePhaseChecks == PhaseChecks::CHECK_ALL) { comp->fgDebugCheckBBlist(); comp->fgDebugCheckLinks(); comp->fgDebugCheckNodesUniqueness(); } } #endif // DEBUG comp->EndPhase(m_phase); }
/************************************************************** * * 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. * *************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" #include "clipboarddispatcher.hxx" #include <editeng/editview.hxx> /** === begin UNO includes === **/ #include <com/sun/star/lang/DisposedException.hpp> /** === end UNO includes === **/ #include <svtools/cliplistener.hxx> #include <svtools/transfer.hxx> //........................................................................ namespace frm { //........................................................................ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::util; using namespace ::com::sun::star::beans; //==================================================================== namespace { static URL createClipboardURL( OClipboardDispatcher::ClipboardFunc _eFunc ) { URL aURL; switch ( _eFunc ) { case OClipboardDispatcher::eCut: aURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Cut" ) ); break; case OClipboardDispatcher::eCopy: aURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Copy" ) ); break; case OClipboardDispatcher::ePaste: aURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Paste" ) ); break; } return aURL; } } //==================================================================== //= OClipboardDispatcher //==================================================================== //-------------------------------------------------------------------- OClipboardDispatcher::OClipboardDispatcher( EditView& _rView, ClipboardFunc _eFunc ) :ORichTextFeatureDispatcher( _rView, createClipboardURL( _eFunc ) ) ,m_eFunc( _eFunc ) ,m_bLastKnownEnabled( sal_True ) { } //-------------------------------------------------------------------- sal_Bool OClipboardDispatcher::implIsEnabled( ) const { sal_Bool bEnabled = sal_False; switch ( m_eFunc ) { case eCut: bEnabled = !getEditView()->IsReadOnly() && getEditView()->HasSelection(); break; case eCopy: bEnabled = getEditView()->HasSelection(); break; case ePaste: bEnabled = !getEditView()->IsReadOnly(); break; } return bEnabled; } //-------------------------------------------------------------------- FeatureStateEvent OClipboardDispatcher::buildStatusEvent() const { FeatureStateEvent aEvent( ORichTextFeatureDispatcher::buildStatusEvent() ); aEvent.IsEnabled = implIsEnabled(); return aEvent; } //-------------------------------------------------------------------- void OClipboardDispatcher::invalidateFeatureState_Broadcast() { sal_Bool bEnabled = implIsEnabled(); if ( m_bLastKnownEnabled == bEnabled ) // nothing changed -> no notification return; m_bLastKnownEnabled = bEnabled; ORichTextFeatureDispatcher::invalidateFeatureState_Broadcast(); } //-------------------------------------------------------------------- void SAL_CALL OClipboardDispatcher::dispatch( const URL& /*_rURL*/, const Sequence< PropertyValue >& /*Arguments*/ ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); if ( !getEditView() ) throw DisposedException(); switch ( m_eFunc ) { case eCut: getEditView()->Cut(); break; case eCopy: getEditView()->Copy(); break; case ePaste: getEditView()->Paste(); break; } } //==================================================================== //= OPasteClipboardDispatcher //==================================================================== //-------------------------------------------------------------------- OPasteClipboardDispatcher::OPasteClipboardDispatcher( EditView& _rView ) :OClipboardDispatcher( _rView, ePaste ) ,m_pClipListener( NULL ) ,m_bPastePossible( sal_False ) { m_pClipListener = new TransferableClipboardListener( LINK( this, OPasteClipboardDispatcher, OnClipboardChanged ) ); m_pClipListener->acquire(); m_pClipListener->AddRemoveListener( _rView.GetWindow(), sal_True ); // initial state TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( _rView.GetWindow() ) ); m_bPastePossible = ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) || aDataHelper.HasFormat( SOT_FORMAT_RTF ) ); } //-------------------------------------------------------------------- OPasteClipboardDispatcher::~OPasteClipboardDispatcher() { if ( !isDisposed() ) { acquire(); dispose(); } } //-------------------------------------------------------------------- IMPL_LINK( OPasteClipboardDispatcher, OnClipboardChanged, TransferableDataHelper*, _pDataHelper ) { OSL_ENSURE( _pDataHelper, "OPasteClipboardDispatcher::OnClipboardChanged: ooops!" ); m_bPastePossible = _pDataHelper->HasFormat( SOT_FORMAT_STRING ) || _pDataHelper->HasFormat( SOT_FORMAT_RTF ); invalidate(); return 0L; } //-------------------------------------------------------------------- void OPasteClipboardDispatcher::disposing( ::osl::ClearableMutexGuard& _rClearBeforeNotify ) { OSL_ENSURE( getEditView() && getEditView()->GetWindow(), "OPasteClipboardDispatcher::disposing: EditView should not (yet) be disfunctional here!" ); if ( getEditView() && getEditView()->GetWindow() && m_pClipListener ) m_pClipListener->AddRemoveListener( getEditView()->GetWindow(), sal_False ); m_pClipListener->release(); m_pClipListener = NULL; OClipboardDispatcher::disposing( _rClearBeforeNotify ); } //-------------------------------------------------------------------- sal_Bool OPasteClipboardDispatcher::implIsEnabled( ) const { return m_bPastePossible && OClipboardDispatcher::implIsEnabled(); } //........................................................................ } // namespace frm //........................................................................
/*******************************<GINKGO LICENSE>****************************** Copyright (c) 2017-2020, the Ginkgo authors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************<GINKGO LICENSE>*******************************/ #include <ginkgo/core/solver/cgs.hpp> #include <random> #include <gtest/gtest.h> #include <ginkgo/core/base/exception.hpp> #include <ginkgo/core/base/executor.hpp> #include <ginkgo/core/matrix/dense.hpp> #include <ginkgo/core/stop/combined.hpp> #include <ginkgo/core/stop/iteration.hpp> #include <ginkgo/core/stop/residual_norm.hpp> #include "core/solver/cgs_kernels.hpp" #include "hip/test/utils.hip.hpp" namespace { class Cgs : public ::testing::Test { protected: using Mtx = gko::matrix::Dense<>; using Solver = gko::solver::Cgs<>; Cgs() : rand_engine(30) {} void SetUp() { ASSERT_GT(gko::HipExecutor::get_num_devices(), 0); ref = gko::ReferenceExecutor::create(); hip = gko::HipExecutor::create(0, ref); mtx = gen_mtx(123, 123); make_diag_dominant(mtx.get()); d_mtx = Mtx::create(hip); d_mtx->copy_from(mtx.get()); hip_cgs_factory = Solver::build() .with_criteria( gko::stop::Iteration::build().with_max_iters(246u).on(hip), gko::stop::ResidualNormReduction<>::build() .with_reduction_factor(1e-15) .on(hip)) .on(hip); ref_cgs_factory = Solver::build() .with_criteria( gko::stop::Iteration::build().with_max_iters(246u).on(ref), gko::stop::ResidualNormReduction<>::build() .with_reduction_factor(1e-15) .on(ref)) .on(ref); } void TearDown() { if (hip != nullptr) { ASSERT_NO_THROW(hip->synchronize()); } } std::unique_ptr<Mtx> gen_mtx(int num_rows, int num_cols) { return gko::test::generate_random_matrix<Mtx>( num_rows, num_cols, std::uniform_int_distribution<>(num_cols, num_cols), std::normal_distribution<>(0.0, 1.0), rand_engine, ref); } void initialize_data() { int m = 597; int n = 43; b = gen_mtx(m, n); r = gen_mtx(m, n); r_tld = gen_mtx(m, n); p = gen_mtx(m, n); q = gen_mtx(m, n); u = gen_mtx(m, n); u_hat = gen_mtx(m, n); v_hat = gen_mtx(m, n); t = gen_mtx(m, n); x = gen_mtx(m, n); alpha = gen_mtx(1, n); beta = gen_mtx(1, n); gamma = gen_mtx(1, n); rho = gen_mtx(1, n); rho_prev = gen_mtx(1, n); stop_status = std::unique_ptr<gko::Array<gko::stopping_status>>( new gko::Array<gko::stopping_status>(ref, n)); for (size_t i = 0; i < stop_status->get_num_elems(); ++i) { stop_status->get_data()[i].reset(); } d_b = Mtx::create(hip); d_b->copy_from(b.get()); d_r = Mtx::create(hip); d_r->copy_from(r.get()); d_r_tld = Mtx::create(hip); d_r_tld->copy_from(r_tld.get()); d_p = Mtx::create(hip); d_p->copy_from(p.get()); d_q = Mtx::create(hip); d_q->copy_from(q.get()); d_u = Mtx::create(hip); d_u->copy_from(u.get()); d_u_hat = Mtx::create(hip); d_u_hat->copy_from(u_hat.get()); d_v_hat = Mtx::create(hip); d_v_hat->copy_from(v_hat.get()); d_t = Mtx::create(hip); d_t->copy_from(t.get()); d_x = Mtx::create(hip); d_x->copy_from(x.get()); d_alpha = Mtx::create(hip); d_alpha->copy_from(alpha.get()); d_beta = Mtx::create(hip); d_beta->copy_from(beta.get()); d_gamma = Mtx::create(hip); d_gamma->copy_from(gamma.get()); d_rho_prev = Mtx::create(hip); d_rho_prev->copy_from(rho_prev.get()); d_rho = Mtx::create(hip); d_rho->copy_from(rho.get()); d_stop_status = std::unique_ptr<gko::Array<gko::stopping_status>>( new gko::Array<gko::stopping_status>(hip, n)); // because there is no public function copy_from, use overloaded = // operator *d_stop_status = *stop_status; } void make_diag_dominant(Mtx *mtx) { using std::abs; for (int i = 0; i < mtx->get_size()[0]; ++i) { auto sum = gko::zero<Mtx::value_type>(); for (int j = 0; j < mtx->get_size()[1]; ++j) { sum += abs(mtx->at(i, j)); } mtx->at(i, i) = sum; } } std::shared_ptr<gko::ReferenceExecutor> ref; std::shared_ptr<const gko::HipExecutor> hip; std::ranlux48 rand_engine; std::shared_ptr<Mtx> mtx; std::shared_ptr<Mtx> d_mtx; std::unique_ptr<Solver::Factory> hip_cgs_factory; std::unique_ptr<Solver::Factory> ref_cgs_factory; std::unique_ptr<Mtx> b; std::unique_ptr<Mtx> r; std::unique_ptr<Mtx> r_tld; std::unique_ptr<Mtx> t; std::unique_ptr<Mtx> p; std::unique_ptr<Mtx> q; std::unique_ptr<Mtx> u; std::unique_ptr<Mtx> u_hat; std::unique_ptr<Mtx> v_hat; std::unique_ptr<Mtx> x; std::unique_ptr<Mtx> alpha; std::unique_ptr<Mtx> beta; std::unique_ptr<Mtx> gamma; std::unique_ptr<Mtx> rho; std::unique_ptr<Mtx> rho_prev; std::unique_ptr<gko::Array<gko::stopping_status>> stop_status; std::unique_ptr<Mtx> d_b; std::unique_ptr<Mtx> d_r; std::unique_ptr<Mtx> d_r_tld; std::unique_ptr<Mtx> d_t; std::unique_ptr<Mtx> d_p; std::unique_ptr<Mtx> d_q; std::unique_ptr<Mtx> d_u; std::unique_ptr<Mtx> d_u_hat; std::unique_ptr<Mtx> d_v_hat; std::unique_ptr<Mtx> d_x; std::unique_ptr<Mtx> d_alpha; std::unique_ptr<Mtx> d_beta; std::unique_ptr<Mtx> d_gamma; std::unique_ptr<Mtx> d_rho; std::unique_ptr<Mtx> d_rho_prev; std::unique_ptr<gko::Array<gko::stopping_status>> d_stop_status; }; TEST_F(Cgs, HipCgsInitializeIsEquivalentToRef) { initialize_data(); gko::kernels::reference::cgs::initialize( ref, b.get(), r.get(), r_tld.get(), p.get(), q.get(), u.get(), u_hat.get(), v_hat.get(), t.get(), alpha.get(), beta.get(), gamma.get(), rho_prev.get(), rho.get(), stop_status.get()); gko::kernels::hip::cgs::initialize( hip, d_b.get(), d_r.get(), d_r_tld.get(), d_p.get(), d_q.get(), d_u.get(), d_u_hat.get(), d_v_hat.get(), d_t.get(), d_alpha.get(), d_beta.get(), d_gamma.get(), d_rho_prev.get(), d_rho.get(), d_stop_status.get()); GKO_ASSERT_MTX_NEAR(d_r, r, 1e-14); GKO_ASSERT_MTX_NEAR(d_r_tld, r_tld, 1e-14); GKO_ASSERT_MTX_NEAR(d_p, p, 1e-14); GKO_ASSERT_MTX_NEAR(d_q, q, 1e-14); GKO_ASSERT_MTX_NEAR(d_u, u, 1e-14); GKO_ASSERT_MTX_NEAR(d_t, t, 1e-14); GKO_ASSERT_MTX_NEAR(d_u_hat, u_hat, 1e-14); GKO_ASSERT_MTX_NEAR(d_v_hat, v_hat, 1e-14); GKO_ASSERT_MTX_NEAR(d_rho_prev, rho_prev, 1e-14); GKO_ASSERT_MTX_NEAR(d_rho, rho, 1e-14); GKO_ASSERT_MTX_NEAR(d_alpha, alpha, 1e-14); GKO_ASSERT_MTX_NEAR(d_beta, beta, 1e-14); GKO_ASSERT_MTX_NEAR(d_gamma, gamma, 1e-14); GKO_ASSERT_ARRAY_EQ(*d_stop_status, *stop_status); } TEST_F(Cgs, HipCgsStep1IsEquivalentToRef) { initialize_data(); gko::kernels::reference::cgs::step_1(ref, r.get(), u.get(), p.get(), q.get(), beta.get(), rho.get(), rho_prev.get(), stop_status.get()); gko::kernels::hip::cgs::step_1(hip, d_r.get(), d_u.get(), d_p.get(), d_q.get(), d_beta.get(), d_rho.get(), d_rho_prev.get(), d_stop_status.get()); GKO_ASSERT_MTX_NEAR(d_beta, beta, 1e-14); GKO_ASSERT_MTX_NEAR(d_u, u, 1e-14); GKO_ASSERT_MTX_NEAR(d_p, p, 1e-14); } TEST_F(Cgs, HipCgsStep2IsEquivalentToRef) { initialize_data(); gko::kernels::reference::cgs::step_2(ref, u.get(), v_hat.get(), q.get(), t.get(), alpha.get(), rho.get(), gamma.get(), stop_status.get()); gko::kernels::hip::cgs::step_2(hip, d_u.get(), d_v_hat.get(), d_q.get(), d_t.get(), d_alpha.get(), d_rho.get(), d_gamma.get(), d_stop_status.get()); GKO_ASSERT_MTX_NEAR(d_alpha, alpha, 1e-14); GKO_ASSERT_MTX_NEAR(d_t, t, 1e-14); GKO_ASSERT_MTX_NEAR(d_q, q, 1e-14); } TEST_F(Cgs, HipCgsStep3IsEquivalentToRef) { initialize_data(); gko::kernels::reference::cgs::step_3(ref, t.get(), u_hat.get(), r.get(), x.get(), alpha.get(), stop_status.get()); gko::kernels::hip::cgs::step_3(hip, d_t.get(), d_u_hat.get(), d_r.get(), d_x.get(), d_alpha.get(), d_stop_status.get()); GKO_ASSERT_MTX_NEAR(d_x, x, 1e-14); GKO_ASSERT_MTX_NEAR(d_r, r, 1e-14); } TEST_F(Cgs, HipCgsApplyOneRHSIsEquivalentToRef) { int m = 123; int n = 1; auto ref_solver = ref_cgs_factory->generate(mtx); auto hip_solver = hip_cgs_factory->generate(d_mtx); auto b = gen_mtx(m, n); auto x = gen_mtx(m, n); auto d_b = Mtx::create(hip); auto d_x = Mtx::create(hip); d_b->copy_from(b.get()); d_x->copy_from(x.get()); ref_solver->apply(b.get(), x.get()); hip_solver->apply(d_b.get(), d_x.get()); GKO_ASSERT_MTX_NEAR(d_b, b, 1e-13); GKO_ASSERT_MTX_NEAR(d_x, x, 1e-13); } TEST_F(Cgs, HipCgsApplyMultipleRHSIsEquivalentToRef) { int m = 123; int n = 16; auto hip_solver = hip_cgs_factory->generate(d_mtx); auto ref_solver = ref_cgs_factory->generate(mtx); auto b = gen_mtx(m, n); auto x = gen_mtx(m, n); auto d_b = Mtx::create(hip); auto d_x = Mtx::create(hip); d_b->copy_from(b.get()); d_x->copy_from(x.get()); ref_solver->apply(b.get(), x.get()); hip_solver->apply(d_b.get(), d_x.get()); GKO_ASSERT_MTX_NEAR(d_b, b, 1e-13); GKO_ASSERT_MTX_NEAR(d_x, x, 1e-13); } } // namespace
#include "bus/math_copro.h" #include <gtest/gtest.h> #include "cpu.h" class MathCoprocessorTest : public ::testing::Test { protected: void SetUp() override { bus.SetIo( [this](uint32_t addr) -> uint8_t { return copro.ReadByte(addr); }, [this](uint32_t addr, uint8_t val) { copro.StoreByte(addr, val); }, 0, 0); } SimpleSystemBus<16> bus; MathCoprocessor copro; }; TEST_F(MathCoprocessorTest, TestM0) { bus.PokeU16LE(M0_OPERAND_A, 12345); bus.PokeU16LE(M0_OPERAND_B, 22225); EXPECT_EQ(bus.PeekU32LE(M0_RESULT), 12345 * 22225); } TEST_F(MathCoprocessorTest, TestM1) { bus.PokeU16LE(M1_OPERAND_A, 12345); bus.PokeU16LE(M1_OPERAND_B, -22222); EXPECT_EQ((int32_t)bus.PeekU32LE(M1_RESULT), 12345 * -22222); } TEST_F(MathCoprocessorTest, TestD0) { bus.PokeU16LE(D0_OPERAND_A, 22222); bus.PokeU16LE(D0_OPERAND_B, 12345); EXPECT_EQ(bus.PeekU16LE(D0_RESULT), 22222/ 12345); EXPECT_EQ(bus.PeekU16LE(D0_REMAINDER), 22222 % 12345); } TEST_F(MathCoprocessorTest, TestD1) { bus.PokeU16LE(D1_OPERAND_A, 22222); bus.PokeU16LE(D1_OPERAND_B, -12345); EXPECT_EQ(bus.PeekU16LE(D1_RESULT), (uint16_t)(22222 / -12345)); EXPECT_EQ(bus.PeekU16LE(D1_REMAINDER), (uint16_t)(22222 % -12345)); } TEST_F(MathCoprocessorTest, TestAdd32) { bus.PokeU32LE(ADDER32_OPERAND_A, 222222); bus.PokeU32LE(ADDER32_OPERAND_B, -422222); EXPECT_EQ((int32_t)bus.PeekU32LE(ADDER32_RESULT), 222222 + -422222); } // TODO: Store 32 bit
/* Copyright (c) 2019, Lawrence Livermore National Security, LLC; See the top-level NOTICE for additional details. All rights reserved. SPDX-License-Identifier: BSD-3-Clause */ #include "test.hpp" #include "units/units.hpp" using namespace units; TEST(logUnits, nonEquality) { auto u1 = precise::log::bel; EXPECT_FALSE(u1 == precise::log::dB); EXPECT_FALSE(u1 == precise::log::neglog10); EXPECT_FALSE(u1 == precise::log::logbase2); EXPECT_FALSE(u1 == precise::log::neglog100); EXPECT_FALSE(u1 == precise::log::neglog1000); EXPECT_FALSE(u1 == precise::log::neglog50000); EXPECT_FALSE(u1 == precise::log::neper); EXPECT_FALSE(precise::log::dB == precise::log::neglog10); EXPECT_FALSE(precise::log::dB == precise::log::logbase2); EXPECT_FALSE(precise::log::dB == precise::log::neglog100); EXPECT_FALSE(precise::log::dB == precise::log::neglog1000); EXPECT_FALSE(precise::log::dB == precise::log::neglog50000); EXPECT_FALSE(precise::log::dB == precise::log::neper); EXPECT_FALSE(precise::log::neglog10 == precise::log::logbase2); EXPECT_FALSE(precise::log::neglog10 == precise::log::neglog100); EXPECT_FALSE(precise::log::neglog10 == precise::log::neglog1000); EXPECT_FALSE(precise::log::neglog10 == precise::log::neglog50000); EXPECT_FALSE(precise::log::neglog10 == precise::log::neper); EXPECT_FALSE(precise::log::logbase2 == precise::log::neglog100); EXPECT_FALSE(precise::log::logbase2 == precise::log::neglog1000); EXPECT_FALSE(precise::log::logbase2 == precise::log::neglog50000); EXPECT_FALSE(precise::log::logbase2 == precise::log::neper); EXPECT_FALSE(precise::log::neglog100 == precise::log::neglog1000); EXPECT_FALSE(precise::log::neglog100 == precise::log::neglog50000); EXPECT_FALSE(precise::log::neglog100 == precise::log::neper); EXPECT_FALSE(precise::log::neglog1000 == precise::log::neglog50000); EXPECT_FALSE(precise::log::neglog1000 == precise::log::neper); EXPECT_FALSE(precise::log::neper == precise::log::neglog50000); } TEST(logUnits, base10) { EXPECT_EQ(convert(precise::ten, precise::log::bel), 2.0); EXPECT_EQ(convert(precise::kilo, precise::log::bel), 6.0); EXPECT_EQ(convert(precise::milli, precise::log::bel), -6.0); EXPECT_EQ(convert(precise::exa, precise::log::bel), 36.0); EXPECT_EQ(convert(precise::femto, precise::log::bel), -30.0); EXPECT_EQ(convert(2.0, precise::log::bel, precise::ten), 1.0); EXPECT_EQ(convert(6.0, precise::log::bel, precise::kilo), 1.0); EXPECT_DOUBLE_EQ(convert(-6.0, precise::log::bel, precise::milli), 1.0); EXPECT_DOUBLE_EQ(convert(-6.0, precise::log::belA, precise::milli), 1.0); EXPECT_DOUBLE_EQ(convert(-3.0, precise::log::belP, precise::milli), 1.0); EXPECT_DOUBLE_EQ(convert(36.0, precise::log::bel, precise::exa), 1.0); EXPECT_NEAR(convert(-30.0, precise::log::bel, precise::femto), 1.0, test::precise_tolerance); EXPECT_EQ(convert(precise::ten, precise::log::belP), 1.0); EXPECT_EQ(convert(precise::ten, precise::log::belA), 2.0); EXPECT_EQ(convert(precise::kilo, precise::log::belP), 3.0); EXPECT_EQ(convert(precise::milli, precise::log::belP), -3.0); EXPECT_EQ(convert(precise::exa, precise::log::belP), 18.0); EXPECT_EQ(convert(precise::femto, precise::log::belP), -15.0); EXPECT_EQ(convert(1.0, precise::log::belP, precise::ten), 1.0); EXPECT_EQ(convert(3.0, precise::log::belP, precise::kilo), 1.0); EXPECT_DOUBLE_EQ(convert(-3.0, precise::log::belP, precise::milli), 1.0); EXPECT_DOUBLE_EQ(convert(18.0, precise::log::belP, precise::exa), 1.0); EXPECT_NEAR(convert(-15.0, precise::log::belP, precise::femto), 1.0, test::precise_tolerance); } TEST(logUnits, negbase10) { EXPECT_EQ(convert(precise::ten, precise::log::neglog10), -1.0); EXPECT_EQ(convert(precise::kilo, precise::log::neglog10), -3.0); EXPECT_EQ(convert(precise::milli, precise::log::neglog10), 3.0); EXPECT_EQ(convert(precise::exa, precise::log::neglog10), -18.0); EXPECT_EQ(convert(precise::femto, precise::log::neglog10), 15.0); EXPECT_EQ(convert(-1.0, precise::log::neglog10, precise::ten), 1.0); EXPECT_EQ(convert(-3.0, precise::log::neglog10, precise::kilo), 1.0); EXPECT_DOUBLE_EQ(convert(3.0, precise::log::neglog10, precise::milli), 1.0); EXPECT_DOUBLE_EQ(convert(-18.0, precise::log::neglog10, precise::exa), 1.0); EXPECT_NEAR( convert(15.0, precise::log::neglog10, precise::femto), 1.0, test::precise_tolerance); } TEST(logUnits, dB) { EXPECT_EQ(convert(precise::ten, precise::log::dB), 20.0); EXPECT_EQ(convert(precise::ten, precise::log::dBA), 20.0); EXPECT_EQ(convert(precise::ten, precise::log::dBP), 10.0); EXPECT_EQ(convert(precise::kilo, precise::log::dB), 60.0); EXPECT_EQ(convert(precise::milli, precise::log::dB), -60.0); EXPECT_EQ(convert(precise::exa, precise::log::dB), 360.0); EXPECT_EQ(convert(precise::femto, precise::log::dB), -300.0); EXPECT_EQ(convert(20.0, precise::log::dB, precise::ten), 1.0); EXPECT_EQ(convert(60.0, precise::log::dB, precise::kilo), 1.0); EXPECT_EQ(convert(20.0, precise::log::dBA, precise::ten), 1.0); EXPECT_EQ(convert(60.0, precise::log::dBA, precise::kilo), 1.0); EXPECT_EQ(convert(10.0, precise::log::dBP, precise::ten), 1.0); EXPECT_EQ(convert(30.0, precise::log::dBP, precise::kilo), 1.0); EXPECT_DOUBLE_EQ(convert(-60.0, precise::log::dB, precise::milli), 1.0); EXPECT_DOUBLE_EQ(convert(360.0, precise::log::dB, precise::exa), 1.0); EXPECT_NEAR(convert(-300.0, precise::log::dB, precise::femto), 1.0, test::precise_tolerance); } TEST(logUnits, negbase100) { EXPECT_DOUBLE_EQ(convert(precise::hundred, precise::log::neglog100), -1.0); EXPECT_DOUBLE_EQ(convert(precise::mega, precise::log::neglog100), -3.0); EXPECT_DOUBLE_EQ(convert(precise::micro, precise::log::neglog100), 3.0); EXPECT_DOUBLE_EQ(convert(precise::exa, precise::log::neglog100), -9.0); EXPECT_DOUBLE_EQ(convert(precise::atto, precise::log::neglog100), 9.0); EXPECT_DOUBLE_EQ(convert(-1.0, precise::log::neglog100, precise::hundred), 1.0); EXPECT_DOUBLE_EQ(convert(-3.0, precise::log::neglog100, precise::mega), 1.0); EXPECT_DOUBLE_EQ(convert(3.0, precise::log::neglog100, precise::micro), 1.0); EXPECT_DOUBLE_EQ(convert(-9.0, precise::log::neglog100, precise::exa), 1.0); EXPECT_DOUBLE_EQ(convert(6.0, precise::log::neglog100, precise::pico), 1.0); } TEST(logUnits, negbase1000) { EXPECT_EQ(convert(precise::kilo, precise::log::neglog1000), -1.0); EXPECT_EQ(convert(precise::milli, precise::log::neglog1000), 1.0); EXPECT_EQ(convert(precise::exa, precise::log::neglog1000), -6.0); EXPECT_EQ(convert(precise::femto, precise::log::neglog1000), 5.0); EXPECT_EQ(convert(-1.0, precise::log::neglog1000, precise::kilo), 1.0); EXPECT_EQ(convert(1.0, precise::log::neglog1000, precise::milli), 1.0); EXPECT_EQ(convert(-6.0, precise::log::neglog1000, precise::exa), 1.0); EXPECT_EQ(convert(5.0, precise::log::neglog1000, precise::femto), 1.0); } TEST(logUnits, negbase50000) { EXPECT_EQ(convert(50000.0, precise::one, precise::log::neglog50000), -1.0); EXPECT_EQ(convert(50000.0 * 50000.0, precise::one, precise::log::neglog50000), -2.0); EXPECT_EQ(convert(1.0 / 50000.0, precise::one, precise::log::neglog50000), 1.0); EXPECT_EQ(convert(1.0 / (50000.0 * 50000.0), precise::one, precise::log::neglog50000), 2.0); EXPECT_EQ(convert(-1.0, precise::log::neglog50000, precise::one), 50000.0); EXPECT_EQ(convert(1.0, precise::log::neglog50000, precise::one), 1.0 / 50000.0); EXPECT_EQ(convert(-2.0, precise::log::neglog50000, precise::one), (50000.0 * 50000.0)); EXPECT_DOUBLE_EQ( convert(2.0, precise::log::neglog50000, precise::one), 1.0 / (50000.0 * 50000.0)); } TEST(logUnits, neper) { EXPECT_EQ(convert(exp(1.0), precise::one, precise::log::neper), 1.0); EXPECT_EQ(convert(exp(3.0), precise::one, precise::log::neper), 3.0); EXPECT_EQ(convert(exp(-1.0), precise::one, precise::log::neper), -1.0); EXPECT_EQ(convert(exp(-3.65), precise::one, precise::log::neper), -3.65); EXPECT_EQ(convert(1.0, precise::log::neper, precise::one), exp(1)); EXPECT_EQ(convert(-3.685, precise::log::neper, precise::one), exp(-3.685)); EXPECT_EQ(convert(-2.0, precise::log::neper, precise::one), exp(-2)); EXPECT_EQ(convert(2.0, precise::log::neper, precise::one), exp(2)); EXPECT_EQ(convert(exp(1.0), precise::one, precise::log::neperA), 1.0); EXPECT_EQ(convert(exp(3.0), precise::one, precise::log::neperA), 3.0); EXPECT_EQ(convert(exp(-1.0), precise::one, precise::log::neperA), -1.0); EXPECT_EQ(convert(exp(-3.65), precise::one, precise::log::neperA), -3.65); EXPECT_EQ(convert(1.0, precise::log::neperA, precise::one), exp(1)); EXPECT_EQ(convert(-3.685, precise::log::neperA, precise::one), exp(-3.685)); EXPECT_EQ(convert(-2.0, precise::log::neperA, precise::one), exp(-2)); EXPECT_EQ(convert(2.0, precise::log::neperA, precise::one), exp(2)); } TEST(logUnits, log2) { EXPECT_EQ(convert(4, precise::one, precise::log::logbase2), 2.0); EXPECT_EQ(convert(1024, precise::one, precise::log::logbase2), 10.0); EXPECT_EQ(convert(0.5, precise::one, precise::log::logbase2), -1.0); EXPECT_EQ(convert(1.0 / pow(2.0, 30), precise::one, precise::log::logbase2), -30); EXPECT_EQ(convert(2.0, precise::log::logbase2, precise::one), 4.0); EXPECT_EQ(convert(10, precise::log::logbase2, precise::one), 1024.0); EXPECT_EQ(convert(-2.0, precise::log::logbase2, precise::one), 0.25); EXPECT_EQ(convert(-40.0, precise::log::logbase2, precise::one), 1.0 / pow(2.0, 40)); } TEST(logUnits, dBNeperConversions) { EXPECT_EQ(convert(1.0, precise::log::bel, precise::log::dB), 10.0); EXPECT_NEAR( convert(1.0, precise::log::bel, precise::log::neper), 1.1512925465, test::tolerance); EXPECT_NEAR( convert(10.0, precise::log::dB, precise::log::neper), 1.1512925465, test::tolerance); EXPECT_NEAR( convert(10.0, precise::log::dB * precise::V, precise::log::neper * precise::V), 1.1512925465, test::tolerance); EXPECT_NEAR( convert(10.0, precise::log::dB * precise::W, precise::log::neper * precise::W), 1.1512925465, test::tolerance); EXPECT_NEAR( convert(10.0, precise::log::dB * precise::V, precise::log::neperA * precise::V), 1.1512925465, test::tolerance); EXPECT_NEAR( convert(10.0, precise::log::dB * precise::W, precise::log::neperP * precise::W), 1.1512925465, test::tolerance); EXPECT_NEAR( convert(1.1512925465, precise::log::neper * precise::V, precise::log::dB * precise::V), 10.0, test::tolerance); EXPECT_NEAR( convert(1.1512925465, precise::log::neper * precise::W, precise::log::dB * precise::W), 10.0, test::tolerance); EXPECT_NEAR( convert(1.1512925465, precise::log::neperA * precise::V, precise::log::dB * precise::V), 10.0, test::tolerance); EXPECT_NEAR( convert(1.1512925465, precise::log::neperP * precise::W, precise::log::dB * precise::W), 10.0, test::tolerance); EXPECT_EQ(convert(10.0, precise::log::bel, precise::log::dB), 100.0); EXPECT_NEAR( convert(10.0, precise::log::bel, precise::log::neper), 11.512925465, test::tolerance); EXPECT_NEAR( convert(100.0, precise::log::dB, precise::log::neper), 11.512925465, test::tolerance); EXPECT_NEAR(convert(2.0, precise::log::dB, precise::log::neper), 0.2302585093, test::tolerance); EXPECT_NEAR( convert(5.0, precise::log::neper, precise::log::dB), 43.4294481903, test::tolerance); EXPECT_NEAR(convert(5.0, precise::log::neper, precise::log::bel), 4.342944819, test::tolerance); } TEST(logUnits, pH) { EXPECT_NEAR( convert(0.0025, precise::laboratory::molarity, precise::laboratory::pH), 2.6, 0.005); EXPECT_NEAR( convert(8.34, precise::laboratory::pH, precise::laboratory::molarity), 4.57e-9, 0.005); EXPECT_NEAR( convert(4.82e-5, precise::laboratory::molarity, precise::laboratory::pH), 4.32, 0.005); } TEST(logUnits, general) { double res = convert(20.0, precise::log::dBA * precise::m / precise::s, precise::m / precise::s); EXPECT_DOUBLE_EQ(res, 10.0); res = convert(100.0, precise::m / precise::s, precise::log::dBA * precise::m / precise::s); EXPECT_DOUBLE_EQ(res, 40.0); res = convert(10.0, precise::log::dBP * precise::km / precise::hr, precise::m / precise::s); EXPECT_DOUBLE_EQ(res, 10000.0 / 3600.0); res = convert( 100000.0 / 3600.0, precise::m / precise::s, precise::log::dBP * precise::km / precise::hr); EXPECT_DOUBLE_EQ(res, 20.0); } TEST(logUnits, error) { EXPECT_TRUE(std::isnan(convert(-20.0, precise::one, precise::log::bel))); EXPECT_TRUE(std::isnan(convert(20.0, precise::log::dBA * precise::m / precise::s, precise::m))); } TEST(otherUnits, prism_diopter) { EXPECT_NEAR(convert(1, precise::deg, precise::clinical::prism_diopter), 1.75, 0.005); EXPECT_NEAR(convert(1.75, precise::clinical::prism_diopter, precise::deg), 1.0, 0.005); } TEST(otherUnits, saffirSimpson) { EXPECT_EQ(std::floor(convert(44.0, precise::m / precise::s, precise::special::sshws)), 2.0); EXPECT_EQ(std::floor(convert(77.0, precise::mph, precise::special::sshws)), 1.0); EXPECT_EQ(std::floor(convert(268.0, precise::km / precise::hr, precise::special::sshws)), 5.0); EXPECT_EQ(std::floor(convert(116.0, precise::nautical::knot, precise::special::sshws)), 4.0); EXPECT_EQ(std::floor(convert(44.0, precise::mph, precise::special::sshws)), 0.0); EXPECT_EQ(std::floor(convert(56.0, precise::m / precise::s, precise::special::sshws)), 3.0); } TEST(otherUnits, saffirSimpson2Speed) { EXPECT_NEAR(convert(3.0, precise::special::sshws, precise::m / precise::s), 50.0, 1.0); EXPECT_NEAR(convert(2.0, precise::special::sshws, precise::mph), 96.0, 1.0); EXPECT_NEAR(convert(1.0, precise::special::sshws, precise::km / precise::hr), 119.0, 1.0); EXPECT_NEAR(convert(5.0, precise::special::sshws, precise::nautical::knot), 135.0, 1.0); EXPECT_NEAR(convert(0.5, precise::special::sshws, precise::m / precise::s), 26.0, 1.0); EXPECT_NEAR(convert(0.0, precise::special::sshws, precise::mph), 39.0, 1.0); } class beaufort : public ::testing::TestWithParam<std::pair<double, double>> { }; TEST_P(beaufort, beaufortTests) { auto p = GetParam(); auto bnumber = p.first; auto wspeed = p.second; auto conv = convert(wspeed, precise::mph, precise::special::beaufort); EXPECT_EQ(std::round(conv), std::floor(bnumber)); EXPECT_NEAR(convert(conv, precise::special::beaufort, precise::mph), wspeed, 0.5); } static const std::vector<std::pair<double, double>> testBValues{ {0.0, 0.0}, {1.5, 2.0}, {2.0, 4.0}, {3.0, 8.0}, {4.0, 13.0}, {5.0, 19.0}, {6.0, 25.0}, {7.0, 32.0}, {8.0, 39.0}, {9.0, 47.0}, {10.0, 55.0}, {11.0, 64.0}, {12.0, 73.0}, }; INSTANTIATE_TEST_SUITE_P(beaufortConversionTests, beaufort, ::testing::ValuesIn(testBValues)); TEST(otherUnits, saffirSimpson2Sbeaufort) { EXPECT_NEAR(convert(12.1, precise::special::beaufort, precise::special::sshws), 1.05, 0.05); EXPECT_NEAR( convert(0.0, precise::special::sshws, precise::special::beaufort), 8.0, 0.05); // tropical storm } class fujita : public ::testing::TestWithParam<std::pair<double, double>> { }; TEST_P(fujita, fujitaTests) { auto p = GetParam(); auto fnumber = p.first; auto wspeed = p.second; auto conv = convert(wspeed, precise::mph, precise::special::fujita); EXPECT_EQ(std::round(conv), std::floor(fnumber)); EXPECT_NEAR(convert(conv, precise::special::fujita, precise::mph), wspeed, 0.5); } static const std::vector<std::pair<double, double>> testFValues{ {0.0, 40.0}, {1.0, 73.0}, {2.0, 113}, {3.0, 158.0}, {4.0, 207.0}, {5.0, 261}, }; INSTANTIATE_TEST_SUITE_P(fujitaConversionTests, fujita, ::testing::ValuesIn(testFValues)); TEST(otherUnits, saffirSimpson2Sfujita) { EXPECT_NEAR(convert(1.0, precise::special::fujita, precise::special::sshws), 1.00, 0.05); EXPECT_NEAR(convert(1.0, precise::special::sshws, precise::special::fujita), 1.0, 0.05); } TEST(otherUnits, trits) { EXPECT_NEAR(convert(1.0, precise::data::trit, precise::data::bit_s), 1.58496, 0.00001); EXPECT_NEAR(convert(6.0, precise::data::trit, precise::data::bit_s), 9.5, 0.01); EXPECT_NEAR(convert(20.19, precise::data::trit, precise::data::bit_s), 32.0, 0.01); EXPECT_NEAR(convert(40.38, precise::data::trit, precise::data::digits), 19.27, 0.01); EXPECT_NEAR(convert(1.58496, precise::data::bit_s, precise::data::trit), 1.0, 0.00001); EXPECT_NEAR(convert(9.5, precise::data::bit_s, precise::data::trit), 6.0, 0.01); EXPECT_NEAR(convert(9, precise::data::digits, precise::data::trit), 18.86, 0.01); } TEST(otherUnits, digits) { EXPECT_NEAR(convert(12.0, precise::data::digits, precise::data::bit_s), 39.86, 0.01); EXPECT_NEAR(convert(6.0, precise::data::digits, precise::data::bit_s), 19.93, 0.01); EXPECT_NEAR(convert(1.0, precise::data::digits, precise::one), 10.0, 0.01); } TEST(otherUnits, Richter) { auto conv5 = convert(5.0, precise::special::moment_magnitude, precise::N * precise::m); EXPECT_FALSE(std::isnan(conv5)); EXPECT_NEAR( convert(conv5, precise::N * precise::m, precise::special::moment_magnitude), 5.0, 0.0001); auto conv7 = convert(7.0, precise::special::moment_magnitude, precise::N * precise::m); EXPECT_FALSE(std::isnan(conv7)); EXPECT_NEAR( convert(conv7, precise::N * precise::m, precise::special::moment_magnitude), 7.0, 0.0001); EXPECT_NEAR(conv7 / conv5, 1000.0, 10.0); } TEST(otherUnits, moment_energy) { auto conv5 = convert(5.0, precise::special::moment_energy, precise::J); EXPECT_FALSE(std::isnan(conv5)); EXPECT_NEAR(convert(conv5, precise::J, precise::special::moment_energy), 5.0, 0.0001); auto conv7 = convert(7.0, precise::special::moment_energy, precise::J); EXPECT_FALSE(std::isnan(conv7)); EXPECT_NEAR(convert(conv7, precise::J, precise::special::moment_energy), 7.0, 0.0001); EXPECT_NEAR(conv7 / conv5, 1000.0, 10.0); } TEST(otherUnits, unknownEQ) { auto eq18 = precise_unit(precise::custom::equation_unit(18)); auto eq19 = precise_unit(precise::custom::equation_unit(19)); EXPECT_EQ(convert(1.92, eq18, precise::one), 1.92); auto conv7 = convert(7.0, eq18, eq19 * precise::W); EXPECT_TRUE(std::isnan(conv7)); EXPECT_EQ(convert(1.927, eq18 * precise::W, eq19 * precise::W), 1.927); }
/* * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ #include <LibGUI/GMLLexer.h> #include <LibGUI/GMLSyntaxHighlighter.h> #include <LibGfx/Palette.h> namespace GUI { static Syntax::TextStyle style_for_token_type(const Gfx::Palette& palette, GMLToken::Type type) { switch (type) { case GMLToken::Type::LeftCurly: case GMLToken::Type::RightCurly: return { palette.syntax_punctuation() }; case GMLToken::Type::ClassMarker: return { palette.syntax_keyword() }; case GMLToken::Type::ClassName: return { palette.syntax_identifier(), true }; case GMLToken::Type::Identifier: return { palette.syntax_identifier() }; case GMLToken::Type::JsonValue: return { palette.syntax_string() }; case GMLToken::Type::Comment: return { palette.syntax_comment() }; default: return { palette.base_text() }; } } bool GMLSyntaxHighlighter::is_identifier(u64 token) const { auto ini_token = static_cast<GUI::GMLToken::Type>(token); return ini_token == GUI::GMLToken::Type::Identifier; } void GMLSyntaxHighlighter::rehighlight(const Palette& palette) { auto text = m_client->get_text(); GMLLexer lexer(text); auto tokens = lexer.lex(); Vector<GUI::TextDocumentSpan> spans; for (auto& token : tokens) { GUI::TextDocumentSpan span; span.range.set_start({ token.m_start.line, token.m_start.column }); span.range.set_end({ token.m_end.line, token.m_end.column }); auto style = style_for_token_type(palette, token.m_type); span.attributes.color = style.color; span.attributes.bold = style.bold; span.is_skippable = false; span.data = static_cast<u64>(token.m_type); spans.append(span); } m_client->do_set_spans(move(spans)); m_has_brace_buddies = false; highlight_matching_token_pair(); m_client->do_update(); } Vector<GMLSyntaxHighlighter::MatchingTokenPair> GMLSyntaxHighlighter::matching_token_pairs_impl() const { static Vector<MatchingTokenPair> pairs; if (pairs.is_empty()) { pairs.append({ static_cast<u64>(GMLToken::Type::LeftCurly), static_cast<u64>(GMLToken::Type::RightCurly) }); } return pairs; } bool GMLSyntaxHighlighter::token_types_equal(u64 token1, u64 token2) const { return static_cast<GUI::GMLToken::Type>(token1) == static_cast<GUI::GMLToken::Type>(token2); } GMLSyntaxHighlighter::~GMLSyntaxHighlighter() { } }
// Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved // CJobObjLimitInfoProps.cpp //#define _WIN32_WINNT 0x0500 #include "precomp.h" #include <wbemprov.h> #include "FRQueryEx.h" #include <vector> #include "helpers.h" #include "CVARIANT.h" #include "CObjProps.h" #include "CJobObjLimitInfoProps.h" #include <crtdbg.h> //***************************************************************************** // BEGIN: Declaration of Win32_JobObjectLimitInfo class properties. //***************************************************************************** // WARNING!! MUST KEEP MEMBERS OF THE FOLLOWING ARRAY // IN SYNCH WITH THE JOB_OBJ_PROPS ENUMERATION DECLARED // IN CJobObjProps.h !!! LPCWSTR g_rgJobObjLimitInfoPropNames[] = { { L"SettingID" }, { L"PerProcessUserTimeLimit" }, { L"PerJobUserTimeLimit" }, { L"LimitFlags" }, { L"MinimumWorkingSetSize" }, { L"MaximumWorkingSetSize" }, { L"ActiveProcessLimit" }, { L"Affinity" }, { L"PriorityClass" }, { L"SchedulingClass" }, { L"ProcessMemoryLimit" }, { L"JobMemoryLimit" } }; //***************************************************************************** // END: Declaration of Win32_JobObjectLimitInfo class properties. //***************************************************************************** CJobObjLimitInfoProps::CJobObjLimitInfoProps(CHString& chstrNamespace) : CObjProps(chstrNamespace) { } CJobObjLimitInfoProps::CJobObjLimitInfoProps( HANDLE hJob, CHString& chstrNamespace) : CObjProps(chstrNamespace), m_hJob(hJob) { } CJobObjLimitInfoProps::~CJobObjLimitInfoProps() { } // Clients call this to establish which properties // were requested. This function calls a base class // helper, which calls our CheckProps function. // The base class helper finally stores the result // in the base class member m_dwReqProps. HRESULT CJobObjLimitInfoProps::GetWhichPropsReq( CFrameworkQuery& cfwq) { HRESULT hr = S_OK; // Call base class version for help. // Base class version will call our // CheckProps function. hr = CObjProps::GetWhichPropsReq( cfwq, CheckProps); return hr; } DWORD CJobObjLimitInfoProps::CheckProps( CFrameworkQuery& Query) { DWORD dwReqProps = PROP_NONE_REQUIRED; // Get the requested properties for this // specific object... if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_ID])) dwReqProps |= PROP_JOLimitInfoID; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_PerProcessUserTimeLimit])) dwReqProps |= PROP_PerProcessUserTimeLimit; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_PerJobUserTimeLimit])) dwReqProps |= PROP_PerJobUserTimeLimit; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_LimitFlags])) dwReqProps |= PROP_LimitFlags; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_MinimumWorkingSetSize])) dwReqProps |= PROP_MinimumWorkingSetSize; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_MaximumWorkingSetSize])) dwReqProps |= PROP_MaximumWorkingSetSize; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_ActiveProcessLimit])) dwReqProps |= PROP_ActiveProcessLimit; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_Affinity])) dwReqProps |= PROP_Affinity; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_PriorityClass])) dwReqProps |= PROP_PriorityClass; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_SchedulingClass])) dwReqProps |= PROP_SchedulingClass; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_ProcessMemoryLimit])) dwReqProps |= PROP_ProcessMemoryLimit; if (Query.IsPropertyRequired(g_rgJobObjLimitInfoPropNames[JOLMTPROP_JobMemoryLimit])) dwReqProps |= PROP_JobMemoryLimit; return dwReqProps; } void CJobObjLimitInfoProps::SetHandle( const HANDLE hJob) { m_hJob = hJob; } HANDLE& CJobObjLimitInfoProps::GetHandle() { _ASSERT(m_hJob); return m_hJob; } // Sets the key properties from the ObjectPath. HRESULT CJobObjLimitInfoProps::SetKeysFromPath( const BSTR ObjectPath, IWbemContext __RPC_FAR *pCtx) { HRESULT hr = WBEM_S_NO_ERROR; // This array contains the key field names CHStringArray rgchstrKeys; rgchstrKeys.Add(g_rgJobObjLimitInfoPropNames[JOLMTPROP_ID]); // This array contains the index numbers // in m_PropMap corresponding to the keys. short sKeyNum[1]; sKeyNum[0] = JOLMTPROP_ID; hr = CObjProps::SetKeysFromPath( ObjectPath, pCtx, IDS_Win32_NamedJobObjectLimitSetting, rgchstrKeys, sKeyNum); return hr; } // Sets the key property from in supplied // parameter. HRESULT CJobObjLimitInfoProps::SetKeysDirect( std::vector<CVARIANT>& vecvKeys) { HRESULT hr = WBEM_S_NO_ERROR; if(vecvKeys.size() == 1) { short sKeyNum[1]; sKeyNum[0] = JOLMTPROP_ID; hr = CObjProps::SetKeysDirect( vecvKeys, sKeyNum); } else { hr = WBEM_E_INVALID_PARAMETER; } return hr; } // Sets the non-key properties. Only those // properties requested are set (as determined // by base class member m_dwReqProps). HRESULT CJobObjLimitInfoProps::SetNonKeyReqProps() { HRESULT hr = WBEM_S_NO_ERROR; DWORD dwReqProps = GetReqProps(); _ASSERT(m_hJob); if(!m_hJob) return WBEM_E_INVALID_PARAMETER; // Because all the properties of this class // come from the same underlying win32 job // object structure, we only need to get that // structure one time. We only need to get // it at all if at least one non-key property // was requested. if(dwReqProps != PROP_NONE_REQUIRED) { // Get the value from the underlying JO: JOBOBJECT_EXTENDED_LIMIT_INFORMATION joeli; BOOL fQIJO = ::QueryInformationJobObject( m_hJob, JobObjectExtendedLimitInformation, &joeli, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION), NULL); if(!fQIJO) { _ASSERT(0); hr = WBEM_E_FAILED; } else { try // CVARIANT can throw { // Get all the reequested values... if(dwReqProps & PROP_PerProcessUserTimeLimit) { ULONGLONG llPerProcessUserTimeLimit = (ULONGLONG)joeli.BasicLimitInformation.PerProcessUserTimeLimit.QuadPart; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_PerProcessUserTimeLimit, new CVARIANT(llPerProcessUserTimeLimit))); } if(dwReqProps & PROP_PerJobUserTimeLimit) { ULONGLONG llPerJobUserTimeLimit = (ULONGLONG)joeli.BasicLimitInformation.PerJobUserTimeLimit.QuadPart; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_PerJobUserTimeLimit, new CVARIANT(llPerJobUserTimeLimit))); } if(dwReqProps & PROP_LimitFlags) { DWORD dwLimitFlags = joeli.BasicLimitInformation.LimitFlags; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_LimitFlags, new CVARIANT(dwLimitFlags))); } if(dwReqProps & PROP_MinimumWorkingSetSize) { DWORD dwMinimumWorkingSetSize = joeli.BasicLimitInformation.MinimumWorkingSetSize; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_MinimumWorkingSetSize, new CVARIANT(dwMinimumWorkingSetSize))); } if(dwReqProps & PROP_MaximumWorkingSetSize) { DWORD dwMaximumWorkingSetSize = joeli.BasicLimitInformation.MaximumWorkingSetSize; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_MaximumWorkingSetSize, new CVARIANT(dwMaximumWorkingSetSize))); } if(dwReqProps & PROP_ActiveProcessLimit) { DWORD dwActiveProcessLimit = joeli.BasicLimitInformation.ActiveProcessLimit; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_ActiveProcessLimit, new CVARIANT(dwActiveProcessLimit))); } if(dwReqProps & PROP_Affinity) { DWORD dwAffinity = joeli.BasicLimitInformation.Affinity; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_Affinity, new CVARIANT(dwAffinity))); } if(dwReqProps & PROP_PriorityClass) { DWORD dwPriorityClass = joeli.BasicLimitInformation.PriorityClass; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_PriorityClass, new CVARIANT(dwPriorityClass))); } if(dwReqProps & PROP_SchedulingClass) { DWORD dwSchedulingClass = joeli.BasicLimitInformation.SchedulingClass; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_SchedulingClass, new CVARIANT(dwSchedulingClass))); } if(dwReqProps & PROP_ProcessMemoryLimit) { DWORD dwProcessMemoryLimit = joeli.ProcessMemoryLimit ; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_ProcessMemoryLimit, new CVARIANT(dwProcessMemoryLimit))); } if(dwReqProps & PROP_JobMemoryLimit) { DWORD dwJobMemoryLimit = joeli.JobMemoryLimit ; m_PropMap.insert(SHORT2PVARIANT::value_type( JOLMTPROP_JobMemoryLimit, new CVARIANT(dwJobMemoryLimit))); } } catch(CVARIANTError& cve) { hr = cve.GetWBEMError(); } } } return hr; } // Used by PutInstance to write out properties. HRESULT CJobObjLimitInfoProps::SetWin32JOLimitInfoProps( IWbemClassObject __RPC_FAR *pInst) { HRESULT hr = WBEM_S_NO_ERROR; _ASSERT(pInst); if(!pInst) return WBEM_E_INVALID_PARAMETER; // Go through the instance and extract all // specified values into the win32 structure. // If a value was not specified, set it to zero. CVARIANT v; JOBOBJECT_EXTENDED_LIMIT_INFORMATION joeli; ::ZeroMemory(&joeli, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION)); hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_PerProcessUserTimeLimit], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_BSTR) ? joeli.BasicLimitInformation.PerProcessUserTimeLimit.QuadPart = _wtoi64(V_BSTR(&v)) : joeli.BasicLimitInformation.PerProcessUserTimeLimit.QuadPart = 0; } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_PerJobUserTimeLimit], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_BSTR) ? joeli.BasicLimitInformation.PerJobUserTimeLimit.QuadPart = _wtoi64(V_BSTR(&v)) : joeli.BasicLimitInformation.PerJobUserTimeLimit.QuadPart = 0; } } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_LimitFlags], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_I4) ? joeli.BasicLimitInformation.LimitFlags = V_I4(&v) : joeli.BasicLimitInformation.LimitFlags = 0; } } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_MinimumWorkingSetSize], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_I4) ? joeli.BasicLimitInformation.MinimumWorkingSetSize = V_I4(&v) : joeli.BasicLimitInformation.MinimumWorkingSetSize = 0; } } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_MaximumWorkingSetSize], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_I4) ? joeli.BasicLimitInformation.MaximumWorkingSetSize = V_I4(&v) : joeli.BasicLimitInformation.MaximumWorkingSetSize = 0; } } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_ActiveProcessLimit], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_I4) ? joeli.BasicLimitInformation.ActiveProcessLimit = V_I4(&v) : joeli.BasicLimitInformation.ActiveProcessLimit = 0; } } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_Affinity], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_I4) ? joeli.BasicLimitInformation.Affinity = V_I4(&v) : joeli.BasicLimitInformation.Affinity = 0; } } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_PriorityClass], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_I4) ? joeli.BasicLimitInformation.PriorityClass = V_I4(&v) : joeli.BasicLimitInformation.PriorityClass = 0; } } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_SchedulingClass], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_I4) ? joeli.BasicLimitInformation.SchedulingClass = V_I4(&v) : joeli.BasicLimitInformation.SchedulingClass = 0; } } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_ProcessMemoryLimit], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_I4) ? joeli.ProcessMemoryLimit = V_I4(&v) : joeli.ProcessMemoryLimit = 0; } } v.Clear(); if(SUCCEEDED(hr)) { hr = pInst->Get( g_rgJobObjLimitInfoPropNames[JOLMTPROP_JobMemoryLimit], 0, &v, NULL, NULL); if(SUCCEEDED(hr)) { (V_VT(&v) == VT_I4) ? joeli.JobMemoryLimit = V_I4(&v) : joeli.JobMemoryLimit = 0; } } // Now write the info out... if(SUCCEEDED(hr)) { if(!::SetInformationJobObject( m_hJob, JobObjectExtendedLimitInformation, &joeli, sizeof(joeli))) { hr = WinErrorToWBEMhResult(::GetLastError()); } } return hr; } HRESULT CJobObjLimitInfoProps::LoadPropertyValues( IWbemClassObject* pIWCO) { HRESULT hr = WBEM_S_NO_ERROR; if(!pIWCO) return E_POINTER; hr = CObjProps::LoadPropertyValues( g_rgJobObjLimitInfoPropNames, pIWCO); return hr; }
//Hudson Soft HuC6280 struct CPU : Processor::HuC6280, Thread { static auto Enter() -> void; auto main() -> void; auto step(uint clocks) -> void override; auto power() -> void; auto lastCycle() -> void override; //memory.cpp auto load() -> void; auto save() -> void; //io.cpp auto read(uint8 bank, uint13 addr) -> uint8 override; auto read_(uint8 bank, uint13 addr) -> uint8; auto write(uint8 bank, uint13 addr, uint8 data) -> void override; auto store(uint2 addr, uint8 data) -> void override; //timer.cpp auto timerStep(uint clocks) -> void; //serialization.cpp auto serialize(serializer&) -> void; vector<Thread*> peripherals; private: uint8 ram[0x8000]; //PC Engine = 8KB, SuperGrafx = 32KB uint8 bram[0x800]; //PC Engine CD-ROM Backup RAM = 2KB struct IRQ { //irq.cpp auto pending() const -> bool; auto vector() const -> uint16; auto poll() -> void; private: bool disableExternal = 0; bool disableVDC = 0; bool disableTimer = 0; bool pendingIRQ = 0; uint16 pendingVector; friend class CPU; } irq; struct Timer { inline auto irqLine() const { return line; } //timer.cpp auto start() -> void; auto step(uint clocks) -> void; private: bool enable = 0; uint7 latch; uint7 value; uint clock = 0; bool line = 0; friend class CPU; } timer; struct IO { uint8 mdr; } io; }; extern CPU cpu;
/* //@HEADER // ************************************************************************ // // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation // // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. // // 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 Corporation nor the names of the // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE // 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. // // Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER */ /// \file Kokkos_Layout.hpp /// \brief Declaration of various \c MemoryLayout options. #ifndef KOKKOS_LAYOUT_HPP #define KOKKOS_LAYOUT_HPP #include <cstddef> #include <impl/Kokkos_Traits.hpp> #include <impl/Kokkos_Tags.hpp> namespace Kokkos { enum { ARRAY_LAYOUT_MAX_RANK = 8 }; //---------------------------------------------------------------------------- /// \struct LayoutLeft /// \brief Memory layout tag indicating left-to-right (Fortran scheme) /// striding of multi-indices. /// /// This is an example of a \c MemoryLayout template parameter of /// View. The memory layout describes how View maps from a /// multi-index (i0, i1, ..., ik) to a memory location. /// /// "Layout left" indicates a mapping where the leftmost index i0 /// refers to contiguous access, and strides increase for dimensions /// going right from there (i1, i2, ...). This layout imitates how /// Fortran stores multi-dimensional arrays. For the special case of /// a two-dimensional array, "layout left" is also called "column /// major." struct LayoutLeft { //! Tag this class as a kokkos array layout typedef LayoutLeft array_layout; size_t dimension[ARRAY_LAYOUT_MAX_RANK]; enum { is_extent_constructible = true }; LayoutLeft(LayoutLeft const&) = default; LayoutLeft(LayoutLeft&&) = default; LayoutLeft& operator=(LayoutLeft const&) = default; LayoutLeft& operator=(LayoutLeft&&) = default; KOKKOS_INLINE_FUNCTION explicit constexpr LayoutLeft(size_t N0 = 0, size_t N1 = 0, size_t N2 = 0, size_t N3 = 0, size_t N4 = 0, size_t N5 = 0, size_t N6 = 0, size_t N7 = 0) : dimension{N0, N1, N2, N3, N4, N5, N6, N7} {} }; //---------------------------------------------------------------------------- /// \struct LayoutRight /// \brief Memory layout tag indicating right-to-left (C or /// lexigraphical scheme) striding of multi-indices. /// /// This is an example of a \c MemoryLayout template parameter of /// View. The memory layout describes how View maps from a /// multi-index (i0, i1, ..., ik) to a memory location. /// /// "Right layout" indicates a mapping where the rightmost index ik /// refers to contiguous access, and strides increase for dimensions /// going left from there. This layout imitates how C stores /// multi-dimensional arrays. For the special case of a /// two-dimensional array, "layout right" is also called "row major." struct LayoutRight { //! Tag this class as a kokkos array layout typedef LayoutRight array_layout; size_t dimension[ARRAY_LAYOUT_MAX_RANK]; enum { is_extent_constructible = true }; LayoutRight(LayoutRight const&) = default; LayoutRight(LayoutRight&&) = default; LayoutRight& operator=(LayoutRight const&) = default; LayoutRight& operator=(LayoutRight&&) = default; KOKKOS_INLINE_FUNCTION explicit constexpr LayoutRight(size_t N0 = 0, size_t N1 = 0, size_t N2 = 0, size_t N3 = 0, size_t N4 = 0, size_t N5 = 0, size_t N6 = 0, size_t N7 = 0) : dimension{N0, N1, N2, N3, N4, N5, N6, N7} {} }; //---------------------------------------------------------------------------- /// \struct LayoutStride /// \brief Memory layout tag indicated arbitrarily strided /// multi-index mapping into contiguous memory. struct LayoutStride { //! Tag this class as a kokkos array layout typedef LayoutStride array_layout; size_t dimension[ARRAY_LAYOUT_MAX_RANK]; size_t stride[ARRAY_LAYOUT_MAX_RANK]; enum { is_extent_constructible = false }; LayoutStride(LayoutStride const&) = default; LayoutStride(LayoutStride&&) = default; LayoutStride& operator=(LayoutStride const&) = default; LayoutStride& operator=(LayoutStride&&) = default; /** \brief Compute strides from ordered dimensions. * * Values of order uniquely form the set [0..rank) * and specify ordering of the dimensions. * Order = {0,1,2,...} is LayoutLeft * Order = {...,2,1,0} is LayoutRight */ template <typename iTypeOrder, typename iTypeDimen> KOKKOS_INLINE_FUNCTION static LayoutStride order_dimensions( int const rank, iTypeOrder const* const order, iTypeDimen const* const dimen) { LayoutStride tmp; // Verify valid rank order: int check_input = ARRAY_LAYOUT_MAX_RANK < rank ? 0 : int(1 << rank) - 1; for (int r = 0; r < ARRAY_LAYOUT_MAX_RANK; ++r) { tmp.dimension[r] = 0; tmp.stride[r] = 0; } for (int r = 0; r < rank; ++r) { check_input &= ~int(1 << order[r]); } if (0 == check_input) { size_t n = 1; for (int r = 0; r < rank; ++r) { tmp.stride[order[r]] = n; n *= (dimen[order[r]]); tmp.dimension[r] = dimen[r]; } } return tmp; } KOKKOS_INLINE_FUNCTION explicit constexpr LayoutStride(size_t N0 = 0, size_t S0 = 0, size_t N1 = 0, size_t S1 = 0, size_t N2 = 0, size_t S2 = 0, size_t N3 = 0, size_t S3 = 0, size_t N4 = 0, size_t S4 = 0, size_t N5 = 0, size_t S5 = 0, size_t N6 = 0, size_t S6 = 0, size_t N7 = 0, size_t S7 = 0) : dimension{N0, N1, N2, N3, N4, N5, N6, N7}, stride{S0, S1, S2, S3, S4, S5, S6, S7} {} }; // ========================================================================== #ifdef KOKKOS_ENABLE_DEPRECATED_CODE //---------------------------------------------------------------------------- /// \struct LayoutTileLeft /// \brief Memory layout tag indicating left-to-right (Fortran scheme) /// striding of multi-indices by tiles. /// /// This is an example of a \c MemoryLayout template parameter of /// View. The memory layout describes how View maps from a /// multi-index (i0, i1, ..., ik) to a memory location. /// /// "Tiled layout" indicates a mapping to contiguously stored /// <tt>ArgN0</tt> by <tt>ArgN1</tt> tiles for the rightmost two /// dimensions. Indices are LayoutLeft within each tile, and the /// tiles themselves are arranged using LayoutLeft. Note that the /// dimensions <tt>ArgN0</tt> and <tt>ArgN1</tt> of the tiles must be /// compile-time constants. This speeds up index calculations. If /// both tile dimensions are powers of two, Kokkos can optimize /// further. template <unsigned ArgN0, unsigned ArgN1, bool IsPowerOfTwo = (Impl::is_integral_power_of_two(ArgN0) && Impl::is_integral_power_of_two(ArgN1))> struct LayoutTileLeft { static_assert(Impl::is_integral_power_of_two(ArgN0) && Impl::is_integral_power_of_two(ArgN1), "LayoutTileLeft must be given power-of-two tile dimensions"); //! Tag this class as a kokkos array layout typedef LayoutTileLeft<ArgN0, ArgN1, IsPowerOfTwo> array_layout; enum { N0 = ArgN0 }; enum { N1 = ArgN1 }; size_t dimension[ARRAY_LAYOUT_MAX_RANK]; enum { is_extent_constructible = true }; LayoutTileLeft(LayoutTileLeft const&) = default; LayoutTileLeft(LayoutTileLeft&&) = default; LayoutTileLeft& operator=(LayoutTileLeft const&) = default; LayoutTileLeft& operator=(LayoutTileLeft&&) = default; KOKKOS_INLINE_FUNCTION explicit constexpr LayoutTileLeft(size_t argN0 = 0, size_t argN1 = 0, size_t argN2 = 0, size_t argN3 = 0, size_t argN4 = 0, size_t argN5 = 0, size_t argN6 = 0, size_t argN7 = 0) : dimension{argN0, argN1, argN2, argN3, argN4, argN5, argN6, argN7} {} }; #endif // KOKKOS_ENABLE_DEPRECATED_CODE // =================================================================================== ////////////////////////////////////////////////////////////////////////////////////// enum class Iterate { Default, Left, // Left indices stride fastest Right // Right indices stride fastest }; // To check for LayoutTiled // This is to hide extra compile-time 'identifier' info within the LayoutTiled // class by not relying on template specialization to include the ArgN*'s template <typename LayoutTiledCheck, class Enable = void> struct is_layouttiled : std::false_type {}; #ifndef KOKKOS_ENABLE_DEPRECATED_CODE template <typename LayoutTiledCheck> struct is_layouttiled< LayoutTiledCheck, typename std::enable_if<LayoutTiledCheck::is_array_layout_tiled>::type> : std::true_type {}; namespace Experimental { /// LayoutTiled // Must have Rank >= 2 template < Kokkos::Iterate OuterP, Kokkos::Iterate InnerP, unsigned ArgN0, unsigned ArgN1, unsigned ArgN2 = 0, unsigned ArgN3 = 0, unsigned ArgN4 = 0, unsigned ArgN5 = 0, unsigned ArgN6 = 0, unsigned ArgN7 = 0, bool IsPowerOfTwo = (Kokkos::Impl::is_integral_power_of_two(ArgN0) && Kokkos::Impl::is_integral_power_of_two(ArgN1) && (Kokkos::Impl::is_integral_power_of_two(ArgN2) || (ArgN2 == 0)) && (Kokkos::Impl::is_integral_power_of_two(ArgN3) || (ArgN3 == 0)) && (Kokkos::Impl::is_integral_power_of_two(ArgN4) || (ArgN4 == 0)) && (Kokkos::Impl::is_integral_power_of_two(ArgN5) || (ArgN5 == 0)) && (Kokkos::Impl::is_integral_power_of_two(ArgN6) || (ArgN6 == 0)) && (Kokkos::Impl::is_integral_power_of_two(ArgN7) || (ArgN7 == 0)))> struct LayoutTiled { static_assert(IsPowerOfTwo, "LayoutTiled must be given power-of-two tile dimensions"); #if 0 static_assert( (Impl::is_integral_power_of_two(ArgN0) ) && (Impl::is_integral_power_of_two(ArgN1) ) && (Impl::is_integral_power_of_two(ArgN2) || (ArgN2 == 0) ) && (Impl::is_integral_power_of_two(ArgN3) || (ArgN3 == 0) ) && (Impl::is_integral_power_of_two(ArgN4) || (ArgN4 == 0) ) && (Impl::is_integral_power_of_two(ArgN5) || (ArgN5 == 0) ) && (Impl::is_integral_power_of_two(ArgN6) || (ArgN6 == 0) ) && (Impl::is_integral_power_of_two(ArgN7) || (ArgN7 == 0) ) , "LayoutTiled must be given power-of-two tile dimensions" ); #endif typedef LayoutTiled<OuterP, InnerP, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, IsPowerOfTwo> array_layout; static constexpr Iterate outer_pattern = OuterP; static constexpr Iterate inner_pattern = InnerP; enum { N0 = ArgN0 }; enum { N1 = ArgN1 }; enum { N2 = ArgN2 }; enum { N3 = ArgN3 }; enum { N4 = ArgN4 }; enum { N5 = ArgN5 }; enum { N6 = ArgN6 }; enum { N7 = ArgN7 }; size_t dimension[ARRAY_LAYOUT_MAX_RANK]; enum { is_extent_constructible = true }; LayoutTiled(LayoutTiled const&) = default; LayoutTiled(LayoutTiled&&) = default; LayoutTiled& operator=(LayoutTiled const&) = default; LayoutTiled& operator=(LayoutTiled&&) = default; KOKKOS_INLINE_FUNCTION explicit constexpr LayoutTiled(size_t argN0 = 0, size_t argN1 = 0, size_t argN2 = 0, size_t argN3 = 0, size_t argN4 = 0, size_t argN5 = 0, size_t argN6 = 0, size_t argN7 = 0) : dimension{argN0, argN1, argN2, argN3, argN4, argN5, argN6, argN7} {} }; } // namespace Experimental #endif // For use with view_copy template <typename... Layout> struct layout_iterate_type_selector { static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Default; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Default; }; template <> struct layout_iterate_type_selector<Kokkos::LayoutRight> { static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Right; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Right; }; template <> struct layout_iterate_type_selector<Kokkos::LayoutLeft> { static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Left; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Left; }; template <> struct layout_iterate_type_selector<Kokkos::LayoutStride> { static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Default; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Default; }; #ifndef KOKKOS_ENABLE_DEPRECATED_CODE template <unsigned ArgN0, unsigned ArgN1, unsigned ArgN2, unsigned ArgN3, unsigned ArgN4, unsigned ArgN5, unsigned ArgN6, unsigned ArgN7> struct layout_iterate_type_selector<Kokkos::Experimental::LayoutTiled< Kokkos::Iterate::Left, Kokkos::Iterate::Left, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, true> > { static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Left; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Left; }; template <unsigned ArgN0, unsigned ArgN1, unsigned ArgN2, unsigned ArgN3, unsigned ArgN4, unsigned ArgN5, unsigned ArgN6, unsigned ArgN7> struct layout_iterate_type_selector<Kokkos::Experimental::LayoutTiled< Kokkos::Iterate::Right, Kokkos::Iterate::Left, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, true> > { static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Right; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Left; }; template <unsigned ArgN0, unsigned ArgN1, unsigned ArgN2, unsigned ArgN3, unsigned ArgN4, unsigned ArgN5, unsigned ArgN6, unsigned ArgN7> struct layout_iterate_type_selector<Kokkos::Experimental::LayoutTiled< Kokkos::Iterate::Left, Kokkos::Iterate::Right, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, true> > { static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Left; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Right; }; template <unsigned ArgN0, unsigned ArgN1, unsigned ArgN2, unsigned ArgN3, unsigned ArgN4, unsigned ArgN5, unsigned ArgN6, unsigned ArgN7> struct layout_iterate_type_selector<Kokkos::Experimental::LayoutTiled< Kokkos::Iterate::Right, Kokkos::Iterate::Right, ArgN0, ArgN1, ArgN2, ArgN3, ArgN4, ArgN5, ArgN6, ArgN7, true> > { static const Kokkos::Iterate outer_iteration_pattern = Kokkos::Iterate::Right; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::Iterate::Right; }; #endif } // namespace Kokkos #endif // #ifndef KOKKOS_LAYOUT_HPP
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. //***************************************************************************** // File: daccess.cpp // // // ClrDataAccess implementation. // //***************************************************************************** #include "stdafx.h" #include <clrdata.h> #include "typestring.h" #include "holder.h" #include "debuginfostore.h" #include "peimagelayout.inl" #include "datatargetadapter.h" #include "readonlydatatargetfacade.h" #include "metadataexports.h" #include "excep.h" #include "debugger.h" #include "dwreport.h" #include "primitives.h" #include "dbgutil.h" #ifdef TARGET_UNIX #ifdef USE_DAC_TABLE_RVA #include <dactablerva.h> #else extern "C" bool TryGetSymbol(ICorDebugDataTarget* dataTarget, uint64_t baseAddress, const char* symbolName, uint64_t* symbolAddress); #endif #endif #include "dwbucketmanager.hpp" #include "gcinterface.dac.h" // To include definiton of IsThrowableThreadAbortException // #include <exstatecommon.h> CRITICAL_SECTION g_dacCritSec; ClrDataAccess* g_dacImpl; EXTERN_C #ifdef TARGET_UNIX DLLEXPORT // For Win32 PAL LoadLibrary emulation #endif BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved) { static bool g_procInitialized = false; switch(reason) { case DLL_PROCESS_ATTACH: { if (g_procInitialized) { #ifdef HOST_UNIX // Double initialization can happen on Unix // in case of manual load of DAC shared lib and calling DllMain // not a big deal, we just ignore it. return TRUE; #else return FALSE; #endif } #ifdef HOST_UNIX int err = PAL_InitializeDLL(); if(err != 0) { return FALSE; } #endif InitializeCriticalSection(&g_dacCritSec); g_procInitialized = true; break; } case DLL_PROCESS_DETACH: // It's possible for this to be called without ATTACH completing (eg. if it failed) if (g_procInitialized) { DeleteCriticalSection(&g_dacCritSec); } g_procInitialized = false; break; } return TRUE; } HRESULT ConvertUtf8(_In_ LPCUTF8 utf8, ULONG32 bufLen, ULONG32* nameLen, _Out_writes_to_opt_(bufLen, *nameLen) PWSTR buffer) { if (nameLen) { *nameLen = WszMultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0); if (!*nameLen) { return HRESULT_FROM_GetLastError(); } } if (buffer && bufLen) { if (!WszMultiByteToWideChar(CP_UTF8, 0, utf8, -1, buffer, bufLen)) { return HRESULT_FROM_GetLastError(); } } return S_OK; } HRESULT AllocUtf8(_In_opt_ LPCWSTR wstr, ULONG32 srcChars, _Outptr_ LPUTF8* utf8) { ULONG32 chars = WszWideCharToMultiByte(CP_UTF8, 0, wstr, srcChars, NULL, 0, NULL, NULL); if (!chars) { return HRESULT_FROM_GetLastError(); } // Make sure the converted string is always terminated. if (srcChars != (ULONG32)-1) { if (!ClrSafeInt<ULONG32>::addition(chars, 1, chars)) { return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); } } char* mem = new (nothrow) char[chars]; if (!mem) { return E_OUTOFMEMORY; } if (!WszWideCharToMultiByte(CP_UTF8, 0, wstr, srcChars, mem, chars, NULL, NULL)) { HRESULT hr = HRESULT_FROM_GetLastError(); delete [] mem; return hr; } if (srcChars != (ULONG32)-1) { mem[chars - 1] = 0; } *utf8 = mem; return S_OK; } HRESULT GetFullClassNameFromMetadata(IMDInternalImport* mdImport, mdTypeDef classToken, ULONG32 bufferChars, _Inout_updates_(bufferChars) LPUTF8 buffer) { HRESULT hr; LPCUTF8 baseName, namespaceName; IfFailRet(mdImport->GetNameOfTypeDef(classToken, &baseName, &namespaceName)); return ns::MakePath(buffer, bufferChars, namespaceName, baseName) ? S_OK : E_OUTOFMEMORY; } HRESULT GetFullMethodNameFromMetadata(IMDInternalImport* mdImport, mdMethodDef methodToken, ULONG32 bufferChars, _Inout_updates_(bufferChars) LPUTF8 buffer) { HRESULT status; HRESULT hr; mdTypeDef classToken; size_t len; if (mdImport->GetParentToken(methodToken, &classToken) == S_OK) { if ((status = GetFullClassNameFromMetadata(mdImport, classToken, bufferChars, buffer)) != S_OK) { return status; } len = strlen(buffer); buffer += len; bufferChars -= static_cast<ULONG32>(len) + 1; if (!bufferChars) { return E_OUTOFMEMORY; } *buffer++ = NAMESPACE_SEPARATOR_CHAR; } LPCUTF8 methodName; IfFailRet(mdImport->GetNameOfMethodDef(methodToken, &methodName)); len = strlen(methodName); if (len >= bufferChars) { return E_OUTOFMEMORY; } strcpy_s(buffer, bufferChars, methodName); return S_OK; } HRESULT SplitFullName(_In_z_ PCWSTR fullName, SplitSyntax syntax, ULONG32 memberDots, _Outptr_opt_ LPUTF8* namespaceName, _Outptr_opt_ LPUTF8* typeName, _Outptr_opt_ LPUTF8* memberName, _Outptr_opt_ LPUTF8* params) { HRESULT status; PCWSTR paramsStart, memberStart, memberEnd, typeStart; if (!*fullName) { return E_INVALIDARG; } // // Split off parameters. // paramsStart = wcschr(fullName, W('(')); if (paramsStart) { if (syntax != SPLIT_METHOD || paramsStart == fullName) { return E_INVALIDARG; } if ((status = AllocUtf8(paramsStart, (ULONG32)-1, params)) != S_OK) { return status; } memberEnd = paramsStart - 1; } else { *params = NULL; memberEnd = fullName + (wcslen(fullName) - 1); } if (syntax != SPLIT_TYPE) { // // Split off member name. // memberStart = memberEnd; for (;;) { while (memberStart >= fullName && *memberStart != W('.')) { memberStart--; } // Some member names (e.g. .ctor and .dtor) have // dots, so go back to the first dot. while (memberStart > fullName && memberStart[-1] == W('.')) { memberStart--; } if (memberStart <= fullName) { if (memberDots > 0) { // Caller expected dots in the // member name and they weren't found. status = E_INVALIDARG; goto DelParams; } break; } else if (memberDots == 0) { break; } memberStart--; memberDots--; } memberStart++; if (memberStart > memberEnd) { status = E_INVALIDARG; goto DelParams; } if ((status = AllocUtf8(memberStart, (ULONG32) (memberEnd - memberStart) + 1, memberName)) != S_OK) { goto DelParams; } } else { *memberName = NULL; memberStart = memberEnd + 2; } // // Split off type name. // if (memberStart > fullName) { // Must have at least one character for the type // name. If there was a member name, there must // also be a separator. if (memberStart < fullName + 2) { status = E_INVALIDARG; goto DelMember; } typeStart = memberStart - 2; while (typeStart >= fullName && *typeStart != W('.')) { typeStart--; } typeStart++; if ((status = AllocUtf8(typeStart, (ULONG32) (memberStart - typeStart) - 1, typeName)) != S_OK) { goto DelMember; } } else { *typeName = NULL; typeStart = fullName; } // // Namespace must be the rest. // if (typeStart > fullName) { if ((status = AllocUtf8(fullName, (ULONG32) (typeStart - fullName) - 1, namespaceName)) != S_OK) { goto DelType; } } else { *namespaceName = NULL; } return S_OK; DelType: delete [] (*typeName); DelMember: delete [] (*memberName); DelParams: delete [] (*params); return status; } int CompareUtf8(_In_ LPCUTF8 str1, _In_ LPCUTF8 str2, _In_ ULONG32 nameFlags) { if (nameFlags & CLRDATA_BYNAME_CASE_INSENSITIVE) { // XXX Microsoft - Convert to Unicode? return SString::_stricmp(str1, str2); } return strcmp(str1, str2); } //---------------------------------------------------------------------------- // // MetaEnum. // //---------------------------------------------------------------------------- HRESULT MetaEnum::Start(IMDInternalImport* mdImport, ULONG32 kind, mdToken container) { HRESULT status; switch(kind) { case mdtTypeDef: status = mdImport->EnumTypeDefInit(&m_enum); break; case mdtMethodDef: case mdtFieldDef: status = mdImport->EnumInit(kind, container, &m_enum); break; default: return E_INVALIDARG; } if (status != S_OK) { return status; } m_mdImport = mdImport; m_kind = kind; return S_OK; } void MetaEnum::End(void) { if (!m_mdImport) { return; } switch(m_kind) { case mdtTypeDef: case mdtMethodDef: case mdtFieldDef: m_mdImport->EnumClose(&m_enum); break; } Clear(); } HRESULT MetaEnum::NextToken(mdToken* token, _Outptr_opt_result_maybenull_ LPCUTF8* namespaceName, _Outptr_opt_result_maybenull_ LPCUTF8* name) { HRESULT hr; if (!m_mdImport) { return E_INVALIDARG; } switch(m_kind) { case mdtTypeDef: if (!m_mdImport->EnumNext(&m_enum, token)) { return S_FALSE; } m_lastToken = *token; if (namespaceName || name) { LPCSTR _name, _namespaceName; IfFailRet(m_mdImport->GetNameOfTypeDef(*token, &_name, &_namespaceName)); if (namespaceName) { *namespaceName = _namespaceName; } if (name) { *name = _name; } } return S_OK; case mdtMethodDef: if (!m_mdImport->EnumNext(&m_enum, token)) { return S_FALSE; } m_lastToken = *token; if (namespaceName) { *namespaceName = NULL; } if (name != NULL) { IfFailRet(m_mdImport->GetNameOfMethodDef(*token, name)); } return S_OK; case mdtFieldDef: if (!m_mdImport->EnumNext(&m_enum, token)) { return S_FALSE; } m_lastToken = *token; if (namespaceName) { *namespaceName = NULL; } if (name != NULL) { IfFailRet(m_mdImport->GetNameOfFieldDef(*token, name)); } return S_OK; default: return E_INVALIDARG; } } HRESULT MetaEnum::NextDomainToken(AppDomain** appDomain, mdToken* token) { HRESULT status; if (m_appDomain) { // Use only the caller-provided app domain. *appDomain = m_appDomain; return NextToken(token, NULL, NULL); } // // Splay tokens across all app domains. // for (;;) { if (m_lastToken == mdTokenNil) { // Need to fetch a token. if ((status = NextToken(token, NULL, NULL)) != S_OK) { return status; } m_domainIter.Init(); } if (m_domainIter.Next()) { break; } m_lastToken = mdTokenNil; } *appDomain = m_domainIter.GetDomain(); *token = m_lastToken; return S_OK; } HRESULT MetaEnum::NextTokenByName(_In_opt_ LPCUTF8 namespaceName, _In_opt_ LPCUTF8 name, ULONG32 nameFlags, mdToken* token) { HRESULT status; LPCUTF8 tokNamespace, tokName; for (;;) { if ((status = NextToken(token, &tokNamespace, &tokName)) != S_OK) { return status; } if (namespaceName && (!tokNamespace || CompareUtf8(namespaceName, tokNamespace, nameFlags) != 0)) { continue; } if (name && (!tokName || CompareUtf8(name, tokName, nameFlags) != 0)) { continue; } return S_OK; } } HRESULT MetaEnum::NextDomainTokenByName(_In_opt_ LPCUTF8 namespaceName, _In_opt_ LPCUTF8 name, ULONG32 nameFlags, AppDomain** appDomain, mdToken* token) { HRESULT status; if (m_appDomain) { // Use only the caller-provided app domain. *appDomain = m_appDomain; return NextTokenByName(namespaceName, name, nameFlags, token); } // // Splay tokens across all app domains. // for (;;) { if (m_lastToken == mdTokenNil) { // Need to fetch a token. if ((status = NextTokenByName(namespaceName, name, nameFlags, token)) != S_OK) { return status; } m_domainIter.Init(); } if (m_domainIter.Next()) { break; } m_lastToken = mdTokenNil; } *appDomain = m_domainIter.GetDomain(); *token = m_lastToken; return S_OK; } HRESULT MetaEnum::New(Module* mod, ULONG32 kind, mdToken container, IXCLRDataAppDomain* pubAppDomain, MetaEnum** metaEnumRet, CLRDATA_ENUM* handle) { HRESULT status; MetaEnum* metaEnum; if (handle) { *handle = TO_CDENUM(NULL); } metaEnum = new (nothrow) MetaEnum; if (!metaEnum) { return E_OUTOFMEMORY; } if ((status = metaEnum-> Start(mod->GetMDImport(), kind, container)) != S_OK) { delete metaEnum; return status; } if (pubAppDomain) { metaEnum->m_appDomain = ((ClrDataAppDomain*)pubAppDomain)->GetAppDomain(); } if (metaEnumRet) { *metaEnumRet = metaEnum; } if (handle) { *handle = TO_CDENUM(metaEnum); } return S_OK; } //---------------------------------------------------------------------------- // // SplitName // //---------------------------------------------------------------------------- SplitName::SplitName(SplitSyntax syntax, ULONG32 nameFlags, ULONG32 memberDots) { m_syntax = syntax; m_nameFlags = nameFlags; m_memberDots = memberDots; Clear(); } void SplitName::Delete(void) { delete [] m_namespaceName; m_namespaceName = NULL; delete [] m_typeName; m_typeName = NULL; delete [] m_memberName; m_memberName = NULL; delete [] m_params; m_params = NULL; } void SplitName::Clear(void) { m_namespaceName = NULL; m_typeName = NULL; m_typeToken = mdTypeDefNil; m_memberName = NULL; m_memberToken = mdTokenNil; m_params = NULL; m_tlsThread = NULL; m_metaEnum.m_appDomain = NULL; m_module = NULL; m_lastField = NULL; } HRESULT SplitName::SplitString(_In_opt_ PCWSTR fullName) { if (m_syntax == SPLIT_NO_NAME) { if (fullName) { return E_INVALIDARG; } return S_OK; } else if (!fullName) { return E_INVALIDARG; } return SplitFullName(fullName, m_syntax, m_memberDots, &m_namespaceName, &m_typeName, &m_memberName, &m_params); } FORCEINLINE WCHAR* wcrscan(LPCWSTR beg, LPCWSTR end, WCHAR ch) { //_ASSERTE(beg <= end); WCHAR *p; for (p = (WCHAR*)end; p >= beg; --p) { if (*p == ch) break; } return p; } // This functions allocates a new UTF8 string that contains the classname // lying between the current sepName and the previous sepName. E.g. for a // class name of "Outer+middler+inner" when sepName points to the NULL // terminator this function will return "inner" in pResult and will update // sepName to point to the second '+' character in the string. When sepName // points to the first '+' character this function will return "Outer" in // pResult and sepName will point one WCHAR before fullName. HRESULT NextEnclosingClasName(LPCWSTR fullName, _Outref_ LPWSTR& sepName, _Outptr_ LPUTF8 *pResult) { if (sepName < fullName) { return E_FAIL; } //_ASSERTE(*sepName == W('\0') || *sepName == W('+') || *sepName == W('/')); LPWSTR origInnerName = sepName-1; if ((sepName = wcrscan(fullName, origInnerName, W('+'))) < fullName) { sepName = wcrscan(fullName, origInnerName, W('/')); } return AllocUtf8(sepName+1, static_cast<ULONG32>(origInnerName-sepName), pResult); } bool SplitName::FindType(IMDInternalImport* mdInternal) { if (m_typeToken != mdTypeDefNil) { return true; } if (!m_typeName) { return false; } if ((m_namespaceName == NULL || m_namespaceName[0] == '\0') && (CompareUtf8(COR_MODULE_CLASS, m_typeName, m_nameFlags)==0)) { m_typeToken = TokenFromRid(1, mdtTypeDef); // <Module> class always has a RID of 1. return true; } MetaEnum metaEnum; if (metaEnum.Start(mdInternal, mdtTypeDef, mdTypeDefNil) != S_OK) { return false; } LPUTF8 curClassName; ULONG32 length; WCHAR wszName[MAX_CLASS_NAME]; if (ConvertUtf8(m_typeName, MAX_CLASS_NAME, &length, wszName) != S_OK) { return false; } WCHAR *pHead; Retry: pHead = wszName + length; if (FAILED(NextEnclosingClasName(wszName, pHead, &curClassName))) { return false; } // an inner class has an empty namespace associated with it HRESULT hr = metaEnum.NextTokenByName((pHead < wszName) ? m_namespaceName : "", curClassName, m_nameFlags, &m_typeToken); delete[] curClassName; if (hr != S_OK) { // if we didn't find a token with the given name return false; } else if (pHead < wszName) { // if we did find a token, *and* the class name given // does not specify any enclosing class, that's it return true; } else { // restart with innermost class pHead = wszName + length; mdTypeDef tkInner = m_typeToken; mdTypeDef tkOuter; BOOL bRetry = FALSE; LPUTF8 utf8Name; while ( !bRetry && SUCCEEDED(NextEnclosingClasName(wszName, pHead, &utf8Name)) ) { if (mdInternal->GetNestedClassProps(tkInner, &tkOuter) != S_OK) tkOuter = mdTypeDefNil; LPCSTR szName, szNS; if (FAILED(mdInternal->GetNameOfTypeDef(tkInner, &szName, &szNS))) { return false; } bRetry = (CompareUtf8(utf8Name, szName, m_nameFlags) != 0); if (!bRetry) { // if this is outermost class we need to compare namespaces too if (tkOuter == mdTypeDefNil) { // is this the outermost in the class name, too? if (pHead < wszName && CompareUtf8(m_namespaceName ? m_namespaceName : "", szNS, m_nameFlags) == 0) { delete[] utf8Name; return true; } else { bRetry = TRUE; } } } delete[] utf8Name; tkInner = tkOuter; } goto Retry; } } bool SplitName::FindMethod(IMDInternalImport* mdInternal) { if (m_memberToken != mdTokenNil) { return true; } if (m_typeToken == mdTypeDefNil || !m_memberName) { return false; } ULONG32 EmptySig = 0; // XXX Microsoft - Compare using signature when available. if (mdInternal->FindMethodDefUsingCompare(m_typeToken, m_memberName, (PCCOR_SIGNATURE)&EmptySig, sizeof(EmptySig), NULL, NULL, &m_memberToken) != S_OK) { m_memberToken = mdTokenNil; return false; } return true; } bool SplitName::FindField(IMDInternalImport* mdInternal) { if (m_memberToken != mdTokenNil) { return true; } if (m_typeToken == mdTypeDefNil || !m_memberName || m_params) { // Can't have params with a field. return false; } MetaEnum metaEnum; if (metaEnum.Start(mdInternal, mdtFieldDef, m_typeToken) != S_OK) { return false; } return metaEnum.NextTokenByName(NULL, m_memberName, m_nameFlags, &m_memberToken) == S_OK; } HRESULT SplitName::AllocAndSplitString(_In_opt_ PCWSTR fullName, SplitSyntax syntax, ULONG32 nameFlags, ULONG32 memberDots, SplitName** split) { HRESULT status; if (nameFlags & ~(CLRDATA_BYNAME_CASE_SENSITIVE | CLRDATA_BYNAME_CASE_INSENSITIVE)) { return E_INVALIDARG; } *split = new (nothrow) SplitName(syntax, nameFlags, memberDots); if (!*split) { return E_OUTOFMEMORY; } if ((status = (*split)->SplitString(fullName)) != S_OK) { delete (*split); return status; } return S_OK; } HRESULT SplitName::CdStartMethod(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, mdTypeDef typeToken, AppDomain* appDomain, IXCLRDataAppDomain* pubAppDomain, SplitName** splitRet, CLRDATA_ENUM* handle) { HRESULT status; SplitName* split; ULONG methDots = 0; *handle = TO_CDENUM(NULL); Retry: if ((status = SplitName:: AllocAndSplitString(fullName, SPLIT_METHOD, nameFlags, methDots, &split)) != S_OK) { return status; } if (typeToken == mdTypeDefNil) { if (!split->FindType(mod->GetMDImport())) { bool hasNamespace = split->m_namespaceName != NULL; delete split; // // We may have a case where there's an // explicitly implemented method which // has dots in the name. If it's possible // to move the method name dot split // back, go ahead and retry that way. // if (hasNamespace) { methDots++; goto Retry; } return E_INVALIDARG; } typeToken = split->m_typeToken; } else { if (split->m_namespaceName || split->m_typeName) { delete split; return E_INVALIDARG; } } if ((status = split->m_metaEnum. Start(mod->GetMDImport(), mdtMethodDef, typeToken)) != S_OK) { delete split; return status; } split->m_metaEnum.m_appDomain = appDomain; if (pubAppDomain) { split->m_metaEnum.m_appDomain = ((ClrDataAppDomain*)pubAppDomain)->GetAppDomain(); } split->m_module = mod; *handle = TO_CDENUM(split); if (splitRet) { *splitRet = split; } return S_OK; } HRESULT SplitName::CdNextMethod(CLRDATA_ENUM* handle, mdMethodDef* token) { SplitName* split = FROM_CDENUM(SplitName, *handle); if (!split) { return E_INVALIDARG; } return split->m_metaEnum. NextTokenByName(NULL, split->m_memberName, split->m_nameFlags, token); } HRESULT SplitName::CdNextDomainMethod(CLRDATA_ENUM* handle, AppDomain** appDomain, mdMethodDef* token) { SplitName* split = FROM_CDENUM(SplitName, *handle); if (!split) { return E_INVALIDARG; } return split->m_metaEnum. NextDomainTokenByName(NULL, split->m_memberName, split->m_nameFlags, appDomain, token); } HRESULT SplitName::CdStartField(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, ULONG32 fieldFlags, IXCLRDataTypeInstance* fromTypeInst, TypeHandle typeHandle, Module* mod, mdTypeDef typeToken, ULONG64 objBase, Thread* tlsThread, IXCLRDataTask* pubTlsThread, AppDomain* appDomain, IXCLRDataAppDomain* pubAppDomain, SplitName** splitRet, CLRDATA_ENUM* handle) { HRESULT status; SplitName* split; *handle = TO_CDENUM(NULL); if ((status = SplitName:: AllocAndSplitString(fullName, fullName ? SPLIT_FIELD : SPLIT_NO_NAME, nameFlags, 0, &split)) != S_OK) { return status; } if (typeHandle.IsNull()) { if (typeToken == mdTypeDefNil) { if (!split->FindType(mod->GetMDImport())) { status = E_INVALIDARG; goto Fail; } typeToken = split->m_typeToken; } else { if (split->m_namespaceName || split->m_typeName) { status = E_INVALIDARG; goto Fail; } } // With phased class loading, this may return a partially-loaded type // @todo : does this matter? typeHandle = mod->LookupTypeDef(split->m_typeToken); if (typeHandle.IsNull()) { status = E_UNEXPECTED; goto Fail; } } if ((status = InitFieldIter(&split->m_fieldEnum, typeHandle, true, fieldFlags, fromTypeInst)) != S_OK) { goto Fail; } split->m_objBase = objBase; split->m_tlsThread = tlsThread; if (pubTlsThread) { split->m_tlsThread = ((ClrDataTask*)pubTlsThread)->GetThread(); } split->m_metaEnum.m_appDomain = appDomain; if (pubAppDomain) { split->m_metaEnum.m_appDomain = ((ClrDataAppDomain*)pubAppDomain)->GetAppDomain(); } split->m_module = mod; *handle = TO_CDENUM(split); if (splitRet) { *splitRet = split; } return S_OK; Fail: delete split; return status; } HRESULT SplitName::CdNextField(ClrDataAccess* dac, CLRDATA_ENUM* handle, IXCLRDataTypeDefinition** fieldType, ULONG32* fieldFlags, IXCLRDataValue** value, ULONG32 nameBufRetLen, ULONG32* nameLenRet, _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef* tokenRet) { HRESULT status; SplitName* split = FROM_CDENUM(SplitName, *handle); if (!split) { return E_INVALIDARG; } FieldDesc* fieldDesc; while ((fieldDesc = split->m_fieldEnum.Next())) { if (split->m_syntax != SPLIT_NO_NAME) { LPCUTF8 fieldName; if (FAILED(fieldDesc->GetName_NoThrow(&fieldName)) || (split->Compare(split->m_memberName, fieldName) != 0)) { continue; } } split->m_lastField = fieldDesc; if (fieldFlags != NULL) { *fieldFlags = GetTypeFieldValueFlags(fieldDesc->GetFieldTypeHandleThrowing(), fieldDesc, split->m_fieldEnum. IsFieldFromParentClass() ? CLRDATA_FIELD_IS_INHERITED : 0, false); } if ((nameBufRetLen != 0) || (nameLenRet != NULL)) { LPCUTF8 szFieldName; status = fieldDesc->GetName_NoThrow(&szFieldName); if (status != S_OK) { return status; } status = ConvertUtf8( szFieldName, nameBufRetLen, nameLenRet, nameBufRet); if (status != S_OK) { return status; } } if (tokenScopeRet && !value) { *tokenScopeRet = new (nothrow) ClrDataModule(dac, fieldDesc->GetModule()); if (!*tokenScopeRet) { return E_OUTOFMEMORY; } } if (tokenRet) { *tokenRet = fieldDesc->GetMemberDef(); } if (fieldType) { TypeHandle fieldTypeHandle = fieldDesc->GetFieldTypeHandleThrowing(); *fieldType = new (nothrow) ClrDataTypeDefinition(dac, fieldTypeHandle.GetModule(), fieldTypeHandle.GetMethodTable()->GetCl(), fieldTypeHandle); if (!*fieldType && tokenScopeRet) { delete (ClrDataModule*)*tokenScopeRet; } return *fieldType ? S_OK : E_OUTOFMEMORY; } if (value) { return ClrDataValue:: NewFromFieldDesc(dac, split->m_metaEnum.m_appDomain, split->m_fieldEnum.IsFieldFromParentClass() ? CLRDATA_VALUE_IS_INHERITED : 0, fieldDesc, split->m_objBase, split->m_tlsThread, NULL, value, nameBufRetLen, nameLenRet, nameBufRet, tokenScopeRet, tokenRet); } return S_OK; } return S_FALSE; } HRESULT SplitName::CdNextDomainField(ClrDataAccess* dac, CLRDATA_ENUM* handle, IXCLRDataValue** value) { HRESULT status; SplitName* split = FROM_CDENUM(SplitName, *handle); if (!split) { return E_INVALIDARG; } if (split->m_metaEnum.m_appDomain) { // Use only the caller-provided app domain. return CdNextField(dac, handle, NULL, NULL, value, 0, NULL, NULL, NULL, NULL); } // // Splay fields across all app domains. // for (;;) { if (!split->m_lastField) { // Need to fetch a field. if ((status = CdNextField(dac, handle, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL)) != S_OK) { return status; } split->m_metaEnum.m_domainIter.Init(); } if (split->m_metaEnum.m_domainIter.Next()) { break; } split->m_lastField = NULL; } return ClrDataValue:: NewFromFieldDesc(dac, split->m_metaEnum.m_domainIter.GetDomain(), split->m_fieldEnum.IsFieldFromParentClass() ? CLRDATA_VALUE_IS_INHERITED : 0, split->m_lastField, split->m_objBase, split->m_tlsThread, NULL, value, 0, NULL, NULL, NULL, NULL); } HRESULT SplitName::CdStartType(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, AppDomain* appDomain, IXCLRDataAppDomain* pubAppDomain, SplitName** splitRet, CLRDATA_ENUM* handle) { HRESULT status; SplitName* split; *handle = TO_CDENUM(NULL); if ((status = SplitName:: AllocAndSplitString(fullName, SPLIT_TYPE, nameFlags, 0, &split)) != S_OK) { return status; } if ((status = split->m_metaEnum. Start(mod->GetMDImport(), mdtTypeDef, mdTokenNil)) != S_OK) { delete split; return status; } split->m_metaEnum.m_appDomain = appDomain; if (pubAppDomain) { split->m_metaEnum.m_appDomain = ((ClrDataAppDomain*)pubAppDomain)->GetAppDomain(); } split->m_module = mod; *handle = TO_CDENUM(split); if (splitRet) { *splitRet = split; } return S_OK; } HRESULT SplitName::CdNextType(CLRDATA_ENUM* handle, mdTypeDef* token) { SplitName* split = FROM_CDENUM(SplitName, *handle); if (!split) { return E_INVALIDARG; } return split->m_metaEnum. NextTokenByName(split->m_namespaceName, split->m_typeName, split->m_nameFlags, token); } HRESULT SplitName::CdNextDomainType(CLRDATA_ENUM* handle, AppDomain** appDomain, mdTypeDef* token) { SplitName* split = FROM_CDENUM(SplitName, *handle); if (!split) { return E_INVALIDARG; } return split->m_metaEnum. NextDomainTokenByName(split->m_namespaceName, split->m_typeName, split->m_nameFlags, appDomain, token); } //---------------------------------------------------------------------------- // // DacInstanceManager. // // Data retrieved from the target process is cached for two reasons: // // 1. It may be necessary to map from the host address back to the target // address. For example, if any code uses a 'this' pointer or // takes the address of a field the address has to be translated from // host to target. This requires instances to be held as long as // they may be referenced. // // 2. Data is often referenced multiple times so caching is an important // performance advantage. // // Ideally we'd like to implement a simple page cache but this is // complicated by the fact that user minidump memory can have // arbitrary granularity and also that the member operator (->) // needs to return a pointer to an object. That means that all of // the data for an object must be sequential and cannot be split // at page boundaries. // // Data can also be accessed with different sizes. For example, // a base struct can be accessed, then cast to a derived struct and // accessed again with the larger derived size. The cache must // be able to replace data to maintain the largest amount of data // touched. // // We keep track of each access and the recovered memory for it. // A hash on target address allows quick access to instance data // by target address. The data for each access has a header on it // for bookkeeping purposes, so host address to target address translation // is just a matter of backing up to the header and pulling the target // address from it. Keeping each access separately allows easy // replacement by larger accesses. // //---------------------------------------------------------------------------- DacInstanceManager::DacInstanceManager(void) : m_unusedBlock(NULL) { InitEmpty(); } DacInstanceManager::~DacInstanceManager(void) { // We are stopping debugging in this case, so don't save any block of memory. // Otherwise, there will be a memory leak. Flush(false); } #if defined(DAC_HASHTABLE) DAC_INSTANCE* DacInstanceManager::Add(DAC_INSTANCE* inst) { // Assert that we don't add NULL instances. This allows us to assert that found instances // are not NULL in DacInstanceManager::Find _ASSERTE(inst != NULL); DWORD nHash = DAC_INSTANCE_HASH(inst->addr); HashInstanceKeyBlock* block = m_hash[nHash]; if (!block || block->firstElement == 0) { HashInstanceKeyBlock* newBlock; if (block) { newBlock = (HashInstanceKeyBlock*) new (nothrow) BYTE[HASH_INSTANCE_BLOCK_ALLOC_SIZE]; } else { // We allocate one big memory chunk that has a block for every index of the hash table to // improve data locality and reduce the number of allocs. In most cases, a hash bucket will // use only one block, so improving data locality across blocks (i.e. keeping the buckets of the // hash table together) should help. newBlock = (HashInstanceKeyBlock*) ClrVirtualAlloc(NULL, HASH_INSTANCE_BLOCK_ALLOC_SIZE*ARRAY_SIZE(m_hash), MEM_COMMIT, PAGE_READWRITE); } if (!newBlock) { return NULL; } if (block) { // We add the newest block to the start of the list assuming that most accesses are for // recently added elements. newBlock->next = block; m_hash[nHash] = newBlock; // The previously allocated block newBlock->firstElement = HASH_INSTANCE_BLOCK_NUM_ELEMENTS; block = newBlock; } else { for (DWORD j = 0; j < ARRAY_SIZE(m_hash); j++) { m_hash[j] = newBlock; newBlock->next = NULL; // The previously allocated block newBlock->firstElement = HASH_INSTANCE_BLOCK_NUM_ELEMENTS; newBlock = (HashInstanceKeyBlock*) (((BYTE*) newBlock) + HASH_INSTANCE_BLOCK_ALLOC_SIZE); } block = m_hash[nHash]; } } _ASSERTE(block->firstElement > 0); block->firstElement--; block->instanceKeys[block->firstElement].addr = inst->addr; block->instanceKeys[block->firstElement].instance = inst; inst->next = NULL; return inst; } #else //DAC_HASHTABLE DAC_INSTANCE* DacInstanceManager::Add(DAC_INSTANCE* inst) { _ASSERTE(inst != NULL); #ifdef _DEBUG bool isInserted = (m_hash.find(inst->addr) == m_hash.end()); #endif //_DEBUG DAC_INSTANCE *(&target) = m_hash[inst->addr]; _ASSERTE(!isInserted || target == NULL); if( target != NULL ) { //This is necessary to preserve the semantics of Supersede, however, it //is more or less dead code. inst->next = target; target = inst; //verify descending order _ASSERTE(inst->size >= target->size); } else { target = inst; } return inst; } #endif // #if defined(DAC_HASHTABLE) DAC_INSTANCE* DacInstanceManager::Alloc(TADDR addr, ULONG32 size, DAC_USAGE_TYPE usage) { SUPPORTS_DAC_HOST_ONLY; DAC_INSTANCE_BLOCK* block; DAC_INSTANCE* inst; ULONG32 fullSize; static_assert_no_msg(sizeof(DAC_INSTANCE_BLOCK) <= DAC_INSTANCE_ALIGN); static_assert_no_msg((sizeof(DAC_INSTANCE) & (DAC_INSTANCE_ALIGN - 1)) == 0); // // All allocated instances must be kept alive as long // as anybody may have a host pointer for one of them. // This means that we cannot delete an arbitrary instance // unless we are sure no pointers exist, which currently // is not possible to determine, thus we just hold everything // until a Flush. This greatly simplifies instance allocation // as we can then just sweep through large blocks rather // than having to use a real allocator. The only // complication is that we need to keep all instance // data aligned. We have guaranteed that the header will // preserve alignment of the data following if the header // is aligned, so as long as we round up all allocations // to a multiple of the alignment size everything just works. // fullSize = (size + DAC_INSTANCE_ALIGN - 1) & ~(DAC_INSTANCE_ALIGN - 1); _ASSERTE(fullSize && fullSize <= 0xffffffff - 2 * sizeof(*inst)); fullSize += sizeof(*inst); // // Check for an existing block with space. // for (block = m_blocks; block; block = block->next) { if (fullSize <= block->bytesFree) { break; } } if (!block) { // // No existing block has enough space, so allocate a new // one if necessary and link it in. We know we're allocating large // blocks so directly VirtualAlloc. We save one block through a // flush so that we spend less time allocating/deallocating. // ULONG32 blockSize = fullSize + DAC_INSTANCE_ALIGN; if (blockSize < DAC_INSTANCE_BLOCK_ALLOCATION) { blockSize = DAC_INSTANCE_BLOCK_ALLOCATION; } // If we have a saved block and it's large enough, use it. block = m_unusedBlock; if ((block != NULL) && ((block->bytesUsed + block->bytesFree) >= blockSize)) { m_unusedBlock = NULL; // Right now, we're locked to DAC_INSTANCE_BLOCK_ALLOCATION but // that might change in the future if we decide to do something // else with the size guarantee in code:DacInstanceManager::FreeAllBlocks blockSize = block->bytesUsed + block->bytesFree; } else { block = (DAC_INSTANCE_BLOCK*) ClrVirtualAlloc(NULL, blockSize, MEM_COMMIT, PAGE_READWRITE); } if (!block) { return NULL; } // Keep the first aligned unit for the block header. block->bytesUsed = DAC_INSTANCE_ALIGN; block->bytesFree = blockSize - DAC_INSTANCE_ALIGN; block->next = m_blocks; m_blocks = block; m_blockMemUsage += blockSize; } inst = (DAC_INSTANCE*)((PBYTE)block + block->bytesUsed); block->bytesUsed += fullSize; _ASSERTE(block->bytesFree >= fullSize); block->bytesFree -= fullSize; inst->next = NULL; inst->addr = addr; inst->size = size; inst->sig = DAC_INSTANCE_SIG; inst->usage = usage; inst->enumMem = 0; inst->MDEnumed = 0; m_numInst++; m_instMemUsage += fullSize; return inst; } void DacInstanceManager::ReturnAlloc(DAC_INSTANCE* inst) { SUPPORTS_DAC_HOST_ONLY; DAC_INSTANCE_BLOCK* block; DAC_INSTANCE_BLOCK * pPrevBlock; ULONG32 fullSize; // // This special routine handles cleanup in // cases where an instances has been allocated // but must be returned due to a following error. // The given instance must be the last instance // in an existing block. // fullSize = ((inst->size + DAC_INSTANCE_ALIGN - 1) & ~(DAC_INSTANCE_ALIGN - 1)) + sizeof(*inst); pPrevBlock = NULL; for (block = m_blocks; block; pPrevBlock = block, block = block->next) { if ((PBYTE)inst == (PBYTE)block + (block->bytesUsed - fullSize)) { break; } } if (!block) { return; } block->bytesUsed -= fullSize; block->bytesFree += fullSize; m_numInst--; m_instMemUsage -= fullSize; // If the block is empty after returning the specified instance, that means this block was newly created // when this instance was allocated. We have seen cases where we are asked to allocate a // large chunk of memory only to fail to read the memory from a dump later on, i.e. when both the target // address and the size are invalid. If we keep the allocation, we'll grow the VM size unnecessarily. // Thus, release a block if it's empty and if it's not the default size (to avoid thrashing memory). // See Dev10 Dbug 812112 for more information. if ((block->bytesUsed == DAC_INSTANCE_ALIGN) && ((block->bytesFree + block->bytesUsed) != DAC_INSTANCE_BLOCK_ALLOCATION)) { // The empty block is at the beginning of the list. if (pPrevBlock == NULL) { m_blocks = block->next; } else { _ASSERTE(pPrevBlock->next == block); pPrevBlock->next = block->next; } ClrVirtualFree(block, 0, MEM_RELEASE); } } #if defined(DAC_HASHTABLE) DAC_INSTANCE* DacInstanceManager::Find(TADDR addr) { #if defined(DAC_MEASURE_PERF) unsigned _int64 nStart, nEnd; g_nFindCalls++; nStart = GetCycleCount(); #endif // #if defined(DAC_MEASURE_PERF) HashInstanceKeyBlock* block = m_hash[DAC_INSTANCE_HASH(addr)]; #if defined(DAC_MEASURE_PERF) nEnd = GetCycleCount(); g_nFindHashTotalTime += nEnd - nStart; #endif // #if defined(DAC_MEASURE_PERF) while (block) { DWORD nIndex = block->firstElement; for (; nIndex < HASH_INSTANCE_BLOCK_NUM_ELEMENTS; nIndex++) { if (block->instanceKeys[nIndex].addr == addr) { #if defined(DAC_MEASURE_PERF) nEnd = GetCycleCount(); g_nFindHits++; g_nFindTotalTime += nEnd - nStart; if (g_nStackWalk) g_nFindStackTotalTime += nEnd - nStart; #endif // #if defined(DAC_MEASURE_PERF) DAC_INSTANCE* inst = block->instanceKeys[nIndex].instance; // inst should not be NULL even if the address was superseded. We search // the entries in the reverse order they were added. So we should have // found the superseding entry before this one. (Of course, if a NULL instance // has been added, this assert is meaningless. DacInstanceManager::Add // asserts that NULL instances aren't added.) _ASSERTE(inst != NULL); return inst; } } block = block->next; } #if defined(DAC_MEASURE_PERF) nEnd = GetCycleCount(); g_nFindFails++; g_nFindTotalTime += nEnd - nStart; if (g_nStackWalk) g_nFindStackTotalTime += nEnd - nStart; #endif // #if defined(DAC_MEASURE_PERF) return NULL; } #else //DAC_HASHTABLE DAC_INSTANCE* DacInstanceManager::Find(TADDR addr) { DacInstanceHashIterator iter = m_hash.find(addr); if( iter == m_hash.end() ) { return NULL; } else { return iter->second; } } #endif // if defined(DAC_HASHTABLE) HRESULT DacInstanceManager::Write(DAC_INSTANCE* inst, bool throwEx) { HRESULT status; if (inst->usage == DAC_VPTR) { // Skip over the host-side vtable pointer when // writing back. status = DacWriteAll(inst->addr + sizeof(TADDR), (PBYTE)(inst + 1) + sizeof(PVOID), inst->size - sizeof(TADDR), throwEx); } else { // Write the whole instance back. status = DacWriteAll(inst->addr, inst + 1, inst->size, throwEx); } return status; } #if defined(DAC_HASHTABLE) void DacInstanceManager::Supersede(DAC_INSTANCE* inst) { _ASSERTE(inst != NULL); // // This instance has been superseded by a larger // one and so must be removed from the hash. However, // code may be holding the instance pointer so it // can't just be deleted. Put it on a list for // later cleanup. // HashInstanceKeyBlock* block = m_hash[DAC_INSTANCE_HASH(inst->addr)]; while (block) { DWORD nIndex = block->firstElement; for (; nIndex < HASH_INSTANCE_BLOCK_NUM_ELEMENTS; nIndex++) { if (block->instanceKeys[nIndex].instance == inst) { block->instanceKeys[nIndex].instance = NULL; break; } } if (nIndex < HASH_INSTANCE_BLOCK_NUM_ELEMENTS) { break; } block = block->next; } AddSuperseded(inst); } #else //DAC_HASHTABLE void DacInstanceManager::Supersede(DAC_INSTANCE* inst) { _ASSERTE(inst != NULL); // // This instance has been superseded by a larger // one and so must be removed from the hash. However, // code may be holding the instance pointer so it // can't just be deleted. Put it on a list for // later cleanup. // DacInstanceHashIterator iter = m_hash.find(inst->addr); if( iter == m_hash.end() ) return; DAC_INSTANCE** bucket = &(iter->second); DAC_INSTANCE* cur = *bucket; DAC_INSTANCE* prev = NULL; //walk through the chain looking for this particular instance while (cur) { if (cur == inst) { if (!prev) { *bucket = inst->next; } else { prev->next = inst->next; } break; } prev = cur; cur = cur->next; } AddSuperseded(inst); } #endif // if defined(DAC_HASHTABLE) // This is the default Flush() called when the DAC cache is invalidated, // e.g. when we continue the debuggee process. In this case, we want to // save one block of memory to avoid thrashing. See the usage of m_unusedBlock // for more information. void DacInstanceManager::Flush(void) { Flush(true); } void DacInstanceManager::Flush(bool fSaveBlock) { SUPPORTS_DAC_HOST_ONLY; // // All allocated memory is in the block // list, so just free the blocks and // forget all the internal pointers. // for (;;) { FreeAllBlocks(fSaveBlock); DAC_INSTANCE_PUSH* push = m_instPushed; if (!push) { break; } m_instPushed = push->next; m_blocks = push->blocks; delete push; } // If we are not saving any memory blocks, then clear the saved buffer block (if any) as well. if (!fSaveBlock) { if (m_unusedBlock != NULL) { ClrVirtualFree(m_unusedBlock, 0, MEM_RELEASE); m_unusedBlock = NULL; } } #if defined(DAC_HASHTABLE) for (int i = STRING_LENGTH(m_hash); i >= 0; i--) { HashInstanceKeyBlock* block = m_hash[i]; HashInstanceKeyBlock* next; while (block) { next = block->next; if (next) { delete [] block; } else if (i == 0) { ClrVirtualFree(block, 0, MEM_RELEASE); } block = next; } } #else //DAC_HASHTABLE m_hash.clear(); #endif //DAC_HASHTABLE InitEmpty(); } #if defined(DAC_HASHTABLE) void DacInstanceManager::ClearEnumMemMarker(void) { ULONG i; DAC_INSTANCE* inst; for (i = 0; i < ARRAY_SIZE(m_hash); i++) { HashInstanceKeyBlock* block = m_hash[i]; while (block) { DWORD j; for (j = block->firstElement; j < HASH_INSTANCE_BLOCK_NUM_ELEMENTS; j++) { inst = block->instanceKeys[j].instance; if (inst != NULL) { inst->enumMem = 0; } } block = block->next; } } for (inst = m_superseded; inst; inst = inst->next) { inst->enumMem = 0; } } #else //DAC_HASHTABLE void DacInstanceManager::ClearEnumMemMarker(void) { ULONG i; DAC_INSTANCE* inst; DacInstanceHashIterator end = m_hash.end(); /* REVISIT_TODO Fri 10/20/2006 * This might have an issue, since it might miss chained entries off of * ->next. However, ->next is going away, and for all intents and * purposes, this never happens. */ for( DacInstanceHashIterator cur = m_hash.begin(); cur != end; ++cur ) { cur->second->enumMem = 0; } for (inst = m_superseded; inst; inst = inst->next) { inst->enumMem = 0; } } #endif // if defined(DAC_HASHTABLE) #if defined(DAC_HASHTABLE) // // // Iterating through all of the hash entry and report the memory // instance to minidump // // This function returns the total number of bytes that it reported. // // UINT DacInstanceManager::DumpAllInstances( ICLRDataEnumMemoryRegionsCallback *pCallBack) // memory report call back { ULONG i; DAC_INSTANCE* inst; UINT cbTotal = 0; #if defined(DAC_MEASURE_PERF) FILE* fp = fopen("c:\\dumpLog.txt", "a"); int total = 0; #endif // #if defined(DAC_MEASURE_PERF) for (i = 0; i < ARRAY_SIZE(m_hash); i++) { #if defined(DAC_MEASURE_PERF) int numInBucket = 0; #endif // #if defined(DAC_MEASURE_PERF) HashInstanceKeyBlock* block = m_hash[i]; while (block) { DWORD j; for (j = block->firstElement; j < HASH_INSTANCE_BLOCK_NUM_ELEMENTS; j++) { inst = block->instanceKeys[j].instance; // Only report those we intended to. // So far, only metadata is excluded! // if (inst && inst->noReport == 0) { cbTotal += inst->size; HRESULT hr = pCallBack->EnumMemoryRegion(TO_CDADDR(inst->addr), inst->size); if (hr == COR_E_OPERATIONCANCELED) { ThrowHR(hr); } } #if defined(DAC_MEASURE_PERF) if (inst) { numInBucket++; } #endif // #if defined(DAC_MEASURE_PERF) } block = block->next; } #if defined(DAC_MEASURE_PERF) fprintf(fp, "%4d: %4d%s", i, numInBucket, (i+1)%5? "; " : "\n"); total += numInBucket; #endif // #if defined(DAC_MEASURE_PERF) } #if defined(DAC_MEASURE_PERF) fprintf(fp, "\n\nTotal entries: %d\n\n", total); fclose(fp); #endif // #if defined(DAC_MEASURE_PERF) return cbTotal; } #else //DAC_HASHTABLE // // // Iterating through all of the hash entry and report the memory // instance to minidump // // This function returns the total number of bytes that it reported. // // UINT DacInstanceManager::DumpAllInstances( ICLRDataEnumMemoryRegionsCallback *pCallBack) // memory report call back { SUPPORTS_DAC_HOST_ONLY; DAC_INSTANCE* inst; UINT cbTotal = 0; #if defined(DAC_MEASURE_PERF) FILE* fp = fopen("c:\\dumpLog.txt", "a"); #endif // #if defined(DAC_MEASURE_PERF) #if defined(DAC_MEASURE_PERF) int numInBucket = 0; #endif // #if defined(DAC_MEASURE_PERF) DacInstanceHashIterator end = m_hash.end(); for (DacInstanceHashIterator cur = m_hash.begin(); end != cur; ++cur) { inst = cur->second; // Only report those we intended to. // So far, only metadata is excluded! // if (inst->noReport == 0) { cbTotal += inst->size; HRESULT hr = pCallBack->EnumMemoryRegion(TO_CDADDR(inst->addr), inst->size); if (hr == COR_E_OPERATIONCANCELED) { ThrowHR(hr); } } #if defined(DAC_MEASURE_PERF) numInBucket++; #endif // #if defined(DAC_MEASURE_PERF) } #if defined(DAC_MEASURE_PERF) fprintf(fp, "\n\nTotal entries: %d\n\n", numInBucket); fclose(fp); #endif // #if defined(DAC_MEASURE_PERF) return cbTotal; } #endif // if defined(DAC_HASHTABLE) DAC_INSTANCE_BLOCK* DacInstanceManager::FindInstanceBlock(DAC_INSTANCE* inst) { for (DAC_INSTANCE_BLOCK* block = m_blocks; block; block = block->next) { if ((PBYTE)inst >= (PBYTE)block && (PBYTE)inst < (PBYTE)block + block->bytesUsed) { return block; } } return NULL; } // If fSaveBlock is false, free all blocks of allocated memory. Otherwise, // free all blocks except the one we save to avoid thrashing memory. // Callers very frequently flush repeatedly with little memory needed in DAC // so this avoids wasteful repeated allocations/deallocations. // There is a very unlikely case that we'll have allocated an extremely large // block; if this is the only block we will save none since this block will // remain allocated. void DacInstanceManager::FreeAllBlocks(bool fSaveBlock) { DAC_INSTANCE_BLOCK* block; while ((block = m_blocks)) { m_blocks = block->next; // If we haven't saved our single block yet and this block is the default size // then we will save it instead of freeing it. This avoids saving an unnecessarily large // memory block. // Do *NOT* trash the byte counts. code:DacInstanceManager::Alloc // depends on them being correct when checking to see if a block is large enough. if (fSaveBlock && (m_unusedBlock == NULL) && ((block->bytesFree + block->bytesUsed) == DAC_INSTANCE_BLOCK_ALLOCATION)) { // Just to avoid confusion, since we're keeping it around. block->next = NULL; m_unusedBlock = block; } else { ClrVirtualFree(block, 0, MEM_RELEASE); } } } //---------------------------------------------------------------------------- // // DacStreamManager. // //---------------------------------------------------------------------------- #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS namespace serialization { namespace bin { //======================================================================== // Support functions for binary serialization of simple types to a buffer: // - raw_size() returns the size in bytes of the binary representation // of a value. // - raw_serialize() copies the binary representation of a value into a // buffer. // - raw_deserialize() generates a value from its binary representation // in a buffer. // Beyond simple types the APIs below support SString instances. SStrings // are stored as UTF8 strings. //======================================================================== static const size_t ErrOverflow = (size_t)(-1); #ifndef TARGET_UNIX // Template class is_blittable template <typename _Ty, typename Enable = void> struct is_blittable : std::false_type { // determines whether _Ty is blittable }; template <typename _Ty> struct is_blittable<_Ty, typename std::enable_if<std::is_arithmetic<_Ty>::value>::type> : std::true_type { // determines whether _Ty is blittable }; // allow types to declare themselves blittable by including a static bool // member "is_blittable". template <typename _Ty> struct is_blittable<_Ty, typename std::enable_if<_Ty::is_blittable>::type> : std::true_type { // determines whether _Ty is blittable }; //======================================================================== // serialization::bin::Traits<T> enables binary serialization and // deserialization of instances of T. //======================================================================== // // General specialization for non-blittable types - must be overridden // for each specific non-blittable type. // template <typename T, typename Enable = void> class Traits { public: static FORCEINLINE size_t raw_size(const T & val) { static_assert(false, "Non-blittable types need explicit specializations"); } }; // // General type trait supporting serialization/deserialization of blittable // type arguments (as defined by the is_blittable<> type traits above). // template <typename T> class Traits<T, typename std::enable_if<is_blittable<T>::value>::type> { #else // TARGET_UNIX template <typename T> class Traits { #endif // !TARGET_UNIX public: // // raw_size() returns the size in bytes of the binary representation of a // value. // static FORCEINLINE size_t raw_size(const T & val) { return sizeof(T); } // // raw_serialize() copies the binary representation of a value into a // "dest" buffer that has "destSize" bytes available. // Returns raw_size(val), or ErrOverflow if the buffer does not have // enough space to accommodate "val". // static FORCEINLINE size_t raw_serialize(BYTE* dest, size_t destSize, const T & val) { size_t cnt = raw_size(val); if (destSize < cnt) { return ErrOverflow; } memcpy_s(dest, destSize, &val, cnt); return cnt; } // // raw_deserialize() generates a value "val" from its binary // representation in a buffer "src". // Returns raw_size(val), or ErrOverflow if the buffer does not have // enough space to accommodate "val". // static FORCEINLINE size_t raw_deserialize(T & val, const BYTE* src, size_t srcSize) { size_t cnt = raw_size(*(T*)src); if (srcSize < cnt) { return ErrOverflow; } memcpy_s(&val, cnt, src, cnt); return cnt; } }; // // Specialization for UTF8 strings // template<> class Traits<LPCUTF8> { public: static FORCEINLINE size_t raw_size(const LPCUTF8 & val) { return strlen(val) + 1; } static FORCEINLINE size_t raw_serialize(BYTE* dest, size_t destSize, const LPCUTF8 & val) { size_t cnt = raw_size(val); if (destSize < cnt) { return ErrOverflow; } memcpy_s(dest, destSize, &val, cnt); return cnt; } static FORCEINLINE size_t raw_deserialize(LPCUTF8 & val, const BYTE* src, size_t srcSize) { size_t cnt = strnlen((LPCUTF8)src, srcSize) + 1; // assert we found a NULL terminated string at "src" if (srcSize < cnt) { return ErrOverflow; } // we won't allocate another buffer for this string val = (LPCUTF8)src; return cnt; } }; // // Specialization for SString. // SString serialization/deserialization is performed to/from a UTF8 // string. // template<> class Traits<SString> { public: static FORCEINLINE size_t raw_size(const SString & val) { StackSString s; val.ConvertToUTF8(s); // make sure to include the NULL terminator return s.GetCount() + 1; } static FORCEINLINE size_t raw_serialize(BYTE* dest, size_t destSize, const SString & val) { // instead of calling raw_size() we inline it here, so we can reuse // the UTF8 string obtained below as an argument to memcpy. StackSString s; val.ConvertToUTF8(s); // make sure to include the NULL terminator size_t cnt = s.GetCount() + 1; if (destSize < cnt) { return ErrOverflow; } memcpy_s(dest, destSize, s.GetUTF8NoConvert(), cnt); return cnt; } static FORCEINLINE size_t raw_deserialize(SString & val, const BYTE* src, size_t srcSize) { size_t cnt = strnlen((LPCUTF8)src, srcSize) + 1; // assert we found a NULL terminated string at "src" if (srcSize < cnt) { return ErrOverflow; } // a literal SString avoids a new allocation + copy SString sUtf8(SString::Utf8Literal, (LPCUTF8) src); sUtf8.ConvertToUnicode(val); return cnt; } }; #ifndef TARGET_UNIX // // Specialization for SString-derived classes (like SStrings) // template<typename T> class Traits<T, typename std::enable_if<std::is_base_of<SString, T>::value>::type> : public Traits<SString> { }; #endif // !TARGET_UNIX // // Convenience functions to allow argument type deduction // template <typename T> FORCEINLINE size_t raw_size(const T & val) { return Traits<T>::raw_size(val); } template <typename T> FORCEINLINE size_t raw_serialize(BYTE* dest, size_t destSize, const T & val) { return Traits<T>::raw_serialize(dest, destSize, val); } template <typename T> FORCEINLINE size_t raw_deserialize(T & val, const BYTE* src, size_t srcSize) { return Traits<T>::raw_deserialize(val, src, srcSize); } enum StreamBuffState { sbsOK, sbsUnrecoverable, sbsOOM = sbsUnrecoverable, }; // // OStreamBuff - Manages writing to an output buffer // class OStreamBuff { public: OStreamBuff(BYTE * _buff, size_t _buffsize) : buffsize(_buffsize) , buff(_buff) , crt(0) , sbs(sbsOK) { } template <typename T> OStreamBuff& operator << (const T & val) { if (sbs >= sbsUnrecoverable) return *this; size_t cnt = raw_serialize(buff+crt, buffsize-crt, val); if (cnt == ErrOverflow) { sbs = sbsOOM; } else { crt += cnt; } return *this; } inline size_t GetPos() const { return crt; } inline BOOL operator!() const { return sbs >= sbsUnrecoverable; } inline StreamBuffState State() const { return sbs; } private: size_t buffsize; // size of buffer BYTE* buff; // buffer to stream to size_t crt; // current offset in buffer StreamBuffState sbs; // current state }; // // OStreamBuff - Manages reading from an input buffer // class IStreamBuff { public: IStreamBuff(const BYTE* _buff, size_t _buffsize) : buffsize(_buffsize) , buff(_buff) , crt(0) , sbs(sbsOK) { } template <typename T> IStreamBuff& operator >> (T & val) { if (sbs >= sbsUnrecoverable) return *this; size_t cnt = raw_deserialize(val, buff+crt, buffsize-crt); if (cnt == ErrOverflow) { sbs = sbsOOM; } else { crt += cnt; } return *this; } inline size_t GetPos() const { return crt; } inline BOOL operator!() const { return sbs >= sbsUnrecoverable; } inline StreamBuffState State() const { return sbs; } private: size_t buffsize; // size of buffer const BYTE * buff; // buffer to read from size_t crt; // current offset in buffer StreamBuffState sbs; // current state }; } } using serialization::bin::StreamBuffState; using serialization::bin::IStreamBuff; using serialization::bin::OStreamBuff; // Callback function type used by DacStreamManager to coordinate // amount of available memory between multiple streamable data // structures (e.g. DacEENamesStreamable) typedef bool (*Reserve_Fnptr)(DWORD size, void * writeState); // // DacEENamesStreamable // Stores EE struct* -> Name mappings and streams them to a // streambuf when asked // class DacEENamesStreamable { private: // the hash map storing the interesting mappings of EE* -> Names MapSHash< TADDR, SString, NoRemoveSHashTraits < NonDacAwareSHashTraits< MapSHashTraits <TADDR, SString> > > > m_hash; Reserve_Fnptr m_reserveFn; void *m_writeState; private: // signature value in the header in stream static const DWORD sig = 0x614e4545; // "EENa" - EE Name // header in stream struct StreamHeader { DWORD sig; // 0x614e4545 == "EENa" DWORD cnt; // count of entries static const bool is_blittable = true; }; public: DacEENamesStreamable() : m_reserveFn(NULL) , m_writeState(NULL) {} // Ensures the instance is ready for caching data and later writing // its map entries to an OStreamBuff. bool PrepareStreamForWriting(Reserve_Fnptr pfn, void * writeState) { _ASSERTE(pfn != NULL && writeState != NULL); m_reserveFn = pfn; m_writeState = writeState; DWORD size = (DWORD) sizeof(StreamHeader); // notify owner to reserve space for a StreamHeader return m_reserveFn(size, m_writeState); } // Adds a new mapping from an EE struct pointer (e.g. MethodDesc*) to // its name bool AddEEName(TADDR taEE, const SString & eeName) { _ASSERTE(m_reserveFn != NULL && m_writeState != NULL); // as a micro-optimization convert to Utf8 here as both raw_size and // raw_serialize are optimized for Utf8... StackSString seeName; eeName.ConvertToUTF8(seeName); DWORD size = (DWORD)(serialization::bin::raw_size(taEE) + serialization::bin::raw_size(seeName)); // notify owner of the amount of space needed in the buffer if (m_reserveFn(size, m_writeState)) { // if there's still space cache the entry in m_hash m_hash.AddOrReplace(KeyValuePair<TADDR, SString>(taEE, seeName)); return true; } else { return false; } } // Finds an EE name from a target address of an EE struct (e.g. // MethodDesc*) bool FindEEName(TADDR taEE, SString & eeName) const { return m_hash.Lookup(taEE, &eeName) == TRUE; } void Clear() { m_hash.RemoveAll(); } // Writes a header and the hash entries to an OStreamBuff HRESULT StreamTo(OStreamBuff &out) const { StreamHeader hdr; hdr.sig = sig; hdr.cnt = (DWORD) m_hash.GetCount(); out << hdr; auto end = m_hash.End(); for (auto cur = m_hash.Begin(); end != cur; ++cur) { out << cur->Key() << cur->Value(); if (!out) return E_FAIL; } return S_OK; } // Reads a header and the hash entries from an IStreamBuff HRESULT StreamFrom(IStreamBuff &in) { StreamHeader hdr; in >> hdr; // in >> hdr.sig >> hdr.cnt; if (hdr.sig != sig) return E_FAIL; for (size_t i = 0; i < hdr.cnt; ++i) { TADDR taEE; SString eeName; in >> taEE >> eeName; if (!in) return E_FAIL; m_hash.AddOrReplace(KeyValuePair<TADDR, SString>(taEE, eeName)); } return S_OK; } }; //================================================================================ // This class enables two scenarios: // 1. When debugging a triage/mini-dump the class is initialized with a valid // buffer in taMiniMetaDataBuff. Afterwards one can call MdCacheGetEEName to // retrieve the name associated with a MethodDesc*. // 2. When generating a dump one must follow this sequence: // a. Initialize the DacStreamManager passing a valid (if the current // debugging target is a triage/mini-dump) or empty buffer (if the // current target is a live processa full or a heap dump) // b. Call PrepareStreamsForWriting() before starting enumerating any memory // c. Call MdCacheAddEEName() anytime we enumerate an EE structure of interest // d. Call EnumStreams() as the last action in the memory enumeration method. // class DacStreamManager { public: enum eReadOrWrite { eNone, // the stream doesn't exist (target is a live process/full/heap dump) eRO, // the stream exists and we've read it (target is triage/mini-dump) eWO, // the stream doesn't exist but we're creating it // (e.g. to save a minidump from the current debugging session) eRW // the stream exists but we're generating another triage/mini-dump }; static const DWORD sig = 0x6d727473; // 'strm' struct StreamsHeader { DWORD dwSig; // 0x6d727473 == "strm" DWORD dwTotalSize; // total size in bytes DWORD dwCntStreams; // number of streams (currently 1) static const bool is_blittable = true; }; DacStreamManager(TADDR miniMetaDataBuffAddress, DWORD miniMetaDataBuffSizeMax) : m_MiniMetaDataBuffAddress(miniMetaDataBuffAddress) , m_MiniMetaDataBuffSizeMax(miniMetaDataBuffSizeMax) , m_rawBuffer(NULL) , m_cbAvailBuff(0) , m_rw(eNone) , m_bStreamsRead(FALSE) , m_EENames() { Initialize(); } ~DacStreamManager() { if (m_rawBuffer != NULL) { delete [] m_rawBuffer; } } bool PrepareStreamsForWriting() { if (m_rw == eNone) m_rw = eWO; else if (m_rw == eRO) m_rw = eRW; else if (m_rw == eRW) /* nothing */; else // m_rw == eWO { // this is a second invocation from a possibly live process // clean up the map since the callstacks/exceptions may be different m_EENames.Clear(); } // update available count based on the header and footer sizes if (m_MiniMetaDataBuffSizeMax < sizeof(StreamsHeader)) return false; m_cbAvailBuff = m_MiniMetaDataBuffSizeMax - sizeof(StreamsHeader); // update available count based on each stream's initial needs if (!m_EENames.PrepareStreamForWriting(&ReserveInBuffer, this)) return false; return true; } bool MdCacheAddEEName(TADDR taEEStruct, const SString& name) { // don't cache unless we enabled "W"riting from a target that does not // already have a stream yet if (m_rw != eWO) return false; m_EENames.AddEEName(taEEStruct, name); return true; } HRESULT EnumStreams(IN CLRDataEnumMemoryFlags flags) { _ASSERTE(flags == CLRDATA_ENUM_MEM_MINI || flags == CLRDATA_ENUM_MEM_TRIAGE); _ASSERTE(m_rw == eWO || m_rw == eRW); DWORD cbWritten = 0; if (m_rw == eWO) { // only dump the stream is it wasn't already present in the target DumpAllStreams(&cbWritten); } else { cbWritten = m_MiniMetaDataBuffSizeMax; } DacEnumMemoryRegion(m_MiniMetaDataBuffAddress, cbWritten, false); DacUpdateMemoryRegion(m_MiniMetaDataBuffAddress, cbWritten, m_rawBuffer); return S_OK; } bool MdCacheGetEEName(TADDR taEEStruct, SString & eeName) { if (!m_bStreamsRead) { ReadAllStreams(); } if (m_rw == eNone || m_rw == eWO) { return false; } return m_EENames.FindEEName(taEEStruct, eeName); } private: HRESULT Initialize() { _ASSERTE(m_rw == eNone); _ASSERTE(m_rawBuffer == NULL); HRESULT hr = S_OK; StreamsHeader hdr; DacReadAll(dac_cast<TADDR>(m_MiniMetaDataBuffAddress), &hdr, sizeof(hdr), true); // when the DAC looks at a triage dump or minidump generated using // a "minimetadata" enabled DAC, buff will point to a serialized // representation of a methoddesc->method name hashmap. if (hdr.dwSig == sig) { m_rw = eRO; m_MiniMetaDataBuffSizeMax = hdr.dwTotalSize; hr = S_OK; } else // when the DAC initializes this for the case where the target is // (a) a live process, or (b) a full dump, buff will point to a // zero initialized memory region (allocated w/ VirtualAlloc) if (hdr.dwSig == 0 && hdr.dwTotalSize == 0 && hdr.dwCntStreams == 0) { hr = S_OK; } // otherwise we may have some memory corruption. treat this as // a liveprocess/full dump else { hr = S_FALSE; } BYTE * buff = new BYTE[m_MiniMetaDataBuffSizeMax]; DacReadAll(dac_cast<TADDR>(m_MiniMetaDataBuffAddress), buff, m_MiniMetaDataBuffSizeMax, true); m_rawBuffer = buff; return hr; } HRESULT DumpAllStreams(DWORD * pcbWritten) { _ASSERTE(m_rw == eWO); HRESULT hr = S_OK; OStreamBuff out(m_rawBuffer, m_MiniMetaDataBuffSizeMax); // write header StreamsHeader hdr; hdr.dwSig = sig; hdr.dwTotalSize = m_MiniMetaDataBuffSizeMax-m_cbAvailBuff; // will update hdr.dwCntStreams = 1; out << hdr; // write MethodDesc->Method name map hr = m_EENames.StreamTo(out); // wrap up the buffer whether we ecountered an error or not size_t cbWritten = out.GetPos(); cbWritten = ALIGN_UP(cbWritten, sizeof(size_t)); // patch the dwTotalSize field blitted at the beginning of the buffer ((StreamsHeader*)m_rawBuffer)->dwTotalSize = (DWORD) cbWritten; if (pcbWritten) *pcbWritten = (DWORD) cbWritten; return hr; } HRESULT ReadAllStreams() { _ASSERTE(!m_bStreamsRead); if (m_rw == eNone || m_rw == eWO) { // no streams to read... m_bStreamsRead = TRUE; return S_FALSE; } HRESULT hr = S_OK; IStreamBuff in(m_rawBuffer, m_MiniMetaDataBuffSizeMax); // read header StreamsHeader hdr; in >> hdr; _ASSERTE(hdr.dwSig == sig); _ASSERTE(hdr.dwCntStreams == 1); // read EE struct pointer -> EE name map m_EENames.Clear(); hr = m_EENames.StreamFrom(in); m_bStreamsRead = TRUE; return hr; } static bool ReserveInBuffer(DWORD size, void * writeState) { DacStreamManager * pThis = reinterpret_cast<DacStreamManager*>(writeState); if (size > pThis->m_cbAvailBuff) { return false; } else { pThis->m_cbAvailBuff -= size; return true; } } private: TADDR m_MiniMetaDataBuffAddress; // TADDR of the buffer DWORD m_MiniMetaDataBuffSizeMax; // max size of buffer BYTE * m_rawBuffer; // inproc copy of buffer DWORD m_cbAvailBuff; // available bytes in buffer eReadOrWrite m_rw; BOOL m_bStreamsRead; DacEENamesStreamable m_EENames; }; #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS //---------------------------------------------------------------------------- // // ClrDataAccess. // //---------------------------------------------------------------------------- LONG ClrDataAccess::s_procInit; ClrDataAccess::ClrDataAccess(ICorDebugDataTarget * pTarget, ICLRDataTarget * pLegacyTarget/*=0*/) { SUPPORTS_DAC_HOST_ONLY; // ctor does no marshalling - don't check with DacCop /* * Stash the various forms of the new ICorDebugDataTarget interface */ m_pTarget = pTarget; m_pTarget->AddRef(); HRESULT hr; hr = m_pTarget->QueryInterface(__uuidof(ICorDebugMutableDataTarget), (void**)&m_pMutableTarget); if (hr != S_OK) { // Create a target which always fails the write requests with CORDBG_E_TARGET_READONLY m_pMutableTarget = new ReadOnlyDataTargetFacade(); m_pMutableTarget->AddRef(); } /* * If we have a legacy target, it means we're providing compatibility for code that used * the old ICLRDataTarget interfaces. There are still a few things (like metadata location, * GetImageBase, and VirtualAlloc) that the implementation may use which we haven't superseded * in ICorDebugDataTarget, so we still need access to the old target interfaces. * Any functionality that does exist in ICorDebugDataTarget is accessed from that interface * using the DataTargetAdapter on top of the legacy interface (to unify the calling code). * Eventually we may expose all functionality we need using ICorDebug (possibly a private * interface for things like VirtualAlloc), at which point we can stop using the legacy interfaces * completely (except in the DataTargetAdapter). */ m_pLegacyTarget = NULL; m_pLegacyTarget2 = NULL; m_pLegacyTarget3 = NULL; m_legacyMetaDataLocator = NULL; m_target3 = NULL; if (pLegacyTarget != NULL) { m_pLegacyTarget = pLegacyTarget; m_pLegacyTarget->AddRef(); m_pLegacyTarget->QueryInterface(__uuidof(ICLRDataTarget2), (void**)&m_pLegacyTarget2); m_pLegacyTarget->QueryInterface(__uuidof(ICLRDataTarget3), (void**)&m_pLegacyTarget3); if (pLegacyTarget->QueryInterface(__uuidof(ICLRMetadataLocator), (void**)&m_legacyMetaDataLocator) != S_OK) { // The debugger doesn't implement IMetadataLocator. Use // IXCLRDataTarget3 if that exists. Otherwise we don't need it. pLegacyTarget->QueryInterface(__uuidof(IXCLRDataTarget3), (void**)&m_target3); } } m_globalBase = 0; m_refs = 1; m_instanceAge = 0; m_debugMode = GetEnvironmentVariableA("MSCORDACWKS_DEBUG", NULL, 0) != 0; m_enumMemCb = NULL; m_updateMemCb = NULL; m_enumMemFlags = (CLRDataEnumMemoryFlags)-1; // invalid m_jitNotificationTable = NULL; m_gcNotificationTable = NULL; #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS m_streams = NULL; #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS // Target consistency checks are disabled by default. // See code:ClrDataAccess::SetTargetConsistencyChecks for details. m_fEnableTargetConsistencyAsserts = false; #ifdef _DEBUG if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_DbgDACEnableAssert)) { m_fEnableTargetConsistencyAsserts = true; } // Verification asserts are disabled by default because some debuggers (cdb/windbg) probe likely locations // for DAC and having this assert pop up all the time can be annoying. We let derived classes enable // this if they want. It can also be overridden at run-time with COMPlus_DbgDACAssertOnMismatch, // see ClrDataAccess::VerifyDlls for details. m_fEnableDllVerificationAsserts = false; #endif } ClrDataAccess::~ClrDataAccess(void) { SUPPORTS_DAC_HOST_ONLY; #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS if (m_streams) { delete m_streams; } #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS delete [] m_jitNotificationTable; if (m_pLegacyTarget) { m_pLegacyTarget->Release(); } if (m_pLegacyTarget2) { m_pLegacyTarget2->Release(); } if (m_pLegacyTarget3) { m_pLegacyTarget3->Release(); } if (m_legacyMetaDataLocator) { m_legacyMetaDataLocator->Release(); } if (m_target3) { m_target3->Release(); } m_pTarget->Release(); m_pMutableTarget->Release(); } STDMETHODIMP ClrDataAccess::QueryInterface(THIS_ IN REFIID interfaceId, OUT PVOID* iface) { void* ifaceRet; if (IsEqualIID(interfaceId, IID_IUnknown) || IsEqualIID(interfaceId, __uuidof(IXCLRDataProcess)) || IsEqualIID(interfaceId, __uuidof(IXCLRDataProcess2))) { ifaceRet = static_cast<IXCLRDataProcess2*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ICLRDataEnumMemoryRegions))) { ifaceRet = static_cast<ICLRDataEnumMemoryRegions*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface))) { ifaceRet = static_cast<ISOSDacInterface*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface2))) { ifaceRet = static_cast<ISOSDacInterface2*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface3))) { ifaceRet = static_cast<ISOSDacInterface3*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface4))) { ifaceRet = static_cast<ISOSDacInterface4*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface5))) { ifaceRet = static_cast<ISOSDacInterface5*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface6))) { ifaceRet = static_cast<ISOSDacInterface6*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface7))) { ifaceRet = static_cast<ISOSDacInterface7*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface8))) { ifaceRet = static_cast<ISOSDacInterface8*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface9))) { ifaceRet = static_cast<ISOSDacInterface9*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface10))) { ifaceRet = static_cast<ISOSDacInterface10*>(this); } else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface11))) { ifaceRet = static_cast<ISOSDacInterface11*>(this); } else { *iface = NULL; return E_NOINTERFACE; } AddRef(); *iface = ifaceRet; return S_OK; } STDMETHODIMP_(ULONG) ClrDataAccess::AddRef(THIS) { return InterlockedIncrement(&m_refs); } STDMETHODIMP_(ULONG) ClrDataAccess::Release(THIS) { SUPPORTS_DAC_HOST_ONLY; LONG newRefs = InterlockedDecrement(&m_refs); if (newRefs == 0) { delete this; } return newRefs; } HRESULT STDMETHODCALLTYPE ClrDataAccess::Flush(void) { SUPPORTS_DAC_HOST_ONLY; // // Free MD import objects. // m_mdImports.Flush(); // Free instance memory. m_instances.Flush(); // When the host instance cache is flushed we // update the instance age count so that // all child objects automatically become // invalid. This prevents them from using // any pointers they've kept to host instances // which are now gone. m_instanceAge++; return S_OK; } HRESULT STDMETHODCALLTYPE ClrDataAccess::StartEnumTasks( /* [out] */ CLRDATA_ENUM* handle) { HRESULT status; DAC_ENTER(); EX_TRY { if (ThreadStore::s_pThreadStore) { Thread* thread = ThreadStore::GetAllThreadList(NULL, 0, 0); *handle = TO_CDENUM(thread); status = *handle ? S_OK : S_FALSE; } else { status = S_FALSE; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EnumTask( /* [in, out] */ CLRDATA_ENUM* handle, /* [out] */ IXCLRDataTask **task) { HRESULT status; DAC_ENTER(); EX_TRY { if (*handle) { Thread* thread = FROM_CDENUM(Thread, *handle); *task = new (nothrow) ClrDataTask(this, thread); if (*task) { thread = ThreadStore::GetAllThreadList(thread, 0, 0); *handle = TO_CDENUM(thread); status = S_OK; } else { status = E_OUTOFMEMORY; } } else { status = S_FALSE; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EndEnumTasks( /* [in] */ CLRDATA_ENUM handle) { HRESULT status; DAC_ENTER(); EX_TRY { // Enumerator holds no resources. status = S_OK; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetTaskByOSThreadID( /* [in] */ ULONG32 osThreadID, /* [out] */ IXCLRDataTask **task) { HRESULT status; DAC_ENTER(); EX_TRY { status = E_INVALIDARG; Thread* thread = DacGetThread(osThreadID); if (thread != NULL) { *task = new (nothrow) ClrDataTask(this, thread); status = *task ? S_OK : E_OUTOFMEMORY; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetTaskByUniqueID( /* [in] */ ULONG64 uniqueID, /* [out] */ IXCLRDataTask **task) { HRESULT status; DAC_ENTER(); EX_TRY { Thread* thread = FindClrThreadByTaskId(uniqueID); if (thread) { *task = new (nothrow) ClrDataTask(this, thread); status = *task ? S_OK : E_OUTOFMEMORY; } else { status = E_INVALIDARG; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetFlags( /* [out] */ ULONG32 *flags) { HRESULT status; DAC_ENTER(); EX_TRY { // XXX Microsoft - GC check. *flags = CLRDATA_PROCESS_DEFAULT; status = S_OK; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::IsSameObject( /* [in] */ IXCLRDataProcess* process) { HRESULT status; DAC_ENTER(); EX_TRY { status = m_pTarget == ((ClrDataAccess*)process)->m_pTarget ? S_OK : S_FALSE; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetManagedObject( /* [out] */ IXCLRDataValue **value) { HRESULT status; DAC_ENTER(); EX_TRY { // XXX Microsoft. status = E_NOTIMPL; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetDesiredExecutionState( /* [out] */ ULONG32 *state) { HRESULT status; DAC_ENTER(); EX_TRY { // XXX Microsoft. status = E_NOTIMPL; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::SetDesiredExecutionState( /* [in] */ ULONG32 state) { HRESULT status; DAC_ENTER(); EX_TRY { // XXX Microsoft. status = E_NOTIMPL; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetAddressType( /* [in] */ CLRDATA_ADDRESS address, /* [out] */ CLRDataAddressType* type) { HRESULT status; DAC_ENTER(); EX_TRY { // The only thing that constitutes a failure is some // dac failure while checking things. status = S_OK; TADDR taAddr = CLRDATA_ADDRESS_TO_TADDR(address); if (IsPossibleCodeAddress(taAddr) == S_OK) { if (ExecutionManager::IsManagedCode(taAddr)) { *type = CLRDATA_ADDRESS_MANAGED_METHOD; goto Exit; } if (StubManager::IsStub(taAddr)) { *type = CLRDATA_ADDRESS_RUNTIME_UNMANAGED_STUB; goto Exit; } } *type = CLRDATA_ADDRESS_UNRECOGNIZED; Exit: ; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetRuntimeNameByAddress( /* [in] */ CLRDATA_ADDRESS address, /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *symbolLen, /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement) { HRESULT status; DAC_ENTER(); EX_TRY { #ifdef TARGET_ARM address &= ~THUMB_CODE; //workaround for windbg passing in addresses with the THUMB mode bit set #endif status = RawGetMethodName(address, flags, bufLen, symbolLen, symbolBuf, displacement); } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::StartEnumAppDomains( /* [out] */ CLRDATA_ENUM* handle) { HRESULT status; DAC_ENTER(); EX_TRY { AppDomainIterator* iter = new (nothrow) AppDomainIterator(FALSE); if (iter) { *handle = TO_CDENUM(iter); status = S_OK; } else { status = E_OUTOFMEMORY; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EnumAppDomain( /* [in, out] */ CLRDATA_ENUM* handle, /* [out] */ IXCLRDataAppDomain **appDomain) { HRESULT status; DAC_ENTER(); EX_TRY { AppDomainIterator* iter = FROM_CDENUM(AppDomainIterator, *handle); if (iter->Next()) { *appDomain = new (nothrow) ClrDataAppDomain(this, iter->GetDomain()); status = *appDomain ? S_OK : E_OUTOFMEMORY; } else { status = S_FALSE; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EndEnumAppDomains( /* [in] */ CLRDATA_ENUM handle) { HRESULT status; DAC_ENTER(); EX_TRY { AppDomainIterator* iter = FROM_CDENUM(AppDomainIterator, handle); delete iter; status = S_OK; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetAppDomainByUniqueID( /* [in] */ ULONG64 uniqueID, /* [out] */ IXCLRDataAppDomain **appDomain) { HRESULT status; DAC_ENTER(); EX_TRY { if (uniqueID != DefaultADID) { status = E_INVALIDARG; } else { *appDomain = new (nothrow) ClrDataAppDomain(this, AppDomain::GetCurrentDomain()); status = *appDomain ? S_OK : E_OUTOFMEMORY; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::StartEnumAssemblies( /* [out] */ CLRDATA_ENUM* handle) { HRESULT status; DAC_ENTER(); EX_TRY { ProcessModIter* iter = new (nothrow) ProcessModIter; if (iter) { *handle = TO_CDENUM(iter); status = S_OK; } else { status = E_OUTOFMEMORY; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EnumAssembly( /* [in, out] */ CLRDATA_ENUM* handle, /* [out] */ IXCLRDataAssembly **assembly) { HRESULT status; DAC_ENTER(); EX_TRY { ProcessModIter* iter = FROM_CDENUM(ProcessModIter, *handle); Assembly* assem; if ((assem = iter->NextAssem())) { *assembly = new (nothrow) ClrDataAssembly(this, assem); status = *assembly ? S_OK : E_OUTOFMEMORY; } else { status = S_FALSE; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EndEnumAssemblies( /* [in] */ CLRDATA_ENUM handle) { HRESULT status; DAC_ENTER(); EX_TRY { ProcessModIter* iter = FROM_CDENUM(ProcessModIter, handle); delete iter; status = S_OK; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::StartEnumModules( /* [out] */ CLRDATA_ENUM* handle) { HRESULT status; DAC_ENTER(); EX_TRY { ProcessModIter* iter = new (nothrow) ProcessModIter; if (iter) { *handle = TO_CDENUM(iter); status = S_OK; } else { status = E_OUTOFMEMORY; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EnumModule( /* [in, out] */ CLRDATA_ENUM* handle, /* [out] */ IXCLRDataModule **mod) { HRESULT status; DAC_ENTER(); EX_TRY { ProcessModIter* iter = FROM_CDENUM(ProcessModIter, *handle); Module* curMod; if ((curMod = iter->NextModule())) { *mod = new (nothrow) ClrDataModule(this, curMod); status = *mod ? S_OK : E_OUTOFMEMORY; } else { status = S_FALSE; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EndEnumModules( /* [in] */ CLRDATA_ENUM handle) { HRESULT status; DAC_ENTER(); EX_TRY { ProcessModIter* iter = FROM_CDENUM(ProcessModIter, handle); delete iter; status = S_OK; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetModuleByAddress( /* [in] */ CLRDATA_ADDRESS address, /* [out] */ IXCLRDataModule** mod) { HRESULT status; DAC_ENTER(); EX_TRY { ProcessModIter modIter; Module* modDef; while ((modDef = modIter.NextModule())) { TADDR base; ULONG32 length; PEAssembly* pPEAssembly = modDef->GetPEAssembly(); if ((base = PTR_TO_TADDR(pPEAssembly->GetLoadedImageContents(&length)))) { if (TO_CDADDR(base) <= address && TO_CDADDR(base + length) > address) { break; } } } if (modDef) { *mod = new (nothrow) ClrDataModule(this, modDef); status = *mod ? S_OK : E_OUTOFMEMORY; } else { status = S_FALSE; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::StartEnumMethodDefinitionsByAddress( /* [in] */ CLRDATA_ADDRESS address, /* [out] */ CLRDATA_ENUM *handle) { HRESULT status; DAC_ENTER(); EX_TRY { ProcessModIter modIter; Module* modDef; while ((modDef = modIter.NextModule())) { TADDR base; ULONG32 length; PEAssembly* assembly = modDef->GetPEAssembly(); if ((base = PTR_TO_TADDR(assembly->GetLoadedImageContents(&length)))) { if (TO_CDADDR(base) <= address && TO_CDADDR(base + length) > address) { break; } } } status = EnumMethodDefinitions:: CdStart(modDef, true, address, handle); } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EnumMethodDefinitionByAddress( /* [out][in] */ CLRDATA_ENUM* handle, /* [out] */ IXCLRDataMethodDefinition **method) { HRESULT status; DAC_ENTER(); EX_TRY { status = EnumMethodDefinitions::CdNext(this, handle, method); } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EndEnumMethodDefinitionsByAddress( /* [in] */ CLRDATA_ENUM handle) { HRESULT status; DAC_ENTER(); EX_TRY { status = EnumMethodDefinitions::CdEnd(handle); } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::StartEnumMethodInstancesByAddress( /* [in] */ CLRDATA_ADDRESS address, /* [in] */ IXCLRDataAppDomain* appDomain, /* [out] */ CLRDATA_ENUM *handle) { HRESULT status; DAC_ENTER(); EX_TRY { MethodDesc* methodDesc; *handle = 0; status = S_FALSE; TADDR taddr; if( (status = TRY_CLRDATA_ADDRESS_TO_TADDR(address, &taddr)) != S_OK ) { goto Exit; } if (IsPossibleCodeAddress(taddr) != S_OK) { goto Exit; } methodDesc = ExecutionManager::GetCodeMethodDesc(taddr); if (!methodDesc) { goto Exit; } status = EnumMethodInstances::CdStart(methodDesc, appDomain, handle); Exit: ; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EnumMethodInstanceByAddress( /* [out][in] */ CLRDATA_ENUM* handle, /* [out] */ IXCLRDataMethodInstance **method) { HRESULT status; DAC_ENTER(); EX_TRY { status = EnumMethodInstances::CdNext(this, handle, method); } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::EndEnumMethodInstancesByAddress( /* [in] */ CLRDATA_ENUM handle) { HRESULT status; DAC_ENTER(); EX_TRY { status = EnumMethodInstances::CdEnd(handle); } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetDataByAddress( /* [in] */ CLRDATA_ADDRESS address, /* [in] */ ULONG32 flags, /* [in] */ IXCLRDataAppDomain* appDomain, /* [in] */ IXCLRDataTask* tlsTask, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataValue **value, /* [out] */ CLRDATA_ADDRESS *displacement) { HRESULT status; if (flags != 0) { return E_INVALIDARG; } DAC_ENTER(); EX_TRY { // XXX Microsoft. status = E_NOTIMPL; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetExceptionStateByExceptionRecord( /* [in] */ EXCEPTION_RECORD64 *record, /* [out] */ IXCLRDataExceptionState **exception) { HRESULT status; DAC_ENTER(); EX_TRY { // XXX Microsoft. status = E_NOTIMPL; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::TranslateExceptionRecordToNotification( /* [in] */ EXCEPTION_RECORD64 *record, /* [in] */ IXCLRDataExceptionNotification *notify) { HRESULT status = E_FAIL; ClrDataModule* pubModule = NULL; ClrDataMethodInstance* pubMethodInst = NULL; ClrDataExceptionState* pubExState = NULL; GcEvtArgs pubGcEvtArgs = {}; ULONG32 notifyType = 0; DWORD catcherNativeOffset = 0; TADDR nativeCodeLocation = NULL; DAC_ENTER(); EX_TRY { // // We cannot hold the dac lock while calling // out as the external code can do arbitrary things. // Instead we make a pass over the exception // information and create all necessary objects. // We then leave the lock and make the callbac. // TADDR exInfo[EXCEPTION_MAXIMUM_PARAMETERS]; for (UINT i = 0; i < EXCEPTION_MAXIMUM_PARAMETERS; i++) { exInfo[i] = TO_TADDR(record->ExceptionInformation[i]); } notifyType = DACNotify::GetType(exInfo); switch(notifyType) { case DACNotify::MODULE_LOAD_NOTIFICATION: { TADDR modulePtr; if (DACNotify::ParseModuleLoadNotification(exInfo, modulePtr)) { Module* clrModule = PTR_Module(modulePtr); pubModule = new (nothrow) ClrDataModule(this, clrModule); if (pubModule == NULL) { status = E_OUTOFMEMORY; } else { status = S_OK; } } break; } case DACNotify::MODULE_UNLOAD_NOTIFICATION: { TADDR modulePtr; if (DACNotify::ParseModuleUnloadNotification(exInfo, modulePtr)) { Module* clrModule = PTR_Module(modulePtr); pubModule = new (nothrow) ClrDataModule(this, clrModule); if (pubModule == NULL) { status = E_OUTOFMEMORY; } else { status = S_OK; } } break; } case DACNotify::JIT_NOTIFICATION2: { TADDR methodDescPtr; if(DACNotify::ParseJITNotification(exInfo, methodDescPtr, nativeCodeLocation)) { // Try and find the right appdomain MethodDesc* methodDesc = PTR_MethodDesc(methodDescPtr); BaseDomain* baseDomain = methodDesc->GetDomain(); AppDomain* appDomain = NULL; if (baseDomain->IsAppDomain()) { appDomain = PTR_AppDomain(PTR_HOST_TO_TADDR(baseDomain)); } else { // Find a likely domain, because it's the shared domain. AppDomainIterator adi(FALSE); appDomain = adi.GetDomain(); } pubMethodInst = new (nothrow) ClrDataMethodInstance(this, appDomain, methodDesc); if (pubMethodInst == NULL) { status = E_OUTOFMEMORY; } else { status = S_OK; } } break; } case DACNotify::EXCEPTION_NOTIFICATION: { TADDR threadPtr; if (DACNotify::ParseExceptionNotification(exInfo, threadPtr)) { // Translation can only occur at the time of // receipt of the notify exception, so we assume // that the Thread's current exception state // is the state we want. status = ClrDataExceptionState:: NewFromThread(this, PTR_Thread(threadPtr), &pubExState, NULL); } break; } case DACNotify::GC_NOTIFICATION: { if (DACNotify::ParseGCNotification(exInfo, pubGcEvtArgs)) { status = S_OK; } break; } case DACNotify::CATCH_ENTER_NOTIFICATION: { TADDR methodDescPtr; if (DACNotify::ParseExceptionCatcherEnterNotification(exInfo, methodDescPtr, catcherNativeOffset)) { // Try and find the right appdomain MethodDesc* methodDesc = PTR_MethodDesc(methodDescPtr); BaseDomain* baseDomain = methodDesc->GetDomain(); AppDomain* appDomain = NULL; if (baseDomain->IsAppDomain()) { appDomain = PTR_AppDomain(PTR_HOST_TO_TADDR(baseDomain)); } else { // Find a likely domain, because it's the shared domain. AppDomainIterator adi(FALSE); appDomain = adi.GetDomain(); } pubMethodInst = new (nothrow) ClrDataMethodInstance(this, appDomain, methodDesc); if (pubMethodInst == NULL) { status = E_OUTOFMEMORY; } else { status = S_OK; } } break; } default: status = E_INVALIDARG; break; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); if (status == S_OK) { IXCLRDataExceptionNotification2* notify2; if (notify->QueryInterface(__uuidof(IXCLRDataExceptionNotification2), (void**)&notify2) != S_OK) { notify2 = NULL; } IXCLRDataExceptionNotification3* notify3; if (notify->QueryInterface(__uuidof(IXCLRDataExceptionNotification3), (void**)&notify3) != S_OK) { notify3 = NULL; } IXCLRDataExceptionNotification4* notify4; if (notify->QueryInterface(__uuidof(IXCLRDataExceptionNotification4), (void**)&notify4) != S_OK) { notify4 = NULL; } IXCLRDataExceptionNotification5* notify5; if (notify->QueryInterface(__uuidof(IXCLRDataExceptionNotification5), (void**)&notify5) != S_OK) { notify5 = NULL; } switch(notifyType) { case DACNotify::MODULE_LOAD_NOTIFICATION: notify->OnModuleLoaded(pubModule); break; case DACNotify::MODULE_UNLOAD_NOTIFICATION: notify->OnModuleUnloaded(pubModule); break; case DACNotify::JIT_NOTIFICATION2: notify->OnCodeGenerated(pubMethodInst); if (notify5) { notify5->OnCodeGenerated2(pubMethodInst, TO_CDADDR(nativeCodeLocation)); } break; case DACNotify::EXCEPTION_NOTIFICATION: if (notify2) { notify2->OnException(pubExState); } else { status = E_INVALIDARG; } break; case DACNotify::GC_NOTIFICATION: if (notify3) { notify3->OnGcEvent(pubGcEvtArgs); } break; case DACNotify::CATCH_ENTER_NOTIFICATION: if (notify4) { notify4->ExceptionCatcherEnter(pubMethodInst, catcherNativeOffset); } break; default: // notifyType has already been validated. _ASSERTE(FALSE); break; } if (notify2) { notify2->Release(); } if (notify3) { notify3->Release(); } if (notify4) { notify4->Release(); } if (notify5) { notify5->Release(); } } if (pubModule) { pubModule->Release(); } if (pubMethodInst) { pubMethodInst->Release(); } if (pubExState) { pubExState->Release(); } return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::CreateMemoryValue( /* [in] */ IXCLRDataAppDomain* appDomain, /* [in] */ IXCLRDataTask* tlsTask, /* [in] */ IXCLRDataTypeInstance* type, /* [in] */ CLRDATA_ADDRESS addr, /* [out] */ IXCLRDataValue** value) { HRESULT status; DAC_ENTER(); EX_TRY { AppDomain* dacDomain; Thread* dacThread; TypeHandle dacType; ULONG32 flags; NativeVarLocation loc; dacDomain = ((ClrDataAppDomain*)appDomain)->GetAppDomain(); if (tlsTask) { dacThread = ((ClrDataTask*)tlsTask)->GetThread(); } else { dacThread = NULL; } dacType = ((ClrDataTypeInstance*)type)->GetTypeHandle(); flags = GetTypeFieldValueFlags(dacType, NULL, 0, false); loc.addr = addr; loc.size = dacType.GetSize(); loc.contextReg = false; *value = new (nothrow) ClrDataValue(this, dacDomain, dacThread, flags, dacType, addr, 1, &loc); status = *value ? S_OK : E_OUTOFMEMORY; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::SetAllTypeNotifications( /* [in] */ IXCLRDataModule* mod, /* [in] */ ULONG32 flags) { HRESULT status; DAC_ENTER(); EX_TRY { // XXX Microsoft. status = E_NOTIMPL; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::SetAllCodeNotifications( /* [in] */ IXCLRDataModule* mod, /* [in] */ ULONG32 flags) { HRESULT status; DAC_ENTER(); EX_TRY { status = E_FAIL; if (!IsValidMethodCodeNotification(flags)) { status = E_INVALIDARG; } else { JITNotifications jn(GetHostJitNotificationTable()); if (!jn.IsActive()) { status = E_OUTOFMEMORY; } else { BOOL changedTable; TADDR modulePtr = mod ? PTR_HOST_TO_TADDR(((ClrDataModule*)mod)->GetModule()) : NULL; if (jn.SetAllNotifications(modulePtr, flags, &changedTable)) { if (!changedTable || (changedTable && jn.UpdateOutOfProcTable())) { status = S_OK; } } } } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetTypeNotifications( /* [in] */ ULONG32 numTokens, /* [in, size_is(numTokens)] */ IXCLRDataModule* mods[], /* [in] */ IXCLRDataModule* singleMod, /* [in, size_is(numTokens)] */ mdTypeDef tokens[], /* [out, size_is(numTokens)] */ ULONG32 flags[]) { HRESULT status; DAC_ENTER(); EX_TRY { // XXX Microsoft. status = E_NOTIMPL; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::SetTypeNotifications( /* [in] */ ULONG32 numTokens, /* [in, size_is(numTokens)] */ IXCLRDataModule* mods[], /* [in] */ IXCLRDataModule* singleMod, /* [in, size_is(numTokens)] */ mdTypeDef tokens[], /* [in, size_is(numTokens)] */ ULONG32 flags[], /* [in] */ ULONG32 singleFlags) { HRESULT status; DAC_ENTER(); EX_TRY { // XXX Microsoft. status = E_NOTIMPL; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::GetCodeNotifications( /* [in] */ ULONG32 numTokens, /* [in, size_is(numTokens)] */ IXCLRDataModule* mods[], /* [in] */ IXCLRDataModule* singleMod, /* [in, size_is(numTokens)] */ mdMethodDef tokens[], /* [out, size_is(numTokens)] */ ULONG32 flags[]) { HRESULT status; DAC_ENTER(); EX_TRY { if ((flags == NULL || tokens == NULL) || (mods == NULL && singleMod == NULL) || (mods != NULL && singleMod != NULL)) { status = E_INVALIDARG; } else { JITNotifications jn(GetHostJitNotificationTable()); if (!jn.IsActive()) { status = E_OUTOFMEMORY; } else { TADDR modulePtr = NULL; if (singleMod) { modulePtr = PTR_HOST_TO_TADDR(((ClrDataModule*)singleMod)-> GetModule()); } for (ULONG32 i = 0; i < numTokens; i++) { if (singleMod == NULL) { modulePtr = PTR_HOST_TO_TADDR(((ClrDataModule*)mods[i])-> GetModule()); } USHORT jt = jn.Requested(modulePtr, tokens[i]); flags[i] = jt; } status = S_OK; } } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT STDMETHODCALLTYPE ClrDataAccess::SetCodeNotifications( /* [in] */ ULONG32 numTokens, /* [in, size_is(numTokens)] */ IXCLRDataModule* mods[], /* [in] */ IXCLRDataModule* singleMod, /* [in, size_is(numTokens)] */ mdMethodDef tokens[], /* [in, size_is(numTokens)] */ ULONG32 flags[], /* [in] */ ULONG32 singleFlags) { HRESULT status = E_UNEXPECTED; DAC_ENTER(); EX_TRY { if ((tokens == NULL) || (mods == NULL && singleMod == NULL) || (mods != NULL && singleMod != NULL)) { status = E_INVALIDARG; } else { JITNotifications jn(GetHostJitNotificationTable()); if (!jn.IsActive() || numTokens > jn.GetTableSize()) { status = E_OUTOFMEMORY; } else { BOOL changedTable = FALSE; // Are flags valid? if (flags) { for (ULONG32 check = 0; check < numTokens; check++) { if (!IsValidMethodCodeNotification(flags[check])) { status = E_INVALIDARG; goto Exit; } } } else if (!IsValidMethodCodeNotification(singleFlags)) { status = E_INVALIDARG; goto Exit; } TADDR modulePtr = NULL; if (singleMod) { modulePtr = PTR_HOST_TO_TADDR(((ClrDataModule*)singleMod)-> GetModule()); } for (ULONG32 i = 0; i < numTokens; i++) { if (singleMod == NULL) { modulePtr = PTR_HOST_TO_TADDR(((ClrDataModule*)mods[i])-> GetModule()); } USHORT curFlags = jn.Requested(modulePtr, tokens[i]); USHORT setFlags = (USHORT)(flags ? flags[i] : singleFlags); if (curFlags != setFlags) { if (!jn.SetNotification(modulePtr, tokens[i], setFlags)) { status = E_FAIL; goto Exit; } changedTable = TRUE; } } if (!changedTable || (changedTable && jn.UpdateOutOfProcTable())) { status = S_OK; } } } Exit: ; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT ClrDataAccess::GetOtherNotificationFlags( /* [out] */ ULONG32* flags) { HRESULT status; DAC_ENTER(); EX_TRY { *flags = g_dacNotificationFlags; status = S_OK; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } HRESULT ClrDataAccess::SetOtherNotificationFlags( /* [in] */ ULONG32 flags) { HRESULT status; if ((flags & ~(CLRDATA_NOTIFY_ON_MODULE_LOAD | CLRDATA_NOTIFY_ON_MODULE_UNLOAD | CLRDATA_NOTIFY_ON_EXCEPTION | CLRDATA_NOTIFY_ON_EXCEPTION_CATCH_ENTER)) != 0) { return E_INVALIDARG; } DAC_ENTER(); EX_TRY { g_dacNotificationFlags = flags; status = S_OK; } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } enum { STUB_BUF_FLAGS_START, STUB_BUF_METHOD_JITTED, STUB_BUF_FRAME_PUSHED, STUB_BUF_STUB_MANAGER_PUSHED, STUB_BUF_FLAGS_END, }; union STUB_BUF { CLRDATA_FOLLOW_STUB_BUFFER apiBuf; struct { ULONG64 flags; ULONG64 addr; ULONG64 arg1; } u; }; HRESULT ClrDataAccess::FollowStubStep( /* [in] */ Thread* thread, /* [in] */ ULONG32 inFlags, /* [in] */ TADDR inAddr, /* [in] */ union STUB_BUF* inBuffer, /* [out] */ TADDR* outAddr, /* [out] */ union STUB_BUF* outBuffer, /* [out] */ ULONG32* outFlags) { TraceDestination trace; bool traceDone = false; BYTE* retAddr; T_CONTEXT localContext; REGDISPLAY regDisp; MethodDesc* methodDesc; ZeroMemory(outBuffer, sizeof(*outBuffer)); if (inBuffer) { switch(inBuffer->u.flags) { case STUB_BUF_METHOD_JITTED: if (inAddr != GFN_TADDR(DACNotifyCompilationFinished)) { return E_INVALIDARG; } // It's possible that this notification is // for a different method, so double-check // and recycle the notification if necessary. methodDesc = PTR_MethodDesc(CORDB_ADDRESS_TO_TADDR(inBuffer->u.addr)); if (methodDesc->HasNativeCode()) { *outAddr = methodDesc->GetNativeCode(); *outFlags = CLRDATA_FOLLOW_STUB_EXIT; return S_OK; } // We didn't end up with native code so try again. trace.InitForUnjittedMethod(methodDesc); traceDone = true; break; case STUB_BUF_FRAME_PUSHED: if (!thread || inAddr != inBuffer->u.addr) { return E_INVALIDARG; } trace.InitForFramePush(CORDB_ADDRESS_TO_TADDR(inBuffer->u.addr)); DacGetThreadContext(thread, &localContext); thread->FillRegDisplay(&regDisp, &localContext); if (!thread->GetFrame()-> TraceFrame(thread, TRUE, &trace, &regDisp)) { return E_FAIL; } traceDone = true; break; case STUB_BUF_STUB_MANAGER_PUSHED: if (!thread || inAddr != inBuffer->u.addr || !inBuffer->u.arg1) { return E_INVALIDARG; } trace.InitForManagerPush(CORDB_ADDRESS_TO_TADDR(inBuffer->u.addr), PTR_StubManager(CORDB_ADDRESS_TO_TADDR(inBuffer->u.arg1))); DacGetThreadContext(thread, &localContext); if (!trace.GetStubManager()-> TraceManager(thread, &trace, &localContext, &retAddr)) { return E_FAIL; } traceDone = true; break; default: return E_INVALIDARG; } } if ((!traceDone && !StubManager::TraceStub(inAddr, &trace)) || !StubManager::FollowTrace(&trace)) { return E_NOINTERFACE; } switch(trace.GetTraceType()) { case TRACE_UNMANAGED: case TRACE_MANAGED: // We've hit non-stub code so we're done. *outAddr = trace.GetAddress(); *outFlags = CLRDATA_FOLLOW_STUB_EXIT; break; case TRACE_UNJITTED_METHOD: // The stub causes jitting, so return // the address of the jit-complete routine // so that the real native address can // be picked up once the JIT is done. methodDesc = trace.GetMethodDesc(); *outAddr = GFN_TADDR(DACNotifyCompilationFinished); outBuffer->u.flags = STUB_BUF_METHOD_JITTED; outBuffer->u.addr = PTR_HOST_TO_TADDR(methodDesc); *outFlags = CLRDATA_FOLLOW_STUB_INTERMEDIATE; break; case TRACE_FRAME_PUSH: if (!thread) { return E_INVALIDARG; } *outAddr = trace.GetAddress(); outBuffer->u.flags = STUB_BUF_FRAME_PUSHED; outBuffer->u.addr = trace.GetAddress(); *outFlags = CLRDATA_FOLLOW_STUB_INTERMEDIATE; break; case TRACE_MGR_PUSH: if (!thread) { return E_INVALIDARG; } *outAddr = trace.GetAddress(); outBuffer->u.flags = STUB_BUF_STUB_MANAGER_PUSHED; outBuffer->u.addr = trace.GetAddress(); outBuffer->u.arg1 = PTR_HOST_TO_TADDR(trace.GetStubManager()); *outFlags = CLRDATA_FOLLOW_STUB_INTERMEDIATE; break; default: return E_INVALIDARG; } return S_OK; } HRESULT STDMETHODCALLTYPE ClrDataAccess::FollowStub( /* [in] */ ULONG32 inFlags, /* [in] */ CLRDATA_ADDRESS inAddr, /* [in] */ CLRDATA_FOLLOW_STUB_BUFFER* _inBuffer, /* [out] */ CLRDATA_ADDRESS* outAddr, /* [out] */ CLRDATA_FOLLOW_STUB_BUFFER* _outBuffer, /* [out] */ ULONG32* outFlags) { return FollowStub2(NULL, inFlags, inAddr, _inBuffer, outAddr, _outBuffer, outFlags); } HRESULT STDMETHODCALLTYPE ClrDataAccess::FollowStub2( /* [in] */ IXCLRDataTask* task, /* [in] */ ULONG32 inFlags, /* [in] */ CLRDATA_ADDRESS _inAddr, /* [in] */ CLRDATA_FOLLOW_STUB_BUFFER* _inBuffer, /* [out] */ CLRDATA_ADDRESS* _outAddr, /* [out] */ CLRDATA_FOLLOW_STUB_BUFFER* _outBuffer, /* [out] */ ULONG32* outFlags) { HRESULT status; if ((inFlags & ~(CLRDATA_FOLLOW_STUB_DEFAULT)) != 0) { return E_INVALIDARG; } STUB_BUF* inBuffer = (STUB_BUF*)_inBuffer; STUB_BUF* outBuffer = (STUB_BUF*)_outBuffer; if (inBuffer && (inBuffer->u.flags <= STUB_BUF_FLAGS_START || inBuffer->u.flags >= STUB_BUF_FLAGS_END)) { return E_INVALIDARG; } DAC_ENTER(); EX_TRY { STUB_BUF cycleBuf; TADDR inAddr = TO_TADDR(_inAddr); TADDR outAddr; Thread* thread = task ? ((ClrDataTask*)task)->GetThread() : NULL; ULONG32 loops = 4; for (;;) { if ((status = FollowStubStep(thread, inFlags, inAddr, inBuffer, &outAddr, outBuffer, outFlags)) != S_OK) { break; } // Some stub tracing just requests further iterations // of processing, so detect that case and loop. if (outAddr != inAddr) { // We can make forward progress, we're done. *_outAddr = TO_CDADDR(outAddr); break; } // We need more processing. As a protection // against infinite loops in corrupted or buggy // situations, we only allow this to happen a // small number of times. if (--loops == 0) { ZeroMemory(outBuffer, sizeof(*outBuffer)); status = E_FAIL; break; } cycleBuf = *outBuffer; inBuffer = &cycleBuf; } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4297) #endif // _MSC_VER STDMETHODIMP ClrDataAccess::GetGcNotification(GcEvtArgs* gcEvtArgs) { HRESULT status; DAC_ENTER(); EX_TRY { if (gcEvtArgs->typ >= GC_EVENT_TYPE_MAX) { status = E_INVALIDARG; } else { GcNotifications gn(GetHostGcNotificationTable()); if (!gn.IsActive()) { status = E_OUTOFMEMORY; } else { GcEvtArgs *res = gn.GetNotification(*gcEvtArgs); if (res != NULL) { *gcEvtArgs = *res; status = S_OK; } else { status = E_FAIL; } } } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } STDMETHODIMP ClrDataAccess::SetGcNotification(IN GcEvtArgs gcEvtArgs) { HRESULT status; DAC_ENTER(); EX_TRY { if (gcEvtArgs.typ >= GC_EVENT_TYPE_MAX) { status = E_INVALIDARG; } else { GcNotifications gn(GetHostGcNotificationTable()); if (!gn.IsActive()) { status = E_OUTOFMEMORY; } else { if (gn.SetNotification(gcEvtArgs) && gn.UpdateOutOfProcTable()) { status = S_OK; } else { status = E_FAIL; } } } } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &status)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); return status; } #ifdef _MSC_VER #pragma warning(pop) #endif // _MSC_VER HRESULT ClrDataAccess::Initialize(void) { HRESULT hr; CLRDATA_ADDRESS base = { 0 }; // // We do not currently support cross-platform // debugging. Verify that cross-platform is not // being attempted. // // Determine our platform based on the pre-processor macros set when we were built #ifdef TARGET_UNIX #if defined(TARGET_X86) CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_X86; #elif defined(TARGET_AMD64) CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_AMD64; #elif defined(TARGET_ARM) CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_ARM; #elif defined(TARGET_ARM64) CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_ARM64; #else #error Unknown Processor. #endif #else #if defined(TARGET_X86) CorDebugPlatform hostPlatform = CORDB_PLATFORM_WINDOWS_X86; #elif defined(TARGET_AMD64) CorDebugPlatform hostPlatform = CORDB_PLATFORM_WINDOWS_AMD64; #elif defined(TARGET_ARM) CorDebugPlatform hostPlatform = CORDB_PLATFORM_WINDOWS_ARM; #elif defined(TARGET_ARM64) CorDebugPlatform hostPlatform = CORDB_PLATFORM_WINDOWS_ARM64; #else #error Unknown Processor. #endif #endif CorDebugPlatform targetPlatform; IfFailRet(m_pTarget->GetPlatform(&targetPlatform)); if (targetPlatform != hostPlatform) { // DAC fatal error: Platform mismatch - the platform reported by the data target // is not what this version of mscordacwks.dll was built for. return CORDBG_E_UNCOMPATIBLE_PLATFORMS; } // // Get the current DLL base for mscorwks globals. // In case of multiple-CLRs, there may be multiple dlls named "mscorwks". // code:OpenVirtualProcess can take the base address (clrInstanceId) to select exactly // which CLR to is being target. If so, m_globalBase will already be set. // if (m_globalBase == 0) { // Caller didn't specify which CLR to debug, we should be using a legacy data target. if (m_pLegacyTarget == NULL) { DacError(E_INVALIDARG); UNREACHABLE(); } ReleaseHolder<ICLRRuntimeLocator> pRuntimeLocator(NULL); if (m_pLegacyTarget->QueryInterface(__uuidof(ICLRRuntimeLocator), (void**)&pRuntimeLocator) != S_OK || pRuntimeLocator->GetRuntimeBase(&base) != S_OK) { IfFailRet(m_pLegacyTarget->GetImageBase(TARGET_MAIN_CLR_DLL_NAME_W, &base)); } m_globalBase = TO_TADDR(base); } // We don't need to try too hard to prevent // multiple initializations as each one will // copy the same data into the globals and so // cannot interfere with each other. if (!s_procInit) { IfFailRet(GetDacGlobals()); IfFailRet(DacGetHostVtPtrs()); s_procInit = true; } // // DAC is now setup and ready to use // // Do some validation IfFailRet(VerifyDlls()); return S_OK; } Thread* ClrDataAccess::FindClrThreadByTaskId(ULONG64 taskId) { Thread* thread = NULL; if (!ThreadStore::s_pThreadStore) { return NULL; } while ((thread = ThreadStore::GetAllThreadList(thread, 0, 0))) { if (thread->GetThreadId() == (DWORD)taskId) { return thread; } } return NULL; } HRESULT ClrDataAccess::IsPossibleCodeAddress(IN TADDR address) { SUPPORTS_DAC; BYTE testRead; ULONG32 testDone; // First do a trivial check on the readability of the // address. This makes for quick rejection of bogus // addresses that the debugger sends in when searching // stacks for return addresses. // XXX Microsoft - Will this cause problems in minidumps // where it's possible the stub is identifiable but // the stub code isn't present? Yes, but the lack // of that code could confuse the walker on its own // if it does code analysis. if ((m_pTarget->ReadVirtual(address, &testRead, sizeof(testRead), &testDone) != S_OK) || !testDone) { return E_INVALIDARG; } return S_OK; } HRESULT ClrDataAccess::GetFullMethodName( IN MethodDesc* methodDesc, IN ULONG32 symbolChars, OUT ULONG32* symbolLen, _Out_writes_to_opt_(symbolChars, *symbolLen) LPWSTR symbol ) { StackSString s; #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS PAL_CPP_TRY { #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS TypeString::AppendMethodInternal(s, methodDesc, TypeString::FormatSignature|TypeString::FormatNamespace|TypeString::FormatFullInst); #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS } PAL_CPP_CATCH_ALL { if (!MdCacheGetEEName(dac_cast<TADDR>(methodDesc), s)) { PAL_CPP_RETHROW; } } PAL_CPP_ENDTRY #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS if (symbol) { // Copy as much as we can and truncate the rest. wcsncpy_s(symbol, symbolChars, s.GetUnicode(), _TRUNCATE); } if (symbolLen) *symbolLen = s.GetCount() + 1; if (symbol != NULL && symbolChars < (s.GetCount() + 1)) return S_FALSE; else return S_OK; } PCSTR ClrDataAccess::GetJitHelperName( IN TADDR address, IN bool dynamicHelpersOnly /*=false*/ ) { const static PCSTR s_rgHelperNames[] = { #define JITHELPER(code,fn,sig) #code, #include <jithelpers.h> }; static_assert_no_msg(ARRAY_SIZE(s_rgHelperNames) == CORINFO_HELP_COUNT); #ifdef TARGET_UNIX if (!dynamicHelpersOnly) #else if (!dynamicHelpersOnly && g_runtimeLoadedBaseAddress <= address && address < g_runtimeLoadedBaseAddress + g_runtimeVirtualSize) #endif // TARGET_UNIX { // Read the whole table from the target in one shot for better performance VMHELPDEF * pTable = static_cast<VMHELPDEF *>( PTR_READ(dac_cast<TADDR>(&hlpFuncTable), CORINFO_HELP_COUNT * sizeof(VMHELPDEF))); for (int i = 0; i < CORINFO_HELP_COUNT; i++) { if (address == (TADDR)(pTable[i].pfnHelper)) return s_rgHelperNames[i]; } } // Check if its a dynamically generated JIT helper const static CorInfoHelpFunc s_rgDynamicHCallIds[] = { #define DYNAMICJITHELPER(code, fn, sig) code, #define JITHELPER(code, fn,sig) #include <jithelpers.h> }; // Read the whole table from the target in one shot for better performance VMHELPDEF * pDynamicTable = static_cast<VMHELPDEF *>( PTR_READ(dac_cast<TADDR>(&hlpDynamicFuncTable), DYNAMIC_CORINFO_HELP_COUNT * sizeof(VMHELPDEF))); for (unsigned d = 0; d < DYNAMIC_CORINFO_HELP_COUNT; d++) { if (address == (TADDR)(pDynamicTable[d].pfnHelper)) { return s_rgHelperNames[s_rgDynamicHCallIds[d]]; } } return NULL; } HRESULT ClrDataAccess::RawGetMethodName( /* [in] */ CLRDATA_ADDRESS address, /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *symbolLen, /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement) { #ifdef TARGET_ARM _ASSERTE((address & THUMB_CODE) == 0); address &= ~THUMB_CODE; #endif const UINT k_cch64BitHexFormat = ARRAY_SIZE("1234567812345678"); HRESULT status; if (flags != 0) { return E_INVALIDARG; } TADDR taddr; if( (status = TRY_CLRDATA_ADDRESS_TO_TADDR(address, &taddr)) != S_OK ) { return status; } if ((status = IsPossibleCodeAddress(taddr)) != S_OK) { return status; } PTR_StubManager pStubManager; MethodDesc* methodDesc = NULL; { EECodeInfo codeInfo(TO_TADDR(address)); if (codeInfo.IsValid()) { if (displacement) { *displacement = codeInfo.GetRelOffset(); } methodDesc = codeInfo.GetMethodDesc(); goto NameFromMethodDesc; } } pStubManager = StubManager::FindStubManager(TO_TADDR(address)); if (pStubManager != NULL) { if (displacement) { *displacement = 0; } // // Special-cased stub managers // if (pStubManager == PrecodeStubManager::g_pManager) { PCODE alignedAddress = AlignDown(TO_TADDR(address), PRECODE_ALIGNMENT); #ifdef TARGET_ARM alignedAddress += THUMB_CODE; #endif SIZE_T maxPrecodeSize = sizeof(StubPrecode); #ifdef HAS_THISPTR_RETBUF_PRECODE maxPrecodeSize = max(maxPrecodeSize, sizeof(ThisPtrRetBufPrecode)); #endif for (SIZE_T i = 0; i < maxPrecodeSize / PRECODE_ALIGNMENT; i++) { EX_TRY { // Try to find matching precode entrypoint Precode* pPrecode = Precode::GetPrecodeFromEntryPoint(alignedAddress, TRUE); if (pPrecode != NULL) { methodDesc = pPrecode->GetMethodDesc(); if (methodDesc != NULL) { if (DacValidateMD(methodDesc)) { if (displacement) { *displacement = TO_TADDR(address) - PCODEToPINSTR(alignedAddress); } goto NameFromMethodDesc; } } } alignedAddress -= PRECODE_ALIGNMENT; } EX_CATCH { } EX_END_CATCH(SwallowAllExceptions) } } else if (pStubManager == JumpStubStubManager::g_pManager) { PCODE pTarget = decodeBackToBackJump(TO_TADDR(address)); HRESULT hr = GetRuntimeNameByAddress(pTarget, flags, bufLen, symbolLen, symbolBuf, NULL); if (SUCCEEDED(hr)) { return hr; } PCSTR pHelperName = GetJitHelperName(pTarget); if (pHelperName != NULL) { hr = ConvertUtf8(pHelperName, bufLen, symbolLen, symbolBuf); if (FAILED(hr)) return S_FALSE; return hr; } } static WCHAR s_wszFormatNameWithStubManager[] = W("CLRStub[%s]@%I64x"); LPCWSTR wszStubManagerName = pStubManager->GetStubManagerName(TO_TADDR(address)); _ASSERTE(wszStubManagerName != NULL); int result = _snwprintf_s( symbolBuf, bufLen, _TRUNCATE, s_wszFormatNameWithStubManager, wszStubManagerName, // Arg 1 = stub name TO_TADDR(address)); // Arg 2 = stub hex address if (result != -1) { // Printf succeeded, so we have an exact char count to return if (symbolLen) { size_t cchSymbol = wcslen(symbolBuf) + 1; if (!FitsIn<ULONG32>(cchSymbol)) return COR_E_OVERFLOW; *symbolLen = (ULONG32) cchSymbol; } return S_OK; } // Printf failed. Estimate a size that will be at least big enough to hold the name if (symbolLen) { size_t cchSymbol = ARRAY_SIZE(s_wszFormatNameWithStubManager) + wcslen(wszStubManagerName) + k_cch64BitHexFormat + 1; if (!FitsIn<ULONG32>(cchSymbol)) return COR_E_OVERFLOW; *symbolLen = (ULONG32) cchSymbol; } return S_FALSE; } // Do not waste time looking up name for static helper. Debugger can get the actual name from .pdb. PCSTR pHelperName; pHelperName = GetJitHelperName(TO_TADDR(address), true /* dynamicHelpersOnly */); if (pHelperName != NULL) { if (displacement) { *displacement = 0; } HRESULT hr = ConvertUtf8(pHelperName, bufLen, symbolLen, symbolBuf); if (FAILED(hr)) return S_FALSE; return S_OK; } return E_NOINTERFACE; NameFromMethodDesc: if (methodDesc->GetClassification() == mcDynamic && !methodDesc->GetSig()) { // XXX Microsoft - Should this case have a more specific name? static WCHAR s_wszFormatNameAddressOnly[] = W("CLRStub@%I64x"); int result = _snwprintf_s( symbolBuf, bufLen, _TRUNCATE, s_wszFormatNameAddressOnly, TO_TADDR(address)); if (result != -1) { // Printf succeeded, so we have an exact char count to return if (symbolLen) { size_t cchSymbol = wcslen(symbolBuf) + 1; if (!FitsIn<ULONG32>(cchSymbol)) return COR_E_OVERFLOW; *symbolLen = (ULONG32) cchSymbol; } return S_OK; } // Printf failed. Estimate a size that will be at least big enough to hold the name if (symbolLen) { size_t cchSymbol = ARRAY_SIZE(s_wszFormatNameAddressOnly) + k_cch64BitHexFormat + 1; if (!FitsIn<ULONG32>(cchSymbol)) return COR_E_OVERFLOW; *symbolLen = (ULONG32) cchSymbol; } return S_FALSE; } return GetFullMethodName(methodDesc, bufLen, symbolLen, symbolBuf); } HRESULT ClrDataAccess::GetMethodExtents(MethodDesc* methodDesc, METH_EXTENTS** extents) { CLRDATA_ADDRESS_RANGE* curExtent; { // // Get the information from the methoddesc. // We'll go through the CodeManager + JitManagers, so this should work // for all types of managed code. // PCODE methodStart = methodDesc->GetNativeCode(); if (!methodStart) { return E_NOINTERFACE; } EECodeInfo codeInfo(methodStart); _ASSERTE(codeInfo.IsValid()); TADDR codeSize = codeInfo.GetCodeManager()->GetFunctionSize(codeInfo.GetGCInfoToken()); *extents = new (nothrow) METH_EXTENTS; if (!*extents) { return E_OUTOFMEMORY; } (*extents)->numExtents = 1; curExtent = (*extents)->extents; curExtent->startAddress = TO_CDADDR(methodStart); curExtent->endAddress = curExtent->startAddress + codeSize; curExtent++; } (*extents)->curExtent = 0; return S_OK; } // Allocator to pass to the debug-info-stores... BYTE* DebugInfoStoreNew(void * pData, size_t cBytes) { return new (nothrow) BYTE[cBytes]; } HRESULT ClrDataAccess::GetMethodVarInfo(MethodDesc* methodDesc, TADDR address, ULONG32* numVarInfo, ICorDebugInfo::NativeVarInfo** varInfo, ULONG32* codeOffset) { SUPPORTS_DAC; COUNT_T countNativeVarInfo; NewHolder<ICorDebugInfo::NativeVarInfo> nativeVars(NULL); TADDR nativeCodeStartAddr; if (address != NULL) { NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address); if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL) { return E_INVALIDARG; } nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode()); } else { nativeCodeStartAddr = PCODEToPINSTR(methodDesc->GetNativeCode()); } DebugInfoRequest request; request.InitFromStartingAddr(methodDesc, nativeCodeStartAddr); BOOL success = DebugInfoManager::GetBoundariesAndVars( request, DebugInfoStoreNew, NULL, // allocator NULL, NULL, &countNativeVarInfo, &nativeVars); if (!success) { return E_FAIL; } if (!nativeVars || !countNativeVarInfo) { return E_NOINTERFACE; } *numVarInfo = countNativeVarInfo; *varInfo = nativeVars; nativeVars.SuppressRelease(); // To prevent NewHolder from releasing the memory if (codeOffset) { *codeOffset = (ULONG32)(address - nativeCodeStartAddr); } return S_OK; } HRESULT ClrDataAccess::GetMethodNativeMap(MethodDesc* methodDesc, TADDR address, ULONG32* numMap, DebuggerILToNativeMap** map, bool* mapAllocated, CLRDATA_ADDRESS* codeStart, ULONG32* codeOffset) { _ASSERTE((codeOffset == NULL) || (address != NULL)); // Use the DebugInfoStore to get IL->Native maps. // It doesn't matter whether we're jitted, ngenned etc. TADDR nativeCodeStartAddr; if (address != NULL) { NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address); if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL) { return E_INVALIDARG; } nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode()); } else { nativeCodeStartAddr = PCODEToPINSTR(methodDesc->GetNativeCode()); } DebugInfoRequest request; request.InitFromStartingAddr(methodDesc, nativeCodeStartAddr); // Bounds info. ULONG32 countMapCopy; NewHolder<ICorDebugInfo::OffsetMapping> mapCopy(NULL); BOOL success = DebugInfoManager::GetBoundariesAndVars( request, DebugInfoStoreNew, NULL, // allocator &countMapCopy, &mapCopy, NULL, NULL); if (!success) { return E_FAIL; } // Need to convert map formats. *numMap = countMapCopy; *map = new (nothrow) DebuggerILToNativeMap[countMapCopy]; if (!*map) { return E_OUTOFMEMORY; } ULONG32 i; for (i = 0; i < *numMap; i++) { (*map)[i].ilOffset = mapCopy[i].ilOffset; (*map)[i].nativeStartOffset = mapCopy[i].nativeOffset; if (i > 0) { (*map)[i - 1].nativeEndOffset = (*map)[i].nativeStartOffset; } (*map)[i].source = mapCopy[i].source; } if (*numMap >= 1) { (*map)[i - 1].nativeEndOffset = 0; } // Update varion out params. if (codeStart) { *codeStart = TO_CDADDR(nativeCodeStartAddr); } if (codeOffset) { *codeOffset = (ULONG32)(address - nativeCodeStartAddr); } *mapAllocated = true; return S_OK; } // Get the MethodDesc for a function // Arguments: // Input: // pModule - pointer to the module for the function // memberRef - metadata token for the function // Return Value: // MethodDesc for the function MethodDesc * ClrDataAccess::FindLoadedMethodRefOrDef(Module* pModule, mdToken memberRef) { CONTRACT(MethodDesc *) { GC_NOTRIGGER; PRECONDITION(CheckPointer(pModule)); POSTCONDITION(CheckPointer(RETVAL, NULL_OK)); } CONTRACT_END; // Must have a MemberRef or a MethodDef mdToken tkType = TypeFromToken(memberRef); _ASSERTE((tkType == mdtMemberRef) || (tkType == mdtMethodDef)); if (tkType == mdtMemberRef) { RETURN pModule->LookupMemberRefAsMethod(memberRef); } RETURN pModule->LookupMethodDef(memberRef); } // FindLoadedMethodRefOrDef // // ReportMem - report a region of memory for dump gathering // // If you specify that you expect success, any failure will cause ReportMem to // return false. If you do not expect success, true is always returned. // This function only throws when all dump collection should be cancelled. // // Arguments: // addr - the starting target address for the memory to report // size - the length (in bytes) to report // fExpectSuccess - if true (the default), then we expect that this region of memory // should be fully readable. Any read errors indicate a corrupt target. // bool ClrDataAccess::ReportMem(TADDR addr, TSIZE_T size, bool fExpectSuccess /*= true*/) { SUPPORTS_DAC_HOST_ONLY; // This block of code is to help debugging blocks that we report // to minidump/heapdump. You can set break point here to view the static // variable to figure out the size of blocks that we are reporting. // Most useful is set conditional break point to catch large chuck of // memory. We will leave it here for all builds. // static TADDR debugAddr; static TSIZE_T debugSize; debugAddr = addr; debugSize = size; HRESULT status; if (!addr || addr == (TADDR)-1 || !size) { if (fExpectSuccess) return false; else return true; } // // Try and sanity-check the reported region of memory // #ifdef _DEBUG // in debug builds, sanity-check all reports const TSIZE_T k_minSizeToCheck = 1; #else // in retail builds, only sanity-check larger chunks which have the potential to waste a // lot of time and/or space. This avoids the overhead of checking for the majority of // memory regions (which are small). const TSIZE_T k_minSizeToCheck = 1024; #endif if (size >= k_minSizeToCheck) { if (!IsFullyReadable(addr, size)) { if (!fExpectSuccess) { // We know the read might fail (eg. we're trying to find mapped pages in // a module image), so just skip this block silently. // Note that the EnumMemoryRegion callback won't necessarily do anything if any part of // the region is unreadable, and so there is no point in calling it. For cases where we expect // the read might fail, but we want to report any partial blocks, we have to break up the region // into pages and try reporting each page anyway return true; } // We're reporting bogus memory, so the target must be corrupt (or there is a issue). We should abort // reporting and continue with the next data structure (where the exception is caught), // just like we would for a DAC read error (otherwise we might do something stupid // like get into an infinite loop, or otherwise waste time with corrupt data). TARGET_CONSISTENCY_CHECK(false, "Found unreadable memory while reporting memory regions for dump gathering"); return false; } } // Minidumps should never contain data structures that are anywhere near 4MB. If we see this, it's // probably due to memory corruption. To keep the dump small, we'll truncate the block. Note that // the size to which the block is truncated is pretty unique, so should be good evidence in a dump // that this has happened. // Note that it's hard to say what a good value would be here, or whether we should dump any of the // data structure at all. Hopefully experience will help guide this going forward. // @dbgtodo : Extend dump-gathering API to allow a dump-log to be included. const TSIZE_T kMaxMiniDumpRegion = 4*1024*1024 - 3; // 4MB-3 if( size > kMaxMiniDumpRegion && (m_enumMemFlags == CLRDATA_ENUM_MEM_MINI || m_enumMemFlags == CLRDATA_ENUM_MEM_TRIAGE)) { TARGET_CONSISTENCY_CHECK( false, "Dump target consistency failure - truncating minidump data structure"); size = kMaxMiniDumpRegion; } // track the total memory reported. m_cbMemoryReported += size; // ICLRData APIs take only 32-bit sizes. In practice this will almost always be sufficient, but // in theory we might have some >4GB ranges on large 64-bit processes doing a heap dump // (for example, the code:LoaderHeap). If necessary, break up the reporting into maximum 4GB // chunks so we can use the existing API. // @dbgtodo : ICorDebugDataTarget should probably use 64-bit sizes while (size) { ULONG32 enumSize; if (size > UINT32_MAX) { enumSize = UINT32_MAX; } else { enumSize = (ULONG32)size; } // Actually perform the memory reporting callback status = m_enumMemCb->EnumMemoryRegion(TO_CDADDR(addr), enumSize); if (status != S_OK) { // If dump generation was cancelled, allow us to throw upstack so we'll actually quit. if ((fExpectSuccess) && (status != COR_E_OPERATIONCANCELED)) return false; } // If the return value of EnumMemoryRegion is COR_E_OPERATIONCANCELED, // it means that user has requested that the minidump gathering be canceled. // To do this we throw an exception which is caught in EnumMemoryRegionsWrapper. if (status == COR_E_OPERATIONCANCELED) { ThrowHR(status); } // Move onto the next chunk (if any) size -= enumSize; addr += enumSize; } return true; } // // DacUpdateMemoryRegion - updates/poisons a region of memory of generated dump // // Parameters: // addr - target address of the beginning of the memory region // bufferSize - number of bytes to update/poison // buffer - data to be written at given target address // bool ClrDataAccess::DacUpdateMemoryRegion(TADDR addr, TSIZE_T bufferSize, BYTE* buffer) { SUPPORTS_DAC_HOST_ONLY; HRESULT status; if (!addr || addr == (TADDR)-1 || !bufferSize) { return false; } // track the total memory reported. m_cbMemoryReported += bufferSize; if (m_updateMemCb == NULL) { return false; } // Actually perform the memory updating callback status = m_updateMemCb->UpdateMemoryRegion(TO_CDADDR(addr), (ULONG32)bufferSize, buffer); if (status != S_OK) { return false; } return true; } // // Check whether a region of target memory is fully readable. // // Arguments: // addr The base target address of the region // size The size of the region to analyze // // Return value: // True if the entire regions appears to be readable, false otherwise. // // Notes: // The motivation here is that reporting large regions of unmapped address space to dbgeng can result in // it taking a long time trying to identify a valid subrange. This can happen when the target // memory is corrupt, and we enumerate a data structure with a dynamic size. Ideally we would just spec // the ICLRDataEnumMemoryRegionsCallback API to require the client to fail if it detects an unmapped // memory address in the region. However, we can't change the existing dbgeng code, so for now we'll // rely on this heuristic here. // @dbgtodo : Try and get the dbg team to change their EnumMemoryRegion behavior. See DevDiv Bugs 6265 // bool ClrDataAccess::IsFullyReadable(TADDR taBase, TSIZE_T dwSize) { // The only way we have to verify that a memory region is readable is to try reading it in it's // entirety. This is potentially expensive, so we'll rely on a heuristic that spot-checks various // points in the region. // Ensure we've got something to check if( dwSize == 0 ) return true; // Check for overflow TADDR taEnd = DacTAddrOffset(taBase, dwSize, 1); // Loop through using expontential growth, being sure to check both the first and last byte TADDR taCurr = taBase; TSIZE_T dwInc = 4096; bool bDone = false; while (!bDone) { // Try and read a byte from the target. Note that we don't use PTR_BYTE here because we don't want // the overhead of inserting entries into the DAC instance cache. BYTE b; ULONG32 dwBytesRead; HRESULT hr = m_pTarget->ReadVirtual(taCurr, &b, 1, &dwBytesRead); if( hr != S_OK || dwBytesRead < 1 ) { return false; } if (taEnd - taCurr <= 1) { // We just read the last byte so we're done _ASSERTE( taCurr = taEnd - 1 ); bDone = true; } else if (dwInc == 0 || dwInc >= taEnd - taCurr) { // we've reached the end of the exponential series, check the last byte taCurr = taEnd - 1; } else { // advance current pointer (subtraction above ensures this won't overflow) taCurr += dwInc; // double the increment for next time (or set to 0 if it's already the max) dwInc <<= 1; } } return true; } JITNotification* ClrDataAccess::GetHostJitNotificationTable() { if (m_jitNotificationTable == NULL) { m_jitNotificationTable = JITNotifications::InitializeNotificationTable(1000); } return m_jitNotificationTable; } GcNotification* ClrDataAccess::GetHostGcNotificationTable() { if (m_gcNotificationTable == NULL) { m_gcNotificationTable = GcNotifications::InitializeNotificationTable(128); } return m_gcNotificationTable; } /* static */ bool ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly, DWORD &dwTimeStamp, DWORD &dwSize, DWORD &dwDataSize, DWORD &dwRvaHint, bool &isNGEN, _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath) { SUPPORTS_DAC_HOST_ONLY; PEImage *mdImage = NULL; PEImageLayout *layout = NULL; IMAGE_DATA_DIRECTORY *pDir = NULL; COUNT_T uniPathChars = 0; isNGEN = false; if (pDir == NULL || pDir->Size == 0) { mdImage = pPEAssembly->GetPEImage(); if (mdImage != NULL) { layout = mdImage->GetLoadedLayout(); pDir = &layout->GetCorHeader()->MetaData; // In IL image case, we do not have any hint to IL metadata since it is stored // in the corheader. // dwRvaHint = 0; dwDataSize = pDir->Size; } else { return false; } } // Do not fail if path can not be read. Triage dumps don't have paths and we want to fallback // on searching metadata from IL image. mdImage->GetPath().DacGetUnicode(cchFilePath, wszFilePath, &uniPathChars); if (!mdImage->HasNTHeaders() || !mdImage->HasCorHeader() || !mdImage->HasLoadedLayout() || (uniPathChars > cchFilePath)) { return false; } // It is possible that the module is in-memory. That is the wszFilePath here is empty. // We will try to use the module name instead in this case for hosting debugger // to find match. if (wcslen(wszFilePath) == 0) { mdImage->GetModuleFileNameHintForDAC().DacGetUnicode(cchFilePath, wszFilePath, &uniPathChars); if (uniPathChars > cchFilePath) { return false; } } dwTimeStamp = layout->GetTimeDateStamp(); dwSize = (ULONG32)layout->GetVirtualSize(); return true; } /* static */ bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly, DWORD &dwTimeStamp, DWORD &dwSize, _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath) { SUPPORTS_DAC_HOST_ONLY; DWORD dwWritten = 0; // use the IL File name if (!pPEAssembly->GetPath().DacGetUnicode(cchFilePath, wszFilePath, (COUNT_T *)(&dwWritten))) { // Use DAC hint to retrieve the IL name. pPEAssembly->GetModuleFileNameHint().DacGetUnicode(cchFilePath, wszFilePath, (COUNT_T *)(&dwWritten)); } dwTimeStamp = 0; dwSize = 0; return true; } void * ClrDataAccess::GetMetaDataFromHost(PEAssembly* pPEAssembly, bool* isAlternate) { DWORD imageTimestamp, imageSize, dataSize; void* buffer = NULL; WCHAR uniPath[MAX_LONGPATH] = {0}; bool isAlt = false; bool isNGEN = false; DAC_INSTANCE* inst = NULL; HRESULT hr = S_OK; DWORD ulRvaHint; // // We always ask for the IL image metadata, // as we expect that to be more // available than others. The drawback is that // there may be differences between the IL image // metadata and native image metadata, so we // have to mark such alternate metadata so that // we can fail unsupported usage of it. // // Microsoft - above comment seems to be an unimplemented thing. // The DAC_MD_IMPORT.isAlternate field gets ultimately set, but // on the searching I did, I cannot find any usage of it // other than in the ctor. Should we be doing something, or should // we remove this comment and the isAlternate field? // It's possible that test will want us to track whether we have // an IL image's metadata loaded against an NGEN'ed image // so the field remains for now. if (!ClrDataAccess::GetMetaDataFileInfoFromPEFile( pPEAssembly, imageTimestamp, imageSize, dataSize, ulRvaHint, isNGEN, uniPath, ARRAY_SIZE(uniPath))) { return NULL; } // try direct match for the image that is loaded into the managed process pPEAssembly->GetLoadedMetadata((COUNT_T *)(&dataSize)); DWORD allocSize = 0; if (!ClrSafeInt<DWORD>::addition(dataSize, sizeof(DAC_INSTANCE), allocSize)) { DacError(HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW)); } inst = m_instances.Alloc(0, allocSize, DAC_DPTR); if (!inst) { DacError(E_OUTOFMEMORY); return NULL; } buffer = (void*)(inst + 1); // APIs implemented by hosting debugger. It can use the path/filename, timestamp, and // pPEAssembly size to find an exact match for the image. If that fails for an ngen'ed image, // we can request the IL image which it came from. if (m_legacyMetaDataLocator) { // Legacy API implemented by hosting debugger. hr = m_legacyMetaDataLocator->GetMetadata( uniPath, imageTimestamp, imageSize, NULL, // MVID - not used yet ulRvaHint, 0, // flags - reserved for future. dataSize, (BYTE*)buffer, NULL); } else { hr = m_target3->GetMetaData( uniPath, imageTimestamp, imageSize, NULL, // MVID - not used yet ulRvaHint, 0, // flags - reserved for future. dataSize, (BYTE*)buffer, NULL); } if (FAILED(hr) && isNGEN) { // We failed to locate the ngen'ed image. We should try to // find the matching IL image // isAlt = true; if (!ClrDataAccess::GetILImageInfoFromNgenPEFile( pPEAssembly, imageTimestamp, imageSize, uniPath, ARRAY_SIZE(uniPath))) { goto ErrExit; } const WCHAR* ilExtension = W("dll"); WCHAR ngenImageName[MAX_LONGPATH] = {0}; if (wcscpy_s(ngenImageName, ARRAY_SIZE(ngenImageName), uniPath) != 0) { goto ErrExit; } if (wcscpy_s(uniPath, ARRAY_SIZE(uniPath), ngenImageName) != 0) { goto ErrExit; } // RVA size in ngen image and IL image is the same. Because the only // different is in RVA. That is 4 bytes column fixed. // // try again if (m_legacyMetaDataLocator) { hr = m_legacyMetaDataLocator->GetMetadata( uniPath, imageTimestamp, imageSize, NULL, // MVID - not used yet 0, // pass zero hint here... important 0, // flags - reserved for future. dataSize, (BYTE*)buffer, NULL); } else { hr = m_target3->GetMetaData( uniPath, imageTimestamp, imageSize, NULL, // MVID - not used yet 0, // pass zero hint here... important 0, // flags - reserved for future. dataSize, (BYTE*)buffer, NULL); } } if (FAILED(hr)) { goto ErrExit; } *isAlternate = isAlt; m_instances.AddSuperseded(inst); return buffer; ErrExit: if (inst != NULL) { m_instances.ReturnAlloc(inst); } return NULL; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // Given a PEAssembly or a ReflectionModule try to find the corresponding metadata // We will first ask debugger to locate it. If fail, we will try // to get it from the target process // //++++++++++++++++++++++++++++++++++++++++++++++++++++++++ IMDInternalImport* ClrDataAccess::GetMDImport(const PEAssembly* pPEAssembly, const ReflectionModule* reflectionModule, bool throwEx) { HRESULT status; PTR_CVOID mdBaseTarget = NULL; COUNT_T mdSize; IMDInternalImport* mdImport = NULL; PVOID mdBaseHost = NULL; bool isAlternate = false; _ASSERTE((pPEAssembly == NULL && reflectionModule != NULL) || (pPEAssembly != NULL && reflectionModule == NULL)); TADDR peAssemblyAddr = (pPEAssembly != NULL) ? dac_cast<TADDR>(pPEAssembly) : dac_cast<TADDR>(reflectionModule); // // Look for one we've already created. // mdImport = m_mdImports.Get(peAssemblyAddr); if (mdImport != NULL) { return mdImport; } if (pPEAssembly != NULL) { // Get the metadata size mdBaseTarget = const_cast<PEAssembly*>(pPEAssembly)->GetLoadedMetadata(&mdSize); } else if (reflectionModule != NULL) { // Get the metadata PTR_SBuffer metadataBuffer = reflectionModule->GetDynamicMetadataBuffer(); if (metadataBuffer != PTR_NULL) { mdBaseTarget = dac_cast<PTR_CVOID>((metadataBuffer->DacGetRawBuffer()).StartAddress()); mdSize = metadataBuffer->GetSize(); } else { if (throwEx) { DacError(E_FAIL); } return NULL; } } else { if (throwEx) { DacError(E_FAIL); } return NULL; } if (mdBaseTarget == PTR_NULL) { mdBaseHost = NULL; } else { // // Maybe the target process has the metadata // Find out where the metadata for the image is // in the target's memory. // // // Read the metadata into the host process. Make sure pass in false in the last // parameter. This is only matters when producing skinny mini-dump. This will // prevent metadata gets reported into mini-dump. // mdBaseHost = DacInstantiateTypeByAddressNoReport(dac_cast<TADDR>(mdBaseTarget), mdSize, false); } // Try to see if debugger can locate it if (pPEAssembly != NULL && mdBaseHost == NULL && (m_target3 || m_legacyMetaDataLocator)) { // We couldn't read the metadata from memory. Ask // the target for metadata as it may be able to // provide it from some alternate means. mdBaseHost = GetMetaDataFromHost(const_cast<PEAssembly *>(pPEAssembly), &isAlternate); } if (mdBaseHost == NULL) { // cannot locate metadata anywhere if (throwEx) { DacError(E_INVALIDARG); } return NULL; } // // Open the MD interface on the host copy of the metadata. // status = GetMDInternalInterface(mdBaseHost, mdSize, ofRead, IID_IMDInternalImport, (void**)&mdImport); if (status != S_OK) { if (throwEx) { DacError(status); } return NULL; } // // Remember the object for this module for // possible later use. // The m_mdImports list does get cleaned up by calls to ClrDataAccess::Flush, // i.e. every time the process changes state. if (m_mdImports.Add(peAssemblyAddr, mdImport, isAlternate) == NULL) { mdImport->Release(); DacError(E_OUTOFMEMORY); } return mdImport; } // // Set whether inconsistencies in the target should raise asserts. // This overrides the default initial setting. // // Arguments: // fEnableAsserts - whether ASSERTs in dacized code should be enabled // void ClrDataAccess::SetTargetConsistencyChecks(bool fEnableAsserts) { LIMITED_METHOD_DAC_CONTRACT; m_fEnableTargetConsistencyAsserts = fEnableAsserts; } // // Get whether inconsistencies in the target should raise asserts. // // Return value: // whether ASSERTs in dacized code should be enabled // // Notes: // The implementation of ASSERT accesses this via code:DacTargetConsistencyAssertsEnabled // // By default, this is disabled, unless COMPlus_DbgDACEnableAssert is set (see code:ClrDataAccess::ClrDataAccess). // This is necessary for compatibility. For example, SOS expects to be able to scan for // valid MethodTables etc. (which may cause ASSERTs), and also doesn't want ASSERTs when working // with targets with corrupted memory. // // Calling code:ClrDataAccess::SetTargetConsistencyChecks overrides the default setting. // bool ClrDataAccess::TargetConsistencyAssertsEnabled() { LIMITED_METHOD_DAC_CONTRACT; return m_fEnableTargetConsistencyAsserts; } // // VerifyDlls - Validate that the mscorwks in the target matches this version of mscordacwks // Only done on Windows and Mac builds at the moment. // See code:CordbProcess::CordbProcess#DBIVersionChecking for more information regarding version checking. // HRESULT ClrDataAccess::VerifyDlls() { #ifndef TARGET_UNIX // Provide a knob for disabling this check if we really want to try and proceed anyway with a // DAC mismatch. DAC behavior may be arbitrarily bad - globals probably won't be at the same // address, data structures may be laid out differently, etc. if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_DbgDACSkipVerifyDlls)) { return S_OK; } // Read the debug directory timestamp from the target mscorwks image using DAC // Note that we don't use the PE timestamp because the PE pPEAssembly might be changed in ways // that don't effect the PDB (and therefore don't effect DAC). Specifically, we rebase // our DLLs at the end of a build, that changes the PE pPEAssembly, but not the PDB. // Note that if we wanted to be extra careful, we could read the CV contents (which includes // the GUID signature) and verify it matches. Using the timestamp is useful for helpful error // messages, and should be sufficient in any real scenario. DWORD timestamp = 0; HRESULT hr = S_OK; DAC_ENTER(); EX_TRY { // Note that we don't need to worry about ensuring the image memory read by this code // is saved in a minidump. Managed minidump debugging already requires that you have // the full mscorwks.dll available at debug time (eg. windbg won't even load DAC without it). PEDecoder pedecoder(dac_cast<PTR_VOID>(m_globalBase)); // We use the first codeview debug directory entry since this should always refer to the single // PDB for mscorwks.dll. const UINT k_maxDebugEntries = 32; // a reasonable upper limit in case of corruption for( UINT i = 0; i < k_maxDebugEntries; i++) { PTR_IMAGE_DEBUG_DIRECTORY pDebugEntry = pedecoder.GetDebugDirectoryEntry(i); // If there are no more entries, then stop if (pDebugEntry == NULL) break; // Ignore non-codeview entries. Some scenarios (eg. optimized builds), there may be extra // debug directory entries at the end of some other type. if (pDebugEntry->Type == IMAGE_DEBUG_TYPE_CODEVIEW) { // Found a codeview entry - use it's timestamp for comparison timestamp = pDebugEntry->TimeDateStamp; break; } } char szMsgBuf[1024]; _snprintf_s(szMsgBuf, sizeof(szMsgBuf), _TRUNCATE, "Failed to find any valid codeview debug directory entry in %s image", MAIN_CLR_MODULE_NAME_A); _ASSERTE_MSG(timestamp != 0, szMsgBuf); } EX_CATCH { if (!DacExceptionFilter(GET_EXCEPTION(), this, &hr)) { EX_RETHROW; } } EX_END_CATCH(SwallowAllExceptions) DAC_LEAVE(); if (FAILED(hr)) { return hr; } // Validate that we got a timestamp and it matches what the DAC table told us to expect if (timestamp == 0 || timestamp != g_dacTableInfo.dwID0) { // Timestamp mismatch. This means mscordacwks is being used with a version of // mscorwks other than the one it was built for. This will not work reliably. #ifdef _DEBUG // Check if verbose asserts are enabled. The default is up to the specific instantiation of // ClrDataAccess, but can be overridden (in either direction) by a COMPlus_ knob. // Note that we check this knob every time because it may be handy to turn it on in // the environment mid-flight. DWORD dwAssertDefault = m_fEnableDllVerificationAsserts ? 1 : 0; if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_DbgDACAssertOnMismatch, dwAssertDefault)) { // Output a nice error message that contains the timestamps in string format. time_t actualTime = timestamp; char szActualTime[30]; ctime_s(szActualTime, sizeof(szActualTime), &actualTime); time_t expectedTime = g_dacTableInfo.dwID0; char szExpectedTime[30]; ctime_s(szExpectedTime, sizeof(szExpectedTime), &expectedTime); // Create a nice detailed message for the assert dialog. // Note that the strings returned by ctime_s have terminating newline characters. // This is technically a TARGET_CONSISTENCY_CHECK because a corrupt target could, // in-theory, have a corrupt mscrowks PE header and cause this check to fail // unnecessarily. However, this check occurs during startup, before we know // whether target consistency checks should be enabled, so it's always enabled // at the moment. char szMsgBuf[1024]; _snprintf_s(szMsgBuf, sizeof(szMsgBuf), _TRUNCATE, "DAC fatal error: %s/mscordacwks.dll version mismatch\n\n"\ "The debug directory timestamp of the loaded %s does not match the\n"\ "version mscordacwks.dll was built for.\n"\ "Expected %s timestamp: %s"\ "Actual %s timestamp: %s\n"\ "DAC will now fail to initialize with a CORDBG_E_MISMATCHED_CORWKS_AND_DACWKS_DLLS\n"\ "error. If you really want to try and use the mimatched DLLs, you can disable this\n"\ "check by setting COMPlus_DbgDACSkipVerifyDlls=1. However, using a mismatched DAC\n"\ "DLL will usually result in arbitrary debugger failures.\n", TARGET_MAIN_CLR_DLL_NAME_A, TARGET_MAIN_CLR_DLL_NAME_A, TARGET_MAIN_CLR_DLL_NAME_A, szExpectedTime, TARGET_MAIN_CLR_DLL_NAME_A, szActualTime); _ASSERTE_MSG(false, szMsgBuf); } #endif // Return a specific hresult indicating this problem return CORDBG_E_MISMATCHED_CORWKS_AND_DACWKS_DLLS; } #endif // TARGET_UNIX return S_OK; } #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS void ClrDataAccess::InitStreamsForWriting(IN CLRDataEnumMemoryFlags flags) { // enforce this should only be called when generating triage and mini-dumps if (flags != CLRDATA_ENUM_MEM_MINI && flags != CLRDATA_ENUM_MEM_TRIAGE) return; EX_TRY { if (m_streams == NULL) m_streams = new DacStreamManager(g_MiniMetaDataBuffAddress, g_MiniMetaDataBuffMaxSize); if (!m_streams->PrepareStreamsForWriting()) { delete m_streams; m_streams = NULL; } } EX_CATCH { if (m_streams != NULL) { delete m_streams; m_streams = NULL; } } EX_END_CATCH(SwallowAllExceptions) } bool ClrDataAccess::MdCacheAddEEName(TADDR taEEStruct, const SString& name) { bool result = false; EX_TRY { if (m_streams != NULL) result = m_streams->MdCacheAddEEName(taEEStruct, name); } EX_CATCH { result = false; } EX_END_CATCH(SwallowAllExceptions) return result; } void ClrDataAccess::EnumStreams(IN CLRDataEnumMemoryFlags flags) { // enforce this should only be called when generating triage and mini-dumps if (flags != CLRDATA_ENUM_MEM_MINI && flags != CLRDATA_ENUM_MEM_TRIAGE) return; EX_TRY { if (m_streams != NULL) m_streams->EnumStreams(flags); } EX_CATCH { } EX_END_CATCH(SwallowAllExceptions) } bool ClrDataAccess::MdCacheGetEEName(TADDR taEEStruct, SString & eeName) { bool result = false; EX_TRY { if (m_streams == NULL) m_streams = new DacStreamManager(g_MiniMetaDataBuffAddress, g_MiniMetaDataBuffMaxSize); result = m_streams->MdCacheGetEEName(taEEStruct, eeName); } EX_CATCH { result = false; } EX_END_CATCH(SwallowAllExceptions) return result; } #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS // Needed for RT_RCDATA. #define MAKEINTRESOURCE(v) MAKEINTRESOURCEW(v) // this funny looking double macro forces x to be macro expanded before L is prepended #define _WIDE(x) _WIDE2(x) #define _WIDE2(x) W(x) HRESULT GetDacTableAddress(ICorDebugDataTarget* dataTarget, ULONG64 baseAddress, PULONG64 dacTableAddress) { #ifdef TARGET_UNIX #ifdef USE_DAC_TABLE_RVA #ifdef DAC_TABLE_SIZE if (DAC_TABLE_SIZE != sizeof(g_dacGlobals)) { return E_INVALIDARG; } #endif // On MacOS, FreeBSD or NetBSD use the RVA include file *dacTableAddress = baseAddress + DAC_TABLE_RVA; #else // On Linux/MacOS try to get the dac table address via the export symbol if (!TryGetSymbol(dataTarget, baseAddress, "g_dacTable", dacTableAddress)) { return CORDBG_E_MISSING_DEBUGGER_EXPORTS; } #endif #endif return S_OK; } HRESULT ClrDataAccess::GetDacGlobals() { #ifdef TARGET_UNIX ULONG64 dacTableAddress; HRESULT hr = GetDacTableAddress(m_pTarget, m_globalBase, &dacTableAddress); if (FAILED(hr)) { return hr; } if (FAILED(ReadFromDataTarget(m_pTarget, dacTableAddress, (BYTE*)&g_dacGlobals, sizeof(g_dacGlobals)))) { return CORDBG_E_MISSING_DEBUGGER_EXPORTS; } if (g_dacGlobals.ThreadStore__s_pThreadStore == NULL) { return CORDBG_E_UNSUPPORTED; } return S_OK; #else HRESULT status = E_FAIL; DWORD rsrcRVA = 0; LPVOID rsrcData = NULL; DWORD rsrcSize = 0; DWORD resourceSectionRVA = 0; if (FAILED(status = GetMachineAndResourceSectionRVA(m_pTarget, m_globalBase, NULL, &resourceSectionRVA))) { _ASSERTE_MSG(false, "DAC fatal error: can't locate resource section in " TARGET_MAIN_CLR_DLL_NAME_A); return CORDBG_E_MISSING_DEBUGGER_EXPORTS; } if (FAILED(status = GetResourceRvaFromResourceSectionRvaByName(m_pTarget, m_globalBase, resourceSectionRVA, (DWORD)(size_t)RT_RCDATA, _WIDE(DACCESS_TABLE_RESOURCE), 0, &rsrcRVA, &rsrcSize))) { _ASSERTE_MSG(false, "DAC fatal error: can't locate DAC table resource in " TARGET_MAIN_CLR_DLL_NAME_A); return CORDBG_E_MISSING_DEBUGGER_EXPORTS; } rsrcData = new (nothrow) BYTE[rsrcSize]; if (rsrcData == NULL) return E_OUTOFMEMORY; if (FAILED(status = ReadFromDataTarget(m_pTarget, m_globalBase + rsrcRVA, (BYTE*)rsrcData, rsrcSize))) { _ASSERTE_MSG(false, "DAC fatal error: can't load DAC table resource from " TARGET_MAIN_CLR_DLL_NAME_A); return CORDBG_E_MISSING_DEBUGGER_EXPORTS; } PBYTE rawData = (PBYTE)rsrcData; DWORD bytesLeft = rsrcSize; // Read the header struct DacTableHeader header; // We currently expect the header to be 2 32-bit values and 1 16-byte value, // make sure there is no packing going on or anything. static_assert_no_msg(sizeof(DacTableHeader) == 2 * 4 + 16); if (bytesLeft < sizeof(DacTableHeader)) { _ASSERTE_MSG(false, "DAC fatal error: DAC table too small for header."); goto Exit; } memcpy(&header, rawData, sizeof(DacTableHeader)); rawData += sizeof(DacTableHeader); bytesLeft -= sizeof(DacTableHeader); // Save the table info for later use g_dacTableInfo = header.info; // Sanity check that the DAC table is the size we expect. // This could fail if a different version of dacvars.h or vptr_list.h was used when building // mscordacwks.dll than when running DacTableGen. if (offsetof(DacGlobals, EEJitManager__vtAddr) != header.numGlobals * sizeof(ULONG)) { #ifdef _DEBUG char szMsgBuf[1024]; _snprintf_s(szMsgBuf, sizeof(szMsgBuf), _TRUNCATE, "DAC fatal error: mismatch in number of globals in DAC table. Read from file: %d, expected: %zd.", header.numGlobals, (size_t)offsetof(DacGlobals, EEJitManager__vtAddr) / sizeof(ULONG)); _ASSERTE_MSG(false, szMsgBuf); #endif // _DEBUG status = E_INVALIDARG; goto Exit; } if (sizeof(DacGlobals) != (header.numGlobals + header.numVptrs) * sizeof(ULONG)) { #ifdef _DEBUG char szMsgBuf[1024]; _snprintf_s(szMsgBuf, sizeof(szMsgBuf), _TRUNCATE, "DAC fatal error: mismatch in number of vptrs in DAC table. Read from file: %d, expected: %zd.", header.numVptrs, (size_t)(sizeof(DacGlobals) - offsetof(DacGlobals, EEJitManager__vtAddr)) / sizeof(ULONG)); _ASSERTE_MSG(false, szMsgBuf); #endif // _DEBUG status = E_INVALIDARG; goto Exit; } // Copy the DAC table into g_dacGlobals if (bytesLeft < sizeof(DacGlobals)) { _ASSERTE_MSG(false, "DAC fatal error: DAC table resource too small for DacGlobals."); status = E_UNEXPECTED; goto Exit; } memcpy(&g_dacGlobals, rawData, sizeof(DacGlobals)); rawData += sizeof(DacGlobals); bytesLeft -= sizeof(DacGlobals); status = S_OK; Exit: return status; #endif } #undef MAKEINTRESOURCE //---------------------------------------------------------------------------- // // IsExceptionFromManagedCode - report if pExceptionRecord points to an exception belonging to the current runtime // // Arguments: // pExceptionRecord - the exception record // // Return Value: // TRUE if it is // Otherwise, FALSE // //---------------------------------------------------------------------------- BOOL ClrDataAccess::IsExceptionFromManagedCode(EXCEPTION_RECORD* pExceptionRecord) { DAC_ENTER(); BOOL flag = FALSE; if (::IsExceptionFromManagedCode(pExceptionRecord)) { flag = TRUE; } DAC_LEAVE(); return flag; } #ifndef TARGET_UNIX //---------------------------------------------------------------------------- // // GetWatsonBuckets - retrieve Watson buckets from the specified thread // // Arguments: // dwThreadId - the thread ID // pGM - pointer to the space to store retrieved Watson buckets // // Return Value: // S_OK if the operation is successful. // or S_FALSE if Watson buckets cannot be found // else detailed error code. // //---------------------------------------------------------------------------- HRESULT ClrDataAccess::GetWatsonBuckets(DWORD dwThreadId, GenericModeBlock * pGM) { _ASSERTE((dwThreadId != 0) && (pGM != NULL)); if ((dwThreadId == 0) || (pGM == NULL)) { return E_INVALIDARG; } DAC_ENTER(); Thread * pThread = DacGetThread(dwThreadId); _ASSERTE(pThread != NULL); HRESULT hr = E_UNEXPECTED; if (pThread != NULL) { hr = GetClrWatsonBucketsWorker(pThread, pGM); } DAC_LEAVE(); return hr; } #endif // TARGET_UNIX //---------------------------------------------------------------------------- // // CLRDataAccessCreateInstance - create and initialize a ClrDataAccess object // // Arguments: // pLegacyTarget - data target object // pClrDataAccess - ClrDataAccess object // // Return Value: // S_OK on success, else detailed error code. // //---------------------------------------------------------------------------- STDAPI CLRDataAccessCreateInstance(ICLRDataTarget * pLegacyTarget, ClrDataAccess ** pClrDataAccess) { if ((pLegacyTarget == NULL) || (pClrDataAccess == NULL)) { return E_INVALIDARG; } *pClrDataAccess = NULL; // Create an adapter which implements the new ICorDebugDataTarget interfaces using // a legacy implementation of ICLRDataTarget // ClrDataAccess will take a take a ref on this and delete it when it's released. DataTargetAdapter * pDtAdapter = new (nothrow) DataTargetAdapter(pLegacyTarget); if (!pDtAdapter) { return E_OUTOFMEMORY; } ClrDataAccess* dacClass = new (nothrow) ClrDataAccess(pDtAdapter, pLegacyTarget); if (!dacClass) { delete pDtAdapter; return E_OUTOFMEMORY; } HRESULT hr = dacClass->Initialize(); if (FAILED(hr)) { dacClass->Release(); return hr; } *pClrDataAccess = dacClass; return S_OK; } //---------------------------------------------------------------------------- // // CLRDataCreateInstance. // Creates the IXClrData object // This is the legacy entrypoint to DAC, used by dbgeng/dbghelp (windbg, SOS, watson, etc). // //---------------------------------------------------------------------------- STDAPI DLLEXPORT CLRDataCreateInstance(REFIID iid, ICLRDataTarget * pLegacyTarget, void ** iface) { if ((pLegacyTarget == NULL) || (iface == NULL)) { return E_INVALIDARG; } *iface = NULL; ClrDataAccess * pClrDataAccess; HRESULT hr = CLRDataAccessCreateInstance(pLegacyTarget, &pClrDataAccess); if (hr != S_OK) { return hr; } hr = pClrDataAccess->QueryInterface(iid, iface); pClrDataAccess->Release(); return hr; } //---------------------------------------------------------------------------- // // OutOfProcessExceptionEventGetProcessIdAndThreadId - get ProcessID and ThreadID // // Arguments: // hProcess - process handle // hThread - thread handle // pPId - pointer to DWORD to store ProcessID // pThreadId - pointer to DWORD to store ThreadID // // Return Value: // TRUE if the operation is successful. // FALSE if it fails // //---------------------------------------------------------------------------- BOOL OutOfProcessExceptionEventGetProcessIdAndThreadId(HANDLE hProcess, HANDLE hThread, DWORD * pPId, DWORD * pThreadId) { _ASSERTE((pPId != NULL) && (pThreadId != NULL)); #ifdef TARGET_UNIX // UNIXTODO: mikem 1/13/15 Need appropriate PAL functions for getting ids *pPId = (DWORD)(SIZE_T)hProcess; *pThreadId = (DWORD)(SIZE_T)hThread; #else *pPId = GetProcessIdOfThread(hThread); *pThreadId = GetThreadId(hThread); #endif // TARGET_UNIX return TRUE; } // WER_RUNTIME_EXCEPTION_INFORMATION will be available from Win7 SDK once Win7 SDK is released. #if !defined(WER_RUNTIME_EXCEPTION_INFORMATION) typedef struct _WER_RUNTIME_EXCEPTION_INFORMATION { DWORD dwSize; HANDLE hProcess; HANDLE hThread; EXCEPTION_RECORD exceptionRecord; CONTEXT context; } WER_RUNTIME_EXCEPTION_INFORMATION, * PWER_RUNTIME_EXCEPTION_INFORMATION; #endif // !defined(WER_RUNTIME_EXCEPTION_INFORMATION) #ifndef TARGET_UNIX //---------------------------------------------------------------------------- // // OutOfProcessExceptionEventGetWatsonBucket - retrieve Watson buckets if it is a managed exception // // Arguments: // pContext - the context passed at helper module registration // pExceptionInformation - structure that contains information about the crash // pGM - pointer to the space to store retrieved Watson buckets // // Return Value: // S_OK if the operation is successful. // or S_FALSE if it is not a managed exception or Watson buckets cannot be found // else detailed error code. // //---------------------------------------------------------------------------- STDAPI OutOfProcessExceptionEventGetWatsonBucket(_In_ PDWORD pContext, _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, _Out_ GenericModeBlock * pGMB) { HANDLE hProcess = pExceptionInformation->hProcess; HANDLE hThread = pExceptionInformation->hThread; DWORD PId, ThreadId; if (!OutOfProcessExceptionEventGetProcessIdAndThreadId(hProcess, hThread, &PId, &ThreadId)) { return E_FAIL; } CLRDATA_ADDRESS baseAddressOfRuntime = (CLRDATA_ADDRESS)pContext; NewHolder<LiveProcDataTarget> dataTarget(NULL); dataTarget = new (nothrow) LiveProcDataTarget(hProcess, PId, baseAddressOfRuntime); if (dataTarget == NULL) { return E_OUTOFMEMORY; } NewHolder<ClrDataAccess> pClrDataAccess(NULL); HRESULT hr = CLRDataAccessCreateInstance(dataTarget, &pClrDataAccess); if (hr != S_OK) { if (hr == S_FALSE) { return E_FAIL; } else { return hr; } } if (!pClrDataAccess->IsExceptionFromManagedCode(&pExceptionInformation->exceptionRecord)) { return S_FALSE; } return pClrDataAccess->GetWatsonBuckets(ThreadId, pGMB); } //---------------------------------------------------------------------------- // // OutOfProcessExceptionEventCallback - claim the ownership of this event if current // runtime threw the unhandled exception // // Arguments: // pContext - the context passed at helper module registration // pExceptionInformation - structure that contains information about the crash // pbOwnershipClaimed - output parameter for claiming the ownership of this event // pwszEventName - name of the event. If this is NULL, pchSize cannot be NULL. // This parameter is valid only if * pbOwnershipClaimed is TRUE. // pchSize - the size of the buffer pointed by pwszEventName // pdwSignatureCount - the count of signature parameters. Valid values range from // 0 to 10. If the value returned is greater than 10, only the // 1st 10 parameters are used for bucketing parameters. This // parameter is valid only if * pbOwnershipClaimed is TRUE. // // Return Value: // S_OK on success, else detailed error code. // // Note: // This is the 1st function that is called into by WER. This API through its out // parameters, tells WER as to whether or not it is claiming the crash. If it does // claim the crash, WER uses the event name specified in the string pointed to by // pwszEventName for error reporting. WER then proceed to call the // OutOfProcessExceptionEventSignatureCallback to get the bucketing parameters from // the helper dll. // // This function follows the multiple call paradigms. WER may call into this function // with *pwszEventName pointer set to NULL. This is to indicate to the function, that // WER wants to know the buffer size needed by the function to populate the string // into the buffer. The function should return E_INSUFFICIENTBUFFER with the needed // buffer size in *pchSize. WER shall then allocate a buffer of size *pchSize for // pwszEventName and then call this function again at which point the function should // populate the string and return S_OK. // // Note that *pdOwnershipClaimed should be set to TRUE everytime this function is called // for the helper dll to claim ownership of bucketing. // // The Win7 WER spec is at // http://windows/windows7/docs/COSD%20Documents/Fundamentals/Feedback%20Services%20and%20Platforms/WER-CLR%20Integration%20Dev%20Spec.docx // // !!!READ THIS!!! // Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224). // //---------------------------------------------------------------------------- STDAPI OutOfProcessExceptionEventCallback(_In_ PDWORD pContext, _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, _Out_ BOOL * pbOwnershipClaimed, _Out_writes_(*pchSize) PWSTR pwszEventName, __inout PDWORD pchSize, _Out_ PDWORD pdwSignatureCount) { SUPPORTS_DAC_HOST_ONLY; if ((pContext == NULL) || (pExceptionInformation == NULL) || (pExceptionInformation->dwSize < sizeof(WER_RUNTIME_EXCEPTION_INFORMATION)) || (pbOwnershipClaimed == NULL) || (pchSize == NULL) || (pdwSignatureCount == NULL)) { return E_INVALIDARG; } *pbOwnershipClaimed = FALSE; GenericModeBlock gmb; HRESULT hr = E_FAIL; EX_TRY { // get Watson buckets if it is a managed exception hr = OutOfProcessExceptionEventGetWatsonBucket(pContext, pExceptionInformation, &gmb); } EX_CATCH_HRESULT(hr); if (hr != S_OK) { // S_FALSE means either it is not a managed exception or we do not have Watson buckets. // Since we have set pbOwnershipClaimed to FALSE, we return S_OK to WER. if (hr == S_FALSE) { hr = S_OK; } return hr; } if ((pwszEventName == NULL) || (*pchSize <= wcslen(gmb.wzEventTypeName))) { *pchSize = static_cast<DWORD>(wcslen(gmb.wzEventTypeName)) + 1; return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); } // copy custom event name wcscpy_s(pwszEventName, *pchSize, gmb.wzEventTypeName); *pdwSignatureCount = GetCountBucketParamsForEvent(gmb.wzEventTypeName); *pbOwnershipClaimed = TRUE; return S_OK; } //---------------------------------------------------------------------------- // // OutOfProcessExceptionEventCallback - provide custom Watson buckets // // Arguments: // pContext - the context passed at helper module registration // pExceptionInformation - structure that contains information about the crash // dwIndex - the index of the bucketing parameter being requested. Valid values are // from 0 to 9 // pwszName - pointer to the name of the bucketing parameter // pchName - pointer to character count of the pwszName buffer. If pwszName points to // null, *pchName represents the buffer size (represented in number of characters) // needed to populate the name in pwszName. // pwszValue - pointer to the value of the pwszName bucketing parameter // pchValue - pointer to the character count of the pwszValue buffer. If pwszValue points // to null, *pchValue represents the buffer size (represented in number of // characters) needed to populate the value in pwszValue. // // Return Value: // S_OK on success, else detailed error code. // // Note: // This function is called by WER only if the call to OutOfProcessExceptionEventCallback() // was successful and the value of *pbOwnershipClaimed was TRUE. This function is called // pdwSignatureCount times to collect the bucketing parameters from the helper dll. // // This function also follows the multiple call paradigm as described for the // OutOfProcessExceptionEventCallback() function. The buffer sizes needed for // this function are of the pwszName and pwszValue buffers. // // !!!READ THIS!!! // Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224). // //---------------------------------------------------------------------------- STDAPI OutOfProcessExceptionEventSignatureCallback(_In_ PDWORD pContext, _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, _In_ DWORD dwIndex, _Out_writes_(*pchName) PWSTR pwszName, __inout PDWORD pchName, _Out_writes_(*pchValue) PWSTR pwszValue, __inout PDWORD pchValue) { SUPPORTS_DAC_HOST_ONLY; if ((pContext == NULL) || (pExceptionInformation == NULL) || (pExceptionInformation->dwSize < sizeof(WER_RUNTIME_EXCEPTION_INFORMATION)) || (pchName == NULL) || (pchValue == NULL)) { return E_INVALIDARG; } if ((pwszName == NULL) || (*pchName == 0)) { *pchName = 1; return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); } GenericModeBlock gmb; const PWSTR pwszBucketValues[] = {gmb.wzP1, gmb.wzP2, gmb.wzP3, gmb.wzP4, gmb.wzP5, gmb.wzP6, gmb.wzP7, gmb.wzP8, gmb.wzP9, gmb.wzP10}; HRESULT hr = E_FAIL; EX_TRY { // get Watson buckets if it is a managed exception hr = OutOfProcessExceptionEventGetWatsonBucket(pContext, pExceptionInformation, &gmb); } EX_CATCH_HRESULT(hr); // it's possible for the OS to kill // the faulting process before WER crash reporting has completed. _ASSERTE(hr == S_OK || hr == CORDBG_E_READVIRTUAL_FAILURE); if (hr != S_OK) { // S_FALSE means either it is not a managed exception or we do not have Watson buckets. // Either case is a logic error becuase this function is called by WER only if the call // to OutOfProcessExceptionEventCallback() was successful and the value of // *pbOwnershipClaimed was TRUE. if (hr == S_FALSE) { hr = E_FAIL; } return hr; } DWORD paramCount = GetCountBucketParamsForEvent(gmb.wzEventTypeName); if (dwIndex >= paramCount) { _ASSERTE(!"dwIndex is out of range"); return E_INVALIDARG; } // Return pwszName as an emptry string to let WER use localized version of "Parameter n" *pwszName = W('\0'); if ((pwszValue == NULL) || (*pchValue <= wcslen(pwszBucketValues[dwIndex]))) { *pchValue = static_cast<DWORD>(wcslen(pwszBucketValues[dwIndex]))+ 1; return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); } // copy custom Watson bucket value wcscpy_s(pwszValue, *pchValue, pwszBucketValues[dwIndex]); return S_OK; } #endif // TARGET_UNIX //---------------------------------------------------------------------------- // // OutOfProcessExceptionEventCallback - provide custom debugger launch string // // Arguments: // pContext - the context passed at helper module registration // pExceptionInformation - structure that contains information about the crash // pbCustomDebuggerNeeded - pointer to a BOOL. If this BOOL is set to TRUE, then // a custom debugger launch option is needed by the // process. In that case, the subsequent parameters will // be meaningfully used. If this is FALSE, the subsequent // parameters will be ignored. // pwszDebuggerLaunch - pointer to a string that will be used to launch the debugger, // if the debugger is launched. The value of this string overrides // the default debugger launch string used by WER. // pchSize - pointer to the character count of the pwszDebuggerLaunch buffer. If // pwszDebuggerLaunch points to null, *pchSize represents the buffer size // (represented in number of characters) needed to populate the debugger // launch string in pwszDebuggerLaunch. // pbAutoLaunchDebugger - pointer to a BOOL. If this BOOL is set to TRUE, WER will // directly launch the debugger. If set to FALSE, WER will show // the debug option to the user in the WER UI. // // Return Value: // S_OK on success, else detailed error code. // // Note: // This function is called into by WER only if the call to OutOfProcessExceptionEventCallback() // was successful and the value of *pbOwnershipClaimed was TRUE. This function allows the helper // dll to customize the debugger launch options including the launch string. // // This function also follows the multiple call paradigm as described for the // OutOfProcessExceptionEventCallback() function. The buffer sizes needed for // this function are of the pwszName and pwszValue buffers. // //---------------------------------------------------------------------------- STDAPI OutOfProcessExceptionEventDebuggerLaunchCallback(_In_ PDWORD pContext, _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, _Out_ BOOL * pbCustomDebuggerNeeded, _Out_writes_opt_(*pchSize) PWSTR pwszDebuggerLaunch, __inout PDWORD pchSize, _Out_ BOOL * pbAutoLaunchDebugger) { SUPPORTS_DAC_HOST_ONLY; if ((pContext == NULL) || (pExceptionInformation == NULL) || (pExceptionInformation->dwSize < sizeof(WER_RUNTIME_EXCEPTION_INFORMATION)) || (pbCustomDebuggerNeeded == NULL) || (pwszDebuggerLaunch == NULL) || (pchSize == NULL) || (pbAutoLaunchDebugger == NULL)) { return E_INVALIDARG; } // Starting from CLRv4 managed debugger string and setting are unified with native debuggers. // There is no need to provide custom debugger string for WER. *pbCustomDebuggerNeeded = FALSE; return S_OK; } // DacHandleEnum #include "comcallablewrapper.h" DacHandleWalker::DacHandleWalker() : mDac(0), m_instanceAge(0), mMap(0), mIndex(0), mTypeMask(0), mGenerationFilter(-1), mChunkIndex(0), mCurr(0), mIteratorIndex(0) { SUPPORTS_DAC; } DacHandleWalker::~DacHandleWalker() { SUPPORTS_DAC; HandleChunkHead *curr = mHead.Next; while (curr) { HandleChunkHead *tmp = curr; curr = curr->Next; delete tmp; } } HRESULT DacHandleWalker::Init(ClrDataAccess *dac, UINT types[], UINT typeCount) { SUPPORTS_DAC; if (dac == NULL || types == NULL) return E_POINTER; mDac = dac; m_instanceAge = dac->m_instanceAge; return Init(BuildTypemask(types, typeCount)); } HRESULT DacHandleWalker::Init(ClrDataAccess *dac, UINT types[], UINT typeCount, int gen) { SUPPORTS_DAC; if (gen < 0 || gen > (int)*g_gcDacGlobals->max_gen) return E_INVALIDARG; mGenerationFilter = gen; return Init(dac, types, typeCount); } HRESULT DacHandleWalker::Init(UINT32 typemask) { SUPPORTS_DAC; mMap = g_gcDacGlobals->handle_table_map; mTypeMask = typemask; return S_OK; } UINT32 DacHandleWalker::BuildTypemask(UINT types[], UINT typeCount) { SUPPORTS_DAC; UINT32 mask = 0; for (UINT i = 0; i < typeCount; ++i) { _ASSERTE(types[i] < 32); mask |= (1 << types[i]); } return mask; } HRESULT DacHandleWalker::Next(unsigned int celt, SOSHandleData handles[], unsigned int *pceltFetched) { SUPPORTS_DAC; if (handles == NULL || pceltFetched == NULL) return E_POINTER; SOSHelperEnter(); hr = DoHandleWalk<SOSHandleData, unsigned int, DacHandleWalker::EnumCallbackSOS>(celt, handles, pceltFetched); SOSHelperLeave(); return hr; } bool DacHandleWalker::FetchMoreHandles(HANDLESCANPROC callback) { SUPPORTS_DAC; // The table slots are based on the number of GC heaps in the process. int max_slots = 1; #ifdef FEATURE_SVR_GC if (GCHeapUtilities::IsServerHeap()) max_slots = GCHeapCount(); #endif // FEATURE_SVR_GC // Reset the Count on all cached chunks. We reuse chunks after allocating // them, and the count is the only thing which needs resetting. for (HandleChunkHead *curr = &mHead; curr; curr = curr->Next) curr->Count = 0; DacHandleWalkerParam param(&mHead); do { // Have we advanced past the end of the current bucket? if (mMap && mIndex >= INITIAL_HANDLE_TABLE_ARRAY_SIZE) { mIndex = 0; mMap = mMap->pNext; } // Have we walked the entire handle table map? if (mMap == NULL) { mCurr = NULL; return false; } if (mMap->pBuckets[mIndex] != NULL) { for (int i = 0; i < max_slots; ++i) { DPTR(dac_handle_table) hTable = mMap->pBuckets[mIndex]->pTable[i]; if (hTable) { // Yikes! The handle table callbacks don't produce the handle type or // the AppDomain that we need, and it's too difficult to propagate out // these things (especially the type) without worrying about performance // implications for the GC. Instead we'll have the callback walk each // type individually. There are only a few handle types, and the handle // table has a fast-path for only walking a single type anyway. UINT32 handleType = 0; for (UINT32 mask = mTypeMask; mask; mask >>= 1, handleType++) { if (mask & 1) { dac_handle_table *pTable = hTable; PTR_AppDomain pDomain = AppDomain::GetCurrentDomain(); param.AppDomain = TO_CDADDR(pDomain.GetAddr()); param.Type = handleType; // Either enumerate the handles regularly, or walk the handle // table as the GC does if a generation filter was requested. if (mGenerationFilter != -1) HndScanHandlesForGC(hTable, callback, (LPARAM)&param, 0, &handleType, 1, mGenerationFilter, *g_gcDacGlobals->max_gen, 0); else HndEnumHandles(hTable, &handleType, 1, callback, (LPARAM)&param, 0, FALSE); } } } } } // Stop looping as soon as we have found data. We also stop if we have a failed HRESULT during // the callback (this should indicate OOM). mIndex++; } while (mHead.Count == 0 && SUCCEEDED(param.Result)); mCurr = mHead.Next; return true; } HRESULT DacHandleWalker::Skip(unsigned int celt) { return E_NOTIMPL; } HRESULT DacHandleWalker::Reset() { return E_NOTIMPL; } HRESULT DacHandleWalker::GetCount(unsigned int *pcelt) { return E_NOTIMPL; } void DacHandleWalker::GetRefCountedHandleInfo( OBJECTREF oref, unsigned int uType, unsigned int *pRefCount, unsigned int *pJupiterRefCount, BOOL *pIsPegged, BOOL *pIsStrong) { SUPPORTS_DAC; if (pJupiterRefCount) *pJupiterRefCount = 0; if (pIsPegged) *pIsPegged = FALSE; #if defined(FEATURE_COMINTEROP) || defined(FEATURE_COMWRAPPERS) || defined(FEATURE_OBJCMARSHAL) if (uType == HNDTYPE_REFCOUNTED) { #if defined(FEATURE_COMINTEROP) // get refcount from the CCW PTR_ComCallWrapper pWrap = ComCallWrapper::GetWrapperForObject(oref); if (pWrap != NULL) { if (pRefCount) *pRefCount = (unsigned int)pWrap->GetRefCount(); if (pIsStrong) *pIsStrong = pWrap->IsWrapperActive(); return; } #endif #if defined(FEATURE_OBJCMARSHAL) // [TODO] FEATURE_OBJCMARSHAL #endif // FEATURE_OBJCMARSHAL } #endif // FEATURE_COMINTEROP || FEATURE_COMWRAPPERS || FEATURE_OBJCMARSHAL if (pRefCount) *pRefCount = 0; if (pIsStrong) *pIsStrong = FALSE; } void CALLBACK DacHandleWalker::EnumCallbackSOS(PTR_UNCHECKED_OBJECTREF handle, uintptr_t *pExtraInfo, uintptr_t param1, uintptr_t param2) { SUPPORTS_DAC; DacHandleWalkerParam *param = (DacHandleWalkerParam *)param1; HandleChunkHead *curr = param->Curr; // If we failed on a previous call (OOM) don't keep trying to allocate, it's not going to work. if (FAILED(param->Result)) return; // We've moved past the size of the current chunk. We'll allocate a new chunk // and stuff the handles there. These are cleaned up by the destructor if (curr->Count >= (curr->Size/sizeof(SOSHandleData))) { if (curr->Next == NULL) { HandleChunk *next = new (nothrow) HandleChunk; if (next != NULL) { curr->Next = next; } else { param->Result = E_OUTOFMEMORY; return; } } curr = param->Curr = param->Curr->Next; } // Fill the current handle. SOSHandleData *dataArray = (SOSHandleData*)curr->pData; SOSHandleData &data = dataArray[curr->Count++]; data.Handle = TO_CDADDR(handle.GetAddr()); data.Type = param->Type; if (param->Type == HNDTYPE_DEPENDENT) data.Secondary = GetDependentHandleSecondary(handle.GetAddr()).GetAddr(); #ifdef FEATURE_COMINTEROP else if (param->Type == HNDTYPE_WEAK_NATIVE_COM) data.Secondary = HndGetHandleExtraInfo(handle.GetAddr()); #endif // FEATURE_COMINTEROP else data.Secondary = 0; data.AppDomain = param->AppDomain; GetRefCountedHandleInfo((OBJECTREF)*handle, param->Type, &data.RefCount, &data.JupiterRefCount, &data.IsPegged, &data.StrongReference); data.StrongReference |= (BOOL)IsAlwaysStrongReference(param->Type); } DacStackReferenceWalker::DacStackReferenceWalker(ClrDataAccess *dac, DWORD osThreadID) : mDac(dac), m_instanceAge(dac ? dac->m_instanceAge : 0), mThread(0), mErrors(0), mEnumerated(false), mChunkIndex(0), mCurr(0), mIteratorIndex(0) { Thread *curr = NULL; for (curr = ThreadStore::GetThreadList(curr); curr; curr = ThreadStore::GetThreadList(curr)) { if (curr->GetOSThreadId() == osThreadID) { mThread = curr; break; } } } DacStackReferenceWalker::~DacStackReferenceWalker() { StackRefChunkHead *curr = mHead.next; while (curr) { StackRefChunkHead *tmp = curr; curr = curr->next; delete tmp; } } HRESULT DacStackReferenceWalker::Init() { if (!mThread) return E_INVALIDARG; return mHeap.Init(); } HRESULT STDMETHODCALLTYPE DacStackReferenceWalker::Skip(unsigned int count) { return E_NOTIMPL; } HRESULT STDMETHODCALLTYPE DacStackReferenceWalker::Reset() { return E_NOTIMPL; } HRESULT DacStackReferenceWalker::GetCount(unsigned int *pCount) { if (!pCount) return E_POINTER; SOSHelperEnter(); if (!mEnumerated) { // Fill out our data structures. WalkStack<unsigned int, SOSStackRefData>(0, NULL, DacStackReferenceWalker::GCReportCallbackSOS, DacStackReferenceWalker::GCEnumCallbackSOS); } unsigned int count = 0; for(StackRefChunkHead *curr = &mHead; curr; curr = curr->next) count += curr->count; *pCount = count; SOSHelperLeave(); return hr; } HRESULT DacStackReferenceWalker::Next(unsigned int count, SOSStackRefData stackRefs[], unsigned int *pFetched) { if (stackRefs == NULL || pFetched == NULL) return E_POINTER; SOSHelperEnter(); hr = DoStackWalk<unsigned int, SOSStackRefData, DacStackReferenceWalker::GCReportCallbackSOS, DacStackReferenceWalker::GCEnumCallbackSOS> (count, stackRefs, pFetched); SOSHelperLeave(); return hr; } HRESULT DacStackReferenceWalker::EnumerateErrors(ISOSStackRefErrorEnum **ppEnum) { if (!ppEnum) return E_POINTER; SOSHelperEnter(); if (mThread) { // Fill out our data structures. WalkStack<unsigned int, SOSStackRefData>(0, NULL, DacStackReferenceWalker::GCReportCallbackSOS, DacStackReferenceWalker::GCEnumCallbackSOS); } DacStackReferenceErrorEnum *pEnum = new DacStackReferenceErrorEnum(this, mErrors); hr = pEnum->QueryInterface(__uuidof(ISOSStackRefErrorEnum), (void**)ppEnum); SOSHelperLeave(); return hr; } CLRDATA_ADDRESS DacStackReferenceWalker::ReadPointer(TADDR addr) { ULONG32 bytesRead = 0; TADDR result = 0; HRESULT hr = mDac->m_pTarget->ReadVirtual(addr, (BYTE*)&result, sizeof(TADDR), &bytesRead); if (FAILED(hr) || (bytesRead != sizeof(TADDR))) return (CLRDATA_ADDRESS)~0; return TO_CDADDR(result); } void DacStackReferenceWalker::GCEnumCallbackSOS(LPVOID hCallback, OBJECTREF *pObject, uint32_t flags, DacSlotLocation loc) { GCCONTEXT *gcctx = (GCCONTEXT *)hCallback; DacScanContext *dsc = (DacScanContext*)gcctx->sc; // Yuck. The GcInfoDecoder reports a local pointer for registers (as it's reading out of the REGDISPLAY // in the stack walk), and it reports a TADDR for stack locations. This is architecturally difficulty // to fix, so we are leaving it for now. TADDR addr = 0; TADDR obj = 0; if (loc.targetPtr) { addr = (TADDR)pObject; obj = TO_TADDR(dsc->pWalker->ReadPointer((CORDB_ADDRESS)addr)); } else { obj = pObject->GetAddr(); } if (flags & GC_CALL_INTERIOR) { CORDB_ADDRESS fixed_obj = 0; HRESULT hr = dsc->pWalker->mHeap.ListNearObjects((CORDB_ADDRESS)obj, NULL, &fixed_obj, NULL); // If we failed...oh well, SOS won't mind. We'll just report the interior pointer as is. if (SUCCEEDED(hr)) obj = TO_TADDR(fixed_obj); } SOSStackRefData *data = dsc->pWalker->GetNextObject<SOSStackRefData>(dsc); if (data != NULL) { // Report where the object and where it was found. data->HasRegisterInformation = true; data->Register = loc.reg; data->Offset = loc.regOffset; data->Address = TO_CDADDR(addr); data->Object = TO_CDADDR(obj); data->Flags = flags; // Report the frame that the data came from. data->StackPointer = TO_CDADDR(dsc->sp); if (dsc->pFrame) { data->SourceType = SOS_StackSourceFrame; data->Source = dac_cast<PTR_Frame>(dsc->pFrame).GetAddr(); } else { data->SourceType = SOS_StackSourceIP; data->Source = TO_CDADDR(dsc->pc); } } } void DacStackReferenceWalker::GCReportCallbackSOS(PTR_PTR_Object ppObj, ScanContext *sc, uint32_t flags) { DacScanContext *dsc = (DacScanContext*)sc; CLRDATA_ADDRESS obj = dsc->pWalker->ReadPointer(ppObj.GetAddr()); if (flags & GC_CALL_INTERIOR) { CORDB_ADDRESS fixed_addr = 0; HRESULT hr = dsc->pWalker->mHeap.ListNearObjects((CORDB_ADDRESS)obj, NULL, &fixed_addr, NULL); // If we failed...oh well, SOS won't mind. We'll just report the interior pointer as is. if (SUCCEEDED(hr)) obj = TO_CDADDR(fixed_addr); } SOSStackRefData *data = dsc->pWalker->GetNextObject<SOSStackRefData>(dsc); if (data != NULL) { data->HasRegisterInformation = false; data->Register = 0; data->Offset = 0; data->Address = ppObj.GetAddr(); data->Object = obj; data->Flags = flags; data->StackPointer = TO_CDADDR(dsc->sp); if (dsc->pFrame) { data->SourceType = SOS_StackSourceFrame; data->Source = dac_cast<PTR_Frame>(dsc->pFrame).GetAddr(); } else { data->SourceType = SOS_StackSourceIP; data->Source = TO_CDADDR(dsc->pc); } } } StackWalkAction DacStackReferenceWalker::Callback(CrawlFrame *pCF, VOID *pData) { // // KEEP IN SYNC WITH GcStackCrawlCallBack in vm\gcscan.cpp // GCCONTEXT *gcctx = (GCCONTEXT*)pData; DacScanContext *dsc = (DacScanContext*)gcctx->sc; MethodDesc *pMD = pCF->GetFunction(); gcctx->sc->pMD = pMD; PREGDISPLAY pRD = pCF->GetRegisterSet(); dsc->sp = (TADDR)GetRegdisplaySP(pRD);; dsc->pc = PCODEToPINSTR(GetControlPC(pRD)); ResetPointerHolder<CrawlFrame*> rph(&gcctx->cf); gcctx->cf = pCF; bool fReportGCReferences = true; #if defined(FEATURE_EH_FUNCLETS) // On Win64 and ARM, we may have unwound this crawlFrame and thus, shouldn't report the invalid // references it may contain. // todo. fReportGCReferences = pCF->ShouldCrawlframeReportGCReferences(); #endif // defined(FEATURE_EH_FUNCLETS) Frame *pFrame = ((DacScanContext*)gcctx->sc)->pFrame = pCF->GetFrame(); EX_TRY { if (fReportGCReferences) { if (pCF->IsFrameless()) { ICodeManager * pCM = pCF->GetCodeManager(); _ASSERTE(pCM != NULL); unsigned flags = pCF->GetCodeManagerFlags(); pCM->EnumGcRefs(pCF->GetRegisterSet(), pCF->GetCodeInfo(), flags, dsc->pEnumFunc, pData); } else { pFrame->GcScanRoots(gcctx->f, gcctx->sc); } } } EX_CATCH { SOSStackErrorList *err = new SOSStackErrorList; err->pNext = NULL; if (pFrame) { err->error.SourceType = SOS_StackSourceFrame; err->error.Source = dac_cast<PTR_Frame>(pFrame).GetAddr(); } else { err->error.SourceType = SOS_StackSourceIP; err->error.Source = TO_CDADDR(dsc->pc); } if (dsc->pWalker->mErrors == NULL) { dsc->pWalker->mErrors = err; } else { // This exception case should be non-existent. It only happens when there is either // a clr!Frame on the callstack which is not properly dac-ized, or when a call down // EnumGcRefs causes a data read exception. Since this is so rare, we don't worry // about making this code very efficient. SOSStackErrorList *curr = dsc->pWalker->mErrors; while (curr->pNext) curr = curr->pNext; curr->pNext = err; } } EX_END_CATCH(SwallowAllExceptions) #if 0 // todo // If we're executing a LCG dynamic method then we must promote the associated resolver to ensure it // doesn't get collected and yank the method code out from under us). // Be careful to only promote the reference -- we can also be called to relocate the reference and // that can lead to all sorts of problems since we could be racing for the relocation with the long // weak handle we recover the reference from. Promoting the reference is enough, the handle in the // reference will be relocated properly as long as we keep it alive till the end of the collection // as long as the reference is actually maintained by the long weak handle. if (pMD) { BOOL fMaybeCollectibleMethod = TRUE; // If this is a frameless method then the jitmanager can answer the question of whether // or not this is LCG simply by looking at the heap where the code lives, however there // is also the prestub case where we need to explicitly look at the MD for stuff that isn't // ngen'd if (pCF->IsFrameless() && pMD->IsLCGMethod()) { fMaybeCollectibleMethod = ExecutionManager::IsCollectibleMethod(pCF->GetMethodToken()); } if (fMaybeCollectibleMethod && pMD->IsLCGMethod()) { PTR_Object obj = OBJECTREFToObject(pMD->AsDynamicMethodDesc()->GetLCGMethodResolver()->GetManagedResolver()); dsc->pWalker->ReportObject(obj); } else { if (fMaybeCollectibleMethod) { PTR_Object obj = pMD->GetLoaderAllocator()->GetExposedObject(); dsc->pWalker->ReportObject(obj); } if (fReportGCReferences) { GenericParamContextType paramContextType = GENERIC_PARAM_CONTEXT_NONE; if (pCF->IsFrameless()) { // We need to grab the Context Type here because there are cases where the MethodDesc // is shared, and thus indicates there should be an instantion argument, but the JIT // was still allowed to optimize it away and we won't grab it below because we're not // reporting any references from this frame. paramContextType = pCF->GetCodeManager()->GetParamContextType(pCF->GetRegisterSet(), pCF->GetCodeInfo()); } else { if (pMD->RequiresInstMethodDescArg()) paramContextType = GENERIC_PARAM_CONTEXT_METHODDESC; else if (pMD->RequiresInstMethodTableArg()) paramContextType = GENERIC_PARAM_CONTEXT_METHODTABLE; } // Handle the case where the method is a static shared generic method and we need to keep the type of the generic parameters alive if (paramContextType == GENERIC_PARAM_CONTEXT_METHODDESC) { MethodDesc *pMDReal = dac_cast<PTR_MethodDesc>(pCF->GetParamTypeArg()); _ASSERTE((pMDReal != NULL) || !pCF->IsFrameless()); if (pMDReal != NULL) { PTR_Object obj = pMDReal->GetLoaderAllocator()->GetExposedObject(); dsc->pWalker->ReportObject(obj); } } else if (paramContextType == GENERIC_PARAM_CONTEXT_METHODTABLE) { MethodTable *pMTReal = dac_cast<PTR_MethodTable>(pCF->GetParamTypeArg()); _ASSERTE((pMTReal != NULL) || !pCF->IsFrameless()); if (pMTReal != NULL) { PTR_Object obj = pMTReal->GetLoaderAllocator()->GetExposedObject(); dsc->pWalker->ReportObject(obj); } } } } } #endif return SWA_CONTINUE; } DacStackReferenceErrorEnum::DacStackReferenceErrorEnum(DacStackReferenceWalker *pEnum, SOSStackErrorList *pErrors) : mEnum(pEnum), mHead(pErrors), mCurr(pErrors) { _ASSERTE(mEnum); if (mHead != NULL) mEnum->AddRef(); } DacStackReferenceErrorEnum::~DacStackReferenceErrorEnum() { if (mHead) mEnum->Release(); } HRESULT DacStackReferenceErrorEnum::Skip(unsigned int count) { unsigned int i = 0; for (i = 0; i < count && mCurr; ++i) mCurr = mCurr->pNext; return i < count ? S_FALSE : S_OK; } HRESULT DacStackReferenceErrorEnum::Reset() { mCurr = mHead; return S_OK; } HRESULT DacStackReferenceErrorEnum::GetCount(unsigned int *pCount) { SOSStackErrorList *curr = mHead; unsigned int count = 0; while (curr) { curr = curr->pNext; count++; } *pCount = count; return S_OK; } HRESULT DacStackReferenceErrorEnum::Next(unsigned int count, SOSStackRefError ref[], unsigned int *pFetched) { if (pFetched == NULL || ref == NULL) return E_POINTER; unsigned int i; for (i = 0; i < count && mCurr; ++i, mCurr = mCurr->pNext) ref[i] = mCurr->error; *pFetched = i; return i < count ? S_FALSE : S_OK; }
#include "Halide.h" #include <stdio.h> #include <math.h> using std::vector; using namespace Halide; using namespace Halide::Internal; class CountInterleaves : public IRVisitor { public: int result; CountInterleaves() : result(0) {} using IRVisitor::visit; void visit(const Call *op) { if (op->is_intrinsic(Call::interleave_vectors)) { result++; } IRVisitor::visit(op); } }; int count_interleaves(Func f) { Target t = get_jit_target_from_environment(); t.set_feature(Target::NoBoundsQuery); t.set_feature(Target::NoAsserts); f.compute_root(); Stmt s = Internal::lower({f.function()}, f.name(), t); CountInterleaves i; s.accept(&i); return i.result; } void check_interleave_count(Func f, int correct) { int c = count_interleaves(f); if (c < correct) { printf("Func %s should have interleaved >= %d times but interleaved %d times instead.\n", f.name().c_str(), correct, c); exit(-1); } } void define(FuncRef f, std::vector<Expr> values) { if (values.size() == 1) { f = values[0]; } else { f = Tuple(values); } } void define(FuncRef f, Expr value, int count) { std::vector<Expr> values; for (int i = 0; i < count; i++) { values.push_back(value); } define(f, values); } Expr element(FuncRef f, int i) { if (f.size() == 1) { assert(i == 0); return f; } else { return f[i]; } } // Make sure the interleave pattern generates good vector code int main(int argc, char **argv) { Var x, y, c; // As of May 26 2016, this test causes a segfault due to // permissions failure on ARM-32 trying to execute a // non-executable page when jitting. Started happening between // llvm commits 270148 and 270159, but there's no obvious // culprit. Just disabling it for now. { Target t = get_host_target(); if (t.arch == Target::ARM && t.bits == 32) { printf("Skipping test on arm-32 (see the source for why)\n"); return 0; } } for (int elements = 1; elements <= 5; elements++) { Func f, g, h; std::vector<Expr> f_def, g_def; for (int i = 0; i < elements; i++) { f_def.push_back(sin(x + i)); g_def.push_back(cos(x + i)); } define(f(x), f_def); define(g(x), g_def); std::vector<Expr> h_def; for (int i = 0; i < elements; i++) { h_def.push_back(select(x % 2 == 0, 1.0f/element(f(x/2), i), element(g(x/2), i)*17.0f)); g_def.push_back(cos(x + i)); } define(h(x), h_def); f.compute_root(); g.compute_root(); h.vectorize(x, 8); check_interleave_count(h, 1); Realization results = h.realize(16); for (int i = 0; i < elements; i++) { Buffer<float> result = results[i]; for (int x = 0; x < 16; x++) { float correct = ((x % 2) == 0) ? (1.0f/(sinf(x/2 + i))) : (cosf(x/2 + i)*17.0f); float delta = result(x) - correct; if (delta > 0.01 || delta < -0.01) { printf("result(%d) = %f instead of %f\n", x, result(x), correct); return -1; } } } } { // Test interleave 3 vectors: Func planar, interleaved; planar(x, y) = Halide::cast<float>( 3 * x + y ); interleaved(x, y) = planar(x, y); Var xy("xy"); planar .compute_at(interleaved, xy) .vectorize(x, 4); interleaved .reorder(y, x) .bound(y, 0, 3) .bound(x, 0, 16) .fuse(y, x, xy) .vectorize(xy, 12); interleaved .output_buffer() .dim(0) .set_stride(3) .dim(1) .set_min(0) .set_stride(1) .set_extent(3); Buffer<float> buff3(3, 16); buff3.transpose(0, 1); interleaved.realize(buff3); check_interleave_count(interleaved, 1); for (int x = 0; x < 16; x++) { for (int y = 0; y < 3; y++) { float correct = 3*x + y; float delta = buff3(x, y) - correct; if (delta > 0.01 || delta < -0.01) { printf("result(%d) = %f instead of %f\n", x, buff3(x,y), correct); return -1; } } } } { // Test interleave 4 vectors: Func f1, f2, f3, f4, f5; f1(x) = sin(x); f2(x) = sin(2*x); f3(x) = sin(3*x); f4(x) = sin(4*x); f5(x) = sin(5*x); Func output4; output4(x, y) = select(y == 0, f1(x), y == 1, f2(x), y == 2, f3(x), f4(x)); output4 .reorder(y, x) .bound(y, 0, 4) .unroll(y) .vectorize(x, 4); output4.output_buffer() .dim(0) .set_stride(4) .dim(1) .set_min(0) .set_stride(1) .set_extent(4); check_interleave_count(output4, 1); Buffer<float> buff4(4, 16); buff4.transpose(0, 1); output4.realize(buff4); for (int x = 0; x < 16; x++) { for (int y = 0; y < 4; y++) { float correct = sin((y+1)*x); float delta = buff4(x, y) - correct; if (delta > 0.01 || delta < -0.01) { printf("result(%d) = %f instead of %f\n", x, buff4(x,y), correct); return -1; } } } // Test interleave 5 vectors: Func output5; output5(x, y) = select(y == 0, f1(x), y == 1, f2(x), y == 2, f3(x), y == 3, f4(x), f5(x)); output5 .reorder(y, x) .bound(y, 0, 5) .unroll(y) .vectorize(x, 4); output5.output_buffer() .dim(0) .set_stride(5) .dim(1) .set_min(0) .set_stride(1) .set_extent(5); check_interleave_count(output5, 1); Buffer<float> buff5(5, 16); buff5.transpose(0, 1); output5.realize(buff5); for (int x = 0; x < 16; x++) { for (int y = 0; y < 5; y++) { float correct = sin((y+1)*x); float delta = buff5(x, y) - correct; if (delta > 0.01 || delta < -0.01) { printf("result(%d) = %f instead of %f\n", x, buff5(x,y), correct); return -1; } } } } { // Test interleaving inside of nested blocks Func f1, f2, f3, f4, f5; f1(x) = sin(x); f1.compute_root(); f2(x) = sin(2*x); f2.compute_root(); Func unrolled; unrolled(x, y) = select(x % 2 == 0, f1(x), f2(x)) + y; Var xi, yi; unrolled.tile(x, y, xi, yi, 16, 2).unroll(xi, 2).vectorize(xi, 4).unroll(xi).unroll(yi); check_interleave_count(unrolled, 4); } for (int elements = 1; elements <= 5; elements++) { // Make sure we don't interleave when the reordering would change the meaning. Realization* refs = nullptr; for (int i = 0; i < 2; i++) { Func output6; define(output6(x, y), cast<uint8_t>(x), elements); RDom r(0, 16); // A not-safe-to-merge pair of updates define(output6(2*r, 0), cast<uint8_t>(3), elements); define(output6(2*r+1, 0), cast<uint8_t>(4), elements); // A safe-to-merge pair of updates define(output6(2*r, 1), cast<uint8_t>(3), elements); define(output6(2*r+1, 1), cast<uint8_t>(4), elements); // A safe-to-merge-but-not-complete triple of updates: define(output6(3*r, 3), cast<uint8_t>(3), elements); define(output6(3*r+1, 3), cast<uint8_t>(4), elements); // A safe-to-merge-but-we-don't pair of updates, because they // load recursively, so we conservatively bail out. std::vector<Expr> rdef0, rdef1; for (int i = 0; i < elements; i++) { rdef0.push_back(element(output6(2*r, 2), i) + 1); rdef1.push_back(element(output6(2*r+1, 2), i) + 1); } define(output6(2*r, 2), rdef0); define(output6(2*r+1, 2), rdef1); // A safe-to-merge triple of updates: define(output6(3*r, 3), cast<uint8_t>(7), elements); define(output6(3*r+2, 3), cast<uint8_t>(9), elements); define(output6(3*r+1, 3), cast<uint8_t>(8), elements); if (i == 0) { // Making the reference output. refs = new Realization(output6.realize(50, 4)); } else { // Vectorize and compare to the reference. for (int j = 0; j < 11; j++) { output6.update(j).vectorize(r); } check_interleave_count(output6, 2*elements); Realization outs = output6.realize(50, 4); for (int e = 0; e < elements; e++) { Buffer<uint8_t> ref = (*refs)[e]; Buffer<uint8_t> out = outs[e]; for (int y = 0; y < ref.height(); y++) { for (int x = 0; x < ref.width(); x++) { if (out(x, y) != ref(x, y)) { printf("result(%d, %d) = %d instead of %d\n", x, y, out(x, y), ref(x, y)); return -1; } } } } } } delete refs; } { // Test that transposition works when vectorizing either dimension: Func square("square"); square(x, y) = cast(UInt(16), 5*x + y); Func trans1("trans1"); trans1(x, y) = square(y, x); Func trans2("trans2"); trans2(x, y) = square(y, x); square.compute_root() .bound(x, 0, 8) .bound(y, 0, 8); trans1.compute_root() .bound(x, 0, 8) .bound(y, 0, 8) .vectorize(x) .unroll(y); trans2.compute_root() .bound(x, 0, 8) .bound(y, 0, 8) .unroll(x) .vectorize(y); trans1.output_buffer() .dim(0) .set_min(0) .set_stride(1) .set_extent(8) .dim(1) .set_min(0) .set_stride(8) .set_extent(8); trans2.output_buffer() .dim(0) .set_min(0) .set_stride(1) .set_extent(8) .dim(1) .set_min(0) .set_stride(8) .set_extent(8); Buffer<uint16_t> result6(8, 8); Buffer<uint16_t> result7(8, 8); trans1.realize(result6); trans2.realize(result7); for (int x = 0; x < 8; x++) { for (int y = 0; y < 8; y++) { int correct = 5*y + x; if (result6(x,y) != correct) { printf("result(%d) = %d instead of %d\n", x, result6(x,y), correct); return -1; } if (result7(x,y) != correct) { printf("result(%d) = %d instead of %d\n", x, result7(x,y), correct); return -1; } } } check_interleave_count(trans1, 1); check_interleave_count(trans2, 1); } printf("Success!\n"); return 0; }
#include "brainclouds2s.h" #include <curl/curl.h> #include <json/json.h> #include <atomic> #include <chrono> #include <condition_variable> #include <mutex> #include <queue> #include <thread> #define s2s_log(...) {printf(__VA_ARGS__); fflush(stdout);} using AuthenticateCallback = std::function<void(const Json::Value&)>; // Error code for expired session static const int SERVER_SESSION_EXPIRED = 40365; // 30 minutes heartbeat interval static const int HEARTBEAT_INTERVALE_MS = 60 * 30 * 1000; class S2SContext_internal final : public S2SContext , public std::enable_shared_from_this<S2SContext_internal> { public: S2SContext_internal(const std::string& appId, const std::string& serverName, const std::string& serverSecret, const std::string& url); ~S2SContext_internal(); void setLogEnabled(bool enabled) override; void request( const std::string& json, const S2SCallback& callback) override; void runCallbacks(uint64_t timeoutMS = 0) override; // private: struct Callback { S2SCallback callback; std::string data; }; void authenticate(const AuthenticateCallback& callback); void sendRequest(const std::string& json, const S2SCallback& callback); void s2sRequest(const Json::Value& json, const S2SCallback& callback); void curlSend(const std::string& data, const S2SCallback& successCallback, const S2SCallback& errorCallback); void queueCallback(const Callback& callback); void startHeartbeat(); void stopHeartbeat(); void disconnect(); void sendHeartbeat(); std::string m_appId; std::string m_serverName; std::string m_serverSecret; std::string m_url; bool m_logEnabled = false; bool m_authenticated = false; int m_packetId = 0; std::string m_sessionId = ""; std::chrono::system_clock::time_point m_heartbeatStartTime; std::chrono::milliseconds m_heartbeatInverval; // Callbacks queue std::mutex m_callbacksMutex; std::condition_variable m_callbacksCond; std::queue<Callback> m_callbacks; }; S2SContextRef S2SContext::create(const std::string& appId, const std::string& serverName, const std::string& serverSecret, const std::string& url) { return S2SContextRef( new S2SContext_internal(appId, serverName, serverSecret, url) ); } S2SContext_internal::S2SContext_internal(const std::string& appId, const std::string& serverName, const std::string& serverSecret, const std::string& url) : m_appId(appId) , m_serverName(serverName) , m_serverSecret(serverSecret) , m_url(url) , m_heartbeatInverval(HEARTBEAT_INTERVALE_MS) { } S2SContext_internal::~S2SContext_internal() { disconnect(); } void S2SContext_internal::setLogEnabled(bool enabled) { m_logEnabled = enabled; } void S2SContext_internal::authenticate(const AuthenticateCallback& callback) { // Build the authentication json Json::Value json(Json::ValueType::objectValue); json["packetId"] = 0; Json::Value messages(Json::ValueType::arrayValue); Json::Value message(Json::ValueType::objectValue); message["service"] = "authenticationV2"; message["operation"] = "AUTHENTICATE"; Json::Value data(Json::ValueType::objectValue); data["appId"] = m_appId; data["serverName"] = m_serverName; data["serverSecret"] = m_serverSecret; message["data"] = data; messages.append(message); json["messages"] = messages; auto pThis = shared_from_this(); s2sRequest(json, [pThis, callback](const std::string& dataStr) { Json::Value data; Json::Reader reader; bool parsingSuccessful = reader.parse(dataStr.c_str(), data); if (!parsingSuccessful) { Json::Value json(Json::ValueType::objectValue); json["status"] = 900; json["message"] = "Failed to parse json"; pThis->disconnect(); callback(json); return; } const auto& messageResponses = data["messageResponses"]; if (!messageResponses.isNull() && messageResponses.size() > 0 && messageResponses[0]["status"].isInt() && messageResponses[0]["status"].asInt() == 200) { const auto& message = messageResponses[0]; pThis->m_authenticated = true; pThis->m_packetId = data["packetId"].asInt() + 1; const auto& messageData = message["data"]; pThis->m_sessionId = messageData["sessionId"].asString(); const auto& heartbeatSeconds = messageData["heartbeatSeconds"]; if (heartbeatSeconds.isInt()) { pThis->m_heartbeatInverval = std::chrono::milliseconds(heartbeatSeconds.asInt() * 1000); } pThis->startHeartbeat(); callback(message); } else { Json::Value json(Json::ValueType::objectValue); json["status"] = 900; json["message"] = "Malformed json"; pThis->disconnect(); callback(json); } }); } void S2SContext_internal::sendRequest( const std::string& json, const S2SCallback& callback) { // Build packet json Json::Value packet(Json::ValueType::objectValue); packet["packetId"] = m_packetId; packet["sessionId"] = m_sessionId; Json::Value messages(Json::ValueType::arrayValue); // Parse user json { Json::Value data; Json::Reader reader; bool parsingSuccessful = reader.parse(json.c_str(), data); if (!parsingSuccessful) { callback("{\"status_code\":900,\"message\":\"Failed to parse user json\"}"); return; } messages.append(data); } packet["messages"] = messages; m_packetId++; auto pThis = shared_from_this(); s2sRequest(packet, [pThis, json, callback](const std::string& dataStr) { Json::Value data; Json::Reader reader; bool parsingSuccessful = reader.parse(dataStr.c_str(), data); if (!parsingSuccessful) { pThis->disconnect(); callback("{\"status_code\":900,\"message\":\"Failed to parse json\"}"); return; } const auto& messageResponses = data["messageResponses"]; if (data["status"].asInt() != 200 && data["reason_code"].asInt() == SERVER_SESSION_EXPIRED) { pThis->disconnect(); // Redo the request, it will try to authenticate again pThis->request(json, callback); return; } if (callback) { Json::StreamWriterBuilder builder; builder["indentation"] = ""; // If you want whitespace-less output std::string jsonStr = Json::writeString(builder, messageResponses[0]); callback(jsonStr); } }); } void S2SContext_internal::s2sRequest( const Json::Value& json, const S2SCallback& callback) { Json::StreamWriterBuilder builder; builder["indentation"] = ""; // If you want whitespace-less output std::string postData = Json::writeString(builder, json); if (m_logEnabled) { s2s_log("[S2S SEND %s] %s\n", m_appId.c_str(), postData.c_str()); } auto pThis = shared_from_this(); curlSend(postData, [pThis, callback](const std::string& data) { if (pThis->m_logEnabled) { s2s_log("[S2S RECV %s] %s\n", pThis->m_appId.c_str(), data.c_str()); } if (callback) { callback(data); } }, [pThis, callback](const std::string& data) { if (pThis->m_logEnabled) { s2s_log("[S2S Error %s] %s\n", pThis->m_appId.c_str(), data.c_str()); } if (callback) { callback(data); } }); } /** * This is the writer call back function used by curl * * @param toWrite - data received from the remote server * @param size - size of a character (?) * @param nmemb - number of characters * @param data - pointer to the curlloader * * @return int - number of characters received (should equal size * nmemb) */ static size_t writeData( char * toWrite, size_t size, size_t nmemb, void * data) { std::string* pOutData = (std::string*)data; // What we will return size_t result = 0; // Check for a valid response object. if (pOutData != NULL) { // Append the data to the buffer pOutData->append(toWrite, size * nmemb); // How much did we write? result = size * nmemb; } return result; } void S2SContext_internal::curlSend(const std::string& postData, const S2SCallback& successCallback, const S2SCallback& errorCallback) { auto pThis = shared_from_this(); auto sendThread = std::thread( [pThis, postData, successCallback, errorCallback] { CURL* curl = curl_easy_init(); if (!curl) { if (errorCallback) { pThis->queueCallback({ errorCallback, "{\"status_code\":900,\"message\":\"cURL Out of Memory\"}" }); } return; } char curlError[CURL_ERROR_SIZE]; // Use an error buffer to store the description of any errors. curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curlError); // Set the headers. struct curl_slist * headers = NULL; headers = curl_slist_append(headers, "Content-Type: application/json"); std::string contentLength = "Content-Length: " + std::to_string(postData.size()); headers = curl_slist_append(headers, contentLength.c_str()); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); // Set up the object to store the content of the response. std::string result; curl_easy_setopt(curl, CURLOPT_WRITEDATA, &result); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeData); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, (long)0); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, (long)0); // Set the base URL for the request. curl_easy_setopt(curl, CURLOPT_URL, pThis->m_url.c_str()); // Create all of the form data. curl_easy_setopt(curl, CURLOPT_POST, 1); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, postData.size()); curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, postData.c_str()); CURLcode rc = curl_easy_perform(curl); if (rc == CURLE_OPERATION_TIMEDOUT) { if (errorCallback) { pThis->queueCallback({ errorCallback, "{\"status_code\":900,\"message\":\"Operation timed out\"}" }); } return; } else if (rc != CURLE_OK) { if (errorCallback) { pThis->queueCallback({ errorCallback, std::string("{\"status_code\":900,\"message\":\"") + curlError + "\"}" }); } return; } // Clean up memory. if (headers != NULL) { curl_slist_free_all(headers); } curl_easy_cleanup(curl); if (successCallback) { pThis->queueCallback({ successCallback, result }); } }); sendThread.detach(); } void S2SContext_internal::request( const std::string& json, const S2SCallback& callback) { if (m_authenticated) { sendRequest(json, callback); } else { auto pThis = shared_from_this(); authenticate([pThis, json, callback](const Json::Value& data) { if (!data.isNull()) { pThis->sendRequest(json, callback); } else if (callback) { callback("{\"status\":900}"); } }); } } void S2SContext_internal::startHeartbeat() { stopHeartbeat(); m_heartbeatStartTime = std::chrono::system_clock::now(); } void S2SContext_internal::stopHeartbeat() { } void S2SContext_internal::disconnect() { stopHeartbeat(); m_authenticated = false; } void S2SContext_internal::queueCallback(const Callback& callback) { std::unique_lock<std::mutex> lock(m_callbacksMutex); m_callbacks.push(callback); m_callbacksCond.notify_all(); } void S2SContext_internal::sendHeartbeat() { auto pThis = shared_from_this(); sendRequest("{ \ \"service\":\"heartbeat\", \ \"operation\":\"HEARTBEAT\" \ }", [pThis](const std::string& result) { Json::Value data; Json::Reader reader; bool parsingSuccessful = reader.parse(result.c_str(), data); if (!parsingSuccessful || data.isNull() || data["status"].asInt() != 200) { pThis->disconnect(); return; } }); } void S2SContext_internal::runCallbacks(uint64_t timeoutMS) { // Send heartbeat if we have to if (m_authenticated) { auto now = std::chrono::system_clock::now(); auto timeDiff = now - m_heartbeatStartTime; if (timeDiff >= std::chrono::milliseconds(m_heartbeatInverval)) { sendHeartbeat(); m_heartbeatStartTime = now; timeDiff = decltype(timeDiff)::zero(); } // Just wait for the specified timeout if (timeoutMS > 0) { auto waitTime = std::min( std::chrono::milliseconds(timeoutMS), std::chrono::milliseconds(m_heartbeatInverval) - std::chrono::duration_cast<std::chrono::milliseconds>(timeDiff) ); std::unique_lock<std::mutex> lock(m_callbacksMutex); m_callbacksCond.wait_for(lock, waitTime); } } else if (timeoutMS > 0) { // Just wait for the specified timeout std::unique_lock<std::mutex> lock(m_callbacksMutex); m_callbacksCond.wait_for(lock, std::chrono::milliseconds(timeoutMS)); } m_callbacksMutex.lock(); while (!m_callbacks.empty()) { auto callback = m_callbacks.front(); m_callbacks.pop(); if (callback.callback) { m_callbacksMutex.unlock(); callback.callback(callback.data); m_callbacksMutex.lock(); } } m_callbacksMutex.unlock(); }
#include "parserDriver.h" #include <cerrno> #include <cstdio> #include <iostream> #include <sstream> #include <boost/algorithm/string/predicate.hpp> #include <boost/format.hpp> #include "frontends/common/options.h" #include "frontends/common/constantFolding.h" #include "frontends/parsers/p4/p4lexer.hpp" #include "frontends/parsers/p4/p4AnnotationLexer.hpp" #include "frontends/parsers/p4/p4parser.hpp" #include "frontends/parsers/v1/v1lexer.hpp" #include "frontends/parsers/v1/v1parser.hpp" #include "lib/error.h" #ifdef HAVE_LIBBOOST_IOSTREAMS #include <boost/iostreams/device/file_descriptor.hpp> #include <boost/iostreams/stream.hpp> namespace { /// A RAII helper class that provides an istream wrapper for a stdio FILE*. This /// is the efficient implementation for users with boost::iostreams installed. struct AutoStdioInputStream { explicit AutoStdioInputStream(FILE* in) : source(fileno(in), boost::iostreams::never_close_handle) , buffer(source) , stream(&buffer) { } std::istream& get() { return stream; } private: AutoStdioInputStream(const AutoStdioInputStream&) = delete; AutoStdioInputStream(AutoStdioInputStream&&) = delete; boost::iostreams::file_descriptor_source source; boost::iostreams::stream_buffer<boost::iostreams::file_descriptor_source> buffer; std::istream stream; }; } // anonymous namespace #else /// A RAII helper class that provides an istream wrapper for a stdio FILE*. This /// is an inefficient fallback implementation. struct AutoStdioInputStream { explicit AutoStdioInputStream(FILE* in) { char buffer[512]; while (fgets(buffer, sizeof(buffer), in)) stream << buffer; } std::istream& get() { return stream; } private: std::stringstream stream; }; #endif namespace P4 { AbstractParserDriver::AbstractParserDriver() : sources(new Util::InputSources) { } AbstractParserDriver::~AbstractParserDriver() { } void AbstractParserDriver::onReadToken(const char* text) { auto posBeforeToken = sources->getCurrentPosition(); sources->appendText(text); auto posAfterToken = sources->getCurrentPosition(); yylloc = Util::SourceInfo(sources, posBeforeToken, posAfterToken); } void AbstractParserDriver::onReadLineNumber(const char* text) { char* last; errno = 0; lineDirectiveLine = strtol(text, &last, 10); const bool consumedEntireToken = strlen(last) == 0; if (errno != 0 || !consumedEntireToken) { auto& context = BaseCompileContext::get(); context.errorReporter().parser_error(sources, "Error parsing line number %s", text); } } void AbstractParserDriver::onReadComment(const char* text, bool lineComment) { sources->addComment(yylloc, lineComment, text); } void AbstractParserDriver::onReadFileName(const char* text) { lineDirectiveFile = cstring(text); sources->mapLine(lineDirectiveFile, lineDirectiveLine); } void AbstractParserDriver::onReadIdentifier(cstring id) { lastIdentifier = id; } void AbstractParserDriver::onParseError(const Util::SourceInfo& location, const std::string& message) { static const std::string unexpectedIdentifierError = "syntax error, unexpected IDENTIFIER"; auto& context = BaseCompileContext::get(); if (boost::equal(message, unexpectedIdentifierError)) { context.errorReporter().parser_error(location, boost::format("%s \"%s\"") % unexpectedIdentifierError % lastIdentifier); } else { context.errorReporter().parser_error(location, message); } } P4ParserDriver::P4ParserDriver() : structure(new Util::ProgramStructure) , nodes(new IR::Vector<IR::Node>()) { } bool P4ParserDriver::parse(AbstractP4Lexer& lexer, const char* sourceFile, unsigned sourceLine /* = 1 */) { // Create and configure the parser. P4Parser parser(*this, lexer); #ifdef YYDEBUG if (const char *p = getenv("YYDEBUG")) parser.set_debug_level(atoi(p)); structure->setDebug(parser.debug_level() != 0); #endif // Provide an initial source location. sources->mapLine(sourceFile, sourceLine); // Parse. if (parser.parse() != 0) return false; structure->endParse(); return true; } /* static */ const IR::P4Program* P4ParserDriver::parse(std::istream& in, const char* sourceFile, unsigned sourceLine /* = 1 */) { LOG1("Parsing P4-16 program " << sourceFile); P4ParserDriver driver; P4Lexer lexer(in); if (!driver.parse(lexer, sourceFile, sourceLine)) return nullptr; return new IR::P4Program(driver.nodes->srcInfo, *driver.nodes); } /* static */ const IR::P4Program* P4ParserDriver::parse(FILE* in, const char* sourceFile, unsigned sourceLine /* = 1 */) { AutoStdioInputStream inputStream(in); return parse(inputStream.get(), sourceFile, sourceLine); } template<typename T> const T* P4ParserDriver::parse(P4AnnotationLexer::Type type, const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { LOG3("Parsing P4-16 annotation " << srcInfo); P4AnnotationLexer lexer(type, srcInfo, body); if (!parse(lexer, srcInfo.getSourceFile())) { return nullptr; } return nodes->front()->to<T>(); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseExpressionList(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::EXPRESSION_LIST, srcInfo, body); } /* static */ const IR::IndexedVector<IR::NamedExpression>* P4ParserDriver::parseKvList(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::IndexedVector<IR::NamedExpression>>( P4AnnotationLexer::KV_LIST, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseConstantList(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::INTEGER_LIST, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseConstantOrStringLiteralList(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::INTEGER_OR_STRING_LITERAL_LIST, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseStringLiteralList(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::STRING_LITERAL_LIST, srcInfo, body); } /* static */ const IR::Expression* P4ParserDriver::parseExpression(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Expression>( P4AnnotationLexer::EXPRESSION, srcInfo, body); } /* static */ const IR::Constant* P4ParserDriver::parseConstant(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Constant>( P4AnnotationLexer::INTEGER, srcInfo, body); } /* static */ const IR::Expression* P4ParserDriver::parseConstantOrStringLiteral(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Expression>( P4AnnotationLexer::INTEGER_OR_STRING_LITERAL, srcInfo, body); } /* static */ const IR::StringLiteral* P4ParserDriver::parseStringLiteral(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::StringLiteral>( P4AnnotationLexer::STRING_LITERAL, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseExpressionPair(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::EXPRESSION_PAIR, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseConstantPair(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::INTEGER_PAIR, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseStringLiteralPair(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::STRING_LITERAL_PAIR, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseExpressionTriple(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::EXPRESSION_TRIPLE, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseConstantTriple(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::INTEGER_TRIPLE, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseStringLiteralTriple(const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::STRING_LITERAL_TRIPLE, srcInfo, body); } /* static */ const IR::Vector<IR::Expression>* P4ParserDriver::parseP4rtTranslationAnnotation( const Util::SourceInfo& srcInfo, const IR::Vector<IR::AnnotationToken>& body) { P4ParserDriver driver; return driver.parse<IR::Vector<IR::Expression>>( P4AnnotationLexer::P4RT_TRANSLATION_ANNOTATION, srcInfo, body); } void P4ParserDriver::onReadErrorDeclaration(IR::Type_Error* error) { if (allErrors == nullptr) { nodes->push_back(error); allErrors = error; return; } allErrors->members.append(error->members); } } // namespace P4 namespace V1 { V1ParserDriver::V1ParserDriver() : global(new IR::V1Program) { } /* static */ const IR::V1Program* V1ParserDriver::parse(std::istream& in, const char* sourceFile, unsigned sourceLine /* = 1 */) { LOG1("Parsing P4-14 program " << sourceFile); // Create and configure the parser and lexer. V1ParserDriver driver; V1Lexer lexer(in); V1Parser parser(driver, lexer); #ifdef YYDEBUG if (const char *p = getenv("YYDEBUG")) parser.set_debug_level(atoi(p)); #endif // Provide an initial source location. driver.sources->mapLine(sourceFile, sourceLine); // Parse. if (parser.parse() != 0) return nullptr; return driver.global; } /* static */ const IR::V1Program* V1ParserDriver::parse(FILE* in, const char* sourceFile, unsigned sourceLine /* = 1 */) { AutoStdioInputStream inputStream(in); return parse(inputStream.get(), sourceFile, sourceLine); } IR::Constant* V1ParserDriver::constantFold(IR::Expression* expr) { IR::Node* node(expr); auto rv = node->apply(P4::DoConstantFolding(nullptr, nullptr))->to<IR::Constant>(); return rv ? new IR::Constant(rv->srcInfo, rv->type, rv->value, rv->base) : nullptr; } IR::Vector<IR::Expression> V1ParserDriver::makeExpressionList(const IR::NameList* list) { IR::Vector<IR::Expression> rv; for (auto &name : list->names) rv.push_back(new IR::StringLiteral(name)); return rv; } void V1ParserDriver::clearPragmas() { currentPragmas.clear(); } void V1ParserDriver::addPragma(IR::Annotation* pragma) { if (!P4CContext::get().options().isAnnotationDisabled(pragma)) currentPragmas.push_back(pragma); } IR::Vector<IR::Annotation> V1ParserDriver::takePragmasAsVector() { IR::Vector<IR::Annotation> pragmas; std::swap(pragmas, currentPragmas); return pragmas; } const IR::Annotations* V1ParserDriver::takePragmasAsAnnotations() { if (currentPragmas.empty()) return IR::Annotations::empty; auto *rv = new IR::Annotations(currentPragmas); currentPragmas.clear(); return rv; } } // namespace V1
/** * By downloading, copying, installing or using the software you agree to this license. * If you do not agree to this license, do not download, install, * copy or use the software. * * * License Agreement * For Open Source Computer Vision Library * (3-clause BSD License) * * Copyright (C) 2000-2020, Intel Corporation, all rights reserved. * Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. * Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. * Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. * Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. * Copyright (C) 2015-2016, Itseez Inc., all rights reserved. * Copyright (C) 2019-2020, Xperience AI, all rights reserved. * Third party copyrights are property of their respective owners. * * 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 names of the copyright holders nor the names of the 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 copyright holders or contributors be liable for any direct, * indirect, incidental, special, exemplary, or consequential damages * (including, but not limited to, procurement of substitute goods or services; * loss of use, data, or profits; or business interruption) however caused * and on any theory of liability, whether in contract, strict liability, * or tort (including negligence or otherwise) arising in any way out of * the use of this software, even if advised of the possibility of such damage. * * --------------------------------------------------------------------------- * \file dnn/src/x86/separable_conv/sep_conv_filter_engine.cpp * * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") * * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * This file has been modified by Megvii ("Megvii Modifications"). * All Megvii Modifications are Copyright (C) 2014-2019 Megvii Inc. All rights reserved. * * --------------------------------------------------------------------------- */ #include "./sep_conv_filter.h" #include <cfloat> #include <cstring> #include <cmath> #include <pmmintrin.h> #include <smmintrin.h> namespace megdnn { namespace x86 { namespace sep_conv { using BorderMode = SeparableConv::Param::BorderMode; using uchar = unsigned char; using ushort = unsigned short; ////////////////////////////////////////////// //vecOp ///////////////////////////////////////////// struct RowVec_32f { RowVec_32f() {} RowVec_32f(int _len) { ksize = _len; } MEGDNN_ATTRIBUTE_TARGET("sse") int operator()(const uchar* _src, uchar* _dst, uchar * kernel, int width, int cn) const { int _ksize = ksize; const float* src0 = (const float*)_src; float* dst = (float*)_dst; const float* _kx = (float*)kernel; int i = 0, k; width *= cn; for( ; i <= width - 8; i += 8 ) { const float* src = src0 + i; __m128 f, s0 = _mm_setzero_ps(), s1 = s0, x0, x1; for( k = 0; k < _ksize; k++, src += cn ) { f = _mm_load_ss(_kx+k); f = _mm_shuffle_ps(f, f, 0); x0 = _mm_loadu_ps(src); x1 = _mm_loadu_ps(src + 4); s0 = _mm_add_ps(s0, _mm_mul_ps(x0, f)); s1 = _mm_add_ps(s1, _mm_mul_ps(x1, f)); } _mm_store_ps(dst + i, s0); _mm_store_ps(dst + i + 4, s1); } for( ; i <= width - 4; i += 4 ) { const float* src = src0 + i; __m128 f, s0 = _mm_setzero_ps(), x0; for( k = 0; k < _ksize; k++, src += cn ) { f = _mm_load_ss(_kx+k); f = _mm_shuffle_ps(f, f, 0); x0 = _mm_loadu_ps(src); s0 = _mm_add_ps(s0, _mm_mul_ps(x0, f)); } _mm_store_ps(dst + i, s0); } return i; } int ksize; }; struct SymmRowSmallVec_32f { SymmRowSmallVec_32f() {} SymmRowSmallVec_32f(int _len) { ksize = _len; } MEGDNN_ATTRIBUTE_TARGET("sse") int operator()(const uchar* _src, uchar* _dst, uchar * kernel, int width, int cn) const { int i = 0, _ksize = ksize; float* dst = (float*)_dst; const float* src = (const float*)_src + (_ksize/2)*cn; const float* kx = (float*)kernel + _ksize/2; width *= cn; { if( _ksize == 1 ) return 0; if( _ksize == 3 ) { __m128 k0 = _mm_set1_ps(kx[0]), k1 = _mm_set1_ps(kx[1]); for( ; i <= width - 8; i += 8, src += 8 ) { __m128 x0, x1, x2, y0, y1, y2; x0 = _mm_loadu_ps(src - cn); x1 = _mm_loadu_ps(src); x2 = _mm_loadu_ps(src + cn); y0 = _mm_loadu_ps(src - cn + 4); y1 = _mm_loadu_ps(src + 4); y2 = _mm_loadu_ps(src + cn + 4); x0 = _mm_mul_ps(_mm_add_ps(x0, x2), k1); y0 = _mm_mul_ps(_mm_add_ps(y0, y2), k1); x0 = _mm_add_ps(x0, _mm_mul_ps(x1, k0)); y0 = _mm_add_ps(y0, _mm_mul_ps(y1, k0)); _mm_store_ps(dst + i, x0); _mm_store_ps(dst + i + 4, y0); } } else if( _ksize == 5 ) { __m128 k0 = _mm_set1_ps(kx[0]), k1 = _mm_set1_ps(kx[1]), k2 = _mm_set1_ps(kx[2]); for( ; i <= width - 8; i += 8, src += 8 ) { __m128 x0, x1, x2, y0, y1, y2; x0 = _mm_loadu_ps(src - cn); x1 = _mm_loadu_ps(src); x2 = _mm_loadu_ps(src + cn); y0 = _mm_loadu_ps(src - cn + 4); y1 = _mm_loadu_ps(src + 4); y2 = _mm_loadu_ps(src + cn + 4); x0 = _mm_mul_ps(_mm_add_ps(x0, x2), k1); y0 = _mm_mul_ps(_mm_add_ps(y0, y2), k1); x0 = _mm_add_ps(x0, _mm_mul_ps(x1, k0)); y0 = _mm_add_ps(y0, _mm_mul_ps(y1, k0)); x2 = _mm_add_ps(_mm_loadu_ps(src + cn*2), _mm_loadu_ps(src - cn*2)); y2 = _mm_add_ps(_mm_loadu_ps(src + cn*2 + 4), _mm_loadu_ps(src - cn*2 + 4)); x0 = _mm_add_ps(x0, _mm_mul_ps(x2, k2)); y0 = _mm_add_ps(y0, _mm_mul_ps(y2, k2)); _mm_store_ps(dst + i, x0); _mm_store_ps(dst + i + 4, y0); } } } return i; } int ksize; }; struct ColumnVec_32f { ColumnVec_32f() {} ColumnVec_32f(int _len, int) { ksize = _len; } MEGDNN_ATTRIBUTE_TARGET("sse") int operator()(const uchar** _src, uchar* _dst, uchar * kernel, int &, int width) const { const float* ky = (const float*)kernel; int i = 0, k; const float** src = (const float**)_src; const float *S; float* dst = (float*)_dst; { for( ; i <= width - 16; i += 16 ) { __m128 f = _mm_load_ss(ky); f = _mm_shuffle_ps(f, f, 0); __m128 s0, s1, s2, s3; __m128 x0, x1; S = src[0] + i; s0 = _mm_load_ps(S); s1 = _mm_load_ps(S+4); s0 = _mm_mul_ps(s0, f); s1 = _mm_mul_ps(s1, f); s2 = _mm_load_ps(S+8); s3 = _mm_load_ps(S+12); s2 = _mm_mul_ps(s2, f); s3 = _mm_mul_ps(s3, f); for( k = 1; k < ksize; k++ ) { S = src[k] + i; f = _mm_load_ss(ky+k); f = _mm_shuffle_ps(f, f, 0); x0 =_mm_mul_ps(f, _mm_load_ps(S)); x1 =_mm_mul_ps(f, _mm_load_ps(S+4)); s0 = _mm_add_ps(s0, x0); s1 = _mm_add_ps(s1, x1); x0 =_mm_mul_ps(f, _mm_load_ps(S+8)); x1 =_mm_mul_ps(f, _mm_load_ps(S+12)); s2 = _mm_add_ps(s2, x0); s3 = _mm_add_ps(s3, x1); } s0 = _mm_add_ps(s0, _mm_loadu_ps(dst+i)); s1 = _mm_add_ps(s1, _mm_loadu_ps(dst+i+4)); s2 = _mm_add_ps(s2, _mm_loadu_ps(dst+i+8)); s3 = _mm_add_ps(s3, _mm_loadu_ps(dst+i+12)); _mm_storeu_ps(dst + i, s0); _mm_storeu_ps(dst + i + 4, s1); _mm_storeu_ps(dst + i + 8, s2); _mm_storeu_ps(dst + i + 12, s3); } for( ; i <= width - 4; i += 4 ) { __m128 f = _mm_load_ss(ky); f = _mm_shuffle_ps(f, f, 0); __m128 x0, s0 = _mm_load_ps(src[0] + i); s0 = _mm_mul_ps(s0, f); for( k = 1; k < ksize; k++ ) { f = _mm_load_ss(ky+k); f = _mm_shuffle_ps(f, f, 0); S = src[k] + i; x0 = _mm_mul_ps(f, _mm_load_ps(S)); s0 = _mm_add_ps(s0, x0); // for test //s0 += _mm_add_ps(s0, _mm_mul_ps(_mm_load_ps(src[k]+i), f)); //s0 += _mm_add_ps(s0, _mm_mul_ps(_mm_load_ps(src[-k]+i), f)); } s0 = _mm_add_ps(s0, _mm_loadu_ps(dst + i)); _mm_storeu_ps(dst + i, s0); } } return i; } int ksize; }; struct SymmColumnVec_32f { SymmColumnVec_32f() {} SymmColumnVec_32f(int _len, int) { ksize = _len; } MEGDNN_ATTRIBUTE_TARGET("sse") int operator()(const uchar** _src, uchar* _dst, uchar * kernel, int &, int width) const { int ksize2 = (ksize)/2; const float* ky = (const float*)kernel + ksize2; int i = 0, k; const float** src = (const float**)_src; const float *S, *S2; float* dst = (float*)_dst; { for( ; i <= width - 16; i += 16 ) { __m128 f = _mm_load_ss(ky); f = _mm_shuffle_ps(f, f, 0); __m128 s0, s1, s2, s3; __m128 x0, x1; S = src[0] + i; s0 = _mm_load_ps(S); s1 = _mm_load_ps(S+4); s0 = _mm_mul_ps(s0, f); s1 = _mm_mul_ps(s1, f); s2 = _mm_load_ps(S+8); s3 = _mm_load_ps(S+12); s2 = _mm_mul_ps(s2, f); s3 = _mm_mul_ps(s3, f); for( k = 1; k <= ksize2; k++ ) { S = src[k] + i; S2 = src[-k] + i; f = _mm_load_ss(ky+k); f = _mm_shuffle_ps(f, f, 0); x0 = _mm_add_ps(_mm_load_ps(S), _mm_load_ps(S2)); x1 = _mm_add_ps(_mm_load_ps(S+4), _mm_load_ps(S2+4)); s0 = _mm_add_ps(s0, _mm_mul_ps(x0, f)); s1 = _mm_add_ps(s1, _mm_mul_ps(x1, f)); x0 = _mm_add_ps(_mm_load_ps(S+8), _mm_load_ps(S2+8)); x1 = _mm_add_ps(_mm_load_ps(S+12), _mm_load_ps(S2+12)); s2 = _mm_add_ps(s2, _mm_mul_ps(x0, f)); s3 = _mm_add_ps(s3, _mm_mul_ps(x1, f)); } s0 = _mm_add_ps(s0, _mm_loadu_ps(dst+i)); s1 = _mm_add_ps(s1, _mm_loadu_ps(dst+i+4)); s2 = _mm_add_ps(s2, _mm_loadu_ps(dst+i+8)); s3 = _mm_add_ps(s3, _mm_loadu_ps(dst+i+12)); _mm_storeu_ps(dst + i, s0); _mm_storeu_ps(dst + i + 4, s1); _mm_storeu_ps(dst + i + 8, s2); _mm_storeu_ps(dst + i + 12, s3); } for( ; i <= width - 4; i += 4 ) { __m128 f = _mm_load_ss(ky); f = _mm_shuffle_ps(f, f, 0); __m128 x0, s0 = _mm_load_ps(src[0] + i); s0 = _mm_mul_ps(s0, f); for( k = 1; k <= ksize2; k++ ) { f = _mm_load_ss(ky+k); f = _mm_shuffle_ps(f, f, 0); S = src[k] + i; S2 = src[-k] + i; x0 = _mm_add_ps(_mm_load_ps(S), _mm_load_ps(S2)); s0 = _mm_add_ps(s0, _mm_mul_ps(x0, f)); // for test //s0 += _mm_add_ps(s0, _mm_mul_ps(_mm_load_ps(src[k]+i), f)); //s0 += _mm_add_ps(s0, _mm_mul_ps(_mm_load_ps(src[-k]+i), f)); } s0 = _mm_add_ps(s0, _mm_loadu_ps(dst + i)); _mm_storeu_ps(dst + i, s0); } } return i; } int ksize; }; struct SymmColumnSmallVec_32f { SymmColumnSmallVec_32f() { } SymmColumnSmallVec_32f(int _len, int) { ksize = _len; } MEGDNN_ATTRIBUTE_TARGET("sse") int operator()(const uchar** _src, uchar* _dst, uchar * kernel, int & count, int width) const { (void)count; int ksize2 = (ksize)/2; const float* ky = (float*)kernel + ksize2; int i = 0; const float** src = (const float**)_src; const float *S0 = src[-1], *S1 = src[0], *S2 = src[1]; float* dst = (float*)_dst; { __m128 k0 = _mm_set1_ps(ky[0]), k1 = _mm_set1_ps(ky[1]); for( ; i <= width - 8; i += 8 ) { __m128 s0, s1, x0, x1; s0 = _mm_load_ps(S1 + i); s1 = _mm_load_ps(S1 + i + 4); s0 = _mm_mul_ps(s0, k0); s1 = _mm_mul_ps(s1, k0); x0 = _mm_add_ps(_mm_load_ps(S0 + i), _mm_load_ps(S2 + i)); x1 = _mm_add_ps(_mm_load_ps(S0 + i + 4), _mm_load_ps(S2 + i + 4)); s0 = _mm_add_ps(s0, _mm_mul_ps(x0,k1)); s1 = _mm_add_ps(s1, _mm_mul_ps(x1,k1)); s0 = _mm_add_ps(s0, _mm_loadu_ps(dst + i)); s1 = _mm_add_ps(s1, _mm_loadu_ps(dst + i + 4)); _mm_storeu_ps(dst + i, s0); _mm_storeu_ps(dst + i + 4, s1); } } return i; } int ksize; }; ////////////////////////////////////////////////////////////////////////////////////// //%RowFilter% ////////////////////////////////////////////////////////////////////////////////////// BaseRowFilter::BaseRowFilter() { ksize = anchor = -1; } BaseRowFilter::~BaseRowFilter() {} template<typename ST, typename DT, class VecOp> struct RowFilter : public BaseRowFilter { RowFilter(int _ksize, int _anchor, const VecOp& _vecOp=VecOp() ) { anchor = _anchor; ksize = _ksize; vecOp = _vecOp; } void operator()(const uchar* src, uchar* dst, uchar* kernel, int width, int cn) { int _ksize = ksize; const DT* kx = (DT* )kernel; const ST* S; DT* D = (DT*)dst; int i, k; i = vecOp(src, dst, kernel, width, cn); width *= cn; #if MEGCV_ENABLE_UNROLLED for( ; i <= width - 4; i += 4 ) { S = (const ST*)src + i; DT f = kx[0]; DT s0 = f*S[0], s1 = f*S[1], s2 = f*S[2], s3 = f*S[3]; for( k = 1; k < _ksize; k++ ) { S += cn; f = kx[k]; s0 += f*S[0]; s1 += f*S[1]; s2 += f*S[2]; s3 += f*S[3]; } D[i] = s0; D[i+1] = s1; D[i+2] = s2; D[i+3] = s3; } #endif for( ; i < width; i++ ) { S = (const ST*)src + i; DT s0 = kx[0]*S[0]; for( k = 1; k < _ksize; k++ ) { S += cn; s0 += kx[k]*S[0]; } D[i] = s0; } } VecOp vecOp; }; template<typename ST, typename DT, class VecOp> struct SymmRowSmallFilter : public RowFilter<ST, DT, VecOp> { SymmRowSmallFilter(int _ksize, int _anchor, const VecOp& _vecOp = VecOp() ) : RowFilter<ST, DT, VecOp>( _ksize, _anchor, _vecOp ) {} void operator()(const uchar* src, uchar* dst, uchar* kernel, int width, int cn) { int ksize2 = this->ksize/2, ksize2n = ksize2*cn; const DT* kx = (DT*)kernel + ksize2; DT* D = (DT*)dst; int i = this->vecOp(src, dst, kernel, width, cn), j, k; const ST* S = (const ST*)src + i + ksize2n; width *= cn; { if( this->ksize == 1 && kx[0] == 1 ) { for( ; i <= width - 2; i += 2 ) { DT s0 = S[i], s1 = S[i+1]; D[i] = s0; D[i+1] = s1; } S += i; } else if( this->ksize == 3 ) { DT k0 = kx[0], k1 = kx[1]; for( ; i <= width - 2; i += 2, S += 2 ) { DT s0 = S[0]*k0 + (S[-cn] + S[cn])*k1, s1 = S[1]*k0 + (S[1-cn] + S[1+cn])*k1; D[i] = s0; D[i+1] = s1; } } else if( this->ksize == 5 ) { DT k0 = kx[0], k1 = kx[1], k2 = kx[2]; for( ; i <= width - 2; i += 2, S += 2 ) { DT s0 = S[0]*k0 + (S[-cn] + S[cn])*k1 + (S[-cn*2] + S[cn*2])*k2; DT s1 = S[1]*k0 + (S[1-cn] + S[1+cn])*k1 + (S[1-cn*2] + S[1+cn*2])*k2; D[i] = s0; D[i+1] = s1; } } for( ; i < width; i++, S++ ) { DT s0 = kx[0]*S[0]; for( k = 1, j = cn; k <= ksize2; k++, j += cn ) s0 += kx[k]*(S[j] + S[-j]); D[i] = s0; } } } }; template <typename T, typename T1> BaseRowFilter * getLinearRowFilter(int ksize, bool is_symm_kernel) { // TODO: calculate anchor int anchor = ksize/2; if(is_symm_kernel) { if( ksize <= 5 ) { //if( typeid(T) == typeid(float) && typeid(T1) == typeid(float)) return new SymmRowSmallFilter<T, T1, SymmRowSmallVec_32f> (ksize, anchor, SymmRowSmallVec_32f(ksize)); } //if( typeid(T) == typeid(float) && typeid(T1) == typeid(float)) return new RowFilter<T, T1, RowVec_32f> (ksize, anchor, RowVec_32f(ksize)); } else { //if( typeid(T) == typeid(float) && typeid(T1) == typeid(float)) return new RowFilter<T, T1, RowVec_32f> (ksize, anchor, RowVec_32f(ksize)); } //printf("Unsupported combination of source format (=%s), and buffer format (=%s)", // typeid(T).name(), typeid(T1).name()); //exit(1); } ////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////// //%BaseColFilter% ////////////////////////////////////////////////////////////////////////////////////// BaseColumnFilter::BaseColumnFilter() { ksize = anchor = -1; } BaseColumnFilter::~BaseColumnFilter() {} void BaseColumnFilter::reset() {} template<class CastOp, class VecOp> struct ColumnFilter : public BaseColumnFilter { typedef typename CastOp::type1 ST; typedef typename CastOp::rtype DT; ColumnFilter(int _ksize, int _anchor, const CastOp& _castOp=CastOp(), const VecOp& _vecOp=VecOp()) { this->anchor = _anchor; this->ksize = _ksize; this->castOp0 = _castOp; this->vecOp = _vecOp; } void operator()(const uchar** src, uchar* dst, uchar* kernel, int dststep, int count, int width) { const ST* ky = (ST*)kernel; int i = 0, k; CastOp castOp = this->castOp0; { for( ; count > 0; count--, dst += dststep, src++ ) { DT* D = (DT*)dst; i = (this->vecOp)(src, dst, kernel, count, width); #if MEGCV_ENABLE_UNROLLED for( ; i <= width - 4; i += 4 ) { ST f = ky[0]; const ST* S = (const ST*)src[0] + i; ST s0 = f*S[0], s1 = f*S[1], s2 = f*S[2], s3 = f*S[3]; for( k = 1; k < ksize; k++ ) { S = (const ST*)src[k] + i; f = ky[k]; s0 += f*S[0]; s1 += f*S[1]; s2 += f*S[2]; s3 += f*S[3]; } D[i] += castOp(s0); D[i+1] += castOp(s1); D[i+2] += castOp(s2); D[i+3] += castOp(s3); } #endif for( ; i < width; i++ ) { ST s0 = D[i]; //ST s0 = ky[0]*((const ST*)src[0])[i]; for( k = 0; k < ksize; k++ ) { s0 += ky[k]* ((const ST*)src[k])[i]; } D[i] = castOp(s0); //D[i] += castOp(s0); } } } } CastOp castOp0; VecOp vecOp; }; template<class CastOp, class VecOp> struct SymmColumnFilter : public BaseColumnFilter { typedef typename CastOp::type1 ST; typedef typename CastOp::rtype DT; SymmColumnFilter(int _ksize, int _anchor, const CastOp& _castOp=CastOp(), const VecOp& _vecOp=VecOp()) { this->anchor = _anchor; this->ksize = _ksize; this->castOp0 = _castOp; this->vecOp = _vecOp; } void operator()(const uchar** src, uchar* dst, uchar* kernel, int dststep, int count, int width) { int ksize2 = this->ksize/2; const ST* ky = (ST*)kernel + ksize2; int i, k; CastOp castOp = this->castOp0; src += ksize2; { for( ; count > 0; count--, dst += dststep, src++ ) { DT* D = (DT*)dst; i = (this->vecOp)(src, dst, kernel, count, width); #if MEGCV_ENABLE_UNROLLED for( ; i <= width - 4; i += 4 ) { ST f = ky[0]; const ST* S = (const ST*)src[0] + i, *S2; ST s0 = f*S[0], s1 = f*S[1], s2 = f*S[2], s3 = f*S[3]; for( k = 1; k <= ksize2; k++ ) { S = (const ST*)src[k] + i; S2 = (const ST*)src[-k] + i; f = ky[k]; s0 += f*(S[0] + S2[0]); s1 += f*(S[1] + S2[1]); s2 += f*(S[2] + S2[2]); s3 += f*(S[3] + S2[3]); } D[i] += castOp(s0); D[i+1] += castOp(s1); D[i+2] += castOp(s2); D[i+3] += castOp(s3); } #endif for( ; i < width; i++ ) { ST s0 = ky[0]*((const ST*)src[0])[i]; for( k = 1; k <= ksize2; k++ ) { s0 += ky[k]*(((const ST*)src[k])[i] + ((const ST*)src[-k])[i]); //s0 += ky[k]*((const ST*)src[k])[i]; //s0 += ky[k]*((const ST*)src[-k])[i]; } D[i] += castOp(s0); } } } } CastOp castOp0; VecOp vecOp; }; template<class CastOp, class VecOp> struct SymmColumnSmallFilter : public SymmColumnFilter<CastOp, VecOp> { typedef typename CastOp::type1 ST; typedef typename CastOp::rtype DT; SymmColumnSmallFilter( int _ksize, int _anchor, const CastOp & _castOp=CastOp(), const VecOp & _vecOp=VecOp()) : SymmColumnFilter<CastOp, VecOp>(_ksize, _anchor, _castOp, _vecOp ) { megdnn_assert(this->ksize == 3 ); } void operator()(const uchar** src, uchar* dst, uchar* kernel, int dststep, int count, int width) { int ksize2 = this->ksize/2; const ST* ky = (ST*)kernel + ksize2; int i = 0; ST f0 = ky[0], f1 = ky[1]; CastOp castOp = this->castOp0; src += ksize2; /* if((typeid(ST) == typeid(int) && typeid(DT) == typeid(uchar))) { (this->vecOp)(src, dst, kernel, count, width); } */ for( ; count > 0; count--, dst += dststep, src++ ) { DT* D = (DT*)dst; i = (this->vecOp)(src, dst, kernel, count, width); if(count == 0) break; const ST* S0 = (const ST*)src[-1]; const ST* S1 = (const ST*)src[0]; const ST* S2 = (const ST*)src[1]; { #if MEGCV_ENABLE_UNROLLED for( ; i <= width - 4; i += 4 ) { ST s0 = (S0[i] + S2[i])*f1 + S1[i]*f0; ST s1 = (S0[i+1] + S2[i+1])*f1 + S1[i+1]*f0; D[i] += castOp(s0); D[i+1] += castOp(s1); s0 = (S0[i+2] + S2[i+2])*f1 + S1[i+2]*f0; s1 = (S0[i+3] + S2[i+3])*f1 + S1[i+3]*f0; D[i+2] += castOp(s0); D[i+3] += castOp(s1); } #endif for( ; i < width; i ++ ) { ST s0 = (S0[i] + S2[i])*f1 + S1[i]*f0; D[i] += castOp(s0); } } } } }; template<typename T1, typename T> BaseColumnFilter * getLinearColumnFilter(int ksize, int bits, bool is_symm_kernel) { // for the case that type of T1 is float. bits = 0; int anchor = ksize/2; { if(is_symm_kernel) { if( ksize == 3 ) { //if( typeid(T1) == typeid(float) && typeid(T) == typeid(float) ) return new SymmColumnSmallFilter<FixedPtCastEx<T1, T>,SymmColumnSmallVec_32f> (ksize, anchor, FixedPtCastEx<T1, T>(0), SymmColumnSmallVec_32f(ksize, bits)); } //if( typeid(T1) == typeid(float) && typeid(T) == typeid(float) ) return new SymmColumnFilter<FixedPtCastEx<T1, T>, SymmColumnVec_32f> (ksize, anchor, FixedPtCastEx<T1, T>(), SymmColumnVec_32f(ksize, bits)); } else { //if( typeid(T1) == typeid(float) && typeid(T) == typeid(float) ) return new ColumnFilter<FixedPtCastEx<T1, T>, ColumnVec_32f> (ksize, anchor, FixedPtCastEx<T1, T>(), ColumnVec_32f(ksize, bits)); } } //printf("Unsupported combination of buffer format (=%s), and destination format (=%s)", // typeid(T1).name(), typeid(T).name()); //exit(1); } ////////////////////////////////////////////////////////////////////////////////////// ////%FilterEngine% ////////////////////////////////////////////////////////////////////////////////////// FilterEngine::FilterEngine(const int &ih, const int &iw, const int &oh, const int &ow, const int &kh, const int &kw, const int &anchor_h, const int &anchor_w, BorderMode borderType, bool is_symm_kernel) { init(ih, iw, oh, ow, kh, kw, anchor_h, anchor_w, borderType, is_symm_kernel); } FilterEngine::~FilterEngine() { if(rowFilter_ != NULL) delete rowFilter_; if(colFilter_ != NULL) delete colFilter_; } void FilterEngine::init(const int &ih, const int &iw, const int &oh, const int &ow, const int &kh, const int &kw, const int &anchor_h, const int &anchor_w, BorderMode borderType, bool is_symm_kernel) { // reduce warning int wrn = ih + iw + oh; ++wrn; ksize_x_ = kw; ksize_y_ = kh; anchor_x_ = anchor_w; anchor_y_ = anchor_h; borderType_ = borderType; is_symm_kernel_ = is_symm_kernel; rowFilter_ = getLinearRowFilter<float, float>(kw, is_symm_kernel_); colFilter_ = getLinearColumnFilter<float, float>(kh, 0, is_symm_kernel_); rowBufferOutputRow_ = 1; maxBufferRow_ = ksize_y_ + rowBufferOutputRow_ - 1; //int rowBuffStride_ = sizeof(float)*(int)align_size(maxWidth + (ksize_y_ - 1),VEC_ALIGN); rowBuffStride_ = sizeof(float) * (int)align_size(ow, VEC_ALIGN); row_ptr_.resize(maxBufferRow_); ringBuf_.resize(rowBuffStride_ * maxBufferRow_ + VEC_ALIGN); // There is no need to use constBorder when padding == 0. //if (borderType_ = BORDER_CONSTANT) { // constBorderRow.resize(sizeof(int) * (maxWidth + ksize.cols() - 1) + VEC_ALIGN); //} } void FilterEngine::exec( const TensorND & src, const TensorND & kernel_x, const TensorND & kernel_y, const TensorND & dst) { //int stride_src = src.layout.stride[1]; //int stride_dst = dst.layout.stride[1]; //float *src0 = src.ptr(); //float *dst0 = dst.ptr(); float * src_cur_row = src.ptr<float>(); float * src_cur_step = src.ptr<float>(); float * dst_cur_chan = dst.ptr<float>(); int width_src = (int)src.layout.shape[3]; int width_dst = (int)dst.layout.shape[3]; int height_src = (int)src.layout.shape[2]; //int height_dst = dst.layout.shape[2]; int kernel_chan_stride = (int)kernel_x.layout.stride[1]; memset(dst.ptr<float>(), 0, sizeof(float) * dst.layout.total_nr_elems()); for(int step = 0; step < (int)src.layout.shape[0]; ++step) { for(int chan_out = 0; chan_out < (int)dst.layout.shape[1]; ++ chan_out, dst_cur_chan += dst.layout.stride[1]) { float* kx = kernel_x.ptr<float>(); float* ky = kernel_y.ptr<float>(); src_cur_row = src_cur_step; // handle a channel of input for(int chan_in = 0; chan_in < (int)src.layout.shape[1]; ++ chan_in) { // 1. init row buffer borden // No need to init row border when padding == 0. // 2. fill ring buffer & calculate int row_count = 0; int row_ptr_pos = 0; int dststep = dst.layout.stride[2]; int bufRows = (int)row_ptr_.size(); int bi = 0; float* dst_cur_row = dst_cur_chan; for(row_count = 0; row_count < height_src; ++row_count, src_cur_row += width_src) { //2.1 Get tab row. No need to do this when padding == 0. //2.2 Calculate a row. bi = row_count % bufRows; uchar* brow = align_ptr(&ringBuf_[0], VEC_ALIGN) + bi * rowBuffStride_; if(row_count < bufRows - 1) { row_ptr_[bi] = (float*)brow; } else { row_ptr_[bufRows - 1] = (float*)brow; } // Get a row & make border //uchar* row = &srcRow[0]; //memcpy( row + _dx1*esz, src, (width1 - _dx2 - _dx1)*esz ); uchar* row = (uchar*)src_cur_row; (*rowFilter_)(row, brow, (uchar*)kx, width_dst, 1); // operator()(const uchar* src, uchar* dst, uchar* kernel, int width, int cn) // Keeping fill the ring_buff until its length is ky if(row_count < bufRows - 1) { ++ row_ptr_pos; continue; } // 2.3 Calculate column // operator()(const uchar** src, uchar* dst, ST* kernel, int dststep, int count, int width) (*colFilter_)((const uchar**)(&row_ptr_[0]), (uchar*)dst_cur_row, (uchar*)ky, dststep, rowBufferOutputRow_, width_dst); // Update row_ptr for(int i = 0; i< bufRows - 1; ++i) { row_ptr_[i] = row_ptr_[i+1]; } dst_cur_row += width_dst; //dst.layout.stride[2]; } kx += kernel_chan_stride; ky += kernel_chan_stride; } // chan_in } // chan_out src_cur_step += src.layout.shape[0]; } //step_in } } // namespace sep_conv } // namespace x86 } // namespace megdnn // vim: syntax=cpp.doxygen
//begin #include <Core> /* * Package: StandardCodeLibrary.Core * Last Update: 2012-1-4 * */ #include <iostream> #include <fstream> #include <sstream> #include <iomanip> #include <utility> #include <vector> #include <list> #include <string> #include <stack> #include <queue> #include <deque> #include <set> #include <map> #include <algorithm> #include <functional> #include <numeric> #include <bitset> #include <complex> #include <cstdio> #include <cstring> #include <cmath> #include <cstdlib> #include <ctime> #include <climits> #if __GNUC__>=4 and __GNUC_MINOR__>=6 #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/tag_and_trait.hpp> #endif using namespace std; #define lp for(;;) #define repf(i,a,b) for (int i=(a);i<(b);++i) #define rep(i,n) repf(i,0,n) #define ft(i,a,b) for (int i=(a);i<=(b);++i) #define fdt(i,a,b) for (int i=(a);i>=b;--i) #define feach(e,s) for (typeof((s).begin()) e=(s).begin();e!=(s).end();++e) #define fsubset(subset,set) for (int subset=(set)&((set)-1);subset;subset=(subset-1)&(set)) #define forin(i,charset) for (cstr i=(charset);*i;i++) #define whl while #define rtn return #define fl(x,y) memset((x),char(y),sizeof(x)) #define clr(x) fl(x,char(0)) #define cpy(x,y) memcpy(x,y,sizeof(x)) #define pb push_back #define mp make_pair #define ins insert #define ers erase #define lb lower_bound #define ub upper_bound #define rnk order_of_key #define sel find_by_order #define x first #define y second #define sz(x) (int((x).size())) #define all(x) (x).begin(),(x).end() #define srt(x) sort(all(x)) #define uniq(x) srt(x),(x).erase(unique(all(x)),(x).end()) #define vec vector #define pr pair #define que queue #define prq priority_queue #define itr iterator #define sf scanf #define pf printf #define pdb(prcs,x) (cout<<setprecision(prcs)<<fixed<<(sgn(x)?(x):0)) #ifdef DEBUG #define prt(x) cerr<<#x"="<<(x)<<endl #define asrtWA(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0) #define asrtTLE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0) #define asrtMLE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0) #define asrtOLE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0) #define asrtRE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0) #define runtime() cerr<<"Used: "<<db(clock())/CLOCKS_PER_SEC<<"s"<<endl #define input(in) do{}whl(0) #define output(out) do{}whl(0) #else #define endl (char('\n')) #define prt(x) (cerr) #define asrtWA(s) do if(!(s))exit(0);whl(0) #define asrtTLE(s) do if(!(s))whl(1);whl(0) #define asrtMLE(s) do if(!(s))whl(new int);whl(0) #define asrtOLE(s) do if(!(s))whl(1)puts("OLE");whl(0) #define asrtRE(s) do if(!(s))*(int*)0=0;whl(0) #define runtime() (cerr) #define input(in) freopen(in,"r",stdin) #define output(out) freopen(out,"w",stdout) #endif typedef long long int lli; typedef double db; typedef const char* cstr; typedef string str; typedef vec<int> vi; typedef vec<vi> vvi; typedef vec<bool> vb; typedef vec<vb> vvb; typedef vec<str> vs; typedef pr<int,int> pii; typedef pr<lli,lli> pll; typedef pr<db,db> pdd; typedef pr<str,int> psi; typedef map<int,int> mii; typedef map<str,int> msi; typedef map<char,int> mci; typedef set<int> si; typedef set<str> ss; typedef que<int> qi; typedef prq<int> pqi; #if __GNUC__>=4 and __GNUC_MINOR__>=7 template<typename key,typename value>class ext_map:public __gnu_pbds::tree<key,value,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{}; template<typename key>class ext_set:public __gnu_pbds::tree<key,__gnu_pbds::null_type,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{}; #elif __GNUC__>=4 and __GNUC_MINOR__>=6 template<typename key,typename value>class ext_map:public __gnu_pbds::tree<key,value,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{}; template<typename key>class ext_set:public __gnu_pbds::tree<key,__gnu_pbds::null_mapped_type,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{}; #endif const int oo=(~0u)>>1; const lli ooll=(~0ull)>>1; const db inf=1e+10; const db eps=1e-10; const db pi=acos(-1.0); const int MOD=1000000007; template<typename type>inline bool cmax(type& a,const type& b){rtn a<b?a=b,true:false;} template<typename type>inline bool cmin(type& a,const type& b){rtn b<a?a=b,true:false;} template<typename type>inline type sqr(const type& x){rtn x*x;} inline int dbcmp(const db& a,const db& b){rtn (a>b+eps)-(a<b-eps);} inline int sgn(const db& x){rtn dbcmp(x,0);} template<typename ostream,typename type>ostream& operator<<(ostream& cout,const pr<type,type>& x){rtn cout<<"("<<x.x<<","<<x.y<<")";} template<typename type>pr<type,type> operator-(const pr<type,type>& x){rtn mp(-x.x,-x.y);} template<typename type>pr<type,type> operator+(const pr<type,type>& a,const pr<type,type>& b){rtn mp(a.x+b.x,a.y+b.y);} template<typename type>pr<type,type> operator-(const pr<type,type>& a,const pr<type,type>& b){rtn mp(a.x-b.x,a.y-b.y);} template<typename type>inline type cross(const pr<type,type>& a,const pr<type,type>& b,const pr<type,type>& c){rtn (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x);} template<typename type>inline type dot(const pr<type,type>& a,const pr<type,type>& b,const pr<type,type>& c){rtn (b.x-a.x)*(c.x-a.x)+(b.y-a.y)*(c.y-a.y);} template<typename type>inline type gcd(type a,type b){if(b)whl((a%=b)&&(b%=a));rtn a+b;} template<typename type>inline type lcm(type a,type b){rtn a*b/gcd(a,b);} template<typename type>inline void bit_inc(vec<type>& st,int x,type inc){whl(x<sz(st))st[x]+=inc,x|=x+1;} template<typename type>inline type bit_sum(const vec<type>& st,int x){type s=0;whl(x>=0)s+=st[x],x=(x&(x+1))-1;rtn s;} template<typename type>inline type bit_kth(const vec<type>& st,int k){int x=0,y=0,z=0;whl((1<<(++y))<=sz(st));fdt(i,y-1,0){if((x+=1<<i)>sz(st)||z+st[x-1]>k)x-=1<<i;else z+=st[x-1];}rtn x;} inline void make_set(vi& st){rep(i,sz(st))st[i]=i;} inline int find_set(vi& st,int x){int y=x,z;whl(y!=st[y])y=st[y];whl(x!=st[x])z=st[x],st[x]=y,x=z;rtn y;} inline bool union_set(vi& st,int a,int b){a=find_set(st,a),b=find_set(st,b);rtn a!=b?st[a]=b,true:false;} template<typename type>inline void merge(type& a,type& b){if(sz(a)<sz(b))swap(a,b);whl(sz(b))a.insert(*b.begin()),b.erase(b.begin());} template<typename type>inline void merge(prq<type>& a,prq<type>& b){if(sz(a)<sz(b))swap(a,b);whl(sz(b))a.push(b.top()),b.pop();} struct Initializer{Initializer(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}~Initializer(){runtime();}}initializer; //end #include <Core> bool in(pdd a,pdd b,pdd c,pdd f) { rtn sgn(dot(a,b,f))==sgn(dot(b,c,f))&&sgn(dot(b,c,f))==sgn(dot(c,a,f)); } pdd intersection(pdd a1,pdd a2,pdd b1,pdd b2) { pdd a=a2-a1,b=b2-b1,s=b1-a1; if (sgn(cross(pdd(0,0),a,b))==0) return pdd(inf,inf); return a1+pdd(a.x*cross(pdd(0,0),s,b)/cross(pdd(0,0),a,b),a.y*cross(pdd(0,0),s,b)/cross(pdd(0,0),a,b)); } bool on(pdd a,pdd b,pdd c) { rtn dbcmp(a.x,c.x)*dbcmp(c.x,b.x)>=0&&dbcmp(a.y,c.y)*dbcmp(c.y,b.y)>=0; } bool pass(pdd a,pdd b,pdd c,pdd o,pdd f) { pdd ab=intersection(o,f,a,b),bc=intersection(o,f,b,c),ca=intersection(o,f,c,a); rtn (on(a,b,ab)&&on(o,f,ab))+(on(b,c,bc)&&on(o,f,bc))+(on(c,a,ca)&&on(o,f,ca)) -(dbcmp(ab.x,bc.x)==0&&dbcmp(ab.y,bc.y)==0) -(dbcmp(bc.x,ca.x)==0&&dbcmp(bc.y,ca.y)==0) -(dbcmp(ca.x,ab.x)==0&&dbcmp(ca.y,ab.y)==0)>=2; } int main() { pdd f; cin>>f.x>>f.y; pdd a=pdd(0,0),b=pdd(10,0),c=pdd(10,10); db ans=0; rep(i,100) { pdd A=a,B=b,C=c; pdd M=pdd((A+C).x/2,(A+C).y/2); if (pass(A,B,M,pdd(0,0),f)) ans+=abs(cross(A,B,M)/2); if (pass(C,B,M,pdd(0,0),f)) ans+=abs(cross(A,B,M)/2); if (in(A,B,M,f)&&!pass(A,B,M,pdd(0,0),f)) { a=A; b=M; c=B; } else if (!pass(C,B,M,pdd(0,0),f)) { a=C; b=M; c=B; } else break; } pdb(6,ans)<<endl; }
#include "blackhole/filter/severity.hpp" #include <boost/optional/optional.hpp> #include "blackhole/config/node.hpp" #include "blackhole/config/option.hpp" #include "blackhole/filter.hpp" #include "blackhole/record.hpp" #include "../memory.hpp" namespace blackhole { inline namespace v1 { namespace filter { class severity_t : public filter_t { std::int64_t threshold; public: severity_t(std::int64_t threshold) noexcept : threshold(threshold) {} auto filter(const record_t& record) -> filter_t::action_t override { if (record.severity() >= threshold) { return filter_t::action_t::neutral; } else { return filter_t::action_t::deny; } } }; } // namespace filter auto factory<filter::severity_t>::type() const noexcept -> const char* { return "severity"; } auto factory<filter::severity_t>::from(const config::node_t& config) const -> std::unique_ptr<filter_t> { if (auto threshold = config["threshold"].to_sint64()) { return blackhole::make_unique<filter::severity_t>(*threshold); } throw std::invalid_argument("field 'threshold' is required"); } } // namespace v1 } // namespace blackhole
/*############################################################################## HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ############################################################################## */ #ifndef __THORRREGEX_HPP_ #define __THORRREGEX_HPP_ #ifdef _WIN32 #ifdef THORHELPER_EXPORTS #define THORHELPER_API __declspec(dllexport) #else #define THORHELPER_API __declspec(dllimport) #endif #else #define THORHELPER_API #endif #define RegexSpecialMask 0xF0000000 #define RegexSpecialCharacterClass 0x10000000 #define RegexSpecialCollationClass 0x20000000 #define RegexSpecialEquivalenceClass 0x30000000 #define RCCalnum (RegexSpecialCharacterClass|0) #define RCCcntrl (RegexSpecialCharacterClass|1) #define RCClower (RegexSpecialCharacterClass|2) #define RCCupper (RegexSpecialCharacterClass|3) #define RCCspace (RegexSpecialCharacterClass|4) #define RCCalpha (RegexSpecialCharacterClass|5) #define RCCdigit (RegexSpecialCharacterClass|6) #define RCCprint (RegexSpecialCharacterClass|7) #define RCCblank (RegexSpecialCharacterClass|8) #define RCCgraph (RegexSpecialCharacterClass|9) #define RCCpunct (RegexSpecialCharacterClass|10) #define RCCxdigit (RegexSpecialCharacterClass|11) #define RCCany (RegexSpecialCharacterClass|12) #define RCCutf8lead (RegexSpecialCharacterClass|13) #define RCCutf8follow (RegexSpecialCharacterClass|14) #define PATTERN_UNLIMITED_LENGTH ((unsigned)-1) #endif /* __THORREGEX_HPP_ */
/* * This file is a part of the TChecker project. * * See files AUTHORS and LICENSE for copyright details. * */ #ifndef TCHECKER_EXPRESSION_STATIC_ANALYSIS_HH #define TCHECKER_EXPRESSION_STATIC_ANALYSIS_HH #include <unordered_set> #include "tchecker/basictypes.hh" #include "tchecker/expression/expression.hh" #include "tchecker/expression/typed_expression.hh" #include "tchecker/utils/iterator.hh" /*! \file static_analysis.hh \brief Static analysis of expressions */ namespace tchecker { // Constant expression evaluation /*! \brief Evaluate a constant expression \param expr : expression to evaluate \return value of expr \throw std::invalid_argument : if expr is not a constant expression (i.e. it contains variables) \throw std::runtime_error : should never happen (code safety) */ tchecker::integer_t const_evaluate(tchecker::expression_t const & expr); /*! \brief Evaluate a constant expression \param expr : expression to evaluate \param value : a value \return value of expr if expr is a constant expression (i.e. it does not contain any variable), value otherwise \throw std::runtime_error : should never happen (code safety) */ tchecker::integer_t const_evaluate(tchecker::expression_t const & expr, tchecker::integer_t value); // Variable IDs extraction /*! \brief Extract variable IDs of an lvalue expression \param expr : expression \return for expressions of type tchecker::typed_var_expression_t or tchecker::typed_bounded_var_expression_t, the range containing the ID of the variable. For expressions of type tchecker::typed_array_expression_t (i.e. x[e]), returns the ID of x[e] if e is a constant expression that can be evaluated statically, and the entire range of IDs of array x if the value of e cannot be determined \throw std::invalid_argument : if expr is not of type type tchecker::typed_var_expression_t, tchecker::typed_bounded_var_expression_t or tchecker::typed_array_expression_t */ tchecker::range_t<tchecker::variable_id_t> extract_lvalue_variable_ids(tchecker::typed_lvalue_expression_t const & expr); /*! \brief Extract variable IDs from base of an array expression \param expr : an lvalue expression \param clocks : a set fo clock IDs \param intvars : a set of integer variable IDs \post if expr is an array expression base[offset], the identifiers of base have been added to clocks or intvars depending on the type of the variable. In particular, if offset can be statically evaluated, then base+offset is added to the set corresponding to the type of base, otherwise, all base+k for k in the domain of base have been added to clocks or intvars depending on the type of base If expr is not an array expression, this function does nothing */ void extract_lvalue_base_variable_ids(tchecker::typed_lvalue_expression_t const & expr, std::unordered_set<tchecker::clock_id_t> & clocks, std::unordered_set<tchecker::intvar_id_t> & intvars); /*! \brief Extract variables IDs from offset of an array expression \param expr : an lvalue expression \param clocks : a set of clock IDs \param intvars : a set of integer variable IDs \post if expr is an array expression base[offset], the identifiers of every variable appearing in offset have been added to clocks or intvars depending on the type of the variable. In particular, if an expression of the form x[e] appears in offset, then if e can be statically evaluated, then x+e is added to the set corresponding to the type of x, otherwise, all x+k for k in the domain of x is added to the corresponding set of identifiers. If expr is not an array expression, this function does nothing. */ void extract_lvalue_offset_variable_ids(tchecker::typed_lvalue_expression_t const & expr, std::unordered_set<tchecker::clock_id_t> & clocks, std::unordered_set<tchecker::intvar_id_t> & intvars); /*! \brief Extract typed variables IDs from an expression \param expr : expression \param clocks : a set of clock IDs \param intvars : a set of integer variable IDs \post for every occurrence of a variable x in expr, x has been added to clocks if x is a clock, and to intvars if x is an integer variable. For expressions of type tchecker::typed_array_expression_t (i.e. x[e]), if e can be statically evaluated then x[e] is added to the set according to the type of x. Otherwise, x[k] is added to set (according to the type of x) for every k in the domain of x. */ void extract_variables(tchecker::typed_expression_t const & expr, std::unordered_set<tchecker::clock_id_t> & clocks, std::unordered_set<tchecker::intvar_id_t> & intvars); } // end of namespace tchecker #endif // TCHECKER_EXPRESSION_STATIC_ANALYSIS_HH
// Copyright (c) Microsoft. All rights reserved. #include "pch.h" #include "Scenario7_DeviceInformationKind.xaml.h" using namespace SDKTemplate; using namespace Platform; using namespace Platform::Collections; using namespace Windows::Foundation; using namespace Windows::Foundation::Collections; using namespace Windows::UI::Core; using namespace Windows::UI::Xaml; using namespace Windows::UI::Xaml::Controls; using namespace Windows::UI::Xaml::Controls::Primitives; using namespace Windows::UI::Xaml::Data; using namespace Windows::UI::Xaml::Input; using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; using namespace Windows::Devices::Enumeration; // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 Scenario7_DeviceInformationKind::Scenario7_DeviceInformationKind() { InitializeComponent(); } void Scenario7_DeviceInformationKind::OnNavigatedTo(NavigationEventArgs^ e) { resultsListView->ItemsSource = resultCollection; kindComboBox->ItemsSource = DeviceInformationKindChoices::Choices; kindComboBox->SelectedIndex = 0; } void Scenario7_DeviceInformationKind::OnNavigatedFrom(NavigationEventArgs^ e) { StopWatchers(/* reset */ true); } void Scenario7_DeviceInformationKind::StartWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { StartWatchers(); } void Scenario7_DeviceInformationKind::StopWatcherButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { StopWatchers(); } void Scenario7_DeviceInformationKind::StartWatchers() { startWatcherButton->IsEnabled = false; resultCollection->Clear(); DeviceInformationKindChoice^ kindChoice = safe_cast<DeviceInformationKindChoice^>(kindComboBox->SelectedItem); // Create a watcher for each DeviceInformationKind selected by the user for (DeviceInformationKind deviceInfoKind : kindChoice->DeviceInformationKinds) { DeviceWatcher^ deviceWatcher = DeviceInformation::CreateWatcher( "", // AQS Filter string nullptr, // requested properties deviceInfoKind); DeviceWatcherHelper^ deviceWatcherHelper = ref new DeviceWatcherHelper(resultCollection, Dispatcher); deviceWatcherHelper->UpdateStatus = false; deviceWatcherHelper->DeviceChanged += ref new TypedEventHandler<DeviceWatcher^, String^>(this, &Scenario7_DeviceInformationKind::OnDeviceListChanged); deviceWatcherHelpers->Append(deviceWatcherHelper); deviceWatcherHelper->StartWatcher(deviceWatcher); } stopWatcherButton->IsEnabled = true; stopWatcherButton->Focus(::FocusState::Keyboard); } void Scenario7_DeviceInformationKind::StopWatchers(bool reset) { stopWatcherButton->IsEnabled = false; for (DeviceWatcherHelper^ deviceWatcherHelper : deviceWatcherHelpers) { deviceWatcherHelper->StopWatcher(); if (reset) { deviceWatcherHelper->Reset(); } } deviceWatcherHelpers->Clear(); startWatcherButton->IsEnabled = true; } void Scenario7_DeviceInformationKind::OnDeviceListChanged(DeviceWatcher^ sender, String^ id) { int watchersRunning = 0; // Count running watchers for (DeviceWatcherHelper^ deviceWatcherHelper : deviceWatcherHelpers) { if (deviceWatcherHelper->IsWatcherRunning()) { watchersRunning++; } } String^ message = watchersRunning.ToString() + "/" + deviceWatcherHelpers->Size.ToString() + " watchers running. " + resultCollection->Size.ToString() + " devices found."; rootPage->NotifyUser(message, NotifyType::StatusMessage); }
// Copyright (c) 2010-2017 Fabric Software Inc. All rights reserved. #include "GraphViewWidget.h" #include <QDebug> #include <QPainter> #include <QGLWidget> #include <QMimeData> #include <QRect> #include <QGraphicsSceneEvent> #include <FabricUI/GraphView/MainPanel.h> #include <FabricUI/GraphView/SidePanel.h> #include <FabricUI/GraphView/Graph.h> #include <FabricUI/GraphView/MouseGrabber.h> #ifdef FABRICUI_TIMERS #include <Util/Timer.h> #endif #include <stdlib.h> #include <math.h> using namespace FabricUI::GraphView; GraphViewWidget::GraphViewWidget( QWidget * parent, const GraphConfig & config, Graph * graph ) : QGraphicsView(parent) , m_altWasHeldAtLastMousePress( false ) , m_uiGraphZoomBeforeQuickZoom( 0.0f ) { setRenderHint(QPainter::Antialiasing); // setRenderHint(QPainter::HighQualityAntialiasing); setRenderHint(QPainter::TextAntialiasing); setOptimizationFlag(DontSavePainterState); setStyleSheet( "QGraphicsView { border-style: none; }" ); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); setViewportUpdateMode(SmartViewportUpdate); setAcceptDrops( true ); // use opengl for rendering with multi sampling if(config.useOpenGL) { char const *useCanvasOpenGL = ::getenv( "FABRIC_USE_CANVAS_OPENGL" ); if ( !!useCanvasOpenGL && !!useCanvasOpenGL[0] ) { QGLFormat format; format.setSampleBuffers(true); QGLContext * context = new QGLContext(format); QGLWidget * glWidget = new QGLWidget(context); setViewport(glWidget); } } setGraph(graph); setMouseTracking(true); } Graph * GraphViewWidget::graph() { return m_graph; } const Graph * GraphViewWidget::graph() const { return m_graph; } void GraphViewWidget::setGraph(Graph * graph) { m_scene = new GraphViewScene( graph ); setScene(m_scene); QObject::connect(m_scene, SIGNAL(changed(const QList<QRectF> &)), this, SLOT(onSceneChanged())); QObject::connect( m_scene, SIGNAL(urlDropped(QUrl, bool, bool, QPointF)), this, SIGNAL(urlDropped(QUrl, bool, bool, QPointF)) ); m_graph = graph; if(m_graph) { m_graph->setGeometry(0, 0, size().width(), size().height()); m_scene->addItem(m_graph); m_graph->updateOverlays(rect().width(), rect().height()); } } void GraphViewWidget::resizeEvent(QResizeEvent * event) { setSceneRect(0, 0, event->size().width(), event->size().height()); if (m_graph) { m_graph->setGeometry(0, 0, event->size().width(), event->size().height()); m_graph->updateOverlays(event->size().width(), event->size().height()); } } void GraphViewWidget::mousePressEvent(QMouseEvent * event) { m_altWasHeldAtLastMousePress = event->modifiers().testFlag( Qt::AltModifier ); QGraphicsView::mousePressEvent(event); } void GraphViewWidget::mouseMoveEvent(QMouseEvent * event) { m_lastEventPos = event->pos(); if (getUiGraphZoomBeforeQuickZoom() > 0) update(); QGraphicsView::mouseMoveEvent(event); } void GraphViewWidget::keyPressEvent(QKeyEvent * event) { if (event->key() == Qt::Key_Escape) { MouseGrabber *mouseGrabber = graph()->getMouseGrabber(); if (mouseGrabber) { mouseGrabber->performUngrab(NULL); graph()->resetMouseGrabber(); event->accept(); return; } } QGraphicsView::keyPressEvent(event); } void GraphViewWidget::contextMenuEvent(QContextMenuEvent * event) { if ( m_altWasHeldAtLastMousePress ) { // [pz 20170113] FE-7941: we don't pop up a context menu if Alt was // held when the right mouse button was pressed event->accept(); return; } QGraphicsView::contextMenuEvent(event); } QPoint GraphViewWidget::lastEventPos() const { return m_lastEventPos; } void GraphViewWidget::onSceneChanged() { #ifdef FABRICUI_TIMERS Util::TimerPtr overAllTimer = Util::Timer::getTimer("FabricUI::GraphViewWidget"); std::map<std::string, Util::TimerPtr> & timers = Util::Timer::getAllTimers(); std::map<std::string, Util::TimerPtr>::iterator it; for(it = timers.begin(); it != timers.end(); it++) { QString message; message += it->second->title(); if(message.left(8) != "FabricUI") continue; double elapsed = it->second->getElapsedMS(); if(elapsed == 0.0) continue; message += " " + QString::number(elapsed, 'g', 3); message += "ms"; printf("%s\n", message.toUtf8().constData()); it->second->reset(); } overAllTimer->resume(); #endif emit sceneChanged(); } bool GraphViewWidget::focusNextPrevChild(bool next) { // avoid focus switching return false; } void GraphViewWidget::drawBackground(QPainter *painter, const QRectF &exposedRect) { // prepare. painter->save(); GraphView::MainPanel *mainPanel = graph()->mainPanel(); GraphView::GraphConfig &config = graph()->config(); std::vector<QLineF> &lines = m_lines; QRectF rect = this->rect(); rect.setLeft(graph()->sidePanel(GraphView::PortType_Output)->rect().right()); // fill the background. if (getUiGraphZoomBeforeQuickZoom() > 0) { painter->fillRect(rect, config.mainPanelHotkeyZoomBackgroundColor); QPointF pos = lastEventPos(); QSizeF size = mainPanel->canvasZoom() * rect.size() / getUiGraphZoomBeforeQuickZoom(); QRectF zoomRect; zoomRect.setRect(pos.x() - 0.5f * size.width() , pos.y() - 0.5f * size.height(), size.width(), size.height()); QPainterPath path; path.addRoundedRect(zoomRect, 5, 5); QPen pen(config.mainPanelHotkeyZoomBorderColor, 1.5f, Qt::DashLine); painter->setPen(pen); painter->fillPath(path, config.mainPanelBackgroundColor); painter->drawPath(path); } else { painter->fillRect(rect, config.mainPanelBackgroundColor); } // draw the grid. if (config.mainPanelDrawGrid) { // get the view's pan and zoom. QPointF pan = mainPanel->canvasPan(); qreal zoom = mainPanel->canvasZoom(); // draw the grid lines. qreal gridStepMin = config.mainPanelGridSpan / 4; qreal gridStepMax = config.mainPanelGridSpan; for (int pass=0;pass<2;pass++) { qreal gridStep = zoom * (pass == 0 ? 1 : 10) * config.mainPanelGridSpan; if (gridStep > gridStepMin) { lines.clear(); qreal x = rect.left() + fmod(pan.rx(), gridStep); qreal y = rect.top() + fmod(pan.ry(), gridStep); for (;x<rect.right(); x+=gridStep) lines.push_back(QLineF(x, rect.top(), x, rect.bottom())); for (;y<rect.bottom();y+=gridStep) lines.push_back(QLineF(rect.left(), y, rect.right(), y)); // calculate the pen width for the lines // based on the grid step: the smaller // the grid step the thinner the width. qreal penWidth = config.mainPanelGridPen.widthF(); if (gridStep < gridStepMax) penWidth *= 0.5 * (gridStep - gridStepMin) / (gridStepMax - gridStepMin); else if (gridStep < 10 * gridStepMax) penWidth *= 0.5 + 0.5 * (gridStep - gridStepMax) / (10 * gridStepMax - gridStepMax); // draw lines. painter->setPen(QPen(config.mainPanelGridPen.color(), penWidth)); painter->drawLines(lines.data(), lines.size()); } } } // clean up. painter->restore(); } GraphViewScene::GraphViewScene( Graph * graph ) { m_graph = graph; } void GraphViewScene::dragEnterEvent( QGraphicsSceneDragDropEvent *event ) { QMimeData const *mimeData = event->mimeData(); if ( mimeData->hasUrls() ) { QList<QUrl> urls = mimeData->urls(); if ( urls.count() == 1 ) { event->acceptProposedAction(); } } if ( !event->isAccepted() ) QGraphicsScene::dragEnterEvent( event ); } void GraphViewScene::dropEvent( QGraphicsSceneDragDropEvent *event ) { QGraphicsScene::dropEvent( event ); QMimeData const *mimeData = event->mimeData(); if ( mimeData->hasUrls() ) { QList<QUrl> urls = mimeData->urls(); if ( urls.count() == 1 ) { QUrl url = urls.front(); bool ctrlPressed = event->modifiers().testFlag( Qt::ControlModifier ); bool altPressed = event->modifiers().testFlag( Qt::AltModifier ); emit urlDropped( url, ctrlPressed, altPressed, event->pos() ); } } } QPointF GraphViewWidget::mapToGraph( QPoint const &globalPos ) const { MainPanel *mainPanel = m_graph->mainPanel(); QPointF pos = mainPanel->mapFromScene( mapToScene( mapFromGlobal( globalPos ) ) ); QPointF pan = mainPanel->canvasPan(); pos -= pan; if ( float zoom = mainPanel->canvasZoom() ) pos /= zoom; return pos; }
#include <bits/stdc++.h> using namespace std; int main() { int sum=0,max_s=0,n,x; cin>>n; vector <int>v; for (int i=0;i<n;i++) { cin>>x; v.push_back(x); } for(int i=0;i<v.size();i++) { sum=sum+v[i]; max_s=max(sum,max_s); // if(sum<0) // sum=0; } cout<<max_s; return 0; }
#include "dynet/dynet.h" #include "dynet/exec.h" #include "dynet/nodes.h" #include "dynet/param-nodes.h" #include "dynet/aligned-mem-pool.h" #include "dynet/dynet-helper.h" #include "dynet/expr.h" using namespace std; namespace dynet { float* kSCALAR_MINUSONE; float* kSCALAR_ONE; float* kSCALAR_ZERO; int n_hgs = 0; unsigned n_cumul_hgs = 0; int get_number_of_active_graphs() {return n_hgs;}; unsigned get_current_graph_id() {return n_cumul_hgs;}; Node::~Node() {} size_t Node::aux_storage_size() const { return 0; } // perform the forward/backward passes in one or multiple calls // TODO: This is a lot of code for something simple. Can it be shortened? void Node::forward(const std::vector<const Tensor*>& xs, Tensor& fx) const { if (this->supports_multibatch() || fx.d.batch_elems() == 1) { forward_impl(xs, fx); } else { size_t i; std::vector<Tensor> xs_elems(xs.size()); std::vector<const Tensor*> xs_ptrs(xs.size()); std::vector<size_t> xs_sizes(xs.size()); for (i = 0; i < xs.size(); ++i) { xs_elems[i] = xs[i]->batch_elem(0); xs_ptrs[i] = &xs_elems[i]; xs_sizes[i] = xs_elems[i].d.size(); } Tensor fx_elem(fx.batch_elem(0)); size_t fx_size = fx_elem.d.size(); forward_impl(xs_ptrs, fx_elem); for (unsigned b = 1; b < fx.d.batch_elems(); ++b) { for (i = 0; i < xs.size(); ++i) if (xs[i]->d.bd > 1) xs_elems[i].v += xs_sizes[i]; fx_elem.v += fx_size; forward_impl(xs_ptrs, fx_elem); } } } void Node::backward(const std::vector<const Tensor*>& xs, const Tensor& fx, const Tensor& dEdf, unsigned xs_i, Tensor& dEdxi) const { if (this->supports_multibatch() || fx.d.batch_elems() == 1) { backward_impl(xs, fx, dEdf, xs_i, dEdxi); } else { size_t i; std::vector<Tensor> xs_elems(xs.size()); std::vector<const Tensor*> xs_ptrs(xs.size()); std::vector<size_t> xs_sizes(xs.size()); for (i = 0; i < xs.size(); ++i) { xs_elems[i] = xs[i]->batch_elem(0); xs_ptrs[i] = &xs_elems[i]; xs_sizes[i] = xs_elems[i].d.size(); } Tensor fx_elem(fx.batch_elem(0)); size_t fx_size = fx_elem.d.size(); Tensor dEdf_elem(dEdf.batch_elem(0)); size_t dEdf_size = dEdf_elem.d.size(); Tensor dEdxi_elem(dEdxi.batch_elem(0)); size_t dEdxi_size = dEdxi_elem.d.size(); backward_impl(xs_ptrs, fx_elem, dEdf_elem, xs_i, dEdxi_elem); for (unsigned b = 1; b < fx.d.batch_elems(); ++b) { for (i = 0; i < xs.size(); ++i) if (xs[i]->d.bd > 1) xs_elems[i].v += xs_sizes[i]; fx_elem.v += fx_size; dEdf_elem.v += dEdf_size; if (dEdxi.d.bd > 1) dEdxi_elem.v += dEdxi_size; backward_impl(xs_ptrs, fx_elem, dEdf_elem, xs_i, dEdxi_elem); } } } ComputationGraph::ComputationGraph(): ee(new SimpleExecutionEngine(*this)) { if (n_hgs > 0) { cerr << "Memory allocator assumes only a single ComputationGraph at a time.\n"; throw std::runtime_error("Attempted to create >1 CG"); } ++n_hgs; immediate_compute = false; check_validity = false; ++n_cumul_hgs; graph_id = n_cumul_hgs; } ComputationGraph::~ComputationGraph() { this->clear(); delete ee; --n_hgs; } void ComputationGraph::clear() { parameter_nodes.clear(); for (auto n : nodes) delete n; nodes.clear(); } CGCheckpoint ComputationGraph::_get_checkpoint() { CGCheckpoint p; p.device_mem_checkpoint = default_device->mark(this); p.node_idx = nodes.size(); p.par_node_idx = parameter_nodes.size(); return p; } void ComputationGraph::_revert(CGCheckpoint p) { default_device->revert(p.device_mem_checkpoint); // clear all nodes at position >= p.node_idx if ((int)nodes.size() > p.node_idx) { nodes.resize(p.node_idx); // TODO verify deletion of nodes. ee->invalidate(p.node_idx - 1); // clear precomputed forward values } // clear all parameter nodes at position >= p.par_node_idx if ((int)parameter_nodes.size() > p.par_node_idx) { parameter_nodes.resize(p.par_node_idx); } } void ComputationGraph::checkpoint() { checkpoints.push_back(_get_checkpoint()); } void ComputationGraph::revert() { if (checkpoints.size() == 0) return; _revert(checkpoints.back()); checkpoints.pop_back(); } Dim& ComputationGraph::get_dimension(VariableIndex index) const { return nodes[index]->dim; } VariableIndex ComputationGraph::add_input(real s) { VariableIndex new_node_index(nodes.size()); nodes.push_back(new ScalarInputNode(s)); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_input(const real* ps) { VariableIndex new_node_index(nodes.size()); nodes.push_back(new ScalarInputNode(ps)); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_input(const Dim& d, const vector<float>& pm) { VariableIndex new_node_index(nodes.size()); nodes.push_back(new InputNode(d, pm)); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_input(const Dim& d, const vector<float>* pm) { VariableIndex new_node_index(nodes.size()); nodes.push_back(new InputNode(d, pm)); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_input(const Dim& d, const vector<unsigned int>& ids, const vector<float>& data, float defdata) { VariableIndex new_node_index(nodes.size()); nodes.push_back(new SparseInputNode(d, ids, data, defdata)); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_parameters(Parameter p) { VariableIndex new_node_index(nodes.size()); ParameterNode* new_node = new ParameterNode(p); nodes.push_back(new_node); parameter_nodes.push_back(new_node_index); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_parameters(LookupParameter p) { VariableIndex new_node_index(nodes.size()); ParameterNode* new_node = new ParameterNode(p); nodes.push_back(new_node); parameter_nodes.push_back(new_node_index); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_const_parameters(Parameter p) { VariableIndex new_node_index(nodes.size()); ConstParameterNode* new_node = new ConstParameterNode(p); nodes.push_back(new_node); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_const_parameters(LookupParameter p) { VariableIndex new_node_index(nodes.size()); ConstParameterNode* new_node = new ConstParameterNode(p); nodes.push_back(new_node); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_lookup(LookupParameter p, const unsigned* pindex) { VariableIndex new_node_index(nodes.size()); LookupNode* new_node = new LookupNode(p, pindex); nodes.push_back(new_node); parameter_nodes.push_back(new_node_index); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_lookup(LookupParameter p, unsigned index) { VariableIndex new_node_index(nodes.size()); LookupNode* new_node = new LookupNode(p, index); nodes.push_back(new_node); parameter_nodes.push_back(new_node_index); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_lookup(LookupParameter p, const std::vector<unsigned>& indices) { VariableIndex new_node_index(nodes.size()); LookupNode* new_node = new LookupNode(p, indices); nodes.push_back(new_node); parameter_nodes.push_back(new_node_index); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_lookup(LookupParameter p, const std::vector<unsigned>* indices) { VariableIndex new_node_index(nodes.size()); LookupNode* new_node = new LookupNode(p, indices); nodes.push_back(new_node); parameter_nodes.push_back(new_node_index); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_const_lookup(LookupParameter p, const unsigned* pindex) { VariableIndex new_node_index(nodes.size()); LookupNode* new_node = new LookupNode(p, pindex); // get rid of the following in favor of using parameter_nodes to see the needs_derivative // expression nodes.push_back(new_node); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_const_lookup(LookupParameter p, unsigned index) { VariableIndex new_node_index(nodes.size()); LookupNode* new_node = new LookupNode(p, index); nodes.push_back(new_node); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_const_lookup(LookupParameter p, const std::vector<unsigned>& indices) { VariableIndex new_node_index(nodes.size()); LookupNode* new_node = new LookupNode(p, indices); nodes.push_back(new_node); set_dim_for_new_node(new_node_index); return new_node_index; } VariableIndex ComputationGraph::add_const_lookup(LookupParameter p, const std::vector<unsigned>* indices) { VariableIndex new_node_index(nodes.size()); LookupNode* new_node = new LookupNode(p, indices); nodes.push_back(new_node); set_dim_for_new_node(new_node_index); return new_node_index; } // factory function should call this right after creating a new node object // to set its dimensions properly void ComputationGraph::set_dim_for_new_node(const VariableIndex& i) { Node* node = nodes[i]; vector<Dim> xds(node->arity()); unsigned ai = 0; for (VariableIndex arg : node->args) { xds[ai] = nodes[arg]->dim; ++ai; } node->dim = node->dim_forward(xds); if (immediate_compute) { const Tensor& value = incremental_forward(i); if (check_validity) if (!value.is_valid()) { cerr << "NaN or Inf detected\n"; throw std::runtime_error("NaN or Inf detected"); } } } const Tensor& ComputationGraph::incremental_forward(const expr::Expression& last) { return ee->incremental_forward(last.i); } const Tensor& ComputationGraph::forward(const expr::Expression& last) { return ee->forward(last.i); } const Tensor& ComputationGraph::incremental_forward(VariableIndex last) { return ee->incremental_forward(last); } const Tensor& ComputationGraph::forward(VariableIndex last) { return ee->forward(last); } const Tensor& ComputationGraph::get_value(VariableIndex i) { return ee->get_value(i); } const Tensor& ComputationGraph::get_value(const expr::Expression& e) { return this->get_value(e.i); } void ComputationGraph::invalidate() { ee->invalidate(); } void ComputationGraph::backward(const expr::Expression& last) { ee->backward(last.i); } void ComputationGraph::backward(VariableIndex i) { ee->backward(i); } void ComputationGraph::set_immediate_compute(bool ic) { immediate_compute = ic; } void ComputationGraph::set_check_validity(bool cv) { check_validity = cv; } void ComputationGraph::print_graphviz() const { cerr << "digraph G {\n rankdir=LR;\n nodesep=.05;\n"; unsigned nc = 0; for (auto node : nodes) { vector<string> var_names; for (auto arg : node->args) var_names.push_back(string("v") + to_string((unsigned)arg)); cerr << " N" << nc << " [label=\"v" << nc << " = " << node->as_string(var_names) << "\"];\n"; for (auto arg : node->args) cerr << " N" << ((unsigned)arg) << " -> N" << nc << ";\n"; ++nc; } cerr << "}\n"; } } // namespace dynet
#include <symengine/printers/strprinter.h> namespace SymEngine { namespace detail { std::string poly_print(const Expression &x) { Precedence prec; if (prec.getPrecedence(x.get_basic()) == PrecedenceEnum::Add) { return "(" + x.get_basic()->__str__() + ")"; } return x.get_basic()->__str__(); } } } // SymEngine
/* * TextFieldMultiLineString.cpp * * This file is part of the "TypographiaLib" project (Copyright (c) 2015 by Lukas Hermanns) * See "LICENSE.txt" for license information. */ #include <Typo/TextFieldMultiLineString.h> #include <algorithm> namespace Tg { TextFieldMultiLineString::TextFieldMultiLineString(const FontGlyphSet& glyphSet, int maxWidth, const String& text) : text_ { glyphSet, maxWidth, text } { } TextFieldMultiLineString& TextFieldMultiLineString::operator = (const String& str) { SetText(str); return *this; } TextFieldMultiLineString& TextFieldMultiLineString::operator += (const String& str) { for (const auto& chr : str) Insert(chr); return *this; } TextFieldMultiLineString& TextFieldMultiLineString::operator += (Char chr) { Insert(chr); return *this; } /* --- Text position conversion --- */ TextFieldMultiLineString::SizeType TextFieldMultiLineString::GetTextIndex(const Point& position) const { return text_.GetTextIndex(position.y, position.x); } Point TextFieldMultiLineString::GetTextPosition(SizeType index) const { SizeType lineIndex = 0, positionInLine = 0; text_.GetTextPosition(index, lineIndex, positionInLine); return Point(positionInLine, lineIndex); } TextFieldMultiLineString::SizeType TextFieldMultiLineString::GetXPositionFromCoordinate(SizeType coordinateX, std::size_t lineIndex) const { if (lineIndex < GetLines().size()) { /* Iterate over line text to find suitable X coordinate by the text width */ const auto& text = GetLineText(lineIndex); SizeType pos = 0; for (auto width = static_cast<long long>(coordinateX); pos < text.size(); ++pos) { /* Reduce width to zero, to find the suitable */ auto prevWidth = width; width -= GetGlyphSet()[text[pos]].advance; if (width <= 0) { if (prevWidth > -width) ++pos; break; } } return pos; } return 0; } TextFieldMultiLineString::SizeType TextFieldMultiLineString::GetXCoordinateFromPosition(SizeType positionX, std::size_t lineIndex) const { if (lineIndex < GetLines().size()) { /* Return text width of the specified line to the X position */ return GetGlyphSet().TextWidth(GetLineText(lineIndex), 0, positionX); } return 0; } /* --- Cursor operations --- */ void TextFieldMultiLineString::SetCursorCoordinate(Point position) { if (!GetLines().empty()) { position.y = std::min(position.y, GetLines().size() - 1); position.x = std::min(position.x, GetLineText(position.y).size()); SetCursorPosition(GetTextIndex(position)); } else SetCursorPosition(0); } Point TextFieldMultiLineString::GetCursorCoordinate() const { return GetTextPosition(GetCursorPosition()); } bool TextFieldMultiLineString::IsCursorTop() const { return (GetLines().empty() || GetCursorCoordinate().y == 0); } bool TextFieldMultiLineString::IsCursorBottom() const { return (GetLines().empty() || GetCursorCoordinate().y + 1 == GetLines().size()); } void TextFieldMultiLineString::MoveCursor(int direction) { if (direction < 0) { auto dir = static_cast<SizeType>(-direction); SetCursorPosition(GetCursorPosition() - std::min(dir, GetCursorPosition())); } else if (direction > 0) { auto dir = static_cast<SizeType>(direction); SetCursorPosition(std::min(GetText().size(), GetCursorPosition() + dir)); } StoreCursorCoordX(); } void TextFieldMultiLineString::MoveCursorLine(int direction) { /* Get number of lines and quit if moving cursor is not possible */ auto count = GetLines().size(); if (count < 2) return; if (direction < 0) { auto dir = static_cast<SizeType>(-direction); if (GetCursorCoordinate().y >= dir) { /* Move cursor up */ RestoreCursorCoordX(GetCursorCoordinate().y - dir); } else { /* Locate cursor to the top */ MoveCursorTop(); } } else if (direction > 0) { auto dir = static_cast<SizeType>(direction); if (GetCursorCoordinate().y + dir <= count) { /* Move cursor down */ RestoreCursorCoordX(GetCursorCoordinate().y + dir); } else { /* Locate cursor to the bottom */ MoveCursorBottom(); } } } //!INCOMPLETE! (due to trunaced spaces at an implicit line break) void TextFieldMultiLineString::MoveCursorBegin() { if (wrapLines) { /* Move cursor left until the left sided character is a new-line character */ while (!IsCursorBegin()) { SetCursorCoordinate(0, GetCursorCoordinate().y); if (!text_.IsNewLine(CharLeft())) MoveCursor(-1); else break; } } else SetCursorCoordinate(0, GetCursorCoordinate().y); StoreCursorCoordX(); } //!INCOMPLETE! (due to trunaced spaces at an implicit line break) void TextFieldMultiLineString::MoveCursorEnd() { if (wrapLines) { /* Move cursor right until the right sided character is a new-line character */ while (!IsCursorEnd()) { SetCursorCoordinate(GetLineText().size(), GetCursorCoordinate().y); if (!text_.IsNewLine(CharRight())) MoveCursor(1); else break; } } else SetCursorCoordinate(GetLineText().size(), GetCursorCoordinate().y); StoreCursorCoordX(); } void TextFieldMultiLineString::MoveCursorTop() { RestoreCursorCoordX(0); } void TextFieldMultiLineString::MoveCursorBottom() { if (!GetLines().empty()) RestoreCursorCoordX(GetLines().size() - 1); } void TextFieldMultiLineString::JumpUp() { /* Move up to the first non-empty line, then move up to the last non-empty line */ while (!IsCursorTop() && IsUpperLineEmpty()) MoveCursorLine(-1); while (!IsCursorTop() && !IsUpperLineEmpty()) MoveCursorLine(-1); } void TextFieldMultiLineString::JumpDown() { /* Move down to the first non-empty line, then move down to the last non-empty line */ while (!IsCursorBottom() && IsLowerLineEmpty()) MoveCursorLine(1); while (!IsCursorBottom() && !IsLowerLineEmpty()) MoveCursorLine(1); } /* --- Selection operations --- */ void TextFieldMultiLineString::SetSelectionCoordinate(const Point& start, const Point& end) { SetSelection(GetTextIndex(start), GetTextIndex(end)); } void TextFieldMultiLineString::GetSelectionCoordinate(Point& start, Point& end) const { SizeType startPos = 0, endPos = 0; GetSelection(startPos, endPos); start = GetTextPosition(startPos); end = GetTextPosition(endPos); } /* --- String content --- */ Char TextFieldMultiLineString::CharLeft() const { return (!IsCursorBegin() ? GetText()[GetCursorPosition() - 1] : Char(0)); } Char TextFieldMultiLineString::CharRight() const { return (!IsCursorEnd() ? GetText()[GetCursorPosition()] : Char(0)); } void TextFieldMultiLineString::RemoveLeft() { if (IsSelected()) { /* First remove selection */ RemoveSelection(); } else if (!IsCursorBegin()) { /* Move cursor left and then remove character */ MoveCursor(-1); auto cursorCoord = GetCursorCoordinate(); text_.Remove(cursorCoord.y, cursorCoord.x); } } void TextFieldMultiLineString::RemoveRight() { if (IsSelected()) { /* First remove selection */ RemoveSelection(); } else if (!IsCursorEnd()) { /* Only remove character without moving the cursor */ auto cursorCoord = GetCursorCoordinate(); text_.Remove(cursorCoord.y, cursorCoord.x); } } void TextFieldMultiLineString::RemoveSelection() { /* Remove characters from the start position */ if (IsSelected()) { /* Get selection range */ SizeType start, end; GetSelection(start, end); /* Locate cursor to the selection start */ selectionEnabled = false; SetCursorPosition(start); /* Remove the selected amount of characters from the start position */ auto erasePos = GetTextPosition(start); for (; start < end; ++start) text_.Remove(erasePos.y, erasePos.x); } } bool TextFieldMultiLineString::IsValidChar(Char chr) const { return (unsigned(chr) >= 32 || chr == '\r' || chr == '\n'); } void TextFieldMultiLineString::SetText(const String& text) { text_.SetText(text); UpdateCursorRange(); } const String& TextFieldMultiLineString::GetText() const { return text_.GetText(); } void TextFieldMultiLineString::SetMaxWidth(int maxWidth) { if (GetMaxWidth() != maxWidth) { text_.SetMaxWidth(maxWidth); StoreCursorCoordX(); } } const MultiLineString::TextLine& TextFieldMultiLineString::GetLine() const { return GetLine(GetCursorCoordinate().y); } const MultiLineString::TextLine& TextFieldMultiLineString::GetLine(std::size_t lineIndex) const { static const MultiLineString::TextLine dummyLine; if (lineIndex < GetLines().size()) return GetLines()[lineIndex]; return dummyLine; } const String& TextFieldMultiLineString::GetLineText() const { return GetLine().text; } const String& TextFieldMultiLineString::GetLineText(std::size_t lineIndex) const { return GetLine(lineIndex).text; } /* * ======= Private: ======= */ void TextFieldMultiLineString::InsertChar(Char chr, bool wasSelected) { /* Replace '\r' by '\n' */ if (chr == '\r') chr = '\n'; /* Insert the new character (only use insertion if selection was not replaced) */ auto coord = GetCursorCoordinate(); text_.Insert(coord.y, coord.x, chr, (insertionEnabled && !wasSelected)); } bool TextFieldMultiLineString::IsUpperLineEmpty() const { return GetLines()[GetCursorCoordinate().y - 1].text.empty(); } bool TextFieldMultiLineString::IsLowerLineEmpty() const { return GetLines()[GetCursorCoordinate().y + 1].text.empty(); } void TextFieldMultiLineString::StoreCursorCoordX() { auto cursorCoord = GetCursorCoordinate(); storedCursorCoordX_ = GetXCoordinateFromPosition(cursorCoord.x, cursorCoord.y); } void TextFieldMultiLineString::RestoreCursorCoordX(SizeType lineIndex) { SetCursorCoordinate(GetXPositionFromCoordinate(storedCursorCoordX_, lineIndex), lineIndex); } } // /namespace Tg // ================================================================================
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef itkMetaContourConverter_hxx #define itkMetaContourConverter_hxx #include "itkMetaContourConverter.h" namespace itk { template <unsigned int NDimensions> typename MetaContourConverter<NDimensions>::MetaObjectType * MetaContourConverter<NDimensions>::CreateMetaObject() { return dynamic_cast<MetaObjectType *>(new ContourMetaObjectType); } /** Convert a metaContour into an Contour SpatialObject */ template <unsigned int NDimensions> typename MetaContourConverter<NDimensions>::SpatialObjectPointer MetaContourConverter<NDimensions>::MetaObjectToSpatialObject(const MetaObjectType * mo) { const auto * contourMO = dynamic_cast<const MetaContour *>(mo); if (contourMO == nullptr) { itkExceptionMacro(<< "Can't downcast MetaObject to MetaContour"); } ContourSpatialObjectPointer contourSO = ContourSpatialObjectType::New(); contourSO->GetProperty().SetName(contourMO->Name()); contourSO->SetId(contourMO->ID()); contourSO->SetParentId(contourMO->ParentID()); contourSO->GetProperty().SetRed(contourMO->Color()[0]); contourSO->GetProperty().SetGreen(contourMO->Color()[1]); contourSO->GetProperty().SetBlue(contourMO->Color()[2]); contourSO->GetProperty().SetAlpha(contourMO->Color()[3]); contourSO->SetIsClosed(const_cast<ContourMetaObjectType *>(contourMO)->Closed()); contourSO->SetAttachedToSlice(const_cast<ContourMetaObjectType *>(contourMO)->AttachedToSlice()); // First the control points using ControlPointType = typename ContourSpatialObjectType::ContourPointType; auto itCP = contourMO->GetControlPoints().begin(); for (unsigned int identifier = 0; identifier < contourMO->GetControlPoints().size(); identifier++) { ControlPointType pnt; using PointType = typename ControlPointType::PointType; PointType point; PointType pickedPoint; using CovariantVectorType = typename ControlPointType::CovariantVectorType; CovariantVectorType normal; for (unsigned int i = 0; i < NDimensions; i++) { point[i] = (*itCP)->m_X[i] * contourMO->ElementSpacing(i); } for (unsigned int i = 0; i < NDimensions; i++) { pickedPoint[i] = (*itCP)->m_XPicked[i] * contourMO->ElementSpacing(i); } for (unsigned int i = 0; i < NDimensions; i++) { normal[i] = (*itCP)->m_V[i]; } pnt.SetId((*itCP)->m_Id); pnt.SetRed((*itCP)->m_Color[0]); pnt.SetGreen((*itCP)->m_Color[1]); pnt.SetBlue((*itCP)->m_Color[2]); pnt.SetAlpha((*itCP)->m_Color[3]); pnt.SetPositionInObjectSpace(point); pnt.SetPickedPointInObjectSpace(pickedPoint); pnt.SetNormalInObjectSpace(normal); contourSO->GetControlPoints().push_back(pnt); itCP++; } // Then the interpolated points using InterpolatedPointType = typename ContourSpatialObjectType::ContourPointType; auto itI = contourMO->GetInterpolatedPoints().begin(); for (unsigned int identifier = 0; identifier < contourMO->GetInterpolatedPoints().size(); identifier++) { InterpolatedPointType pnt; using PointType = typename ControlPointType::PointType; PointType point; for (unsigned int i = 0; i < NDimensions; i++) { point[i] = (*itI)->m_X[i]; } pnt.SetId((*itI)->m_Id); pnt.SetRed((*itI)->m_Color[0]); pnt.SetGreen((*itI)->m_Color[1]); pnt.SetBlue((*itI)->m_Color[2]); pnt.SetAlpha((*itI)->m_Color[3]); pnt.SetPositionInObjectSpace(point); contourSO->AddPoint(pnt); itI++; } return contourSO.GetPointer(); } /** Convert a Contour SpatialObject into a metaContour */ template <unsigned int NDimensions> typename MetaContourConverter<NDimensions>::MetaObjectType * MetaContourConverter<NDimensions>::SpatialObjectToMetaObject(const SpatialObjectType * so) { ContourSpatialObjectConstPointer contourSO = dynamic_cast<const ContourSpatialObjectType *>(so); if (contourSO.IsNull()) { itkExceptionMacro(<< "Can't downcast SpatialObject to ContourSpatialObject"); } auto * contourMO = new MetaContour(NDimensions); // fill in the control points information typename ContourSpatialObjectType::ContourPointListType::const_iterator itCP; for (itCP = contourSO->GetControlPoints().begin(); itCP != contourSO->GetControlPoints().end(); itCP++) { auto * pnt = new ContourControlPnt(NDimensions); pnt->m_Id = (*itCP).GetId(); for (unsigned int d = 0; d < NDimensions; d++) { pnt->m_X[d] = (*itCP).GetPositionInObjectSpace()[d]; } for (unsigned int d = 0; d < NDimensions; d++) { pnt->m_XPicked[d] = (*itCP).GetPickedPointInObjectSpace()[d]; } for (unsigned int d = 0; d < NDimensions; d++) { pnt->m_V[d] = (*itCP).GetNormalInObjectSpace()[d]; } pnt->m_Color[0] = (*itCP).GetRed(); pnt->m_Color[1] = (*itCP).GetGreen(); pnt->m_Color[2] = (*itCP).GetBlue(); pnt->m_Color[3] = (*itCP).GetAlpha(); contourMO->GetControlPoints().push_back(pnt); } if (NDimensions == 2) { contourMO->ControlPointDim("id x y xp yp v1 v2 r g b a"); } else if (NDimensions == 3) { contourMO->ControlPointDim("id x y z xp yp zp v1 v2 v3 r gn be a"); } // fill in the interpolated points information typename ContourSpatialObjectType::ContourPointListType::const_iterator itI; for (itI = contourSO->GetPoints().begin(); itI != contourSO->GetPoints().end(); itI++) { auto * pnt = new ContourInterpolatedPnt(NDimensions); pnt->m_Id = (*itI).GetId(); for (unsigned int d = 0; d < NDimensions; d++) { pnt->m_X[d] = (*itI).GetPositionInObjectSpace()[d]; } pnt->m_Color[0] = (*itI).GetRed(); pnt->m_Color[1] = (*itI).GetGreen(); pnt->m_Color[2] = (*itI).GetBlue(); pnt->m_Color[3] = (*itI).GetAlpha(); contourMO->GetInterpolatedPoints().push_back(pnt); } if (NDimensions == 2) { contourMO->InterpolatedPointDim("id x y r g b a"); } else if (NDimensions == 3) { contourMO->InterpolatedPointDim("id x y z r g b a"); } // Set the interpolation type switch (contourSO->GetInterpolationMethod()) { case ContourSpatialObjectType::InterpolationMethodType::EXPLICIT_INTERPOLATION: contourMO->Interpolation(MET_EXPLICIT_INTERPOLATION); break; case ContourSpatialObjectType::InterpolationMethodType::LINEAR_INTERPOLATION: contourMO->Interpolation(MET_LINEAR_INTERPOLATION); break; case ContourSpatialObjectType::InterpolationMethodType::BEZIER_INTERPOLATION: contourMO->Interpolation(MET_BEZIER_INTERPOLATION); break; default: contourMO->Interpolation(MET_NO_INTERPOLATION); } float color[4]; for (unsigned int i = 0; i < 4; i++) { color[i] = contourSO->GetProperty().GetColor()[i]; } contourMO->Color(color); contourMO->ID(contourSO->GetId()); contourMO->Closed(contourSO->GetIsClosed()); contourMO->AttachedToSlice(contourSO->GetAttachedToSlice()); contourMO->DisplayOrientation(contourSO->GetOrientationInObjectSpace()); if (contourSO->GetParent()) { contourMO->ParentID(contourSO->GetParent()->GetId()); } contourMO->BinaryData(true); return contourMO; } } // end namespace itk #endif
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include "config/ruxcrypto-config.h" #endif #include "tinyformat.h" #include "utiltime.h" #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/thread.hpp> static int64_t nMockTime = 0; //!< For unit testing int64_t GetTime() { if (nMockTime) return nMockTime; time_t now = time(NULL); assert(now > 0); return now; } void SetMockTime(int64_t nMockTimeIn) { nMockTime = nMockTimeIn; } bool IsMockTime() { return nMockTime != 0; } int64_t GetTimeMillis() { int64_t now = (boost::posix_time::microsec_clock::universal_time() - boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds(); assert(now > 0); return now; } int64_t GetTimeMicros() { int64_t now = (boost::posix_time::microsec_clock::universal_time() - boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds(); assert(now > 0); return now; } int64_t GetSystemTimeInSeconds() { return GetTimeMicros()/1000000; } /** Return a time useful for the debug log */ int64_t GetLogTimeMicros() { if (nMockTime) return nMockTime*1000000; return GetTimeMicros(); } void MilliSleep(int64_t n) { /** * Boost's sleep_for was uninterruptible when backed by nanosleep from 1.50 * until fixed in 1.52. Use the deprecated sleep method for the broken case. * See: https://svn.boost.org/trac/boost/ticket/7238 */ #if defined(HAVE_WORKING_BOOST_SLEEP_FOR) boost::this_thread::sleep_for(boost::chrono::milliseconds(n)); #elif defined(HAVE_WORKING_BOOST_SLEEP) boost::this_thread::sleep(boost::posix_time::milliseconds(n)); #else //should never get here #error missing boost sleep implementation #endif } std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) { static std::locale classic(std::locale::classic()); // std::locale takes ownership of the pointer std::locale loc(classic, new boost::posix_time::time_facet(pszFormat)); std::stringstream ss; ss.imbue(loc); ss << boost::posix_time::from_time_t(nTime); return ss.str(); }
#include <fstream> #include "ortools_utils.h" #include "ortools/lp_data/mps_reader.h" #include "ortools/lp_data/proto_utils.h" #include "ortools/linear_solver/linear_solver.pb.h" #include "ortools/linear_solver/model_exporter.h" namespace { //convert ortools status into an XPRSgetbasis like result value /** * row status : * 0 : slack, surplus or artificial is non-basic at lower bound; * 1 : slack, surplus or artificial is basic; * 2 : slack or surplus is non-basic at upper bound. * 3 : slack or surplus is super-basic. * column status * 0 : variable is non-basic at lower bound, or superbasic at zero if the variable has no lower bound; * 1 : variable is basic; * 2 : variable is non-basic at upper bound; * 3 : variable is super-basic. */ int basisStatusToInt(operations_research::MPSolver::BasisStatus basisStatus_l) { switch(basisStatus_l) { case operations_research::MPSolver::FREE : { return 3; } case operations_research::MPSolver::AT_LOWER_BOUND : { return 0; } case operations_research::MPSolver::AT_UPPER_BOUND : { return 2; } case operations_research::MPSolver::FIXED_VALUE : { return 0; //actually this means 0 and 2 at the same time } case operations_research::MPSolver::BASIC : { return 1; } default: std::cerr << "\nbasisStatusToInt: Unknown basis status : " << basisStatus_l << "!\n"; return 3; } } } operations_research::MPSolverResponseStatus ORTreadmps(operations_research::MPSolver & solver_p, std::string const & filename_p) { solver_p.Clear(); std::ifstream mpsfile(filename_p.c_str()); if(mpsfile.good()) { operations_research::MPModelProto model_proto_l; #if defined(ORTOOLS_PRE_V71) operations_research::glop::LinearProgram linearProgram_l; operations_research::glop::MPSReader().LoadFileWithMode(filename_p, true, &linearProgram_l); operations_research::glop::LinearProgramToMPModelProto(linearProgram_l, &model_proto_l); #else operations_research::glop::MPSReader().ParseFile(filename_p, &model_proto_l); #endif std::string errorMessage_l; const operations_research::MPSolverResponseStatus status = solver_p.LoadModelFromProtoWithUniqueNamesOrDie(model_proto_l, &errorMessage_l); if(errorMessage_l.length()) { std::cerr << "readMPS::error message: " << errorMessage_l << std::endl; } else { if (solver_p.NumVariables() == 0) std::cout << "readMPS:: no variable in mps " << filename_p << std::endl; if (solver_p.NumConstraints() == 0) std::cout << "readMPS:: no constraint in mps " << filename_p << std::endl; } return status; } std::cerr << "MPS file " << filename_p << " was not found!\n"; return operations_research::MPSOLVER_MODEL_INVALID; } bool ORTwritemps(operations_research::MPSolver const & solver_p, std::string const & filename_p) { std::string modelMps_l; solver_p.ExportModelAsMpsFormat(false, false, &modelMps_l); std::ofstream mpsOut(filename_p); mpsOut << modelMps_l; mpsOut.close(); return true; } bool ORTwritelp(operations_research::MPSolver const & solver_p, std::string const & filename_p) { std::string modelLP_l; solver_p.ExportModelAsLpFormat(false, &modelLP_l); std::ofstream lpOut(filename_p); lpOut << modelLP_l; lpOut.close(); return true; } void ORTdescribe(operations_research::MPSolver const & solver_p, std::ostringstream & oss_p, bool index_p) { operations_research::MPObjective const & objective_l(solver_p.Objective()); oss_p << ( objective_l.maximization() ? "max" : "min" ) << "\t" << objective_l.offset() << "\t" ; for(auto pairVarCoeff : objective_l.terms()) { oss_p << pairVarCoeff.second << " " << ( index_p ? "x"+std::to_string(pairVarCoeff.first->index()) : pairVarCoeff.first->name() )<< "\t"; } for(auto constraint : solver_p.constraints()) { oss_p << std::endl << constraint->name() << ":\t" << constraint->lb() << "\t<=\t"; for(auto pairVarCoeff : constraint->terms()) { oss_p << pairVarCoeff.second << " " << ( index_p ? "x"+std::to_string(pairVarCoeff.first->index()) : pairVarCoeff.first->name() ) << "\t"; } oss_p << "<=\t" << constraint->ub(); } oss_p << std::endl; } void ORTgetrows(operations_research::MPSolver const & solver_p, std::vector<int> & mstart_p, std::vector<int> & mclind_p, std::vector<double> & dmatval_p, int first_p, int last_p) { mstart_p.clear(); mclind_p.clear(); dmatval_p.clear(); int ind(0); for(auto itConstraint_l(solver_p.constraints().cbegin()+first_p), itConstraintEnd_l(solver_p.constraints().cbegin()+last_p+1) ; itConstraint_l!=itConstraintEnd_l ; ++itConstraint_l) { operations_research::MPConstraint* constraint_l(*itConstraint_l); mstart_p.push_back(ind); std::for_each(constraint_l->terms().begin(), constraint_l->terms().end(), [&ind, &mclind_p, &dmatval_p] (std::pair<const operations_research::MPVariable*, double> const & termVarVal_p){ mclind_p.push_back(termVarVal_p.first->index()); dmatval_p.push_back(termVarVal_p.second); ++ind; }); } } void ORTchgobj(operations_research::MPSolver & solver_p, std::vector<int> const & mindex_p, std::vector<double> const & obj_p) { const std::vector<operations_research::MPVariable*> & variables_l = solver_p.variables(); operations_research::MPObjective * objective_l(solver_p.MutableObjective()); for(int cnt_l(0); cnt_l < mindex_p.size(); ++cnt_l) { if ( -1 == mindex_p[cnt_l] ) { objective_l->SetOffset(obj_p[cnt_l]); } else { objective_l->SetCoefficient(variables_l[mindex_p[cnt_l]], obj_p[cnt_l]); } } } void ORTgetobj(operations_research::MPSolver const & solver_p, std::vector<double> & obj_p, int first_p, int last_p) { obj_p.clear(); auto const & mapVarCoeff = solver_p.Objective().terms(); std::transform(solver_p.variables().cbegin()+first_p, solver_p.variables().cbegin()+last_p+1, std::back_inserter(obj_p), [&mapVarCoeff](operations_research::MPVariable * const variable_p) -> double{ auto it_l = mapVarCoeff.find(variable_p); if ( it_l != mapVarCoeff.end() ) { return it_l->second; } else { return 0; } }); } void ORTaddcols(operations_research::MPSolver & solver_p, std::vector<double> const & objx_p, std::vector<int> const & mstart_p, std::vector<int> const & mrwind_p, std::vector<double> const & dmatval_p, std::vector<double> const & bdl_p, std::vector<double> const & bdu_p, std::vector<char> const & colTypes_p, std::vector<std::string> const & colNames_p) { assert(objx_p.size() != 0); assert((objx_p.size() == mstart_p.size()) || (mstart_p.size() == 0)); assert(mrwind_p.size() == dmatval_p.size()); operations_research::MPObjective* objective_l = solver_p.MutableObjective(); const std::vector<operations_research::MPConstraint*> & constraints_l = solver_p.constraints(); for(int col_l(0); col_l < objx_p.size(); ++col_l) { const std::string& name_l = (colNames_p.size() == objx_p.size()) ? colNames_p[col_l] : ""; operations_research::MPVariable* mpVar_l; switch ( colTypes_p[col_l] ) { case 'C': { mpVar_l = solver_p.MakeNumVar(bdl_p[col_l], bdu_p[col_l] , name_l); break; } case 'I': { mpVar_l = solver_p.MakeIntVar(bdl_p[col_l], bdu_p[col_l] , name_l); break; } case 'B': { mpVar_l = solver_p.MakeBoolVar(name_l); break; } default: { std::cerr << "type of the variable " << col_l << " is not handled : -" << colTypes_p[col_l] << "-!\n" ; } } objective_l->SetCoefficient(mpVar_l, objx_p[col_l]); int startIndex_l = (mstart_p.size() > col_l) ? mstart_p[col_l] : 0; int endIndex_l(0); if(0 == mstart_p.size()) { endIndex_l = 0; } else if(col_l == mstart_p.size()-1) { endIndex_l = mrwind_p.size(); } else { endIndex_l = mstart_p[col_l+1]; } for(int ind_l(startIndex_l); ind_l < endIndex_l ; ++ind_l) { constraints_l[mrwind_p[ind_l]]->SetCoefficient(mpVar_l, dmatval_p[ind_l]); } } } void ORTaddrows(operations_research::MPSolver & solver_p, std::vector<char> const & qrtype_p, std::vector<double> const & rhs_p, std::vector<double> const & range_p, std::vector<int> const & mstart_p, std::vector<int> const & mclind_p, std::vector<double> const & dmatval_p) { assert(qrtype_p.size() == rhs_p.size()); assert((mstart_p.size() == 0 ) || (mstart_p.size() == qrtype_p.size()) ); assert((range_p.size() == 0 ) || (range_p.size() == qrtype_p.size()) ); assert(mclind_p.size() == dmatval_p.size()); const std::vector<operations_research::MPVariable*> & variables_l = solver_p.variables(); for(int row_l(0); row_l < qrtype_p.size(); ++row_l) { double lb_l(-solver_p.infinity()); double ub_l(solver_p.infinity()); const std::string& name_l = "addedRow_" + std::to_string(solver_p.NumConstraints()); switch ( qrtype_p[row_l] ) { case 'L': { ub_l = rhs_p[row_l]; break; } case 'G': { lb_l = rhs_p[row_l]; break; } case 'E': { lb_l = rhs_p[row_l]; ub_l = rhs_p[row_l]; break; } case 'R': { if(range_p[row_l] >= 0 ) { ub_l = rhs_p[row_l]; lb_l = rhs_p[row_l] - range_p[row_l]; } else { std::cerr << "ORTaddrows: negative range values are not handled!\n"; } break; } case 'N': { std::cout << "ORTaddrows: ignoring non-binding row " << row_l << ".\n"; continue;//ignore non-binding rows break; } default: { std::cerr << "type of the row " << row_l << " is not handled : " << qrtype_p[row_l] << "!\n" ; } } operations_research::MPConstraint* const mpConstraint_l = solver_p.MakeRowConstraint(lb_l, ub_l, name_l); int startIndex_l = (mstart_p.size() > row_l) ? mstart_p[row_l] : 0; int endIndex_l(0); if(0 == mstart_p.size()) { endIndex_l = 0; } else if(row_l == mstart_p.size()-1) { endIndex_l = mclind_p.size(); } else { endIndex_l = mstart_p[row_l+1]; } for(int ind_l(startIndex_l); ind_l < endIndex_l ; ++ind_l) { mpConstraint_l->SetCoefficient(variables_l[mclind_p[ind_l]], dmatval_p[ind_l]); } } } void ORTgetlpsolution(operations_research::MPSolver const & solver_p, std::vector<double> & x_p) { x_p.clear(); const std::vector<operations_research::MPVariable*> & variables_l = solver_p.variables(); std::transform(variables_l.begin(), variables_l.end(), std::back_inserter(x_p), [](operations_research::MPVariable * const var_l) -> double{ return var_l->solution_value(); }); } void ORTgetlpdual(operations_research::MPSolver const & solver_p, std::vector<double> & dual_p) { dual_p.clear(); const std::vector<operations_research::MPConstraint*> & constraints_l = solver_p.constraints(); std::transform(constraints_l.begin(), constraints_l.end(), std::back_inserter(dual_p), [](operations_research::MPConstraint * const cstr_l) -> double{ return cstr_l->dual_value(); }); } void ORTgetlpreducedcost(operations_research::MPSolver const & solver_p, std::vector<double> & dj_p) { dj_p.clear(); const std::vector<operations_research::MPVariable*> & variables_l = solver_p.variables(); std::transform(variables_l.begin(), variables_l.end(), std::back_inserter(dj_p), [](operations_research::MPVariable * const var_l) -> double{ return var_l->reduced_cost(); }); } void ORTgetrowtype(operations_research::MPSolver const & solver_p, std::vector<char> & qrtype_p, int first_p, int last_p) { qrtype_p.clear(); std::transform(solver_p.constraints().cbegin()+first_p, solver_p.constraints().cbegin()+last_p+1, std::back_inserter(qrtype_p), [&solver_p](operations_research::MPConstraint * const cstr_l) -> char{ if( (cstr_l->lb() == -solver_p.infinity()) && (cstr_l->ub() == solver_p.infinity()) ) { return 'N'; } if( cstr_l->lb() == -solver_p.infinity() ) { return 'L'; } else if ( cstr_l->ub() == solver_p.infinity()) { return 'G'; } else if ( cstr_l->lb() == cstr_l->ub() ) { return 'E'; } else { return 'R'; } }); } void ORTgetrhs(operations_research::MPSolver const & solver_p, std::vector<double> & rhs_p, int first_p, int last_p) { rhs_p.clear(); std::transform(solver_p.constraints().cbegin()+first_p, solver_p.constraints().cbegin()+last_p+1, std::back_inserter(rhs_p), [&solver_p](operations_research::MPConstraint * const cstr_l) -> double{ if( cstr_l->lb() == -solver_p.infinity() ) { return cstr_l->ub(); } else if ( cstr_l->ub() == solver_p.infinity()) { return cstr_l->lb(); } else if ( cstr_l->lb() == cstr_l->ub() ) { return cstr_l->lb(); } else { //TODO : we assume that the RHS for ranges is the ub : verify consistency with xpress results return cstr_l->ub(); } }); } void ORTgetrhsrange(operations_research::MPSolver const & solver_p, std::vector<double> & range_p, int first_p, int last_p) { range_p.clear(); std::transform(solver_p.constraints().cbegin()+first_p, solver_p.constraints().cbegin()+last_p+1, std::back_inserter(range_p), [&solver_p](operations_research::MPConstraint * const cstr_l) -> double{ if( (cstr_l->lb() == -solver_p.infinity()) || ( cstr_l->ub() == solver_p.infinity()) ) { return solver_p.infinity(); } else { return (cstr_l->ub() - cstr_l->lb()); } }); } void ORTgetcolinfo(operations_research::MPSolver const & solver_p, std::vector<char> & coltype_p, std::vector<double> & bdl_p, std::vector<double> & bdu_p, int first_p, int last_p) { bdl_p.clear(); bdu_p.clear(); coltype_p.clear(); std::for_each(solver_p.variables().cbegin()+first_p, solver_p.variables().cbegin()+last_p+1, [&bdl_p, &bdu_p, &coltype_p](operations_research::MPVariable* const variable_l){ bdl_p.push_back(variable_l->lb()); bdu_p.push_back(variable_l->ub()); if(variable_l->integer()) { if( variable_l->lb() == 0 && variable_l->ub()==1 ) { coltype_p.push_back('B'); } else { coltype_p.push_back('I'); } } else { coltype_p.push_back('C'); } }); } //@WARN does not delete the constraints simply removes the coeficients and bounds void ORTdeactivaterows(operations_research::MPSolver & solver_p, std::vector<int> const & mindex) { const std::vector<operations_research::MPConstraint*> & constraints_l = solver_p.constraints(); std::for_each(mindex.begin(), mindex.end(), [&constraints_l, &solver_p](int rowInd_l){ operations_research::MPConstraint* cstr_l = constraints_l[rowInd_l]; cstr_l->SetBounds(-solver_p.infinity(), solver_p.infinity()); cstr_l->Clear(); }); } //@WARN rstatus and cstatus are inversed in ortools xpressinterface implementation using XPRSgetbasis, //check if ortools fixed this issue if having bad results with xpress void ORTgetbasis(operations_research::MPSolver & solver_p, std::vector<int> & rstatus_p, std::vector<int> & cstatus_p) { //row status std::transform(solver_p.constraints().begin(), solver_p.constraints().end(), std::back_inserter(rstatus_p), [&solver_p](const operations_research::MPConstraint * const cstr_l) -> int{ operations_research::MPSolver::BasisStatus rowStatus_l = cstr_l->basis_status(); if ((rowStatus_l == operations_research::MPSolver::AT_LOWER_BOUND) && (cstr_l->lb() == -solver_p.infinity())) { double cst_value = 0; for(const auto & pairVarCoeff : cstr_l->terms()) { cst_value += pairVarCoeff.second * pairVarCoeff.first->solution_value(); } if(cst_value == cstr_l->ub()) { rowStatus_l = operations_research::MPSolver::AT_UPPER_BOUND; } } return basisStatusToInt(rowStatus_l); }); //column status std::transform(solver_p.variables().begin(), solver_p.variables().end(), std::back_inserter(cstatus_p), [](const operations_research::MPVariable * const variable_l) -> int{ return basisStatusToInt(variable_l->basis_status()); }); } void ORTchgbounds(operations_research::MPSolver & solver_p, std::vector<int> const & mindex_p, std::vector<char> const & qbtype_p, std::vector<double> const & bnd_p) { assert(mindex_p.size() == qbtype_p.size()); assert(mindex_p.size() == bnd_p.size()); const std::vector<operations_research::MPVariable*> & variables_l = solver_p.variables(); int cnt_l(0); for(int index_l : mindex_p) { switch(qbtype_p[cnt_l]) { case 'U' : { variables_l[index_l]->SetUB(bnd_p[cnt_l]); break; } case 'L' : { variables_l[index_l]->SetLB(bnd_p[cnt_l]); break; } case 'B' : { variables_l[index_l]->SetBounds(bnd_p[cnt_l], bnd_p[cnt_l]); break; } default: std::cerr << "\nORTchgbounds: Unknown bound type : " << qbtype_p[cnt_l] << "!\n"; } ++cnt_l; } } void ORTcopyandrenamevars(operations_research::MPSolver & outSolver_p, operations_research::MPSolver const & inSolver_p, std::vector<std::string> const & names_p) { if (outSolver_p.ProblemType() != inSolver_p.ProblemType()) { std::cout << "\nWarn: ORTcopyandrenamevars is copying solvers with different types!\n"; } outSolver_p.Clear(); //copy and rename columns std::vector<double> obj_l; ORTgetobj(inSolver_p, obj_l, 0, inSolver_p.NumVariables() - 1); std::vector<double> lb_l; std::vector<double> ub_l; std::vector<char> coltype_l; ORTgetcolinfo(inSolver_p, coltype_l, lb_l, ub_l, 0, inSolver_p.NumVariables() - 1); ORTaddcols(outSolver_p, obj_l, {}, {}, {}, lb_l, ub_l, coltype_l, names_p); const std::vector<operations_research::MPVariable*> & outVariables_l = outSolver_p.variables(); assert(inSolver_p.NumVariables() == outVariables_l.size()); //copy constraints for(auto inConstraint_l : inSolver_p.constraints()) { operations_research::MPConstraint* outConstraint_l = outSolver_p.MakeRowConstraint(inConstraint_l->lb(), inConstraint_l->ub(), inConstraint_l->name()); for(auto pairVarCoeff_l : inConstraint_l->terms()) { outConstraint_l->SetCoefficient(outVariables_l[pairVarCoeff_l.first->index()], pairVarCoeff_l.second); } } }
/* Copyright (C) 2003 MySQL AB 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; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> #include <NDBT_Thread.hpp> #include <NdbApi.hpp> NDBT_Thread::NDBT_Thread() { create(0, -1); } NDBT_Thread::NDBT_Thread(NDBT_ThreadSet* thread_set, int thread_no) { create(thread_set, thread_no); } void NDBT_Thread::create(NDBT_ThreadSet* thread_set, int thread_no) { m_magic = NDBT_Thread::Magic; m_state = Wait; m_thread_set = thread_set; m_thread_no = thread_no; m_func = 0; m_input = 0; m_output = 0; m_ndb = 0; m_err = 0; m_mutex = NdbMutex_Create(); assert(m_mutex != 0); m_cond = NdbCondition_Create(); assert(m_cond != 0); char buf[20]; sprintf(buf, "NDBT_%04u"); const char* name = strdup(buf); assert(name != 0); unsigned stacksize = 512 * 1024; NDB_THREAD_PRIO prio = NDB_THREAD_PRIO_LOW; m_thread = NdbThread_Create(NDBT_Thread_run, (void**)this, stacksize, name, prio); assert(m_thread != 0); } NDBT_Thread::~NDBT_Thread() { if (m_thread != 0) { NdbThread_Destroy(&m_thread); m_thread = 0; } if (m_cond != 0) { NdbCondition_Destroy(m_cond); m_cond = 0; } if (m_mutex != 0) { NdbMutex_Destroy(m_mutex); m_mutex = 0; } } static void* NDBT_Thread_run(void* arg) { assert(arg != 0); NDBT_Thread& thr = *(NDBT_Thread*)arg; assert(thr.m_magic == NDBT_Thread::Magic); thr.run(); return 0; } void NDBT_Thread::run() { while (1) { lock(); while (m_state != Start && m_state != Exit) { wait(); } if (m_state == Exit) { unlock(); break; } (*m_func)(*this); m_state = Stop; signal(); unlock(); } } // methods for main process void NDBT_Thread::start() { lock(); m_state = Start; signal(); unlock(); } void NDBT_Thread::stop() { lock(); while (m_state != Stop) wait(); m_state = Wait; unlock(); } void NDBT_Thread::exit() { lock(); m_state = Exit; signal(); unlock(); } void NDBT_Thread::join() { NdbThread_WaitFor(m_thread, &m_status); m_thread = 0; } int NDBT_Thread::connect(class Ndb_cluster_connection* ncc, const char* db) { m_ndb = new Ndb(ncc, db); if (m_ndb->init() == -1 || m_ndb->waitUntilReady() == -1) { m_err = m_ndb->getNdbError().code; return -1; } return 0; } void NDBT_Thread::disconnect() { delete m_ndb; m_ndb = 0; } // set of threads NDBT_ThreadSet::NDBT_ThreadSet(int count) { m_count = count; m_thread = new NDBT_Thread* [count]; for (int n = 0; n < count; n++) { m_thread[n] = new NDBT_Thread(this, n); } } NDBT_ThreadSet::~NDBT_ThreadSet() { delete_output(); for (int n = 0; n < m_count; n++) { delete m_thread[n]; m_thread[n] = 0; } delete [] m_thread; } void NDBT_ThreadSet::start() { for (int n = 0; n < m_count; n++) { NDBT_Thread& thr = *m_thread[n]; thr.start(); } } void NDBT_ThreadSet::stop() { for (int n = 0; n < m_count; n++) { NDBT_Thread& thr = *m_thread[n]; thr.stop(); } } void NDBT_ThreadSet::exit() { for (int n = 0; n < m_count; n++) { NDBT_Thread& thr = *m_thread[n]; thr.exit(); } } void NDBT_ThreadSet::join() { for (int n = 0; n < m_count; n++) { NDBT_Thread& thr = *m_thread[n]; thr.join(); } } void NDBT_ThreadSet::set_func(NDBT_ThreadFunc* func) { for (int n = 0; n < m_count; n++) { NDBT_Thread& thr = *m_thread[n]; thr.set_func(func); } } void NDBT_ThreadSet::set_input(const void* input) { for (int n = 0; n < m_count; n++) { NDBT_Thread& thr = *m_thread[n]; thr.set_input(input); } } void NDBT_ThreadSet::delete_output() { for (int n = 0; n < m_count; n++) { if (m_thread[n] != 0) { NDBT_Thread& thr = *m_thread[n]; thr.delete_output(); } } } int NDBT_ThreadSet::connect(class Ndb_cluster_connection* ncc, const char* db) { for (int n = 0; n < m_count; n++) { assert(m_thread[n] != 0); NDBT_Thread& thr = *m_thread[n]; if (thr.connect(ncc, db) == -1) return -1; } return 0; } void NDBT_ThreadSet::disconnect() { for (int n = 0; n < m_count; n++) { if (m_thread[n] != 0) { NDBT_Thread& thr = *m_thread[n]; thr.disconnect(); } } } int NDBT_ThreadSet::get_err() const { for (int n = 0; n < m_count; n++) { if (m_thread[n] != 0) { NDBT_Thread& thr = *m_thread[n]; int err = thr.get_err(); if (err != 0) return err; } } return 0; }
/*===============================================================*/ /* */ /* check_result.cpp */ /* */ /* Software evaluation of training and test error rate */ /* */ /*===============================================================*/ #include <cstdio> #include "typedefs.h" #include "output_data.h" #ifndef SW bool check_results(axi_bus* output) #else bool check_results(bit8 output[MAX_X][MAX_Y]) #endif { #ifndef SW bit8 frame_buffer_print[MAX_X][MAX_Y]; // read result from the 32-bit output buffer unsigned x = 0; unsigned y = 0; for (int i = 0; i < OUTPUT_WORDS; i ++ ) { axi_bus word = output[i]; for (int j = 0; j < AXI_BUS_WIDTH / 8; j ++ ) { frame_buffer_print[x][y] = word(8 * j + 7, 8 * j); if (++x == MAX_X) { x = 0; y++; } } } #endif #if 0 for (int i = 0; i < MAX_Y; i++) { printf("{"); for (int j = 0; j < MAX_X; j++) { int pix; #ifndef SW pix = frame_buffer_print[i][j].to_int(); #else pix = output[i][j]; #endif if (j < MAX_X - 1) printf("%i, ", pix); else printf("%i", pix); } printf("},\n"); } #else for (int i = 0; i < MAX_Y; i++) for (int j = 0; j < MAX_X; j++) { int pix; #ifndef SW pix = frame_buffer_print[i][j].to_int(); #else pix = output[i][j]; #endif if (pix != expected[i][j]) return true; } #endif return false; }
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "distributeddb_interfaces_transaction_testcase.h" using namespace testing::ext; using namespace DistributedDB; using namespace DistributedDBUnitTest; using namespace std; void DistributedDBInterfacesTransactionTestCase::StartTransaction001(KvStoreDelegate *&kvDelegatePtr) { /** * @tc.steps:step1. call StartTransaction interface the 1st time. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. call StartTransaction interface the 2nd time. * @tc.expected: step2. call failed and return ERROR. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == DB_ERROR); EXPECT_EQ(kvDelegatePtr->Commit(), OK); } void DistributedDBInterfacesTransactionTestCase::StartTransaction002(KvStoreDelegate *&kvDelegatePtr) { /** * @tc.steps:step1. call StartTransaction interface. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. call commit interface. * @tc.expected: step2. call succeed. */ EXPECT_TRUE(kvDelegatePtr->Commit() == OK); } void DistributedDBInterfacesTransactionTestCase::StartTransaction003(KvStoreDelegate *&kvDelegatePtr) { /** * @tc.steps:step1. call StartTransaction interface. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. call rollback interface. * @tc.expected: step2. call succeed. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == OK); } static void GetSnapshotUnitTest(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus snapshotDelegateStatus = INVALID_ARGS; auto snapshotDelegateCallback = bind(&DistributedDBToolsUnitTest::SnapshotDelegateCallback, placeholders::_1, placeholders::_2, std::ref(snapshotDelegateStatus), std::ref(snapshotDelegatePtr)); kvDelegatePtr->GetKvStoreSnapshot(nullptr, snapshotDelegateCallback); EXPECT_TRUE(snapshotDelegateStatus == OK); ASSERT_TRUE(snapshotDelegatePtr != nullptr); } void DistributedDBInterfacesTransactionTestCase::StartTransaction004(KvStoreDelegate *&kvDelegatePtr, const string &storeId, bool localOnly, KvStoreDelegateManager &mgr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus kvDelegateStatus = INVALID_ARGS; auto kvDelegateCallback = bind(&DistributedDBToolsUnitTest::KvStoreDelegateCallback, placeholders::_1, placeholders::_2, std::ref(kvDelegateStatus), std::ref(kvDelegatePtr)); DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); /** * @tc.steps:step1. call StartTransaction interface. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. put (k1, v1) to data base. * @tc.expected: step2. put succeed. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_1, VALUE_1) == OK); /** * @tc.steps:step3. close data base. * @tc.expected: step3. close succeed. */ EXPECT_EQ(mgr.CloseKvStore(kvDelegatePtr), OK); kvDelegatePtr = nullptr; /** * @tc.steps:step4. use GetKvStore interface to open db. * @tc.expected: step4. open succeed. */ KvStoreDelegate::Option option = {true, localOnly}; mgr.GetKvStore(storeId, option, kvDelegateCallback); EXPECT_EQ(kvDelegateStatus, OK); ASSERT_TRUE(kvDelegatePtr != nullptr); /** * @tc.steps:step5. use snapshot interface to check the value of k1. * @tc.expected: step5. can't get the record of k1. */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == NOT_FOUND); EXPECT_TRUE(value.size() == 0); } void DistributedDBInterfacesTransactionTestCase::StartTransaction005(KvStoreDelegate *&kvDelegatePtr, const string &storeId, bool localOnly, KvStoreDelegateManager &mgr) { DBStatus kvDelegateStatus = INVALID_ARGS; auto kvDelegateCallback = bind(&DistributedDBToolsUnitTest::KvStoreDelegateCallback, placeholders::_1, placeholders::_2, std::ref(kvDelegateStatus), std::ref(kvDelegatePtr)); /** * @tc.steps:step1. call StartTransaction interface the 1st time. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); KvStoreDelegate *temp = kvDelegatePtr; temp->Put(KEY_1, VALUE_1); KvStoreDelegate::Option option = {true, localOnly}; mgr.GetKvStore(storeId, option, kvDelegateCallback); EXPECT_TRUE(kvDelegateStatus == OK); ASSERT_TRUE(kvDelegatePtr != nullptr); /** * @tc.steps:step2. call StartTransaction interface the 2nd time using another . * @tc.expected: step2. call failed. */ EXPECT_NE(kvDelegatePtr->StartTransaction(), OK); kvDelegatePtr->Put(KEY_2, VALUE_2); /** * @tc.steps:step4. call commit interface the 1st time. * @tc.expected: step4. call failed. */ EXPECT_EQ(temp->Commit(), OK); EXPECT_EQ(mgr.CloseKvStore(temp), OK); temp = nullptr; /** * @tc.steps:step5. call commit interface the 2nd time. * @tc.expected: step5. call failed. */ EXPECT_NE(kvDelegatePtr->Commit(), OK); } void DistributedDBInterfacesTransactionTestCase::Commit001(KvStoreDelegate *&kvDelegatePtr) { /** * @tc.steps:step1. commit Transaction without start it. * @tc.expected: step1. commit failed and returned ERROR. */ EXPECT_TRUE(kvDelegatePtr->Commit() == DB_ERROR); } void DistributedDBInterfacesTransactionTestCase::Commit002(KvStoreDelegate *&kvDelegatePtr) { /** * @tc.steps:step1. call StartTransaction interface. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. call commit interface the 1st time. * @tc.expected: step2. call succeed. */ EXPECT_TRUE(kvDelegatePtr->Commit() == OK); /** * @tc.steps:step3. call commit interface the 2nd time. * @tc.expected: step3. call failed and returned ERROR. */ EXPECT_TRUE(kvDelegatePtr->Commit() == DB_ERROR); } void DistributedDBInterfacesTransactionTestCase::Commit003(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); /** * @tc.steps:step1. call StartTransaction interface. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. put (k1, v1) to db. * @tc.expected: step2. put succeed. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_1, VALUE_1) == OK); /** * @tc.steps:step3. call commit interface. * @tc.expected: step3. call succeed. */ EXPECT_TRUE(kvDelegatePtr->Commit() == OK); /** * @tc.steps:step4. use snapshot interface to check if (k1, v1) is put succeed. * @tc.expected: step4. can find (k1, v1) from db. */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == OK); ASSERT_TRUE(value.size() > 0); EXPECT_TRUE(value.front() == VALUE_1.front()); } void DistributedDBInterfacesTransactionTestCase::Commit004(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); /** * @tc.steps:step1. put one data. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_1, VALUE_1) == OK); /** * @tc.steps:step2. call StartTransaction interface. * @tc.expected: step2. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step3. update the data to another value. * @tc.expected: step3. call succeed. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_1, VALUE_2) == OK); /** * @tc.steps:step4. call commit interface. * @tc.expected: step4. call succeed. */ EXPECT_TRUE(kvDelegatePtr->Commit() == OK); /** * @tc.steps:step5. use snapshot interface to check the updated data. * @tc.expected: step5. the value is updated. */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == OK); ASSERT_TRUE(value.size() > 0); EXPECT_TRUE(value.front() == VALUE_2.front()); } void DistributedDBInterfacesTransactionTestCase::Commit005(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); EXPECT_TRUE(kvDelegatePtr->Put(KEY_1, VALUE_1) == OK); /** * @tc.steps:step1. call StartTransaction interface. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. delete record from db where key = k1. * @tc.expected: step2. delete succeed. */ EXPECT_TRUE(kvDelegatePtr->Delete(KEY_1) == OK); /** * @tc.steps:step3. call commit interface. * @tc.expected: step3. commit succeed. */ EXPECT_TRUE(kvDelegatePtr->Commit() == OK); /** * @tc.steps:step4. use snapshot interface to check if (k1, v1) is delete succeed. * @tc.expected: step4. can't find (k1, v1) in the db. */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == NOT_FOUND); } void DistributedDBInterfacesTransactionTestCase::Commit006(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus entryVectorStatus = INVALID_ARGS; unsigned long matchSize = 0; std::vector<Entry> entriesVector; auto entryVectorCallback = bind(&DistributedDBToolsUnitTest::EntryVectorCallback, placeholders::_1, placeholders::_2, std::ref(entryVectorStatus), std::ref(matchSize), std::ref(entriesVector)); EXPECT_TRUE(kvDelegatePtr->PutBatch(ENTRY_VECTOR) == OK); /** * @tc.steps:step1. call StartTransaction interface. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. clear all the records from db. * @tc.expected: step2. clear succeed. */ EXPECT_TRUE(kvDelegatePtr->Clear() == OK); /** * @tc.steps:step3. call commit interface. * @tc.expected: step3. commit succeed. */ EXPECT_TRUE(kvDelegatePtr->Commit() == OK); /** * @tc.steps:step4. use snapshot interface to check if there are any data in db. * @tc.expected: step4. can't find any data in db. */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->GetEntries(NULL_KEY_1, entryVectorCallback); EXPECT_TRUE(entryVectorStatus == NOT_FOUND); } void DistributedDBInterfacesTransactionTestCase::Commit007(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); EXPECT_TRUE(kvDelegatePtr->PutBatch(ENTRY_VECTOR) == OK); /** * @tc.steps:step1. call StartTransaction interface. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. delete record from db where key = k1. * @tc.expected: step2. delete succeed. */ EXPECT_TRUE(kvDelegatePtr->Delete(KEY_1) == OK); /** * @tc.steps:step3. put (k2, v1) to db. * @tc.expected: step3. put succeed. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_2, VALUE_1) == OK); /** * @tc.steps:step4. call commit interface. * @tc.expected: step4. commit succeed. */ EXPECT_TRUE(kvDelegatePtr->Commit() == OK); /** * @tc.steps:step5. use snapshot interface to check the data in db. * @tc.expected: step5. can't find (k1, v1) but can find (k2, v1) in db. */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == NOT_FOUND); snapshotDelegatePtr->Get(KEY_2, valueCallback); EXPECT_TRUE(valueStatus == OK); ASSERT_TRUE(value.size() > 0); EXPECT_TRUE(value.front() == VALUE_1.front()); } void DistributedDBInterfacesTransactionTestCase::Commit008(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus entryVectorStatus = INVALID_ARGS; unsigned long matchSizeCallback = 0; std::vector<Entry> entriesVector; auto entryVectorCallback = bind(&DistributedDBToolsUnitTest::EntryVectorCallback, placeholders::_1, placeholders::_2, std::ref(entryVectorStatus), std::ref(matchSizeCallback), std::ref(entriesVector)); EXPECT_TRUE(kvDelegatePtr->PutBatch(ENTRY_VECTOR) == OK); /** * @tc.steps:step1. call StartTransaction interface. * @tc.expected: step1. call succeed. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. clear all the records from db. * @tc.expected: step2. clear succeed. */ EXPECT_TRUE(kvDelegatePtr->Clear() == OK); /** * @tc.steps:step3. put (k3, v3) to db. * @tc.expected: step3. put succeed. */ Entry entry; GenerateEntry(1, 3, entry); EXPECT_TRUE(kvDelegatePtr->Put(entry.key, entry.value) == OK); /** * @tc.steps:step4. call commit interface. * @tc.expected: step4. commit succeed. */ EXPECT_TRUE(kvDelegatePtr->Commit() == OK); /** * @tc.steps:step5. use snapshot interface to check the data in db. * @tc.expected: step5. can only find (k3, v3) in db. */ unsigned long matchSize = 1; GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->GetEntries(NULL_KEY_1, entryVectorCallback); EXPECT_TRUE(entryVectorStatus == OK); ASSERT_TRUE(matchSizeCallback == matchSize); } void DistributedDBInterfacesTransactionTestCase::RollBack001(KvStoreDelegate *&kvDelegatePtr) { /** * @tc.steps:step1. Test g_kvDelegatePtr->Rollback * @tc.expected: step1. Return ERROR. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == DB_ERROR); } void DistributedDBInterfacesTransactionTestCase::RollBack002(KvStoreDelegate *&kvDelegatePtr) { /** * @tc.steps:step1. start a transaction * @tc.expected: step1. Return OK. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. rollback the transaction * @tc.expected: step2. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == OK); /** * @tc.steps:step3. rollback the transaction the second time * @tc.expected: step3. Return ERROR. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == DB_ERROR); } void DistributedDBInterfacesTransactionTestCase::RollBack003(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); /** * @tc.steps:step1. start a transaction * @tc.expected: step1. Return OK. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step2. Put (k1,v1) * @tc.expected: step2. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_1, VALUE_1) == OK); /** * @tc.steps:step3. rollback a transaction * @tc.expected: step3. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == OK); /** * @tc.steps:step4. check if (k1,v1) exists * @tc.expected: step4. Return NOT_FOUND. */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == NOT_FOUND); } void DistributedDBInterfacesTransactionTestCase::RollBack004(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); /** * @tc.steps:step1. Put (k1,v1) * @tc.expected: step1. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_1, VALUE_1) == OK); /** * @tc.steps:step2. start a transaction * @tc.expected: step2. Return OK. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step3. Update (k1,v1) to (k1,v2) in the transaction * @tc.expected: step3. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_1, VALUE_2) == OK); /** * @tc.steps:step4. rollback the transaction * @tc.expected: step4. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == OK); /** * @tc.steps:step5. check the value of k1 is v1 * @tc.expected: step5. verification is OK . */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == OK); ASSERT_TRUE(value.size() > 0); EXPECT_TRUE(value.front() == VALUE_1.front()); } void DistributedDBInterfacesTransactionTestCase::RollBack005(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); /** * @tc.steps:step1. Put (k1,v1) * @tc.expected: step1. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_1, VALUE_1) == OK); /** * @tc.steps:step2. start a transaction * @tc.expected: step2. Return OK. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step3. Delete (k1,v1) in the transaction * @tc.expected: step3. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Delete(KEY_1) == OK); /** * @tc.steps:step4. rollback the transaction * @tc.expected: step4. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == OK); /** * @tc.steps:step5. check the value of k1 is v1 * @tc.expected: step5. verification is OK . */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == OK); ASSERT_TRUE(value.size() > 0); EXPECT_TRUE(value.front() == VALUE_1.front()); } void DistributedDBInterfacesTransactionTestCase::RollBack006(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus entryVectorStatus = INVALID_ARGS; unsigned long matchSizeCallback = 0; std::vector<Entry> entriesVector; auto entryVectorCallback = bind(&DistributedDBToolsUnitTest::EntryVectorCallback, placeholders::_1, placeholders::_2, std::ref(entryVectorStatus), std::ref(matchSizeCallback), std::ref(entriesVector)); /** * @tc.steps:step1. PutBatch records: (k1,v1), (k2,v2) * @tc.expected: step1. Return OK. */ EXPECT_TRUE(kvDelegatePtr->PutBatch(ENTRY_VECTOR) == OK); /** * @tc.steps:step2. start a transaction * @tc.expected: step2. Return OK. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step3. Clear all records in the transaction * @tc.expected: step3. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Clear() == OK); /** * @tc.steps:step4. rollback the transaction * @tc.expected: step4. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == OK); /** * @tc.steps:step5. check if there are 2 records in the db * @tc.expected: step5. verification is OK . */ unsigned long matchSize = 2; GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->GetEntries(NULL_KEY_1, entryVectorCallback); EXPECT_TRUE(entryVectorStatus == OK); ASSERT_TRUE(matchSizeCallback == matchSize); } void DistributedDBInterfacesTransactionTestCase::RollBack007(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); DBStatus entryVectorStatus = INVALID_ARGS; unsigned long matchSizeCallback = 0; std::vector<Entry> entriesVector; auto entryVectorCallback = bind(&DistributedDBToolsUnitTest::EntryVectorCallback, placeholders::_1, placeholders::_2, std::ref(entryVectorStatus), std::ref(matchSizeCallback), std::ref(entriesVector)); /** * @tc.steps:step1. PutBatch records: (k1,v1), (k2,v2) * @tc.expected: step1. Return OK. */ EXPECT_TRUE(kvDelegatePtr->PutBatch(ENTRY_VECTOR) == OK); /** * @tc.steps:step2. start a transaction * @tc.expected: step2. Return OK. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step3. Delete (k1,v1) in the transaction * @tc.expected: step3. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Delete(KEY_1) == OK); /** * @tc.steps:step4. Update (k2,v2) to (k2,v1) in the transaction * @tc.expected: step4. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Put(KEY_2, VALUE_1) == OK); /** * @tc.steps:step5. rollback the transaction * @tc.expected: step5. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == OK); /** * @tc.steps:step6. check if (k1,v1),(k2,v2) exist and no more records in the db * @tc.expected: step6. verification is OK . */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == OK); ASSERT_TRUE(value.size() > 0); EXPECT_TRUE(value.front() == VALUE_1.front()); snapshotDelegatePtr->Get(KEY_2, valueCallback); EXPECT_TRUE(valueStatus == OK); ASSERT_TRUE(value.size() > 0); EXPECT_TRUE(value.front() == VALUE_2.front()); unsigned long matchSize = 2; snapshotDelegatePtr->GetEntries(NULL_KEY_1, entryVectorCallback); EXPECT_TRUE(entryVectorStatus == OK); ASSERT_TRUE(matchSizeCallback == matchSize); } void DistributedDBInterfacesTransactionTestCase::RollBack008(KvStoreDelegate *&kvDelegatePtr, KvStoreSnapshotDelegate *&snapshotDelegatePtr) { DBStatus valueStatus = INVALID_ARGS; Value value; auto valueCallback = bind(&DistributedDBToolsUnitTest::ValueCallback, placeholders::_1, placeholders::_2, std::ref(valueStatus), std::ref(value)); DBStatus entryVectorStatus = INVALID_ARGS; unsigned long matchSizeCallback = 0; std::vector<Entry> entriesVector; auto entryVectorCallback = bind(&DistributedDBToolsUnitTest::EntryVectorCallback, placeholders::_1, placeholders::_2, std::ref(entryVectorStatus), std::ref(matchSizeCallback), std::ref(entriesVector)); /** * @tc.steps:step1. PutBatch records: (k1,v1), (k2,v2) * @tc.expected: step1. Return OK. */ EXPECT_TRUE(kvDelegatePtr->PutBatch(ENTRY_VECTOR) == OK); /** * @tc.steps:step2. start a transaction * @tc.expected: step2. Return OK. */ EXPECT_TRUE(kvDelegatePtr->StartTransaction() == OK); /** * @tc.steps:step3. Clear all records in the transaction * @tc.expected: step3. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Clear() == OK); /** * @tc.steps:step4. Put (012, ABC) in the transaction * @tc.expected: step4. Return OK. */ Entry entry; GenerateEntry(1, 3, entry); EXPECT_TRUE(kvDelegatePtr->Put(entry.key, entry.value) == OK); /** * @tc.steps:step5. rollback the transaction * @tc.expected: step5. Return OK. */ EXPECT_TRUE(kvDelegatePtr->Rollback() == OK); /** * @tc.steps:step6. check if (k1,v1),(k2,v2) exist and no more records in the db * @tc.expected: step6. verification is OK . */ GetSnapshotUnitTest(kvDelegatePtr, snapshotDelegatePtr); snapshotDelegatePtr->Get(KEY_1, valueCallback); EXPECT_TRUE(valueStatus == OK); ASSERT_TRUE(value.size() > 0); EXPECT_TRUE(value.front() == VALUE_1.front()); snapshotDelegatePtr->Get(KEY_2, valueCallback); EXPECT_TRUE(valueStatus == OK); ASSERT_TRUE(value.size() > 0); EXPECT_TRUE(value.front() == VALUE_2.front()); unsigned long matchSize = 2; snapshotDelegatePtr->GetEntries(NULL_KEY_1, entryVectorCallback); EXPECT_TRUE(entryVectorStatus == OK); ASSERT_TRUE(matchSizeCallback == matchSize); }
/***************************************************************************** * var_list.hpp ***************************************************************************** * Copyright (C) 2003 the VideoLAN team * $Id: 9ece48c7c3e6b75f8d07dacaed8a8a86b6697f0e $ * * Authors: Cyril Deguet <asmax@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr> * * 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. *****************************************************************************/ #ifndef VAR_LIST_HPP #define VAR_LIST_HPP #include <list> #include "variable.hpp" #include "observer.hpp" #include "ustring.hpp" #include "var_percent.hpp" /// List variable class VarList: public Variable, public Subject<VarList> { public: VarList( intf_thread_t *pIntf ); virtual ~VarList(); /// Get the variable type virtual const std::string &getType() const { return m_type; } /// Add a pointer on a string in the list virtual void add( const UStringPtr &rcString ); /// Remove the selected elements from the list virtual void delSelected(); /// Remove all the elements from the list virtual void clear(); /// Get the number of items in the list int size() const { return m_list.size(); } /// Type of an element in the list struct Elem_t { UStringPtr m_cString; bool m_selected; bool m_playing; Elem_t( const UStringPtr &rcString, bool selected = false, bool playing = false ) : m_cString( rcString ), m_selected( selected ), m_playing( playing ) { } }; /// Iterators typedef std::list<Elem_t>::iterator Iterator; typedef std::list<Elem_t>::const_iterator ConstIterator; /// Beginning of the list Iterator begin() { return m_list.begin(); } ConstIterator begin() const { return m_list.begin(); } /// End of the list Iterator end() { return m_list.end(); } ConstIterator end() const { return m_list.end(); } /// Return an iterator on the n'th element of the list Iterator operator[]( int n ); ConstIterator operator[]( int n ) const; /// Execute the action associated to this item virtual void action( Elem_t *pItem ) { (void)pItem; } /// Get a reference on the position variable VarPercent &getPositionVar() const { return *((VarPercent*)m_cPosition.get()); } /// Get a counted pointer on the position variable const VariablePtr &getPositionVarPtr() const { return m_cPosition; } protected: /// List of elements std::list<Elem_t> m_list; private: /// Variable type static const std::string m_type; /// Position variable VariablePtr m_cPosition; }; #endif
/* * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ #include "precompiled.hpp" #include "asm/assembler.inline.hpp" #include "gc/shared/cardTableBarrierSet.hpp" #include "gc/shared/collectedHeap.inline.hpp" #include "interpreter/interpreter.hpp" #include "memory/resourceArea.hpp" #include "prims/methodHandles.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/objectMonitor.hpp" #include "runtime/os.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "utilities/macros.hpp" #include "utilities/powerOfTwo.hpp" #ifdef PRODUCT #define BLOCK_COMMENT(str) // nothing #else #define BLOCK_COMMENT(str) block_comment(str) #endif int AbstractAssembler::code_fill_byte() { return 0x00; // illegal instruction 0x00000000 } // Patch instruction `inst' at offset `inst_pos' to refer to // `dest_pos' and return the resulting instruction. We should have // pcs, not offsets, but since all is relative, it will work out fine. int Assembler::patched_branch(int dest_pos, int inst, int inst_pos) { int m = 0; // mask for displacement field int v = 0; // new value for displacement field switch (inv_op_ppc(inst)) { case b_op: m = li(-1); v = li(disp(dest_pos, inst_pos)); break; case bc_op: m = bd(-1); v = bd(disp(dest_pos, inst_pos)); break; default: ShouldNotReachHere(); } return inst & ~m | v; } // Return the offset, relative to _code_begin, of the destination of // the branch inst at offset pos. int Assembler::branch_destination(int inst, int pos) { int r = 0; switch (inv_op_ppc(inst)) { case b_op: r = bxx_destination_offset(inst, pos); break; case bc_op: r = inv_bd_field(inst, pos); break; default: ShouldNotReachHere(); } return r; } // Low-level andi-one-instruction-macro. void Assembler::andi(Register a, Register s, const long ui16) { if (is_power_of_2(((jlong) ui16)+1)) { // pow2minus1 clrldi(a, s, 64 - log2i_exact((((jlong) ui16)+1))); } else if (is_power_of_2((jlong) ui16)) { // pow2 rlwinm(a, s, 0, 31 - log2i_exact((jlong) ui16), 31 - log2i_exact((jlong) ui16)); } else if (is_power_of_2((jlong)-ui16)) { // negpow2 clrrdi(a, s, log2i_exact((jlong)-ui16)); } else { assert(is_uimm(ui16, 16), "must be 16-bit unsigned immediate"); andi_(a, s, ui16); } } // RegisterOrConstant version. void Assembler::ld(Register d, RegisterOrConstant roc, Register s1) { if (roc.is_constant()) { if (s1 == noreg) { int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true); Assembler::ld(d, simm16_rest, d); } else if (is_simm(roc.as_constant(), 16)) { Assembler::ld(d, roc.as_constant(), s1); } else { load_const_optimized(d, roc.as_constant()); Assembler::ldx(d, d, s1); } } else { if (s1 == noreg) Assembler::ld(d, 0, roc.as_register()); else Assembler::ldx(d, roc.as_register(), s1); } } void Assembler::lwa(Register d, RegisterOrConstant roc, Register s1) { if (roc.is_constant()) { if (s1 == noreg) { int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true); Assembler::lwa(d, simm16_rest, d); } else if (is_simm(roc.as_constant(), 16)) { Assembler::lwa(d, roc.as_constant(), s1); } else { load_const_optimized(d, roc.as_constant()); Assembler::lwax(d, d, s1); } } else { if (s1 == noreg) Assembler::lwa(d, 0, roc.as_register()); else Assembler::lwax(d, roc.as_register(), s1); } } void Assembler::lwz(Register d, RegisterOrConstant roc, Register s1) { if (roc.is_constant()) { if (s1 == noreg) { int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true); Assembler::lwz(d, simm16_rest, d); } else if (is_simm(roc.as_constant(), 16)) { Assembler::lwz(d, roc.as_constant(), s1); } else { load_const_optimized(d, roc.as_constant()); Assembler::lwzx(d, d, s1); } } else { if (s1 == noreg) Assembler::lwz(d, 0, roc.as_register()); else Assembler::lwzx(d, roc.as_register(), s1); } } void Assembler::lha(Register d, RegisterOrConstant roc, Register s1) { if (roc.is_constant()) { if (s1 == noreg) { int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true); Assembler::lha(d, simm16_rest, d); } else if (is_simm(roc.as_constant(), 16)) { Assembler::lha(d, roc.as_constant(), s1); } else { load_const_optimized(d, roc.as_constant()); Assembler::lhax(d, d, s1); } } else { if (s1 == noreg) Assembler::lha(d, 0, roc.as_register()); else Assembler::lhax(d, roc.as_register(), s1); } } void Assembler::lhz(Register d, RegisterOrConstant roc, Register s1) { if (roc.is_constant()) { if (s1 == noreg) { int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true); Assembler::lhz(d, simm16_rest, d); } else if (is_simm(roc.as_constant(), 16)) { Assembler::lhz(d, roc.as_constant(), s1); } else { load_const_optimized(d, roc.as_constant()); Assembler::lhzx(d, d, s1); } } else { if (s1 == noreg) Assembler::lhz(d, 0, roc.as_register()); else Assembler::lhzx(d, roc.as_register(), s1); } } void Assembler::lbz(Register d, RegisterOrConstant roc, Register s1) { if (roc.is_constant()) { if (s1 == noreg) { int simm16_rest = load_const_optimized(d, roc.as_constant(), noreg, true); Assembler::lbz(d, simm16_rest, d); } else if (is_simm(roc.as_constant(), 16)) { Assembler::lbz(d, roc.as_constant(), s1); } else { load_const_optimized(d, roc.as_constant()); Assembler::lbzx(d, d, s1); } } else { if (s1 == noreg) Assembler::lbz(d, 0, roc.as_register()); else Assembler::lbzx(d, roc.as_register(), s1); } } void Assembler::std(Register d, RegisterOrConstant roc, Register s1, Register tmp) { if (roc.is_constant()) { if (s1 == noreg) { guarantee(tmp != noreg, "Need tmp reg to encode large constants"); int simm16_rest = load_const_optimized(tmp, roc.as_constant(), noreg, true); Assembler::std(d, simm16_rest, tmp); } else if (is_simm(roc.as_constant(), 16)) { Assembler::std(d, roc.as_constant(), s1); } else { guarantee(tmp != noreg, "Need tmp reg to encode large constants"); load_const_optimized(tmp, roc.as_constant()); Assembler::stdx(d, tmp, s1); } } else { if (s1 == noreg) Assembler::std(d, 0, roc.as_register()); else Assembler::stdx(d, roc.as_register(), s1); } } void Assembler::stw(Register d, RegisterOrConstant roc, Register s1, Register tmp) { if (roc.is_constant()) { if (s1 == noreg) { guarantee(tmp != noreg, "Need tmp reg to encode large constants"); int simm16_rest = load_const_optimized(tmp, roc.as_constant(), noreg, true); Assembler::stw(d, simm16_rest, tmp); } else if (is_simm(roc.as_constant(), 16)) { Assembler::stw(d, roc.as_constant(), s1); } else { guarantee(tmp != noreg, "Need tmp reg to encode large constants"); load_const_optimized(tmp, roc.as_constant()); Assembler::stwx(d, tmp, s1); } } else { if (s1 == noreg) Assembler::stw(d, 0, roc.as_register()); else Assembler::stwx(d, roc.as_register(), s1); } } void Assembler::sth(Register d, RegisterOrConstant roc, Register s1, Register tmp) { if (roc.is_constant()) { if (s1 == noreg) { guarantee(tmp != noreg, "Need tmp reg to encode large constants"); int simm16_rest = load_const_optimized(tmp, roc.as_constant(), noreg, true); Assembler::sth(d, simm16_rest, tmp); } else if (is_simm(roc.as_constant(), 16)) { Assembler::sth(d, roc.as_constant(), s1); } else { guarantee(tmp != noreg, "Need tmp reg to encode large constants"); load_const_optimized(tmp, roc.as_constant()); Assembler::sthx(d, tmp, s1); } } else { if (s1 == noreg) Assembler::sth(d, 0, roc.as_register()); else Assembler::sthx(d, roc.as_register(), s1); } } void Assembler::stb(Register d, RegisterOrConstant roc, Register s1, Register tmp) { if (roc.is_constant()) { if (s1 == noreg) { guarantee(tmp != noreg, "Need tmp reg to encode large constants"); int simm16_rest = load_const_optimized(tmp, roc.as_constant(), noreg, true); Assembler::stb(d, simm16_rest, tmp); } else if (is_simm(roc.as_constant(), 16)) { Assembler::stb(d, roc.as_constant(), s1); } else { guarantee(tmp != noreg, "Need tmp reg to encode large constants"); load_const_optimized(tmp, roc.as_constant()); Assembler::stbx(d, tmp, s1); } } else { if (s1 == noreg) Assembler::stb(d, 0, roc.as_register()); else Assembler::stbx(d, roc.as_register(), s1); } } void Assembler::add(Register d, RegisterOrConstant roc, Register s1) { if (roc.is_constant()) { intptr_t c = roc.as_constant(); assert(is_simm(c, 16), "too big"); addi(d, s1, (int)c); } else add(d, roc.as_register(), s1); } void Assembler::subf(Register d, RegisterOrConstant roc, Register s1) { if (roc.is_constant()) { intptr_t c = roc.as_constant(); assert(is_simm(-c, 16), "too big"); addi(d, s1, (int)-c); } else subf(d, roc.as_register(), s1); } void Assembler::cmpd(ConditionRegister d, RegisterOrConstant roc, Register s1) { if (roc.is_constant()) { intptr_t c = roc.as_constant(); assert(is_simm(c, 16), "too big"); cmpdi(d, s1, (int)c); } else cmpd(d, roc.as_register(), s1); } // Load a 64 bit constant. Patchable. void Assembler::load_const(Register d, long x, Register tmp) { // 64-bit value: x = xa xb xc xd int xa = (x >> 48) & 0xffff; int xb = (x >> 32) & 0xffff; int xc = (x >> 16) & 0xffff; int xd = (x >> 0) & 0xffff; if (tmp == noreg) { Assembler::lis( d, (int)(short)xa); Assembler::ori( d, d, (unsigned int)xb); Assembler::sldi(d, d, 32); Assembler::oris(d, d, (unsigned int)xc); Assembler::ori( d, d, (unsigned int)xd); } else { // exploit instruction level parallelism if we have a tmp register assert_different_registers(d, tmp); Assembler::lis(tmp, (int)(short)xa); Assembler::lis(d, (int)(short)xc); Assembler::ori(tmp, tmp, (unsigned int)xb); Assembler::ori(d, d, (unsigned int)xd); Assembler::insrdi(d, tmp, 32, 0); } } // Load a 64 bit constant, optimized, not identifyable. // Tmp can be used to increase ILP. Set return_simm16_rest=true to get a // 16 bit immediate offset. int Assembler::load_const_optimized(Register d, long x, Register tmp, bool return_simm16_rest) { // Avoid accidentally trying to use R0 for indexed addressing. assert_different_registers(d, tmp); short xa, xb, xc, xd; // Four 16-bit chunks of const. long rem = x; // Remaining part of const. xd = rem & 0xFFFF; // Lowest 16-bit chunk. rem = (rem >> 16) + ((unsigned short)xd >> 15); // Compensation for sign extend. if (rem == 0) { // opt 1: simm16 li(d, xd); return 0; } int retval = 0; if (return_simm16_rest) { retval = xd; x = rem << 16; xd = 0; } if (d == R0) { // Can't use addi. if (is_simm(x, 32)) { // opt 2: simm32 lis(d, x >> 16); if (xd) ori(d, d, (unsigned short)xd); } else { // 64-bit value: x = xa xb xc xd xa = (x >> 48) & 0xffff; xb = (x >> 32) & 0xffff; xc = (x >> 16) & 0xffff; bool xa_loaded = (xb & 0x8000) ? (xa != -1) : (xa != 0); if (tmp == noreg || (xc == 0 && xd == 0)) { if (xa_loaded) { lis(d, xa); if (xb) { ori(d, d, (unsigned short)xb); } } else { li(d, xb); } sldi(d, d, 32); if (xc) { oris(d, d, (unsigned short)xc); } if (xd) { ori( d, d, (unsigned short)xd); } } else { // Exploit instruction level parallelism if we have a tmp register. bool xc_loaded = (xd & 0x8000) ? (xc != -1) : (xc != 0); if (xa_loaded) { lis(tmp, xa); } if (xc_loaded) { lis(d, xc); } if (xa_loaded) { if (xb) { ori(tmp, tmp, (unsigned short)xb); } } else { li(tmp, xb); } if (xc_loaded) { if (xd) { ori(d, d, (unsigned short)xd); } } else { li(d, xd); } insrdi(d, tmp, 32, 0); } } return retval; } xc = rem & 0xFFFF; // Next 16-bit chunk. rem = (rem >> 16) + ((unsigned short)xc >> 15); // Compensation for sign extend. if (rem == 0) { // opt 2: simm32 lis(d, xc); } else { // High 32 bits needed. if (tmp != noreg && (int)x != 0) { // opt 3: We have a temp reg. // No carry propagation between xc and higher chunks here (use logical instructions). xa = (x >> 48) & 0xffff; xb = (x >> 32) & 0xffff; // No sign compensation, we use lis+ori or li to allow usage of R0. bool xa_loaded = (xb & 0x8000) ? (xa != -1) : (xa != 0); bool return_xd = false; if (xa_loaded) { lis(tmp, xa); } if (xc) { lis(d, xc); } if (xa_loaded) { if (xb) { ori(tmp, tmp, (unsigned short)xb); } // No addi, we support tmp == R0. } else { li(tmp, xb); } if (xc) { if (xd) { addi(d, d, xd); } } else { li(d, xd); } insrdi(d, tmp, 32, 0); return retval; } xb = rem & 0xFFFF; // Next 16-bit chunk. rem = (rem >> 16) + ((unsigned short)xb >> 15); // Compensation for sign extend. xa = rem & 0xFFFF; // Highest 16-bit chunk. // opt 4: avoid adding 0 if (xa) { // Highest 16-bit needed? lis(d, xa); if (xb) { addi(d, d, xb); } } else { li(d, xb); } sldi(d, d, 32); if (xc) { addis(d, d, xc); } } if (xd) { addi(d, d, xd); } return retval; } // We emit only one addition to s to optimize latency. int Assembler::add_const_optimized(Register d, Register s, long x, Register tmp, bool return_simm16_rest) { assert(s != R0 && s != tmp, "unsupported"); long rem = x; // Case 1: Can use mr or addi. short xd = rem & 0xFFFF; // Lowest 16-bit chunk. rem = (rem >> 16) + ((unsigned short)xd >> 15); if (rem == 0) { if (xd == 0) { if (d != s) { mr(d, s); } return 0; } if (return_simm16_rest && (d == s)) { return xd; } addi(d, s, xd); return 0; } // Case 2: Can use addis. if (xd == 0) { short xc = rem & 0xFFFF; // 2nd 16-bit chunk. rem = (rem >> 16) + ((unsigned short)xc >> 15); if (rem == 0) { addis(d, s, xc); return 0; } } // Other cases: load & add. Register tmp1 = tmp, tmp2 = noreg; if ((d != tmp) && (d != s)) { // Can use d. tmp1 = d; tmp2 = tmp; } int simm16_rest = load_const_optimized(tmp1, x, tmp2, return_simm16_rest); add(d, tmp1, s); return simm16_rest; } #ifndef PRODUCT // Test of ppc assembler. void Assembler::test_asm() { // PPC 1, section 3.3.8, Fixed-Point Arithmetic Instructions addi( R0, R1, 10); addis( R5, R2, 11); addic_( R3, R31, 42); subfic( R21, R12, 2112); add( R3, R2, R1); add_( R11, R22, R30); subf( R7, R6, R5); subf_( R8, R9, R4); addc( R11, R12, R13); addc_( R14, R14, R14); subfc( R15, R16, R17); subfc_( R18, R20, R19); adde( R20, R22, R24); adde_( R29, R27, R26); subfe( R28, R1, R0); subfe_( R21, R11, R29); neg( R21, R22); neg_( R13, R23); mulli( R0, R11, -31); mulld( R1, R18, R21); mulld_( R2, R17, R22); mullw( R3, R16, R23); mullw_( R4, R15, R24); divd( R5, R14, R25); divd_( R6, R13, R26); divw( R7, R12, R27); divw_( R8, R11, R28); li( R3, -4711); // PPC 1, section 3.3.9, Fixed-Point Compare Instructions cmpi( CCR7, 0, R27, 4711); cmp( CCR0, 1, R14, R11); cmpli( CCR5, 1, R17, 45); cmpl( CCR3, 0, R9, R10); cmpwi( CCR7, R27, 4711); cmpw( CCR0, R14, R11); cmplwi( CCR5, R17, 45); cmplw( CCR3, R9, R10); cmpdi( CCR7, R27, 4711); cmpd( CCR0, R14, R11); cmpldi( CCR5, R17, 45); cmpld( CCR3, R9, R10); // PPC 1, section 3.3.11, Fixed-Point Logical Instructions andi_( R4, R5, 0xff); andis_( R12, R13, 0x7b51); ori( R1, R4, 13); oris( R3, R5, 177); xori( R7, R6, 51); xoris( R29, R0, 1); andr( R17, R21, R16); and_( R3, R5, R15); orr( R2, R1, R9); or_( R17, R15, R11); xorr( R19, R18, R10); xor_( R31, R21, R11); nand( R5, R7, R3); nand_( R3, R1, R0); nor( R2, R3, R5); nor_( R3, R6, R8); andc( R25, R12, R11); andc_( R24, R22, R21); orc( R20, R10, R12); orc_( R22, R2, R13); nop(); // PPC 1, section 3.3.12, Fixed-Point Rotate and Shift Instructions sld( R5, R6, R8); sld_( R3, R5, R9); slw( R2, R1, R10); slw_( R6, R26, R16); srd( R16, R24, R8); srd_( R21, R14, R7); srw( R22, R25, R29); srw_( R5, R18, R17); srad( R7, R11, R0); srad_( R9, R13, R1); sraw( R7, R15, R2); sraw_( R4, R17, R3); sldi( R3, R18, 63); sldi_( R2, R20, 30); slwi( R1, R21, 30); slwi_( R7, R23, 8); srdi( R0, R19, 2); srdi_( R12, R24, 5); srwi( R13, R27, 6); srwi_( R14, R29, 7); sradi( R15, R30, 9); sradi_( R16, R31, 19); srawi( R17, R31, 15); srawi_( R18, R31, 12); clrrdi( R3, R30, 5); clrldi( R9, R10, 11); rldicr( R19, R20, 13, 15); rldicr_(R20, R20, 16, 14); rldicl( R21, R21, 30, 33); rldicl_(R22, R1, 20, 25); rlwinm( R23, R2, 25, 10, 11); rlwinm_(R24, R3, 12, 13, 14); // PPC 1, section 3.3.2 Fixed-Point Load Instructions lwzx( R3, R5, R7); lwz( R11, 0, R1); lwzu( R31, -4, R11); lwax( R3, R5, R7); lwa( R31, -4, R11); lhzx( R3, R5, R7); lhz( R31, -4, R11); lhzu( R31, -4, R11); lhax( R3, R5, R7); lha( R31, -4, R11); lhau( R11, 0, R1); lbzx( R3, R5, R7); lbz( R31, -4, R11); lbzu( R11, 0, R1); ld( R31, -4, R11); ldx( R3, R5, R7); ldu( R31, -4, R11); // PPC 1, section 3.3.3 Fixed-Point Store Instructions stwx( R3, R5, R7); stw( R31, -4, R11); stwu( R11, 0, R1); sthx( R3, R5, R7 ); sth( R31, -4, R11); sthu( R31, -4, R11); stbx( R3, R5, R7); stb( R31, -4, R11); stbu( R31, -4, R11); std( R31, -4, R11); stdx( R3, R5, R7); stdu( R31, -4, R11); // PPC 1, section 3.3.13 Move To/From System Register Instructions mtlr( R3); mflr( R3); mtctr( R3); mfctr( R3); mtcrf( 0xff, R15); mtcr( R15); mtcrf( 0x03, R15); mtcr( R15); mfcr( R15); // PPC 1, section 2.4.1 Branch Instructions Label lbl1, lbl2, lbl3; bind(lbl1); b(pc()); b(pc() - 8); b(lbl1); b(lbl2); b(lbl3); bl(pc() - 8); bl(lbl1); bl(lbl2); bcl(4, 10, pc() - 8); bcl(4, 10, lbl1); bcl(4, 10, lbl2); bclr( 4, 6, 0); bclrl(4, 6, 0); bind(lbl2); bcctr( 4, 6, 0); bcctrl(4, 6, 0); blt(CCR0, lbl2); bgt(CCR1, lbl2); beq(CCR2, lbl2); bso(CCR3, lbl2); bge(CCR4, lbl2); ble(CCR5, lbl2); bne(CCR6, lbl2); bns(CCR7, lbl2); bltl(CCR0, lbl2); bgtl(CCR1, lbl2); beql(CCR2, lbl2); bsol(CCR3, lbl2); bgel(CCR4, lbl2); blel(CCR5, lbl2); bnel(CCR6, lbl2); bnsl(CCR7, lbl2); blr(); sync(); icbi( R1, R2); dcbst(R2, R3); // FLOATING POINT instructions ppc. // PPC 1, section 4.6.2 Floating-Point Load Instructions lfs( F1, -11, R3); lfsu(F2, 123, R4); lfsx(F3, R5, R6); lfd( F4, 456, R7); lfdu(F5, 789, R8); lfdx(F6, R10, R11); // PPC 1, section 4.6.3 Floating-Point Store Instructions stfs( F7, 876, R12); stfsu( F8, 543, R13); stfsx( F9, R14, R15); stfd( F10, 210, R16); stfdu( F11, 111, R17); stfdx( F12, R18, R19); // PPC 1, section 4.6.4 Floating-Point Move Instructions fmr( F13, F14); fmr_( F14, F15); fneg( F16, F17); fneg_( F18, F19); fabs( F20, F21); fabs_( F22, F23); fnabs( F24, F25); fnabs_(F26, F27); // PPC 1, section 4.6.5.1 Floating-Point Elementary Arithmetic // Instructions fadd( F28, F29, F30); fadd_( F31, F0, F1); fadds( F2, F3, F4); fadds_(F5, F6, F7); fsub( F8, F9, F10); fsub_( F11, F12, F13); fsubs( F14, F15, F16); fsubs_(F17, F18, F19); fmul( F20, F21, F22); fmul_( F23, F24, F25); fmuls( F26, F27, F28); fmuls_(F29, F30, F31); fdiv( F0, F1, F2); fdiv_( F3, F4, F5); fdivs( F6, F7, F8); fdivs_(F9, F10, F11); // PPC 1, section 4.6.6 Floating-Point Rounding and Conversion // Instructions frsp( F12, F13); fctid( F14, F15); fctidz(F16, F17); fctiw( F18, F19); fctiwz(F20, F21); fcfid( F22, F23); // PPC 1, section 4.6.7 Floating-Point Compare Instructions fcmpu( CCR7, F24, F25); tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", p2i(code()->insts_begin()), p2i(code()->insts_end())); code()->decode(); } #endif // !PRODUCT
/** * MaNGOS is a full featured server for World of Warcraft, supporting * the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8 * * Copyright (C) 2005-2016 MaNGOS project <https://getmangos.eu> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * World of Warcraft, and all World of Warcraft or Warcraft art, images, * and lore are copyrighted by Blizzard Entertainment, Inc. */ #include "GossipDef.h" #include "QuestDef.h" #include "ObjectMgr.h" #include "Opcodes.h" #include "WorldPacket.h" #include "WorldSession.h" #include "Formulas.h" GossipMenu::GossipMenu(WorldSession* session) : m_session(session) { m_gItems.reserve(16); // can be set for max from most often sizes to speedup push_back and less memory use m_gMenuId = 0; } GossipMenu::~GossipMenu() { ClearMenu(); } void GossipMenu::AddMenuItem(uint8 Icon, const std::string& Message, uint32 dtSender, uint32 dtAction, const std::string& BoxMessage, uint32 BoxMoney, bool Coded) { MANGOS_ASSERT(m_gItems.size() <= GOSSIP_MAX_MENU_ITEMS); GossipMenuItem gItem; gItem.m_gIcon = Icon; gItem.m_gMessage = Message; gItem.m_gCoded = Coded; gItem.m_gSender = dtSender; gItem.m_gOptionId = dtAction; gItem.m_gBoxMessage = BoxMessage; gItem.m_gBoxMoney = BoxMoney; m_gItems.push_back(gItem); } void GossipMenu::AddGossipMenuItemData(int32 action_menu, uint32 action_poi, uint32 action_script) { GossipMenuItemData pItemData; pItemData.m_gAction_menu = action_menu; pItemData.m_gAction_poi = action_poi; pItemData.m_gAction_script = action_script; m_gItemsData.push_back(pItemData); } void GossipMenu::AddMenuItem(uint8 Icon, const std::string& Message, bool Coded) { AddMenuItem(Icon, Message, 0, 0, "", 0, Coded); } void GossipMenu::AddMenuItem(uint8 Icon, char const* Message, bool Coded) { AddMenuItem(Icon, std::string(Message ? Message : ""), Coded); } void GossipMenu::AddMenuItem(uint8 Icon, char const* Message, uint32 dtSender, uint32 dtAction, char const* BoxMessage, uint32 BoxMoney, bool Coded) { AddMenuItem(Icon, std::string(Message ? Message : ""), dtSender, dtAction, std::string(BoxMessage ? BoxMessage : ""), BoxMoney, Coded); } void GossipMenu::AddMenuItem(uint8 Icon, int32 itemText, uint32 dtSender, uint32 dtAction, int32 boxText, uint32 BoxMoney, bool Coded) { uint32 loc_idx = m_session->GetSessionDbLocaleIndex(); char const* item_text = itemText ? sObjectMgr.GetMangosString(itemText, loc_idx) : ""; char const* box_text = boxText ? sObjectMgr.GetMangosString(boxText, loc_idx) : ""; AddMenuItem(Icon, std::string(item_text), dtSender, dtAction, std::string(box_text), BoxMoney, Coded); } uint32 GossipMenu::MenuItemSender(unsigned int ItemId) { if (ItemId >= m_gItems.size()) { return 0; } return m_gItems[ ItemId ].m_gSender; } uint32 GossipMenu::MenuItemAction(unsigned int ItemId) { if (ItemId >= m_gItems.size()) { return 0; } return m_gItems[ ItemId ].m_gOptionId; } bool GossipMenu::MenuItemCoded(unsigned int ItemId) { if (ItemId >= m_gItems.size()) { return 0; } return m_gItems[ ItemId ].m_gCoded; } void GossipMenu::ClearMenu() { m_gItems.clear(); m_gItemsData.clear(); m_gMenuId = 0; } PlayerMenu::PlayerMenu(WorldSession* session) : mGossipMenu(session) { } PlayerMenu::~PlayerMenu() { ClearMenus(); } void PlayerMenu::ClearMenus() { mGossipMenu.ClearMenu(); mQuestMenu.ClearMenu(); } uint32 PlayerMenu::GossipOptionSender(unsigned int Selection) { return mGossipMenu.MenuItemSender(Selection); } uint32 PlayerMenu::GossipOptionAction(unsigned int Selection) { return mGossipMenu.MenuItemAction(Selection); } bool PlayerMenu::GossipOptionCoded(unsigned int Selection) { return mGossipMenu.MenuItemCoded(Selection); } void PlayerMenu::SendGossipMenu(uint32 TitleTextId, ObjectGuid objectGuid) { WorldPacket data(SMSG_GOSSIP_MESSAGE, (100)); // guess size data << ObjectGuid(objectGuid); data << uint32(mGossipMenu.GetMenuId()); // new 2.4.0 data << uint32(TitleTextId); data << uint32(mGossipMenu.MenuItemCount()); // max count 0x20 for (uint32 iI = 0; iI < mGossipMenu.MenuItemCount(); ++iI) { GossipMenuItem const& gItem = mGossipMenu.GetItem(iI); data << uint32(iI); data << uint8(gItem.m_gIcon); data << uint8(gItem.m_gCoded); // makes pop up box password data << uint32(gItem.m_gBoxMoney); // money required to open menu, 2.0.3 data << gItem.m_gMessage; // text for gossip item, max 0x800 data << gItem.m_gBoxMessage; // accept text (related to money) pop up box, 2.0.3, max 0x800 } data << uint32(mQuestMenu.MenuItemCount()); // max count 0x20 for (uint32 iI = 0; iI < mQuestMenu.MenuItemCount(); ++iI) { QuestMenuItem const& qItem = mQuestMenu.GetItem(iI); uint32 questID = qItem.m_qId; Quest const* pQuest = sObjectMgr.GetQuestTemplate(questID); data << uint32(questID); data << uint32(qItem.m_qIcon); data << int32(pQuest->GetQuestLevel()); int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex(); std::string title = pQuest->GetTitle(); sObjectMgr.GetQuestLocaleStrings(questID, loc_idx, &title); data << title; // max 0x200 } GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_MESSAGE from %s", objectGuid.GetString().c_str()); } void PlayerMenu::CloseGossip() { WorldPacket data(SMSG_GOSSIP_COMPLETE, 0); GetMenuSession()->SendPacket(&data); // DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_COMPLETE"); } // Outdated void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, char const* locName) { WorldPacket data(SMSG_GOSSIP_POI, (4 + 4 + 4 + 4 + 4 + 10)); // guess size data << uint32(Flags); data << float(X); data << float(Y); data << uint32(Icon); data << uint32(Data); data << locName; GetMenuSession()->SendPacket(&data); // DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI"); } void PlayerMenu::SendPointOfInterest(uint32 poi_id) { PointOfInterest const* poi = sObjectMgr.GetPointOfInterest(poi_id); if (!poi) { sLog.outErrorDb("Requested send nonexistent POI (Id: %u), ignore.", poi_id); return; } std::string icon_name = poi->icon_name; int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex(); if (loc_idx >= 0) if (PointOfInterestLocale const* pl = sObjectMgr.GetPointOfInterestLocale(poi_id)) if (pl->IconName.size() > size_t(loc_idx) && !pl->IconName[loc_idx].empty()) { icon_name = pl->IconName[loc_idx]; } WorldPacket data(SMSG_GOSSIP_POI, (4 + 4 + 4 + 4 + 4 + 10)); // guess size data << uint32(poi->flags); data << float(poi->x); data << float(poi->y); data << uint32(poi->icon); data << uint32(poi->data); data << icon_name; GetMenuSession()->SendPacket(&data); // DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI"); } void PlayerMenu::SendTalking(uint32 textID) { GossipText const* pGossip = sObjectMgr.GetGossipText(textID); WorldPacket data(SMSG_NPC_TEXT_UPDATE, 100); // guess size data << textID; // can be < 0 if (!pGossip) { for (uint32 i = 0; i < 8; ++i) { data << float(0); data << "Greetings $N"; data << "Greetings $N"; data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(0); } } else { std::string Text_0[MAX_GOSSIP_TEXT_OPTIONS], Text_1[MAX_GOSSIP_TEXT_OPTIONS]; for (int i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i) { Text_0[i] = pGossip->Options[i].Text_0; Text_1[i] = pGossip->Options[i].Text_1; } int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex(); sObjectMgr.GetNpcTextLocaleStringsAll(textID, loc_idx, &Text_0, &Text_1); for (int i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i) { data << pGossip->Options[i].Probability; if (Text_0[i].empty()) { data << Text_1[i]; } else { data << Text_0[i]; } if (Text_1[i].empty()) { data << Text_0[i]; } else { data << Text_1[i]; } data << pGossip->Options[i].Language; for (int j = 0; j < 3; ++j) { data << pGossip->Options[i].Emotes[j]._Delay; data << pGossip->Options[i].Emotes[j]._Emote; } } } GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_NPC_TEXT_UPDATE "); } void PlayerMenu::SendTalking(char const* title, char const* text) { WorldPacket data(SMSG_NPC_TEXT_UPDATE, 50); // guess size data << uint32(0); for (uint32 i = 0; i < 8; ++i) { data << float(0); data << title; data << text; data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(0); } GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_NPC_TEXT_UPDATE "); } /*********************************************************/ /*** QUEST SYSTEM ***/ /*********************************************************/ QuestMenu::QuestMenu() { m_qItems.reserve(16); // can be set for max from most often sizes to speedup push_back and less memory use } QuestMenu::~QuestMenu() { ClearMenu(); } void QuestMenu::AddMenuItem(uint32 QuestId, uint8 Icon) { Quest const* qinfo = sObjectMgr.GetQuestTemplate(QuestId); if (!qinfo) { return; } MANGOS_ASSERT(m_qItems.size() <= GOSSIP_MAX_MENU_ITEMS); QuestMenuItem qItem; qItem.m_qId = QuestId; qItem.m_qIcon = Icon; m_qItems.push_back(qItem); } bool QuestMenu::HasItem(uint32 questid) { for (QuestMenuItemList::const_iterator i = m_qItems.begin(); i != m_qItems.end(); ++i) if (i->m_qId == questid) { return true; } return false; } void QuestMenu::ClearMenu() { m_qItems.clear(); } void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, ObjectGuid npcGUID) { WorldPacket data(SMSG_QUESTGIVER_QUEST_LIST, 100); // guess size data << ObjectGuid(npcGUID); data << Title; data << uint32(eEmote._Delay); // player emote data << uint32(eEmote._Emote); // NPC emote size_t count_pos = data.wpos(); data << uint8(mQuestMenu.MenuItemCount()); uint32 count = 0; for (; count < mQuestMenu.MenuItemCount(); ++count) { QuestMenuItem const& qmi = mQuestMenu.GetItem(count); uint32 questID = qmi.m_qId; if (Quest const* pQuest = sObjectMgr.GetQuestTemplate(questID)) { int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex(); std::string title = pQuest->GetTitle(); sObjectMgr.GetQuestLocaleStrings(questID, loc_idx, &title); data << uint32(questID); data << uint32(qmi.m_qIcon); data << uint32(pQuest->GetQuestLevel()); data << title; } } data.put<uint8>(count_pos, count); GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid = %s", npcGUID.GetString().c_str()); } void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, ObjectGuid npcGUID) { WorldPacket data(SMSG_QUESTGIVER_STATUS, 9); data << npcGUID; data << uint8(questStatus); GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_STATUS for %s", npcGUID.GetString().c_str()); } void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid, bool ActivateAccept) { std::string Title = pQuest->GetTitle(); std::string Details = pQuest->GetDetails(); std::string Objectives = pQuest->GetObjectives(); int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { if (QuestLocale const* ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) { if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty()) { Title = ql->Title[loc_idx]; } if (ql->Details.size() > (size_t)loc_idx && !ql->Details[loc_idx].empty()) { Details = ql->Details[loc_idx]; } if (ql->Objectives.size() > (size_t)loc_idx && !ql->Objectives[loc_idx].empty()) { Objectives = ql->Objectives[loc_idx]; } } } WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, 100); // guess size data << guid; data << uint32(pQuest->GetQuestId()); data << Title; data << Details; data << Objectives; data << uint32(ActivateAccept ? 1 : 0); // auto finish data << uint32(pQuest->GetSuggestedPlayers()); if (pQuest->HasQuestFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { data << uint32(0); // Rewarded chosen items hidden data << uint32(0); // Rewarded items hidden data << uint32(0); // Rewarded money hidden } else { ItemPrototype const* IProto; data << uint32(pQuest->GetRewChoiceItemsCount()); for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) { if (!pQuest->RewChoiceItemId[i]) continue; data << uint32(pQuest->RewChoiceItemId[i]); data << uint32(pQuest->RewChoiceItemCount[i]); IProto = ObjectMgr::GetItemPrototype(pQuest->RewChoiceItemId[i]); if (IProto) { data << uint32(IProto->DisplayInfoID); } else { data << uint32(0x00); } } data << uint32(pQuest->GetRewItemsCount()); for (uint32 i = 0; i < QUEST_REWARDS_COUNT; ++i) { if (!pQuest->RewItemId[i]) continue; data << uint32(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemCount[i]); IProto = ObjectMgr::GetItemPrototype(pQuest->RewItemId[i]); if (IProto) { data << uint32(IProto->DisplayInfoID); } else { data << uint32(0x00); } } data << uint32(pQuest->GetRewOrReqMoney()); } // rewarded honor points. Multiply with 10 to satisfy client data << uint32(10 * MaNGOS::Honor::hk_honor_at_level(GetMenuSession()->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0) data << uint32(pQuest->GetRewSpellCast()); // casted spell data << uint32(pQuest->GetCharTitleBitIndex()); // CharTitle, new 2.4.0, player gets this title (bit index from CharTitles) data << uint32(QUEST_EMOTE_COUNT); for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i) { data << uint32(pQuest->DetailsEmote[i]); data << uint32(pQuest->DetailsEmoteDelay[i]); // DetailsEmoteDelay (in ms) } GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS - for %s of %s, questid = %u", GetMenuSession()->GetPlayer()->GetGuidStr().c_str(), guid.GetString().c_str(), pQuest->GetQuestId()); } // send only static data in this packet! void PlayerMenu::SendQuestQueryResponse(Quest const* pQuest) { std::string Title, Details, Objectives, EndText; std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; Title = pQuest->GetTitle(); Details = pQuest->GetDetails(); Objectives = pQuest->GetObjectives(); EndText = pQuest->GetEndText(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) { ObjectiveText[i] = pQuest->ObjectiveText[i]; } int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { if (QuestLocale const* ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) { if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty()) { Title = ql->Title[loc_idx]; } if (ql->Details.size() > (size_t)loc_idx && !ql->Details[loc_idx].empty()) { Details = ql->Details[loc_idx]; } if (ql->Objectives.size() > (size_t)loc_idx && !ql->Objectives[loc_idx].empty()) { Objectives = ql->Objectives[loc_idx]; } if (ql->EndText.size() > (size_t)loc_idx && !ql->EndText[loc_idx].empty()) { EndText = ql->EndText[loc_idx]; } for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) if (ql->ObjectiveText[i].size() > (size_t)loc_idx && !ql->ObjectiveText[i][loc_idx].empty()) { ObjectiveText[i] = ql->ObjectiveText[i][loc_idx]; } } } WorldPacket data(SMSG_QUEST_QUERY_RESPONSE, 100); // guess size data << uint32(pQuest->GetQuestId()); // quest id data << uint32(pQuest->GetQuestMethod()); // Accepted values: 0, 1 or 2. 0==IsAutoComplete() (skip objectives/details) data << uint32(pQuest->GetQuestLevel()); // may be -1, static data, in other cases must be used dynamic level: Player::GetQuestLevelForPlayer (0 is not known, but assuming this is no longer valid for quest intended for client) data << uint32(pQuest->GetZoneOrSort()); // zone or sort to display in quest log data << uint32(pQuest->GetType()); // quest type data << uint32(pQuest->GetSuggestedPlayers()); // suggested players count data << uint32(pQuest->GetRepObjectiveFaction()); // shown in quest log as part of quest objective data << uint32(pQuest->GetRepObjectiveValue()); // shown in quest log as part of quest objective data << uint32(0); // RequiredOpositeRepFaction data << uint32(0); // RequiredOpositeRepValue, required faction value with another (oposite) faction (objective) data << uint32(pQuest->GetNextQuestInChain()); // client will request this quest from NPC, if not 0 if (pQuest->HasQuestFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { data << uint32(0); } // Hide money rewarded else { data << uint32(pQuest->GetRewOrReqMoney()); } // reward money (below max lvl) data << uint32(pQuest->GetRewMoneyMaxLevel()); // used in XP calculation at client data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0) data << uint32(pQuest->GetRewSpellCast()); // casted spell // rewarded honor points data << uint32(MaNGOS::Honor::hk_honor_at_level(GetMenuSession()->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); data << uint32(pQuest->GetSrcItemId()); // source item id data << uint32(pQuest->GetQuestFlags()); // quest flags data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) int iI; if (pQuest->HasQuestFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { for (iI = 0; iI < QUEST_REWARDS_COUNT; ++iI) { data << uint32(0) << uint32(0); } for (iI = 0; iI < QUEST_REWARD_CHOICES_COUNT; ++iI) { data << uint32(0) << uint32(0); } } else { for (iI = 0; iI < QUEST_REWARDS_COUNT; ++iI) { data << uint32(pQuest->RewItemId[iI]); data << uint32(pQuest->RewItemCount[iI]); } for (iI = 0; iI < QUEST_REWARD_CHOICES_COUNT; ++iI) { data << uint32(pQuest->RewChoiceItemId[iI]); data << uint32(pQuest->RewChoiceItemCount[iI]); } } data << pQuest->GetPointMapId(); data << pQuest->GetPointX(); data << pQuest->GetPointY(); data << pQuest->GetPointOpt(); data << Title; data << Objectives; data << Details; data << EndText; for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI) { if (pQuest->ReqCreatureOrGOId[iI] < 0) { // client expected gameobject template id in form (id|0x80000000) data << uint32((pQuest->ReqCreatureOrGOId[iI] * (-1)) | 0x80000000); } else { data << uint32(pQuest->ReqCreatureOrGOId[iI]); } data << uint32(pQuest->ReqCreatureOrGOCount[iI]); data << uint32(pQuest->ReqItemId[iI]); data << uint32(pQuest->ReqItemCount[iI]); } for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI) { data << ObjectiveText[iI]; } GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", pQuest->GetQuestId()); } void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, ObjectGuid npcGUID, bool EnableNext) { std::string Title = pQuest->GetTitle(); std::string OfferRewardText = pQuest->GetOfferRewardText(); int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { if (QuestLocale const* ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) { if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty()) { Title = ql->Title[loc_idx]; } if (ql->OfferRewardText.size() > (size_t)loc_idx && !ql->OfferRewardText[loc_idx].empty()) { OfferRewardText = ql->OfferRewardText[loc_idx]; } } } WorldPacket data(SMSG_QUESTGIVER_OFFER_REWARD, 50); // guess size data << ObjectGuid(npcGUID); data << uint32(pQuest->GetQuestId()); data << Title; data << OfferRewardText; data << uint32(EnableNext ? 1 : 0); // Auto Finish data << uint32(pQuest->GetSuggestedPlayers()); // SuggestedGroupNum uint32 EmoteCount = 0; for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i) { if (pQuest->OfferRewardEmote[i] <= 0) { break; } ++EmoteCount; } data << EmoteCount; // Emote Count for (uint32 i = 0; i < EmoteCount; ++i) { data << uint32(pQuest->OfferRewardEmoteDelay[i]); // Delay Emote data << uint32(pQuest->OfferRewardEmote[i]); } ItemPrototype const* pItem; data << uint32(pQuest->GetRewChoiceItemsCount()); for (uint32 i = 0; i < pQuest->GetRewChoiceItemsCount(); ++i) { pItem = ObjectMgr::GetItemPrototype(pQuest->RewChoiceItemId[i]); data << uint32(pQuest->RewChoiceItemId[i]); data << uint32(pQuest->RewChoiceItemCount[i]); if (pItem) { data << uint32(pItem->DisplayInfoID); } else { data << uint32(0x00); } } data << uint32(pQuest->GetRewItemsCount()); for (uint32 i = 0; i < pQuest->GetRewItemsCount(); ++i) { pItem = ObjectMgr::GetItemPrototype(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemCount[i]); if (pItem) { data << uint32(pItem->DisplayInfoID); } else { data << uint32(0x00); } } data << uint32(pQuest->GetRewOrReqMoney()); // rewarded honor points. Multiply with 10 to satisfy client data << uint32(10 * MaNGOS::Honor::hk_honor_at_level(GetMenuSession()->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); data << uint32(0x08); // unused by client? data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0) data << uint32(pQuest->GetRewSpellCast()); // casted spell data << uint32(pQuest->GetCharTitleBitIndex()); // character title GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid = %s, questid = %u", npcGUID.GetString().c_str(), pQuest->GetQuestId()); } void PlayerMenu::SendQuestGiverRequestItems(Quest const* pQuest, ObjectGuid npcGUID, bool Completable, bool CloseOnCancel) { // We can always call to RequestItems, but this packet only goes out if there are actually // items. Otherwise, we'll skip straight to the OfferReward std::string Title = pQuest->GetTitle(); std::string RequestItemsText = pQuest->GetRequestItemsText(); int loc_idx = GetMenuSession()->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { if (QuestLocale const* ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) { if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty()) { Title = ql->Title[loc_idx]; } if (ql->RequestItemsText.size() > (size_t)loc_idx && !ql->RequestItemsText[loc_idx].empty()) { RequestItemsText = ql->RequestItemsText[loc_idx]; } } } // We may wish a better check, perhaps checking the real quest requirements if (RequestItemsText.empty()) { SendQuestGiverOfferReward(pQuest, npcGUID, true); return; } WorldPacket data(SMSG_QUESTGIVER_REQUEST_ITEMS, 50); // guess size data << ObjectGuid(npcGUID); data << uint32(pQuest->GetQuestId()); data << Title; data << RequestItemsText; data << uint32(0x00); // emote delay if (Completable) { data << pQuest->GetCompleteEmote(); } // emote id else { data << pQuest->GetIncompleteEmote(); } // Close Window after cancel if (CloseOnCancel) { data << uint32(0x01); } // auto finish else { data << uint32(0x00); } data << uint32(pQuest->GetSuggestedPlayers()); // SuggestedGroupNum // Required Money data << uint32(pQuest->GetRewOrReqMoney() < 0 ? -pQuest->GetRewOrReqMoney() : 0); data << uint32(pQuest->GetReqItemsCount()); ItemPrototype const* pItem; for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { if (!pQuest->ReqItemId[i]) { continue; } pItem = ObjectMgr::GetItemPrototype(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemId[i]); data << uint32(pQuest->ReqItemCount[i]); if (pItem) { data << uint32(pItem->DisplayInfoID); } else { data << uint32(0); } } if (!Completable) // Completable = flags1 && flags2 && flags3 && flags4 { data << uint32(0x00); } // flags1 else { data << uint32(0x03); } data << uint32(0x04); // flags2 data << uint32(0x08); // flags3 data << uint32(0x10); // flags4 GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid = %s, questid = %u", npcGUID.GetString().c_str(), pQuest->GetQuestId()); }
#include "chanspreadsheet.h" #include <QtWidgets/QApplication> #include <qsplashscreen.h> int main(int argc, char* argv[]) { QApplication a(argc, argv); QSplashScreen* splash = new QSplashScreen; splash->setPixmap(QPixmap(srcFileName::pSplash)); splash->show(); splash->showMessage(QObject::tr("loading resource"), Qt::AlignLeft | Qt::AlignBottom, Qt::blue); splash->showMessage(QObject::tr("Chan Spreadsheet has been loaded"), Qt::AlignLeft | Qt::AlignBottom, Qt::blue); ChanSpreadsheet w; w.show(); splash->finish(&w); delete splash; return a.exec(); }
// 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 "extensions/browser/test_extension_registry_observer.h" #include "content/public/test/test_utils.h" #include "extensions/browser/extension_registry.h" namespace extensions { class TestExtensionRegistryObserver::Waiter { public: Waiter(const std::string& extension_id) : observed_(false), runner_(NULL) {} void Wait() { if (observed_) return; runner_ = new content::MessageLoopRunner(); runner_->Run(); } void OnObserved() { observed_ = true; if (runner_) { runner_->Quit(); runner_ = NULL; } } private: bool observed_; scoped_refptr<content::MessageLoopRunner> runner_; DISALLOW_COPY_AND_ASSIGN(Waiter); }; TestExtensionRegistryObserver::TestExtensionRegistryObserver( ExtensionRegistry* registry, const std::string& extension_id) : will_be_installed_waiter_(new Waiter(extension_id)), uninstalled_waiter_(new Waiter(extension_id)), loaded_waiter_(new Waiter(extension_id)), unloaded_waiter_(new Waiter(extension_id)), extension_registry_observer_(this), extension_id_(extension_id) { extension_registry_observer_.Add(registry); } TestExtensionRegistryObserver::~TestExtensionRegistryObserver() { } void TestExtensionRegistryObserver::WaitForExtensionUninstalled() { uninstalled_waiter_->Wait(); } void TestExtensionRegistryObserver::WaitForExtensionWillBeInstalled() { will_be_installed_waiter_->Wait(); } void TestExtensionRegistryObserver::WaitForExtensionLoaded() { loaded_waiter_->Wait(); } void TestExtensionRegistryObserver::WaitForExtensionUnloaded() { unloaded_waiter_->Wait(); } void TestExtensionRegistryObserver::OnExtensionWillBeInstalled( content::BrowserContext* browser_context, const Extension* extension, bool is_update, bool from_ephemeral, const std::string& old_name) { if (extension->id() == extension_id_) will_be_installed_waiter_->OnObserved(); } void TestExtensionRegistryObserver::OnExtensionUninstalled( content::BrowserContext* browser_context, const Extension* extension, extensions::UninstallReason reason) { if (extension->id() == extension_id_) uninstalled_waiter_->OnObserved(); } void TestExtensionRegistryObserver::OnExtensionLoaded( content::BrowserContext* browser_context, const Extension* extension) { if (extension->id() == extension_id_) loaded_waiter_->OnObserved(); } void TestExtensionRegistryObserver::OnExtensionUnloaded( content::BrowserContext* browser_context, const Extension* extension, UnloadedExtensionInfo::Reason reason) { if (extension->id() == extension_id_) unloaded_waiter_->OnObserved(); } } // namespace extensions
 #include <LuminoPlatform/PlatformWindow.hpp> #include <Workspace.hpp> #include "../Project/Project.hpp" #include "../Project/AssetDatabase.hpp" #include "../App/Application.hpp" #include "../App/MainWindow.hpp" #include "../App/DocumentManager.hpp" #include "AssetBrowserNavigator.hpp" #include "LevelEditor.hpp" // TODO: namespace lna { //============================================================================== // AssetBrowserTreeViewModel bool AssetBrowserTreeViewModel::onTestFilter(const ln::Path& path) { return ln::FileSystem::existsDirectory(path); } #if 0 //============================================================================== // AssetBrowserTreeView void AssetBrowserTreeView::init(AssetBrowserNavigatorExtension* owner) { UITreeView::init(); m_owner = owner; m_model = ln::makeObject<AssetBrowserTreeViewModel>(); //m_model->setExcludeFilters(ln::makeList<ln::String>({_TT("*.lnasset"})); setViewModel(m_model); } void AssetBrowserTreeView::setPath(const ln::Path & path) { m_model->setRootPath(path); } Ref<ln::UITreeItem> AssetBrowserTreeView::onRenderItem(ln::UICollectionItemViewModel* viewModel) { return UITreeView::onRenderItem(viewModel); //auto item = UITreeView::onRenderItem(viewModel); //auto project = lna::Workspace::instance()->project(); //if (project->assetDatabase()->isImportedAssetFile(m_model->filePath(viewModel))) { //} //else { // item->setTextColor(ln::Color::Gray); //} //return item; } void AssetBrowserTreeView::onItemClick(ln::UITreeItem* item, ln::UIMouseEventArgs* e) { UITreeView::onItemClick(item, e); auto path = m_model->filePath(static_cast<ln::UICollectionItemViewModel*>(item->m_viewModel.get())); m_owner->setAssetListPathFromTreeClick(path); #if 0 if (e->getClickCount() == 2) { auto path = m_model->filePath(static_cast<ln::UICollectionItemModel*>(item->m_viewModel.get())); auto project = lna::Workspace::instance()->project(); if (project->assetDatabase()->isImportedAssetFile(path)) { EditorApplication::instance()->openAssetFile(path); } else { EditorApplication::instance()->importFile(path); } } #endif } //============================================================================== // AssetBrowserListViewModel bool AssetBrowserListViewModel::onTestFilter(const ln::Path& path) { // ignore folder and other files return lna::AssetDatabase::isAssetFile(path); } //============================================================================== // AssetBrowserListView void AssetBrowserListView::init(AssetBrowserNavigatorExtension* owner) { UIListView::init(); m_owner = owner; auto project = lna::Workspace::instance()->mainProject(); m_model = ln::makeObject<AssetBrowserListViewModel>(); setViewModel(m_model); } void AssetBrowserListView::setPath(const ln::Path& path) { m_model->setRootPath(path); m_path = path; } //============================================================================== // AssetBrowserNavigatorExtension void AssetBrowserNavigatorExtension::init() { Object::init(); m_navbarItemContent = ln::makeObject<ln::NavigationMenuItem>(); m_navbarItemContent->setIconName(_TT("file"); m_splitter = ln::makeObject<ln::UISplitter>(); m_splitter->setOrientation(ln::UILayoutOrientation::Vertical); m_splitter->setCellDefinition(0, ln::UILayoutLengthType::Ratio, 1); m_splitter->setCellDefinition(1, ln::UILayoutLengthType::Ratio, 1); m_treeView = ln::makeObject<AssetBrowserTreeView>(this); m_treeView->setBackgroundColor(ln::UIColors::get(ln::UIColorHues::Grey, 2)); m_treeView->getGridLayoutInfo()->layoutRow = 0; m_splitter->addElement(m_treeView); m_layout2 = ln::makeObject<ln::UIVBoxLayout2>(); m_layout2->getGridLayoutInfo()->layoutRow = 1; m_splitter->addElement(m_layout2); m_importButton = ln::makeObject<ln::UIButton>(); m_importButton->setText(_TT("Import"); m_importButton->connectOnClicked(ln::bind(this, &AssetBrowserNavigatorExtension::onImport)); m_layout2->addChild(m_importButton); m_listView = ln::makeObject<AssetBrowserListView>(this); m_listView->setBackgroundColor(ln::UIColors::get(ln::UIColorHues::Grey, 3)); m_treeView->getGridLayoutInfo()->layoutWeight = 1; m_layout2->addChild(m_listView); auto project = lna::Workspace::instance()->mainProject(); m_treeView->setPath(project->assetsDir()); m_listView->setPath(project->assetsDir()); } void AssetBrowserNavigatorExtension::setAssetListPathFromTreeClick(const ln::Path& path) { m_listView->setPath(path); } void AssetBrowserNavigatorExtension::onAttached() { } void AssetBrowserNavigatorExtension::onDetached() { } ln::NavigationMenuItem* AssetBrowserNavigatorExtension::getNavigationMenuItem() { return m_navbarItemContent; } ln::UIElement* AssetBrowserNavigatorExtension::getNavigationPane() { return m_splitter; } void AssetBrowserNavigatorExtension::onImport() { auto dlg = ln::PlatformOpenFileDialog::create(); if (dlg->showDialog(EditorApplication::instance()->mainWindow()->platformWindow())) { auto src = dlg->getPath(); auto dst = ln::Path(m_listView->path(), src.fileName()); EditorApplication::instance()->workspace()->mainAssetDatabase()->importAsset(src, dst); m_listView->model()->refresh(); } } // ////============================================================================== //// AssetBrowserNavigator // //ln::UIElement* AssetBrowserNavigator::createNavigationBarItem() //{ // m_navbarItem = ln::makeObject<ln::UIIcon>(); // m_navbarItem->setIconName(_TT("file"); // return m_navbarItem; //} // //ln::UIElement* AssetBrowserNavigator::createView() //{ // // // m_treeView = ln::makeObject<AssetBrowserTreeView>(); // m_treeView->setWidth(200); // m_treeView->setBackgroundColor(ln::UIColors::get(ln::UIColorHues::Grey, 2)); // m_treeView->getGridLayoutInfo()->layoutRow = 0; // // return m_treeView; //} #endif //============================================================================== // AssetBrowserPane bool AssetBrowserPane::init(lna::EditorContext* context) { if (!NavigatorContentPane::init()) return false; Project* project = context->mainProject(); DocumentManager* documentManager = context->documentManager(); auto mainLauout = ln::makeObject<ln::UIGridLayout>(); mainLauout->setColumnCount(4); addChild(mainLauout); auto model1 = ln::makeObject<ln::UIFileSystemCollectionModel>(); model1->setRootPath(project->assetsDir()); auto treeview1 = ln::makeObject<ln::UITreeView2>(); treeview1->connectOnChecked([model1](ln::UIEventArgs* e) { auto* item = static_cast<ln::UITreeItem2*>(e->sender()); auto path = model1->filePath(ln::static_pointer_cast<ln::UICollectionItemViewModel>(item->m_viewModel)); EditorApplication::instance()->openAssetFile(path); }); treeview1->setGenerateTreeItemHandler([documentManager, model1](ln::UITreeItem2* item) { // TODO: とりいそぎ LevelEditor に追加したい臨時ボタン auto button = ln::UIButton::create(_TT(">")); button->setAlignments(ln::UIHAlignment::Right, ln::UIVAlignment::Center); button->setMargin(1); item->addChild(button); button->connectOnClicked([documentManager, model1, item]() { if (auto d = dynamic_cast<LevelEditor*>(documentManager->activeDocument()->editor().get())) { auto path = model1->filePath(ln::static_pointer_cast<ln::UICollectionItemViewModel>(item->m_viewModel)); d->tryInstantiateObjectFromAnyFile(path); } }); }); treeview1->setViewModel(model1); mainLauout->addChild(treeview1); return true; } //============================================================================== // AssetBrowserNavigator bool AssetBrowserNavigator::init(lna::EditorContext* context) { if (!Navigator::init()) return false; m_navigationItem = ln::makeObject<ln::UIIcon>(); m_navigationItem->setIconName(_TT("file")); m_navigationItem->setHAlignment(ln::UIHAlignment::Center); m_navigationItem->setVAlignment(ln::UIVAlignment::Center); m_navigationItem->setFontSize(24); m_mainPane = ln::makeObject<AssetBrowserPane>(context); //m_mainPane->setBackgroundColor(ln::Color::Red); return true; } ln::UIElement* AssetBrowserNavigator::getNavigationMenuItem() { return m_navigationItem; } ln::UIElement* AssetBrowserNavigator::getNavigationPane() { return m_mainPane; } } // namespace lna
// Copyright (c) 2015 Elements of Programming Interviews. All rights reserved. #include <algorithm> #include <cassert> #include <iostream> #include <random> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> #include "./GCD2.h" using std::cout; using std::default_random_engine; using std::hash; using std::endl; using std::make_pair; using std::max; using std::pair; using std::random_device; using std::uniform_int_distribution; using std::unordered_map; using std::unordered_set; using std::vector; using GCD2::GCD; // @include struct Point { // Equal function for hash. bool operator==(const Point& that) const { return x == that.x && y == that.y; } int x, y; }; // Hash function for Point. struct HashPoint { size_t operator()(const Point& p) const { return hash<int>()(p.x) ^ hash<int>()(p.y); } }; struct Rational { bool operator==(const Rational& that) const { return numerator == that.numerator && denominator == that.denominator; } int numerator, denominator; }; Rational GetCanonicalForm(int a, int b) { int gcd = GCD(abs(a), abs(b)); a /= gcd, b /= gcd; return b < 0 ? Rational{-a, -b} : Rational{a, b}; } // Line function of two points, a and b, and the equation is // y = x(b.y - a.y) / (b.x - a.x) + (b.x * a.y - a.x * b.y) / (b.x - a.x). struct Line { Line(const Point& a, const Point& b) { slope = a.x != b.x ? GetCanonicalForm(b.y - a.y, b.x - a.x) : Rational{1, 0}; intercept = a.x != b.x ? GetCanonicalForm(b.x * a.y - a.x * b.y, b.x - a.x) : Rational{a.x, 1}; } // Equal function for Line. bool operator==(const Line& that) const { return slope == that.slope && intercept == that.intercept; } // slope is a rational number. Note that if the line is parallel to y-axis // that we store 1/0. Rational slope; // intercept is a rational number for the y-intercept unless // the line is parallel to y-axis in which case it is the x-intercept. Rational intercept; }; // Hash function for Line. struct HashLine { size_t operator()(const Line& l) const { return hash<int>()(l.slope.numerator) ^ hash<int>()(l.slope.denominator) ^ hash<int>()(l.intercept.numerator) ^ hash<int>()(l.intercept.denominator); } }; // @exclude // n^3 checking int Check(const vector<Point>& P) { int max_count = 0; for (int i = 0; i < P.size(); ++i) { for (int j = i + 1; j < P.size(); ++j) { int count = 2; Line temp(P[i], P[j]); for (int k = j + 1; k < P.size(); ++k) { if (Line(P[i], P[k]) == temp) { ++count; } } max_count = max(max_count, count); } } return max_count; } // @include Line FindLineWithMostPoints(const vector<Point>& P) { // Add all possible lines into hash table. unordered_map<Line, unordered_set<Point, HashPoint>, HashLine> table; for (int i = 0; i < P.size(); ++i) { for (int j = i + 1; j < P.size(); ++j) { Line l(P[i], P[j]); table[l].emplace(P[i]), table[l].emplace(P[j]); } } // @exclude auto line_max_points = max_element( table.cbegin(), table.cend(), [](const auto& a, const auto& b) { return a.second.size() < b.second.size(); }); int res = Check(P); assert(res == line_max_points->second.size()); // @include // Return the line with most points have passed. return max_element(table.cbegin(), table.cend(), [](const auto& a, const auto& b) { return a.second.size() < b.second.size(); }) ->first; } // @exclude int main(int argc, char* argv[]) { default_random_engine gen((random_device())()); for (int times = 0; times < 100; ++times) { cout << times << endl; int n; if (argc == 2) { n = atoi(argv[1]); } else { // Needs at least two points to form a line. uniform_int_distribution<int> dis(2, 100); n = dis(gen); } vector<Point> points; unordered_set<Point, HashPoint> t; do { uniform_int_distribution<int> dis(0, 999); Point p{dis(gen), dis(gen)}; if (t.find(p) == t.cend()) { points.push_back(p); t.emplace(p); } } while (t.size() < n); /* for (int i = 0; i < points.size(); ++i) { cout << points[i].x << ", " << points[i].y << endl; } */ Line l = FindLineWithMostPoints(points); cout << l.slope.numerator << " " << l.slope.denominator << " " << l.intercept.numerator << " " << l.intercept.denominator << endl; } return 0; }
#include<bits/stdc++.h> using namespace std; void nextGreater(int a[], int n)//time comp. O(n^2) ; space comp. O(1) { for (int i = 0; i < n; i++) { int j = 0; for (j = i + 1; j < n; j++) { if (a[j] > a[i]) { cout << a[j] << " "; break; } } if (j == n) { cout << -1 << " "; } } } int main() { int arr[] = {5, 15, 10, 8, 6, 12, 9, 18}; int n = sizeof(arr) / sizeof(int); nextGreater(arr, n); return 0; }
#include "mandel.hpp" #include <omp.h> void mandelbrot_omp(unsigned num_threads, int d = D) { omp_set_num_threads(num_threads); int i,j ; # pragma omp parallel shared (d) private (i, j) { # pragma omp for schedule(dynamic, 1) for(i=0; i<H ;i ++) { for(j=0; j<W; j++) { auto xy = scale_xy(i, j); auto value = escape_time(xy.first, xy.second, d); auto k = 3*(j*W + i); std::tie(RGB[k], RGB[k+1], RGB[k+2]) = get_color(value); } } } } std::chrono::microseconds measure_time_omp(unsigned num_threads) { auto beg = std::chrono::high_resolution_clock::now(); mandelbrot_omp(num_threads); auto end = std::chrono::high_resolution_clock::now(); return std::chrono::duration_cast<std::chrono::microseconds>(end - beg); }
/* * Copyright © 2018 Adobe Inc. * * This is part of HarfBuzz, a text shaping library. * * Permission is hereby granted, without written agreement and without * license or royalty fees, to use, copy, modify, and distribute this * software and its documentation for any purpose, provided that the * above copyright notice and the following two paragraphs appear in * all copies of this software. * * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * Adobe Author(s): Michiharu Ariza */ #ifndef HB_OT_VORG_TABLE_HH #define HB_OT_VORG_TABLE_HH #include "hb-open-type.hh" /* * VORG -- Vertical Origin Table * https://docs.microsoft.com/en-us/typography/opentype/spec/vorg */ #define HB_OT_TAG_VORG HB_TAG('V','O','R','G') namespace OT { struct VertOriginMetric { int cmp (hb_codepoint_t g) const { return glyph.cmp (g); } bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); } public: HBGlyphID glyph; FWORD vertOriginY; public: DEFINE_SIZE_STATIC (4); }; struct VORG { static constexpr hb_tag_t tableTag = HB_OT_TAG_VORG; bool has_data () const { return version.to_int (); } int get_y_origin (hb_codepoint_t glyph) const { unsigned int i; if (!vertYOrigins.bfind (glyph, &i)) return defaultVertOriginY; return vertYOrigins[i].vertOriginY; } template <typename Iterator, hb_requires (hb_is_iterator (Iterator))> void serialize (hb_serialize_context_t *c, Iterator it, FWORD defaultVertOriginY) { if (unlikely (!c->extend_min ((*this)))) return; this->version.major = 1; this->version.minor = 0; this->defaultVertOriginY = defaultVertOriginY; this->vertYOrigins.len = it.len (); c->copy_all (it); } bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); VORG *vorg_prime = c->serializer->start_embed<VORG> (); if (unlikely (!c->serializer->check_success (vorg_prime))) return_trace (false); auto it = + vertYOrigins.as_array () | hb_filter (c->plan->glyphset (), &VertOriginMetric::glyph) | hb_map ([&] (const VertOriginMetric& _) { hb_codepoint_t new_glyph = HB_SET_VALUE_INVALID; c->plan->new_gid_for_old_gid (_.glyph, &new_glyph); VertOriginMetric metric; metric.glyph = new_glyph; metric.vertOriginY = _.vertOriginY; return metric; }) ; /* serialize the new table */ vorg_prime->serialize (c->serializer, it, defaultVertOriginY); return_trace (true); } bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && version.major == 1 && vertYOrigins.sanitize (c)); } protected: FixedVersion<> version; /* Version of VORG table. Set to 0x00010000u. */ FWORD defaultVertOriginY; /* The default vertical origin. */ SortedArrayOf<VertOriginMetric> vertYOrigins; /* The array of vertical origins. */ public: DEFINE_SIZE_ARRAY(8, vertYOrigins); }; } /* namespace OT */ #endif /* HB_OT_VORG_TABLE_HH */
/* Copyright (c) 2015-2017 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* HIT_START * BUILD: %t %s ../test_common.cpp NVCC_OPTIONS -std=c++11 * TEST: %t * HIT_END */ #include <cstdint> #include "hip/hip_runtime.h" #include "test_common.h" // Memory alignment is broken // Update: with latest changes the aligment is working fine, hence enabled #define ENABLE_ALIGNMENT_TEST_SMALL_BAR 1 // Packed member atribute broken #define ENABLE_PACKED_TEST 0 // Update: with latest changes struct class object // from device is working fine, hence enabled #define ENABLE_CLASS_OBJ_ACCESS 1 // accessing dynamic/heap memory from device is broken #define ENABLE_HEAP_MEMORY_ACCESS 0 // Update: with latest changes it's working hence enabled #define ENABLE_USER_STL 1 // Update: with latest changes it's working hence enabled #define ENABLE_OUT_OF_ORDER_INITIALIZATION 1 // Direct initialization of struct broken, // ip_d9 is a pointer, uint_t*, hipLaunchKernelStruct_h9 = {'c', ip_d9}; #define ENABLE_DECLARE_INITIALIZATION_POINTER 0 // Bit fields are broken #define ENABLE_BIT_FIELDS 0 static const int BLOCK_DIM_SIZE = 512; // allocate memory on device and host for result validation static bool *result_d, *result_h; static hipError_t hipMallocError = hipErrorUnknown; static hipError_t hipHostMallocError = hipErrorUnknown; static hipError_t hipMemsetError = hipErrorUnknown; static void ResultValidation() { hipMemcpy(result_h, result_d, BLOCK_DIM_SIZE*sizeof(bool), hipMemcpyDeviceToHost); for (int k = 0; k < BLOCK_DIM_SIZE; ++k) { HIPASSERT(result_h[k] == true); } return; } // Segregating the reset part as it was causing a problem when i put inside // ResultValidation() function, the memory was not reset correctly for the // tests which were disabled. static void ResetValidationMem() { // reset the memory to false to reuse it. hipMemset(result_d, false, BLOCK_DIM_SIZE); hipMemset(result_h, false, BLOCK_DIM_SIZE); return; } // This test is to verify Struct with variables // support, read from device. typedef struct hipLaunchKernelStruct1 { int li; // local int float lf; // local float bool result; // local bool } hipLaunchKernelStruct_t1; // This test is to verify struct with padding, read from device typedef struct hipLaunchKernelStruct2 { char c1; long l1; char c2; long l2; bool result; } hipLaunchKernelStruct_t2; // This test is to verify struct with padding, read from device typedef struct hipLaunchKernelStruct3 { char bf1; char bf2; long l1; char bf3; bool result; } hipLaunchKernelStruct_t3; // This test is to verify empty struct typedef struct hipLaunchKernelStruct4 { // empty struct, size will be verified from device side,size 1Byte } hipLaunchKernelStruct_t4; // This test is to verify struct with pointer member variable. typedef struct hipLaunchKernelStruct5 { char c1; char* cp; // char pointer } hipLaunchKernelStruct_t5; // This test is to verify struct with aligned(8), // right now it's broken on hcc & hip-clang typedef struct hipLaunchKernelStruct6 { char c1; short int si; } __attribute__((aligned(8))) hipLaunchKernelStruct_t6; // This test is to verify struct with aligned(16), // right now it's brokenon hcc & hip-clang typedef struct hipLaunchKernelStruct7 { char c1; short int si; } __attribute__((aligned(16))) hipLaunchKernelStruct_t7; // This test is to verify struct with packed & aligned, // size should be 4Bytes right now it's broken on hcc & hip-clang typedef struct hipLaunchKernelStruct8 { char c1; short int si; bool b; }__attribute__((packed, aligned(4))) hipLaunchKernelStruct_t8; // This test is to verify struct with packed, no alignment as Sam suggested // size should be 4Bytes, right now it's broken on hcc & hip-clang typedef struct hipLaunchKernelStruct8A { char c1; short int si; bool b; }__attribute__((packed)) hipLaunchKernelStruct_t8A; // This test is to verify struct with alignment, no packing as Sam suggested // size should be 8Bytes as no packing, right now it's broken on hcc & hip-clang typedef struct hipLaunchKernelStruct8B { char c1; short int si; bool b; }__attribute__((aligned(8))) hipLaunchKernelStruct_t8B; // This test is to verify const struct object typedef struct hipLaunchKernelStruct9 { char c1; uint32_t* ip; // uint pointer } hipLaunchKernelStruct_t9; // This test is to verify struct with stdint types, uintN_t typedef struct hipLaunchKernelStruct10 { uint64_t u64; uint32_t u32; uint8_t u8; } hipLaunchKernelStruct_t10; // This test is to verify struct with volatile member typedef struct hipLaunchKernelStruct11 { int i1; volatile unsigned int vint; } hipLaunchKernelStruct_t11; // This test is to verify struct with simple class object class base { public: int i = 0; base() {} }; typedef struct hipLaunchKernelStruct12 { base b; char c1; } hipLaunchKernelStruct_t12; // This test is to verify struct with __device__ func() attribute typedef struct hipLaunchKernelStruct13 { int i1; __device__ int getvalue() { return i1; } } hipLaunchKernelStruct_t13; // This test is to verify struct with array variable, // write to from device typedef struct hipLaunchKernelStruct14 { int readint; int writeint[BLOCK_DIM_SIZE]; // will write to this from device } hipLaunchKernelStruct_t14; // This test is to verify struct with dynamic memory, new int // the heap memory will be accessed from device typedef struct hipLaunchKernelStruct15 { char c1; int* heapmem; // allocated using hipMalloc() } hipLaunchKernelStruct_t15; // This test is to verify simple template struct template<typename T> struct hipLaunchKernelStruct_t16 { T t1; }; // This test is to verify simple explicity template struct template<typename T> struct hipLaunchKernelStruct_t17 {}; template<> // explicit template struct hipLaunchKernelStruct_t17<int> { int t1; }; // This test is to verity write to struct memory using __device__ func() typedef struct hipLaunchKernelStruct18 { char c1; __device__ void setChar(char c) { c1 = c; } __device__ int getChar() { return c1; } } hipLaunchKernelStruct_t18; // This test is to verity user defined STL, simple stack implementation typedef struct stackNode { int data; stackNode* nextNode = NULL; } stackNode_t; typedef struct hipLaunchKernelStruct19 { stackNode_t* stack = NULL; unsigned int size_ = 0; void pushMe(int value) { // not a device function, setting from host stackNode_t* newNode; hipMalloc((void**)&newNode, sizeof(stackNode_t)); hipMemset(&newNode->data, value, sizeof(stackNode_t)); //newNode->data = value; ++size_; if (stack == NULL) { stack = newNode; return; } stackNode_t* currentHead = stack; stack = newNode; stack->nextNode = currentHead; return; } __device__ void popMe() { stackNode_t* currentHead = stack; stack = stack->nextNode; --size_; // delete currentHead; // no idea why delete not working return; } int stackSize() { return size_; } } hipLaunchKernelStruct_t19; // This test is to verify out of order initalizer of struct elements // and access in-order, from device. typedef struct hipLaunchKernelStruct20 { char name; int age; int rank; } hipLaunchKernelStruct_t20; // This test is to verify bit fields operations // the size should be 1Bytes typedef struct hipLaunchKernelStruct21 { int i : 3; // limiting bits to 3 int j : 2; // limiting bits to 2 } hipLaunchKernelStruct_t21; // Passing struct to a hipLaunchKernelGGL(), // read and write into the same struct __global__ void hipLaunchKernelStructFunc1( hipLaunchKernelStruct_t1 hipLaunchKernelStruct_, bool* result_d1) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d1[x] = ((hipLaunchKernelStruct_.li == 1) && (hipLaunchKernelStruct_.lf == 1.0) && (hipLaunchKernelStruct_.result == false)); } // Passing struct to a hipLaunchKernelGGL(), checks padding, // read and write into the same struct __global__ void hipLaunchKernelStructFunc2( hipLaunchKernelStruct_t2 hipLaunchKernelStruct_, bool* result_d2) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d2[x] = ((hipLaunchKernelStruct_.c1 == 'a') && (hipLaunchKernelStruct_.l1 == 1.0) && (hipLaunchKernelStruct_.c2 == 'b') && (hipLaunchKernelStruct_.l2 == 2.0) ); } // Passing struct to a hipLaunchKernelGGL(), checks padding, // read and write into the same struct __global__ void hipLaunchKernelStructFunc3( hipLaunchKernelStruct_t3 hipLaunchKernelStruct_, bool* result_d3) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d3[x] = ((hipLaunchKernelStruct_.bf1 == 1) && (hipLaunchKernelStruct_.bf2 == 1) && (hipLaunchKernelStruct_.l1 == 1.0) && (hipLaunchKernelStruct_.bf3 == 1) ); } // Passing empty struct to a hipLaunchKernelGGL(), // check the size of 1Byte, set result_d4 to true if condition met __global__ void hipLaunchKernelStructFunc4( hipLaunchKernelStruct_t4 hipLaunchKernelStruct_, bool* result_d4) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d4[x] = (sizeof(hipLaunchKernelStruct_) == 1); } // Passing struct with pointer object to a hipLaunchKernelGGL() __global__ void hipLaunchKernelStructFunc5( hipLaunchKernelStruct_t5 hipLaunchKernelStruct_, bool* result_d5) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d5[x] = ((hipLaunchKernelStruct_.c1 == 'c') && (*hipLaunchKernelStruct_.cp == 'p')); } // Passing struct which is aligned to 8Byte to a hipLaunchKernelGGL(), // set the result_d6 to true if condition met __global__ void hipLaunchKernelStructFunc6( hipLaunchKernelStruct_t6 hipLaunchKernelStruct_, bool* result_d6) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met // get the address of the struct // size_t(p)%8 will be 0 if aligned to 8Byte address space int *p = (int*)(&hipLaunchKernelStruct_); result_d6[x] = ((hipLaunchKernelStruct_.c1 == 'c') && (hipLaunchKernelStruct_.si == 1) && ((size_t(p))%8 ==0)); } // Passing struct which is aligned to 16Byte, // set the result_d7 to true if condition met __global__ void hipLaunchKernelStructFunc7( hipLaunchKernelStruct_t7 hipLaunchKernelStruct_, bool* result_d7) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met // get the address of the struct // size_t(p)%16 will be 0 if aligned to 16Byte address space int *p = (int*)(&hipLaunchKernelStruct_); result_d7[x] = ((hipLaunchKernelStruct_.c1 == 'c') && (hipLaunchKernelStruct_.si == 1) && ((size_t(p))%16 ==0) ); } // Passing struct which is packed & aligned to 4Byte, // set the result_d8 to true if condition met __global__ void hipLaunchKernelStructFunc8( hipLaunchKernelStruct_t8 hipLaunchKernelStruct_, bool* result_d8) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met // get the address of the xth element, struct[x], // size_t(p)%4 will be 0 if aligned to 4Byte address space int *p = (int*)(&hipLaunchKernelStruct_); result_d8[x] = ((hipLaunchKernelStruct_.c1 == 'c') && (hipLaunchKernelStruct_.si == 1) && ((size_t(p))%4 ==0) && (sizeof(hipLaunchKernelStruct_) == 4)); } // Passing struct which is packed only, as Sam suggested, should be 4Bytes // set the result_d8A to true if condition met __global__ void hipLaunchKernelStructFunc8A( hipLaunchKernelStruct_t8A hipLaunchKernelStruct_, bool* result_d8A) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met // this is packed struct // the address will not be aglined in this case hence condition removed // only sizeof(hipLaunchKernelStruct_) will be valided result_d8A[x] = ((hipLaunchKernelStruct_.c1 == 'c') && (hipLaunchKernelStruct_.si == 1) && (sizeof(hipLaunchKernelStruct_) == 4)); } // Passing struct which is aligned(4) only, as Sam suggested // , size should be 8Bytes, set the result_d8B to true if condition met __global__ void hipLaunchKernelStructFunc8B( hipLaunchKernelStruct_t8B hipLaunchKernelStruct_, bool* result_d8B) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met // get the address of the xth element, struct[x], // size_t(p)%4 will be 0 if aligned to 4Byte address space int *p = (int*)(&hipLaunchKernelStruct_); result_d8B[x] = ((hipLaunchKernelStruct_.c1 == 'c') && (hipLaunchKernelStruct_.si == 1) && ((size_t(p))%8 == 0) && (sizeof(hipLaunchKernelStruct_) == 8)); } // Passing struct with uint pointer object to a hipLaunchKernelGGL() __global__ void hipLaunchKernelStructFunc9( const hipLaunchKernelStruct_t9 hipLaunchKernelStruct_, bool* result_d9) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d9[x] = ((hipLaunchKernelStruct_.c1 == 'c') && (*hipLaunchKernelStruct_.ip == 1)); } // Passing struct with stdint types object, uintN_t, to a hipLaunchKernelGGL() __global__ void hipLaunchKernelStructFunc10( hipLaunchKernelStruct_t10 hipLaunchKernelStruct_, bool* result_d10) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d10[x] = ((hipLaunchKernelStruct_.u64 == UINT64_MAX) && (hipLaunchKernelStruct_.u32 == 1) && (hipLaunchKernelStruct_.u8 == UINT8_MAX)); } // Passing struct with volatile member, to a hipLaunchKernelGGL() __global__ void hipLaunchKernelStructFunc11( hipLaunchKernelStruct_t11 hipLaunchKernelStruct_, bool* result_d11) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d11[x] = ((hipLaunchKernelStruct_.i1 == 1) && (hipLaunchKernelStruct_.vint == 0)); } // Passing struct with simple class obj, to a hipLaunchKernelGGL() __global__ void hipLaunchKernelStructFunc12( hipLaunchKernelStruct_t12 hipLaunchKernelStruct_, bool* result_d12) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d12[x] = ((hipLaunchKernelStruct_.c1 == 'c') && (hipLaunchKernelStruct_.b.i == 0)); } // Passing struct with simple __device__ func(), to a hipLaunchKernelGGL() __global__ void hipLaunchKernelStructFunc13( hipLaunchKernelStruct_t13 hipLaunchKernelStruct_, bool* result_d13) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d13[x] = ((hipLaunchKernelStruct_.i1 == 1) && (hipLaunchKernelStruct_.getvalue() == 1)); } // Passing struct with array variable, write to from device __global__ void hipLaunchKernelStructFunc14( hipLaunchKernelStruct_t14 hipLaunchKernelStruct_, bool* result_d14) { int x = blockIdx.x * blockDim.x + threadIdx.x; hipLaunchKernelStruct_.writeint[x] = 1; // set the result to true if the condition met result_d14[x] = ((hipLaunchKernelStruct_.readint == 1) && (hipLaunchKernelStruct_.writeint[x] == 1)); } // Passing struct with struct with dynamic memory, new int // the heap memory will be accessed from device __global__ void hipLaunchKernelStructFunc15( hipLaunchKernelStruct_t15 hipLaunchKernelStruct_, bool* result_d15) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d15[x] = ((hipLaunchKernelStruct_.c1 == 'c') && (hipLaunchKernelStruct_.heapmem[x] == 1)); } // Passing simple template struct __global__ void hipLaunchKernelStructFunc16( hipLaunchKernelStruct_t16<char> hipLaunchKernelStruct_, bool* result_d16) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d16[x] = (hipLaunchKernelStruct_.t1 == 'c'); } // Passing simple explicit template struct __global__ void hipLaunchKernelStructFunc17( hipLaunchKernelStruct_t17<int> hipLaunchKernelStruct_, bool* result_d17) { int x = blockIdx.x * blockDim.x + threadIdx.x; // set the result to true if the condition met result_d17[x] = (hipLaunchKernelStruct_.t1 == 1); } // Passing struct and write to struct memory using __device__ func() __global__ void hipLaunchKernelStructFunc18( hipLaunchKernelStruct_t18 hipLaunchKernelStruct_, bool* result_d18) { int x = blockIdx.x * blockDim.x + threadIdx.x; hipLaunchKernelStruct_.setChar('c'); // set the result to true if the condition met result_d18[x] = (hipLaunchKernelStruct_.getChar() == 'c'); } // Passing simple user defined stack implemenration, using __device__ func() __global__ void hipLaunchKernelStructFunc19( hipLaunchKernelStruct_t19 hipLaunchKernelStruct_) { int x = blockIdx.x * blockDim.x + threadIdx.x; // stack should be empty after the kernel execustion, verify on host side hipLaunchKernelStruct_.popMe(); } // Passing out of order initalized struct, access in-order __global__ void hipLaunchKernelStructFunc20( hipLaunchKernelStruct_t20 hipLaunchKernelStruct_, bool* result_d20) { int x = blockIdx.x * blockDim.x + threadIdx.x; // accessing struct members in order result_d20[x] = (hipLaunchKernelStruct_.name == 'A' // strcmp(hipLaunchKernelStruct_.name, "AMD") -> strcmp is not broken && hipLaunchKernelStruct_.age == 42 && hipLaunchKernelStruct_.rank == 2); } // Passing struct with bit fields __global__ void hipLaunchKernelStructFunc21( hipLaunchKernelStruct_t21 hipLaunchKernelStruct_, bool* result_d21) { int x = blockIdx.x * blockDim.x + threadIdx.x; // accessing struct members in order result_d21[x] = (hipLaunchKernelStruct_.i == 2 && hipLaunchKernelStruct_.j == 0 && (sizeof(hipLaunchKernelStruct_) == 1)); } __global__ void vAdd(float* a) {} template<class T1, class T2> __global__ void myKernel(T1 a, T2 b) {} //--- // Some wrapper macro for testing: #define WRAP(...) __VA_ARGS__ #define MY_LAUNCH_MACRO(cmd, elapsed, quiet) \ do { \ hipDeviceSynchronize(); \ cmd; \ hipDeviceSynchronize(); \ } while (0); #define MY_LAUNCH(command, doTrace, msg) \ { \ if (doTrace) printf("TRACE: %s %s\n", msg, #command); \ command; \ } #define MY_LAUNCH_WITH_PAREN(command, doTrace, msg) \ { \ if (doTrace) printf("TRACE: %s %s\n", msg, #command); \ (command); \ } int main() { hipMallocError = hipMalloc((void**)&result_d, BLOCK_DIM_SIZE*sizeof(bool)); hipHostMallocError = hipHostMalloc((void**)&result_h, BLOCK_DIM_SIZE*sizeof(bool)); hipMemsetError = hipMemset(result_d, false, BLOCK_DIM_SIZE); // Validating memory & initial value, for result_d, result_h HIPASSERT(hipMallocError == hipSuccess); HIPASSERT(hipHostMallocError == hipSuccess); HIPASSERT(hipMemsetError == hipSuccess); // Test: Passing Struct type, check access from device. ResetValidationMem(); hipLaunchKernelStruct_t1 hipLaunchKernelStruct_h1; hipLaunchKernelStruct_h1.li = 1; hipLaunchKernelStruct_h1.lf = 1.0; hipLaunchKernelStruct_h1.result = false; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc1), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h1, result_d); ResultValidation(); // Test: Passing Struct type, checks padding ResetValidationMem(); hipLaunchKernelStruct_t2 hipLaunchKernelStruct_h2; hipLaunchKernelStruct_h2.c1 = 'a'; hipLaunchKernelStruct_h2.l1 = 1.0; hipLaunchKernelStruct_h2.c2 = 'b'; hipLaunchKernelStruct_h2.l2 = 2.0; hipLaunchKernelStruct_h2.result = false; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc2), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h2, result_d); ResultValidation(); // Test: Passing Struct type, checks padding, assigning integer to a char ResetValidationMem(); hipLaunchKernelStruct_t3 hipLaunchKernelStruct_h3; hipLaunchKernelStruct_h3.bf1 = 1; hipLaunchKernelStruct_h3.bf2 = 1; hipLaunchKernelStruct_h3.l1 = 1.0; hipLaunchKernelStruct_h3.bf3 = 1; hipLaunchKernelStruct_h3.result = false; // initialize to false, will be set to // true if the struct size is 1Byte, from device size hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc3), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h3, result_d); ResultValidation(); // Test: Passing empty struct ResetValidationMem(); hipLaunchKernelStruct_t4 hipLaunchKernelStruct_h4; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc4), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h4, result_d); ResultValidation(); // Test: Passing struct with pointer object to a hipLaunchKernelGGL() ResetValidationMem(); hipLaunchKernelStruct_t5 hipLaunchKernelStruct_h5; char* cp_d5; // This is passed as pointer to struct member // allocating memory for char pointer on device HIPCHECK(hipMalloc((void**)&cp_d5, sizeof(char))); HIPCHECK(hipMemset(cp_d5, 'p', sizeof(char))); hipLaunchKernelStruct_h5.c1 = 'c'; hipLaunchKernelStruct_h5.cp = cp_d5; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc5), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h5, result_d); ResultValidation(); // Test: Passing struct with aligned(8) ResetValidationMem(); hipLaunchKernelStruct_t6 hipLaunchKernelStruct_h6; hipLaunchKernelStruct_h6.c1 = 'c'; hipLaunchKernelStruct_h6.si = 1; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc6), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h6, result_d); // alignment is broken hence disabled the validation part #if ENABLE_ALIGNMENT_TEST_SMALL_BAR ResultValidation(); #endif // Test: Passing struct with aligned(16) ResetValidationMem(); hipLaunchKernelStruct_t7 hipLaunchKernelStruct_h7; hipLaunchKernelStruct_h7.c1 = 'c'; hipLaunchKernelStruct_h7.si = 1; #if ENABLE_ALIGNMENT_TEST_SMALL_BAR // This is broken on small bar hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc7), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h7, result_d); ResultValidation(); #endif // Test: Passing struct with packed aligned to 4Bytes ResetValidationMem(); hipLaunchKernelStruct_t8 hipLaunchKernelStruct_h8; hipLaunchKernelStruct_h8.c1 = 'c'; hipLaunchKernelStruct_h8.si = 1; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc8), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h8, result_d); // packed member broken on large and small bar setup. #if ENABLE_PACKED_TEST ResultValidation(); #endif // Test: Passing struct with packed to 4Bytes ResetValidationMem(); hipLaunchKernelStruct_t8A hipLaunchKernelStruct_h8A; hipLaunchKernelStruct_h8A.c1 = 'c'; hipLaunchKernelStruct_h8A.si = 1; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc8A), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h8A, result_d); // packed member broken on large and small bar setup. #if ENABLE_PACKED_TEST ResultValidation(); #endif // Test: Passing struct with aligned(4) to 4Bytes, size is 8Bytes ResetValidationMem(); hipLaunchKernelStruct_t8B hipLaunchKernelStruct_h8B; hipLaunchKernelStruct_h8B.c1 = 'c'; hipLaunchKernelStruct_h8B.si = 1; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc8B), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h8B, result_d); // alignment is broken hence disabled the validation part #if ENABLE_ALIGNMENT_TEST_SMALL_BAR ResultValidation(); #endif // Test: Passing const struct object to a hipLaunchKernelGGL() ResetValidationMem(); uint32_t* ip_d9; // allocating memory for char pointer on device HIPCHECK(hipMalloc((void**)&ip_d9, sizeof(uint32_t))); HIPCHECK(hipMemset(ip_d9, 1, sizeof(uint32_t))); // ip_d9 passed as pointer to struct member, struct.ip = &ip_d9 const hipLaunchKernelStruct_t9 hipLaunchKernelStruct_h9 = {'c', ip_d9}; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc9), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h9, result_d); #if ENABLE_DECLARE_INITIALIZATION_POINTER ResultValidation(); #endif // Test: Passing struct with uintN_t as member variables ResetValidationMem(); hipLaunchKernelStruct_t10 hipLaunchKernelStruct_h10; hipLaunchKernelStruct_h10.u64 = UINT64_MAX; hipLaunchKernelStruct_h10.u32 = 1; hipLaunchKernelStruct_h10.u8 = UINT8_MAX; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc10), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h10, result_d); ResultValidation(); // Test: Passing struct with uintN_t as member variables ResetValidationMem(); hipLaunchKernelStruct_t11 hipLaunchKernelStruct_h11; hipLaunchKernelStruct_h11.i1 = 1; hipLaunchKernelStruct_h11.vint = 0; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc11), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h11, result_d); ResultValidation(); // Test: Passing struct with simple class object ResetValidationMem(); hipLaunchKernelStruct_t12 hipLaunchKernelStruct_h12; hipLaunchKernelStruct_h12.c1 = 'c'; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc12), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h12, result_d); #if ENABLE_CLASS_OBJ_ACCESS // access class obj from device broken // Validation part of the struct, hipLaunchKernelStructFunc12 ResultValidation(); #endif // Test: Passing struct with simple __device__ func() ResetValidationMem(); hipLaunchKernelStruct_t13 hipLaunchKernelStruct_h13; hipLaunchKernelStruct_h13.i1 = 1; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc13), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h13, result_d); ResultValidation(); // Test: Passing struct with array variable, write to from device ResetValidationMem(); hipLaunchKernelStruct_t14 hipLaunchKernelStruct_h14; hipLaunchKernelStruct_h14.readint = 1; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc14), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h14, result_d); ResultValidation(); // Test: Passing struct with heap memory, read to from device ResetValidationMem(); hipLaunchKernelStruct_t15 hipLaunchKernelStruct_h15; hipLaunchKernelStruct_h15.c1 = 'c'; #if ENABLE_HEAP_MEMORY_ACCESS // causing page fault here, // on small bar set HIPCHECK(hipMalloc(&hipLaunchKernelStruct_h15.heapmem, BLOCK_DIM_SIZE*sizeof(int))); HIPCHECK(hipMemset(&hipLaunchKernelStruct_h15.heapmem, 0, BLOCK_DIM_SIZE)); hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc15), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h15, result_d); ResultValidation(); #endif // Test: Passing simple template struct ResetValidationMem(); hipLaunchKernelStruct_t16<char> hipLaunchKernelStruct_h16; hipLaunchKernelStruct_h16.t1 = 'c'; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc16), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h16, result_d); ResultValidation(); // Test: Passing simple explicit template struct ResetValidationMem(); hipLaunchKernelStruct_t17<int> hipLaunchKernelStruct_h17; hipLaunchKernelStruct_h17.t1 = 1; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc17), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h17, result_d); ResultValidation(); // Test: Passing struct with simple __device__ func() to struct memory ResetValidationMem(); hipLaunchKernelStruct_t18 hipLaunchKernelStruct_h18; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc18), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h18, result_d); ResultValidation(); // Test: Passing user defined stack, ResetValidationMem(); hipLaunchKernelStruct_t19 hipLaunchKernelStruct_h19; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc19), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h19); #if ENABLE_USER_STL // Validation part of the struct, hipLaunchKernelStructFunc19 HIPASSERT(hipLaunchKernelStruct_h19.stackSize() == 0); #endif // Test: Passing struct which is initiazed out of order // accessing same elements in order from device ResetValidationMem(); hipLaunchKernelStruct_t20 hipLaunchKernelStruct_h20; hipLaunchKernelStruct_h20.name = 'A'; hipLaunchKernelStruct_h20.rank = 2; hipLaunchKernelStruct_h20.age = 42; bool *result_d20, *result_h20; #if ENABLE_OUT_OF_ORDER_INITIALIZATION hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc20), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h20, result_d); ResultValidation(); #endif // Test: Passing struct with bit fields operation // accessing same elements in order from device ResetValidationMem(); hipLaunchKernelStruct_t21 hipLaunchKernelStruct_h21 = // out of order initalization {2,0}; bool *result_d21, *result_h21; hipLaunchKernelGGL(HIP_KERNEL_NAME(hipLaunchKernelStructFunc21), dim3(BLOCK_DIM_SIZE), dim3(1), 0, 0, hipLaunchKernelStruct_h21, result_d); #if ENABLE_BIT_FIELDS ResultValidation(); #endif // Test: Passing the different hipLaunchParm options: float* Ad; hipMalloc((void**)&Ad, 1024); hipLaunchKernelGGL(HIP_KERNEL_NAME(vAdd), size_t(1024), 1, 0, 0, Ad); hipLaunchKernelGGL(HIP_KERNEL_NAME(vAdd), 1024, dim3(1), 0, 0, Ad); hipLaunchKernelGGL(HIP_KERNEL_NAME(vAdd), dim3(1024), 1, 0, 0, Ad); hipLaunchKernelGGL(HIP_KERNEL_NAME(vAdd), dim3(1024), dim3(1), 0, 0, Ad); // Test: Passing macro to hipLaunchKernelGGL #define KERNEL_CONFIG dim3(1024), dim3(1), 0, 0 hipLaunchKernelGGL(HIP_KERNEL_NAME(vAdd), KERNEL_CONFIG, Ad); // Test: Same thing with templates: int a; float b; hipLaunchKernelGGL(HIP_KERNEL_NAME(myKernel<int, float>), KERNEL_CONFIG, a, b); #define TYPE_PARAM_CONFIG int, float hipLaunchKernelGGL(HIP_KERNEL_NAME(myKernel<TYPE_PARAM_CONFIG>), KERNEL_CONFIG, a, b); // Test: Passing hipLaunchKernelGGL inside another macro: float e0; MY_LAUNCH_MACRO(hipLaunchKernelGGL(vAdd, dim3(1024), dim3(1), 0, 0, Ad), e0, j); MY_LAUNCH_MACRO(WRAP(hipLaunchKernelGGL(vAdd, dim3(1024), dim3(1), 0, 0, Ad)), e0, j); #ifdef EXTRA_PARENS_1 // Don't wrap hipLaunchKernelGGL in extra set of parens: MY_LAUNCH_MACRO((hipLaunchKernelGGL(vAdd, dim3(1024), dim3(1), 0, 0, Ad)), e0, j); #endif MY_LAUNCH(hipLaunchKernelGGL(vAdd, dim3(1024), dim3(1), 0, 0, Ad), true, "firstCall"); float* A; float e1; MY_LAUNCH_WITH_PAREN(hipMalloc(&A, 100), true, "launch2"); #ifdef EXTRA_PARENS_2 // MY_LAUNCH_WITH_PAREN wraps cmd in () which can cause issues. MY_LAUNCH_WITH_PAREN(hipLaunchKernelGGL(vAdd, dim3(1024), dim3(1), 0, 0, Ad), true, "firstCall"); #endif HIPCHECK(hipHostFree(result_h)); HIPCHECK(hipFree(result_d)); passed(); }
#include <catch.hpp> #include <Camera.h> #include <World.h> #include <Canvas.h> static const double PI = 3.14159265; static const double EPSILON = 0.00001; TEST_CASE("Camera working properly", "[camera]") { SECTION("Constructing a camera") { int hsize = 160; int vsize = 120; double fieldOfView = PI / 2; Camera camera = Camera::makeCamera(hsize, vsize, fieldOfView); REQUIRE(camera.hSize == hsize); REQUIRE(camera.vSize == vsize); REQUIRE(camera.fieldOfView == fieldOfView); REQUIRE(camera.getTransform() == Matrix::identity4x4); } SECTION("The pixel size for a horizontal canvas") { Camera camera = Camera::makeCamera(200, 125, PI / 2); REQUIRE((camera.pixelSize - 0.01) < EPSILON); } SECTION("The pixel size for a horizontal canvas") { Camera camera = Camera::makeCamera(125, 200, PI / 2); REQUIRE((camera.pixelSize - 0.01) < EPSILON); } SECTION("Constructing a ray through the center of the canvas") { Camera camera = Camera::makeCamera(201, 101, PI / 2); Ray r = camera.rayForPixel(100, 50); REQUIRE(r.origin == Tuple::point(0, 0, 0)); REQUIRE(r.direction == Tuple::vector(0, 0, -1)); } SECTION("Constructing a ray through a corner of the canvas") { Camera camera = Camera::makeCamera(201, 101, PI / 2); Ray r = camera.rayForPixel(0, 0); REQUIRE(r.origin == Tuple::point(0, 0, 0)); REQUIRE(r.direction == Tuple::vector(0.66519, 0.33259, -0.66851)); } SECTION("Constructing a ray when the camera is transformed") { Camera camera = Camera::makeCamera(201, 101, PI / 2); camera.setTransform(Matrix::rotationY(PI / 4) * Matrix::translation(0, -2, 5)); Ray r = camera.rayForPixel(100, 50); REQUIRE(r.origin == Tuple::point(0, 2, -5)); REQUIRE(r.direction == Tuple::vector(sqrt(2)/2, 0, -sqrt(2)/2)); } SECTION("Rendering a world with a camera") { World w = World::makeDefaultWorld(); Camera camera = Camera::makeCamera(11, 11, PI / 2); Tuple from = Tuple::point(0, 0, -5); Tuple to = Tuple::point(0, 0, 0); Tuple up = Tuple::vector(0, 1, 0); camera.setTransform(Matrix::viewTransform(from, to, up)); Canvas image = camera.render(w); REQUIRE(image.at(5, 5) == Color::Color(0.38066, 0.47583, 0.2855)); } }
#include<iostream> #include<vector> using namespace std; class Solution { public: int search(vector<int>& nums, int target) { int left=0; int right = nums.size()-1; //得到旋转点 while(left<right){ int mid=(left+right)/2; if(nums[mid]>nums[right]) left = mid+1; else right = mid; } int ro_id = right; int left1=0,right1=ro_id-1; int left2=ro_id,right2=nums.size()-1; int tmp_idx1 = find_idx(nums,left1,right1,target); if(tmp_idx1!=-1) return tmp_idx1; else{ int tmp_idx2 = find_idx(nums,left2,right2,target); if(tmp_idx2!=-1) return tmp_idx2; else return -1; } //return -1; } int find_idx(vector<int>& nums,int tmp_left,int tmp_right,int target){ if(nums[tmp_left]>target||nums[tmp_right]<target) return -1; else{ int left = tmp_left; int right = tmp_right; while(left<=right){ int mid=(left+right)/2; if(nums[mid]<target){ left = mid+1; } if(nums[mid]>target){ right = mid-1; } if(nums[mid]==target){ return mid; } } } } }; int main(){ vector<int> nums={4,5,6,7,0,1,2}; int se_idx = Solution().search(nums,5); cout<<se_idx; }
/* * Copyright (c) 2010-2015 Pivotal Software, 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. See accompanying * LICENSE file. */ /** * Clob.cpp * * Author: swale */ #include "types/Clob.h" using namespace com::pivotal::gemfirexd::client::types; Clob::Clob() { // TODO Auto-generated constructor stub } Clob::~Clob() { // TODO Auto-generated destructor stub }
/**************************************************************************** * * Copyright (C) 2013-2016 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name PX4 nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /* Auto-generated by genmsg_cpp from file /home/leonardo/src/PX4_Firmware/PX4_Firmware/msg/differential_pressure.msg */ #include <px4_config.h> #include <drivers/drv_orb_dev.h> #include <uORB/topics/differential_pressure.h> const char *__orb_differential_pressure_fields = "uint64_t timestamp;uint64_t error_count;float differential_pressure_raw_pa;float differential_pressure_filtered_pa;float max_differential_pressure_pa;float temperature;"; ORB_DEFINE(differential_pressure, struct differential_pressure_s, 32, __orb_differential_pressure_fields);
// // Created by juan.castellanos on 9/07/20. // #ifndef STARTER_CPP_FOO_HPP #define STARTER_CPP_FOO_HPP // Cross-platform #include "IFoo.hpp" struct Foo : IFoo { void doSomething() override; ~Foo() override = default; }; struct Bar { IFoo& _iFoo; bool _done{}; explicit Bar(IFoo& iFoo); bool runDoSomething(); }; #endif //STARTER_CPP_FOO_HPP
/* Simple Obj viewer for Windows using OpenGL and SDL Can only read triangular faces, not polygonal, and does not draw textures Modified code based on frank253's OpenGl Glut OBJ Loader sample openglsamples.sourceforge.net/projects/index.pho/blog/index/ Wavefront loader is built on Ricardo Rendon Cepeda's OpenGL ES tutorial raywenderlich.com/48293/ Wavefront loader also borrows elements from Lazaros Karydas's objview github.com/lKarydas/objview THE PROGRAM 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 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 <windows.h> #include <commdlg.h> #include <string> #include <SDL.h> #include <SDL_opengl.h> #include <gl/GLU.h> #include <iostream> #include "wavefrontloader.h" #define KEY_ESCAPE 27 #define SCREENWIDTH 640 #define SCREENHEIGHT 480 #define MAJOR_GL 2 //using OpenGL 2 functions, fixed pipeline #define MINOR_GL 1 struct MyWindow { int width; int height; char* title; float fovAngle; float zNear; float zFar; SDL_Window* viewWindow; MyWindow(); }; void MoveCamera (int &rotX, int &rotY); void Display(OBJClass &objmodel, bool &wireframeToggle, int &rotX, int &rotY); void DrawAxis(); void DrawText(std::string &text, float &x, float &y, void *font); void DrawModel(OBJClass &objmodel, bool &wireframeToggle); void InitGL(int &width, int &height, float &fovangle, float &znear, float &zfar); MyWindow::MyWindow() { title = NULL; viewWindow = NULL; width = height = 0; fovAngle = zNear = zFar = 0.0f; } void DrawModel(OBJClass &objmodel, bool &wireframeToggle) { if (objmodel.GetVertexBuffer() != NULL) { if (wireframeToggle) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); else glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glColor3f(1.0f,1.0f,1.0f); glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex arrays if (objmodel.HasNormals()) { glEnableClientState(GL_NORMAL_ARRAY); // Enable normal arrays //glVertexPointer(4,GL_FLOAT, 0, objmodel.GetFacesTriangles());// Vertex Pt to triangle array glVertexPointer(4,GL_FLOAT, 0, objmodel.GetVertexBuffer()); glNormalPointer(GL_FLOAT, 0, objmodel.GetNormalBuffer()); // Normal pointer to normal array //glDrawArrays(GL_TRIANGLES, 0, objmodel.mFaceCount*3); // Draw the triangles glDrawElements(GL_TRIANGLES, objmodel.GetTotalConnectTriangles(), GL_UNSIGNED_INT, objmodel.GetIndexBufferV()); glDisableClientState(GL_NORMAL_ARRAY); // Disable normal arrays } else { glVertexPointer(4,GL_FLOAT, 0, objmodel.GetVertexBuffer()); glDrawElements(GL_TRIANGLES, objmodel.GetTotalConnectTriangles(), GL_UNSIGNED_INT, objmodel.GetIndexBufferV()); } glDisableClientState(GL_VERTEX_ARRAY); // Disable vertex arrays } } void DrawAxis() { const float linewidth = 5.0f; glLineWidth(5.0f); glColor3f(1.0f,0,0); glBegin(GL_LINE_STRIP); //X glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f( linewidth, 0.0f, 0.0f); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f( linewidth, 0.0f, 0.0f); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f( linewidth - 0.2f , -0.2f, 0.0f); glVertex3f( linewidth + 0.2f , 0.2f, 0.0f); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f( linewidth - 0.2f , 0.2f, 0.0f); glVertex3f( linewidth + 0.2f , - 0.2f, 0.0f); glEnd(); /////////// glColor3f(0.0f,1.0f,0); glBegin(GL_LINE_STRIP); //Y glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f( 0.0f, linewidth, 0.0f); glEnd(); //////////// glColor3f(0.0f,0,1.0f); glBegin(GL_LINE_STRIP); //Z glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f( 0.0f, 0.0f, linewidth); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f( 0.0f, -0.2f, linewidth + 0.2f); glVertex3f( 0.0f, 0.2f, linewidth - 0.2f); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f( 0.0f, -0.2f, linewidth -0.2f); glVertex3f( 0.0f, -0.2f, linewidth + 0.2f); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f( 0.0f, 0.2f, linewidth -0.2f); glVertex3f( 0.0f, 0.2f, linewidth +0.2f); glEnd(); glLineWidth(1.0f); } void MoveCamera (int &rotX, int &rotY) { glRotatef( (GLfloat)rotX,1.0f,0.0f,0.0f); //rotate our camera on teh x-axis (left and right) glRotatef( (GLfloat)rotY,0.0f,1.0f,0.0f); //rotate our camera on the y-axis (up and down) } void Display(OBJClass &objmodel, bool &wireframeToggle, int &rotX, int &rotY) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); gluLookAt( 10,3,10, 0, 0, 0, 0, 1, 0); glPushMatrix(); MoveCamera(rotX, rotY); DrawAxis(); glColor3f(1.0f,1.0f,1.0f); glLineWidth(1.0f); DrawModel(objmodel, wireframeToggle); glPopMatrix(); } //setting up matrices, lights, shading, etc void InitGL(int &width, int &height, float &fovangle, float &znear, float &zfar) { glMatrixMode(GL_PROJECTION); glViewport(0, 0, width, height); GLfloat aspect = (GLfloat) width/height; glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(fovangle, aspect, znear, zfar); glMatrixMode(GL_MODELVIEW); glShadeModel( GL_SMOOTH ); glClearColor( 0.0f, 1.0f, 0.5f, 0.5f ); glClearDepth( 1.0f ); glEnable( GL_DEPTH_TEST ); glDepthFunc( GL_LEQUAL ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); GLfloat amb_light[] = { 0.1f, 0.1f, 0.1f, 1.0f }; GLfloat diffuse[] = { 0.6f, 0.6f, 0.6f, 1.0f }; GLfloat specular[] = { 0.7f, 0.7f, 0.3f, 1.0f }; glLightModelfv( GL_LIGHT_MODEL_AMBIENT, amb_light ); glLightfv( GL_LIGHT0, GL_DIFFUSE, diffuse ); glLightfv( GL_LIGHT0, GL_SPECULAR, specular ); glEnable( GL_LIGHT0 ); glEnable( GL_COLOR_MATERIAL ); glShadeModel( GL_SMOOTH ); glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE ); glDepthFunc( GL_LEQUAL ); glEnable( GL_DEPTH_TEST ); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } int main(int argc, char *argv[]) { bool boolToExit = false; SDL_Event event; SDL_GLContext context; const unsigned char *version; bool isRotatingCamera = false, wireframeToggle = false; int mousePosition[2] = {0, 0}; int mouseDiff[2] = {0, 0}; int rotation[2] = {0, 0}; OPENFILENAME opdlg = {0}; //ZeroMemory(&opdlg, sizeof(opdlg)); wchar_t fileName[250]; const wchar_t filter[] = L"OBJ Files\0*.obj\0All Files\0*.*\0"; MyWindow window1; OBJClass obj; opdlg.lStructSize = sizeof(opdlg); opdlg.hwndOwner = GetForegroundWindow(); //=NULL; opdlg.lpstrFile = fileName; opdlg.lpstrFile[0] = '\0'; opdlg.nMaxFile = sizeof(fileName); opdlg.lpstrFilter = filter; opdlg.nFilterIndex = 1; opdlg.lpstrFileTitle = NULL; opdlg.nMaxFileTitle = 0; opdlg.lpstrInitialDir = NULL; opdlg.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST; if (!GetOpenFileName(&opdlg)) //using windows-specific file menu { std::cerr << "Can't open file name" << std::endl; return 1; } if (obj.Load(fileName) == -1) { obj.Release(); std::cerr << "Model incomplete" << std::endl; return 1; } if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { obj.Release(); std::cerr << "There was an error initing SDL2: " << SDL_GetError() << std::endl; return 1; } SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, MAJOR_GL); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, MINOR_GL); window1.width = SCREENWIDTH; window1.height = SCREENHEIGHT; window1.title = "OpenGL+SDL OBJ Viewer."; window1.fovAngle = 45; window1.zNear = 1.0f; window1.zFar = 500.0f; window1.viewWindow = SDL_CreateWindow(window1.title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, window1.width, window1.height, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL); if (window1.viewWindow == NULL) { obj.Release(); std::cerr << "There was an error creating the window: " << SDL_GetError() << std::endl; return 1; } context = SDL_GL_CreateContext(window1.viewWindow); if (context == NULL) { obj.Release(); SDL_DestroyWindow(window1.viewWindow); std::cerr << "There was an error creating OpenGL context: " << SDL_GetError() << std::endl; return 1; } version = glGetString(GL_VERSION); if (version == NULL) { obj.Release(); SDL_DestroyWindow(window1.viewWindow); std::cerr << "There was an error with OpenGL configuration:" << std::endl; return 1; } SDL_GL_MakeCurrent(window1.viewWindow, context); InitGL(window1.width, window1.height, window1.fovAngle, window1.zNear, window1.zFar); //drawing on the 1st frame, //only redraw when rotating camera, setting wireframe mode, resetting camera, and restoring window Display(obj, wireframeToggle, rotation[0], rotation[1]); SDL_GL_SwapWindow(window1.viewWindow); while (!boolToExit) { while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_QUIT: boolToExit = true; break; case SDL_KEYDOWN: switch (event.key.keysym.sym) { // case SDLK_LEFT: // key_left = false; // break; default: break; } break; case SDL_KEYUP: break; case SDL_MOUSEMOTION: if (isRotatingCamera) //if left mouse button is down + mouse moves, rotate camera and redraw the scene { mouseDiff[0] = event.motion.y - mousePosition[1]; mouseDiff[1] = event.motion.x - mousePosition[0]; //mouse left and right affect y axis rotation rotation[0] += mouseDiff[0]; //set the xrot to xrot with the addition of the difference in the y position rotation[1] += mouseDiff[1]; //set the xrot to yrot with the addition of the difference in the x position if (rotation[0] < -360) rotation[0] += 360; if (rotation[0] > 360) rotation[0] -= 360; if (rotation[1] >360) rotation[1] -= 360; if (rotation[1] <-360) rotation[1] += 360; Display(obj, wireframeToggle, rotation[0], rotation[1]); SDL_GL_SwapWindow(window1.viewWindow); } mousePosition[0] = event.motion.x; mousePosition[1] = event.motion.y; break; case SDL_MOUSEBUTTONDOWN: switch (event.button.button) { case SDL_BUTTON_LEFT: //left button for rotating camera isRotatingCamera = true; SDL_GetMouseState(&mousePosition[0], &mousePosition[1]); break; case SDL_BUTTON_MIDDLE: //middle button for wireframe wireframeToggle = !wireframeToggle; Display(obj, wireframeToggle, rotation[0], rotation[1]); SDL_GL_SwapWindow(window1.viewWindow); break; case SDL_BUTTON_RIGHT: //right button for resetting camera rotation[0] = rotation[1] = 0; Display(obj, wireframeToggle, rotation[0], rotation[1]); SDL_GL_SwapWindow(window1.viewWindow); break; default: break; } break; case SDL_MOUSEBUTTONUP: isRotatingCamera = false; //SDL_GetMouseState(&mousePosition[0], &mousePosition[1]); break; case SDL_WINDOWEVENT: if (event.window.event == SDL_WINDOWEVENT_RESTORED) { Display(obj, wireframeToggle, rotation[0], rotation[1]); SDL_GL_SwapWindow(window1.viewWindow); } break; default: break; } } } SDL_StopTextInput(); obj.Release(); SDL_GL_DeleteContext(context); SDL_DestroyWindow(window1.viewWindow); SDL_Quit(); return 0; }
#include <gainput/gainput.h> #include "../samplefw/SampleFramework.h" enum Button { ButtonConfirm, ButtonConfirmDouble, ButtonConfirmExtra, ButtonHoldGesture, ButtonTapGesture, ButtonPinching, ButtonPinchScale, ButtonRotating, ButtonRotateAngle, }; const unsigned TouchPointCount = 8; const unsigned TouchDataElems = 4; class MultiTouchEmulator : public gainput::InputDevice { public: MultiTouchEmulator(gainput::InputManager& manager, gainput::DeviceId device, unsigned index, gainput::InputDevice::DeviceVariant variant) : gainput::InputDevice(manager, device, index == InputDevice::AutoIndex ? manager.GetDeviceCountByType(DT_CUSTOM) : 0) { state_ = manager.GetAllocator().New<gainput::InputState>(manager.GetAllocator(), TouchPointCount*TouchDataElems); GAINPUT_ASSERT(state_); previousState_ = manager.GetAllocator().New<gainput::InputState>(manager.GetAllocator(), TouchPointCount*TouchDataElems); GAINPUT_ASSERT(previousState_); } ~MultiTouchEmulator() { manager_.GetAllocator().Delete(state_); manager_.GetAllocator().Delete(previousState_); } void Initialize(gainput::DeviceId downDevice, gainput::DeviceButtonId downButton, gainput::DeviceId xAxisDevice, gainput::DeviceButtonId xAxisButton, gainput::DeviceId yAxisDevice, gainput::DeviceButtonId yAxisButton, gainput::DeviceId downDevice2, gainput::DeviceButtonId downButton2, gainput::DeviceId xAxisDevice2, gainput::DeviceButtonId xAxisButton2, gainput::DeviceId yAxisDevice2, gainput::DeviceButtonId yAxisButton2) { isDown_ = false; downDevice_ = downDevice; downButton_ = downButton; xAxisDevice_ = xAxisDevice; xAxisButton_ = xAxisButton; yAxisDevice_ = yAxisDevice; yAxisButton_ = yAxisButton; downDevice2_ = downDevice2; downButton2_ = downButton2; xAxisDevice2_ = xAxisDevice2; xAxisButton2_ = xAxisButton2; yAxisDevice2_ = yAxisDevice2; yAxisButton2_ = yAxisButton2; } DeviceType GetType() const { return DT_CUSTOM; } const char* GetTypeName() const { return "custom"; } bool IsValidButtonId(gainput::DeviceButtonId deviceButton) const { return deviceButton == gainput::Touch0Down || deviceButton == gainput::Touch0X || deviceButton == gainput::Touch0Y || deviceButton == gainput::Touch1Down || deviceButton == gainput::Touch1X || deviceButton == gainput::Touch1Y; } gainput::ButtonType GetButtonType(gainput::DeviceButtonId deviceButton) const { GAINPUT_ASSERT(IsValidButtonId(deviceButton)); return (deviceButton == gainput::Touch0Down || deviceButton == gainput::Touch1Down) ? gainput::BT_BOOL : gainput::BT_FLOAT; } protected: void InternalUpdate(gainput::InputDeltaState* delta) { const gainput::InputDevice* downDevice = manager_.GetDevice(downDevice_); GAINPUT_ASSERT(downDevice); if (!downDevice->GetBool(downButton_) && downDevice->GetBoolPrevious(downButton_)) { isDown_ = !isDown_; const gainput::InputDevice* xDevice = manager_.GetDevice(xAxisDevice_); GAINPUT_ASSERT(xDevice); x_ = xDevice->GetFloat(xAxisButton_); const gainput::InputDevice* yDevice = manager_.GetDevice(yAxisDevice_); GAINPUT_ASSERT(yDevice); y_ = yDevice->GetFloat(yAxisButton_); } state_->Set(gainput::Touch1Down, isDown_); state_->Set(gainput::Touch1X, x_); state_->Set(gainput::Touch1Y, y_); const gainput::InputDevice* downDevice2 = manager_.GetDevice(downDevice2_); GAINPUT_ASSERT(downDevice2); const gainput::InputDevice* xDevice2 = manager_.GetDevice(xAxisDevice2_); GAINPUT_ASSERT(xDevice2); const gainput::InputDevice* yDevice2 = manager_.GetDevice(yAxisDevice2_); GAINPUT_ASSERT(yDevice2); state_->Set(gainput::Touch0Down, downDevice2->GetBool(downButton2_)); state_->Set(gainput::Touch0X, xDevice2->GetFloat(xAxisButton2_)); state_->Set(gainput::Touch0Y, yDevice2->GetFloat(yAxisButton2_)); } DeviceState InternalGetState() const { return DS_OK; } private: bool isDown_; float x_; float y_; gainput::DeviceId downDevice_; gainput::DeviceButtonId downButton_; gainput::DeviceId xAxisDevice_; gainput::DeviceButtonId xAxisButton_; gainput::DeviceId yAxisDevice_; gainput::DeviceButtonId yAxisButton_; gainput::DeviceId downDevice2_; gainput::DeviceButtonId downButton2_; gainput::DeviceId xAxisDevice2_; gainput::DeviceButtonId xAxisButton2_; gainput::DeviceId yAxisDevice2_; gainput::DeviceButtonId yAxisButton2_; }; void SampleMain() { SfwOpenWindow("Gainput: Gesture sample"); gainput::TrackingAllocator allocator(gainput::GetDefaultAllocator()); gainput::InputManager manager(true, allocator); const gainput::DeviceId keyboardId = manager.CreateDevice<gainput::InputDeviceKeyboard>(); const gainput::DeviceId mouseId = manager.CreateDevice<gainput::InputDeviceMouse>(); gainput::InputDeviceTouch* touchDevice = manager.CreateAndGetDevice<gainput::InputDeviceTouch>(); GAINPUT_ASSERT(touchDevice); gainput::DeviceId touchId = touchDevice->GetDeviceId(); #if defined(GAINPUT_PLATFORM_LINUX) || defined(GAINPUT_PLATFORM_WIN) manager.SetDisplaySize(SfwGetWidth(), SfwGetHeight()); #endif SfwSetInputManager(&manager); gainput::InputMap map(manager, "testmap", allocator); map.MapBool(ButtonConfirm, mouseId, gainput::MouseButtonLeft); gainput::DoubleClickGesture* dcg = manager.CreateAndGetDevice<gainput::DoubleClickGesture>(); GAINPUT_ASSERT(dcg); dcg->Initialize(mouseId, gainput::MouseButtonLeft, mouseId, gainput::MouseAxisX, 0.01f, mouseId, gainput::MouseAxisY, 0.01f, 500); map.MapBool(ButtonConfirmDouble, dcg->GetDeviceId(), gainput::DoubleClickTriggered); gainput::SimultaneouslyDownGesture* sdg = manager.CreateAndGetDevice<gainput::SimultaneouslyDownGesture>(); GAINPUT_ASSERT(sdg); sdg->AddButton(mouseId, gainput::MouseButtonLeft); sdg->AddButton(keyboardId, gainput::KeyShiftL); map.MapBool(ButtonConfirmExtra, sdg->GetDeviceId(), gainput::SimultaneouslyDownTriggered); MultiTouchEmulator* mte = manager.CreateAndGetDevice<MultiTouchEmulator>(); mte->Initialize(sdg->GetDeviceId(), gainput::SimultaneouslyDownTriggered, mouseId, gainput::MouseAxisX, mouseId, gainput::MouseAxisY, mouseId, gainput::MouseButtonLeft, mouseId, gainput::MouseAxisX, mouseId, gainput::MouseAxisY); if (!touchDevice->IsAvailable() || touchDevice->GetVariant() == gainput::InputDevice::DV_NULL) { touchId = mte->GetDeviceId(); } gainput::HoldGesture* hg = manager.CreateAndGetDevice<gainput::HoldGesture>(); GAINPUT_ASSERT(hg); hg->Initialize(touchId, gainput::Touch0Down, touchId, gainput::Touch0X, 0.1f, touchId, gainput::Touch0Y, 0.1f, true, 800); map.MapBool(ButtonHoldGesture, hg->GetDeviceId(), gainput::HoldTriggered); gainput::TapGesture* tg = manager.CreateAndGetDevice<gainput::TapGesture>(); GAINPUT_ASSERT(tg); tg->Initialize(touchId, gainput::Touch0Down, 500); map.MapBool(ButtonTapGesture, tg->GetDeviceId(), gainput::TapTriggered); gainput::PinchGesture* pg = manager.CreateAndGetDevice<gainput::PinchGesture>(); GAINPUT_ASSERT(pg); pg->Initialize(touchId, gainput::Touch0Down, touchId, gainput::Touch0X, touchId, gainput::Touch0Y, touchId, gainput::Touch1Down, touchId, gainput::Touch1X, touchId, gainput::Touch1Y); map.MapBool(ButtonPinching, pg->GetDeviceId(), gainput::PinchTriggered); map.MapFloat(ButtonPinchScale, pg->GetDeviceId(), gainput::PinchScale); gainput::RotateGesture* rg = manager.CreateAndGetDevice<gainput::RotateGesture>(); GAINPUT_ASSERT(rg); rg->Initialize(touchId, gainput::Touch0Down, touchId, gainput::Touch0X, touchId, gainput::Touch0Y, touchId, gainput::Touch1Down, touchId, gainput::Touch1X, touchId, gainput::Touch1Y); map.MapBool(ButtonRotating, rg->GetDeviceId(), gainput::RotateTriggered); map.MapFloat(ButtonRotateAngle, rg->GetDeviceId(), gainput::RotateAngle); bool doExit = false; while (!SfwIsDone() && !doExit) { manager.Update(); #if defined(GAINPUT_PLATFORM_LINUX) XEvent event; while (XPending(SfwGetXDisplay())) { XNextEvent(SfwGetXDisplay(), &event); manager.HandleEvent(event); if (event.type == DestroyNotify || event.type == ClientMessage) { doExit = true; } } #elif defined(GAINPUT_PLATFORM_WIN) MSG msg; while (PeekMessage(&msg, SfwGetHWnd(), 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); manager.HandleMessage(msg); } #endif SfwUpdate(); if (map.GetBoolWasDown(ButtonConfirm)) { SFW_LOG("Confirmed!\n"); SFW_LOG("Memory: %u allocs, %u deallocs, %u used bytes\n", static_cast<unsigned>(allocator.GetAllocateCount()), static_cast<unsigned>(allocator.GetDeallocateCount()), static_cast<unsigned>(allocator.GetAllocatedMemory())); } if (map.GetBoolWasDown(ButtonConfirmDouble)) { SFW_LOG("Confirmed doubly!\n"); } if (map.GetBoolWasDown(ButtonConfirmExtra)) { SFW_LOG("Confirmed alternatively!\n"); } if (map.GetBool(ButtonHoldGesture)) { SFW_LOG("Hold triggered!\n"); } if (map.GetBoolWasDown(ButtonTapGesture)) { SFW_LOG("Tapped!\n"); } if (map.GetBool(ButtonPinching)) { SFW_LOG("Pinching: %f\n", map.GetFloat(ButtonPinchScale)); } if (map.GetBool(ButtonRotating)) { SFW_LOG("Rotation angle: %f\n", map.GetFloat(ButtonRotateAngle)); } } SfwCloseWindow(); }
#pragma once namespace qnt{ class QBit; void adamar(QBit& qb); }
// RUN: %check_clang_tidy %s readability-uppercase-literal-suffix %t -- -config="{CheckOptions: [{key: readability-uppercase-literal-suffix.NewSuffixes, value: 'L;uL'}]}" -- -I %S // RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -fix -config="{CheckOptions: [{key: readability-uppercase-literal-suffix.NewSuffixes, value: 'L;uL'}]}" -- -I %S // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -warnings-as-errors='-*,readability-uppercase-literal-suffix' -config="{CheckOptions: [{key: readability-uppercase-literal-suffix.NewSuffixes, value: 'L;uL'}]}" -- -I %S #include "readability-uppercase-literal-suffix.h" void integer_suffix() { // Unsigned static constexpr auto v3 = 1u; // OK. static_assert(is_same<decltype(v3), const unsigned int>::value, ""); static_assert(v3 == 1, ""); static constexpr auto v4 = 1U; // OK. static_assert(is_same<decltype(v4), const unsigned int>::value, ""); static_assert(v4 == 1, ""); // Long static constexpr auto v5 = 1l; // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'l', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v5 = 1l; // CHECK-MESSAGES-NEXT: ^~ // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}} // CHECK-FIXES: static constexpr auto v5 = 1L; static_assert(is_same<decltype(v5), const long>::value, ""); static_assert(v5 == 1, ""); static constexpr auto v6 = 1L; // OK. static_assert(is_same<decltype(v6), const long>::value, ""); static_assert(v6 == 1, ""); // Long Long static constexpr auto v7 = 1ll; // OK. static_assert(is_same<decltype(v7), const long long>::value, ""); static_assert(v7 == 1, ""); static constexpr auto v8 = 1LL; // OK. static_assert(is_same<decltype(v8), const long long>::value, ""); static_assert(v8 == 1, ""); // Unsigned Long static constexpr auto v9 = 1ul; // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: integer literal has suffix 'ul', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v9 = 1ul; // CHECK-MESSAGES-NEXT: ^~~ // CHECK-MESSAGES-NEXT: {{^ *}}uL{{$}} // CHECK-FIXES: static constexpr auto v9 = 1uL; static_assert(is_same<decltype(v9), const unsigned long>::value, ""); static_assert(v9 == 1, ""); static constexpr auto v10 = 1uL; // OK. static_assert(is_same<decltype(v10), const unsigned long>::value, ""); static_assert(v10 == 1, ""); static constexpr auto v11 = 1Ul; // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'Ul', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v11 = 1Ul; // CHECK-MESSAGES-NEXT: ^~~ // CHECK-MESSAGES-NEXT: {{^ *}}uL{{$}} // CHECK-FIXES: static constexpr auto v11 = 1uL; static_assert(is_same<decltype(v11), const unsigned long>::value, ""); static_assert(v11 == 1, ""); static constexpr auto v12 = 1UL; // OK. // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: integer literal has suffix 'UL', which is not uppercase // CHECK-MESSAGES-NEXT: static constexpr auto v12 = 1UL; // CHECK-MESSAGES-NEXT: ^~~ // CHECK-MESSAGES-NEXT: {{^ *}}uL{{$}} // CHECK-FIXES: static constexpr auto v12 = 1uL; static_assert(is_same<decltype(v12), const unsigned long>::value, ""); static_assert(v12 == 1, ""); // Long Unsigned static constexpr auto v13 = 1lu; // OK. static_assert(is_same<decltype(v13), const unsigned long>::value, ""); static_assert(v13 == 1, ""); static constexpr auto v14 = 1Lu; // OK. static_assert(is_same<decltype(v14), const unsigned long>::value, ""); static_assert(v14 == 1, ""); static constexpr auto v15 = 1lU; // OK. static_assert(is_same<decltype(v15), const unsigned long>::value, ""); static_assert(v15 == 1, ""); static constexpr auto v16 = 1LU; // OK. static_assert(is_same<decltype(v16), const unsigned long>::value, ""); static_assert(v16 == 1, ""); // Unsigned Long Long static constexpr auto v17 = 1ull; // OK. static_assert(is_same<decltype(v17), const unsigned long long>::value, ""); static_assert(v17 == 1, ""); static constexpr auto v18 = 1uLL; // OK. static_assert(is_same<decltype(v18), const unsigned long long>::value, ""); static_assert(v18 == 1, ""); static constexpr auto v19 = 1Ull; // OK. static_assert(is_same<decltype(v19), const unsigned long long>::value, ""); static_assert(v19 == 1, ""); static constexpr auto v20 = 1ULL; // OK. static_assert(is_same<decltype(v20), const unsigned long long>::value, ""); static_assert(v20 == 1, ""); // Long Long Unsigned static constexpr auto v21 = 1llu; // OK. static_assert(is_same<decltype(v21), const unsigned long long>::value, ""); static_assert(v21 == 1, ""); static constexpr auto v22 = 1LLu; // OK. static_assert(is_same<decltype(v22), const unsigned long long>::value, ""); static_assert(v22 == 1, ""); static constexpr auto v23 = 1llU; // OK. static_assert(is_same<decltype(v23), const unsigned long long>::value, ""); static_assert(v23 == 1, ""); static constexpr auto v24 = 1LLU; // OK. static_assert(is_same<decltype(v24), const unsigned long long>::value, ""); static_assert(v24 == 1, ""); }
// Copyright 2017 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/network/mdns/service/host_name_resolver.h" #include "src/connectivity/network/mdns/service/mdns_names.h" #include "src/lib/fxl/logging.h" #include "src/lib/fxl/time/time_point.h" namespace mdns { HostNameResolver::HostNameResolver(MdnsAgent::Host* host, const std::string& host_name, fxl::TimePoint timeout, Mdns::ResolveHostNameCallback callback) : MdnsAgent(host), host_name_(host_name), host_full_name_(MdnsNames::LocalHostFullName(host_name)), timeout_(timeout), callback_(std::move(callback)) { FXL_DCHECK(callback_); } HostNameResolver::~HostNameResolver() {} void HostNameResolver::Start(const std::string& host_full_name, const MdnsAddresses& addresses) { // Note that |host_full_name_| is the name we're trying to resolve, not the // name of the local host, which is the (ignored) parameter to this method. MdnsAgent::Start(host_full_name, addresses); SendQuestion(std::make_shared<DnsQuestion>(host_full_name_, DnsType::kA)); SendQuestion(std::make_shared<DnsQuestion>(host_full_name_, DnsType::kAaaa)); PostTaskForTime( [this]() { if (callback_) { callback_(host_name_, v4_address_, v6_address_); callback_ = nullptr; RemoveSelf(); } }, timeout_); } void HostNameResolver::ReceiveResource(const DnsResource& resource, MdnsResourceSection section) { if (resource.name_.dotted_string_ != host_full_name_) { return; } if (resource.type_ == DnsType::kA) { v4_address_ = resource.a_.address_.address_; } else if (resource.type_ == DnsType::kAaaa) { v6_address_ = resource.aaaa_.address_.address_; } } void HostNameResolver::EndOfMessage() { FXL_DCHECK(callback_); if (v4_address_ || v6_address_) { callback_(host_name_, v4_address_, v6_address_); callback_ = nullptr; PostTaskForTime([this]() { RemoveSelf(); }, fxl::TimePoint::Now()); } } void HostNameResolver::Quit() { FXL_DCHECK(callback_); callback_(host_name_, v4_address_, v6_address_); callback_ = nullptr; RemoveSelf(); } } // namespace mdns
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistribution's of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistribution's 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. // // * The name of the copyright holders may not 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 Intel Corporation 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. // //M*/ #include "precomp.hpp" namespace cv { template<typename _KeyTp, typename _ValueTp> struct sorted_vector { sorted_vector() {} void clear() { vec.clear(); } size_t size() const { return vec.size(); } _ValueTp& operator [](size_t idx) { return vec[idx]; } const _ValueTp& operator [](size_t idx) const { return vec[idx]; } void add(const _KeyTp& k, const _ValueTp& val) { std::pair<_KeyTp, _ValueTp> p(k, val); vec.push_back(p); size_t i = vec.size()-1; for( ; i > 0 && vec[i].first < vec[i-1].first; i-- ) std::swap(vec[i-1], vec[i]); CV_Assert( i == 0 || vec[i].first != vec[i-1].first ); } bool find(const _KeyTp& key, _ValueTp& value) const { size_t a = 0, b = vec.size(); while( b > a ) { size_t c = (a + b)/2; if( vec[c].first < key ) a = c+1; else b = c; } if( a < vec.size() && vec[a].first == key ) { value = vec[a].second; return true; } return false; } void get_keys(std::vector<_KeyTp>& keys) const { size_t i = 0, n = vec.size(); keys.resize(n); for( i = 0; i < n; i++ ) keys[i] = vec[i].first; } std::vector<std::pair<_KeyTp, _ValueTp> > vec; }; template<typename _ValueTp> inline const _ValueTp* findstr(const sorted_vector<String, _ValueTp>& vec, const char* key) { if( !key ) return 0; size_t a = 0, b = vec.vec.size(); while( b > a ) { size_t c = (a + b)/2; if( strcmp(vec.vec[c].first.c_str(), key) < 0 ) a = c+1; else b = c; } if( ( a < vec.vec.size() ) && ( strcmp(vec.vec[a].first.c_str(), key) == 0 )) return &vec.vec[a].second; return 0; } Param::Param() { type = 0; offset = 0; readonly = false; getter = 0; setter = 0; } Param::Param(int _type, bool _readonly, int _offset, Algorithm::Getter _getter, Algorithm::Setter _setter, const String& _help) { type = _type; readonly = _readonly; offset = _offset; getter = _getter; setter = _setter; help = _help; } struct CV_EXPORTS AlgorithmInfoData { sorted_vector<String, Param> params; String _name; }; static sorted_vector<String, Algorithm::Constructor>& alglist() { static sorted_vector<String, Algorithm::Constructor> alglist_var; return alglist_var; } void Algorithm::getList(std::vector<String>& algorithms) { alglist().get_keys(algorithms); } Ptr<Algorithm> Algorithm::_create(const String& name) { Algorithm::Constructor c = 0; if( !alglist().find(name, c) ) return Ptr<Algorithm>(); return Ptr<Algorithm>(c()); } Algorithm::Algorithm() { } Algorithm::~Algorithm() { } String Algorithm::name() const { return info()->name(); } void Algorithm::set(const String& parameter, int value) { info()->set(this, parameter.c_str(), ParamType<int>::type, &value); } void Algorithm::set(const String& parameter, double value) { info()->set(this, parameter.c_str(), ParamType<double>::type, &value); } void Algorithm::set(const String& parameter, bool value) { info()->set(this, parameter.c_str(), ParamType<bool>::type, &value); } void Algorithm::set(const String& parameter, const String& value) { info()->set(this, parameter.c_str(), ParamType<String>::type, &value); } void Algorithm::set(const String& parameter, const Mat& value) { info()->set(this, parameter.c_str(), ParamType<Mat>::type, &value); } void Algorithm::set(const String& parameter, const std::vector<Mat>& value) { info()->set(this, parameter.c_str(), ParamType<std::vector<Mat> >::type, &value); } void Algorithm::set(const String& parameter, const Ptr<Algorithm>& value) { info()->set(this, parameter.c_str(), ParamType<Algorithm>::type, &value); } void Algorithm::set(const char* parameter, int value) { info()->set(this, parameter, ParamType<int>::type, &value); } void Algorithm::set(const char* parameter, double value) { info()->set(this, parameter, ParamType<double>::type, &value); } void Algorithm::set(const char* parameter, bool value) { info()->set(this, parameter, ParamType<bool>::type, &value); } void Algorithm::set(const char* parameter, const String& value) { info()->set(this, parameter, ParamType<String>::type, &value); } void Algorithm::set(const char* parameter, const Mat& value) { info()->set(this, parameter, ParamType<Mat>::type, &value); } void Algorithm::set(const char* parameter, const std::vector<Mat>& value) { info()->set(this, parameter, ParamType<std::vector<Mat> >::type, &value); } void Algorithm::set(const char* parameter, const Ptr<Algorithm>& value) { info()->set(this, parameter, ParamType<Algorithm>::type, &value); } void Algorithm::setInt(const String& parameter, int value) { info()->set(this, parameter.c_str(), ParamType<int>::type, &value); } void Algorithm::setDouble(const String& parameter, double value) { info()->set(this, parameter.c_str(), ParamType<double>::type, &value); } void Algorithm::setBool(const String& parameter, bool value) { info()->set(this, parameter.c_str(), ParamType<bool>::type, &value); } void Algorithm::setString(const String& parameter, const String& value) { info()->set(this, parameter.c_str(), ParamType<String>::type, &value); } void Algorithm::setMat(const String& parameter, const Mat& value) { info()->set(this, parameter.c_str(), ParamType<Mat>::type, &value); } void Algorithm::setMatVector(const String& parameter, const std::vector<Mat>& value) { info()->set(this, parameter.c_str(), ParamType<std::vector<Mat> >::type, &value); } void Algorithm::setAlgorithm(const String& parameter, const Ptr<Algorithm>& value) { info()->set(this, parameter.c_str(), ParamType<Algorithm>::type, &value); } void Algorithm::setInt(const char* parameter, int value) { info()->set(this, parameter, ParamType<int>::type, &value); } void Algorithm::setDouble(const char* parameter, double value) { info()->set(this, parameter, ParamType<double>::type, &value); } void Algorithm::setBool(const char* parameter, bool value) { info()->set(this, parameter, ParamType<bool>::type, &value); } void Algorithm::setString(const char* parameter, const String& value) { info()->set(this, parameter, ParamType<String>::type, &value); } void Algorithm::setMat(const char* parameter, const Mat& value) { info()->set(this, parameter, ParamType<Mat>::type, &value); } void Algorithm::setMatVector(const char* parameter, const std::vector<Mat>& value) { info()->set(this, parameter, ParamType<std::vector<Mat> >::type, &value); } void Algorithm::setAlgorithm(const char* parameter, const Ptr<Algorithm>& value) { info()->set(this, parameter, ParamType<Algorithm>::type, &value); } int Algorithm::getInt(const String& parameter) const { return get<int>(parameter); } double Algorithm::getDouble(const String& parameter) const { return get<double>(parameter); } bool Algorithm::getBool(const String& parameter) const { return get<bool>(parameter); } String Algorithm::getString(const String& parameter) const { return get<String>(parameter); } Mat Algorithm::getMat(const String& parameter) const { return get<Mat>(parameter); } std::vector<Mat> Algorithm::getMatVector(const String& parameter) const { return get<std::vector<Mat> >(parameter); } Ptr<Algorithm> Algorithm::getAlgorithm(const String& parameter) const { return get<Algorithm>(parameter); } String Algorithm::paramHelp(const String& parameter) const { return info()->paramHelp(parameter.c_str()); } int Algorithm::paramType(const String& parameter) const { return info()->paramType(parameter.c_str()); } int Algorithm::paramType(const char* parameter) const { return info()->paramType(parameter); } void Algorithm::getParams(std::vector<String>& names) const { info()->getParams(names); } void Algorithm::write(FileStorage& fs) const { info()->write(this, fs); } void Algorithm::read(const FileNode& fn) { info()->read(this, fn); } AlgorithmInfo::AlgorithmInfo(const String& _name, Algorithm::Constructor create) { data = new AlgorithmInfoData; data->_name = _name; if (!alglist().find(_name, create)) alglist().add(_name, create); } AlgorithmInfo::~AlgorithmInfo() { delete data; } void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const { size_t i = 0, nparams = data->params.vec.size(); cv::write(fs, "name", algo->name()); for( i = 0; i < nparams; i++ ) { const Param& p = data->params.vec[i].second; const String& pname = data->params.vec[i].first; if( p.type == Param::INT ) cv::write(fs, pname, algo->get<int>(pname)); else if( p.type == Param::BOOLEAN ) cv::write(fs, pname, (int)algo->get<bool>(pname)); else if( p.type == Param::REAL ) cv::write(fs, pname, algo->get<double>(pname)); else if( p.type == Param::STRING ) cv::write(fs, pname, algo->get<String>(pname)); else if( p.type == Param::MAT ) cv::write(fs, pname, algo->get<Mat>(pname)); else if( p.type == Param::MAT_VECTOR ) cv::write(fs, pname, algo->get<std::vector<Mat> >(pname)); else if( p.type == Param::ALGORITHM ) { internal::WriteStructContext ws(fs, pname, CV_NODE_MAP); Ptr<Algorithm> nestedAlgo = algo->get<Algorithm>(pname); nestedAlgo->write(fs); } else if( p.type == Param::FLOAT) cv::write(fs, pname, algo->getDouble(pname)); else if( p.type == Param::UNSIGNED_INT) cv::write(fs, pname, algo->getInt(pname));//TODO: implement cv::write(, , unsigned int) else if( p.type == Param::UINT64) cv::write(fs, pname, algo->getInt(pname));//TODO: implement cv::write(, , uint64) else if( p.type == Param::UCHAR) cv::write(fs, pname, algo->getInt(pname)); else { String msg = format("unknown/unsupported type of '%s' parameter == %d", pname.c_str(), p.type); CV_Error( CV_StsUnsupportedFormat, msg.c_str()); } } } void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const { size_t i = 0, nparams = data->params.vec.size(); AlgorithmInfo* info = algo->info(); for( i = 0; i < nparams; i++ ) { const Param& p = data->params.vec[i].second; const String& pname = data->params.vec[i].first; const FileNode n = fn[pname]; if( n.empty() ) continue; if( p.type == Param::INT ) { int val = (int)n; info->set(algo, pname.c_str(), p.type, &val, true); } else if( p.type == Param::BOOLEAN ) { bool val = (int)n != 0; info->set(algo, pname.c_str(), p.type, &val, true); } else if( p.type == Param::REAL ) { double val = (double)n; info->set(algo, pname.c_str(), p.type, &val, true); } else if( p.type == Param::STRING ) { String val = (String)n; info->set(algo, pname.c_str(), p.type, &val, true); } else if( p.type == Param::MAT ) { Mat m; cv::read(n, m); info->set(algo, pname.c_str(), p.type, &m, true); } else if( p.type == Param::MAT_VECTOR ) { std::vector<Mat> mv; cv::read(n, mv); info->set(algo, pname.c_str(), p.type, &mv, true); } else if( p.type == Param::ALGORITHM ) { Ptr<Algorithm> nestedAlgo = Algorithm::_create((String)n["name"]); CV_Assert( nestedAlgo ); nestedAlgo->read(n); info->set(algo, pname.c_str(), p.type, &nestedAlgo, true); } else if( p.type == Param::FLOAT ) { float val = (float)n; info->set(algo, pname.c_str(), p.type, &val, true); } else if( p.type == Param::UNSIGNED_INT ) { unsigned int val = (unsigned int)((int)n);//TODO: implement conversion (unsigned int)FileNode info->set(algo, pname.c_str(), p.type, &val, true); } else if( p.type == Param::UINT64) { uint64 val = (uint64)((int)n);//TODO: implement conversion (uint64)FileNode info->set(algo, pname.c_str(), p.type, &val, true); } else if( p.type == Param::UCHAR) { uchar val = (uchar)((int)n); info->set(algo, pname.c_str(), p.type, &val, true); } else { String msg = format("unknown/unsupported type of '%s' parameter == %d", pname.c_str(), p.type); CV_Error( CV_StsUnsupportedFormat, msg.c_str()); } } } String AlgorithmInfo::name() const { return data->_name; } union GetSetParam { int (Algorithm::*get_int)() const; bool (Algorithm::*get_bool)() const; double (Algorithm::*get_double)() const; String (Algorithm::*get_string)() const; Mat (Algorithm::*get_mat)() const; std::vector<Mat> (Algorithm::*get_mat_vector)() const; Ptr<Algorithm> (Algorithm::*get_algo)() const; float (Algorithm::*get_float)() const; unsigned int (Algorithm::*get_uint)() const; uint64 (Algorithm::*get_uint64)() const; uchar (Algorithm::*get_uchar)() const; void (Algorithm::*set_int)(int); void (Algorithm::*set_bool)(bool); void (Algorithm::*set_double)(double); void (Algorithm::*set_string)(const String&); void (Algorithm::*set_mat)(const Mat&); void (Algorithm::*set_mat_vector)(const std::vector<Mat>&); void (Algorithm::*set_algo)(const Ptr<Algorithm>&); void (Algorithm::*set_float)(float); void (Algorithm::*set_uint)(unsigned int); void (Algorithm::*set_uint64)(uint64); void (Algorithm::*set_uchar)(uchar); }; static String getNameOfType(int argType); static String getNameOfType(int argType) { switch(argType) { case Param::INT: return "integer"; case Param::BOOLEAN: return "boolean"; case Param::REAL: return "double"; case Param::STRING: return "string"; case Param::MAT: return "cv::Mat"; case Param::MAT_VECTOR: return "std::vector<cv::Mat>"; case Param::ALGORITHM: return "algorithm"; case Param::FLOAT: return "float"; case Param::UNSIGNED_INT: return "unsigned int"; case Param::UINT64: return "unsigned int64"; case Param::UCHAR: return "unsigned char"; default: CV_Error(CV_StsBadArg, "Wrong argument type"); } return ""; } static String getErrorMessageForWrongArgumentInSetter(String algoName, String paramName, int paramType, int argType) { String message = String("Argument error: the setter") + " method was called for the parameter '" + paramName + "' of the algorithm '" + algoName +"', the parameter has " + getNameOfType(paramType) + " type, "; if (paramType == Param::INT || paramType == Param::BOOLEAN || paramType == Param::REAL || paramType == Param::FLOAT || paramType == Param::UNSIGNED_INT || paramType == Param::UINT64 || paramType == Param::UCHAR) { message = message + "so it should be set by integer, unsigned integer, uint64, unsigned char, boolean, float or double value, "; } message = message + "but the setter was called with " + getNameOfType(argType) + " value"; return message; } static String getErrorMessageForWrongArgumentInGetter(String algoName, String paramName, int paramType, int argType) { String message = String("Argument error: the getter") + " method was called for the parameter '" + paramName + "' of the algorithm '" + algoName +"', the parameter has " + getNameOfType(paramType) + " type, "; if (paramType == Param::BOOLEAN) { message = message + "so it should be get as integer, unsigned integer, uint64, boolean, unsigned char, float or double value, "; } else if (paramType == Param::INT || paramType == Param::UNSIGNED_INT || paramType == Param::UINT64 || paramType == Param::UCHAR) { message = message + "so it should be get as integer, unsigned integer, uint64, unsigned char, float or double value, "; } message = message + "but the getter was called to get a " + getNameOfType(argType) + " value"; return message; } void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, const void* value, bool force) const { const Param* p = findstr(data->params, parameter); if( !p ) CV_Error_( CV_StsBadArg, ("No parameter '%s' is found", parameter ? parameter : "<NULL>") ); if( !force && p->readonly ) CV_Error_( CV_StsError, ("Parameter '%s' is readonly", parameter)); GetSetParam f; f.set_int = p->setter; if( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR) { if ( !( p->type == Param::INT || p->type == Param::REAL || p->type == Param::BOOLEAN || p->type == Param::UNSIGNED_INT || p->type == Param::UINT64 || p->type == Param::FLOAT || argType == Param::UCHAR) ) { String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } if( p->type == Param::INT ) { bool is_ok = true; int val = argType == Param::INT ? *(const int*)value : argType == Param::BOOLEAN ? (int)*(const bool*)value : argType == Param::REAL ? saturate_cast<int>(*(const double*)value) : argType == Param::FLOAT ? saturate_cast<int>(*(const float*)value) : argType == Param::UNSIGNED_INT ? (int)*(const unsigned int*)value : argType == Param::UINT64 ? (int)*(const uint64*)value : argType == Param::UCHAR ? (int)*(const uchar*)value : (int)(is_ok = false); if (!is_ok) { CV_Error(CV_StsBadArg, "Wrong argument type in the setter"); } if( p->setter ) (algo->*f.set_int)(val); else *(int*)((uchar*)algo + p->offset) = val; } else if( p->type == Param::BOOLEAN ) { bool is_ok = true; bool val = argType == Param::INT ? *(const int*)value != 0 : argType == Param::BOOLEAN ? *(const bool*)value : argType == Param::REAL ? (*(const double*)value != 0) : argType == Param::FLOAT ? (*(const float*)value != 0) : argType == Param::UNSIGNED_INT ? (*(const unsigned int*)value != 0): argType == Param::UINT64 ? (*(const uint64*)value != 0): argType == Param::UCHAR ? (*(const uchar*)value != 0): (int)(is_ok = false); if (!is_ok) { CV_Error(CV_StsBadArg, "Wrong argument type in the setter"); } if( p->setter ) (algo->*f.set_bool)(val); else *(bool*)((uchar*)algo + p->offset) = val; } else if( p->type == Param::REAL ) { bool is_ok = true; double val = argType == Param::INT ? (double)*(const int*)value : argType == Param::BOOLEAN ? (double)*(const bool*)value : argType == Param::REAL ? (double)(*(const double*)value ) : argType == Param::FLOAT ? (double)(*(const float*)value ) : argType == Param::UNSIGNED_INT ? (double)(*(const unsigned int*)value ) : argType == Param::UINT64 ? (double)(*(const uint64*)value ) : argType == Param::UCHAR ? (double)(*(const uchar*)value ) : (double)(is_ok = false); if (!is_ok) { CV_Error(CV_StsBadArg, "Wrong argument type in the setter"); } if( p->setter ) (algo->*f.set_double)(val); else *(double*)((uchar*)algo + p->offset) = val; } else if( p->type == Param::FLOAT ) { bool is_ok = true; double val = argType == Param::INT ? (double)*(const int*)value : argType == Param::BOOLEAN ? (double)*(const bool*)value : argType == Param::REAL ? (double)(*(const double*)value ) : argType == Param::FLOAT ? (double)(*(const float*)value ) : argType == Param::UNSIGNED_INT ? (double)(*(const unsigned int*)value ) : argType == Param::UINT64 ? (double)(*(const uint64*)value ) : argType == Param::UCHAR ? (double)(*(const uchar*)value ) : (double)(is_ok = false); if (!is_ok) { CV_Error(CV_StsBadArg, "Wrong argument type in the setter"); } if( p->setter ) (algo->*f.set_float)((float)val); else *(float*)((uchar*)algo + p->offset) = (float)val; } else if( p->type == Param::UNSIGNED_INT ) { bool is_ok = true; unsigned int val = argType == Param::INT ? (unsigned int)*(const int*)value : argType == Param::BOOLEAN ? (unsigned int)*(const bool*)value : argType == Param::REAL ? saturate_cast<unsigned int>(*(const double*)value ) : argType == Param::FLOAT ? saturate_cast<unsigned int>(*(const float*)value ) : argType == Param::UNSIGNED_INT ? (unsigned int)(*(const unsigned int*)value ) : argType == Param::UINT64 ? (unsigned int)(*(const uint64*)value ) : argType == Param::UCHAR ? (unsigned int)(*(const uchar*)value ) : (int)(is_ok = false); if (!is_ok) { CV_Error(CV_StsBadArg, "Wrong argument type in the setter"); } if( p->setter ) (algo->*f.set_uint)(val); else *(unsigned int*)((uchar*)algo + p->offset) = val; } else if( p->type == Param::UINT64 ) { bool is_ok = true; uint64 val = argType == Param::INT ? (uint64)*(const int*)value : argType == Param::BOOLEAN ? (uint64)*(const bool*)value : argType == Param::REAL ? saturate_cast<uint64>(*(const double*)value ) : argType == Param::FLOAT ? saturate_cast<uint64>(*(const float*)value ) : argType == Param::UNSIGNED_INT ? (uint64)(*(const unsigned int*)value ) : argType == Param::UINT64 ? (uint64)(*(const uint64*)value ) : argType == Param::UCHAR ? (uint64)(*(const uchar*)value ) : (int)(is_ok = false); if (!is_ok) { CV_Error(CV_StsBadArg, "Wrong argument type in the setter"); } if( p->setter ) (algo->*f.set_uint64)(val); else *(uint64*)((uchar*)algo + p->offset) = val; } else if( p->type == Param::UCHAR ) { bool is_ok = true; uchar val = argType == Param::INT ? (uchar)*(const int*)value : argType == Param::BOOLEAN ? (uchar)*(const bool*)value : argType == Param::REAL ? saturate_cast<uchar>(*(const double*)value ) : argType == Param::FLOAT ? saturate_cast<uchar>(*(const float*)value ) : argType == Param::UNSIGNED_INT ? (uchar)(*(const unsigned int*)value ) : argType == Param::UINT64 ? (uchar)(*(const uint64*)value ) : argType == Param::UCHAR ? (uchar)(*(const uchar*)value ) : (int)(is_ok = false); if (!is_ok) { CV_Error(CV_StsBadArg, "Wrong argument type in the setter"); } if( p->setter ) (algo->*f.set_uchar)(val); else *(uchar*)((uchar*)algo + p->offset) = val; } else CV_Error(CV_StsBadArg, "Wrong parameter type in the setter"); } else if( argType == Param::STRING ) { if( p->type != Param::STRING ) { String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } const String& val = *(const String*)value; if( p->setter ) (algo->*f.set_string)(val); else *(String*)((uchar*)algo + p->offset) = val; } else if( argType == Param::MAT ) { if( p->type != Param::MAT ) { String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } const Mat& val = *(const Mat*)value; if( p->setter ) (algo->*f.set_mat)(val); else *(Mat*)((uchar*)algo + p->offset) = val; } else if( argType == Param::MAT_VECTOR ) { if( p->type != Param::MAT_VECTOR ) { String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } const std::vector<Mat>& val = *(const std::vector<Mat>*)value; if( p->setter ) (algo->*f.set_mat_vector)(val); else *(std::vector<Mat>*)((uchar*)algo + p->offset) = val; } else if( argType == Param::ALGORITHM ) { if( p->type != Param::ALGORITHM ) { String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } const Ptr<Algorithm>& val = *(const Ptr<Algorithm>*)value; if( p->setter ) (algo->*f.set_algo)(val); else *(Ptr<Algorithm>*)((uchar*)algo + p->offset) = val; } else CV_Error(CV_StsBadArg, "Unknown/unsupported parameter type"); } void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argType, void* value) const { const Param* p = findstr(data->params, parameter); if( !p ) CV_Error_( CV_StsBadArg, ("No parameter '%s' is found", parameter ? parameter : "<NULL>") ); GetSetParam f; f.get_int = p->getter; if( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR) { if( p->type == Param::INT ) { if (!( argType == Param::INT || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR)) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } int val = p->getter ? (algo->*f.get_int)() : *(int*)((uchar*)algo + p->offset); if( argType == Param::INT ) *(int*)value = (int)val; else if ( argType == Param::REAL ) *(double*)value = (double)val; else if ( argType == Param::FLOAT) *(float*)value = (float)val; else if ( argType == Param::UNSIGNED_INT ) *(unsigned int*)value = (unsigned int)val; else if ( argType == Param::UINT64 ) *(uint64*)value = (uint64)val; else if ( argType == Param::UCHAR) *(uchar*)value = (uchar)val; else CV_Error(CV_StsBadArg, "Wrong argument type"); } else if( p->type == Param::BOOLEAN ) { if (!( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR)) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } bool val = p->getter ? (algo->*f.get_bool)() : *(bool*)((uchar*)algo + p->offset); if( argType == Param::INT ) *(int*)value = (int)val; else if( argType == Param::BOOLEAN ) *(bool*)value = val; else if ( argType == Param::REAL ) *(double*)value = (int)val; else if ( argType == Param::FLOAT) *(float*)value = (float)((int)val); else if ( argType == Param::UNSIGNED_INT ) *(unsigned int*)value = (unsigned int)val; else if ( argType == Param::UINT64 ) *(uint64*)value = (int)val; else if ( argType == Param::UCHAR) *(uchar*)value = (uchar)val; else CV_Error(CV_StsBadArg, "Wrong argument type"); } else if( p->type == Param::REAL ) { if(!( argType == Param::REAL || argType == Param::FLOAT)) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } double val = p->getter ? (algo->*f.get_double)() : *(double*)((uchar*)algo + p->offset); if ( argType == Param::REAL ) *(double*)value = val; else if ( argType == Param::FLOAT) *(float*)value = (float)val; else CV_Error(CV_StsBadArg, "Wrong argument type"); } else if( p->type == Param::FLOAT ) { if(!( argType == Param::REAL || argType == Param::FLOAT)) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } float val = p->getter ? (algo->*f.get_float)() : *(float*)((uchar*)algo + p->offset); if ( argType == Param::REAL ) *(double*)value = (double)val; else if ( argType == Param::FLOAT) *(float*)value = (float)val; else CV_Error(CV_StsBadArg, "Wrong argument type"); } else if( p->type == Param::UNSIGNED_INT ) { if (!( argType == Param::INT || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR)) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } unsigned int val = p->getter ? (algo->*f.get_uint)() : *(unsigned int*)((uchar*)algo + p->offset); if( argType == Param::INT ) *(int*)value = (int)val; else if ( argType == Param::REAL ) *(double*)value = (double)val; else if ( argType == Param::FLOAT) *(float*)value = (float)val; else if ( argType == Param::UNSIGNED_INT ) *(unsigned int*)value = (unsigned int)val; else if ( argType == Param::UINT64 ) *(uint64*)value = (uint64)val; else if ( argType == Param::UCHAR) *(uchar*)value = (uchar)val; else CV_Error(CV_StsBadArg, "Wrong argument type"); } else if( p->type == Param::UINT64 ) { if (!( argType == Param::INT || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR)) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } uint64 val = p->getter ? (algo->*f.get_uint64)() : *(uint64*)((uchar*)algo + p->offset); if( argType == Param::INT ) *(int*)value = (int)val; else if ( argType == Param::REAL ) *(double*)value = (double)val; else if ( argType == Param::FLOAT) *(float*)value = (float)val; else if ( argType == Param::UNSIGNED_INT ) *(unsigned int*)value = (unsigned int)val; else if ( argType == Param::UINT64 ) *(uint64*)value = (uint64)val; else if ( argType == Param::UCHAR) *(uchar*)value = (uchar)val; else CV_Error(CV_StsBadArg, "Wrong argument type"); } else if( p->type == Param::UCHAR ) { if (!( argType == Param::INT || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR)) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } uchar val = p->getter ? (algo->*f.get_uchar)() : *(uchar*)((uchar*)algo + p->offset); if( argType == Param::INT ) *(int*)value = val; else if ( argType == Param::REAL ) *(double*)value = val; else if ( argType == Param::FLOAT) *(float*)value = val; else if ( argType == Param::UNSIGNED_INT ) *(unsigned int*)value = val; else if ( argType == Param::UINT64 ) *(uint64*)value = val; else if ( argType == Param::UCHAR) *(uchar*)value = val; else CV_Error(CV_StsBadArg, "Wrong argument type"); } else CV_Error(CV_StsBadArg, "Unknown/unsupported parameter type"); } else if( argType == Param::STRING ) { if( p->type != Param::STRING ) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } *(String*)value = p->getter ? (algo->*f.get_string)() : *(String*)((uchar*)algo + p->offset); } else if( argType == Param::MAT ) { if( p->type != Param::MAT ) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } *(Mat*)value = p->getter ? (algo->*f.get_mat)() : *(Mat*)((uchar*)algo + p->offset); } else if( argType == Param::MAT_VECTOR ) { if( p->type != Param::MAT_VECTOR ) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } *(std::vector<Mat>*)value = p->getter ? (algo->*f.get_mat_vector)() : *(std::vector<Mat>*)((uchar*)algo + p->offset); } else if( argType == Param::ALGORITHM ) { if( p->type != Param::ALGORITHM ) { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } *(Ptr<Algorithm>*)value = p->getter ? (algo->*f.get_algo)() : *(Ptr<Algorithm>*)((uchar*)algo + p->offset); } else { String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType); CV_Error(CV_StsBadArg, message); } } int AlgorithmInfo::paramType(const char* parameter) const { const Param* p = findstr(data->params, parameter); if( !p ) CV_Error_( CV_StsBadArg, ("No parameter '%s' is found", parameter ? parameter : "<NULL>") ); return p->type; } String AlgorithmInfo::paramHelp(const char* parameter) const { const Param* p = findstr(data->params, parameter); if( !p ) CV_Error_( CV_StsBadArg, ("No parameter '%s' is found", parameter ? parameter : "<NULL>") ); return p->help; } void AlgorithmInfo::getParams(std::vector<String>& names) const { data->params.get_keys(names); } void AlgorithmInfo::addParam_(Algorithm& algo, const char* parameter, int argType, void* value, bool readOnly, Algorithm::Getter getter, Algorithm::Setter setter, const String& help) { CV_Assert( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL || argType == Param::STRING || argType == Param::MAT || argType == Param::MAT_VECTOR || argType == Param::ALGORITHM || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR); data->params.add(String(parameter), Param(argType, readOnly, (int)((size_t)value - (size_t)(void*)&algo), getter, setter, help)); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, int& value, bool readOnly, int (Algorithm::*getter)(), void (Algorithm::*setter)(int), const String& help) { addParam_(algo, parameter, ParamType<int>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, bool& value, bool readOnly, int (Algorithm::*getter)(), void (Algorithm::*setter)(int), const String& help) { addParam_(algo, parameter, ParamType<bool>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, double& value, bool readOnly, double (Algorithm::*getter)(), void (Algorithm::*setter)(double), const String& help) { addParam_(algo, parameter, ParamType<double>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, String& value, bool readOnly, String (Algorithm::*getter)(), void (Algorithm::*setter)(const String&), const String& help) { addParam_(algo, parameter, ParamType<String>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, Mat& value, bool readOnly, Mat (Algorithm::*getter)(), void (Algorithm::*setter)(const Mat&), const String& help) { addParam_(algo, parameter, ParamType<Mat>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, std::vector<Mat>& value, bool readOnly, std::vector<Mat> (Algorithm::*getter)(), void (Algorithm::*setter)(const std::vector<Mat>&), const String& help) { addParam_(algo, parameter, ParamType<std::vector<Mat> >::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, Ptr<Algorithm>& value, bool readOnly, Ptr<Algorithm> (Algorithm::*getter)(), void (Algorithm::*setter)(const Ptr<Algorithm>&), const String& help) { addParam_(algo, parameter, ParamType<Algorithm>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, float& value, bool readOnly, float (Algorithm::*getter)(), void (Algorithm::*setter)(float), const String& help) { addParam_(algo, parameter, ParamType<float>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, unsigned int& value, bool readOnly, unsigned int (Algorithm::*getter)(), void (Algorithm::*setter)(unsigned int), const String& help) { addParam_(algo, parameter, ParamType<unsigned int>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, uint64& value, bool readOnly, uint64 (Algorithm::*getter)(), void (Algorithm::*setter)(uint64), const String& help) { addParam_(algo, parameter, ParamType<uint64>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter, uchar& value, bool readOnly, uchar (Algorithm::*getter)(), void (Algorithm::*setter)(uchar), const String& help) { addParam_(algo, parameter, ParamType<uchar>::type, &value, readOnly, (Algorithm::Getter)getter, (Algorithm::Setter)setter, help); } } /* End of file. */
#include <stdlib.h> #include <malloc.h> #include "Messages.h" #include "GRMain.h" extern "C" int GET_MW(int argc, void **argv) { #define InSize 30 #define RLSize 7 if (argc<3) { IDLmsg("GET_MW error: not enough parameters."); return -1; } else { int NSteps=*((short*)argv[0]); if (NSteps<1) { IDLmsg("GET_MW error: number of nodes must be positive."); return -2; } else { double *ParmsIn=(double*)argv[1]; double *RL=(double*)argv[2]; int Nnu=(int)ParmsIn[18]; if (Nnu<1) { IDLmsg("GET_MW error: number of frequencies must be positive."); return -3; } else { double **Parms=(double**)malloc(sizeof(double*)*NSteps); for (int i=0; i<NSteps; i++) { Parms[i]=(double*)malloc(sizeof(double)*InSize); double *p=ParmsIn+i*InSize; for (int j=0; j<InSize; j++) Parms[i][j]=p[j]; } double *nu=(double*)malloc(sizeof(double)*Nnu); double *Le=(double*)malloc(sizeof(double)*Nnu); double *Re=(double*)malloc(sizeof(double)*Nnu); double *Lw=(double*)malloc(sizeof(double)*Nnu); double *Rw=(double*)malloc(sizeof(double)*Nnu); double *Ls=(double*)malloc(sizeof(double)*Nnu); double *Rs=(double*)malloc(sizeof(double)*Nnu); for (int i=0; i<Nnu; i++) { double *r=RL+i*RLSize; Lw[i]=r[1]; Rw[i]=r[2]; Ls[i]=r[3]; Rs[i]=r[4]; Le[i]=r[5]; Re[i]=r[6]; } int res=GRTransfer(NSteps, Parms, nu, Rw, Lw, Rs, Ls, Re, Le); for (int i=0; i<Nnu; i++) { double *r=RL+i*RLSize; r[0]=nu[i]/1e9; r[1]=Lw[i]; r[2]=Rw[i]; r[3]=Ls[i]; r[4]=Rs[i]; r[5]=Le[i]; r[6]=Re[i]; } free(nu); free(Le); free(Re); free(Ls); free(Rs); free(Lw); free(Rw); for (int i=0; i<NSteps; i++) free(Parms[i]); free(Parms); return res; } } } }
/* * Copyright 2019 Google 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 "Firestore/core/src/core/sync_engine.h" #include "Firestore/core/include/firebase/firestore/firestore_errors.h" #include "Firestore/core/src/bundle/bundle_element.h" #include "Firestore/core/src/bundle/bundle_loader.h" #include "Firestore/core/src/core/sync_engine_callback.h" #include "Firestore/core/src/core/transaction.h" #include "Firestore/core/src/core/transaction_runner.h" #include "Firestore/core/src/local/local_documents_view.h" #include "Firestore/core/src/local/local_store.h" #include "Firestore/core/src/local/local_view_changes.h" #include "Firestore/core/src/local/local_write_result.h" #include "Firestore/core/src/local/query_result.h" #include "Firestore/core/src/local/target_data.h" #include "Firestore/core/src/model/document_key.h" #include "Firestore/core/src/model/document_key_set.h" #include "Firestore/core/src/model/document_map.h" #include "Firestore/core/src/model/document_set.h" #include "Firestore/core/src/model/mutation_batch_result.h" #include "Firestore/core/src/model/no_document.h" #include "Firestore/core/src/util/async_queue.h" #include "Firestore/core/src/util/log.h" #include "Firestore/core/src/util/status.h" #include "absl/strings/match.h" namespace firebase { namespace firestore { namespace core { namespace { using auth::User; using bundle::BundleElement; using bundle::BundleLoader; using bundle::InitialProgress; using bundle::SuccessProgress; using firestore::Error; using local::LocalStore; using local::LocalViewChanges; using local::LocalWriteResult; using local::QueryPurpose; using local::QueryResult; using local::TargetData; using model::BatchId; using model::DocumentKey; using model::DocumentKeySet; using model::DocumentUpdateMap; using model::kBatchIdUnknown; using model::ListenSequenceNumber; using model::MaybeDocumentMap; using model::NoDocument; using model::SnapshotVersion; using model::TargetId; using remote::RemoteEvent; using remote::TargetChange; using util::AsyncQueue; using util::Status; using util::StatusCallback; // Limbo documents don't use persistence, and are eagerly GC'd. So, listens for // them don't need real sequence numbers. const ListenSequenceNumber kIrrelevantSequenceNumber = -1; bool ErrorIsInteresting(const Status& error) { bool missing_index = (error.code() == Error::kErrorFailedPrecondition && absl::StrContains(error.error_message(), "requires an index")); bool no_permission = (error.code() == Error::kErrorPermissionDenied); return missing_index || no_permission; } } // namespace SyncEngine::SyncEngine(LocalStore* local_store, remote::RemoteStore* remote_store, const auth::User& initial_user, size_t max_concurrent_limbo_resolutions) : local_store_(local_store), remote_store_(remote_store), current_user_(initial_user), target_id_generator_(TargetIdGenerator::SyncEngineTargetIdGenerator()), max_concurrent_limbo_resolutions_(max_concurrent_limbo_resolutions) { } void SyncEngine::AssertCallbackExists(absl::string_view source) { HARD_ASSERT(sync_engine_callback_, "Tried to call '%s' before callback was registered.", source); } TargetId SyncEngine::Listen(Query query) { AssertCallbackExists("Listen"); HARD_ASSERT(query_views_by_query_.find(query) == query_views_by_query_.end(), "We already listen to query: %s", query.ToString()); TargetData target_data = local_store_->AllocateTarget(query.ToTarget()); ViewSnapshot view_snapshot = InitializeViewAndComputeSnapshot(query, target_data.target_id()); std::vector<ViewSnapshot> snapshots; // Not using the `std::initializer_list` constructor to avoid extra copies. snapshots.push_back(std::move(view_snapshot)); sync_engine_callback_->OnViewSnapshots(std::move(snapshots)); // TODO(wuandy): move `target_data` into `Listen`. remote_store_->Listen(target_data); return target_data.target_id(); } ViewSnapshot SyncEngine::InitializeViewAndComputeSnapshot(const Query& query, TargetId target_id) { QueryResult query_result = local_store_->ExecuteQuery(query, /* use_previous_results= */ true); // If there are already queries mapped to the target id, create a synthesized // target change to apply the sync state from those queries to the new query. auto current_sync_state = SyncState::None; absl::optional<TargetChange> synthesized_current_change; if (queries_by_target_.find(target_id) != queries_by_target_.end()) { const Query& mirror_query = queries_by_target_[target_id][0]; current_sync_state = query_views_by_query_[mirror_query]->view().sync_state(); synthesized_current_change = TargetChange::CreateSynthesizedTargetChange( current_sync_state == SyncState::Synced); } View view(query, query_result.remote_keys()); ViewDocumentChanges view_doc_changes = view.ComputeDocumentChanges(query_result.documents().underlying_map()); ViewChange view_change = view.ApplyChanges(view_doc_changes, synthesized_current_change); UpdateTrackedLimboDocuments(view_change.limbo_changes(), target_id); auto query_view = std::make_shared<QueryView>(query, target_id, std::move(view)); query_views_by_query_[query] = query_view; queries_by_target_[target_id].push_back(query); HARD_ASSERT( view_change.snapshot().has_value(), "ApplyChanges to documents for new view should always return a snapshot"); return view_change.snapshot().value(); } void SyncEngine::StopListening(const Query& query) { AssertCallbackExists("StopListening"); auto query_view = query_views_by_query_[query]; HARD_ASSERT(query_view, "Trying to stop listening to a query not found"); query_views_by_query_.erase(query); TargetId target_id = query_view->target_id(); auto& queries = queries_by_target_[target_id]; queries.erase(std::remove(queries.begin(), queries.end(), query), queries.end()); if (queries.empty()) { local_store_->ReleaseTarget(target_id); remote_store_->StopListening(target_id); RemoveAndCleanupTarget(target_id, Status::OK()); } } void SyncEngine::RemoveAndCleanupTarget(TargetId target_id, Status status) { for (const Query& query : queries_by_target_.at(target_id)) { query_views_by_query_.erase(query); if (!status.ok()) { sync_engine_callback_->OnError(query, status); if (ErrorIsInteresting(status)) { LOG_WARN("Listen for query at %s failed: %s", query.path().CanonicalString(), status.error_message()); } } } queries_by_target_.erase(target_id); DocumentKeySet limbo_keys = limbo_document_refs_.ReferencedKeys(target_id); limbo_document_refs_.RemoveReferences(target_id); for (const DocumentKey& key : limbo_keys) { if (!limbo_document_refs_.ContainsKey(key)) { // We removed the last reference for this key. RemoveLimboTarget(key); } } } void SyncEngine::WriteMutations(std::vector<model::Mutation>&& mutations, StatusCallback callback) { AssertCallbackExists("WriteMutations"); LocalWriteResult result = local_store_->WriteLocally(std::move(mutations)); mutation_callbacks_[current_user_].insert( std::make_pair(result.batch_id(), std::move(callback))); EmitNewSnapshotsAndNotifyLocalStore(result.changes(), absl::nullopt); remote_store_->FillWritePipeline(); } void SyncEngine::RegisterPendingWritesCallback(StatusCallback callback) { if (!remote_store_->CanUseNetwork()) { LOG_DEBUG( "The network is disabled. The task returned by " "'waitForPendingWrites()' will not " "complete until the network is enabled."); } int largest_pending_batch_id = local_store_->GetHighestUnacknowledgedBatchId(); if (largest_pending_batch_id == kBatchIdUnknown) { // Trigger the callback right away if there is no pending writes at the // moment. callback(Status::OK()); return; } pending_writes_callbacks_[largest_pending_batch_id].push_back( std::move(callback)); } void SyncEngine::Transaction(int retries, const std::shared_ptr<AsyncQueue>& worker_queue, TransactionUpdateCallback update_callback, TransactionResultCallback result_callback) { worker_queue->VerifyIsCurrentQueue(); HARD_ASSERT(retries >= 0, "Got negative number of retries for transaction"); // Allocate a shared_ptr so that the TransactionRunner can outlive this frame. auto runner = std::make_shared<TransactionRunner>(worker_queue, remote_store_, std::move(update_callback), std::move(result_callback)); runner->Run(); } void SyncEngine::HandleCredentialChange(const auth::User& user) { bool user_changed = (current_user_ != user); current_user_ = user; if (user_changed) { // Fails callbacks waiting for pending writes requested by previous user. FailOutstandingPendingWriteCallbacks( "'waitForPendingWrites' callback is cancelled due to a user change."); // Notify local store and emit any resulting events from swapping out the // mutation queue. MaybeDocumentMap changes = local_store_->HandleUserChange(user); EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); } // Notify remote store so it can restart its streams. remote_store_->HandleCredentialChange(); } void SyncEngine::ApplyRemoteEvent(const RemoteEvent& remote_event) { AssertCallbackExists("HandleRemoteEvent"); // Update received document as appropriate for any limbo targets. for (const auto& entry : remote_event.target_changes()) { TargetId target_id = entry.first; const TargetChange& change = entry.second; auto it = active_limbo_resolutions_by_target_.find(target_id); if (it == active_limbo_resolutions_by_target_.end()) { continue; } LimboResolution& limbo_resolution = it->second; // Since this is a limbo resolution lookup, it's for a single document and // it could be added, modified, or removed, but not a combination. auto changed_documents_count = change.added_documents().size() + change.modified_documents().size() + change.removed_documents().size(); HARD_ASSERT( changed_documents_count <= 1, "Limbo resolution for single document contains multiple changes."); if (!change.added_documents().empty()) { limbo_resolution.document_received = true; } else if (!change.modified_documents().empty()) { HARD_ASSERT(limbo_resolution.document_received, "Received change for limbo target document without add."); } else if (!change.removed_documents().empty()) { HARD_ASSERT(limbo_resolution.document_received, "Received remove for limbo target document without add."); limbo_resolution.document_received = false; } else { // This was probably just a CURRENT target change or similar. } } MaybeDocumentMap changes = local_store_->ApplyRemoteEvent(remote_event); EmitNewSnapshotsAndNotifyLocalStore(changes, remote_event); } void SyncEngine::HandleRejectedListen(TargetId target_id, Status error) { AssertCallbackExists("HandleRejectedListen"); auto it = active_limbo_resolutions_by_target_.find(target_id); if (it != active_limbo_resolutions_by_target_.end()) { DocumentKey limbo_key = it->second.key; // Since this query failed, we won't want to manually unlisten to it. // So go ahead and remove it from bookkeeping. active_limbo_targets_by_key_.erase(limbo_key); active_limbo_resolutions_by_target_.erase(target_id); PumpEnqueuedLimboResolutions(); // TODO(dimond): Retry on transient errors? // It's a limbo doc. Create a synthetic event saying it was deleted. This is // kind of a hack. Ideally, we would have a method in the local store to // purge a document. However, it would be tricky to keep all of the local // store's invariants with another method. NoDocument doc(limbo_key, SnapshotVersion::None(), /* has_committed_mutations= */ false); // Explicitly instantiate these to work around a bug in the default // constructor of the std::unordered_map that comes with GCC 4.8. Without // this GCC emits a spurious "chosen constructor is explicit in // copy-initialization" error. DocumentKeySet limbo_documents{limbo_key}; RemoteEvent::TargetChangeMap target_changes; RemoteEvent::TargetSet target_mismatches; DocumentUpdateMap document_updates{{limbo_key, doc}}; RemoteEvent event{SnapshotVersion::None(), std::move(target_changes), std::move(target_mismatches), std::move(document_updates), std::move(limbo_documents)}; ApplyRemoteEvent(event); } else { local_store_->ReleaseTarget(target_id); RemoveAndCleanupTarget(target_id, error); } } void SyncEngine::HandleSuccessfulWrite( const model::MutationBatchResult& batch_result) { AssertCallbackExists("HandleSuccessfulWrite"); // The local store may or may not be able to apply the write result and // raise events immediately (depending on whether the watcher is caught up), // so we raise user callbacks first so that they consistently happen before // listen events. NotifyUser(batch_result.batch().batch_id(), Status::OK()); TriggerPendingWriteCallbacks(batch_result.batch().batch_id()); MaybeDocumentMap changes = local_store_->AcknowledgeBatch(batch_result); EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); } void SyncEngine::HandleRejectedWrite( firebase::firestore::model::BatchId batch_id, Status error) { AssertCallbackExists("HandleRejectedWrite"); MaybeDocumentMap changes = local_store_->RejectBatch(batch_id); if (!changes.empty() && ErrorIsInteresting(error)) { const DocumentKey& min_key = changes.min()->first; LOG_WARN("Write at %s failed: %s", min_key.ToString(), error.error_message()); } // The local store may or may not be able to apply the write result and // raise events immediately (depending on whether the watcher is caught up), // so we raise user callbacks first so that they consistently happen before // listen events. NotifyUser(batch_id, std::move(error)); TriggerPendingWriteCallbacks(batch_id); EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); } void SyncEngine::HandleOnlineStateChange(model::OnlineState online_state) { AssertCallbackExists("HandleOnlineStateChange"); std::vector<ViewSnapshot> new_view_snapshot; for (const auto& entry : query_views_by_query_) { const auto& query_view = entry.second; ViewChange view_change = query_view->view().ApplyOnlineStateChange(online_state); HARD_ASSERT(view_change.limbo_changes().empty(), "OnlineState should not affect limbo documents."); if (view_change.snapshot().has_value()) { new_view_snapshot.push_back(*std::move(view_change).snapshot()); } } sync_engine_callback_->OnViewSnapshots(std::move(new_view_snapshot)); sync_engine_callback_->HandleOnlineStateChange(online_state); } DocumentKeySet SyncEngine::GetRemoteKeys(TargetId target_id) const { auto it = active_limbo_resolutions_by_target_.find(target_id); if (it != active_limbo_resolutions_by_target_.end() && it->second.document_received) { return DocumentKeySet{it->second.key}; } else { DocumentKeySet keys; if (queries_by_target_.count(target_id) == 0) { return keys; } for (const auto& query : queries_by_target_.at(target_id)) { keys = keys.union_with( query_views_by_query_.at(query)->view().synced_documents()); } return keys; } } void SyncEngine::NotifyUser(BatchId batch_id, Status status) { auto it = mutation_callbacks_.find(current_user_); // NOTE: Mutations restored from persistence won't have callbacks, so // it's okay for this (or the callback below) to not exist. if (it == mutation_callbacks_.end()) { return; } std::unordered_map<BatchId, StatusCallback>& callbacks = it->second; auto callback_it = callbacks.find(batch_id); if (callback_it != callbacks.end()) { callback_it->second(std::move(status)); callbacks.erase(callback_it); } } void SyncEngine::TriggerPendingWriteCallbacks(BatchId batch_id) { auto it = pending_writes_callbacks_.find(batch_id); if (it != pending_writes_callbacks_.end()) { for (const auto& callback : it->second) { callback(Status::OK()); } pending_writes_callbacks_.erase(it); } } void SyncEngine::FailOutstandingPendingWriteCallbacks( const std::string& message) { for (const auto& entry : pending_writes_callbacks_) { for (const auto& callback : entry.second) { callback(Status(Error::kErrorCancelled, message)); } } pending_writes_callbacks_.clear(); } void SyncEngine::EmitNewSnapshotsAndNotifyLocalStore( const MaybeDocumentMap& changes, const absl::optional<RemoteEvent>& maybe_remote_event) { std::vector<ViewSnapshot> new_snapshots; std::vector<LocalViewChanges> document_changes_in_all_views; for (const auto& entry : query_views_by_query_) { const auto& query_view = entry.second; View& view = query_view->view(); ViewDocumentChanges view_doc_changes = view.ComputeDocumentChanges(changes); if (view_doc_changes.needs_refill()) { // The query has a limit and some docs were removed/updated, so we need to // re-run the query against the local store to make sure we didn't lose // any good docs that had been past the limit. QueryResult query_result = local_store_->ExecuteQuery( query_view->query(), /* use_previous_results= */ false); view_doc_changes = view.ComputeDocumentChanges( query_result.documents().underlying_map(), view_doc_changes); } absl::optional<TargetChange> target_changes; if (maybe_remote_event.has_value()) { const RemoteEvent& remote_event = maybe_remote_event.value(); auto it = remote_event.target_changes().find(query_view->target_id()); if (it != remote_event.target_changes().end()) { target_changes = it->second; } } ViewChange view_change = view.ApplyChanges(view_doc_changes, target_changes); UpdateTrackedLimboDocuments(view_change.limbo_changes(), query_view->target_id()); if (view_change.snapshot().has_value()) { new_snapshots.push_back(*view_change.snapshot()); LocalViewChanges doc_changes = LocalViewChanges::FromViewSnapshot( *view_change.snapshot(), query_view->target_id()); document_changes_in_all_views.push_back(std::move(doc_changes)); } } sync_engine_callback_->OnViewSnapshots(std::move(new_snapshots)); local_store_->NotifyLocalViewChanges(document_changes_in_all_views); } void SyncEngine::UpdateTrackedLimboDocuments( const std::vector<LimboDocumentChange>& limbo_changes, TargetId target_id) { for (const LimboDocumentChange& limbo_change : limbo_changes) { switch (limbo_change.type()) { case LimboDocumentChange::Type::Added: limbo_document_refs_.AddReference(limbo_change.key(), target_id); TrackLimboChange(limbo_change); break; case LimboDocumentChange::Type::Removed: LOG_DEBUG("Document no longer in limbo: %s", limbo_change.key().ToString()); limbo_document_refs_.RemoveReference(limbo_change.key(), target_id); if (!limbo_document_refs_.ContainsKey(limbo_change.key())) { // We removed the last reference for this key RemoveLimboTarget(limbo_change.key()); } break; default: HARD_FAIL("Unknown limbo change type: %s", limbo_change.type()); } } } void SyncEngine::TrackLimboChange(const LimboDocumentChange& limbo_change) { const DocumentKey& key = limbo_change.key(); if (active_limbo_targets_by_key_.find(key) == active_limbo_targets_by_key_.end() && enqueued_limbo_resolutions_.push_back(key)) { LOG_DEBUG("New document in limbo: %s", key.ToString()); PumpEnqueuedLimboResolutions(); } } void SyncEngine::PumpEnqueuedLimboResolutions() { while (!enqueued_limbo_resolutions_.empty() && active_limbo_targets_by_key_.size() < max_concurrent_limbo_resolutions_) { DocumentKey key = enqueued_limbo_resolutions_.front(); enqueued_limbo_resolutions_.pop_front(); TargetId limbo_target_id = target_id_generator_.NextId(); active_limbo_resolutions_by_target_.emplace(limbo_target_id, LimboResolution{key}); active_limbo_targets_by_key_.emplace(key, limbo_target_id); remote_store_->Listen(TargetData(Query(key.path()).ToTarget(), limbo_target_id, kIrrelevantSequenceNumber, QueryPurpose::LimboResolution)); } } void SyncEngine::RemoveLimboTarget(const DocumentKey& key) { enqueued_limbo_resolutions_.remove(key); auto it = active_limbo_targets_by_key_.find(key); if (it == active_limbo_targets_by_key_.end()) { // This target already got removed, because the query failed. return; } TargetId limbo_target_id = it->second; remote_store_->StopListening(limbo_target_id); active_limbo_targets_by_key_.erase(key); active_limbo_resolutions_by_target_.erase(limbo_target_id); PumpEnqueuedLimboResolutions(); } absl::optional<BundleLoader> SyncEngine::ReadIntoLoader( const bundle::BundleMetadata& metadata, bundle::BundleReader& reader, api::LoadBundleTask& result_task) { BundleLoader loader(local_store_, metadata); int64_t current_bytes_read = 0; // Breaks when either error happened, or when there is no more element to // read. while (true) { auto element = reader.GetNextElement(); if (!reader.reader_status().ok()) { LOG_WARN("Failed to GetNextElement() from bundle with error %s", reader.reader_status().error_message()); result_task.SetError(reader.reader_status()); return absl::nullopt; } // No more elements from reader. if (element == nullptr) { break; } int64_t old_bytes_read = current_bytes_read; current_bytes_read = reader.bytes_read(); auto maybe_progress = loader.AddElement( std::move(element), current_bytes_read - old_bytes_read); if (!maybe_progress.ok()) { LOG_WARN("Failed to AddElement() to bundle loader with error %s", maybe_progress.status().error_message()); result_task.SetError(maybe_progress.status()); return absl::nullopt; } if (maybe_progress.ValueOrDie().has_value()) { result_task.UpdateProgress(maybe_progress.ConsumeValueOrDie().value()); } } return loader; } void SyncEngine::LoadBundle(std::shared_ptr<bundle::BundleReader> reader, std::shared_ptr<api::LoadBundleTask> result_task) { auto bundle_metadata = reader->GetBundleMetadata(); if (!reader->reader_status().ok()) { LOG_WARN("Failed to GetBundleMetadata() for bundle with error %s", reader->reader_status().error_message()); result_task->SetError(reader->reader_status()); return; } bool has_newer_bundle = local_store_->HasNewerBundle(bundle_metadata); if (has_newer_bundle) { result_task->SetSuccess(SuccessProgress(bundle_metadata)); return; } result_task->UpdateProgress(InitialProgress(bundle_metadata)); auto maybe_loader = ReadIntoLoader(bundle_metadata, *reader, *result_task); if (!maybe_loader.has_value()) { // `ReadIntoLoader` would call `result_task.SetError` should there be an // error, so we do not need set it here. return; } util::StatusOr<MaybeDocumentMap> changes = maybe_loader.value().ApplyChanges(); if (!changes.ok()) { LOG_WARN("Failed to ApplyChanges() for bundle elements with error %s", changes.status().error_message()); result_task->SetError(changes.status()); return; } EmitNewSnapshotsAndNotifyLocalStore(changes.ConsumeValueOrDie(), absl::nullopt); result_task->SetSuccess(SuccessProgress(bundle_metadata)); } } // namespace core } // namespace firestore } // namespace firebase
// Copyright (c) 2016-2019, The MKEcoin Project // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <vector> #include "misc_os_dependent.h" #include "perf_timer.h" #undef MKEcoin_DEFAULT_LOG_CATEGORY #define MKEcoin_DEFAULT_LOG_CATEGORY "perf" #define PERF_LOG_ALWAYS(level, cat, x) \ el::base::Writer(level, __FILE__, __LINE__, ELPP_FUNC, el::base::DispatchAction::FileOnlyLog).construct(cat) << x #define PERF_LOG(level, cat, x) \ do { \ if (ELPP->vRegistry()->allowed(level, cat)) PERF_LOG_ALWAYS(level, cat, x); \ } while(0) namespace tools { uint64_t get_tick_count() { #if defined(__x86_64__) uint32_t hi, lo; __asm__ volatile("rdtsc" : "=a"(lo), "=d"(hi)); return (((uint64_t)hi) << 32) | (uint64_t)lo; #else return epee::misc_utils::get_ns_count(); #endif } #ifdef __x86_64__ uint64_t get_ticks_per_ns() { uint64_t t0 = epee::misc_utils::get_ns_count(), t1; uint64_t r0 = get_tick_count(); while (1) { t1 = epee::misc_utils::get_ns_count(); if (t1 - t0 > 1*1000000000) break; // work one second } uint64_t r1 = get_tick_count(); uint64_t tpns256 = 256 * (r1 - r0) / (t1 - t0); return tpns256 ? tpns256 : 1; } #endif #ifdef __x86_64__ uint64_t ticks_per_ns = get_ticks_per_ns(); #endif uint64_t ticks_to_ns(uint64_t ticks) { #if defined(__x86_64__) return 256 * ticks / ticks_per_ns; #else return ticks; #endif } } namespace tools { el::Level performance_timer_log_level = el::Level::Info; static __thread std::vector<LoggingPerformanceTimer*> *performance_timers = NULL; void set_performance_timer_log_level(el::Level level) { if (level != el::Level::Debug && level != el::Level::Trace && level != el::Level::Info && level != el::Level::Warning && level != el::Level::Error && level != el::Level::Fatal) { MERROR("Wrong log level: " << el::LevelHelper::convertToString(level) << ", using Info"); level = el::Level::Info; } performance_timer_log_level = level; } PerformanceTimer::PerformanceTimer(bool paused): started(true), paused(paused) { if (paused) ticks = 0; else ticks = get_tick_count(); } LoggingPerformanceTimer::LoggingPerformanceTimer(const std::string &s, const std::string &cat, uint64_t unit, el::Level l): PerformanceTimer(), name(s), cat(cat), unit(unit), level(l) { const bool log = ELPP->vRegistry()->allowed(level, cat.c_str()); if (!performance_timers) { if (log) PERF_LOG_ALWAYS(level, cat.c_str(), "PERF ----------"); performance_timers = new std::vector<LoggingPerformanceTimer*>(); performance_timers->reserve(16); // how deep before realloc } else { LoggingPerformanceTimer *pt = performance_timers->back(); if (!pt->started && !pt->paused) { if (log) { size_t size = 0; for (const auto *tmp: *performance_timers) if (!tmp->paused) ++size; PERF_LOG_ALWAYS(pt->level, cat.c_str(), "PERF " << std::string((size-1) * 2, ' ') << " " << pt->name); } pt->started = true; } } performance_timers->push_back(this); } PerformanceTimer::~PerformanceTimer() { if (!paused) ticks = get_tick_count() - ticks; } LoggingPerformanceTimer::~LoggingPerformanceTimer() { pause(); performance_timers->pop_back(); const bool log = ELPP->vRegistry()->allowed(level, cat.c_str()); if (log) { char s[12]; snprintf(s, sizeof(s), "%8llu ", (unsigned long long)(ticks_to_ns(ticks) / (1000000000 / unit))); size_t size = 0; for (const auto *tmp: *performance_timers) if (!tmp->paused || tmp==this) ++size; PERF_LOG_ALWAYS(level, cat.c_str(), "PERF " << s << std::string(size * 2, ' ') << " " << name); } if (performance_timers->empty()) { delete performance_timers; performance_timers = NULL; } } void PerformanceTimer::pause() { if (paused) return; ticks = get_tick_count() - ticks; paused = true; } void PerformanceTimer::resume() { if (!paused) return; ticks = get_tick_count() - ticks; paused = false; } void PerformanceTimer::reset() { if (paused) ticks = 0; else ticks = get_tick_count(); } uint64_t PerformanceTimer::value() const { uint64_t v = ticks; if (!paused) v = get_tick_count() - v; return ticks_to_ns(v); } }
/* Copyright (c) 2016, Arvid Norberg 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 author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.hpp" #include "test_utils.hpp" #include <vector> #include "libtorrent/entry.hpp" #include "libtorrent/torrent_info.hpp" #include "libtorrent/random.hpp" #include "libtorrent/create_torrent.hpp" #include "libtorrent/bencode.hpp" #include "libtorrent/add_torrent_params.hpp" #include "libtorrent/read_resume_data.hpp" #include "libtorrent/write_resume_data.hpp" using namespace lt; TORRENT_TEST(read_resume) { entry rd; rd["file-format"] = "libtorrent resume file"; rd["file-version"] = 1; rd["info-hash"] = "abcdefghijklmnopqrst"; rd["pieces"] = "\x01\x01\x01\x01\x01\x01"; rd["total_uploaded"] = 1337; rd["total_downloaded"] = 1338; rd["active_time"] = 1339; rd["seeding_time"] = 1340; rd["upload_rate_limit"] = 1343; rd["download_rate_limit"] = 1344; rd["max_connections"] = 1345; rd["max_uploads"] = 1346; rd["seed_mode"] = 0; rd["super_seeding"] = 0; rd["added_time"] = 1347; rd["completed_time"] = 1348; rd["finished_time"] = 1352; rd["piece_priority"] = "\x01\x02\x03\x04\x05\x06"; rd["auto_managed"] = 0; rd["sequential_download"] = 0; rd["paused"] = 0; std::vector<char> resume_data; bencode(std::back_inserter(resume_data), rd); error_code ec; add_torrent_params atp = read_resume_data(resume_data, ec); TEST_CHECK(!ec); TEST_EQUAL(atp.info_hash, sha1_hash("abcdefghijklmnopqrst")); TEST_EQUAL(atp.have_pieces.size(), 6); TEST_EQUAL(atp.have_pieces.count(), 6); TEST_EQUAL(atp.total_uploaded, 1337); TEST_EQUAL(atp.total_downloaded, 1338); TEST_EQUAL(atp.active_time, 1339); TEST_EQUAL(atp.seeding_time, 1340); TEST_EQUAL(atp.upload_limit, 1343); TEST_EQUAL(atp.download_limit, 1344); TEST_EQUAL(atp.max_connections, 1345); TEST_EQUAL(atp.max_uploads, 1346); torrent_flags_t const flags_mask = torrent_flags::seed_mode | torrent_flags::super_seeding | torrent_flags::auto_managed | torrent_flags::paused | torrent_flags::sequential_download; TEST_CHECK(!(atp.flags & flags_mask)); TEST_EQUAL(atp.added_time, 1347); TEST_EQUAL(atp.completed_time, 1348); TEST_EQUAL(atp.finished_time, 1352); TEST_EQUAL(atp.piece_priorities.size(), 6); TEST_EQUAL(atp.piece_priorities[0], 1_pri); TEST_EQUAL(atp.piece_priorities[1], 2_pri); TEST_EQUAL(atp.piece_priorities[2], 3_pri); TEST_EQUAL(atp.piece_priorities[3], 4_pri); TEST_EQUAL(atp.piece_priorities[4], 5_pri); TEST_EQUAL(atp.piece_priorities[5], 6_pri); } TORRENT_TEST(read_resume_missing_info_hash) { entry rd; rd["file-format"] = "libtorrent resume file"; rd["file-version"] = 1; // missing info-hash std::vector<char> resume_data; bencode(std::back_inserter(resume_data), rd); error_code ec; add_torrent_params atp = read_resume_data(resume_data, ec); TEST_EQUAL(ec, error_code(errors::missing_info_hash)); } TORRENT_TEST(read_resume_missing_file_format) { entry rd; // missing file-format rd["file-version"] = 1; rd["info-hash"] = "abcdefghijklmnopqrst"; std::vector<char> resume_data; bencode(std::back_inserter(resume_data), rd); error_code ec; add_torrent_params atp = read_resume_data(resume_data, ec); TEST_EQUAL(ec, error_code(errors::invalid_file_tag)); } TORRENT_TEST(read_resume_mismatching_torrent) { entry rd; rd["file-format"] = "libtorrent resume file"; rd["file-version"] = 1; rd["info-hash"] = "abcdefghijklmnopqrst"; entry& info = rd["info"]; info["piece length"] = 16384 * 16; info["name"] = "test"; std::vector<char> resume_data; bencode(std::back_inserter(resume_data), rd); // the info-hash field does not match the torrent in the "info" field, so it // will be ignored error_code ec; add_torrent_params atp = read_resume_data(resume_data, ec); TEST_CHECK(!ec); TEST_CHECK(!atp.ti); } namespace { std::shared_ptr<torrent_info> generate_torrent() { file_storage fs; fs.add_file("test_resume/tmp1", 128 * 1024 * 8); fs.add_file("test_resume/tmp2", 128 * 1024); fs.add_file("test_resume/tmp3", 128 * 1024); lt::create_torrent t(fs, 128 * 1024, 6); t.add_tracker("http://torrent_file_tracker.com/announce"); t.add_url_seed("http://torrent_file_url_seed.com/"); int num = t.num_pieces(); TEST_CHECK(num > 0); for (auto const i : fs.piece_range()) { sha1_hash ph; aux::random_bytes(ph); t.set_hash(i, ph); } std::vector<char> buf; bencode(std::back_inserter(buf), t.generate()); return std::make_shared<torrent_info>(buf, from_span); } } // anonymous namespace TORRENT_TEST(read_resume_torrent) { std::shared_ptr<torrent_info> ti = generate_torrent(); entry rd; rd["file-format"] = "libtorrent resume file"; rd["file-version"] = 1; rd["info-hash"] = ti->info_hash().to_string(); rd["info"] = bdecode(ti->metadata().get(), ti->metadata().get() + ti->metadata_size()); std::vector<char> resume_data; bencode(std::back_inserter(resume_data), rd); // the info-hash field does not match the torrent in the "info" field, so it // will be ignored error_code ec; add_torrent_params atp = read_resume_data(resume_data, ec); TEST_CHECK(!ec); TEST_CHECK(atp.ti); TEST_EQUAL(atp.ti->info_hash(), ti->info_hash()); TEST_EQUAL(atp.ti->name(), ti->name()); } namespace { void test_roundtrip(add_torrent_params const& input) { auto b = write_resume_data_buf(input); error_code ec; auto output = read_resume_data(b, ec); TEST_CHECK(write_resume_data_buf(output) == b); } template <typename T> lt::typed_bitfield<T> bits() { lt::typed_bitfield<T> b; b.resize(19); b.set_bit(T(2)); b.set_bit(T(6)); b.set_bit(T(12)); return b; } lt::bitfield bits() { lt::bitfield b; b.resize(19); b.set_bit(2); b.set_bit(6); b.set_bit(12); return b; } template <typename T> std::vector<T> vec() { std::vector<T> ret; ret.resize(10); ret[0] = T(1); ret[1] = T(2); ret[5] = T(3); ret[7] = T(4); return ret; } } TORRENT_TEST(round_trip_have_pieces) { add_torrent_params atp; atp.have_pieces = bits<piece_index_t>(); test_roundtrip(atp); } TORRENT_TEST(round_trip_verified_pieces) { add_torrent_params atp; atp.verified_pieces = bits<piece_index_t>(); test_roundtrip(atp); } TORRENT_TEST(round_trip_prios) { add_torrent_params atp; atp.piece_priorities = vec<download_priority_t>(); test_roundtrip(atp); } TORRENT_TEST(round_trip_unfinished) { add_torrent_params atp; atp.unfinished_pieces = std::map<piece_index_t, bitfield>{{piece_index_t{42}, bits()}}; test_roundtrip(atp); }
#include <scope/scope.hpp> namespace { void example_deleter(int&){} } int main() { { auto scope = ::scope::make_scope_exit([]{ }); (void) scope; } { auto scope = ::scope::make_scope_fail([]{ }); (void) scope; } { auto scope = ::scope::make_scope_success([]{ }); (void) scope; } { auto resource = ::scope::make_unique_resource(int{5}, &::example_deleter); (void) resource; } return 0; }
/* * @file OrthographicCamera.cpp * @author Adriel Marchena Santos * * Camera System * * Implementation File */ #include "pch.h" #include "OrthographicCamera.h" #include "glm/gtc/matrix_transform.hpp" namespace Base { OrthographicCamera::OrthographicCamera(float_t left, float_t right, float_t bottom, float_t top) : m_ProjectionMatrix(glm::ortho(left, right, bottom, top, -1.0f, 1.0f)), m_ViewMatrix(1.0f) { RecalculateViewMatrix(); } void OrthographicCamera::SetProjection(float_t left, float_t right, float_t bottom, float_t top) { m_ProjectionMatrix = glm::ortho(left, right, bottom, top, -1.0f, 1.0f); RecalculateViewMatrix(); } void OrthographicCamera::RecalculateViewMatrix() { glm::mat4 transform = glm::translate(glm::mat4(1.0f), m_Position) * glm::rotate(glm::mat4(1.0f), glm::radians(m_Rotation), glm::vec3(0, 0, 1)); m_ViewMatrix = glm::inverse(transform); m_ViewProjectionMatrix = m_ProjectionMatrix * m_ViewMatrix; } }
// Copyright (c) 2012 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/common/android/address_parser_internal.h" #include <bitset> #include "base/logging.h" #include "base/string_util.h" namespace { // Number of digits for a valid zip code. const size_t kZipDigits = 5; // Number of digits for a valid zip code in the Zip Plus 4 format. const size_t kZipPlus4Digits = 9; // Maximum number of digits of a house number, including possible hyphens. const size_t kMaxHouseDigits = 5; char16 SafePreviousChar(const string16::const_iterator& it, const string16::const_iterator& begin) { if (it == begin) return ' '; return *(it - 1); } char16 SafeNextChar(const string16::const_iterator& it, const string16::const_iterator& end) { if (it == end) return ' '; return *(it + 1); } bool WordLowerCaseEqualsASCII(string16::const_iterator word_begin, string16::const_iterator word_end, const char* ascii_to_match) { for (string16::const_iterator it = word_begin; it != word_end; ++it, ++ascii_to_match) { if (!*ascii_to_match || base::ToLowerASCII(*it) != *ascii_to_match) return false; } return *ascii_to_match == 0 || *ascii_to_match == ' '; } bool LowerCaseEqualsASCIIWithPlural(string16::const_iterator word_begin, string16::const_iterator word_end, const char* ascii_to_match, bool allow_plural) { for (string16::const_iterator it = word_begin; it != word_end; ++it, ++ascii_to_match) { if (!*ascii_to_match && allow_plural && *it == 's' && it + 1 == word_end) return true; if (!*ascii_to_match || base::ToLowerASCII(*it) != *ascii_to_match) return false; } return *ascii_to_match == 0; } } // anonymous namespace namespace content { namespace address_parser { namespace internal { Word::Word(const string16::const_iterator& begin, const string16::const_iterator& end) : begin(begin), end(end) { DCHECK(begin <= end); } bool HouseNumberParser::IsPreDelimiter(char16 character) { return character == ':' || IsPostDelimiter(character); } bool HouseNumberParser::IsPostDelimiter(char16 character) { return IsWhitespace(character) || strchr(",\"'", character); } void HouseNumberParser::RestartOnNextDelimiter() { ResetState(); for (; it_ != end_ && !IsPreDelimiter(*it_); ++it_) {} } void HouseNumberParser::AcceptChars(size_t num_chars) { size_t offset = std::min(static_cast<size_t>(std::distance(it_, end_)), num_chars); it_ += offset; result_chars_ += offset; } void HouseNumberParser::SkipChars(size_t num_chars) { it_ += std::min(static_cast<size_t>(std::distance(it_, end_)), num_chars); } void HouseNumberParser::ResetState() { num_digits_ = 0; result_chars_ = 0; } bool HouseNumberParser::CheckFinished(Word* word) const { // There should always be a number after a hyphen. if (result_chars_ == 0 || SafePreviousChar(it_, begin_) == '-') return false; if (word) { word->begin = it_ - result_chars_; word->end = it_; } return true; } bool HouseNumberParser::Parse( const string16::const_iterator& begin, const string16::const_iterator& end, Word* word) { it_ = begin_ = begin; end_ = end; ResetState(); // Iterations only used as a fail-safe against any buggy infinite loops. size_t iterations = 0; size_t max_iterations = end - begin + 1; for (; it_ != end_ && iterations < max_iterations; ++iterations) { // Word finished case. if (IsPostDelimiter(*it_)) { if (CheckFinished(word)) return true; else if (result_chars_) ResetState(); SkipChars(1); continue; } // More digits. There should be no more after a letter was found. if (IsAsciiDigit(*it_)) { if (num_digits_ >= kMaxHouseDigits) { RestartOnNextDelimiter(); } else { AcceptChars(1); ++num_digits_; } continue; } if (IsAsciiAlpha(*it_)) { // Handle special case 'one'. if (result_chars_ == 0) { if (it_ + 3 <= end_ && LowerCaseEqualsASCII(it_, it_ + 3, "one")) AcceptChars(3); else RestartOnNextDelimiter(); continue; } // There should be more than 1 character because of result_chars. DCHECK_GT(result_chars_, 0U); DCHECK(it_ != begin_); char16 previous = SafePreviousChar(it_, begin_); if (IsAsciiDigit(previous)) { // Check cases like '12A'. char16 next = SafeNextChar(it_, end_); if (IsPostDelimiter(next)) { AcceptChars(1); continue; } // Handle cases like 12a, 1st, 2nd, 3rd, 7th. if (IsAsciiAlpha(next)) { char16 last_digit = previous; char16 first_letter = base::ToLowerASCII(*it_); char16 second_letter = base::ToLowerASCII(next); bool is_teen = SafePreviousChar(it_ - 1, begin_) == '1' && num_digits_ == 2; switch (last_digit - '0') { case 1: if ((first_letter == 's' && second_letter == 't') || (first_letter == 't' && second_letter == 'h' && is_teen)) { AcceptChars(2); continue; } break; case 2: if ((first_letter == 'n' && second_letter == 'd') || (first_letter == 't' && second_letter == 'h' && is_teen)) { AcceptChars(2); continue; } break; case 3: if ((first_letter == 'r' && second_letter == 'd') || (first_letter == 't' && second_letter == 'h' && is_teen)) { AcceptChars(2); continue; } break; case 0: // Explicitly exclude '0th'. if (num_digits_ == 1) break; case 4: case 5: case 6: case 7: case 8: case 9: if (first_letter == 't' && second_letter == 'h') { AcceptChars(2); continue; } break; default: NOTREACHED(); } } } RestartOnNextDelimiter(); continue; } if (*it_ == '-' && num_digits_ > 0) { AcceptChars(1); ++num_digits_; continue; } RestartOnNextDelimiter(); SkipChars(1); } if (iterations >= max_iterations) return false; return CheckFinished(word); } bool FindStateStartingInWord(WordList* words, size_t state_first_word, size_t* state_last_word, String16Tokenizer* tokenizer, size_t* state_index) { // Bitmasks containing the allowed suffixes for 2-letter state codes. static const int state_two_letter_suffix[23] = { 0x02060c00, // A followed by: [KLRSZ]. 0x00000000, // B. 0x00084001, // C followed by: [AOT]. 0x00000014, // D followed by: [CE]. 0x00000000, // E. 0x00001800, // F followed by: [LM]. 0x00100001, // G followed by: [AU]. 0x00000100, // H followed by: [I]. 0x00002809, // I followed by: [ADLN]. 0x00000000, // J. 0x01040000, // K followed by: [SY]. 0x00000001, // L followed by: [A]. 0x000ce199, // M followed by: [ADEHINOPST]. 0x0120129c, // N followed by: [CDEHJMVY]. 0x00020480, // O followed by: [HKR]. 0x00420001, // P followed by: [ARW]. 0x00000000, // Q. 0x00000100, // R followed by: [I]. 0x0000000c, // S followed by: [CD]. 0x00802000, // T followed by: [NX]. 0x00080000, // U followed by: [T]. 0x00080101, // V followed by: [AIT]. 0x01200101 // W followed by: [AIVY]. }; // Accumulative number of states for the 2-letter code indexed by the first. static const int state_two_letter_accumulative[24] = { 0, 5, 5, 8, 10, 10, 12, 14, 15, 19, 19, 21, 22, 32, 40, 43, 46, 46, 47, 49, 51, 52, 55, 59 }; // State names sorted alphabetically with their lengths. // There can be more than one possible name for a same state if desired. static const struct StateNameInfo { const char* string; char first_word_length; char length; char state_index; // Relative to two-character code alphabetical order. } state_names[59] = { { "alabama", 7, 7, 1 }, { "alaska", 6, 6, 0 }, { "american samoa", 8, 14, 3 }, { "arizona", 7, 7, 4 }, { "arkansas", 8, 8, 2 }, { "california", 10, 10, 5 }, { "colorado", 8, 8, 6 }, { "connecticut", 11, 11, 7 }, { "delaware", 8, 8, 9 }, { "district of columbia", 8, 20, 8 }, { "federated states of micronesia", 9, 30, 11 }, { "florida", 7, 7, 10 }, { "guam", 4, 4, 13 }, { "georgia", 7, 7, 12 }, { "hawaii", 6, 6, 14 }, { "idaho", 5, 5, 16 }, { "illinois", 8, 8, 17 }, { "indiana", 7, 7, 18 }, { "iowa", 4, 4, 15 }, { "kansas", 6, 6, 19 }, { "kentucky", 8, 8, 20 }, { "louisiana", 9, 9, 21 }, { "maine", 5, 5, 24 }, { "marshall islands", 8, 16, 25 }, { "maryland", 8, 8, 23 }, { "massachusetts", 13, 13, 22 }, { "michigan", 8, 8, 26 }, { "minnesota", 9, 9, 27 }, { "mississippi", 11, 11, 30 }, { "missouri", 8, 8, 28 }, { "montana", 7, 7, 31 }, { "nebraska", 8, 8, 34 }, { "nevada", 6, 6, 38 }, { "new hampshire", 3, 13, 35 }, { "new jersey", 3, 10, 36 }, { "new mexico", 3, 10, 37 }, { "new york", 3, 8, 39 }, { "north carolina", 5, 14, 32 }, { "north dakota", 5, 12, 33 }, { "northern mariana islands", 8, 24, 29 }, { "ohio", 4, 4, 40 }, { "oklahoma", 8, 8, 41 }, { "oregon", 6, 6, 42 }, { "palau", 5, 5, 45 }, { "pennsylvania", 12, 12, 43 }, { "puerto rico", 6, 11, 44 }, { "rhode island", 5, 5, 46 }, { "south carolina", 5, 14, 47 }, { "south dakota", 5, 12, 48 }, { "tennessee", 9, 9, 49 }, { "texas", 5, 5, 50 }, { "utah", 4, 4, 51 }, { "vermont", 7, 7, 54 }, { "virgin islands", 6, 14, 53 }, { "virginia", 8, 8, 52 }, { "washington", 10, 10, 55 }, { "west virginia", 4, 13, 57 }, { "wisconsin", 9, 9, 56 }, { "wyoming", 7, 7, 58 } }; // Accumulative number of states for sorted names indexed by the first letter. // Required a different one since there are codes that don't share their // first letter with the name of their state (MP = Northern Mariana Islands). static const int state_names_accumulative[24] = { 0, 5, 5, 8, 10, 10, 12, 14, 15, 19, 19, 21, 22, 31, 40, 43, 46, 46, 47, 49, 51, 52, 55, 59 }; DCHECK_EQ(state_names_accumulative[arraysize(state_names_accumulative) - 1], static_cast<int>(ARRAYSIZE_UNSAFE(state_names))); const Word& first_word = words->at(state_first_word); int length = first_word.end - first_word.begin; if (length < 2 || !IsAsciiAlpha(*first_word.begin)) return false; // No state names start with x, y, z. char16 first_letter = base::ToLowerASCII(*first_word.begin); if (first_letter > 'w') return false; DCHECK(first_letter >= 'a'); int first_index = first_letter - 'a'; // Look for two-letter state names. if (length == 2 && IsAsciiAlpha(*(first_word.begin + 1))) { char16 second_letter = base::ToLowerASCII(*(first_word.begin + 1)); DCHECK(second_letter >= 'a'); int second_index = second_letter - 'a'; if (!(state_two_letter_suffix[first_index] & (1 << second_index))) return false; std::bitset<32> previous_suffixes = state_two_letter_suffix[first_index] & ((1 << second_index) - 1); *state_last_word = state_first_word; *state_index = state_two_letter_accumulative[first_index] + previous_suffixes.count(); return true; } // Look for full state names by their first letter. Discard by length. for (int state = state_names_accumulative[first_index]; state < state_names_accumulative[first_index + 1]; ++state) { if (state_names[state].first_word_length != length) continue; bool state_match = false; size_t state_word = state_first_word; for (int pos = 0; true; ) { if (!WordLowerCaseEqualsASCII(words->at(state_word).begin, words->at(state_word).end, &state_names[state].string[pos])) break; pos += words->at(state_word).end - words->at(state_word).begin + 1; if (pos >= state_names[state].length) { state_match = true; break; } // Ran out of words, extract more from the tokenizer. if (++state_word == words->size()) { do { if (!tokenizer->GetNext()) break; } while (tokenizer->token_is_delim()); words->push_back( Word(tokenizer->token_begin(), tokenizer->token_end())); } } if (state_match) { *state_last_word = state_word; *state_index = state_names[state].state_index; return true; } } return false; } bool IsZipValid(const Word& word, size_t state_index) { size_t length = word.end - word.begin; if (length != kZipDigits && length != kZipPlus4Digits + 1) return false; for (string16::const_iterator it = word.begin; it != word.end; ++it) { size_t pos = it - word.begin; if (IsAsciiDigit(*it) || (*it == '-' && pos == kZipDigits)) continue; return false; } return IsZipValidForState(word, state_index); } bool IsZipValidForState(const Word& word, size_t state_index) { // List of valid zip code ranges. static const struct { signed char low; signed char high; signed char exception1; signed char exception2; } zip_range[] = { { 99, 99, -1, -1 }, // AK Alaska. { 35, 36, -1, -1 }, // AL Alabama. { 71, 72, -1, -1 }, // AR Arkansas. { 96, 96, -1, -1 }, // AS American Samoa. { 85, 86, -1, -1 }, // AZ Arizona. { 90, 96, -1, -1 }, // CA California. { 80, 81, -1, -1 }, // CO Colorado. { 6, 6, -1, -1 }, // CT Connecticut. { 20, 20, -1, -1 }, // DC District of Columbia. { 19, 19, -1, -1 }, // DE Delaware. { 32, 34, -1, -1 }, // FL Florida. { 96, 96, -1, -1 }, // FM Federated States of Micronesia. { 30, 31, -1, -1 }, // GA Georgia. { 96, 96, -1, -1 }, // GU Guam. { 96, 96, -1, -1 }, // HI Hawaii. { 50, 52, -1, -1 }, // IA Iowa. { 83, 83, -1, -1 }, // ID Idaho. { 60, 62, -1, -1 }, // IL Illinois. { 46, 47, -1, -1 }, // IN Indiana. { 66, 67, 73, -1 }, // KS Kansas. { 40, 42, -1, -1 }, // KY Kentucky. { 70, 71, -1, -1 }, // LA Louisiana. { 1, 2, -1, -1 }, // MA Massachusetts. { 20, 21, -1, -1 }, // MD Maryland. { 3, 4, -1, -1 }, // ME Maine. { 96, 96, -1, -1 }, // MH Marshall Islands. { 48, 49, -1, -1 }, // MI Michigan. { 55, 56, -1, -1 }, // MN Minnesota. { 63, 65, -1, -1 }, // MO Missouri. { 96, 96, -1, -1 }, // MP Northern Mariana Islands. { 38, 39, -1, -1 }, // MS Mississippi. { 55, 56, -1, -1 }, // MT Montana. { 27, 28, -1, -1 }, // NC North Carolina. { 58, 58, -1, -1 }, // ND North Dakota. { 68, 69, -1, -1 }, // NE Nebraska. { 3, 4, -1, -1 }, // NH New Hampshire. { 7, 8, -1, -1 }, // NJ New Jersey. { 87, 88, 86, -1 }, // NM New Mexico. { 88, 89, 96, -1 }, // NV Nevada. { 10, 14, 0, 6 }, // NY New York. { 43, 45, -1, -1 }, // OH Ohio. { 73, 74, -1, -1 }, // OK Oklahoma. { 97, 97, -1, -1 }, // OR Oregon. { 15, 19, -1, -1 }, // PA Pennsylvania. { 6, 6, 0, 9 }, // PR Puerto Rico. { 96, 96, -1, -1 }, // PW Palau. { 2, 2, -1, -1 }, // RI Rhode Island. { 29, 29, -1, -1 }, // SC South Carolina. { 57, 57, -1, -1 }, // SD South Dakota. { 37, 38, -1, -1 }, // TN Tennessee. { 75, 79, 87, 88 }, // TX Texas. { 84, 84, -1, -1 }, // UT Utah. { 22, 24, 20, -1 }, // VA Virginia. { 6, 9, -1, -1 }, // VI Virgin Islands. { 5, 5, -1, -1 }, // VT Vermont. { 98, 99, -1, -1 }, // WA Washington. { 53, 54, -1, -1 }, // WI Wisconsin. { 24, 26, -1, -1 }, // WV West Virginia. { 82, 83, -1, -1 } // WY Wyoming. }; // Zip numeric value for the first two characters. DCHECK(word.begin != word.end); DCHECK(IsAsciiDigit(*word.begin)); DCHECK(IsAsciiDigit(*(word.begin + 1))); int zip_prefix = (*word.begin - '0') * 10 + (*(word.begin + 1) - '0'); if ((zip_prefix >= zip_range[state_index].low && zip_prefix <= zip_range[state_index].high) || zip_prefix == zip_range[state_index].exception1 || zip_prefix == zip_range[state_index].exception2) { return true; } return false; } bool IsValidLocationName(const Word& word) { // Supported location names sorted alphabetically and grouped by first letter. static const struct LocationNameInfo { const char* string; char length; bool allow_plural; } location_names[157] = { { "alley", 5, false }, { "annex", 5, false }, { "arcade", 6, false }, { "ave", 3, false }, { "ave.", 4, false }, { "avenue", 6, false }, { "alameda", 7, false }, { "bayou", 5, false }, { "beach", 5, false }, { "bend", 4, false }, { "bluff", 5, true }, { "bottom", 6, false }, { "boulevard", 9, false }, { "branch", 6, false }, { "bridge", 6, false }, { "brook", 5, true }, { "burg", 4, true }, { "bypass", 6, false }, { "broadway", 8, false }, { "camino", 6, false }, { "camp", 4, false }, { "canyon", 6, false }, { "cape", 4, false }, { "causeway", 8, false }, { "center", 6, true }, { "circle", 6, true }, { "cliff", 5, true }, { "club", 4, false }, { "common", 6, false }, { "corner", 6, true }, { "course", 6, false }, { "court", 5, true }, { "cove", 4, true }, { "creek", 5, false }, { "crescent", 8, false }, { "crest", 5, false }, { "crossing", 8, false }, { "crossroad", 9, false }, { "curve", 5, false }, { "circulo", 7, false }, { "dale", 4, false }, { "dam", 3, false }, { "divide", 6, false }, { "drive", 5, true }, { "estate", 6, true }, { "expressway", 10, false }, { "extension", 9, true }, { "fall", 4, true }, { "ferry", 5, false }, { "field", 5, true }, { "flat", 4, true }, { "ford", 4, true }, { "forest", 6, false }, { "forge", 5, true }, { "fork", 4, true }, { "fort", 4, false }, { "freeway", 7, false }, { "garden", 6, true }, { "gateway", 7, false }, { "glen", 4, true }, { "green", 5, true }, { "grove", 5, true }, { "harbor", 6, true }, { "haven", 5, false }, { "heights", 7, false }, { "highway", 7, false }, { "hill", 4, true }, { "hollow", 6, false }, { "inlet", 5, false }, { "island", 6, true }, { "isle", 4, false }, { "junction", 8, true }, { "key", 3, true }, { "knoll", 5, true }, { "lake", 4, true }, { "land", 4, false }, { "landing", 7, false }, { "lane", 4, false }, { "light", 5, true }, { "loaf", 4, false }, { "lock", 4, true }, { "lodge", 5, false }, { "loop", 4, false }, { "mall", 4, false }, { "manor", 5, true }, { "meadow", 6, true }, { "mews", 4, false }, { "mill", 4, true }, { "mission", 7, false }, { "motorway", 8, false }, { "mount", 5, false }, { "mountain", 8, true }, { "neck", 4, false }, { "orchard", 7, false }, { "oval", 4, false }, { "overpass", 8, false }, { "park", 4, true }, { "parkway", 7, true }, { "pass", 4, false }, { "passage", 7, false }, { "path", 4, false }, { "pike", 4, false }, { "pine", 4, true }, { "plain", 5, true }, { "plaza", 5, false }, { "point", 5, true }, { "port", 4, true }, { "prairie", 7, false }, { "privada", 7, false }, { "radial", 6, false }, { "ramp", 4, false }, { "ranch", 5, false }, { "rapid", 5, true }, { "rest", 4, false }, { "ridge", 5, true }, { "river", 5, false }, { "road", 4, true }, { "route", 5, false }, { "row", 3, false }, { "rue", 3, false }, { "run", 3, false }, { "shoal", 5, true }, { "shore", 5, true }, { "skyway", 6, false }, { "spring", 6, true }, { "spur", 4, true }, { "square", 6, true }, { "station", 7, false }, { "stravenue", 9, false }, { "stream", 6, false }, { "st", 2, false }, { "st.", 3, false }, { "street", 6, true }, { "summit", 6, false }, { "speedway", 8, false }, { "terrace", 7, false }, { "throughway", 10, false }, { "trace", 5, false }, { "track", 5, false }, { "trafficway", 10, false }, { "trail", 5, false }, { "tunnel", 6, false }, { "turnpike", 8, false }, { "underpass", 9, false }, { "union", 5, true }, { "valley", 6, true }, { "viaduct", 7, false }, { "view", 4, true }, { "village", 7, true }, { "ville", 5, false }, { "vista", 5, false }, { "walk", 4, true }, { "wall", 4, false }, { "way", 3, true }, { "well", 4, true }, { "xing", 4, false }, { "xrd", 3, false } }; // Accumulative number of location names for each starting letter. static const int location_names_accumulative[25] = { 0, 7, 19, 40, 44, 47, 57, 62, 68, 71, 72, 74, 83, 92, 93, 96, 109, 109, 121, 135, 143, 145, 151, 155, 157 }; DCHECK_EQ( location_names_accumulative[arraysize(location_names_accumulative) - 1], static_cast<int>(ARRAYSIZE_UNSAFE(location_names))); if (!IsAsciiAlpha(*word.begin)) return false; // No location names start with y, z. char16 first_letter = base::ToLowerASCII(*word.begin); if (first_letter > 'x') return false; DCHECK(first_letter >= 'a'); int index = first_letter - 'a'; int length = std::distance(word.begin, word.end); for (int i = location_names_accumulative[index]; i < location_names_accumulative[index + 1]; ++i) { if (location_names[i].length != length && (location_names[i].allow_plural && location_names[i].length + 1 != length)) { continue; } if (LowerCaseEqualsASCIIWithPlural(word.begin, word.end, location_names[i].string, location_names[i].allow_plural)) { return true; } } return false; } } // namespace internal } // namespace address_parser } // namespace content
/* * Copyright 2013 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #if SK_SUPPORT_GPU #include "GrContext.h" #include "GrContextFactory.h" #include "GrRenderTarget.h" #include "GrTexture.h" #include "SkTypes.h" #include "Test.h" DEF_GPUTEST(GrSurface, reporter, factory) { GrContext* context = factory->get(GrContextFactory::kNull_GLContextType); if (NULL != context) { GrTextureDesc desc; desc.fConfig = kSkia8888_GrPixelConfig; desc.fFlags = kRenderTarget_GrTextureFlagBit; desc.fWidth = 256; desc.fHeight = 256; desc.fSampleCnt = 0; GrSurface* texRT1 = context->createUncachedTexture(desc, NULL, 0); GrSurface* texRT2 = context->createUncachedTexture(desc, NULL, 0); desc.fFlags = kNone_GrTextureFlags; GrSurface* tex1 = context->createUncachedTexture(desc, NULL, 0); REPORTER_ASSERT(reporter, texRT1->isSameAs(texRT1)); REPORTER_ASSERT(reporter, texRT1->isSameAs(texRT1->asRenderTarget())); REPORTER_ASSERT(reporter, texRT1->asRenderTarget()->isSameAs(texRT1)); REPORTER_ASSERT(reporter, !texRT2->isSameAs(texRT1)); REPORTER_ASSERT(reporter, !texRT2->asRenderTarget()->isSameAs(texRT1)); REPORTER_ASSERT(reporter, !texRT2->isSameAs(texRT1->asRenderTarget())); REPORTER_ASSERT(reporter, !texRT2->isSameAs(tex1)); REPORTER_ASSERT(reporter, !texRT2->asRenderTarget()->isSameAs(tex1)); GrBackendTextureDesc backendDesc; backendDesc.fConfig = kSkia8888_GrPixelConfig; backendDesc.fFlags = kRenderTarget_GrBackendTextureFlag; backendDesc.fWidth = 256; backendDesc.fHeight = 256; backendDesc.fSampleCnt = 0; backendDesc.fTextureHandle = 5; GrSurface* externalTexRT = context->wrapBackendTexture(backendDesc); REPORTER_ASSERT(reporter, externalTexRT->isSameAs(externalTexRT)); REPORTER_ASSERT(reporter, externalTexRT->isSameAs(externalTexRT->asRenderTarget())); REPORTER_ASSERT(reporter, externalTexRT->asRenderTarget()->isSameAs(externalTexRT)); REPORTER_ASSERT(reporter, !externalTexRT->isSameAs(texRT1)); REPORTER_ASSERT(reporter, !externalTexRT->asRenderTarget()->isSameAs(texRT1)); texRT1->unref(); texRT2->unref(); tex1->unref(); externalTexRT->unref(); } } #endif
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/contrib/lite/toco/import_tensorflow.h" #include <memory> #include <string> #include <utility> #include <vector> #include "google/protobuf/map.h" #include "google/protobuf/text_format.h" #include "absl/memory/memory.h" #include "absl/strings/match.h" #include "absl/strings/numbers.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include "absl/strings/strip.h" #include "tensorflow/contrib/lite/toco/model.h" #include "tensorflow/contrib/lite/toco/model_flags.pb.h" #include "tensorflow/contrib/lite/toco/tensorflow_graph_matching/resolve_cluster.h" #include "tensorflow/contrib/lite/toco/tensorflow_util.h" #include "tensorflow/contrib/lite/toco/tooling_util.h" #include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/common_runtime/function.h" #include "tensorflow/core/common_runtime/process_function_library_runtime.h" #include "tensorflow/core/framework/attr_value.pb.h" #include "tensorflow/core/framework/function.pb.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/node_def.pb.h" #include "tensorflow/core/framework/tensor.pb.h" #include "tensorflow/core/framework/tensor_shape.pb.h" #include "tensorflow/core/framework/types.pb.h" #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/session_options.h" #include "tensorflow/core/public/version.h" using tensorflow::AttrValue; using tensorflow::DT_BOOL; using tensorflow::DT_FLOAT; using tensorflow::DT_INT32; using tensorflow::DT_INT64; using tensorflow::DT_QUINT8; using tensorflow::DT_STRING; using tensorflow::DT_UINT8; using tensorflow::GraphDef; using tensorflow::NodeDef; using tensorflow::OpRegistry; using tensorflow::TensorProto; using tensorflow::TensorShapeProto; namespace toco { namespace { bool HasAttr(const NodeDef& node, const string& attr_name) { return node.attr().count(attr_name) > 0; } bool HasWildcardDimension(const TensorShapeProto& shape) { for (const auto& dim : shape.dim()) { if (dim.size() == -1) return true; } return false; } const string& GetStringAttr(const NodeDef& node, const string& attr_name) { CHECK(HasAttr(node, attr_name)); const auto& attr = node.attr().at(attr_name); CHECK_EQ(attr.value_case(), AttrValue::kS); return attr.s(); } int64 GetIntAttr(const NodeDef& node, const string& attr_name) { CHECK(HasAttr(node, attr_name)) << attr_name << " not found in:\n" << node.DebugString(); const auto& attr = node.attr().at(attr_name); CHECK_EQ(attr.value_case(), AttrValue::kI); return attr.i(); } float GetFloatAttr(const NodeDef& node, const string& attr_name) { CHECK(HasAttr(node, attr_name)); const auto& attr = node.attr().at(attr_name); CHECK_EQ(attr.value_case(), AttrValue::kF); return attr.f(); } bool GetBoolAttr(const NodeDef& node, const string& attr_name) { CHECK(HasAttr(node, attr_name)); const auto& attr = node.attr().at(attr_name); CHECK_EQ(attr.value_case(), AttrValue::kB); return attr.b(); } tensorflow::DataType GetDataTypeAttr(const NodeDef& node, const string& attr_name) { CHECK(HasAttr(node, attr_name)); const auto& attr = node.attr().at(attr_name); CHECK_EQ(attr.value_case(), AttrValue::kType); return attr.type(); } const TensorShapeProto& GetShapeAttr(const NodeDef& node, const string& attr_name) { CHECK(HasAttr(node, attr_name)); const auto& attr = node.attr().at(attr_name); CHECK_EQ(attr.value_case(), AttrValue::kShape); return attr.shape(); } const TensorProto& GetTensorAttr(const NodeDef& node, const string& attr_name) { CHECK(HasAttr(node, attr_name)) << "No attr named '" << attr_name << "'"; const auto& attr = node.attr().at(attr_name); CHECK_EQ(attr.value_case(), AttrValue::kTensor); return attr.tensor(); } const AttrValue::ListValue& GetListAttr(const NodeDef& node, const string& attr_name) { CHECK(HasAttr(node, attr_name)); const auto& attr = node.attr().at(attr_name); CHECK_EQ(attr.value_case(), AttrValue::kList); return attr.list(); } tensorflow::Status CheckOptionalAttr(const NodeDef& node, const string& attr_name, const string& expected_value) { if (HasAttr(node, attr_name)) { const string& value = GetStringAttr(node, attr_name); if (value != expected_value) { return tensorflow::errors::InvalidArgument( "Unexpected value for attribute '" + attr_name + "'. Expected '" + expected_value + "'"); } } return tensorflow::Status::OK(); } tensorflow::Status CheckOptionalAttr( const NodeDef& node, const string& attr_name, const tensorflow::DataType& expected_value) { if (HasAttr(node, attr_name)) { const tensorflow::DataType& value = GetDataTypeAttr(node, attr_name); if (value != expected_value) { return tensorflow::errors::InvalidArgument( "Unexpected value for attribute '" + attr_name + "'. Expected '" + tensorflow::DataType_Name(expected_value) + "'"); } } return tensorflow::Status::OK(); } template <typename T1, typename T2> tensorflow::Status ExpectValue(const T1& v1, const T2& v2, const string& description) { if (v1 == v2) return tensorflow::Status::OK(); return tensorflow::errors::InvalidArgument(absl::StrCat( "Unexpected ", description, ": got ", v1, ", expected ", v2)); } ArrayDataType ConvertDataType(tensorflow::DataType dtype) { if (dtype == DT_UINT8) return ArrayDataType::kUint8; else if (dtype == DT_FLOAT) return ArrayDataType::kFloat; else if (dtype == DT_BOOL) return ArrayDataType::kBool; else if (dtype == DT_INT32) return ArrayDataType::kInt32; else if (dtype == DT_INT64) return ArrayDataType::kInt64; else if (dtype == DT_STRING) return ArrayDataType::kString; else LOG(INFO) << "Unsupported data type in placeholder op: " << dtype; return ArrayDataType::kNone; } tensorflow::Status ImportShape( const TFLITE_PROTO_NS::RepeatedPtrField<tensorflow::TensorShapeProto_Dim>& input_dims, int* input_flat_size, Shape* shape) { std::vector<int> input_dims_only_sizes; for (auto& d : input_dims) { if (d.size() == 0) { // Some TensorFlow shapes contain a 0 dim, effectively making // them of flat size 0 even though they have other nonzero dims. // This breaks our invariant, that array dims can't be 0. // For now, tweaking this to record a 0-D shape instead. shape->mutable_dims()->clear(); if (input_flat_size != nullptr) *input_flat_size = 0; return tensorflow::Status::OK(); } // TensorFlow's shapes use int64s, while TOCO uses ints. if (d.size() > std::numeric_limits<int>::max()) { return tensorflow::errors::InvalidArgument("Shape element overflows"); } input_dims_only_sizes.push_back(d.size()); } *shape->mutable_dims() = input_dims_only_sizes; if (input_flat_size == nullptr) return tensorflow::Status::OK(); return NumElements(input_dims_only_sizes, input_flat_size); } tensorflow::Status ImportFloatArray(const TensorProto& input_tensor, Array* output_array) { CHECK_EQ(input_tensor.dtype(), DT_FLOAT); const auto& input_shape = input_tensor.tensor_shape(); CHECK_LE(input_shape.dim_size(), 6); int input_flat_size; auto status = ImportShape(input_shape.dim(), &input_flat_size, output_array->mutable_shape()); if (!status.ok()) return status; auto& output_float_data = output_array->GetMutableBuffer<ArrayDataType::kFloat>().data; output_float_data.resize(RequiredBufferSizeForShape(output_array->shape()), 0.f); CHECK_GE(output_float_data.size(), input_flat_size); if (input_tensor.float_val_size() == 1) { for (int i = 0; i < input_flat_size; i++) { output_float_data[i] = input_tensor.float_val(0); } } else if (input_tensor.float_val_size() == input_flat_size) { for (int i = 0; i < input_tensor.float_val_size(); i++) { output_float_data[i] = input_tensor.float_val(i); } } else if (input_tensor.tensor_content().size() == input_flat_size * sizeof(float)) { toco::port::CopyToBuffer(input_tensor.tensor_content(), reinterpret_cast<char*>(output_float_data.data())); } else { return tensorflow::errors::InvalidArgument( absl::StrCat("Neither input_content (", input_tensor.tensor_content().size() / sizeof(float), ") nor float_val (", input_tensor.float_val_size(), ") have the right dimensions (", input_flat_size, ") for this float tensor")); } return tensorflow::Status::OK(); } tensorflow::Status ImportQuint8Array(const TensorProto& input_tensor, Array* output_array) { CHECK_EQ(input_tensor.dtype(), DT_QUINT8); const auto& input_shape = input_tensor.tensor_shape(); CHECK_LE(input_shape.dim_size(), 6); int input_flat_size; auto status = ImportShape(input_shape.dim(), &input_flat_size, output_array->mutable_shape()); if (!status.ok()) return status; auto& output_int_data = output_array->GetMutableBuffer<ArrayDataType::kUint8>().data; output_int_data.resize(RequiredBufferSizeForShape(output_array->shape()), 0); CHECK_GE(output_int_data.size(), input_flat_size); if (input_tensor.int_val_size() == 1) { for (int i = 0; i < input_flat_size; i++) { output_int_data[i] = input_tensor.int_val(0); } } else if (input_tensor.int_val_size() == input_flat_size) { for (int i = 0; i < input_tensor.int_val_size(); i++) { output_int_data[i] = input_tensor.int_val(i); } } else if (input_tensor.tensor_content().size() == input_flat_size * sizeof(uint8_t)) { toco::port::CopyToBuffer(input_tensor.tensor_content(), reinterpret_cast<char*>(output_int_data.data())); } else { return tensorflow::errors::InvalidArgument( absl::StrCat("Neither input_content (", input_tensor.tensor_content().size() / sizeof(uint8_t), ") nor int_val (", input_tensor.int_val_size(), ") have the right dimensions (", input_flat_size, ") for this uint8 tensor")); } return tensorflow::Status::OK(); } tensorflow::Status ImportInt32Array(const TensorProto& input_tensor, Array* output_array) { CHECK_EQ(input_tensor.dtype(), DT_INT32); const auto& input_shape = input_tensor.tensor_shape(); CHECK_LE(input_shape.dim_size(), 6); int input_flat_size; auto status = ImportShape(input_shape.dim(), &input_flat_size, output_array->mutable_shape()); if (!status.ok()) return status; auto& output_int_data = output_array->GetMutableBuffer<ArrayDataType::kInt32>().data; output_int_data.resize(RequiredBufferSizeForShape(output_array->shape()), 0); CHECK_GE(output_int_data.size(), input_flat_size); if (input_tensor.int_val_size() == 1) { for (int i = 0; i < input_flat_size; i++) { output_int_data[i] = input_tensor.int_val(0); } } else if (input_tensor.int_val_size() == input_flat_size) { for (int i = 0; i < input_tensor.int_val_size(); i++) { output_int_data[i] = input_tensor.int_val(i); } } else if (input_tensor.tensor_content().size() == input_flat_size * sizeof(int32)) { toco::port::CopyToBuffer(input_tensor.tensor_content(), reinterpret_cast<char*>(output_int_data.data())); } else { return tensorflow::errors::InvalidArgument(absl::StrCat( "Neither input_content (", input_tensor.tensor_content().size() / sizeof(int32), ") nor int_val (", input_tensor.int_val_size(), ") have the right dimensions (", input_flat_size, ") for this int32 tensor")); } return tensorflow::Status::OK(); } tensorflow::Status ImportInt64Array(const TensorProto& input_tensor, Array* output_array) { CHECK_EQ(input_tensor.dtype(), DT_INT64); const auto& input_shape = input_tensor.tensor_shape(); CHECK_LE(input_shape.dim_size(), 6); int input_flat_size; auto status = ImportShape(input_shape.dim(), &input_flat_size, output_array->mutable_shape()); if (!status.ok()) return status; auto& output_int_data = output_array->GetMutableBuffer<ArrayDataType::kInt64>().data; output_int_data.resize(RequiredBufferSizeForShape(output_array->shape()), 0); CHECK_GE(output_int_data.size(), input_flat_size); if (input_tensor.int64_val_size() == 1) { for (int i = 0; i < input_flat_size; i++) { output_int_data[i] = input_tensor.int64_val(0); } } else if (input_tensor.int64_val_size() == input_flat_size) { for (int i = 0; i < input_tensor.float_val_size(); i++) { output_int_data[i] = input_tensor.int64_val(i); } } else if (input_tensor.tensor_content().size() == input_flat_size * sizeof(int64)) { toco::port::CopyToBuffer(input_tensor.tensor_content(), reinterpret_cast<char*>(output_int_data.data())); } else { return tensorflow::errors::InvalidArgument( absl::StrCat("Neither input_content (", input_tensor.tensor_content().size() / sizeof(int64), ") nor int64_val (", input_tensor.int64_val_size(), ") have the right dimensions (", input_flat_size, ") for this int64 tensor")); } return tensorflow::Status::OK(); } tensorflow::Status ImportBoolArray(const TensorProto& input_tensor, Array* output_array) { CHECK_EQ(input_tensor.dtype(), DT_BOOL); const auto& input_shape = input_tensor.tensor_shape(); CHECK_LE(input_shape.dim_size(), 6); int input_flat_size; auto status = ImportShape(input_shape.dim(), &input_flat_size, output_array->mutable_shape()); if (!status.ok()) return status; auto& output_bool_data = output_array->GetMutableBuffer<ArrayDataType::kBool>().data; output_bool_data.resize(RequiredBufferSizeForShape(output_array->shape()), false); CHECK_GE(output_bool_data.size(), input_flat_size); if (input_tensor.bool_val_size() == 1) { for (int i = 0; i < input_flat_size; i++) { output_bool_data[i] = input_tensor.bool_val(0); } } else if (input_tensor.bool_val_size() == input_flat_size) { for (int i = 0; i < input_tensor.bool_val_size(); i++) { output_bool_data[i] = input_tensor.bool_val(i); } } else if (input_tensor.tensor_content().size() == input_flat_size) { std::vector<char> buf(input_tensor.tensor_content().size()); toco::port::CopyToBuffer(input_tensor.tensor_content(), buf.data()); for (int i = 0; i < input_tensor.tensor_content().size(); i++) { output_bool_data[i] = static_cast<bool>(buf[i]); } } else { // Some graphs have bool const nodes without actual value... // assuming that 'false' is implied. // So far only encountered that in an array with 1 entry, let's // require that until we encounter a graph where that's not the case. if (output_bool_data.size() != 1) { return tensorflow::errors::InvalidArgument(absl::StrCat( "Neither input_content (", input_tensor.tensor_content().size(), ") nor bool_val (", input_tensor.bool_val_size(), ") have the right dimensions (", input_flat_size, ") for this bool tensor")); } output_bool_data[0] = false; } return tensorflow::Status::OK(); } tensorflow::Status ImportStringArray(const TensorProto& input_tensor, Array* output_array) { CHECK_EQ(input_tensor.dtype(), DT_STRING); const auto& input_shape = input_tensor.tensor_shape(); CHECK_LE(input_shape.dim_size(), 6); int input_flat_size; auto status = ImportShape(input_shape.dim(), &input_flat_size, output_array->mutable_shape()); if (!status.ok()) return status; if (input_flat_size != input_tensor.string_val_size()) { return tensorflow::errors::InvalidArgument( "Input_content string_val doesn't have the right dimensions " "for this string tensor"); } auto& output_string_data = output_array->GetMutableBuffer<ArrayDataType::kString>().data; output_string_data.resize(RequiredBufferSizeForShape(output_array->shape())); CHECK_GE(output_string_data.size(), input_flat_size); for (int i = 0; i < input_flat_size; ++i) { output_string_data[i] = input_tensor.string_val(i); } return tensorflow::Status::OK(); } // Count the number of inputs of a given node. If // `tf_import_flags.drop_control_dependency` is true, count the number of // non-control-dependency inputs. int GetInputsCount(const NodeDef& node, const TensorFlowImportFlags& tf_import_flags) { if (tf_import_flags.drop_control_dependency) { for (size_t i = 0; i < node.input_size(); ++i) { if (node.input(i)[0] == '^') { return i; } } } return node.input_size(); } tensorflow::Status CheckInputsCount( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, int expected_input_count) { if (GetInputsCount(node, tf_import_flags) != expected_input_count) { return tensorflow::errors::FailedPrecondition( node.op(), " node expects ", expected_input_count, " input(s) other than control dependencies: ", node.DebugString()); } return tensorflow::Status::OK(); } template <ArrayDataType T> string CreateConstArray(Model* model, string const& name, std::vector<typename toco::DataType<T> > const& data) { // Utility function to create a const 1D array, useful for input parameters. string array_name = toco::AvailableArrayName(*model, name); auto& array = model->GetOrCreateArray(array_name); array.data_type = T; array.mutable_shape()->mutable_dims()->emplace_back(data.size()); array.GetMutableBuffer<T>().data = data; return array_name; } // Retain TensorFlow NodeDef in Toco Operator. // // If an op is supported by Toco but not supported by TFLite, TFLite exporter // will use the retained NodeDef to populate a Flex op when Flex mode is // enabled. // // This can't be easily applied to all operations, because a TensorFlow node // may become multiple Toco operators. Thus we need to call this function in // operator conversion functions one by one whenever feasible. // // This may cause problems if a graph transformation rule changes parameters // of the node. When calling this function, please check if any existing // graph transformation rule will change an existing operator with the same // type. // // This provides a route to handle Toco-supported & TFLite-unsupported ops // in Flex mode. However it's not a solid solution. Eventually we should // get rid of this. // TODO(b/117327937): Implement all Toco-supported ops in TFLite, and remove // this function. void RetainTensorFlowNodeDef(const NodeDef& node, Operator* op) { node.SerializeToString(&op->tensorflow_node_def); } tensorflow::Status ConvertConstOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Const"); const auto& tensor = GetTensorAttr(node, "value"); const auto dtype = GetDataTypeAttr(node, "dtype"); tensorflow::Status status = tensorflow::Status::OK(); auto& array = model->GetOrCreateArray(node.name()); switch (dtype) { case DT_FLOAT: array.data_type = ArrayDataType::kFloat; status = ImportFloatArray(tensor, &array); break; case DT_INT32: array.data_type = ArrayDataType::kInt32; status = ImportInt32Array(tensor, &array); break; case DT_QUINT8: array.data_type = ArrayDataType::kUint8; status = ImportQuint8Array(tensor, &array); break; case DT_INT64: array.data_type = ArrayDataType::kInt64; status = ImportInt64Array(tensor, &array); break; case DT_STRING: array.data_type = ArrayDataType::kString; status = ImportStringArray(tensor, &array); break; case DT_BOOL: array.data_type = ArrayDataType::kBool; status = ImportBoolArray(tensor, &array); break; default: array.data_type = ArrayDataType::kNone; // do nothing, silently ignore the Const data. // We just make a dummy buffer to indicate that // this array does not rely on external input. array.GetMutableBuffer<ArrayDataType::kNone>(); break; } TF_RETURN_WITH_CONTEXT_IF_ERROR( status, " (while processing node '" + node.name() + "')"); return tensorflow::Status::OK(); } tensorflow::Status ConvertConvOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Conv2D"); TF_RETURN_IF_ERROR(CheckInputsCount(node, tf_import_flags, 2)); // We only support NHWC, which is the default data_format. // So if data_format is not defined, we're all good. TF_RETURN_IF_ERROR(CheckOptionalAttr(node, "data_format", "NHWC")); TF_RETURN_IF_ERROR(CheckOptionalAttr(node, "T", DT_FLOAT)); const auto& input_name = node.input(0); const auto& weights_name = node.input(1); const auto& reordered_weights_name = weights_name + "_reordered"; // Check if a ReorderAxesOperator was already created for these weights // (that happens when multiple layers share the same weights). const Operator* existing_reorder = GetOpWithOutput(*model, reordered_weights_name); if (existing_reorder) { // Check that it is safe to rely on the _reordered naming of the output // array! CHECK(existing_reorder->type == OperatorType::kReorderAxes); } else { // Create a new ReorderAxesOperator auto* reorder = new ReorderAxesOperator; reorder->inputs = {weights_name}; reorder->outputs = {reordered_weights_name}; reorder->input_axes_order = AxesOrder::kHWIO; reorder->output_axes_order = AxesOrder::kOHWI; model->operators.emplace_back(reorder); } auto* conv = new ConvOperator; conv->inputs = {input_name, reordered_weights_name}; conv->outputs = {node.name()}; if (!HasAttr(node, "strides")) { return tensorflow::errors::InvalidArgument("Missing attribute 'strides'"); } const auto& strides = GetListAttr(node, "strides"); TF_RETURN_IF_ERROR(ExpectValue(strides.i_size(), 4, "number of strides")); TF_RETURN_IF_ERROR(ExpectValue(strides.i(0), 1, "strides(0)")); TF_RETURN_IF_ERROR(ExpectValue(strides.i(3), 1, "strides(3)")); conv->stride_height = strides.i(1); conv->stride_width = strides.i(2); if (HasAttr(node, "dilations")) { const auto& dilations = GetListAttr(node, "dilations"); TF_RETURN_IF_ERROR( ExpectValue(dilations.i_size(), 4, "number of dilations")); if (dilations.i(0) != 1 || dilations.i(3) != 1) { return tensorflow::errors::InvalidArgument(absl::StrCat( "Can only import Conv ops with dilation along the height " "(1st) or width (2nd) axis. TensorFlow op \"", node.name(), "\" had dilations:[ ", dilations.i(0), ", ", dilations.i(1), ", ", dilations.i(2), ", ", dilations.i(3), "].")); } conv->dilation_height_factor = dilations.i(1); conv->dilation_width_factor = dilations.i(2); } else { conv->dilation_height_factor = 1; conv->dilation_width_factor = 1; } const auto& padding = GetStringAttr(node, "padding"); if (padding == "SAME") { conv->padding.type = PaddingType::kSame; } else if (padding == "VALID") { conv->padding.type = PaddingType::kValid; } else { return tensorflow::errors::InvalidArgument( "Bad padding (only SAME and VALID are supported)"); } model->operators.emplace_back(conv); return tensorflow::Status::OK(); } tensorflow::Status ConvertDepthwiseConvOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "DepthwiseConv2dNative"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); // We only support NHWC, which is the default data_format. // So if data_format is not defined, we're all good. if (HasAttr(node, "data_format")) { CHECK_EQ(GetStringAttr(node, "data_format"), "NHWC"); } CHECK_EQ(GetDataTypeAttr(node, "T"), DT_FLOAT); const auto& input_name = node.input(0); const auto& weights_name = node.input(1); const auto& reordered_weights_name = weights_name + "_reordered"; // Check if a ReorderAxesOperator was already created for these weights // (that happens when multiple layers share the same weights). const Operator* existing_reorder = GetOpWithOutput(*model, reordered_weights_name); if (existing_reorder) { // Check that it is safe to rely on the _reordered naming of the output // array! CHECK(existing_reorder->type == OperatorType::kReorderAxes); } else { // Create a new ReorderAxesOperator auto* reorder = new ReorderAxesOperator; reorder->inputs = {weights_name}; reorder->outputs = {reordered_weights_name}; reorder->input_axes_order = AxesOrder::kHWIM; reorder->output_axes_order = AxesOrder::k1HWO; model->operators.emplace_back(reorder); } auto* conv = new DepthwiseConvOperator; conv->inputs = {input_name, reordered_weights_name}; conv->outputs = {node.name()}; const auto& strides = GetListAttr(node, "strides"); CHECK_EQ(strides.i_size(), 4); CHECK_EQ(strides.i(0), 1); CHECK_EQ(strides.i(3), 1); conv->stride_height = strides.i(1); conv->stride_width = strides.i(2); if (HasAttr(node, "dilations")) { const auto& dilations = GetListAttr(node, "dilations"); TF_RETURN_IF_ERROR( ExpectValue(dilations.i_size(), 4, "number of dilations")); if (dilations.i(0) != 1 || dilations.i(3) != 1) { return tensorflow::errors::InvalidArgument(absl::StrCat( "Can only import Conv ops with dilation along the height " "(1st) or width (2nd) axis. TensorFlow op \"", node.name(), "\" had dilations:[ ", dilations.i(0), ", ", dilations.i(1), ", ", dilations.i(2), ", ", dilations.i(3), "].")); } conv->dilation_height_factor = dilations.i(1); conv->dilation_width_factor = dilations.i(2); } else { conv->dilation_height_factor = 1; conv->dilation_width_factor = 1; } const auto& padding = GetStringAttr(node, "padding"); if (padding == "SAME") { conv->padding.type = PaddingType::kSame; } else if (padding == "VALID") { conv->padding.type = PaddingType::kValid; } else { LOG(FATAL) << "Bad padding (only SAME and VALID are supported)"; } model->operators.emplace_back(conv); return tensorflow::Status::OK(); } tensorflow::Status ConvertDepthToSpaceOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "DepthToSpace"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); CHECK_EQ(GetDataTypeAttr(node, "T"), DT_FLOAT); auto* op = new DepthToSpaceOperator; op->inputs.push_back(node.input(0)); op->outputs.push_back(node.name()); op->block_size = GetIntAttr(node, "block_size"); QCHECK_GE(op->block_size, 2); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertSpaceToDepthOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "SpaceToDepth"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); tensorflow::DataType dtype = GetDataTypeAttr(node, "T"); if (dtype != DT_FLOAT && dtype != DT_UINT8 && dtype != DT_INT32 && dtype != DT_INT64) { const auto* enum_descriptor = tensorflow::DataType_descriptor(); LOG(FATAL) << "TFLite does not support SpaceToDepth with type T:" << enum_descriptor->FindValueByNumber(dtype)->name() << ". " << "T must be one of {DT_FLOAT, DT_INT8, DT_INT32, DT_INT64}."; } auto* op = new SpaceToDepthOperator; op->inputs.push_back(node.input(0)); op->outputs.push_back(node.name()); op->block_size = GetIntAttr(node, "block_size"); QCHECK_GE(op->block_size, 2); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertBiasAddOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "BiasAdd"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); const auto& input_name = node.input(0); const auto& bias_name = node.input(1); CHECK_EQ(GetDataTypeAttr(node, "T"), DT_FLOAT); auto* biasadd = new AddOperator; biasadd->inputs.push_back(input_name); biasadd->inputs.push_back(bias_name); biasadd->outputs.push_back(node.name()); model->operators.emplace_back(biasadd); return tensorflow::Status::OK(); } tensorflow::Status ConvertRandomUniform( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "RandomUniform"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); CHECK_EQ(GetDataTypeAttr(node, "T"), DT_INT32); auto op = absl::make_unique<RandomUniformOperator>(); op->inputs.push_back(node.input(0)); op->outputs.push_back(node.name()); op->dtype = ConvertDataType(GetDataTypeAttr(node, "dtype")); op->seed = GetIntAttr(node, "seed"); op->seed2 = GetIntAttr(node, "seed2"); CHECK(model != nullptr); model->operators.emplace_back(std::move(op)); return tensorflow::Status::OK(); } tensorflow::Status ConvertIdentityOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK(node.op() == "Identity" || node.op() == "CheckNumerics" || node.op() == "PlaceholderWithDefault" || node.op() == "StopGradient"); auto* op = new TensorFlowIdentityOperator; // Amazingly, some TensorFlow graphs (at least rajeev_lstm.pb) have // identity nodes with multiple inputs, but the other inputs seem // to be gratuitous (in the case of rajeev_lstm.pb, these are // enumerating the LSTM state arrays). We will just ignore extra // inputs beyond the first input. QCHECK_GE(node.input_size(), 1) << node.op() << " node expects at least 1 input other than control dependencies: " << node.DebugString(); const auto& input_name = node.input(0); op->inputs.push_back(input_name); op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertFakeQuantWithMinMaxArgs( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "FakeQuantWithMinMaxArgs"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); auto* op = new FakeQuantOperator; op->inputs.push_back(node.input(0)); op->minmax.reset(new MinMax); auto& minmax = *op->minmax; minmax.min = GetFloatAttr(node, "min"); minmax.max = GetFloatAttr(node, "max"); op->outputs.push_back(node.name()); // tf.fake_quant_with_min_max_args num_bits defaults to 8. op->num_bits = HasAttr(node, "num_bits") ? GetIntAttr(node, "num_bits") : 8; if (HasAttr(node, "narrow_range")) { op->narrow_range = GetBoolAttr(node, "narrow_range"); } model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertFakeQuantWithMinMaxVars( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "FakeQuantWithMinMaxVars"); const int num_inputs = GetInputsCount(node, tf_import_flags); QCHECK(num_inputs == 3 || num_inputs == 4) << "FakeQuantWithMinMaxVars node expects 3 or 4 inputs other than " "control dependencies: " << node.DebugString(); auto* op = new FakeQuantOperator; for (int i = 0; i < 3; i++) { op->inputs.push_back(node.input(i)); } op->outputs.push_back(node.name()); op->num_bits = HasAttr(node, "num_bits") ? GetIntAttr(node, "num_bits") : 8; if (HasAttr(node, "narrow_range")) { op->narrow_range = GetBoolAttr(node, "narrow_range"); } model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertSqueezeOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Squeeze"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); auto* op = new SqueezeOperator; op->inputs.push_back(node.input(0)); op->outputs.push_back(node.name()); // When omitted we are to squeeze all dimensions == 1. if (HasAttr(node, "squeeze_dims")) { const auto& squeeze_dims = GetListAttr(node, "squeeze_dims"); for (int i = 0; i < squeeze_dims.i_size(); ++i) { op->squeeze_dims.push_back(squeeze_dims.i(i)); } } model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertSplitOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Split"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); auto* op = new TensorFlowSplitOperator; op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); const int num_split = GetIntAttr(node, "num_split"); op->outputs.push_back(node.name()); for (int i = 1; i < num_split; i++) { op->outputs.push_back(absl::StrCat(node.name(), ":", i)); } op->num_split = num_split; model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertSwitchOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Switch"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); auto* op = new TensorFlowSwitchOperator; op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->outputs.push_back(node.name()); // Switch operators have two outputs: "name" and "name:1". op->outputs.push_back(node.name() + ":1"); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertSoftmaxOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Softmax"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); const auto& input_name = node.input(0); auto* softmax = new SoftmaxOperator; softmax->inputs.push_back(input_name); softmax->outputs.push_back(node.name()); // TensorFlow's Softmax doesn't seem to admit a 'beta' parameter. CHECK(!node.attr().count("beta")); // Stab in the dark, just in case. softmax->beta = 1.f; model->operators.emplace_back(softmax); return tensorflow::Status::OK(); } tensorflow::Status ConvertLRNOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "LRN"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); const auto& input_name = node.input(0); auto* lrn = new LocalResponseNormalizationOperator; lrn->inputs.push_back(input_name); lrn->outputs.push_back(node.name()); lrn->range = GetIntAttr(node, "depth_radius"); lrn->bias = GetFloatAttr(node, "bias"); lrn->alpha = GetFloatAttr(node, "alpha"); lrn->beta = GetFloatAttr(node, "beta"); model->operators.emplace_back(lrn); return tensorflow::Status::OK(); } tensorflow::Status ConvertMaxPoolOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "MaxPool"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); const auto& input_name = node.input(0); // We only support NHWC, which is the default data_format. // So if data_format is not defined, we're all good. if (node.attr().count("data_format")) { CHECK_EQ(GetStringAttr(node, "data_format"), "NHWC"); } if (HasAttr(node, "T")) { CHECK_EQ(GetDataTypeAttr(node, "T"), DT_FLOAT); } else { LOG(WARNING) << "Found MaxPool operator missing 'T' attribute"; } auto* maxpool = new MaxPoolOperator; maxpool->inputs.push_back(input_name); maxpool->outputs.push_back(node.name()); const auto& strides = GetListAttr(node, "strides"); CHECK_EQ(strides.i_size(), 4); CHECK_EQ(strides.i(0), 1); CHECK_EQ(strides.i(3), 1); maxpool->stride_height = strides.i(1); maxpool->stride_width = strides.i(2); const auto& ksize = GetListAttr(node, "ksize"); CHECK_EQ(ksize.i_size(), 4); CHECK_EQ(ksize.i(0), 1); CHECK_EQ(ksize.i(3), 1); maxpool->kheight = ksize.i(1); maxpool->kwidth = ksize.i(2); const auto& padding = GetStringAttr(node, "padding"); if (padding == "SAME") { maxpool->padding.type = PaddingType::kSame; } else if (padding == "VALID") { maxpool->padding.type = PaddingType::kValid; } else { LOG(FATAL) << "Bad padding (only SAME and VALID are supported)"; } model->operators.emplace_back(maxpool); return tensorflow::Status::OK(); } tensorflow::Status ConvertAvgPoolOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "AvgPool"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); const auto& input_name = node.input(0); // We only support NHWC, which is the default data_format. // So if data_format is not defined, we're all good. if (node.attr().count("data_format")) { CHECK_EQ(GetStringAttr(node, "data_format"), "NHWC"); } CHECK_EQ(GetDataTypeAttr(node, "T"), DT_FLOAT); auto* avgpool = new AveragePoolOperator; avgpool->inputs.push_back(input_name); avgpool->outputs.push_back(node.name()); const auto& strides = GetListAttr(node, "strides"); CHECK_EQ(strides.i_size(), 4); CHECK_EQ(strides.i(0), 1); CHECK_EQ(strides.i(3), 1); avgpool->stride_height = strides.i(1); avgpool->stride_width = strides.i(2); const auto& ksize = GetListAttr(node, "ksize"); CHECK_EQ(ksize.i_size(), 4); CHECK_EQ(ksize.i(0), 1); CHECK_EQ(ksize.i(3), 1); avgpool->kheight = ksize.i(1); avgpool->kwidth = ksize.i(2); const auto& padding = GetStringAttr(node, "padding"); if (padding == "SAME") { avgpool->padding.type = PaddingType::kSame; } else if (padding == "VALID") { avgpool->padding.type = PaddingType::kValid; } else { LOG(FATAL) << "Bad padding (only SAME and VALID are supported)"; } model->operators.emplace_back(avgpool); return tensorflow::Status::OK(); } tensorflow::Status ConvertBatchMatMulOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); // https://www.tensorflow.org/versions/r0.12/api_docs/python/math_ops/matrix_math_functions CHECK(!HasAttr(node, "adj_a") || (GetBoolAttr(node, "adj_a") == false)); CHECK(!HasAttr(node, "adj_b") || (GetBoolAttr(node, "adj_b") == false)); auto* batch_matmul = new BatchMatMulOperator; batch_matmul->inputs = {node.input(0), node.input(1)}; batch_matmul->outputs = {node.name()}; // For Flex mode. Please read the comments of the function. RetainTensorFlowNodeDef(node, batch_matmul); model->operators.emplace_back(batch_matmul); return tensorflow::Status::OK(); } tensorflow::Status ConvertMatMulOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); CHECK(!HasAttr(node, "adjoint_a") || (GetBoolAttr(node, "adjoint_a") == false)); CHECK(!HasAttr(node, "adjoint_b") || (GetBoolAttr(node, "adjoint_b") == false)); auto* matmul = new TensorFlowMatMulOperator; if (HasAttr(node, "transpose_a")) { matmul->transpose_a = GetBoolAttr(node, "transpose_a"); } if (HasAttr(node, "transpose_b")) { matmul->transpose_b = GetBoolAttr(node, "transpose_b"); } matmul->inputs = {node.input(0), node.input(1)}; matmul->outputs = {node.name()}; model->operators.emplace_back(matmul); return tensorflow::Status::OK(); } tensorflow::Status ConvertConcatOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { Operator* op = nullptr; if (node.op() == "Concat") { op = new TensorFlowConcatOperator; } else if (node.op() == "ConcatV2") { op = new TensorFlowConcatV2Operator; } else { LOG(FATAL) << "Expected Concat or ConcatV2"; } const int num_inputs = GetInputsCount(node, tf_import_flags); QCHECK_GE(num_inputs, 2) << node.op() << " node expects at least 2 inputs other than control dependencies: " << node.DebugString(); CHECK_EQ(num_inputs, 1 + GetIntAttr(node, "N")); for (int i = 0; i < num_inputs; ++i) { op->inputs.push_back(node.input(i)); } op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } // This method supports simple operators without additional attributes. template <typename Op> tensorflow::Status ConvertSimpleOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { auto* op = new Op; const int num_inputs = GetInputsCount(node, tf_import_flags); for (int i = 0; i < num_inputs; ++i) { op->inputs.push_back(node.input(i)); } op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } // This method supports simple operators without additional attributes. template <typename Op, unsigned int NumInputs> tensorflow::Status ConvertSimpleOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, NumInputs)); return ConvertSimpleOperator<Op>(node, tf_import_flags, model); } tensorflow::Status ConvertUnsupportedOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { // Names of special attributes in TF graph that are used by Toco. static constexpr char kAttrOutputQuantized[] = "_output_quantized"; static constexpr char kAttrOutputTypes[] = "_output_types"; static constexpr char kAttrOutputShapes[] = "_output_shapes"; static constexpr char kAttrSupportOutputTypeFloatInQuantizedOp[] = "_support_output_type_float_in_quantized_op"; LOG(INFO) << "Converting unsupported operation: " << node.op(); auto* op = new TensorFlowUnsupportedOperator; op->tensorflow_op = node.op(); // For Flex mode. Please read the comments of the function. RetainTensorFlowNodeDef(node, op); model->operators.emplace_back(op); // Parse inputs. const int num_inputs = GetInputsCount(node, tf_import_flags); for (int i = 0; i < num_inputs; ++i) { op->inputs.push_back(node.input(i)); } // Parse outputs. Name them after the node's name, plus an ordinal suffix. // Note that some outputs are to be multipled by a named attribute. const tensorflow::OpDef* op_def = nullptr; if (tensorflow::OpRegistry::Global()->LookUpOpDef(node.op(), &op_def).ok()) { int next_output = 0; for (int i = 0; i < op_def->output_arg_size(); ++i) { string multiples = op_def->output_arg(i).number_attr(); int num_outputs = multiples.empty() ? 1 : GetIntAttr(node, multiples); LOG(INFO) << "dddddddd " << num_outputs; for (int j = 0; j < num_outputs; ++j) { if (next_output == 0) { op->outputs.push_back(node.name()); // Implicit :0. } else { op->outputs.push_back(absl::StrCat(node.name(), ":", next_output)); } ++next_output; } } } else { LOG(INFO) << "nodef!!!!!!!!!!! "; op->outputs.push_back(node.name()); // Implicit :0. } // Parse if the op supports quantization if (HasAttr(node, kAttrOutputQuantized)) { op->quantized = GetBoolAttr(node, kAttrOutputQuantized); } // Parse if the quantized op allows output arrays of type float if (HasAttr(node, kAttrSupportOutputTypeFloatInQuantizedOp)) { op->support_output_type_float_in_quantized_op = GetBoolAttr(node, kAttrSupportOutputTypeFloatInQuantizedOp); } // Parse output type(s). if (HasAttr(node, kAttrOutputTypes)) { const auto& output_types = GetListAttr(node, kAttrOutputTypes); for (int i = 0; i < output_types.type_size(); ++i) { op->output_data_types.push_back(ConvertDataType(output_types.type(i))); } } else if (HasAttr(node, "Tout")) { const auto& output_type = GetDataTypeAttr(node, "Tout"); op->output_data_types.push_back(ConvertDataType(output_type)); } else if (op_def != nullptr) { for (const auto& output_arg : op_def->output_arg()) { if (output_arg.type() != tensorflow::DT_INVALID) { op->output_data_types.push_back(ConvertDataType(output_arg.type())); } else if (HasAttr(node, output_arg.type_attr())) { op->output_data_types.push_back( ConvertDataType(GetDataTypeAttr(node, output_arg.type_attr()))); } else { LOG(WARNING) << "Op node missing output type attribute: " << node.name(); op->output_data_types.clear(); break; } } } else { // TODO(b/113613439): Figure out how to propagate types for custom ops // that have no OpDef. LOG(INFO) << "Unable to determine output type for op: " << node.op(); } // Parse output shape(s). if (HasAttr(node, kAttrOutputShapes)) { const auto& output_shapes = GetListAttr(node, kAttrOutputShapes); Shape output_shape; for (int i = 0; i < output_shapes.shape_size(); ++i) { const auto& shape = output_shapes.shape(i); // TOCO doesn't yet properly handle shapes with wildcard dimensions. // TODO(b/113613439): Handle shape inference for unsupported ops that have // shapes with wildcard dimensions. if (HasWildcardDimension(shape)) { LOG(INFO) << "Skipping wildcard output shape(s) for node: " << node.name(); op->output_shapes.clear(); break; } const auto status = ImportShape(shape.dim(), /*input_flat_size=*/nullptr, &output_shape); if (!status.ok()) { return status; } op->output_shapes.push_back(output_shape); } } return tensorflow::Status::OK(); } tensorflow::Status ConvertStridedSliceOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "StridedSlice"); // TODO(soroosh): The 4th input (strides) should be e optional, to be // consistent with TF. TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 4)); auto* op = new StridedSliceOperator; for (const auto& input : node.input()) { op->inputs.push_back(input); } op->outputs.push_back(node.name()); op->begin_mask = HasAttr(node, "begin_mask") ? GetIntAttr(node, "begin_mask") : 0; op->ellipsis_mask = HasAttr(node, "ellipsis_mask") ? GetIntAttr(node, "ellipsis_mask") : 0; op->end_mask = HasAttr(node, "end_mask") ? GetIntAttr(node, "end_mask") : 0; op->new_axis_mask = HasAttr(node, "new_axis_mask") ? GetIntAttr(node, "new_axis_mask") : 0; op->shrink_axis_mask = HasAttr(node, "shrink_axis_mask") ? GetIntAttr(node, "shrink_axis_mask") : 0; model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertPlaceholderOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK(node.op() == "Placeholder" || node.op() == "LegacyFedInput"); if (node.op() == "Placeholder") { TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 0)); } auto& array = model->GetOrCreateArray(node.name()); if (node.attr().count("dtype")) { array.data_type = ConvertDataType(GetDataTypeAttr(node, "dtype")); } if (node.attr().count("shape")) { const auto& shape = GetShapeAttr(node, "shape"); auto num_dims = shape.dim_size(); // TODO(b/62716978): This logic needs to be revisted. During dims // refactoring it is an interim fix. if (num_dims > 0 && !HasWildcardDimension(shape)) { auto& dst_array_dims = *array.mutable_shape()->mutable_dims(); dst_array_dims.resize(num_dims); for (std::size_t i = 0; i < num_dims; i++) { dst_array_dims[i] = shape.dim(i).size(); } } } return tensorflow::Status::OK(); } tensorflow::Status ConvertNoOpOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { return tensorflow::Status::OK(); } tensorflow::Status ConvertCastOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Cast"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); const auto tf_src_dtype = GetDataTypeAttr(node, "SrcT"); const auto tf_dst_dtype = GetDataTypeAttr(node, "DstT"); auto* op = new CastOperator; op->src_data_type = ConvertDataType(tf_src_dtype); op->dst_data_type = ConvertDataType(tf_dst_dtype); op->inputs.push_back(node.input(0)); op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertFloorOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Floor"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); const auto data_type = GetDataTypeAttr(node, "T"); CHECK(data_type == DT_FLOAT); auto* op = new FloorOperator; op->inputs.push_back(node.input(0)); op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertGatherOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK(node.op() == "Gather" || node.op() == "GatherV2"); if (node.op() == "Gather") TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); if (node.op() == "GatherV2") TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 3)); const auto indices_data_type = GetDataTypeAttr(node, "Tindices"); CHECK(indices_data_type == DT_INT32 || indices_data_type == DT_INT64); auto* op = new GatherOperator; op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); if (node.input_size() >= 3) { // GatherV2 form where we are provided an axis. It may be either a constant // or runtime defined value, so we just wire up the array and let // ResolveGatherAttributes take care of it later on. const auto axis_data_type = GetDataTypeAttr(node, "Taxis"); CHECK(axis_data_type == DT_INT32 || axis_data_type == DT_INT64); op->inputs.push_back(node.input(2)); } else { // Gather form that assumes axis=0. op->axis = {0}; } op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } template <typename Op> tensorflow::Status ConvertArgMinMaxOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); const auto axis_data_type = HasAttr(node, "Tidx") ? GetDataTypeAttr(node, "Tidx") : DT_INT32; const auto output_type = HasAttr(node, "output_type") ? GetDataTypeAttr(node, "output_type") : DT_INT64; CHECK(axis_data_type == DT_INT64 || axis_data_type == DT_INT32); CHECK(output_type == DT_INT64 || output_type == DT_INT32); auto* op = new Op; op->output_data_type = ConvertDataType(output_type); op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertArgMaxOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "ArgMax"); return ConvertArgMinMaxOperator<ArgMaxOperator>(node, tf_import_flags, model); } tensorflow::Status ConvertArgMinOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "ArgMin"); return ConvertArgMinMaxOperator<ArgMinOperator>(node, tf_import_flags, model); } tensorflow::Status ConvertResizeBilinearOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "ResizeBilinear"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); auto* op = new ResizeBilinearOperator; op->align_corners = false; if (HasAttr(node, "align_corners")) { op->align_corners = GetBoolAttr(node, "align_corners"); } op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertBatchNormWithGlobalNormalizationOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "BatchNormWithGlobalNormalization"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 5)); // TODO(ahentz): to really match tensorflow we need to add variance_epsilon // to the input, before feeding it into TensorFlowRsqrtOperator. // CHECK_EQ(GetFloatAttr(node, "variance_epsilon"), 0.001f); string multiplier = node.name() + "_mul"; if (GetBoolAttr(node, "scale_after_normalization")) { // Create graph: // v -> RSQRT -> // MUL -> multiplier // gamma -----> string rsqrt = node.name() + "_rsqrt"; auto* rsqrt_op = new TensorFlowRsqrtOperator; rsqrt_op->inputs.push_back(node.input(2)); rsqrt_op->outputs.push_back(rsqrt); model->operators.emplace_back(rsqrt_op); auto* mul_op = new MulOperator; mul_op->inputs.push_back(rsqrt); mul_op->inputs.push_back(node.input(4)); mul_op->outputs.push_back(multiplier); model->operators.emplace_back(mul_op); } else { // Create graph: // v -> RSQRT -> multiplier auto* rsqrt_op = new TensorFlowRsqrtOperator; rsqrt_op->inputs.push_back(node.input(2)); rsqrt_op->outputs.push_back(multiplier); model->operators.emplace_back(rsqrt_op); } auto* op = new BatchNormalizationOperator; op->global_normalization = true; op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->inputs.push_back(multiplier); op->inputs.push_back(node.input(3)); op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertFusedBatchNormOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "FusedBatchNorm"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 5)); // Declare shortcuts for the inputs. const string& gamma_input = node.input(1); const string& beta_input = node.input(2); const string& moving_mean_input = node.input(3); const string& moving_variance_input = node.input(4); // Create an array holding the epsilon value (typically, 0.001). const string epsilon_array_name = CreateConstArray<ArrayDataType::kFloat>( model, node.name() + "_epsilon_array", {GetFloatAttr(node, "epsilon")}); // Add epsilon to the moving variance. const string epsilon_add_op_name = node.name() + "_epsilon"; auto* epsilon_add_op = new AddOperator; epsilon_add_op->inputs.push_back(moving_variance_input); epsilon_add_op->inputs.push_back(epsilon_array_name); epsilon_add_op->outputs.push_back(epsilon_add_op_name); model->operators.emplace_back(epsilon_add_op); // Take the inverse square root of the (variance + epsilon). const string rsqrt_op_name = node.name() + "_rsqrt"; auto* rsqrt_op = new TensorFlowRsqrtOperator; rsqrt_op->inputs.push_back(epsilon_add_op_name); rsqrt_op->outputs.push_back(rsqrt_op_name); model->operators.emplace_back(rsqrt_op); // Multiply the result by gamma. const string multiplier = node.name() + "_mul"; auto* mul_op = new MulOperator; mul_op->inputs.push_back(rsqrt_op_name); mul_op->inputs.push_back(gamma_input); mul_op->outputs.push_back(multiplier); model->operators.emplace_back(mul_op); // Now we have all required inputs for the BatchNormalizationOperator. auto* op = new BatchNormalizationOperator; op->global_normalization = true; op->inputs.push_back(node.input(0)); op->inputs.push_back(moving_mean_input); op->inputs.push_back(multiplier); op->inputs.push_back(beta_input); op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertSpaceToBatchNDOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "SpaceToBatchND"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 3)); CHECK_EQ(GetDataTypeAttr(node, "Tblock_shape"), DT_INT32); CHECK_EQ(GetDataTypeAttr(node, "Tpaddings"), DT_INT32); auto* op = new SpaceToBatchNDOperator; op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->inputs.push_back(node.input(2)); op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertBatchToSpaceNDOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "BatchToSpaceND"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 3)); CHECK_EQ(GetDataTypeAttr(node, "Tblock_shape"), DT_INT32); CHECK_EQ(GetDataTypeAttr(node, "Tcrops"), DT_INT32); auto* op = new BatchToSpaceNDOperator; op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->inputs.push_back(node.input(2)); op->outputs.push_back(node.name()); model->operators.emplace_back(op); return tensorflow::Status::OK(); } template <typename T> tensorflow::Status ConvertReduceOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); auto* op = new T; op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->outputs.push_back(node.name()); model->operators.emplace_back(op); if (HasAttr(node, "keepdims")) { op->keep_dims = GetBoolAttr(node, "keepdims"); } else if (HasAttr(node, "keep_dims")) { op->keep_dims = GetBoolAttr(node, "keep_dims"); } return tensorflow::Status::OK(); } tensorflow::Status ConvertSvdfOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Svdf"); const int input_size = GetInputsCount(node, tf_import_flags); QCHECK(input_size == 3 || input_size == 4) << "Svdf node expects 3 or 4 inputs other than control dependencies: " << node.DebugString(); bool has_bias = (input_size == 4); auto* op = new SvdfOperator; op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->inputs.push_back(node.input(2)); if (has_bias) { op->inputs.push_back(node.input(3)); } op->outputs.push_back(node.name() + "_state"); op->outputs.push_back(node.name()); if (node.attr().at("ActivationFunction").s() == "Relu") { op->fused_activation_function = FusedActivationFunctionType::kRelu; } else { op->fused_activation_function = FusedActivationFunctionType::kNone; } op->rank = node.attr().at("Rank").i(); model->operators.emplace_back(op); return tensorflow::Status::OK(); } // This is just bare bones support to get the shapes to propagate. tensorflow::Status ConvertTransposeConvOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Conv2DBackpropInput"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 3)); auto* op = new TransposeConvOperator; op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->inputs.push_back(node.input(2)); op->outputs.push_back(node.name()); const auto& strides = GetListAttr(node, "strides"); op->stride_height = strides.i(1); op->stride_width = strides.i(2); CHECK_EQ(strides.i_size(), 4) << "Can only import TransposeConv ops with 4D strides. TensorFlow op \"" << node.name() << "\" has " << strides.i_size() << "D strides."; CHECK((strides.i(0) == 1) && (strides.i(3) == 1)) << "Can only import TransposeConv ops with striding along the height " "(1st) or width (2nd) axis. TensorFlow op \"" << node.name() << "\" had strides:[ " << strides.i(0) << ", " << strides.i(1) << ", " << strides.i(2) << ", " << strides.i(3) << "]."; op->stride_height = strides.i(1); op->stride_width = strides.i(2); if (HasAttr(node, "dilations")) { const auto& dilations = GetListAttr(node, "dilations"); CHECK_EQ(dilations.i_size(), 4) << "Dilation unsupported in TransposeConv. TensorFlow op \"" << node.name() << "\" had dilations"; CHECK((dilations.i(0) == 1) && (dilations.i(1) == 1) && (dilations.i(1) == 1) && (dilations.i(3) == 1)) << "Dilation unsupported in TransposeConv. TensorFlow op \"" << node.name() << "\" had dilations:[ " << dilations.i(0) << ", " << dilations.i(1) << ", " << dilations.i(2) << ", " << dilations.i(3) << "]."; } const string& weights_name = node.input(TransposeConvOperator::WEIGHTS); const string& transposed_weights_name = weights_name + "_transposed"; // Check if a TransposeOperator was already created for these weights // (can happen when multiple layers share the same weights). const Operator* existing_transpose = GetOpWithOutput(*model, transposed_weights_name); if (existing_transpose) { CHECK(existing_transpose->type == OperatorType::kTranspose); } else { // Transpose weights from HWOI order to OHWI order, which is more efficient // for computation. (Note that TensorFlow considers the order as HWIO // because they consider this a backward conv, inverting the sense of // input/output.) TransposeOperator* transpose = new TransposeOperator; string perm_array = CreateConstArray<ArrayDataType::kInt32>( model, node.name() + "_transpose_perm", {2, 0, 1, 3}); transpose->inputs = {weights_name, perm_array}; transpose->outputs = {transposed_weights_name}; model->operators.emplace_back(transpose); } op->inputs[1] = transposed_weights_name; auto const& padding = GetStringAttr(node, "padding"); if (padding == "SAME") { op->padding.type = PaddingType::kSame; } else if (padding == "VALID") { op->padding.type = PaddingType::kValid; } else { LOG(FATAL) << "Only SAME and VALID padding supported on " "Conv2DBackpropInput nodes."; } model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertRangeOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Range"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 3)); auto* op = new RangeOperator; if (HasAttr(node, "Tidx")) { const auto dtype = toco::GetDataTypeAttr(node, "Tidx"); CHECK(dtype == DT_UINT8 || dtype == DT_INT32 || dtype == DT_INT64 || dtype == DT_FLOAT); op->dtype = ConvertDataType(dtype); } op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); op->inputs.push_back(node.input(2)); op->outputs.push_back(node.name()); // For Flex mode. Please read the comments of the function. RetainTensorFlowNodeDef(node, op); model->operators.emplace_back(op); return tensorflow::Status::OK(); } // Note that it's easy to confuse/conflate "Stack" and "Pack" operators, but // they aren't the same thing. tf.stack results in a "Pack" operator. "Stack" // operators also exist, but involve manipulating the TF runtime stack, and are // not directly related to tf.stack() usage. tensorflow::Status ConvertPackOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Pack"); auto op = absl::make_unique<PackOperator>(); const int num_inputs = GetInputsCount(node, tf_import_flags); QCHECK_GE(num_inputs, 1) << node.op() << " node expects at least 1 input other than control dependencies: " << node.DebugString(); CHECK_EQ(num_inputs, GetIntAttr(node, "N")); for (int i = 0; i < num_inputs; ++i) { op->inputs.push_back(node.input(i)); } op->values_count = HasAttr(node, "N") ? GetIntAttr(node, "N") : num_inputs; op->axis = HasAttr(node, "axis") ? GetIntAttr(node, "axis") : 0; op->dtype = ConvertDataType(toco::GetDataTypeAttr(node, "T")); op->outputs.push_back(node.name()); model->operators.emplace_back(std::move(op)); return tensorflow::Status::OK(); } tensorflow::Status ConvertUnpackOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Unpack"); auto op = absl::make_unique<UnpackOperator>(); const int num_inputs = GetInputsCount(node, tf_import_flags); QCHECK_EQ(num_inputs, 1); op->inputs.push_back(node.input(0)); op->num = GetIntAttr(node, "num"); op->axis = HasAttr(node, "axis") ? GetIntAttr(node, "axis") : 0; op->dtype = ConvertDataType(toco::GetDataTypeAttr(node, "T")); op->outputs.push_back(node.name()); // Implicit :0. for (int i = 1; i < op->num; ++i) { op->outputs.push_back(node.name() + ":" + std::to_string(i)); } model->operators.emplace_back(std::move(op)); return tensorflow::Status::OK(); } // Some TensorFlow ops only occur in graph cycles, representing // control flow. We do not currently support control flow, so we wouldn't // be able to fully support such graphs, including performing inference, // anyway. However, rather than erroring out early on graphs being cyclic, // it helps to at least support these just enough to allow getting a // graph visualization. This is not trivial, as we require graphs to be // acyclic aside from RNN back-edges. The solution is to special-case // such ops as RNN back-edges, which is technically incorrect (does not // allow representing the op's semantics) but good enough to get a // graph visualization. tensorflow::Status ConvertOperatorSpecialCasedAsRNNBackEdge( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { // At the moment, the only type of operator special-cased in this way is // NextIteration, occurring only in control-flow cycles. CHECK_EQ(node.op(), "NextIteration"); CHECK_EQ(node.input_size(), 1); auto* rnn_state = model->flags.add_rnn_states(); // This RNN state is not explicitly created by the user, so it's // OK for some later graph transformation to discard it. rnn_state->set_discardable(true); rnn_state->set_state_array(node.name()); rnn_state->set_back_edge_source_array(node.input(0)); return tensorflow::Status::OK(); } tensorflow::Status ConvertShapeOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "Shape"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1)); const auto out_type = HasAttr(node, "out_type") ? GetDataTypeAttr(node, "out_type") : DT_INT32; CHECK(out_type == DT_INT64 || out_type == DT_INT32); auto op = absl::make_unique<TensorFlowShapeOperator>(); op->output_data_type = ConvertDataType(out_type); op->inputs.push_back(node.input(0)); op->outputs.push_back(node.name()); model->operators.push_back(std::move(op)); return tensorflow::Status::OK(); } void StripCaretFromArrayNames(Model* model) { for (auto& op : model->operators) { for (auto& input : op->inputs) { input = string(absl::StripPrefix(input, "^")); } for (auto& output : op->outputs) { output = string(absl::StripPrefix(output, "^")); } } for (auto& array : model->GetArrayMap()) { if (absl::StartsWith(array.first, "^")) { LOG(FATAL) << "What?"; } } } void StripZeroOutputIndexFromInputs(NodeDef* node) { for (auto& input : *node->mutable_input()) { input = string(absl::StripSuffix(input, ":0")); } } // In TensorFlow GraphDef, when a node has multiple outputs, they are named // name:0, name:1, ... // where 'name' is the node's name(). Just 'name' is an equivalent shorthand // form for name:0. // A TensorFlow GraphDef does not explicitly list all the outputs of each node // (unlike inputs), it being implied by the node's name and operator type // (the latter implies the number of outputs). // This makes it non-trivial for us to reconstruct the list of all arrays // present in the graph and, for each operator, the list of its outputs. // We do that by taking advantage of the fact that // at least each node lists explicitly its inputs, so after we've loaded // all nodes, we can use that information. void AddExtraOutputs(Model* model) { // Construct the list of all arrays consumed by anything in the graph. std::vector<string> consumed_arrays; // Add arrays consumed by an op. for (const auto& consumer_op : model->operators) { for (const string& input : consumer_op->inputs) { consumed_arrays.push_back(input); } } // Add global outputs of the model. for (const string& output_array : model->flags.output_arrays()) { consumed_arrays.push_back(output_array); } // Add arrays consumed by a RNN back-edge. for (const auto& rnn_state : model->flags.rnn_states()) { consumed_arrays.push_back(rnn_state.back_edge_source_array()); } // Now add operator outputs so that all arrays that are consumed, // are produced. for (const string& consumed_array : consumed_arrays) { // Split the consumed array name into the form name:output_index. const std::vector<string>& split = absl::StrSplit(consumed_array, ':'); // If not of the form name:output_index, then this is not an additional // output of a node with multiple outputs, so nothing to do here. if (split.size() != 2) { continue; } int output_index = 0; if (!absl::SimpleAtoi(split[1], &output_index)) { continue; } // Each op is initially recorded as producing at least the array that // has its name. We use that to identify the producer node. auto* producer_op = GetOpWithOutput(*model, split[0]); if (!producer_op) { continue; } // Add extra outputs to that producer node, all the way to the // output_index. while (producer_op->outputs.size() <= output_index) { using toco::port::StringF; producer_op->outputs.push_back( StringF("%s:%d", split[0], producer_op->outputs.size())); } } } bool InlineAllFunctions(GraphDef* graphdef) { if (graphdef->library().function().empty()) { VLOG(kLogLevelModelUnchanged) << "No functions to inline."; return false; } // Override "_noinline" attribute on all functions GraphDef graphdef_copy(*graphdef); for (auto& function : (*graphdef_copy.mutable_library()->mutable_function())) { auto* attributes = function.mutable_attr(); if (attributes->count(tensorflow::kNoInlineAttr) != 0) { (*attributes)[tensorflow::kNoInlineAttr].set_b(false); } } // Construct minimum resources needed to use ExpandInlineFunctions(). tensorflow::SessionOptions options; auto* device_count = options.config.mutable_device_count(); device_count->insert({"CPU", 1}); std::vector<tensorflow::Device*> devices; TF_CHECK_OK(tensorflow::DeviceFactory::AddDevices( options, "/job:localhost/replica:0/task:0", &devices)); tensorflow::FunctionLibraryDefinition fld(tensorflow::OpRegistry::Global(), graphdef_copy.library()); tensorflow::DeviceMgr device_mgr(devices); tensorflow::OptimizerOptions o_opts; tensorflow::ProcessFunctionLibraryRuntime pflr( &device_mgr, tensorflow::Env::Default(), TF_GRAPH_DEF_VERSION, &fld, o_opts, nullptr); tensorflow::FunctionLibraryRuntime* flr; flr = pflr.GetFLR("/job:localhost/replica:0/task:0/cpu:0"); tensorflow::Graph graph(fld); tensorflow::ImportGraphDefOptions gc_opts; gc_opts.validate_shape = false; const auto& tf_convert_status = tensorflow::ImportGraphDef( gc_opts, graphdef_copy, &graph, nullptr, nullptr); if (!tf_convert_status.ok()) { LOG(ERROR) << "tensorflow::ImportGraphDef failed with status: " << tf_convert_status.ToString(); return false; } // Iterate over the graph until there are no more nodes to be inlined. bool graph_modified = false; while (tensorflow::ExpandInlineFunctions(flr, &graph)) { graph_modified = true; } // Output inlined graph if (graph_modified) { LOG(INFO) << "Found and inlined TensorFlow functions."; graph.ToGraphDef(graphdef); } return graph_modified; } tensorflow::Status ConvertTopKV2Operator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK((node.op() == "TopK") || (node.op() == "TopKV2")); auto op = absl::make_unique<TopKV2Operator>(); op->inputs.push_back(node.input(0)); // K can be encoded as attr (TopK) convert it to a const. if (HasAttr(node, "k")) { string k_array = CreateConstArray<ArrayDataType::kInt32>( model, node.name() + "k", {static_cast<int32>(GetIntAttr(node, "k"))}); op->inputs.push_back(k_array); } else { TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); op->inputs.push_back(node.input(1)); } // The op has two outputs. op->outputs.push_back(node.name()); op->outputs.push_back(node.name() + ":1"); model->operators.emplace_back(op.release()); return tensorflow::Status::OK(); } tensorflow::Status ConvertDynamicPartitionOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { auto op = absl::make_unique<DynamicPartitionOperator>(); CHECK(HasAttr(node, "num_partitions")); op->num_partitions = GetIntAttr(node, "num_partitions"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); op->inputs.push_back(node.input(0)); op->inputs.push_back(node.input(1)); CHECK_GT(op->num_partitions, 1); op->outputs.push_back(node.name()); // Implicit :0. for (int i = 1; i < op->num_partitions; ++i) { op->outputs.push_back(node.name() + ":" + std::to_string(i)); } model->operators.emplace_back(op.release()); return tensorflow::Status::OK(); } tensorflow::Status ConvertDynamicStitchOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { // The parallel and non-parallel variants are the same besides whether they // have a parallel loop; there are no behavioral differences. CHECK(node.op() == "DynamicStitch" || node.op() == "ParallelDynamicStitch"); auto op = absl::make_unique<DynamicStitchOperator>(); CHECK(HasAttr(node, "N")); op->num_partitions = GetIntAttr(node, "N"); // Expect all ID partitions + all value partitions. TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, op->num_partitions * 2)); for (int i = 0; i < op->num_partitions * 2; ++i) { op->inputs.push_back(node.input(i)); } op->outputs.push_back(node.name()); model->operators.emplace_back(op.release()); return tensorflow::Status::OK(); } tensorflow::Status ConvertSparseToDenseOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "SparseToDense"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 4)); auto* op = new SparseToDenseOperator; for (const string& input : node.input()) { op->inputs.push_back(input); } op->outputs.push_back(node.name()); op->validate_indices = HasAttr(node, "validate_indices") ? GetBoolAttr(node, "validate_indices") : true; model->operators.emplace_back(op); return tensorflow::Status::OK(); } tensorflow::Status ConvertOneHotOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "OneHot"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 4)); const auto dtype = GetDataTypeAttr(node, "T"); // TODO(b/111744875): Support DT_UINT8 and quantization. CHECK(dtype == DT_INT32 || dtype == DT_INT64 || dtype == DT_FLOAT || dtype == DT_BOOL); auto op = absl::make_unique<OneHotOperator>(); op->axis = HasAttr(node, "axis") ? GetIntAttr(node, "axis") : -1; for (const string& input : node.input()) { op->inputs.push_back(input); } op->outputs.push_back(node.name()); model->operators.emplace_back(op.release()); return tensorflow::Status::OK(); } tensorflow::Status ConvertCTCBeamSearchDecoderOperator( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { CHECK_EQ(node.op(), "CTCBeamSearchDecoder"); TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2)); auto* op = new CTCBeamSearchDecoderOperator; for (const string& input : node.input()) { op->inputs.push_back(input); } op->beam_width = HasAttr(node, "beam_width") ? GetIntAttr(node, "beam_width") : 1; op->top_paths = HasAttr(node, "top_paths") ? GetIntAttr(node, "top_paths") : 1; op->merge_repeated = HasAttr(node, "merge_repeated") ? GetBoolAttr(node, "merge_repeated") : true; // There are top_paths + 1 outputs. op->outputs.push_back(node.name()); // Implicit :0. for (int i = 0; i < op->top_paths; ++i) { op->outputs.push_back(node.name() + ":" + std::to_string(i + 1)); } model->operators.emplace_back(op); return tensorflow::Status::OK(); } // This isn't a TensorFlow builtin op. Currently this node can only be generated // with TfLite OpHint API. tensorflow::Status ConvertUnidirectionalSequenceLstm( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model) { DCHECK_EQ(node.op(), "UnidirectionalSequenceLstm"); auto* op = new UnidirectionalSequenceLstmOperator(); const auto& indices = GetListAttr(node, "_tflite_input_indices"); if (indices.i_size() != node.input().size()) { return tensorflow::errors::InvalidArgument("Input size does not match."); } // The input size needs to be the same as the TfLite UniDirectionalSequence // Lstm implementation. const int kInputsSize = 20; op->inputs.resize(kInputsSize); std::vector<bool> done(kInputsSize); int idx = 0; for (const string& input : node.input()) { int real_index = indices.i(idx); op->inputs[real_index] = (input); done[real_index] = true; idx++; } for (int idx = 0; idx < done.size(); idx++) { if (!done[idx]) { string optional_name = node.name() + "_" + std::to_string(idx); model->CreateOptionalArray(optional_name); op->inputs[idx] = optional_name; } } // There're three outputs, only the last one is required. op->outputs.push_back(node.name() + ":2"); model->operators.emplace_back(op); return tensorflow::Status::OK(); } } // namespace namespace internal { using ConverterType = tensorflow::Status (*)( const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model); using ConverterMapType = std::unordered_map<std::string, ConverterType>; ConverterMapType GetTensorFlowNodeConverterMap() { return std::unordered_map<std::string, ConverterType>({ {"Add", ConvertSimpleOperator<AddOperator, 2>}, {"AddN", ConvertSimpleOperator<AddNOperator>}, {"All", ConvertSimpleOperator<TensorFlowAllOperator>}, {"Any", ConvertReduceOperator<TensorFlowAnyOperator>}, {"ArgMax", ConvertArgMaxOperator}, {"ArgMin", ConvertArgMinOperator}, {"Assert", ConvertSimpleOperator<TensorFlowAssertOperator>}, {"AvgPool", ConvertAvgPoolOperator}, {"BatchMatMul", ConvertBatchMatMulOperator}, {"BatchNormWithGlobalNormalization", ConvertBatchNormWithGlobalNormalizationOperator}, {"BatchToSpaceND", ConvertBatchToSpaceNDOperator}, {"BiasAdd", ConvertBiasAddOperator}, {"Cast", ConvertCastOperator}, {"CheckNumerics", ConvertIdentityOperator}, {"Concat", ConvertConcatOperator}, {"ConcatV2", ConvertConcatOperator}, {"Const", ConvertConstOperator}, {"Conv2D", ConvertConvOperator}, {"Conv2DBackpropInput", ConvertTransposeConvOperator}, {"CTCBeamSearchDecoder", ConvertCTCBeamSearchDecoderOperator}, {"DepthToSpace", ConvertDepthToSpaceOperator}, {"DepthwiseConv2dNative", ConvertDepthwiseConvOperator}, {"Div", ConvertSimpleOperator<DivOperator, 2>}, {"DynamicPartition", ConvertDynamicPartitionOperator}, {"DynamicStitch", ConvertDynamicStitchOperator}, {"Equal", ConvertSimpleOperator<TensorFlowEqualOperator, 2>}, {"Exp", ConvertSimpleOperator<ExpOperator, 1>}, {"ExpandDims", ConvertSimpleOperator<ExpandDimsOperator, 2>}, {"FakeQuantWithMinMaxArgs", ConvertFakeQuantWithMinMaxArgs}, {"FakeQuantWithMinMaxVars", ConvertFakeQuantWithMinMaxVars}, {"Fill", ConvertSimpleOperator<FillOperator, 2>}, {"Floor", ConvertFloorOperator}, {"FloorDiv", ConvertSimpleOperator<FloorDivOperator, 2>}, {"FloorMod", ConvertSimpleOperator<FloorModOperator, 2>}, {"FusedBatchNorm", ConvertFusedBatchNormOperator}, {"Gather", ConvertGatherOperator}, {"GatherV2", ConvertGatherOperator}, {"Greater", ConvertSimpleOperator<TensorFlowGreaterOperator, 2>}, {"GreaterEqual", ConvertSimpleOperator<TensorFlowGreaterEqualOperator, 2>}, {"Identity", ConvertIdentityOperator}, {"LRN", ConvertLRNOperator}, {"LegacyFedInput", ConvertPlaceholderOperator}, {"Less", ConvertSimpleOperator<TensorFlowLessOperator, 2>}, {"LessEqual", ConvertSimpleOperator<TensorFlowLessEqualOperator, 2>}, {"Log", ConvertSimpleOperator<LogOperator, 1>}, {"LogicalAnd", ConvertSimpleOperator<LogicalAndOperator, 2>}, {"LogicalOr", ConvertSimpleOperator<LogicalOrOperator, 2>}, {"LogicalNot", ConvertSimpleOperator<LogicalNotOperator, 1>}, {"LogSoftmax", ConvertSimpleOperator<LogSoftmaxOperator, 1>}, {"MatMul", ConvertMatMulOperator}, {"Max", ConvertReduceOperator<TensorFlowMaxOperator>}, {"MaxPool", ConvertMaxPoolOperator}, {"Maximum", ConvertSimpleOperator<TensorFlowMaximumOperator, 2>}, {"Mean", ConvertReduceOperator<MeanOperator>}, {"Merge", ConvertSimpleOperator<TensorFlowMergeOperator, 2>}, {"Min", ConvertReduceOperator<TensorFlowMinOperator>}, {"Minimum", ConvertSimpleOperator<TensorFlowMinimumOperator, 2>}, {"Mul", ConvertSimpleOperator<MulOperator, 2>}, {"Neg", ConvertSimpleOperator<NegOperator, 1>}, {"NextIteration", ConvertOperatorSpecialCasedAsRNNBackEdge}, {"NoOp", ConvertNoOpOperator}, {"NotEqual", ConvertSimpleOperator<TensorFlowNotEqualOperator, 2>}, {"OneHot", ConvertOneHotOperator}, {"Pack", ConvertPackOperator}, {"Pad", ConvertSimpleOperator<PadOperator, 2>}, {"PadV2", ConvertSimpleOperator<PadV2Operator, 3>}, {"ParallelDynamicStitch", ConvertDynamicStitchOperator}, {"Placeholder", ConvertPlaceholderOperator}, {"PlaceholderWithDefault", ConvertIdentityOperator}, {"Pow", ConvertSimpleOperator<PowOperator, 2>}, {"Prod", ConvertReduceOperator<TensorFlowProdOperator>}, {"RandomUniform", ConvertRandomUniform}, {"Range", ConvertRangeOperator}, {"Rank", ConvertSimpleOperator<RankOperator, 1>}, {"RealDiv", ConvertSimpleOperator<DivOperator, 2>}, {"Relu", ConvertSimpleOperator<ReluOperator, 1>}, {"Relu6", ConvertSimpleOperator<Relu6Operator, 1>}, {"Reshape", ConvertSimpleOperator<TensorFlowReshapeOperator, 2>}, {"ResizeBilinear", ConvertResizeBilinearOperator}, {"Rsqrt", ConvertSimpleOperator<TensorFlowRsqrtOperator, 1>}, {"Select", ConvertSimpleOperator<SelectOperator, 3>}, {"Shape", ConvertShapeOperator}, {"Sigmoid", ConvertSimpleOperator<LogisticOperator, 1>}, {"Sin", ConvertSimpleOperator<SinOperator, 1>}, {"Slice", ConvertSimpleOperator<SliceOperator, 3>}, {"Softmax", ConvertSoftmaxOperator}, {"SpaceToBatchND", ConvertSpaceToBatchNDOperator}, {"SpaceToDepth", ConvertSpaceToDepthOperator}, {"SparseToDense", ConvertSparseToDenseOperator}, {"Split", ConvertSplitOperator}, {"Sqrt", ConvertSimpleOperator<TensorFlowSqrtOperator, 1>}, {"Square", ConvertSimpleOperator<TensorFlowSquareOperator, 1>}, {"Squeeze", ConvertSqueezeOperator}, {"StopGradient", ConvertIdentityOperator}, {"StridedSlice", ConvertStridedSliceOperator}, {"Sub", ConvertSimpleOperator<SubOperator, 2>}, {"Sum", ConvertReduceOperator<TensorFlowSumOperator>}, {"Svdf", ConvertSvdfOperator}, {"Switch", ConvertSwitchOperator}, {"Tanh", ConvertSimpleOperator<TanhOperator, 1>}, {"Tile", ConvertSimpleOperator<TensorFlowTileOperator, 2>}, {"TopK", ConvertTopKV2Operator}, {"TopKV2", ConvertTopKV2Operator}, {"Transpose", ConvertSimpleOperator<TransposeOperator, 2>}, {"Unpack", ConvertUnpackOperator}, {"ZerosLike", ConvertSimpleOperator<TensorFlowZerosLikeOperator, 1>}, {"UnidirectionalSequenceLstm", ConvertUnidirectionalSequenceLstm}, }); } tensorflow::Status ImportTensorFlowNode( const tensorflow::NodeDef& node, const TensorFlowImportFlags& tf_import_flags, Model* model, const ConverterMapType& converter_map) { auto converter = converter_map.find(node.op()); if (converter == converter_map.end()) { return ConvertUnsupportedOperator(node, tf_import_flags, model); } else { return converter->second(node, tf_import_flags, model); } } } // namespace internal std::unique_ptr<Model> ImportTensorFlowGraphDef( const ModelFlags& model_flags, const TensorFlowImportFlags& tf_import_flags, const GraphDef& tf_graph) { LogDumpGraphDef(kLogLevelModelChanged, "AT IMPORT", tf_graph); GraphDef inlined_graph(tf_graph); if (InlineAllFunctions(&inlined_graph)) { LogDumpGraphDef(kLogLevelModelChanged, "AFTER INLINING", inlined_graph); } // Check input and output specification. for (const auto& specified_input_array : model_flags.input_arrays()) { CHECK(!absl::EndsWith(specified_input_array.name(), ":0")) << "Unsupported explicit zero output index: " << specified_input_array.name(); } for (const string& specified_output_array : model_flags.output_arrays()) { CHECK(!absl::EndsWith(specified_output_array, ":0")) << "Unsupported explicit zero output index: " << specified_output_array; } Model* model = new Model; internal::ConverterMapType converter_map; // This is used for the TFLite "Full Flex Mode" conversion. All the ops are // imported as `TensorFlowUnsupportedOperator`, and later all these ops are // converted to TFLite Flex ops. if (!tf_import_flags.import_all_ops_as_unsupported) { converter_map = internal::GetTensorFlowNodeConverterMap(); } for (auto node : inlined_graph.node()) { StripZeroOutputIndexFromInputs(&node); auto status = internal::ImportTensorFlowNode(node, tf_import_flags, model, converter_map); CHECK(status.ok()) << status.error_message(); } ResolveModelFlags(model_flags, model); StripCaretFromArrayNames(model); AddExtraOutputs(model); FixNoMissingArray(model); FixNoOrphanedArray(model); FixOperatorOrdering(model); CheckInvariants(*model); // if rnn state arrays are constant, make them transient for (const auto& rnn_state : model->flags.rnn_states()) { model->GetArray(rnn_state.state_array()).buffer = nullptr; } return std::unique_ptr<Model>(model); } std::unique_ptr<Model> ImportTensorFlowGraphDef( const ModelFlags& model_flags, const TensorFlowImportFlags& tf_import_flags, const string& input_file_contents) { std::unique_ptr<GraphDef> tf_graph(new GraphDef); CHECK(ParseFromStringEitherTextOrBinary(input_file_contents, tf_graph.get())); std::unique_ptr<GraphDef> pruned_graph = MaybeReplaceCompositeSubgraph(*tf_graph); if (pruned_graph) { tf_graph = std::move(pruned_graph); } return ImportTensorFlowGraphDef(model_flags, tf_import_flags, *tf_graph); } } // namespace toco
/**************************************************************************** * * (c) 2009-2019 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> * * QGroundControl is licensed according to the terms in the file * COPYING.md in the root of the source code directory. * * @file * @brief Camera Controller * @author Gus Grubba <gus@auterion.com> * */ #include "CustomCameraControl.h" #include "QGCCameraIO.h" QGC_LOGGING_CATEGORY(CustomCameraLog, "CustomCameraLog") QGC_LOGGING_CATEGORY(CustomCameraVerboseLog, "CustomCameraVerboseLog") //----------------------------------------------------------------------------- CustomCameraControl::CustomCameraControl(const mavlink_camera_information_t *info, Vehicle* vehicle, int compID, QObject* parent) : QGCCameraControl(info, vehicle, compID, parent) { connect(_vehicle, &Vehicle::mavlinkMessageReceived, this, &CustomCameraControl::_mavlinkMessageReceived); } //----------------------------------------------------------------------------- bool CustomCameraControl::takePhoto() { bool res = false; res = QGCCameraControl::takePhoto(); return res; } //----------------------------------------------------------------------------- bool CustomCameraControl::stopTakePhoto() { bool res = QGCCameraControl::stopTakePhoto(); return res; } //----------------------------------------------------------------------------- bool CustomCameraControl::startVideo() { bool res = QGCCameraControl::startVideo(); return res; } //----------------------------------------------------------------------------- bool CustomCameraControl::stopVideo() { bool res = QGCCameraControl::stopVideo(); return res; } //----------------------------------------------------------------------------- void CustomCameraControl::setVideoMode() { if(cameraMode() != CAM_MODE_VIDEO) { qCDebug(CustomCameraLog) << "setVideoMode()"; Fact* pFact = getFact(kCAM_MODE); if(pFact) { pFact->setRawValue(CAM_MODE_VIDEO); _setCameraMode(CAM_MODE_VIDEO); } } } //----------------------------------------------------------------------------- void CustomCameraControl::setPhotoMode() { if(cameraMode() != CAM_MODE_PHOTO) { qCDebug(CustomCameraLog) << "setPhotoMode()"; Fact* pFact = getFact(kCAM_MODE); if(pFact) { pFact->setRawValue(CAM_MODE_PHOTO); _setCameraMode(CAM_MODE_PHOTO); } } } //----------------------------------------------------------------------------- void CustomCameraControl::_setVideoStatus(VideoStatus status) { QGCCameraControl::_setVideoStatus(status); } //----------------------------------------------------------------------------- void CustomCameraControl::_mavlinkMessageReceived(const mavlink_message_t& message) { switch (message.msgid) { case MAVLINK_MSG_ID_MOUNT_ORIENTATION: _handleGimbalOrientation(message); break; } } //----------------------------------------------------------------------------- void CustomCameraControl::_handleGimbalOrientation(const mavlink_message_t& message) { mavlink_mount_orientation_t o; mavlink_msg_mount_orientation_decode(&message, &o); if(fabsf(_gimbalRoll - o.roll) > 0.5f) { _gimbalRoll = o.roll; emit gimbalRollChanged(); } if(fabsf(_gimbalPitch - o.pitch) > 0.5f) { _gimbalPitch = o.pitch; emit gimbalPitchChanged(); } if(fabsf(_gimbalYaw - o.yaw) > 0.5f) { _gimbalYaw = o.yaw; emit gimbalYawChanged(); } if(!_gimbalData) { _gimbalData = true; emit gimbalDataChanged(); } } //----------------------------------------------------------------------------- void CustomCameraControl::handleCaptureStatus(const mavlink_camera_capture_status_t& cap) { QGCCameraControl::handleCaptureStatus(cap); }
//===--- OverloadedUnaryAndCheck.cpp - clang-tidy ---------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "OverloadedUnaryAndCheck.h" #include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" using namespace clang::ast_matchers; namespace clang { namespace tidy { namespace google { namespace runtime { void OverloadedUnaryAndCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { // Only register the matchers for C++; the functionality currently does not // provide any benefit to other languages, despite being benign. if (!getLangOpts().CPlusPlus) return; // Match unary methods that overload operator&. Finder->addMatcher( cxxMethodDecl(parameterCountIs(0), hasOverloadedOperatorName("&")) .bind("overload"), this); // Also match freestanding unary operator& overloads. Be careful not to match // binary methods. Finder->addMatcher( functionDecl(allOf( unless(cxxMethodDecl()), functionDecl(parameterCountIs(1), hasOverloadedOperatorName("&")) .bind("overload"))), this); } void OverloadedUnaryAndCheck::check(const MatchFinder::MatchResult &Result) { const auto *Decl = Result.Nodes.getNodeAs<FunctionDecl>("overload"); diag(Decl->getBeginLoc(), "do not overload unary operator&, it is dangerous."); } } // namespace runtime } // namespace google } // namespace tidy } // namespace clang
#include <FunctionalSim/RegisterFile.hpp> #include <ShISA/Inst.hpp> #include <exceptions.hpp> #include <cstdlib> #include <iostream> #include <limits> #include <string> using shisa::fsim::RegisterFile; using Reg = RegisterFile::Reg; void test_r0() { constexpr auto test_name = __FUNCTION__; RegisterFile RF; constexpr int r0 = 0; { const Reg r0_read = RF.read(r0); constexpr Reg r0_expected = 0; SHISA_CHECK_TEST(r0_expected == r0_read, std::string{test_name} + ": r0 == " + std::to_string(r0_read) + " but must be r0 == 0"); } { constexpr Reg some_data = 69; RF.write(r0, some_data); const Reg r0_read = RF.read(r0); constexpr Reg r0_expected = 0; SHISA_CHECK_TEST(r0_expected == r0_read, std::string{test_name} + ": r0 == " + std::to_string(r0_read) + " but must be r0 == 0"); } } void test_r1() { constexpr auto test_name = __FUNCTION__; RegisterFile RF; constexpr int r1 = 1; { const Reg r1_read = RF.read(r1); constexpr Reg r1_expected = 1; SHISA_CHECK_TEST(r1_expected == r1_read, std::string{test_name} + ": r1 == " + std::to_string(r1_read) + " but must be r1 == 1"); } { constexpr Reg some_data = 69; RF.write(r1, some_data); const Reg r1_read = RF.read(r1); constexpr Reg r1_expected = 1; SHISA_CHECK_TEST(r1_expected == r1_read, std::string{test_name} + ": r1 == " + std::to_string(r1_read) + " but must be r1 == 1"); } } void testReadWrite() { constexpr auto test_name = __FUNCTION__; RegisterFile RF; #ifdef FAST_TEST constexpr Reg step = 0xff; #else constexpr Reg step = 1; #endif for (size_t r = shisa::FIRST_WRITABLE_REG; r < shisa::NREGS; r++) { for (Reg data = 0; data < std::numeric_limits<Reg>::max(); data += step) { RF.write(r, data); const Reg readData = RF.read(r); const Reg dataExpected = data; SHISA_CHECK_TEST(dataExpected == readData, std::string{test_name} + ": written:" + std::to_string(data) + " != read:" + std::to_string(readData)); } } } int main() { try { test_r0(); test_r1(); testReadWrite(); } catch (const shisa::test::Exception &e) { std::cerr << __FILE__ ": test fail: " << e.what() << std::endl; exit(EXIT_FAILURE); } }
// // Created by tim on 31-1-18. // #include <chrono> #include "Program.h" using namespace std; void maze() { cout << ":MAZE:" << endl; auto start = chrono::system_clock::now(); Maze *maze = new Maze(15, 15); maze->ToString(); auto end = chrono::system_clock::now(); chrono::duration<double> elapsed_seconds = end - start; cout << "elapsed time: " << elapsed_seconds.count() << "s\n"; cout << maze->ToString(); cout << ":END MAZE:" << endl; free(maze); } void nqueens() { cout << ":NQUEENS:" << endl; NQueens *nQueens = new NQueens(5); cout << nQueens->ToString() << endl; cout << ":END NQUEENS:" << endl; } void BridgeAndTorchProblem() { cout << ":BRIDGE AND TORCH PROBLEM:" << endl; FamilyAtTheBridge *btp = new FamilyAtTheBridge(); btp->SolveWithBacktracking(); cout << ":END BRIDGE AND TORCH PROBLEM:" << endl; } int week1() { cout << ":WEEK1:" << endl; maze(); //nqueens(); TODO implement BridgeAndTorchProblem(); cout << ":END WEEK1:" << endl; return 0; }
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "llvm/Support/Casting.h" #include "mlir/Dialect/Func/IR/FuncOps.h" // from @llvm-project #include "mlir/IR/Attributes.h" // from @llvm-project #include "mlir/IR/BuiltinOps.h" // from @llvm-project #include "mlir/IR/Dialect.h" // from @llvm-project #include "mlir/IR/Operation.h" // from @llvm-project #include "mlir/IR/Visitors.h" // from @llvm-project #include "mlir/Pass/Pass.h" // from @llvm-project #include "mlir/Support/LogicalResult.h" // from @llvm-project #include "tensorflow/compiler/mlir/tensorflow/ir/tf_device.h" #include "tensorflow/compiler/mlir/tensorflow/transforms/tf_device_passes_detail.h" namespace mlir { namespace TFDevice { namespace { constexpr char kDeviceAttr[] = "device"; struct LaunchToDeviceAttributePass : public LaunchToDeviceAttributePassBase<LaunchToDeviceAttributePass> { void runOnOperation() override; }; // Assign all ops in region with specified device from launch. LogicalResult AssignDevicesInRegion(const Dialect* tf_dialect, tf_device::LaunchOp launch, Region& region) { auto result = region.walk([&](Operation* op) -> WalkResult { if (op->getDialect() != tf_dialect) return WalkResult::advance(); auto device_attr = op->getAttr(kDeviceAttr); if (!device_attr) { op->setAttr(kDeviceAttr, launch.deviceAttr()); return WalkResult::advance(); } if (auto device_str_attr = device_attr.dyn_cast<StringAttr>()) { if (device_str_attr.getValue().empty()) { op->setAttr(kDeviceAttr, launch.deviceAttr()); return WalkResult::advance(); } else if (device_str_attr.getValue() != launch.device()) { return launch.emitOpError() << "inner op has conflicting 'device' attribute, " "got '" << device_str_attr.getValue() << "' but expected '" << launch.device() << "'"; } } else { return launch.emitOpError() << "inner op has bad 'device' attribute, got " << device_attr; } return WalkResult::advance(); }); return failure(result.wasInterrupted()); } LogicalResult HoistOpsAndAnnotateWithDevice(const Dialect* tf_dialect, tf_device::LaunchOp launch) { // Forward launch inner op results to launch op results. launch.replaceAllUsesWith(launch.GetBody().getTerminator()->getOperands()); // For all inner ops, assign the launch device as a `device` attribute. if (failed(AssignDevicesInRegion(tf_dialect, launch, launch.body()))) return failure(); // Move all inner ops of the launch to the block containing the launch. auto body = launch.GetBody().without_terminator(); Operation* launch_op = launch.getOperation(); launch_op->getBlock()->getOperations().splice( launch_op->getIterator(), launch.GetBody().getOperations(), body.begin(), body.end()); launch.erase(); return success(); } void LaunchToDeviceAttributePass::runOnOperation() { const Dialect* tf_dialect = getContext().getLoadedDialect("tf"); if (!tf_dialect) { getOperation().emitError() << "'tf' dialect is not registered"; return signalPassFailure(); } auto result = getOperation().walk([&tf_dialect](tf_device::LaunchOp launch) { if (failed(HoistOpsAndAnnotateWithDevice(tf_dialect, launch))) return WalkResult::interrupt(); return WalkResult::advance(); }); if (result.wasInterrupted()) return signalPassFailure(); } } // anonymous namespace std::unique_ptr<OperationPass<FuncOp>> CreateLaunchToDeviceAttributePass() { return std::make_unique<LaunchToDeviceAttributePass>(); } } // namespace TFDevice } // namespace mlir
#include "client.h" #include "dataset.h" #include "client_test_utils.h" #include "dataset_test_utils.h" void rename_dataset(std::string keyout) { std::vector<size_t> dims({10,10,2}); SmartRedis::Client client(use_cluster()); client.use_tensor_ensemble_prefix(true); double*** t_send_1 = allocate_3D_array<double>(dims[0], dims[1], dims[2]); set_3D_array_floating_point_values<double>(t_send_1, dims[0], dims[1], dims[2]); double*** t_send_2 = allocate_3D_array<double>(dims[0], dims[1], dims[2]); set_3D_array_floating_point_values<double>(t_send_2, dims[0], dims[1], dims[2]); std::string name = "ensemble_dataset"; SmartRedis::DataSet dataset(name); DATASET_TEST_UTILS::fill_dataset_with_metadata(dataset); //Add tensors to the DataSet std::string t_name_1 = "tensor_1"; std::string t_name_2 = "tensor_2"; dataset.add_tensor(t_name_1, t_send_1, dims, SmartRedis::TensorType::dbl, SmartRedis::MemoryLayout::nested); dataset.add_tensor(t_name_2, t_send_2, dims, SmartRedis::TensorType::dbl, SmartRedis::MemoryLayout::nested); client.put_dataset(dataset); std::string new_name = "ensemble_dataset_renamed"; client.rename_dataset(name, new_name); if(!client.key_exists(keyout + "." + new_name)) throw std::runtime_error("The dataset ack key for the new "\ "DataSet does not exist in the " "database."); if(client.key_exists(keyout + "." + name)) throw std::runtime_error("The dataset ack key for the old "\ "DataSet was not deleted."); if(client.key_exists(keyout + "." + name + ".meta")) throw std::runtime_error("The dataset meta key for the old "\ "DataSet was not deleted."); if(client.key_exists(keyout + "." + name + "." + t_name_1)) throw std::runtime_error("The dataset tensor key for " + t_name_1 + " was not deleted."); if(client.key_exists(keyout + "." + name + "." + t_name_2)) throw std::runtime_error("The dataset tensor key for " + t_name_2 + " was not deleted."); //Retrieving a dataset SmartRedis::DataSet retrieved_dataset = client.get_dataset(new_name); DATASET_TEST_UTILS::check_tensor_names(retrieved_dataset, {t_name_1, t_name_2}); //Check that the tensors are the same DATASET_TEST_UTILS::check_nested_3D_tensor(retrieved_dataset, t_name_1, SmartRedis::TensorType::dbl, t_send_1, dims); DATASET_TEST_UTILS::check_nested_3D_tensor(retrieved_dataset, t_name_2, SmartRedis::TensorType::dbl, t_send_2, dims); //Check that the metadata values are correct for the metadata DATASET_TEST_UTILS::check_dataset_metadata(retrieved_dataset); return; } int main(int argc, char* argv[]) { const char* old_keyin = std::getenv("SSKEYIN"); const char* old_keyout = std::getenv("SSKEYOUT"); char keyin_env_put[] = "SSKEYIN=producer_0,producer_1"; char keyout_env_put[] = "SSKEYOUT=producer_0"; putenv( keyin_env_put ); putenv( keyout_env_put ); rename_dataset("producer_0"); if (old_keyin != nullptr) { std::string reset_keyin = std::string("SSKEYIN=") + std::string(old_keyin); char* reset_keyin_c = new char[reset_keyin.size() + 1]; std::copy(reset_keyin.begin(), reset_keyin.end(), reset_keyin_c); reset_keyin_c[reset_keyin.size()] = '\0'; putenv( reset_keyin_c); delete [] reset_keyin_c; } else { unsetenv("SSKEYIN"); } if (old_keyout != nullptr) { std::string reset_keyout = std::string("SSKEYOUT=") + std::string(old_keyout); char* reset_keyout_c = new char[reset_keyout.size() + 1]; std::copy(reset_keyout.begin(), reset_keyout.end(), reset_keyout_c); reset_keyout_c[reset_keyout.size()] = '\0'; putenv( reset_keyout_c); delete [] reset_keyout_c; } else { unsetenv("SSKEYOUT"); } std::cout<<"Ensemble test complete"<<std::endl; return 0; }
#include <vector> using namespace std; class Solution { public: void rotate(vector<int>& nums, int k) { int n = nums.size(), t, offset = n - k % n; if (offset == 0) return; while (offset) { t = nums[0]; offset -= 1; for (int i = 0; i < n - 1; i++) nums[i] = nums[i + 1]; nums[n - 1] = t; } } };
#pragma once #include "common/ChatterinoSetting.hpp" #include "common/Singleton.hpp" #include <QFont> #include <QFontDatabase> #include <QFontMetrics> #include <boost/noncopyable.hpp> #include <pajlada/signals/signal.hpp> #include <array> #include <unordered_map> namespace AB_NAMESPACE { class Settings; class Paths; enum class FontStyle : uint8_t { Tiny, ChatSmall, ChatMediumSmall, ChatMedium, ChatMediumBold, ChatMediumItalic, ChatLarge, ChatVeryLarge, UiMedium, UiTabs, // don't remove this value EndType, // make sure to update these values accordingly! ChatStart = ChatSmall, ChatEnd = ChatVeryLarge, }; class Fonts final : public Singleton { public: Fonts(); virtual void initialize(Settings &settings, Paths &paths) override; // font data gets set in createFontData(...) QFont getFont(FontStyle type, float scale); QFontMetrics getFontMetrics(FontStyle type, float scale); QStringSetting chatFontFamily; IntSetting chatFontSize; pajlada::Signals::NoArgSignal fontChanged; static Fonts *instance; private: struct FontData { FontData(const QFont &_font) : font(_font) , metrics(_font) { } const QFont font; const QFontMetrics metrics; }; struct ChatFontData { float scale; bool italic; QFont::Weight weight; }; struct UiFontData { float size; const char *name; bool italic; QFont::Weight weight; }; FontData &getOrCreateFontData(FontStyle type, float scale); FontData createFontData(FontStyle type, float scale); std::vector<std::unordered_map<float, FontData>> fontsByType_; }; Fonts *getFonts(); } // namespace AB_NAMESPACE
/* * Copyright (c) 2013 - 2016 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall * not be construed as granting a license to any other intellectual * property including but not limited to intellectual property relating * to a hardware implementation of the functionality of the software * licensed hereunder. You may use the software subject to the license * terms below provided that you ensure that this notice is replicated * unmodified and in its entirety in all distributions of the software, * modified or unmodified, in source code or in binary form. * * 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 copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "cpu/trace/trace_cpu.hh" #include "base/compiler.hh" #include "sim/sim_exit.hh" namespace gem5 { // Declare and initialize the static counter for number of trace CPUs. int TraceCPU::numTraceCPUs = 0; TraceCPU::TraceCPU(const TraceCPUParams &params) : BaseCPU(params), icachePort(this), dcachePort(this), mcachePort(this), instRequestorID(params.system->getRequestorId(this, "inst")), dataRequestorID(params.system->getRequestorId(this, "data")), instTraceFile(params.instTraceFile), dataTraceFile(params.dataTraceFile), icacheGen(*this, ".iside", icachePort, instRequestorID, instTraceFile), dcacheGen(*this, ".dside", dcachePort, dataRequestorID, dataTraceFile, params), icacheNextEvent([this]{ schedIcacheNext(); }, name()), dcacheNextEvent([this]{ schedDcacheNext(); }, name()), oneTraceComplete(false), traceOffset(0), execCompleteEvent(nullptr), enableEarlyExit(params.enableEarlyExit), progressMsgInterval(params.progressMsgInterval), progressMsgThreshold(params.progressMsgInterval), traceStats(this) { // Increment static counter for number of Trace CPUs. ++TraceCPU::numTraceCPUs; // Check that the python parameters for sizes of ROB, store buffer and // load buffer do not overflow the corresponding C++ variables. fatal_if(params.sizeROB > UINT16_MAX, "ROB size set to %d exceeds the max. value of %d.", params.sizeROB, UINT16_MAX); fatal_if(params.sizeStoreBuffer > UINT16_MAX, "ROB size set to %d exceeds the max. value of %d.", params.sizeROB, UINT16_MAX); fatal_if(params.sizeLoadBuffer > UINT16_MAX, "Load buffer size set to %d exceeds the max. value of %d.", params.sizeLoadBuffer, UINT16_MAX); } void TraceCPU::updateNumOps(uint64_t rob_num) { traceStats.numOps = rob_num; if (progressMsgInterval != 0 && traceStats.numOps.value() >= progressMsgThreshold) { inform("%s: %i insts committed\n", name(), progressMsgThreshold); progressMsgThreshold += progressMsgInterval; } } void TraceCPU::takeOverFrom(BaseCPU *oldCPU) { // Unbind the ports of the old CPU and bind the ports of the TraceCPU. getInstPort().takeOverFrom(&oldCPU->getInstPort()); getDataPort().takeOverFrom(&oldCPU->getDataPort()); getMetaPort().takeOverFrom(&oldCPU->getMetaPort()); } void TraceCPU::init() { DPRINTF(TraceCPUInst, "Instruction fetch request trace file is \"%s\".\n", instTraceFile); DPRINTF(TraceCPUData, "Data memory request trace file is \"%s\".\n", dataTraceFile); BaseCPU::init(); // Get the send tick of the first instruction read request Tick first_icache_tick = icacheGen.init(); // Get the send tick of the first data read/write request Tick first_dcache_tick = dcacheGen.init(); // Set the trace offset as the minimum of that in both traces traceOffset = std::min(first_icache_tick, first_dcache_tick); inform("%s: Time offset (tick) found as min of both traces is %lli.", name(), traceOffset); // Schedule next icache and dcache event by subtracting the offset schedule(icacheNextEvent, first_icache_tick - traceOffset); schedule(dcacheNextEvent, first_dcache_tick - traceOffset); // Adjust the trace offset for the dcache generator's ready nodes // We don't need to do this for the icache generator as it will // send its first request at the first event and schedule subsequent // events using a relative tick delta dcacheGen.adjustInitTraceOffset(traceOffset); // If the Trace CPU simulation is configured to exit on any one trace // completion then we don't need a counted event to count down all Trace // CPUs in the system. If not then instantiate a counted event. if (!enableEarlyExit) { // The static counter for number of Trace CPUs is correctly set at // this point so create an event and pass it. execCompleteEvent = new CountedExitEvent("end of all traces reached.", numTraceCPUs); } } void TraceCPU::schedIcacheNext() { DPRINTF(TraceCPUInst, "IcacheGen event.\n"); // Try to send the current packet or a retry packet if there is one bool sched_next = icacheGen.tryNext(); // If packet sent successfully, schedule next event if (sched_next) { DPRINTF(TraceCPUInst, "Scheduling next icacheGen event at %d.\n", curTick() + icacheGen.tickDelta()); schedule(icacheNextEvent, curTick() + icacheGen.tickDelta()); ++traceStats.numSchedIcacheEvent; } else { // check if traceComplete. If not, do nothing because sending failed // and next event will be scheduled via RecvRetry() if (icacheGen.isTraceComplete()) { // If this is the first trace to complete, set the variable. If it // is already set then both traces are complete to exit sim. checkAndSchedExitEvent(); } } return; } void TraceCPU::schedDcacheNext() { DPRINTF(TraceCPUData, "DcacheGen event.\n"); // Update stat for numCycles baseStats.numCycles = clockEdge() / clockPeriod(); dcacheGen.execute(); if (dcacheGen.isExecComplete()) { checkAndSchedExitEvent(); } } void TraceCPU::checkAndSchedExitEvent() { if (!oneTraceComplete) { oneTraceComplete = true; } else { // Schedule event to indicate execution is complete as both // instruction and data access traces have been played back. inform("%s: Execution complete.", name()); // If the replay is configured to exit early, that is when any one // execution is complete then exit immediately and return. Otherwise, // schedule the counted exit that counts down completion of each Trace // CPU. if (enableEarlyExit) { exitSimLoop("End of trace reached"); } else { schedule(*execCompleteEvent, curTick()); } } } TraceCPU::TraceStats::TraceStats(TraceCPU *trace) : statistics::Group(trace), ADD_STAT(numSchedDcacheEvent, statistics::units::Count::get(), "Number of events scheduled to trigger data request generator"), ADD_STAT(numSchedIcacheEvent, statistics::units::Count::get(), "Number of events scheduled to trigger instruction request " "generator"), ADD_STAT(numOps, statistics::units::Count::get(), "Number of micro-ops simulated by the Trace CPU"), ADD_STAT(cpi, statistics::units::Rate< statistics::units::Cycle, statistics::units::Count>::get(), "Cycles per micro-op used as a proxy for CPI", trace->baseStats.numCycles / numOps) { cpi.precision(6); } TraceCPU::ElasticDataGen:: ElasticDataGenStatGroup::ElasticDataGenStatGroup(statistics::Group *parent, const std::string& _name) : statistics::Group(parent, _name.c_str()), ADD_STAT(maxDependents, statistics::units::Count::get(), "Max number of dependents observed on a node"), ADD_STAT(maxReadyListSize, statistics::units::Count::get(), "Max size of the ready list observed"), ADD_STAT(numSendAttempted, statistics::units::Count::get(), "Number of first attempts to send a request"), ADD_STAT(numSendSucceeded, statistics::units::Count::get(), "Number of successful first attempts"), ADD_STAT(numSendFailed, statistics::units::Count::get(), "Number of failed first attempts"), ADD_STAT(numRetrySucceeded, statistics::units::Count::get(), "Number of successful retries"), ADD_STAT(numSplitReqs, statistics::units::Count::get(), "Number of split requests"), ADD_STAT(numSOLoads, statistics::units::Count::get(), "Number of strictly ordered loads"), ADD_STAT(numSOStores, statistics::units::Count::get(), "Number of strictly ordered stores"), ADD_STAT(dataLastTick, statistics::units::Tick::get(), "Last tick simulated from the elastic data trace") { } Tick TraceCPU::ElasticDataGen::init() { DPRINTF(TraceCPUData, "Initializing data memory request generator " "DcacheGen: elastic issue with retry.\n"); panic_if(!readNextWindow(), "Trace has %d elements. It must have at least %d elements.", depGraph.size(), 2 * windowSize); DPRINTF(TraceCPUData, "After 1st read, depGraph size:%d.\n", depGraph.size()); panic_if(!readNextWindow(), "Trace has %d elements. It must have at least %d elements.", depGraph.size(), 2 * windowSize); DPRINTF(TraceCPUData, "After 2st read, depGraph size:%d.\n", depGraph.size()); // Print readyList if (debug::TraceCPUData) { printReadyList(); } auto free_itr = readyList.begin(); DPRINTF(TraceCPUData, "Execute tick of the first dependency free node %lli is %d.\n", free_itr->seqNum, free_itr->execTick); // Return the execute tick of the earliest ready node so that an event // can be scheduled to call execute() return (free_itr->execTick); } void TraceCPU::ElasticDataGen::adjustInitTraceOffset(Tick& offset) { for (auto& free_node : readyList) { free_node.execTick -= offset; } } void TraceCPU::ElasticDataGen::exit() { trace.reset(); } bool TraceCPU::ElasticDataGen::readNextWindow() { // Read and add next window DPRINTF(TraceCPUData, "Reading next window from file.\n"); if (traceComplete) { // We are at the end of the file, thus we have no more records. // Return false. return false; } DPRINTF(TraceCPUData, "Start read: Size of depGraph is %d.\n", depGraph.size()); uint32_t num_read = 0; while (num_read != windowSize) { // Create a new graph node GraphNode* new_node = new GraphNode; // Read the next line to get the next record. If that fails then end of // trace has been reached and traceComplete needs to be set in addition // to returning false. if (!trace.read(new_node)) { DPRINTF(TraceCPUData, "\tTrace complete!\n"); traceComplete = true; return false; } // Annotate the ROB dependencies of the new node onto the parent nodes. addDepsOnParent(new_node, new_node->robDep); // Annotate the register dependencies of the new node onto the parent // nodes. addDepsOnParent(new_node, new_node->regDep); num_read++; // Add to map depGraph[new_node->seqNum] = new_node; if (new_node->robDep.empty() && new_node->regDep.empty()) { // Source dependencies are already complete, check if resources // are available and issue. The execution time is approximated // to current time plus the computational delay. checkAndIssue(new_node); } } DPRINTF(TraceCPUData, "End read: Size of depGraph is %d.\n", depGraph.size()); return true; } template<typename T> void TraceCPU::ElasticDataGen::addDepsOnParent(GraphNode *new_node, T& dep_list) { auto dep_it = dep_list.begin(); while (dep_it != dep_list.end()) { // We look up the valid dependency, i.e. the parent of this node auto parent_itr = depGraph.find(*dep_it); if (parent_itr != depGraph.end()) { // If the parent is found, it is yet to be executed. Append a // pointer to the new node to the dependents list of the parent // node. parent_itr->second->dependents.push_back(new_node); auto num_depts = parent_itr->second->dependents.size(); elasticStats.maxDependents = std::max<double>(num_depts, elasticStats.maxDependents.value()); dep_it++; } else { // The dependency is not found in the graph. So consider // the execution of the parent is complete, i.e. remove this // dependency. dep_it = dep_list.erase(dep_it); } } } void TraceCPU::ElasticDataGen::execute() { DPRINTF(TraceCPUData, "Execute start occupancy:\n"); DPRINTFR(TraceCPUData, "\tdepGraph = %d, readyList = %d, " "depFreeQueue = %d ,", depGraph.size(), readyList.size(), depFreeQueue.size()); hwResource.printOccupancy(); // Read next window to make sure that dependents of all dep-free nodes // are in the depGraph if (nextRead) { readNextWindow(); nextRead = false; } // First attempt to issue the pending dependency-free nodes held // in depFreeQueue. If resources have become available for a node, // then issue it, i.e. add the node to readyList. while (!depFreeQueue.empty()) { if (checkAndIssue(depFreeQueue.front(), false)) { DPRINTF(TraceCPUData, "Removing from depFreeQueue: seq. num %lli.\n", (depFreeQueue.front())->seqNum); depFreeQueue.pop(); } else { break; } } // Proceed to execute from readyList auto graph_itr = depGraph.begin(); auto free_itr = readyList.begin(); // Iterate through readyList until the next free node has its execute // tick later than curTick or the end of readyList is reached while (free_itr->execTick <= curTick() && free_itr != readyList.end()) { // Get pointer to the node to be executed graph_itr = depGraph.find(free_itr->seqNum); assert(graph_itr != depGraph.end()); GraphNode* node_ptr = graph_itr->second; // If there is a retryPkt send that else execute the load if (retryPkt) { // The retryPkt must be the request that was created by the // first node in the readyList. if (retryPkt->req->getReqInstSeqNum() != node_ptr->seqNum) { panic("Retry packet's seqence number does not match " "the first node in the readyList.\n"); } if (port.sendTimingReq(retryPkt)) { ++elasticStats.numRetrySucceeded; retryPkt = nullptr; } } else if (node_ptr->isLoad() || node_ptr->isStore()) { // If there is no retryPkt, attempt to send a memory request in // case of a load or store node. If the send fails, executeMemReq() // returns a packet pointer, which we save in retryPkt. In case of // a comp node we don't do anything and simply continue as if the // execution of the comp node succedded. retryPkt = executeMemReq(node_ptr); } // If the retryPkt or a new load/store node failed, we exit from here // as a retry from cache will bring the control to execute(). The // first node in readyList then, will be the failed node. if (retryPkt) { break; } // Proceed to remove dependencies for the successfully executed node. // If it is a load which is not strictly ordered and we sent a // request for it successfully, we do not yet mark any register // dependencies complete. But as per dependency modelling we need // to mark ROB dependencies of load and non load/store nodes which // are based on successful sending of the load as complete. if (node_ptr->isLoad() && !node_ptr->isStrictlyOrdered()) { // If execute succeeded mark its dependents as complete DPRINTF(TraceCPUData, "Node seq. num %lli sent. Waking up dependents..\n", node_ptr->seqNum); auto child_itr = (node_ptr->dependents).begin(); while (child_itr != (node_ptr->dependents).end()) { // ROB dependency of a store on a load must not be removed // after load is sent but after response is received if (!(*child_itr)->isStore() && (*child_itr)->removeRobDep(node_ptr->seqNum)) { // Check if the child node has become dependency free if ((*child_itr)->robDep.empty() && (*child_itr)->regDep.empty()) { // Source dependencies are complete, check if // resources are available and issue checkAndIssue(*child_itr); } // Remove this child for the sent load and point to new // location of the element following the erased element child_itr = node_ptr->dependents.erase(child_itr); } else { // This child is not dependency-free, point to the next // child child_itr++; } } } else { // If it is a strictly ordered load mark its dependents as complete // as we do not send a request for this case. If it is a store or a // comp node we also mark all its dependents complete. DPRINTF(TraceCPUData, "Node seq. num %lli done. Waking" " up dependents..\n", node_ptr->seqNum); for (auto child : node_ptr->dependents) { // If the child node is dependency free removeDepOnInst() // returns true. if (child->removeDepOnInst(node_ptr->seqNum)) { // Source dependencies are complete, check if resources // are available and issue checkAndIssue(child); } } } // After executing the node, remove from readyList and delete node. readyList.erase(free_itr); // If it is a cacheable load which was sent, don't delete // just yet. Delete it in completeMemAccess() after the // response is received. If it is an strictly ordered // load, it was not sent and all dependencies were simply // marked complete. Thus it is safe to delete it. For // stores and non load/store nodes all dependencies were // marked complete so it is safe to delete it. if (!node_ptr->isLoad() || node_ptr->isStrictlyOrdered()) { // Release all resources occupied by the completed node hwResource.release(node_ptr); // clear the dynamically allocated set of dependents (node_ptr->dependents).clear(); // Update the stat for numOps simulated owner.updateNumOps(node_ptr->robNum); // delete node delete node_ptr; // remove from graph depGraph.erase(graph_itr); } // Point to first node to continue to next iteration of while loop free_itr = readyList.begin(); } // end of while loop // Print readyList, sizes of queues and resource status after updating if (debug::TraceCPUData) { printReadyList(); DPRINTF(TraceCPUData, "Execute end occupancy:\n"); DPRINTFR(TraceCPUData, "\tdepGraph = %d, readyList = %d, " "depFreeQueue = %d ,", depGraph.size(), readyList.size(), depFreeQueue.size()); hwResource.printOccupancy(); } if (retryPkt) { DPRINTF(TraceCPUData, "Not scheduling an event as expecting a retry" "event from the cache for seq. num %lli.\n", retryPkt->req->getReqInstSeqNum()); return; } // If the size of the dependency graph is less than the dependency window // then read from the trace file to populate the graph next time we are in // execute. if (depGraph.size() < windowSize && !traceComplete) nextRead = true; // If cache is not blocked, schedule an event for the first execTick in // readyList else retry from cache will schedule the event. If the ready // list is empty then check if the next pending node has resources // available to issue. If yes, then schedule an event for the next cycle. if (!readyList.empty()) { Tick next_event_tick = std::max(readyList.begin()->execTick, curTick()); DPRINTF(TraceCPUData, "Attempting to schedule @%lli.\n", next_event_tick); owner.schedDcacheNextEvent(next_event_tick); } else if (readyList.empty() && !depFreeQueue.empty() && hwResource.isAvailable(depFreeQueue.front())) { DPRINTF(TraceCPUData, "Attempting to schedule @%lli.\n", owner.clockEdge(Cycles(1))); owner.schedDcacheNextEvent(owner.clockEdge(Cycles(1))); } // If trace is completely read, readyList is empty and depGraph is empty, // set execComplete to true if (depGraph.empty() && readyList.empty() && traceComplete && !hwResource.awaitingResponse()) { DPRINTF(TraceCPUData, "\tExecution Complete!\n"); execComplete = true; elasticStats.dataLastTick = curTick(); } } PacketPtr TraceCPU::ElasticDataGen::executeMemReq(GraphNode* node_ptr) { DPRINTF(TraceCPUData, "Executing memory request %lli (phys addr %d, " "virt addr %d, pc %#x, size %d, flags %d).\n", node_ptr->seqNum, node_ptr->physAddr, node_ptr->virtAddr, node_ptr->pc, node_ptr->size, node_ptr->flags); // If the request is strictly ordered, do not send it. Just return nullptr // as if it was succesfully sent. if (node_ptr->isStrictlyOrdered()) { node_ptr->isLoad() ? ++elasticStats.numSOLoads : ++elasticStats.numSOStores; DPRINTF(TraceCPUData, "Skipping strictly ordered request %lli.\n", node_ptr->seqNum); return nullptr; } // Check if the request spans two cache lines as this condition triggers // an assert fail in the L1 cache. If it does then truncate the size to // access only until the end of that line and ignore the remainder. The // stat counting this is useful to keep a check on how frequently this // happens. If required the code could be revised to mimick splitting such // a request into two. unsigned blk_size = owner.cacheLineSize(); Addr blk_offset = (node_ptr->physAddr & (Addr)(blk_size - 1)); if (!(blk_offset + node_ptr->size <= blk_size)) { node_ptr->size = blk_size - blk_offset; ++elasticStats.numSplitReqs; } // Create a request and the packet containing request auto req = std::make_shared<Request>( node_ptr->physAddr, node_ptr->size, node_ptr->flags, requestorId); req->setReqInstSeqNum(node_ptr->seqNum); // If this is not done it triggers assert in L1 cache for invalid contextId req->setContext(ContextID(0)); req->setPC(node_ptr->pc); // If virtual address is valid, set the virtual address field // of the request. if (node_ptr->virtAddr != 0) { req->setVirt(node_ptr->virtAddr, node_ptr->size, node_ptr->flags, requestorId, node_ptr->pc); req->setPaddr(node_ptr->physAddr); req->setReqInstSeqNum(node_ptr->seqNum); } PacketPtr pkt; uint8_t* pkt_data = new uint8_t[req->getSize()]; if (node_ptr->isLoad()) { pkt = Packet::createRead(req); } else { pkt = Packet::createWrite(req); memset(pkt_data, 0xA, req->getSize()); } pkt->dataDynamic(pkt_data); // Call RequestPort method to send a timing request for this packet bool success = port.sendTimingReq(pkt); ++elasticStats.numSendAttempted; if (!success) { // If it fails, return the packet to retry when a retry is signalled by // the cache ++elasticStats.numSendFailed; DPRINTF(TraceCPUData, "Send failed. Saving packet for retry.\n"); return pkt; } else { // It is succeeds, return nullptr ++elasticStats.numSendSucceeded; return nullptr; } } bool TraceCPU::ElasticDataGen::checkAndIssue(const GraphNode* node_ptr, bool first) { // Assert the node is dependency-free assert(node_ptr->robDep.empty() && node_ptr->regDep.empty()); // If this is the first attempt, print a debug message to indicate this. if (first) { DPRINTFR(TraceCPUData, "\t\tseq. num %lli(%s) with rob num %lli is now" " dependency free.\n", node_ptr->seqNum, node_ptr->typeToStr(), node_ptr->robNum); } // Check if resources are available to issue the specific node if (hwResource.isAvailable(node_ptr)) { // If resources are free only then add to readyList DPRINTFR(TraceCPUData, "\t\tResources available for seq. num %lli. " "Adding to readyList, occupying resources.\n", node_ptr->seqNum); // Compute the execute tick by adding the compute delay for the node // and add the ready node to the ready list addToSortedReadyList(node_ptr->seqNum, owner.clockEdge() + node_ptr->compDelay); // Account for the resources taken up by this issued node. hwResource.occupy(node_ptr); return true; } else { if (first) { // Although dependencies are complete, resources are not available. DPRINTFR(TraceCPUData, "\t\tResources unavailable for seq. num " "%lli. Adding to depFreeQueue.\n", node_ptr->seqNum); depFreeQueue.push(node_ptr); } else { DPRINTFR(TraceCPUData, "\t\tResources unavailable for seq. num " "%lli. Still pending issue.\n", node_ptr->seqNum); } return false; } } void TraceCPU::ElasticDataGen::completeMemAccess(PacketPtr pkt) { // Release the resources for this completed node. if (pkt->isWrite()) { // Consider store complete. hwResource.releaseStoreBuffer(); // If it is a store response then do nothing since we do not model // dependencies on store completion in the trace. But if we were // blocking execution due to store buffer fullness, we need to schedule // an event and attempt to progress. } else { // If it is a load response then release the dependents waiting on it. // Get pointer to the completed load auto graph_itr = depGraph.find(pkt->req->getReqInstSeqNum()); assert(graph_itr != depGraph.end()); GraphNode* node_ptr = graph_itr->second; // Release resources occupied by the load hwResource.release(node_ptr); DPRINTF(TraceCPUData, "Load seq. num %lli response received. Waking up" " dependents..\n", node_ptr->seqNum); for (auto child : node_ptr->dependents) { if (child->removeDepOnInst(node_ptr->seqNum)) { checkAndIssue(child); } } // clear the dynamically allocated set of dependents (node_ptr->dependents).clear(); // Update the stat for numOps completed owner.updateNumOps(node_ptr->robNum); // delete node delete node_ptr; // remove from graph depGraph.erase(graph_itr); } if (debug::TraceCPUData) { printReadyList(); } // If the size of the dependency graph is less than the dependency window // then read from the trace file to populate the graph next time we are in // execute. if (depGraph.size() < windowSize && !traceComplete) nextRead = true; // If not waiting for retry, attempt to schedule next event if (!retryPkt) { // We might have new dep-free nodes in the list which will have execute // tick greater than or equal to curTick. But a new dep-free node might // have its execute tick earlier. Therefore, attempt to reschedule. It // could happen that the readyList is empty and we got here via a // last remaining response. So, either the trace is complete or there // are pending nodes in the depFreeQueue. The checking is done in the // execute() control flow, so schedule an event to go via that flow. Tick next_event_tick = readyList.empty() ? owner.clockEdge(Cycles(1)) : std::max(readyList.begin()->execTick, owner.clockEdge(Cycles(1))); DPRINTF(TraceCPUData, "Attempting to schedule @%lli.\n", next_event_tick); owner.schedDcacheNextEvent(next_event_tick); } } void TraceCPU::ElasticDataGen::addToSortedReadyList(NodeSeqNum seq_num, Tick exec_tick) { ReadyNode ready_node; ready_node.seqNum = seq_num; ready_node.execTick = exec_tick; // Iterator to readyList auto itr = readyList.begin(); // If the readyList is empty, simply insert the new node at the beginning // and return if (itr == readyList.end()) { readyList.insert(itr, ready_node); elasticStats.maxReadyListSize = std::max<double>(readyList.size(), elasticStats.maxReadyListSize.value()); return; } // If the new node has its execution tick equal to the first node in the // list then go to the next node. If the first node in the list failed // to execute, its position as the first is thus maintained. if (retryPkt) { if (retryPkt->req->getReqInstSeqNum() == itr->seqNum) itr++; } // Increment the iterator and compare the node pointed to by it to the new // node till the position to insert the new node is found. bool found = false; while (!found && itr != readyList.end()) { // If the execution tick of the new node is less than the node then // this is the position to insert if (exec_tick < itr->execTick) { found = true; // If the execution tick of the new node is equal to the node then // sort in ascending order of sequence numbers } else if (exec_tick == itr->execTick) { // If the sequence number of the new node is less than the node // then this is the position to insert if (seq_num < itr->seqNum) { found = true; // Else go to next node } else { itr++; } } else { // If the execution tick of the new node is greater than the node // then go to the next node. itr++; } } readyList.insert(itr, ready_node); // Update the stat for max size reached of the readyList elasticStats.maxReadyListSize = std::max<double>(readyList.size(), elasticStats.maxReadyListSize.value()); } void TraceCPU::ElasticDataGen::printReadyList() { auto itr = readyList.begin(); if (itr == readyList.end()) { DPRINTF(TraceCPUData, "readyList is empty.\n"); return; } DPRINTF(TraceCPUData, "Printing readyList:\n"); while (itr != readyList.end()) { auto graph_itr = depGraph.find(itr->seqNum); GEM5_VAR_USED GraphNode* node_ptr = graph_itr->second; DPRINTFR(TraceCPUData, "\t%lld(%s), %lld\n", itr->seqNum, node_ptr->typeToStr(), itr->execTick); itr++; } } TraceCPU::ElasticDataGen::HardwareResource::HardwareResource( uint16_t max_rob, uint16_t max_stores, uint16_t max_loads) : sizeROB(max_rob), sizeStoreBuffer(max_stores), sizeLoadBuffer(max_loads), oldestInFlightRobNum(UINT64_MAX), numInFlightLoads(0), numInFlightStores(0) {} void TraceCPU::ElasticDataGen::HardwareResource::occupy(const GraphNode* new_node) { // Occupy ROB entry for the issued node // Merely maintain the oldest node, i.e. numerically least robNum by saving // it in the variable oldestInFLightRobNum. inFlightNodes[new_node->seqNum] = new_node->robNum; oldestInFlightRobNum = inFlightNodes.begin()->second; // Occupy Load/Store Buffer entry for the issued node if applicable if (new_node->isLoad()) { ++numInFlightLoads; } else if (new_node->isStore()) { ++numInFlightStores; } // else if it is a non load/store node, no buffer entry is occupied printOccupancy(); } void TraceCPU::ElasticDataGen::HardwareResource::release(const GraphNode* done_node) { assert(!inFlightNodes.empty()); DPRINTFR(TraceCPUData, "\tClearing done seq. num %d from inFlightNodes..\n", done_node->seqNum); assert(inFlightNodes.find(done_node->seqNum) != inFlightNodes.end()); inFlightNodes.erase(done_node->seqNum); if (inFlightNodes.empty()) { // If we delete the only in-flight node and then the // oldestInFlightRobNum is set to it's initialized (max) value. oldestInFlightRobNum = UINT64_MAX; } else { // Set the oldest in-flight node rob number equal to the first node in // the inFlightNodes since that will have the numerically least value. oldestInFlightRobNum = inFlightNodes.begin()->second; } DPRINTFR(TraceCPUData, "\tCleared. inFlightNodes.size() = %d, " "oldestInFlightRobNum = %d\n", inFlightNodes.size(), oldestInFlightRobNum); // A store is considered complete when a request is sent, thus ROB entry is // freed. But it occupies an entry in the Store Buffer until its response // is received. A load is considered complete when a response is received, // thus both ROB and Load Buffer entries can be released. if (done_node->isLoad()) { assert(numInFlightLoads != 0); --numInFlightLoads; } // For normal writes, we send the requests out and clear a store buffer // entry on response. For writes which are strictly ordered, for e.g. // writes to device registers, we do that within release() which is called // when node is executed and taken off from readyList. if (done_node->isStore() && done_node->isStrictlyOrdered()) { releaseStoreBuffer(); } } void TraceCPU::ElasticDataGen::HardwareResource::releaseStoreBuffer() { assert(numInFlightStores != 0); --numInFlightStores; } bool TraceCPU::ElasticDataGen::HardwareResource::isAvailable( const GraphNode* new_node) const { uint16_t num_in_flight_nodes; if (inFlightNodes.empty()) { num_in_flight_nodes = 0; DPRINTFR(TraceCPUData, "\t\tChecking resources to issue seq. num %lli:" " #in-flight nodes = 0", new_node->seqNum); } else if (new_node->robNum > oldestInFlightRobNum) { // This is the intuitive case where new dep-free node is younger // instruction than the oldest instruction in-flight. Thus we make sure // in_flight_nodes does not overflow. num_in_flight_nodes = new_node->robNum - oldestInFlightRobNum; DPRINTFR(TraceCPUData, "\t\tChecking resources to issue seq. num %lli:" " #in-flight nodes = %d - %d = %d", new_node->seqNum, new_node->robNum, oldestInFlightRobNum, num_in_flight_nodes); } else { // This is the case where an instruction older than the oldest in- // flight instruction becomes dep-free. Thus we must have already // accounted for the entry in ROB for this new dep-free node. // Immediately after this check returns true, oldestInFlightRobNum will // be updated in occupy(). We simply let this node issue now. num_in_flight_nodes = 0; DPRINTFR(TraceCPUData, "\t\tChecking resources to issue seq. num %lli:" " new oldestInFlightRobNum = %d, #in-flight nodes ignored", new_node->seqNum, new_node->robNum); } DPRINTFR(TraceCPUData, ", LQ = %d/%d, SQ = %d/%d.\n", numInFlightLoads, sizeLoadBuffer, numInFlightStores, sizeStoreBuffer); // Check if resources are available to issue the specific node if (num_in_flight_nodes >= sizeROB) { return false; } if (new_node->isLoad() && numInFlightLoads >= sizeLoadBuffer) { return false; } if (new_node->isStore() && numInFlightStores >= sizeStoreBuffer) { return false; } return true; } bool TraceCPU::ElasticDataGen::HardwareResource::awaitingResponse() const { // Return true if there is at least one read or write request in flight return (numInFlightStores != 0 || numInFlightLoads != 0); } void TraceCPU::ElasticDataGen::HardwareResource::printOccupancy() { DPRINTFR(TraceCPUData, "oldestInFlightRobNum = %d, " "LQ = %d/%d, SQ = %d/%d.\n", oldestInFlightRobNum, numInFlightLoads, sizeLoadBuffer, numInFlightStores, sizeStoreBuffer); } TraceCPU::FixedRetryGen::FixedRetryGenStatGroup::FixedRetryGenStatGroup( statistics::Group *parent, const std::string& _name) : statistics::Group(parent, _name.c_str()), ADD_STAT(numSendAttempted, statistics::units::Count::get(), "Number of first attempts to send a request"), ADD_STAT(numSendSucceeded, statistics::units::Count::get(), "Number of successful first attempts"), ADD_STAT(numSendFailed, statistics::units::Count::get(), "Number of failed first attempts"), ADD_STAT(numRetrySucceeded, statistics::units::Count::get(), "Number of successful retries"), ADD_STAT(instLastTick, statistics::units::Tick::get(), "Last tick simulated from the fixed inst trace") { } Tick TraceCPU::FixedRetryGen::init() { DPRINTF(TraceCPUInst, "Initializing instruction fetch request generator" " IcacheGen: fixed issue with retry.\n"); if (nextExecute()) { DPRINTF(TraceCPUInst, "\tFirst tick = %d.\n", currElement.tick); return currElement.tick; } else { panic("Read of first message in the trace failed.\n"); return MaxTick; } } bool TraceCPU::FixedRetryGen::tryNext() { // If there is a retry packet, try to send it if (retryPkt) { DPRINTF(TraceCPUInst, "Trying to send retry packet.\n"); if (!port.sendTimingReq(retryPkt)) { // Still blocked! This should never occur. DPRINTF(TraceCPUInst, "Retry packet sending failed.\n"); return false; } ++fixedStats.numRetrySucceeded; } else { DPRINTF(TraceCPUInst, "Trying to send packet for currElement.\n"); // try sending current element assert(currElement.isValid()); ++fixedStats.numSendAttempted; if (!send(currElement.addr, currElement.blocksize, currElement.cmd, currElement.flags, currElement.pc)) { DPRINTF(TraceCPUInst, "currElement sending failed.\n"); ++fixedStats.numSendFailed; // return false to indicate not to schedule next event return false; } else { ++fixedStats.numSendSucceeded; } } // If packet was sent successfully, either retryPkt or currElement, return // true to indicate to schedule event at current Tick plus delta. If packet // was sent successfully and there is no next packet to send, return false. DPRINTF(TraceCPUInst, "Packet sent successfully, trying to read next " "element.\n"); retryPkt = nullptr; // Read next element into currElement, currElement gets cleared so save the // tick to calculate delta Tick last_tick = currElement.tick; if (nextExecute()) { assert(currElement.tick >= last_tick); delta = currElement.tick - last_tick; } return !traceComplete; } void TraceCPU::FixedRetryGen::exit() { trace.reset(); } bool TraceCPU::FixedRetryGen::nextExecute() { if (traceComplete) // We are at the end of the file, thus we have no more messages. // Return false. return false; //Reset the currElement to the default values currElement.clear(); // Read the next line to get the next message. If that fails then end of // trace has been reached and traceComplete needs to be set in addition // to returning false. If successful then next message is in currElement. if (!trace.read(&currElement)) { traceComplete = true; fixedStats.instLastTick = curTick(); return false; } DPRINTF(TraceCPUInst, "inst fetch: %c addr %d pc %#x size %d tick %d\n", currElement.cmd.isRead() ? 'r' : 'w', currElement.addr, currElement.pc, currElement.blocksize, currElement.tick); return true; } bool TraceCPU::FixedRetryGen::send(Addr addr, unsigned size, const MemCmd& cmd, Request::FlagsType flags, Addr pc) { // Create new request auto req = std::make_shared<Request>(addr, size, flags, requestorId); req->setPC(pc); // If this is not done it triggers assert in L1 cache for invalid contextId req->setContext(ContextID(0)); // Embed it in a packet PacketPtr pkt = new Packet(req, cmd); uint8_t* pkt_data = new uint8_t[req->getSize()]; pkt->dataDynamic(pkt_data); if (cmd.isWrite()) { memset(pkt_data, 0xA, req->getSize()); } // Call RequestPort method to send a timing request for this packet bool success = port.sendTimingReq(pkt); if (!success) { // If it fails, save the packet to retry when a retry is signalled by // the cache retryPkt = pkt; } return success; } void TraceCPU::icacheRetryRecvd() { // Schedule an event to go through the control flow in the same tick as // retry is received DPRINTF(TraceCPUInst, "Icache retry received. Scheduling next IcacheGen" " event @%lli.\n", curTick()); schedule(icacheNextEvent, curTick()); } void TraceCPU::dcacheRetryRecvd() { // Schedule an event to go through the execute flow in the same tick as // retry is received DPRINTF(TraceCPUData, "Dcache retry received. Scheduling next DcacheGen" " event @%lli.\n", curTick()); schedule(dcacheNextEvent, curTick()); } void TraceCPU::schedDcacheNextEvent(Tick when) { if (!dcacheNextEvent.scheduled()) { DPRINTF(TraceCPUData, "Scheduling next DcacheGen event at %lli.\n", when); schedule(dcacheNextEvent, when); ++traceStats.numSchedDcacheEvent; } else if (when < dcacheNextEvent.when()) { DPRINTF(TraceCPUData, "Re-scheduling next dcache event from %lli" " to %lli.\n", dcacheNextEvent.when(), when); reschedule(dcacheNextEvent, when); } } bool TraceCPU::IcachePort::recvTimingResp(PacketPtr pkt) { // All responses on the instruction fetch side are ignored. Simply delete // the packet to free allocated memory delete pkt; return true; } void TraceCPU::IcachePort::recvReqRetry() { owner->icacheRetryRecvd(); } void TraceCPU::dcacheRecvTimingResp(PacketPtr pkt) { DPRINTF(TraceCPUData, "Received timing response from Dcache.\n"); dcacheGen.completeMemAccess(pkt); } bool TraceCPU::DcachePort::recvTimingResp(PacketPtr pkt) { // Handle the responses for data memory requests which is done inside the // elastic data generator owner->dcacheRecvTimingResp(pkt); // After processing the response delete the packet to free // memory delete pkt; return true; } void TraceCPU::DcachePort::recvReqRetry() { owner->dcacheRetryRecvd(); } TraceCPU::ElasticDataGen::InputStream::InputStream( const std::string& filename, const double time_multiplier) : trace(filename), timeMultiplier(time_multiplier), microOpCount(0) { // Create a protobuf message for the header and read it from the stream ProtoMessage::InstDepRecordHeader header_msg; if (!trace.read(header_msg)) { panic("Failed to read packet header from %s\n", filename); if (header_msg.tick_freq() != sim_clock::Frequency) { panic("Trace %s was recorded with a different tick frequency %d\n", header_msg.tick_freq()); } } else { // Assign window size equal to the field in the trace that was recorded // when the data dependency trace was captured in the o3cpu model windowSize = header_msg.window_size(); } } void TraceCPU::ElasticDataGen::InputStream::reset() { trace.reset(); } bool TraceCPU::ElasticDataGen::InputStream::read(GraphNode* element) { ProtoMessage::InstDepRecord pkt_msg; if (trace.read(pkt_msg)) { // Required fields element->seqNum = pkt_msg.seq_num(); element->type = pkt_msg.type(); // Scale the compute delay to effectively scale the Trace CPU frequency element->compDelay = pkt_msg.comp_delay() * timeMultiplier; // Repeated field robDepList element->robDep.clear(); for (int i = 0; i < (pkt_msg.rob_dep()).size(); i++) { element->robDep.push_back(pkt_msg.rob_dep(i)); } // Repeated field element->regDep.clear(); for (int i = 0; i < (pkt_msg.reg_dep()).size(); i++) { // There is a possibility that an instruction has both, a register // and order dependency on an instruction. In such a case, the // register dependency is omitted bool duplicate = false; for (auto &dep: element->robDep) { duplicate |= (pkt_msg.reg_dep(i) == dep); } if (!duplicate) element->regDep.push_back(pkt_msg.reg_dep(i)); } // Optional fields if (pkt_msg.has_p_addr()) element->physAddr = pkt_msg.p_addr(); else element->physAddr = 0; if (pkt_msg.has_v_addr()) element->virtAddr = pkt_msg.v_addr(); else element->virtAddr = 0; if (pkt_msg.has_size()) element->size = pkt_msg.size(); else element->size = 0; if (pkt_msg.has_flags()) element->flags = pkt_msg.flags(); else element->flags = 0; if (pkt_msg.has_pc()) element->pc = pkt_msg.pc(); else element->pc = 0; // ROB occupancy number ++microOpCount; if (pkt_msg.has_weight()) { microOpCount += pkt_msg.weight(); } element->robNum = microOpCount; return true; } // We have reached the end of the file return false; } bool TraceCPU::ElasticDataGen::GraphNode::removeRegDep(NodeSeqNum reg_dep) { for (auto it = regDep.begin(); it != regDep.end(); it++) { if (*it == reg_dep) { // If register dependency is found, erase it. regDep.erase(it); DPRINTFR(TraceCPUData, "\tFor %lli: Marking register dependency %lli done.\n", seqNum, reg_dep); return true; } } // Return false if the dependency is not found return false; } bool TraceCPU::ElasticDataGen::GraphNode::removeRobDep(NodeSeqNum rob_dep) { for (auto it = robDep.begin(); it != robDep.end(); it++) { if (*it == rob_dep) { // If the rob dependency is found, erase it. robDep.erase(it); DPRINTFR(TraceCPUData, "\tFor %lli: Marking ROB dependency %lli done.\n", seqNum, rob_dep); return true; } } return false; } bool TraceCPU::ElasticDataGen::GraphNode::removeDepOnInst(NodeSeqNum done_seq_num) { // If it is an rob dependency then remove it if (!removeRobDep(done_seq_num)) { // If it is not an rob dependency then it must be a register dependency // If the register dependency is not found, it violates an assumption // and must be caught by assert. GEM5_VAR_USED bool regdep_found = removeRegDep(done_seq_num); assert(regdep_found); } // Return true if the node is dependency free return robDep.empty() && regDep.empty(); } void TraceCPU::ElasticDataGen::GraphNode::writeElementAsTrace() const { #if TRACING_ON DPRINTFR(TraceCPUData, "%lli", seqNum); DPRINTFR(TraceCPUData, ",%s", typeToStr()); if (isLoad() || isStore()) { DPRINTFR(TraceCPUData, ",%i", physAddr); DPRINTFR(TraceCPUData, ",%i", size); DPRINTFR(TraceCPUData, ",%i", flags); } DPRINTFR(TraceCPUData, ",%lli", compDelay); DPRINTFR(TraceCPUData, "robDep:"); for (auto &dep: robDep) { DPRINTFR(TraceCPUData, ",%lli", dep); } DPRINTFR(TraceCPUData, "regDep:"); for (auto &dep: regDep) { DPRINTFR(TraceCPUData, ",%lli", dep); } auto child_itr = dependents.begin(); DPRINTFR(TraceCPUData, "dependents:"); while (child_itr != dependents.end()) { DPRINTFR(TraceCPUData, ":%lli", (*child_itr)->seqNum); child_itr++; } DPRINTFR(TraceCPUData, "\n"); #endif // TRACING_ON } std::string TraceCPU::ElasticDataGen::GraphNode::typeToStr() const { return Record::RecordType_Name(type); } TraceCPU::FixedRetryGen::InputStream::InputStream(const std::string& filename) : trace(filename) { // Create a protobuf message for the header and read it from the stream ProtoMessage::PacketHeader header_msg; if (!trace.read(header_msg)) { panic("Failed to read packet header from %s\n", filename); if (header_msg.tick_freq() != sim_clock::Frequency) { panic("Trace %s was recorded with a different tick frequency %d\n", header_msg.tick_freq()); } } } void TraceCPU::FixedRetryGen::InputStream::reset() { trace.reset(); } bool TraceCPU::FixedRetryGen::InputStream::read(TraceElement* element) { ProtoMessage::Packet pkt_msg; if (trace.read(pkt_msg)) { element->cmd = pkt_msg.cmd(); element->addr = pkt_msg.addr(); element->blocksize = pkt_msg.size(); element->tick = pkt_msg.tick(); element->flags = pkt_msg.has_flags() ? pkt_msg.flags() : 0; element->pc = pkt_msg.has_pc() ? pkt_msg.pc() : 0; return true; } // We have reached the end of the file return false; } } // namespace gem5
/*------------------------------------------------------------------------------------------*\ This file contains material supporting chapter 7 of the book: OpenCV3 Computer Vision Application Programming Cookbook Third Edition by Robert Laganiere, Packt Publishing, 2016. This program is free software; permission is hereby granted to use, copy, modify, and distribute this source code, or portions thereof, for any purpose, without fee, subject to the restriction that the copyright notice may not be removed or altered from any source or altered source distribution. The software is released on an as-is basis and without any warranties of any kind. In particular, the software is not guaranteed to be fault-tolerant or free from failure. The author disclaims all warranties with regard to this software, any use, and any consequent failure, is purely the responsibility of the user. Copyright (C) 2016 Robert Laganiere, www.laganiere.name \*------------------------------------------------------------------------------------------*/ #include <iostream> #include <vector> #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> int main() { // Read input binary image cv::Mat image= cv::imread("binaryGroup.bmp",0); if (!image.data) return 0; cv::namedWindow("Binary Image"); cv::imshow("Binary Image",image); // Get the contours of the connected components std::vector<std::vector<cv::Point> > contours; cv::findContours(image, contours, // a vector of contours cv::RETR_EXTERNAL, // retrieve the external contours cv::CHAIN_APPROX_NONE); // retrieve all pixels of each contours // Print contours' length std::cout << "Contours: " << contours.size() << std::endl; std::vector<std::vector<cv::Point> >::const_iterator itContours= contours.begin(); for ( ; itContours!=contours.end(); ++itContours) { std::cout << "Size: " << itContours->size() << std::endl; } // draw black contours on white image cv::Mat result(image.size(),CV_8U,cv::Scalar(255)); cv::drawContours(result,contours, -1, // draw all contours cv::Scalar(0), // in black 2); // with a thickness of 2 cv::namedWindow("Contours"); cv::imshow("Contours",result); // Eliminate too short or too long contours int cmin= 50; // minimum contour length int cmax= 500; // maximum contour length std::vector<std::vector<cv::Point> >::iterator itc= contours.begin(); while (itc!=contours.end()) { if (itc->size() < cmin || itc->size() > cmax) itc= contours.erase(itc); else ++itc; } // draw contours on the original image cv::Mat original= cv::imread("group.jpg"); cv::drawContours(original,contours, -1, // draw all contours cv::Scalar(255,255,255), // in white 2); // with a thickness of 2 cv::namedWindow("Contours on Animals"); cv::imshow("Contours on Animals",original); // Let's now draw black contours on white image result.setTo(cv::Scalar(255)); cv::drawContours(result,contours, -1, // draw all contours 0, // in black 1); // with a thickness of 1 image= cv::imread("binaryGroup.bmp",0); // testing the bounding box cv::Rect r0= cv::boundingRect(contours[0]); // draw the rectangle cv::rectangle(result,r0, 0, 2); // testing the enclosing circle float radius; cv::Point2f center; cv::minEnclosingCircle(contours[1],center,radius); // draw the cricle cv::circle(result,center,static_cast<int>(radius), 0, 2); // testing the approximate polygon std::vector<cv::Point> poly; cv::approxPolyDP(contours[2],poly,5,true); // draw the polygon cv::polylines(result, poly, true, 0, 2); std::cout << "Polygon size: " << poly.size() << std::endl; // testing the convex hull std::vector<cv::Point> hull; cv::convexHull(contours[3],hull); // draw the polygon cv::polylines(result, hull, true, 0, 2); std::vector<cv::Vec4i> defects; // cv::convexityDefects(contours[3], hull, defects); // testing the moments // iterate over all contours itc= contours.begin(); while (itc!=contours.end()) { // compute all moments cv::Moments mom= cv::moments(*itc++); // draw mass center cv::circle(result, // position of mass center converted to integer cv::Point(mom.m10/mom.m00,mom.m01/mom.m00), 2,cv::Scalar(0),2); // draw black dot } cv::namedWindow("Some Shape descriptors"); cv::imshow("Some Shape descriptors",result); // New call to findContours but with RETR_LIST flag image= cv::imread("binaryGroup.bmp",0); // Get the contours of the connected components cv::findContours(image, contours, // a vector of contours cv::RETR_LIST, // retrieve the external and internal contours cv::CHAIN_APPROX_NONE); // retrieve all pixels of each contours // draw black contours on white image result.setTo(255); cv::drawContours(result,contours, -1, // draw all contours 0, // in black 2); // with a thickness of 2 cv::namedWindow("All Contours"); cv::imshow("All Contours",result); // get a MSER image cv::Mat components; components= cv::imread("mser.bmp",0); // create a binary version components= components==255; // open the image (white background) cv::morphologyEx(components,components,cv::MORPH_OPEN,cv::Mat(),cv::Point(-1,-1),3); cv::namedWindow("MSER image"); cv::imshow("MSER image",components); contours.clear(); //invert image (background must be black) cv::Mat componentsInv= 255-components; // Get the contours of the connected components cv::findContours(componentsInv, contours, // a vector of contours cv::RETR_EXTERNAL, // retrieve the external contours cv::CHAIN_APPROX_NONE); // retrieve all pixels of each contours // white image cv::Mat quadri(components.size(),CV_8U,255); // for all contours std::vector<std::vector<cv::Point> >::iterator it= contours.begin(); while (it!= contours.end()) { poly.clear(); // approximate contour by polygon cv::approxPolyDP(*it,poly,5,true); // do we have a quadrilateral? if (poly.size()==4) { // draw it cv::polylines(quadri, poly, true, 0, 2); } ++it; } cv::namedWindow("MSER quadrilateral"); cv::imshow("MSER quadrilateral",quadri); cv::waitKey(); return 0; }
//https://atcoder.jp/contests/abc203/tasks/abc203_b #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio (0); cin.tie (0); cout.tie (0); int N, K, sum = 0; cin >> N >> K; for (int i = 1; i <= N; ++i) { for (int j = 1; j <= K; ++j) { sum += i * 100 + j; } } cout << sum; }
// Copyright (c) 2009-2017 The Bitcoin developers // Copyright (c) 2017-2018 The PIVX developers // Copyright (c) 2018 The Ion developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "key.h" #include "uint256.h" #include "crypto/common.h" #include "crypto/hmac_sha512.h" #include "random.h" #include <secp256k1.h> #include <secp256k1_recovery.h> static secp256k1_context* secp256k1_context_sign = nullptr; /** These functions are taken from the libsecp256k1 distribution and are very ugly. */ /** * This parses a format loosely based on a DER encoding of the ECPrivateKey type from * section C.4 of SEC 1 <http://www.secg.org/sec1-v2.pdf>, with the following caveats: * * * The octet-length of the SEQUENCE must be encoded as 1 or 2 octets. It is not * required to be encoded as one octet if it is less than 256, as DER would require. * * The octet-length of the SEQUENCE must not be greater than the remaining * length of the key encoding, but need not match it (i.e. the encoding may contain * junk after the encoded SEQUENCE). * * The privateKey OCTET STRING is zero-filled on the left to 32 octets. * * Anything after the encoding of the privateKey OCTET STRING is ignored, whether * or not it is validly encoded DER. * * out32 must point to an output buffer of length at least 32 bytes. */ static int ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) { const unsigned char *end = privkey + privkeylen; memset(out32, 0, 32); /* sequence header */ if (end - privkey < 1 || *privkey != 0x30u) { return 0; } privkey++; /* sequence length constructor */ if (end - privkey < 1 || !(*privkey & 0x80u)) { return 0; } ptrdiff_t lenb = *privkey & ~0x80u; privkey++; if (lenb < 1 || lenb > 2) { return 0; } if (end - privkey < lenb) { return 0; } /* sequence length */ ptrdiff_t len = privkey[lenb-1] | (lenb > 1 ? privkey[lenb-2] << 8 : 0u); privkey += lenb; if (end - privkey < len) { return 0; } /* sequence element 0: version number (=1) */ if (end - privkey < 3 || privkey[0] != 0x02u || privkey[1] != 0x01u || privkey[2] != 0x01u) { return 0; } privkey += 3; /* sequence element 1: octet string, up to 32 bytes */ if (end - privkey < 2 || privkey[0] != 0x04u) { return 0; } ptrdiff_t oslen = privkey[1]; privkey += 2; if (oslen > 32 || end - privkey < oslen) { return 0; } memcpy(out32 + (32 - oslen), privkey, oslen); if (!secp256k1_ec_seckey_verify(ctx, out32)) { memset(out32, 0, 32); return 0; } return 1; } /** * This serializes to a DER encoding of the ECPrivateKey type from section C.4 of SEC 1 * <http://www.secg.org/sec1-v2.pdf>. The optional parameters and publicKey fields are * included. * * privkey must point to an output buffer of length at least CKey::PRIVATE_KEY_SIZE bytes. * privkeylen must initially be set to the size of the privkey buffer. Upon return it * will be set to the number of bytes used in the buffer. * key32 must point to a 32-byte raw private key. */ static int ec_privkey_export_der(const secp256k1_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) { assert(*privkeylen >= CKey::PRIVATE_KEY_SIZE); secp256k1_pubkey pubkey; size_t pubkeylen = 0; if (!secp256k1_ec_pubkey_create(ctx, &pubkey, key32)) { *privkeylen = 0; return 0; } if (compressed) { static const unsigned char begin[] = { 0x30,0x81,0xD3,0x02,0x01,0x01,0x04,0x20 }; static const unsigned char middle[] = { 0xA0,0x81,0x85,0x30,0x81,0x82,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48, 0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04, 0x21,0x02,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87, 0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8, 0x17,0x98,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E, 0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x24,0x03,0x22,0x00 }; unsigned char *ptr = privkey; memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin); memcpy(ptr, key32, 32); ptr += 32; memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle); pubkeylen = CPubKey::COMPRESSED_PUBLIC_KEY_SIZE; secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED); ptr += pubkeylen; *privkeylen = ptr - privkey; assert(*privkeylen == CKey::COMPRESSED_PRIVATE_KEY_SIZE); } else { static const unsigned char begin[] = { 0x30,0x82,0x01,0x13,0x02,0x01,0x01,0x04,0x20 }; static const unsigned char middle[] = { 0xA0,0x81,0xA5,0x30,0x81,0xA2,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48, 0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04, 0x41,0x04,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87, 0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8, 0x17,0x98,0x48,0x3A,0xDA,0x77,0x26,0xA3,0xC4,0x65,0x5D,0xA4,0xFB,0xFC,0x0E,0x11, 0x08,0xA8,0xFD,0x17,0xB4,0x48,0xA6,0x85,0x54,0x19,0x9C,0x47,0xD0,0x8F,0xFB,0x10, 0xD4,0xB8,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E, 0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x44,0x03,0x42,0x00 }; unsigned char *ptr = privkey; memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin); memcpy(ptr, key32, 32); ptr += 32; memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle); pubkeylen = CPubKey::PUBLIC_KEY_SIZE; secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED); ptr += pubkeylen; *privkeylen = ptr - privkey; assert(*privkeylen == CKey::PRIVATE_KEY_SIZE); } return 1; } bool CKey::Check(const unsigned char* vch) { return secp256k1_ec_seckey_verify(secp256k1_context_sign, vch); } void CKey::MakeNewKey(bool fCompressedIn) { do { GetRandBytes(keydata.data(), keydata.size()); } while (!Check(keydata.data())); fValid = true; fCompressed = fCompressedIn; } bool CKey::SetPrivKey(const CPrivKey& privkey, bool fCompressedIn) { if (!ec_privkey_import_der(secp256k1_context_sign, (unsigned char*)begin(), &privkey[0], privkey.size())) return false; fCompressed = fCompressedIn; fValid = true; return true; } uint256 CKey::GetPrivKey_256() { void* key = keydata.data(); uint256* key_256 = (uint256*)key; return *key_256; } CPrivKey CKey::GetPrivKey() const { assert(fValid); CPrivKey privkey; size_t privkeylen; privkey.resize(PRIVATE_KEY_SIZE); privkeylen = PRIVATE_KEY_SIZE; int ret = ec_privkey_export_der(secp256k1_context_sign, (unsigned char*)&privkey[0], &privkeylen, begin(), fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED); assert(ret); privkey.resize(privkeylen); return privkey; } CPubKey CKey::GetPubKey() const { assert(fValid); secp256k1_pubkey pubkey; CPubKey result; size_t clen = 65; int ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &pubkey, begin()); assert(ret); secp256k1_ec_pubkey_serialize(secp256k1_context_sign, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED); assert(result.size() == clen); assert(result.IsValid()); return result; } bool CKey::Sign(const uint256& hash, std::vector<unsigned char>& vchSig, uint32_t test_case) const { if (!fValid) return false; vchSig.resize(CPubKey::SIGNATURE_SIZE); size_t nSigLen = CPubKey::SIGNATURE_SIZE; unsigned char extra_entropy[32] = {0}; WriteLE32(extra_entropy, test_case); secp256k1_ecdsa_signature sig; int ret = secp256k1_ecdsa_sign(secp256k1_context_sign, &sig, hash.begin(), begin(), secp256k1_nonce_function_rfc6979, test_case ? extra_entropy : nullptr); assert(ret); secp256k1_ecdsa_signature_serialize_der(secp256k1_context_sign, (unsigned char*)vchSig.data(), &nSigLen, &sig); vchSig.resize(nSigLen); return true; } bool CKey::VerifyPubKey(const CPubKey& pubkey) const { if (pubkey.IsCompressed() != fCompressed) { return false; } unsigned char rnd[8]; std::string str = "Bitcoin key verification\n"; GetRandBytes(rnd, sizeof(rnd)); uint256 hash; CHash256().Write((unsigned char*)str.data(), str.size()).Write(rnd, sizeof(rnd)).Finalize(hash.begin()); std::vector<unsigned char> vchSig; Sign(hash, vchSig); return pubkey.Verify(hash, vchSig); } bool CKey::SignCompact(const uint256& hash, std::vector<unsigned char>& vchSig) const { if (!fValid) return false; vchSig.resize(CPubKey::COMPACT_SIGNATURE_SIZE); int rec = -1; secp256k1_ecdsa_recoverable_signature sig; int ret = secp256k1_ecdsa_sign_recoverable(secp256k1_context_sign, &sig, hash.begin(), begin(), secp256k1_nonce_function_rfc6979, nullptr); assert(ret); secp256k1_ecdsa_recoverable_signature_serialize_compact(secp256k1_context_sign, (unsigned char*)&vchSig[1], &rec, &sig); assert(ret); assert(rec != -1); vchSig[0] = 27 + rec + (fCompressed ? 4 : 0); return true; } bool CKey::Load(const CPrivKey& privkey, const CPubKey& vchPubKey, bool fSkipCheck = false) { if (!ec_privkey_import_der(secp256k1_context_sign, (unsigned char*)begin(), privkey.data(), privkey.size())) return false; fCompressed = vchPubKey.IsCompressed(); fValid = true; if (fSkipCheck) return true; return VerifyPubKey(vchPubKey); } bool CKey::Derive(CKey& keyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const { assert(IsValid()); assert(IsCompressed()); std::vector<unsigned char, secure_allocator<unsigned char>> vout(64); if ((nChild >> 31) == 0) { CPubKey pubkey = GetPubKey(); assert(pubkey.size() == CPubKey::COMPRESSED_PUBLIC_KEY_SIZE); BIP32Hash(cc, nChild, *pubkey.begin(), pubkey.begin()+1, vout.data()); } else { assert(size() == 32); BIP32Hash(cc, nChild, 0, begin(), vout.data()); } memcpy(ccChild.begin(), vout.data()+32, 32); memcpy((unsigned char*)keyChild.begin(), begin(), 32); bool ret = secp256k1_ec_privkey_tweak_add(secp256k1_context_sign, (unsigned char*)keyChild.begin(), vout.data()); keyChild.fCompressed = true; keyChild.fValid = ret; return ret; } bool CExtKey::Derive(CExtKey& out, unsigned int nChild) const { out.nDepth = nDepth + 1; CKeyID id = key.GetPubKey().GetID(); memcpy(&out.vchFingerprint[0], &id, 4); out.nChild = nChild; return key.Derive(out.key, out.chaincode, nChild, chaincode); } void CExtKey::SetMaster(const unsigned char* seed, unsigned int nSeedLen) { static const unsigned char hashkey[] = {'B', 'i', 't', 'c', 'o', 'i', 'n', ' ', 's', 'e', 'e', 'd'}; std::vector<unsigned char, secure_allocator<unsigned char>> vout(64); CHMAC_SHA512(hashkey, sizeof(hashkey)).Write(seed, nSeedLen).Finalize(vout.data()); key.Set(vout.data(), vout.data() + 32, true); memcpy(chaincode.begin(), vout.data() + 32, 32); nDepth = 0; nChild = 0; memset(vchFingerprint, 0, sizeof(vchFingerprint)); } CExtPubKey CExtKey::Neuter() const { CExtPubKey ret; ret.nDepth = nDepth; memcpy(&ret.vchFingerprint[0], &vchFingerprint[0], 4); ret.nChild = nChild; ret.pubkey = key.GetPubKey(); ret.chaincode = chaincode; return ret; } void CExtKey::Encode(unsigned char code[74]) const { code[0] = nDepth; memcpy(code + 1, vchFingerprint, 4); code[5] = (nChild >> 24) & 0xFF; code[6] = (nChild >> 16) & 0xFF; code[7] = (nChild >> 8) & 0xFF; code[8] = (nChild >> 0) & 0xFF; memcpy(code + 9, chaincode.begin(), 32); code[41] = 0; assert(key.size() == 32); memcpy(code + 42, key.begin(), 32); } void CExtKey::Decode(const unsigned char code[74]) { nDepth = code[0]; memcpy(vchFingerprint, code + 1, 4); nChild = (code[5] << 24) | (code[6] << 16) | (code[7] << 8) | code[8]; memcpy(chaincode.begin(), code + 9, 32); key.Set(code + 42, code + 74, true); } bool ECC_InitSanityCheck() { CKey key; key.MakeNewKey(true); CPubKey pubkey = key.GetPubKey(); return key.VerifyPubKey(pubkey); } void ECC_Start() { assert(secp256k1_context_sign == nullptr); secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); assert(ctx != nullptr); { // Pass in a random blinding seed to the secp256k1 context. std::vector<unsigned char, secure_allocator<unsigned char>> vseed(32); GetRandBytes(vseed.data(), 32); bool ret = secp256k1_context_randomize(ctx, vseed.data()); assert(ret); } secp256k1_context_sign = ctx; } void ECC_Stop() { secp256k1_context *ctx = secp256k1_context_sign; secp256k1_context_sign = nullptr; if (ctx) { secp256k1_context_destroy(ctx); } }
// Copyright (c) 2014 The Bitcoin Core developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "primitives/transaction.h" #include "main.h" #include "test_bitszcoin.h" #include <boost/test/unit_test.hpp> BOOST_FIXTURE_TEST_SUITE(main_tests, TestingSetup) CAmount nMoneySupplyPoWEnd = 43199500 * COIN; BOOST_AUTO_TEST_CASE(subsidy_limit_test) { CAmount nSum = 0; for (int nHeight = 0; nHeight < 1; nHeight += 1) { /* premine in block 1 (60,001 BITSZ) */ CAmount nSubsidy = GetBlockValue(nHeight); BOOST_CHECK(nSubsidy <= 60001 * COIN); nSum += nSubsidy; } for (int nHeight = 1; nHeight < 86400; nHeight += 1) { /* PoW Phase One */ CAmount nSubsidy = GetBlockValue(nHeight); BOOST_CHECK(nSubsidy <= 250 * COIN); nSum += nSubsidy; } for (int nHeight = 86400; nHeight < 151200; nHeight += 1) { /* PoW Phase Two */ CAmount nSubsidy = GetBlockValue(nHeight); BOOST_CHECK(nSubsidy <= 225 * COIN); nSum += nSubsidy; } for (int nHeight = 151200; nHeight < 259200; nHeight += 1) { /* PoW Phase Two */ CAmount nSubsidy = GetBlockValue(nHeight); BOOST_CHECK(nSubsidy <= 45 * COIN); BOOST_CHECK(MoneyRange(nSubsidy)); nSum += nSubsidy; BOOST_CHECK(nSum > 0 && nSum <= nMoneySupplyPoWEnd); } BOOST_CHECK(nSum == 4109975100000000ULL); } BOOST_AUTO_TEST_SUITE_END()
/* Copyright 2007-2015 QReal Research Group * * 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 "ev3RbfGeneratorPlugin.h" #include <QtWidgets/QApplication> #include <QtCore/QDirIterator> #include <QtCore/QProcess> #include <qrutils/widgets/qRealMessageBox.h> #include <qrkernel/logging.h> #include <ev3Kit/communication/ev3RobotCommunicationThread.h> #include <ev3GeneratorBase/robotModel/ev3GeneratorRobotModel.h> #include <qrkernel/settingsManager.h> #include "ev3RbfMasterGenerator.h" using namespace ev3::rbf; using namespace qReal; Ev3RbfGeneratorPlugin::Ev3RbfGeneratorPlugin() : Ev3GeneratorPluginBase("Ev3RbfUsbGeneratorRobotModel", tr("Autonomous mode (USB)"), 9 , "Ev3RbfBluetoothGeneratorRobotModel", tr("Autonomous mode (Bluetooth)"), 8) , mGenerateCodeAction(new QAction(nullptr)) , mUploadProgramAction(new QAction(nullptr)) , mRunProgramAction(new QAction(nullptr)) , mStopRobotAction(new QAction(nullptr)) { mGenerateCodeAction->setText(tr("Generate to Ev3 Robot Byte Code File")); mGenerateCodeAction->setIcon(QIcon(":/ev3/rbf/images/generateRbfCode.svg")); connect(mGenerateCodeAction, &QAction::triggered, this, &Ev3RbfGeneratorPlugin::generateCode); mUploadProgramAction->setText(tr("Upload program")); mUploadProgramAction->setIcon(QIcon(":/ev3/rbf/images/uploadProgram.svg")); connect(mUploadProgramAction, &QAction::triggered, this, &Ev3RbfGeneratorPlugin::uploadAndRunProgram); mRunProgramAction->setObjectName("runEv3RbfProgram"); mRunProgramAction->setText(tr("Run program")); mRunProgramAction->setIcon(QIcon(":/ev3/rbf/images/run.png")); connect(mRunProgramAction, &QAction::triggered, this, &Ev3RbfGeneratorPlugin::runProgram, Qt::UniqueConnection); mStopRobotAction->setObjectName("stopEv3RbfRobot"); mStopRobotAction->setText(tr("Stop robot")); mStopRobotAction->setIcon(QIcon(":/ev3/rbf/images/stop.png")); connect(mStopRobotAction, &QAction::triggered, this, &Ev3RbfGeneratorPlugin::stopRobot, Qt::UniqueConnection); text::Languages::registerLanguage(text::LanguageInfo{ "lms" , tr("EV3 Source Code language") , true , 4 , "//" , QString() , "/*" , "*/" , nullptr , {} }); } QList<ActionInfo> Ev3RbfGeneratorPlugin::customActions() { const ActionInfo generateCodeActionInfo(mGenerateCodeAction, "generators", "tools"); const ActionInfo uploadProgramActionInfo(mUploadProgramAction, "generators", "tools"); const ActionInfo runProgramActionInfo(mRunProgramAction, "interpreters", "tools"); const ActionInfo stopRobotActionInfo(mStopRobotAction, "interpreters", "tools"); return {generateCodeActionInfo, uploadProgramActionInfo, runProgramActionInfo, stopRobotActionInfo}; } QList<HotKeyActionInfo> Ev3RbfGeneratorPlugin::hotKeyActions() { mGenerateCodeAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_G)); mUploadProgramAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_U)); mRunProgramAction->setShortcut(QKeySequence(Qt::Key_F5)); mStopRobotAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_F5)); HotKeyActionInfo generateActionInfo("Generator.GenerateEv3Rbf" , tr("Generate Ev3 Robot Byte Code File"), mGenerateCodeAction); HotKeyActionInfo uploadProgramInfo("Generator.UploadEv3", tr("Upload EV3 Program"), mUploadProgramAction); HotKeyActionInfo runProgramInfo("Generator.RunEv3", tr("Run EV3 Program"), mRunProgramAction); HotKeyActionInfo stopRobotInfo("Generator.StopEv3", tr("Stop EV3 Program"), mStopRobotAction); return { generateActionInfo, uploadProgramInfo, runProgramInfo, stopRobotInfo }; } QIcon Ev3RbfGeneratorPlugin::iconForFastSelector(const kitBase::robotModel::RobotModelInterface &robotModel) const { Q_UNUSED(robotModel) return QIcon(":/ev3/rbf/images/switch-to-ev3-rbf.svg"); } int Ev3RbfGeneratorPlugin::priority() const { return 9; } QString Ev3RbfGeneratorPlugin::defaultFilePath(QString const &projectName) const { return QString("ev3-rbf/%1/%1.lms").arg(projectName); } text::LanguageInfo Ev3RbfGeneratorPlugin::language() const { return text::Languages::pickByExtension("lms"); } QString Ev3RbfGeneratorPlugin::generatorName() const { return "ev3/rbf"; } QString Ev3RbfGeneratorPlugin::uploadProgram() { if (!javaInstalled()) { mMainWindowInterface->errorReporter()->addError(tr("<a href=\"https://java.com/ru/download/\">Java</a> is "\ "not installed. Please download and install it.")); return QString(); } QFileInfo const fileInfo = generateCodeForProcessing(); if (!fileInfo.exists()) { return QString(); } if (!copySystemFiles(fileInfo.absolutePath())) { mMainWindowInterface->errorReporter()->addError(tr("Can't write source code files to disk!")); return QString(); } if (!compile(fileInfo)) { QLOG_ERROR() << "EV3 bytecode compillation process failed!"; mMainWindowInterface->errorReporter()->addError(tr("Compilation error occured.")); return QString(); } const QString fileOnRobot = upload(fileInfo); return fileOnRobot; } void Ev3RbfGeneratorPlugin::uploadAndRunProgram() { const QString fileOnRobot = uploadProgram(); communication::Ev3RobotCommunicationThread * const communicator = currentCommunicator(); if (fileOnRobot.isEmpty() || !communicator) { return; } const RunPolicy runPolicy = static_cast<RunPolicy>(SettingsManager::value("ev3RunPolicy").toInt()); switch (runPolicy) { case RunPolicy::Ask: if (utils::QRealMessageBox::question(mMainWindowInterface->windowWidget(), tr("The program has been uploaded") , tr("Do you want to run it?")) == QMessageBox::Yes) { QMetaObject::invokeMethod(communicator, "runProgram", Q_ARG(QString, fileOnRobot)); } break; case RunPolicy::AlwaysRun: QMetaObject::invokeMethod(communicator, "runProgram", Q_ARG(QString, fileOnRobot)); break; case RunPolicy::NeverRun: break; } } void Ev3RbfGeneratorPlugin::runProgram() { const QString fileOnRobot = uploadProgram(); communication::Ev3RobotCommunicationThread * const communicator = currentCommunicator(); if (!fileOnRobot.isEmpty() && communicator) { QMetaObject::invokeMethod(communicator, "runProgram", Q_ARG(QString, fileOnRobot)); } } void Ev3RbfGeneratorPlugin::stopRobot() { if (communication::Ev3RobotCommunicationThread * const communicator = currentCommunicator()) { QMetaObject::invokeMethod(communicator, "stopProgram"); } } bool Ev3RbfGeneratorPlugin::javaInstalled() { QProcess java; java.setEnvironment(QProcess::systemEnvironment()); java.start("java"); java.waitForFinished(); return !java.readAllStandardError().isEmpty(); } bool Ev3RbfGeneratorPlugin::copySystemFiles(const QString &destination) { QDirIterator iterator(":/ev3/rbf/thirdparty"); while (iterator.hasNext()) { const QFileInfo fileInfo(iterator.next()); const QString destFile = destination + "/" + fileInfo.fileName(); if (!QFile::exists(destFile) && !QFile::copy(fileInfo.absoluteFilePath(), destFile)) { return false; } } return true; } bool Ev3RbfGeneratorPlugin::compile(const QFileInfo &lmsFile) { QFile rbfFile(lmsFile.absolutePath() + "/" + lmsFile.baseName() + ".rbf"); if (rbfFile.exists()) { rbfFile.remove(); } QProcess java; java.setEnvironment(QProcess::systemEnvironment()); java.setWorkingDirectory(lmsFile.absolutePath()); #ifdef Q_OS_WIN java.start("cmd /c java -jar assembler.jar " + lmsFile.absolutePath() + "/" + lmsFile.baseName()); #else java.start("java -jar assembler.jar " + lmsFile.absolutePath() + "/" + lmsFile.baseName()); #endif connect(&java, &QProcess::readyRead, this, [&java]() { QLOG_INFO() << java.readAll(); }); java.waitForFinished(); return true; } QString Ev3RbfGeneratorPlugin::upload(const QFileInfo &lmsFile) { const QString folderName = SettingsManager::value("Ev3CommonFolderChecboxChecked", false).toBool() ? SettingsManager::value("Ev3CommonFolderName", "ts").toString() : lmsFile.baseName(); const QString targetPath = "../prjs/" + folderName; const QString rbfPath = lmsFile.absolutePath() + "/" + lmsFile.baseName() + ".rbf"; bool connected = false; communication::Ev3RobotCommunicationThread *communicator = currentCommunicator(); if (!communicator) { return QString(); } QMetaObject::invokeMethod(communicator, "connect" , (communicator->thread()==QThread::currentThread() ? Qt::DirectConnection : Qt::BlockingQueuedConnection) , Q_RETURN_ARG(bool, connected)); if (!connected) { const bool isUsb = mRobotModelManager->model().name().contains("usb", Qt::CaseInsensitive); mMainWindowInterface->errorReporter()->addError(tr("Could not upload file to robot. "\ "Connect to a robot via %1.").arg(isUsb ? tr("USB") : tr("Bluetooth"))); return QString(); } QString res; QMetaObject::invokeMethod(communicator, "uploadFile" , (communicator->thread()==QThread::currentThread() ? Qt::DirectConnection : Qt::BlockingQueuedConnection) , Q_RETURN_ARG(QString, res), Q_ARG(QString, rbfPath), Q_ARG(QString, targetPath)); return res; } generatorBase::MasterGeneratorBase *Ev3RbfGeneratorPlugin::masterGenerator() { return new Ev3RbfMasterGenerator(*mRepo , *mMainWindowInterface->errorReporter() , *mParserErrorReporter , *mRobotModelManager , *mTextLanguage , mMainWindowInterface->activeDiagram() , generatorName()); }
#include "CubismFrameWorkAllocator.h" using namespace Csm; void* CubismFrameWorkAllocator::Allocate(const csmSizeType size) { return malloc(size); } void CubismFrameWorkAllocator::Deallocate(void* memory) { free(memory); } void* CubismFrameWorkAllocator::AllocateAligned(const csmSizeType size, const csmUint32 alignment) { size_t offset, shift, alignedAddress; void* allocation; void** preamble; offset = alignment - 1 + sizeof(void*); allocation = Allocate(size + static_cast<csmUint32>(offset)); alignedAddress = reinterpret_cast<size_t>(allocation) + sizeof(void*); shift = alignedAddress % alignment; if (shift) { alignedAddress += (alignment - shift); } preamble = reinterpret_cast<void**>(alignedAddress); preamble[-1] = allocation; return reinterpret_cast<void*>(alignedAddress); } void CubismFrameWorkAllocator::DeallocateAligned(void* alignedMemory) { void** preamble; preamble = static_cast<void**>(alignedMemory); Deallocate(preamble[-1]); }