hexsha stringlengths 40 40 | size int64 7 1.05M | ext stringclasses 13
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 269 | max_stars_repo_name stringlengths 5 108 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 9 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 269 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 9 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 269 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 9 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 7 1.05M | avg_line_length float64 1.21 330k | max_line_length int64 6 990k | alphanum_fraction float64 0.01 0.99 | author_id stringlengths 2 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4ca4710161503f1db2410a27bdd407a14d167280 | 16,882 | cpp | C++ | graphics/cgal/STL_Extension/test/STL_Extension/test_multiset.cpp | hlzz/dotfiles | 0591f71230c919c827ba569099eb3b75897e163e | [
"BSD-3-Clause"
] | 4 | 2016-03-30T14:31:52.000Z | 2019-02-02T05:01:32.000Z | graphics/cgal/STL_Extension/test/STL_Extension/test_multiset.cpp | hlzz/dotfiles | 0591f71230c919c827ba569099eb3b75897e163e | [
"BSD-3-Clause"
] | null | null | null | graphics/cgal/STL_Extension/test/STL_Extension/test_multiset.cpp | hlzz/dotfiles | 0591f71230c919c827ba569099eb3b75897e163e | [
"BSD-3-Clause"
] | null | null | null | // ============================================================================
//
// Copyright (c) 2005 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
// intended for general use.
//
// ----------------------------------------------------------------------------
//
// release : $CGAL_Revision: $
// release_date : $CGAL_Date: $
//
// file : src/test_multiset.C
// package : $CGAL_Package: STL_Extension $
// chapter : $CGAL_Chapter: STL Extensions for CGAL $
//
// revision : $Id$
// revision_date : $Date$
//
// author(s) : Ron Wein <wein@post.tau.ac.il>
// maintainer : Ron Wein <wein@post.tau.ac.il>
// coordinator : ETH Zurich
//
// A test for the CGAL::Multiset container.
// ============================================================================
#include <CGAL/basic.h>
#include <CGAL/Multiset.h>
#include <string>
#include <vector>
#include <list>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cassert>
void test_massive_insert_and_erase();
void test_iterators();
void test_lookup();
void test_comparison();
void test_catenate();
void test_split();
void test_swap_and_replace();
int main ()
{
std::cout << std::endl
<< "Testing insert and erase:" << std::endl
<< "=========================" << std::endl << std::endl;
test_massive_insert_and_erase();
std::cout << std::endl
<< "Testing the iterators:" << std::endl
<< "======================" << std::endl << std::endl;
test_iterators();
std::cout << std::endl
<< "Testing the lookup methods:" << std::endl
<< "===========================" << std::endl << std::endl;
test_lookup();
std::cout << std::endl
<< "Testing the comparison functions:" << std::endl
<< "=================================" << std::endl << std::endl;
test_comparison();
std::cout << std::endl
<< "Testing catenate:" << std::endl
<< "=================" << std::endl << std::endl;
test_catenate();
std::cout << std::endl
<< "Testing split:" << std::endl
<< "==============" << std::endl << std::endl;
test_split();
std::cout << std::endl
<< "Testing swap and replace:" << std::endl
<< "=========================" << std::endl << std::endl;
test_swap_and_replace();
return (0);
}
// ---------------------------------------------------------------------------
void test_massive_insert_and_erase ()
{
typedef CGAL::Multiset<int> Set;
typedef Set::iterator Set_iter;
Set set;
Set_iter iter;
const int n = 2000;
int k;
int val;
std::cout << "Inserting " << n << " numbers into the set... " << std::flush;
for (k = 0; k < n; k++)
{
val = static_cast<int> (n * static_cast<double>(std::rand()) / RAND_MAX);
set.insert (val);
assert (set.is_valid());
}
std::cout << "Done." << std::endl;
// Print the set characteristics.
std::cout << set.size() << " numbers in the set "
<< "(tree height is " << set.height()
<< ", black-height is " << set.black_height() << ")."
<< std::endl;
// Delete some numbers.
size_t n_del = 0;
std::cout << "Deleting numbers from the set... " << std::flush;
for (k = 0; k < 3*n; k++)
{
val = static_cast<int> (n * static_cast<double>(std::rand()) / RAND_MAX);
n_del += set.erase (val);
assert (set.is_valid());
}
std::cout << "Done." << std::endl;
std::cout << n_del << " numbers have been deleted." << std::endl;
// Print the set.
std::cout << set.size() << " numbers in the set "
<< "(tree height is " << set.height()
<< ", black-height is " << set.black_height()
<< ")." << std::endl;
for (iter = set.begin(); iter != set.end(); ++iter)
std::cout << *iter << ' ';
std::cout << std::endl;
return;
}
// ---------------------------------------------------------------------------
void test_iterators ()
{
typedef CGAL::Multiset<int> Set;
typedef Set::iterator Set_iter;
typedef Set::reverse_iterator Set_rev_iter;
Set set;
const int range = 101; // A prime number.
int k;
int val;
std::cout << "Inserting numbers:" << std::endl;
for (k = 0; k < range; k++)
{
val = (k * (range /2)) % range;
std::cout << val << ' ';
set.insert (val);
}
std::cout << std::endl << std::endl;
// Print the set.
Set_iter iter;
std::cout << set.size() << " numbers in the set (tree height is "
<< set.height() << "):" << std::endl;
for (iter = set.begin(); iter != set.end(); ++iter)
std::cout << *iter << ' ';
std::cout << std::endl;
// Insert a few negative numbers.
Set_iter pos;
pos = set.insert (-20);
set.insert_before (pos, -30);
set.insert_after (pos, -10);
// Erase a few numbers.
set.erase (pos);
set.erase (0);
set.erase (17);
set.erase (19);
// Replace 18 by 19. This does not violate the set properties:
pos = set.find (18);
set.replace (pos, 19);
// Insert back the number 17, but using an inexact hint.
pos++;
set.insert (pos, 17);
// Print the set in a reversed order.
Set_rev_iter rev_iter;
std::cout << set.size() << " numbers in the set (tree height is "
<< set.height() << "):" << std::endl;
for (rev_iter = set.rbegin(); rev_iter != set.rend(); ++rev_iter)
std::cout << *rev_iter << ' ' << std::flush;
std::cout << std::endl;
return;
}
// ---------------------------------------------------------------------------
struct Word_index
{
std::string word;
int index;
};
struct Word_index_compare
{
// Compare two Word_index objects.
CGAL::Comparison_result operator() (const Word_index& w1,
const Word_index& w2) const
{
int res = std::strcmp (w1.word.c_str(), w2.word.c_str());
if (res == 0)
return (CGAL::EQUAL);
else if (res < 0)
return (CGAL::SMALLER);
else
return (CGAL::LARGER);
}
};
struct String_word_index_compare
{
// Compare a string to a Word_index object.
CGAL::Comparison_result operator() (const std::string& str,
const Word_index& w2) const
{
int res = std::strcmp (str.c_str(), w2.word.c_str());
if (res == 0)
return (CGAL::EQUAL);
else if (res < 0)
return (CGAL::SMALLER);
else
return (CGAL::LARGER);
}
};
void test_lookup ()
{
typedef CGAL::Multiset<Word_index, Word_index_compare> Set;
typedef Set::const_iterator Set_iter;
const char *words[] =
{"There's", "a", "lady", "who's", "sure",
"all", "that", "glitters", "is", "gold",
"And", "she's", "buying", "a", "stairway", "to", "heaven",
"And", "when", "she", "gets", "there", "she", "knows",
"if", "the", "stores", "are", "closed",
"With", "a", "word", "she", "can", "get", "what", "she", "came", "for",
"Woe", "oh", "oh", "oh", "oh", "oh",
"And", "she's", "buying", "a", "stairway", "to", "heaven"};
const int n_words = sizeof(words) / sizeof(char*);
// Insert all indexed words into the set.
Set set;
Word_index obj;
int k;
for (k = 0; k < n_words; k++)
{
obj.word = words[k];
obj.index = k;
set.insert (obj);
}
// Print the indices of the words that occur more than once.
CGAL::Multiset<std::string> used_words;
const Set cset = set;
Set_iter lower, upper;
std::pair<Set_iter, Set_iter> range;
std::pair<Set_iter, bool> res;
for (k = 0; k < n_words; k++)
{
if (cset.count (words[k], String_word_index_compare()) > 1 &&
used_words.find (words[k]) == used_words.end())
{
used_words.insert (words[k]);
std::cout << words[k] << ':';
lower = cset.lower_bound (words[k], String_word_index_compare());
upper = cset.upper_bound (words[k], String_word_index_compare());
range = cset.equal_range (words[k], String_word_index_compare());
res = cset.find_lower (words[k], String_word_index_compare());
assert ((res.second && lower != upper) ||
(! res.second && lower == upper));
assert (lower == range.first && upper == range.second);
while (lower != upper)
{
std::cout << ' ' << lower->index;
lower++;
}
std::cout << std::endl;
}
}
return;
}
// ---------------------------------------------------------------------------
void test_comparison ()
{
typedef CGAL::Multiset<int> Set;
// Construct a random set.
const int n = 10;
Set set1;
int k;
for (k = 1; k <= n; k++)
set1.insert (10*k);
Set set2 = set1;
assert (set1 == set2);
// Add elements, then compare.
set2.insert (200);
std::cout << "After first insertion: ";
if (set1 == set2)
std::cout << "S1 == S2" << std::endl;
else if (set1 < set2)
std::cout << "S1 < S2" << std::endl;
else
std::cout << "S1 > S2" << std::endl;
set1.insert (25);
std::cout << "After second insertion: ";
if (set1 == set2)
std::cout << "S1 == S2" << std::endl;
else if (set1 < set2)
std::cout << "S1 < S2" << std::endl;
else
std::cout << "S1 > S2" << std::endl;
// Swap the two sets.
set1.swap (set2);
assert (set1.is_valid());
assert (set2.is_valid());
std::cout << "After swapping the sets: ";
if (set1 == set2)
std::cout << "S1 == S2" << std::endl;
else if (set1 < set2)
std::cout << "S1 < S2" << std::endl;
else
std::cout << "S1 > S2" << std::endl;
return;
}
// ---------------------------------------------------------------------------
void test_catenate ()
{
typedef CGAL::Multiset<int> Set;
typedef Set::iterator Set_iter;
// Test catenation of small sets.
Set s1, s1_rev;
Set s2, s2_rev;
const int max_size = 4;
int size1, size2;
int k;
for (size1 = 1; size1 <= max_size; size1++)
{
for (size2 = 1; size2 <= max_size; size2++)
{
s1.clear();
s1_rev.clear();
for (k = 1; k <= size1; k++)
{
s1.insert (k);
s1_rev.insert (size1 - k + 1);
}
s2.clear();
s2_rev.clear();
for (k = 1; k <= size2; k++)
{
s2.insert (size1 + k);
s2_rev.insert (size1 + size2 - k + 1);
}
s1.catenate (s2);
assert (s1.is_valid());
s1_rev.catenate (s2_rev);
assert (s1_rev.is_valid());
s1.clear();
s1_rev.clear();
for (k = 1; k <= size1; k++)
{
s1.insert (k);
s1_rev.insert (size1 - k + 1);
}
s2.clear();
s2_rev.clear();
for (k = 1; k <= size2; k++)
{
s2.insert (size1 + k);
s2_rev.insert (size1 + size2 - k + 1);
}
s1.catenate (s2_rev);
assert (s1.is_valid());
s1_rev.catenate (s2);
assert (s1_rev.is_valid());
}
}
// Construct two random sets.
const int n1 = 1000;
Set set1;
const int n2 = 100;
Set set2;
int val;
for (k = 0; k < n1; k++)
{
val = static_cast<int> (1000 * static_cast<double>(std::rand()) /
static_cast<double>(RAND_MAX));
set1.insert (val);
}
assert (set1.is_valid());
std::cout << set1.size() << " numbers in the first set "
<< "(tree height is " << set1.height()
<< ", black-height is " << set1.black_height()
<< ")." << std::endl;
for (k = 0; k < n2; k++)
{
val = static_cast<int> (2000 + 1000 * static_cast<double>(std::rand()) /
static_cast<double>(RAND_MAX));
set2.insert (val);
}
assert (set2.is_valid());
std::cout << set2.size() << " numbers in the second set "
<< "(tree height is " << set2.height()
<< ", black-height is " << set2.black_height()
<< ")." << std::endl;
// Merge the sets.
set1.catenate (set2);
// Print the resulting set.
Set_iter iter;
std::cout << set1.size() << " numbers in the merged set "
<< "(tree height is " << set1.height()
<< ", black-height is " << set1.black_height()
<< ")." << std::endl;
for (iter = set1.begin(); iter != set1.end(); ++iter)
std::cout << *iter << ' ';
std::cout << std::endl;
if (set2.size() == 0)
std::cout << "The other set is now empty." << std::endl;
return;
}
// ---------------------------------------------------------------------------
void test_split ()
{
typedef CGAL::Multiset<int> Set;
typedef Set::iterator Set_iter;
Set set;
const int range = 101; // A prime number.
int k;
int val;
std::cout << "Inserting numbers:" << std::endl;
for (k = 0; k < range; k++)
{
val = (k * (range /2)) % range;
set.insert (val);
}
assert (set.is_valid());
// Print the set.
Set_iter iter;
std::cout << set.size() << " numbers in the set "
<< "(tree height is " << set.height()
<< ", black-height is " << set.black_height()
<< ")." << std::endl;
for (iter = set.begin(); iter != set.end(); ++iter)
std::cout << *iter << ' ';
std::cout << std::endl;
// Split the set at all possible positions.
for (k = 0; k < range; k++)
{
Set set1 = set;
Set set2;
std::cout << " Splitting at " << k << " ... " << std::flush;
set1.split (k, set2);
assert (set1.is_valid());
assert (set2.is_valid());
assert (set.size() == set1.size() + set2.size());
std::cout << "OK." << std::endl;
}
return;
}
// ---------------------------------------------------------------------------
struct Compare_floor
{
CGAL::Comparison_result operator() (const double& x1,
const double& x2) const
{
const int ix1 = static_cast<int> (x1);
const int ix2 = static_cast<int> (x2);
if (ix1 < ix2)
return (CGAL::SMALLER);
else if (ix1 == ix2)
return (CGAL::EQUAL);
else
return (CGAL::LARGER);
}
};
void test_swap_and_replace ()
{
typedef CGAL::Multiset<double, Compare_floor> Set;
typedef Set::iterator Set_iter;
typedef std::list<Set_iter> Iter_list;
Set set;
Set_iter iter;
const int M = 10;
std::vector<Iter_list> handles (M);
const int n = 30;
double val;
int k;
std::cout << "Inserting " << n << " numbers into the set... " << std::flush;
for (k = 0; k < n; k++)
{
val = M * (static_cast<double>(std::rand()) / RAND_MAX);
handles[static_cast<int>(val)].push_back (set.insert (val));
}
assert (set.is_valid());
std::cout << "Done." << std::endl;
// Print the set.
std::cout << set.size() << " numbers in the set "
<< "(tree height is " << set.height()
<< ", black-height is " << set.black_height() << ")."
<< std::endl;
for (iter = set.begin(); iter != set.end(); ++iter)
std::cout << *iter << ' ';
std::cout << std::endl;
// Go over the handle buckets and swap elements.
std::cout << "Swapping elements in the set... " << std::flush;
for (k = 0; k < M; k ++)
{
if (handles[k].size() >= 2)
{
set.swap (handles[k].front(), handles[k].back());
assert (set.is_valid());
}
else if (handles[k].size() == 1)
{
set.replace (handles[k].front(), k);
}
}
std::cout << "Done." << std::endl;
for (iter = set.begin(); iter != set.end(); ++iter)
std::cout << *iter << ' ';
std::cout << std::endl;
// Check the case of swapping two sibling nodes.
typedef CGAL::Multiset<int> Int_set;
typedef Int_set::iterator Int_set_iter;
Int_set iset;
Int_set_iter pos1, pos2, iitr;
iset.insert (0);
iset.insert (2000);
iset.insert (1000);
iset.insert (1500);
pos1 = iset.insert (1250);
iset.insert (1375);
pos2 = iset.insert (1437);
for (iitr = iset.begin(); iitr != iset.end(); ++iitr)
std::cout << *iitr << ' ';
std::cout << std::endl;
assert (iset.is_valid());
*pos1 = 1438;
*pos2 = 1251;
for (iitr = iset.begin(); iitr != iset.end(); ++iitr)
std::cout << *iitr << ' ';
std::cout << std::endl;
// Note that the set is temporarily invalid!
assert (! iset.is_valid());
// Perform the swap to make it valid again.
iset.swap (pos1, pos2);
for (iitr = iset.begin(); iitr != iset.end(); ++iitr)
std::cout << *iitr << ' ';
std::cout << std::endl;
assert (iset.is_valid());
return;
}
| 26.29595 | 79 | 0.497512 | hlzz |
4ca622cf63d1b2b43c3daf5161c35c4a64d8b9c5 | 55 | hpp | C++ | include/scapin/scapin.hpp | sbrisard/gollum | 25d5b9aea63a8f2812c4b41850450fcbead64da7 | [
"BSD-3-Clause"
] | null | null | null | include/scapin/scapin.hpp | sbrisard/gollum | 25d5b9aea63a8f2812c4b41850450fcbead64da7 | [
"BSD-3-Clause"
] | 4 | 2020-09-24T07:32:21.000Z | 2020-12-01T08:06:00.000Z | include/scapin/scapin.hpp | sbrisard/gollum | 25d5b9aea63a8f2812c4b41850450fcbead64da7 | [
"BSD-3-Clause"
] | 1 | 2020-02-02T18:05:15.000Z | 2020-02-02T18:05:15.000Z | #pragma once
#include "core.hpp"
#include "hooke.hpp"
| 11 | 20 | 0.709091 | sbrisard |
4ca792d7e9660efb0d8b18ae894764ca09b7e6e0 | 1,485 | cpp | C++ | src/lib/SKManagedClient/MOpTimeoutController.cpp | LevyForch/SilverKing | 6ab063d0f1695675271eecba723f8f1a3b4f75a5 | [
"Apache-2.0"
] | null | null | null | src/lib/SKManagedClient/MOpTimeoutController.cpp | LevyForch/SilverKing | 6ab063d0f1695675271eecba723f8f1a3b4f75a5 | [
"Apache-2.0"
] | 85 | 2021-06-30T01:20:47.000Z | 2021-09-14T01:09:41.000Z | src/lib/SKManagedClient/MOpTimeoutController.cpp | LevyForch/SilverKing | 6ab063d0f1695675271eecba723f8f1a3b4f75a5 | [
"Apache-2.0"
] | null | null | null | #include "StdAfx.h"
#include "MOpTimeoutController.h"
#include "SKAsyncOperation.h"
#include <cstddef>
#include "SKOpTimeoutController.h"
#include "MAsyncOperation.h"
using namespace System;
using namespace System::Net;
using namespace System::Runtime::InteropServices;
namespace SKManagedClient {
MOpTimeoutController::~MOpTimeoutController()
{
this->!MOpTimeoutController();
}
MOpTimeoutController::!MOpTimeoutController()
{
if(pImpl)
{
delete (SKOpTimeoutController*)pImpl ;
pImpl = NULL;
}
}
//MOpTimeoutController::MOpTimeoutController() : pImpl(NULL) {}
SKOpTimeoutController_M ^ MOpTimeoutController::getPImpl(){
SKOpTimeoutController_M ^ opc = gcnew SKOpTimeoutController_M;
opc->pOpTimeoutController = pImpl;
return opc;
}
int MOpTimeoutController::getMaxAttempts(MAsyncOperation ^ op){
SKAsyncOperation * pOp = (SKAsyncOperation *) (op->getPImpl()->pAsyncOperation);
return ((SKOpTimeoutController*)pImpl)->getMaxAttempts(pOp);
}
int MOpTimeoutController::getRelativeTimeoutMillisForAttempt(MAsyncOperation ^ op, int attemptIndex){
SKAsyncOperation * pOp = (SKAsyncOperation *) (op->getPImpl()->pAsyncOperation);
return ((SKOpTimeoutController*)pImpl)->getRelativeTimeoutMillisForAttempt(pOp, attemptIndex);
}
int MOpTimeoutController::getMaxRelativeTimeoutMillis(MAsyncOperation ^ op){
SKAsyncOperation * pOp = (SKAsyncOperation *) (op->getPImpl()->pAsyncOperation);
return ((SKOpTimeoutController*)pImpl)->getMaxRelativeTimeoutMillis(pOp);
}
}
| 27.5 | 101 | 0.785185 | LevyForch |
4ca7939ee1f48050997521e86ce834c26a8bd999 | 222 | cpp | C++ | HDUOJ/2107.cpp | LzyRapx/Competitive-Programming | 6b0eea727f9a6444700a6966209397ac7011226f | [
"Apache-2.0"
] | 81 | 2018-06-03T04:27:45.000Z | 2020-09-13T09:04:12.000Z | HDUOJ/2107.cpp | Walkerlzy/Competitive-algorithm | 6b0eea727f9a6444700a6966209397ac7011226f | [
"Apache-2.0"
] | null | null | null | HDUOJ/2107.cpp | Walkerlzy/Competitive-algorithm | 6b0eea727f9a6444700a6966209397ac7011226f | [
"Apache-2.0"
] | 21 | 2018-07-11T04:02:38.000Z | 2020-07-18T20:31:14.000Z | #include <stdio.h>
int main()
{
int t,a,max;
while(scanf("%d",&t)!=EOF &&t!=0)
{
max=0;
while(t--)
{
scanf("%d",&a);
if(a>max)
{
max=a;
}
}
printf("%d\n",max);
}
return 0;
} | 11.684211 | 35 | 0.405405 | LzyRapx |
4ca8e2e82d9dad9ee92f27c9529e55e557fb227f | 25 | cpp | C++ | library/cpp/iterator/concatenate.cpp | jochenater/catboost | de2786fbc633b0d6ea6a23b3862496c6151b95c2 | [
"Apache-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | library/cpp/iterator/concatenate.cpp | jochenater/catboost | de2786fbc633b0d6ea6a23b3862496c6151b95c2 | [
"Apache-2.0"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | library/cpp/iterator/concatenate.cpp | jochenater/catboost | de2786fbc633b0d6ea6a23b3862496c6151b95c2 | [
"Apache-2.0"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | #include "concatenate.h"
| 12.5 | 24 | 0.76 | jochenater |
4ca8f524968b0b8b0fc493da4b396e450d0bd1f3 | 5,060 | hxx | C++ | main/filter/source/config/cache/cacheupdatelistener.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 679 | 2015-01-06T06:34:58.000Z | 2022-03-30T01:06:03.000Z | main/filter/source/config/cache/cacheupdatelistener.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 102 | 2017-11-07T08:51:31.000Z | 2022-03-17T12:13:49.000Z | main/filter/source/config/cache/cacheupdatelistener.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 331 | 2015-01-06T11:40:55.000Z | 2022-03-14T04:07:51.000Z | /**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef __FILTER_CONFIG_CACHEUPDATELISTENER_HXX_
#define __FILTER_CONFIG_CACHEUPDATELISTENER_HXX_
//_______________________________________________
// includes
#include "filtercache.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/util/XChangesListener.hpp>
#include <salhelper/singletonref.hxx>
#include <cppuhelper/implbase1.hxx>
//_______________________________________________
// namespace
namespace filter{
namespace config{
//_______________________________________________
// definitions
//_______________________________________________
/** @short implements a listener, which will update the
global filter cache, if the underlying configuration
wa changed by other processes.
*/
class CacheUpdateListener : public BaseLock // must be the first one to guarantee right initialized mutex member!
, public ::cppu::WeakImplHelper1< css::util::XChangesListener >
{
//-------------------------------------------
// member
private:
/** @short reference to an uno service manager, which can be used
to create own needed services. */
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
/** @short reference to the singleton(!) filter cache implementation,
which should be updated by this thread. */
::salhelper::SingletonRef< FilterCache > m_rCache;
/** @short holds the configuration access, where we listen alive. */
css::uno::Reference< css::uno::XInterface > m_xConfig;
/** @short every instance of this update listener listen on
a special sub set of the filter configuration.
So it should know, which type of configuration entry
it must put into the filter cache, if the configuration notifys changes ... */
FilterCache::EItemType m_eConfigType;
//-------------------------------------------
// native interface
public:
//---------------------------------------
// ctor/dtor
/** @short initialize new instance of this class.
@descr Listening won't be started here. It can be done
by calling startListening() on this instance.
@see startListening()
@param xSMGR
reference to a service manager, which can be used to create
own needed uno services.
@param xConfigAccess
the configuration access, where this instance should listen for changes.
@param eConfigType
specify the type of configuration.
*/
CacheUpdateListener(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
const css::uno::Reference< css::uno::XInterface >& xConfigAccess,
FilterCache::EItemType eConfigType );
//---------------------------------------
/** @short standard dtor.
*/
virtual ~CacheUpdateListener();
//---------------------------------------
/** @short starts listening.
*/
virtual void startListening();
//---------------------------------------
/** @short stop listening.
*/
virtual void stopListening();
//-------------------------------------------
// uno interface
public:
//---------------------------------------
// XChangesListener
virtual void SAL_CALL changesOccurred(const css::util::ChangesEvent& aEvent)
throw(css::uno::RuntimeException);
//---------------------------------------
// lang.XEventListener
virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent)
throw(css::uno::RuntimeException);
};
} // namespace config
} // namespace filter
#endif // __FILTER_CONFIG_CACHEUPDATELISTENER_HXX_
| 35.138889 | 113 | 0.57668 | Grosskopf |
4cac1a7f4b7e0ef3200dd3a2e1bda64bde60bf7b | 1,841 | cpp | C++ | 2018/cpp/src/day23.cpp | Chrinkus/advent-of-code | b2ae137dc7a1d6fc9e20f29549e891404591c47f | [
"MIT"
] | 1 | 2021-12-04T20:55:02.000Z | 2021-12-04T20:55:02.000Z | 2018/cpp/src/day23.cpp | Chrinkus/advent-of-code | b2ae137dc7a1d6fc9e20f29549e891404591c47f | [
"MIT"
] | null | null | null | 2018/cpp/src/day23.cpp | Chrinkus/advent-of-code | b2ae137dc7a1d6fc9e20f29549e891404591c47f | [
"MIT"
] | null | null | null | #include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>
#include <get_input.hpp>
class Nanobot {
private:
int xx, yy, zz, rr;
public:
Nanobot() = default;
Nanobot(int x, int y, int z, int r)
: xx{x}, yy{y}, zz{z}, rr{r} { }
int x() const { return xx; }
int y() const { return yy; }
int z() const { return zz; }
int r() const { return rr; }
bool is_in_range(const Nanobot& nb) const;
};
int distance(const Nanobot& a, const Nanobot& b)
{
return std::abs(a.x() - b.x()) +
std::abs(a.y() - b.y()) +
std::abs(a.z() - b.z());
}
bool Nanobot::is_in_range(const Nanobot& other) const
{
return distance(*this, other) <= rr;
}
std::istream& operator>>(std::istream& is, Nanobot& n)
{
char ch;
while (is >> ch && ch != '<')
;
int x, y, z;
is >> x >> ch >> y >> ch >> z;
while (is >> ch && ch != '=')
;
int r;
is >> r;
Nanobot nn { x, y, z, r };
n = nn;
return is;
}
auto parse_input(const std::string& input)
{
std::vector<Nanobot> vnb;
std::istringstream iss { input };
for (Nanobot nb; iss >> nb; )
vnb.emplace_back(nb);
return vnb;
}
int in_range_of_strongest(const std::vector<Nanobot>& vnb)
{
auto it = std::max_element(std::begin(vnb), std::end(vnb),
[](const auto& a, const auto& b) { return a.r() < b.r(); });
return std::count_if(std::begin(vnb), std::end(vnb),
[&it](const auto& nb) { return it->is_in_range(nb); });
}
int main(int argc, char* argv[])
{
std::cout << "AoC 2018 Day 23 - Experimental Emergency Teleportation\n";
auto input = utils::get_input_string(argc, argv, "23");
auto vnb = parse_input(input);
auto part1 = in_range_of_strongest(vnb);
std::cout << "Part 1: " << part1 << '\n';
}
| 21.658824 | 76 | 0.552417 | Chrinkus |
4cafa692193ad8d83d94ab89b39b484ba5870a99 | 2,582 | cpp | C++ | B2G/gecko/uriloader/exthandler/ExternalHelperAppChild.cpp | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-08-31T15:24:31.000Z | 2020-04-24T20:31:29.000Z | B2G/gecko/uriloader/exthandler/ExternalHelperAppChild.cpp | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | null | null | null | B2G/gecko/uriloader/exthandler/ExternalHelperAppChild.cpp | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-07-29T07:17:15.000Z | 2020-11-04T06:55:37.000Z | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ExternalHelperAppChild.h"
#include "nsIInputStream.h"
#include "nsIRequest.h"
#include "nsIResumableChannel.h"
#include "nsNetUtil.h"
namespace mozilla {
namespace dom {
NS_IMPL_ISUPPORTS2(ExternalHelperAppChild,
nsIStreamListener,
nsIRequestObserver)
ExternalHelperAppChild::ExternalHelperAppChild()
: mStatus(NS_OK)
{
}
ExternalHelperAppChild::~ExternalHelperAppChild()
{
}
//-----------------------------------------------------------------------------
// nsIStreamListener
//-----------------------------------------------------------------------------
NS_IMETHODIMP
ExternalHelperAppChild::OnDataAvailable(nsIRequest *request,
nsISupports *ctx,
nsIInputStream *input,
uint64_t offset,
uint32_t count)
{
if (NS_FAILED(mStatus))
return mStatus;
nsCString data;
nsresult rv = NS_ReadInputStreamToString(input, data, count);
if (NS_FAILED(rv))
return rv;
if (!SendOnDataAvailable(data, offset, count))
return NS_ERROR_UNEXPECTED;
return NS_OK;
}
//////////////////////////////////////////////////////////////////////////////
// nsIRequestObserver
//////////////////////////////////////////////////////////////////////////////
NS_IMETHODIMP
ExternalHelperAppChild::OnStartRequest(nsIRequest *request, nsISupports *ctx)
{
nsresult rv = mHandler->OnStartRequest(request, ctx);
NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
nsCString entityID;
nsCOMPtr<nsIResumableChannel> resumable(do_QueryInterface(request));
if (resumable)
resumable->GetEntityID(entityID);
SendOnStartRequest(entityID);
return NS_OK;
}
NS_IMETHODIMP
ExternalHelperAppChild::OnStopRequest(nsIRequest *request,
nsISupports *ctx,
nsresult status)
{
nsresult rv = mHandler->OnStopRequest(request, ctx, status);
SendOnStopRequest(status);
NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
return NS_OK;
}
bool
ExternalHelperAppChild::RecvCancel(const nsresult& aStatus)
{
mStatus = aStatus;
return true;
}
} // namespace dom
} // namespace mozilla
| 27.468085 | 79 | 0.583269 | wilebeast |
4cb41210ea8ee7c5d4f8c5d2a3be94488f147348 | 1,695 | cpp | C++ | questions/repeat-24435851/main.cpp | SammyEnigma/stackoverflown | 0f70f2534918b2e65cec1046699573091d9a40b5 | [
"Unlicense"
] | 54 | 2015-09-13T07:29:52.000Z | 2022-03-16T07:43:50.000Z | questions/repeat-24435851/main.cpp | SammyEnigma/stackoverflown | 0f70f2534918b2e65cec1046699573091d9a40b5 | [
"Unlicense"
] | null | null | null | questions/repeat-24435851/main.cpp | SammyEnigma/stackoverflown | 0f70f2534918b2e65cec1046699573091d9a40b5 | [
"Unlicense"
] | 31 | 2016-08-26T13:35:01.000Z | 2022-03-13T16:43:12.000Z | #include <QLabel>
#include <QHBoxLayout>
#include <QBasicTimer>
#include <QProcess>
#include <QApplication>
class Widget : public QWidget {
Q_OBJECT
QHBoxLayout m_layout;
QLabel m_label;
QBasicTimer m_timer;
QProcess m_process;
void timerEvent(QTimerEvent * ev) {
if (ev->timerId() == m_timer.timerId()) txMessage();
}
void txMessage() {
m_timer.stop();
m_process.start("netstat", QStringList() << "-i", QProcess::ReadOnly);
}
Q_SLOT void finished(int rc) {
startTimer();
if (rc != 0) {
m_label.setText("Error");
} else {
QString output = QString::fromLocal8Bit(m_process.readAll());
QStringList lines = output.split('\n', QString::SkipEmptyParts);
foreach (QString line, lines) {
if (!line.contains("en0")) continue;
QStringList args = line.split(' ', QString::SkipEmptyParts);
if (args.count() >= 3) {
m_label.setText(args.at(3));
return;
}
}
}
m_label.setText("...");
}
void startTimer() {
#if QT_VERSION>=QT_VERSION_CHECK(5,0,0)
m_timer.start(1000, Qt::CoarseTimer, this);
#else
m_timer.start(1000, this);
#endif
}
public:
Widget(QWidget * parent = 0) : QWidget(parent), m_layout(this), m_label("...") {
m_layout.addWidget(&m_label);
startTimer();
connect(&m_process, SIGNAL(finished(int)), SLOT(finished(int)));
}
};
int main(int argc, char ** argv)
{
QApplication app(argc, argv);
Widget w;
w.show();
return app.exec();
}
#include "main.moc"
| 27.33871 | 84 | 0.561652 | SammyEnigma |
4cb4836663a4bb1aae276b44cb043f064f7078b0 | 15,064 | cpp | C++ | Source Code/NEXTA-GUI/TLite.cpp | OSADP/DTALite-AMS | 0779e0b3f1a423823b825b88237226a3216db960 | [
"Apache-2.0"
] | 1 | 2020-12-02T05:50:34.000Z | 2020-12-02T05:50:34.000Z | Source Code/NEXTA-GUI/TLite.cpp | OSADP/DTALite-AMS | 0779e0b3f1a423823b825b88237226a3216db960 | [
"Apache-2.0"
] | null | null | null | Source Code/NEXTA-GUI/TLite.cpp | OSADP/DTALite-AMS | 0779e0b3f1a423823b825b88237226a3216db960 | [
"Apache-2.0"
] | 2 | 2020-10-16T09:26:08.000Z | 2021-11-17T06:59:51.000Z | // TLite.cpp : Defines the class behaviors for the application.
//
// Portions Copyright 2010 Xuesong Zhou (xzhou99@gmail.com)
// If you help write or modify the code, please also list your names here.
// The reason of having Copyright info here is to ensure all the modified version, as a whole, under the GPL
// and further prevent a violation of the GPL.
// More about "How to use GNU licenses for your own software"
// http://www.gnu.org/licenses/gpl-howto.html
// This file is part of NeXTA Version 3 (Open-source).
// NEXTA is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// NEXTA 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 NEXTA. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
#include "TLite.h"
#include "MainFrm.h"
#include "ChildFrm.h"
#include "TLiteDoc.h"
#include "TLiteView.h"
#include "TSView.h"
#include "DlgMOE.h"
#include "DlgPathMOE.h"
#include "DlgMainTemplate.h"
#include "Dlg_VehicleClassification.h"
#include "Dlg_Legend.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
extern CDlgMOE *g_LinkMOEDlg;
extern CDlgPathMOE *g_pPathMOEDlg;
extern std::vector<CDlg_VehicleClassification*> g_SummaryDialogVector;
extern CDlg_Legend* g_pLegendDlg;
// CTLiteApp
BEGIN_MESSAGE_MAP(CTLiteApp, CWinApp)
ON_COMMAND(ID_APP_ABOUT, &CTLiteApp::OnAppAbout)
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, &CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, &CWinApp::OnFileOpen)
ON_COMMAND(ID_FILE_OPEN, &CTLiteApp::OnFileOpen)
ON_COMMAND(ID_FILE_OPEN_NEW_DOC, &CTLiteApp::OnFileOpenNewDoc)
ON_COMMAND(ID_RESEARCHTOOLS_EXPORTTODTALITESENSORDATAFORMAT, &CTLiteApp::OnResearchtoolsExporttodtalitesensordataformat)
ON_COMMAND(ID_FILE_OPENMULTIPLETRAFFICDATAPROJECTS, &CTLiteApp::OnFileOpenmultipletrafficdataprojects)
ON_COMMAND(ID_APP_EXIT, &CTLiteApp::OnAppExit)
ON_COMMAND(ID_FILE_OPEN_NETWORK_ONLY, &CTLiteApp::OnFileOpenNetworkOnly)
ON_COMMAND(ID_HELP_USERGUIDE, &CTLiteApp::OnHelpUserguide)
ON_COMMAND(ID_HELP_CHECKLATESTSOFTWARERELEASE, &CTLiteApp::OnHelpChecklatestsoftwarerelease)
END_MESSAGE_MAP()
// CTLiteApp construction
// The one and only CTLiteApp object
CTLiteApp theApp;
// CTLiteApp initialization
CTLiteApp::CTLiteApp()
{
m_SimulatorString_32 = "DTALite_32.exe";
m_SimulatorString_64 = "DTALite.exe";
m_FreewayColor = RGB(030,144,255);
m_RampColor = RGB(160,032,240);
m_ArterialColor = RGB(034,139,034);
m_ConnectorColor = RGB(255,165,000);
m_TransitColor = RGB(255,0,255);
m_WalkingColor = RGB(127,255,0);
m_BackgroundColor = RGB(255,255,255);
m_NodeColor = RGB(0,0,0);
m_NodeBrushColor = RGB(0,0,0);
m_ZoneColor = RGB(000,191,255);
m_NEXTA_use_flag = 0;
m_bLoadNetworkOnly = false;
//m_pTemplateGLView = false;
m_pTemplateTimeTableView = false;
m_pDocTemplate2DView = NULL;
m_pTemplateTimeTableView = NULL;
}
BOOL CTLiteApp::InitInstance()
{
//TODO: call AfxInitRichEdit2() to initialize richedit2 library.
CWinApp::InitInstance();
// Standard initialization
SetRegistryKey(_T("NeXTA Version 3"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
char CurrentDirectory[MAX_PATH+1];
GetCurrentDirectory(MAX_PATH,CurrentDirectory);
CString NEXTASettingsPath;
NEXTASettingsPath.Format ("%s\\NEXTA_Settings.ini", CurrentDirectory);
m_NEXTA_use_flag = (int)g_GetPrivateProfileDouble("initialization", "nexta", 0, NEXTASettingsPath);
WritePrivateProfileString("initialization", "nexta","1",NEXTASettingsPath);
m_FreewayColor = (DWORD )g_GetPrivateProfileDouble("initialization", "FreewayColor", -1, NEXTASettingsPath);
if(m_FreewayColor<0)
m_FreewayColor = RGB(030,144,255);
m_RampColor = (DWORD )g_GetPrivateProfileDouble("initialization", "RampColor", -1, NEXTASettingsPath);
if(m_RampColor<0)
m_RampColor = RGB(160,032,240);
double value = g_GetPrivateProfileDouble("initialization", "ArterialColor", -1, NEXTASettingsPath);
if(value<0)
m_ArterialColor = RGB(160,032,240);
else
m_ArterialColor = (DWORD) value;
value = (DWORD )g_GetPrivateProfileDouble("initialization", "ConnectorColor", -1, NEXTASettingsPath);
if(value<0)
m_ConnectorColor = RGB(160,032,240);
else
m_ConnectorColor = (DWORD) value;
value = (DWORD )g_GetPrivateProfileDouble("initialization", "TransitColor", -1, NEXTASettingsPath);
if(value<0)
m_TransitColor = RGB(160,032,240);
else
m_TransitColor = (DWORD) value;
value = (DWORD )g_GetPrivateProfileDouble("initialization", "WalkingColor", -1, NEXTASettingsPath);
if(value<0)
m_WalkingColor = RGB(160,032,240);
else
m_WalkingColor = (DWORD) value;
value = (DWORD )g_GetPrivateProfileDouble("initialization", "BackgroundColor", -1, NEXTASettingsPath);
if(value<0)
m_BackgroundColor = RGB(255,255,255);
else
m_BackgroundColor = (DWORD) value;
value = (DWORD )g_GetPrivateProfileDouble("initialization", "NodeColor", -1, NEXTASettingsPath);
if(value<0)
m_NodeColor = RGB(0,0,0);
else
m_NodeColor = (DWORD) value;
value = (DWORD )g_GetPrivateProfileDouble("initialization", "NodeBrushColor", -1, NEXTASettingsPath);
if(value<0)
m_NodeBrushColor = RGB(0,0,0);
else
m_NodeBrushColor = (DWORD) value;
char lpbuffer[_MAX_PATH];
if(GetPrivateProfileString("initialization", "UserDefinedSimulator_32","",lpbuffer,sizeof(lpbuffer),NEXTASettingsPath))
{
m_SimulatorString_32.Format ("%s",lpbuffer);
}
if(GetPrivateProfileString("initialization", "UserDefinedSimulator_64","",lpbuffer,sizeof(lpbuffer),NEXTASettingsPath))
{
m_SimulatorString_64.Format ("%s",lpbuffer);
}
int visualization_template = (int)g_GetPrivateProfileDouble("template", "traffic_assignment", 1, NEXTASettingsPath);
m_VisulizationTemplate = e_traffic_assignment;
m_LanguageSupport = (eLanguageSupport)g_GetPrivateProfileInt("template", "LanguageSupport", 0, NEXTASettingsPath);
if( m_VisulizationTemplate == e_traffic_assignment)
{
if(m_LanguageSupport ==LANG_CN_SIMPLIFIED)
{
m_pDocTemplate2DView = new CMultiDocTemplate(IDR_TLiteTYPE5,
RUNTIME_CLASS(CTLiteDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTLiteView));
}else
{
m_pDocTemplate2DView = new CMultiDocTemplate(IDR_TLiteTYPE1,
RUNTIME_CLASS(CTLiteDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTLiteView));
}
}
if( m_VisulizationTemplate == e_train_scheduling)
{
m_pDocTemplate2DView = new CMultiDocTemplate(IDR_TLiteTYPE4,
RUNTIME_CLASS(CTLiteDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTLiteView));
}
if (!m_pDocTemplate2DView)
return FALSE;
AddDocTemplate(m_pDocTemplate2DView);
// add second Doc template for GLView
//The AddDocTemplate() call generated by AppWizard established the primary document/frame/view combination for the application that is effective
//when the program starts.
//The template object below is a secondary template that can be activated in response to the New GLView Window menu item.
m_pTemplateTimeTableView = new CMultiDocTemplate(
IDR_TLiteTYPE1,
RUNTIME_CLASS(CTLiteDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CTimeSpaceView));
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
{
delete pMainFrame;
return FALSE;
}
m_pMainWnd = pMainFrame;
// call DragAcceptFiles only if there's a suffix
// In an MDI app, this should occur immediately after setting m_pMainWnd
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
GetCurrentDirectory(MAX_PATH,pMainFrame->m_CurrentDirectory);
#ifndef _WIN64
pMainFrame->SetTitle ("NeXTA Version 3 Beta (32-bit)");
#else
pMainFrame->SetTitle ("NeXTA Version 3 Beta (64-bit)");
#endif
// The main window has been initialized, so show and update it
pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);
pMainFrame->UpdateWindow();
return TRUE;
}
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
// App command to run the dialog
void CTLiteApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
// CTLiteApp message handlers
void CTLiteApp::OnFileOpen()
{
static char BASED_CODE szFilter[] = "NEXTA Data Files (*.dws;*.tnp)|*.dws; *.tnp|DYNASMART Workspace Files (*.dws)|*.dws|Transportation Network Projects (*.tnp)|*.tnp|All Files (*.*)|*.*||";
CFileDialog dlg(TRUE, 0, 0, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT|OFN_ENABLESIZING , szFilter,NULL, 0, true);
CMainFrame* pMainFrame = (CMainFrame*) AfxGetMainWnd();
CString NetworkFile = pMainFrame->m_CurrentDirectory;
if(theApp.m_NEXTA_use_flag == 0)
{
dlg.m_ofn.lpstrInitialDir = NetworkFile;
theApp.m_NEXTA_use_flag = 1;
}else
{// elsewise use the last used folder
dlg.m_ofn.lpstrInitialDir = "";
}
if(dlg.DoModal() == IDOK)
{
CString PathName = dlg.GetPathName();
POSITION p = m_pDocManager->GetFirstDocTemplatePosition();
CDocTemplate* pTemplate = m_pDocManager->GetNextDocTemplate(p);
CTLiteDoc* pDoc = (CTLiteDoc*)pTemplate->OpenDocumentFile(0);
pDoc->m_bLoadNetworkDataOnly = m_bLoadNetworkOnly;
pDoc->OnOpenDocument(PathName, m_bLoadNetworkOnly);
}
}
void CTLiteApp::OnFileOpenNewDoc()
{
m_bLoadNetworkOnly = false;
OnFileOpen();
//reset back
}
int CTLiteApp::ExitInstance()
{
// Xuesong: potential memory leak
//if(m_pDocTemplate2DView!=NULL)
//delete m_pDocTemplate2DView;
//if(m_pTemplateTimeTableView!=NULL)
//delete m_pTemplateTimeTableView;
//collect memory
return CWinApp::ExitInstance();
}
void CTLiteApp::UpdateAllViews()
{
POSITION posTempl;
POSITION posDoc;
CMultiDocTemplate *pDocTempl;
CDocument *pDoc;
posTempl = GetFirstDocTemplatePosition();
while(posTempl != NULL)
{
pDocTempl = (CMultiDocTemplate *) GetNextDocTemplate(posTempl); // first TEMPLATE
posDoc = pDocTempl->GetFirstDocPosition();
while(posDoc != NULL)
{
pDoc = pDocTempl->GetNextDoc(posDoc);
pDoc->UpdateAllViews (0);
}
}
if(g_LinkMOEDlg && g_LinkMOEDlg ->GetSafeHwnd ())
{
g_LinkMOEDlg->Invalidate (true);
}
if(g_pPathMOEDlg && g_pPathMOEDlg ->GetSafeHwnd ())
{
g_pPathMOEDlg->InsertPathMOEItem();
g_pPathMOEDlg->Invalidate (true);
}
if( g_pLegendDlg!=NULL && g_pLegendDlg->GetSafeHwnd() && g_pLegendDlg->m_pDoc->m_LinkMOEMode == MOE_impact)
{
g_pLegendDlg->Invalidate (true);
}
}
void CTLiteApp::OnResearchtoolsExporttodtalitesensordataformat()
{
// TODO: Add your command handler code here
}
void CTLiteApp::OnFileOpenmultipletrafficdataprojects()
{
CFileDialog dlg(TRUE, 0, 0, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
_T("Project Index File(*.pif)|*.pif|"));
if(dlg.DoModal() == IDOK)
{
/* read project index
// for each project
// project type: resolution (macro, micro, micro-scopic)
// with/without real-world data
// with/without prediction
different layers of data (data framework)
{ import data to a new project
network
traffic control file
demand
scenario file (VMS, incident, ramp metering )
simulated data
observed data
detector sensor (multiple days)
AVI sensor (node to node, AVI)
corridor file (node to node file, )
probe sensor (local X) including NGSIM data
optional CSV files
demand
vehicle trajectory
signal data
}
multiple views
1) spatial 2d network
MOE view (color coded)
2) spatial 3d network
color coded + height (MOE (e.g. emissions)
3) time series
3.1 link MOE
(speed, travel time, density, flow, queue length)
3.2 network MOE
3.3 path
(fuel efficiency)
4) OD to path view
5) time-space view
data vs. simulated
point sensor, AVI, probe, estimated
6) quick summary of scenaro
impacted vehicels by scenarios
selected OD, selected path
AMS Tools
0) basic GIS viewing tools
view, zoom-in, zoom-out, add and delete links, input scenaro and demand data
1) exporting data for selected subarea
Synchro data
DYNASMART
DTALite
TRANSIMS
CORSIM
2) on-line GIS google fusion tables -> KML
3)
generate additional MOE
emissions
safety
reliability
4) dynamic OD demand estimation
5) generate capacity using quick analysis tables
6) communicate with data bus (upload and download dat from central data bus, communicate with simulation clock)
simulator warpper (call external excutable, exchange data with data bus)
{
DYNASMART
DTALite
TRANSIMS
}
7) scenario comparison
estimation vs. prediction
different resolutions
data vs. estimation results, faulty sensors, imcompartable
// end of each project
*/
POSITION p = m_pDocManager->GetFirstDocTemplatePosition();
CDocTemplate* pTemplate = m_pDocManager->GetNextDocTemplate(p);
CTLiteDoc* pDoc = (CTLiteDoc*)pTemplate->OpenDocumentFile(0);
pDoc->OnOpenDocument(dlg.GetPathName());
}
}
void CTLiteApp::OnAppExit()
{
exit(0);
}
void CTLiteApp::OnFileOpenNetworkOnly()
{
m_bLoadNetworkOnly = true;
OnFileOpen();
//reset back
m_bLoadNetworkOnly = false;}
void CTLiteApp::OnHelpUserguide()
{
g_OpenDocument("https://docs.google.com/document/d/14tUa1I6Xf62zsiWf4lLfngqGqGJlIM_MSehLFMVXass/edit", SW_SHOW);
}
void CTLiteApp::OnHelpChecklatestsoftwarerelease()
{
g_OpenDocument("http://code.google.com/p/nexta/downloads/list", SW_SHOW);
}
| 26.756661 | 191 | 0.716543 | OSADP |
4cb6bb1a8df280830bf45e94a50807501bdfce34 | 11,650 | cpp | C++ | src/matOptimize/transpose_vcf/transposed_vcf_to_fa.cpp | abschneider/usher | 2ebfe7013d69097427cce59585a3ee2edd98773b | [
"MIT"
] | 67 | 2020-09-18T23:10:37.000Z | 2022-02-02T17:58:19.000Z | src/matOptimize/transpose_vcf/transposed_vcf_to_fa.cpp | abschneider/usher | 2ebfe7013d69097427cce59585a3ee2edd98773b | [
"MIT"
] | 132 | 2020-09-21T03:11:29.000Z | 2022-03-31T23:19:14.000Z | src/matOptimize/transpose_vcf/transposed_vcf_to_fa.cpp | abschneider/usher | 2ebfe7013d69097427cce59585a3ee2edd98773b | [
"MIT"
] | 22 | 2020-09-18T20:28:21.000Z | 2022-03-24T12:17:33.000Z | #include "../mutation_annotated_tree.hpp"
#include "src/matOptimize/tree_rearrangement_internal.hpp"
#include "transpose_vcf.hpp"
#include <algorithm>
#include <boost/program_options.hpp>
#include <boost/program_options/value_semantic.hpp>
#include <climits>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <fstream>
#include <iostream>
#include <iterator>
#include <mutex>
#include <string>
#include <tbb/blocked_range.h>
#include <tbb/concurrent_vector.h>
#include <tbb/enumerable_thread_specific.h>
#include <tbb/parallel_for.h>
#include <tbb/pipeline.h>
#include <tbb/task_scheduler_init.h>
#include <unistd.h>
#include <unordered_map>
#include <utility>
#include <vector>
#include <zlib.h>
std::string chrom;
std::string ref;
struct Pos_Mut {
int position;
uint8_t mut;
Pos_Mut(int position, uint8_t mut) : position(position), mut(mut) {}
bool operator<(const Pos_Mut &other) const {
return position < other.position;
}
};
struct Sample_Pos_Mut {
std::string name;
std::vector<Pos_Mut> not_Ns;
std::vector<std::pair<int, int>> Ns;
Sample_Pos_Mut(std::string &&name) : name(std::move(name)) {}
};
struct Sample_Pos_Mut_Printer {
std::vector<Pos_Mut>::const_iterator not_Ns_iter;
const std::vector<Pos_Mut>::const_iterator not_Ns_end;
std::vector<std::pair<int, int>>::const_iterator Ns_iter;
const std::vector<std::pair<int, int>>::const_iterator Ns_end;
Sample_Pos_Mut_Printer(const Sample_Pos_Mut &in)
: not_Ns_iter(in.not_Ns.begin()), not_Ns_end(in.not_Ns.end()),
Ns_iter(in.Ns.begin()), Ns_end(in.Ns.end()) {}
int print(uint8_t *out) {
int end;
if (not_Ns_iter == not_Ns_end ||
(Ns_iter != Ns_end && Ns_iter->first < not_Ns_iter->position)) {
memset(out, 'N', Ns_iter->second - Ns_iter->first + 1);
end = Ns_iter->second;
Ns_iter++;
} else {
*out = Mutation_Annotated_Tree::get_nuc(not_Ns_iter->mut);
end = not_Ns_iter->position;
not_Ns_iter++;
}
assert(not_Ns_iter<=not_Ns_end&&Ns_iter<=Ns_end);
return end;
}
int next_pos() const {
auto next_pos=std::min(not_Ns_end == not_Ns_iter ? INT_MAX
: not_Ns_iter->position,
Ns_end == Ns_iter ? INT_MAX : Ns_iter->first);
assert(next_pos!=INT_MAX);
return (next_pos);
}
operator bool() const {
return (Ns_iter != Ns_end) || (not_Ns_iter != not_Ns_end);
}
};
struct Sample_Pos_Mut_Wrap {
Sample_Pos_Mut &content;
void add_Not_N(int position, uint8_t allele) {
content.not_Ns.emplace_back(position-1, allele);
}
void add_N(int first, int second) {
content.Ns.emplace_back(first-1, second-1);
}
};
typedef tbb::enumerable_thread_specific<std::vector<Sample_Pos_Mut>>
sample_pos_mut_local_t;
sample_pos_mut_local_t sample_pos_mut_local;
struct All_Sample_Appender {
Sample_Pos_Mut_Wrap set_name(std::string &&name) {
sample_pos_mut_local_t::reference my_sample_pos_mut_local =
sample_pos_mut_local.local();
my_sample_pos_mut_local.emplace_back(std::move(name));
return Sample_Pos_Mut_Wrap{my_sample_pos_mut_local.back()};
}
};
void load_reference(const char *ref_path, std::string &seq_name,
std::string &reference) {
std::ifstream fasta_f(ref_path);
std::string temp;
std::getline(fasta_f, temp);
seq_name = temp.substr(1, 50);
while (fasta_f) {
std::getline(fasta_f, temp);
reference += temp;
}
}
namespace po = boost::program_options;
size_t write_sample(uint8_t *out, const Sample_Pos_Mut &in,
const std::string &seq) {
out[0] = '>';
memcpy(out + 1, in.name.c_str(), in.name.size());
out[1 + in.name.size()] = '\n';
auto start_offset = 2 + in.name.size();
int last_print = 0;
Sample_Pos_Mut_Printer printer(in);
while (printer) {
auto next = printer.next_pos();
assert(next<seq.size());
auto ref_print_siz = next - last_print;
memcpy(out + last_print + start_offset, seq.data() + last_print,
ref_print_siz);
last_print = printer.print(out + next + start_offset) + 1;
assert(last_print<seq.size());
}
memcpy(out + last_print + start_offset, seq.data() + last_print,
seq.size() - last_print);
out[start_offset + seq.size()] = '\n';
return start_offset + seq.size() + 1;
}
#define OUT_BUF_SIZ 0x100000
struct Batch_Printer {
const std::vector<Sample_Pos_Mut> ∈
const std::string &seq;
const size_t inbuf_siz;
const int fd;
std::mutex& out_mutex;
mutable z_stream stream;
mutable uint8_t *inbuf;
mutable uint8_t *outbuf;
Batch_Printer(const std::vector<Sample_Pos_Mut> &in, const std::string &seq,
size_t inbuf_siz,int fd,std::mutex& out_mutex)
: in(in), seq(seq), inbuf_siz(inbuf_siz),fd(fd),out_mutex(out_mutex), inbuf(nullptr),
outbuf(nullptr) {
stream.opaque = nullptr;
stream.zalloc = nullptr;
stream.zfree = nullptr;
}
Batch_Printer(const Batch_Printer &other)
: in(other.in), seq(other.seq), inbuf_siz(other.inbuf_siz),fd(other.fd), out_mutex(other.out_mutex),inbuf(nullptr),
outbuf(nullptr) {
stream.opaque = nullptr;
stream.zalloc = nullptr;
stream.zfree = nullptr;
}
void init() const {
if (!inbuf) {
inbuf=(uint8_t*) malloc(inbuf_siz);
outbuf=(uint8_t*) malloc(OUT_BUF_SIZ);
//auto err =
deflateInit2(&stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
15 | 16, 9, Z_DEFAULT_STRATEGY);
//assert(err==Z_OK);
} else {
//auto err=
deflateReset(&stream);
//assert(err==Z_OK);
}
stream.avail_out=OUT_BUF_SIZ;
stream.next_out=outbuf;
}
void output()const {
if (stream.avail_out<OUT_BUF_SIZ/2) {
//auto err =
deflate(&stream, Z_FINISH);
//assert(err==Z_STREAM_END);
out_mutex.lock();
auto out=write(fd,outbuf,stream.next_out-outbuf);
if (out!=stream.next_out-outbuf) {
fprintf(stderr, "Couldn't output\n");
exit(EXIT_FAILURE);
}
out_mutex.unlock();
deflateReset(&stream);
stream.avail_out=OUT_BUF_SIZ;
stream.next_out=outbuf;
}
}
void operator()(tbb::blocked_range<size_t> range) const {
//fprintf(stderr, "%zu ",range.size());
init();
stream.avail_out = OUT_BUF_SIZ;
stream.next_out = outbuf;
for (size_t samp_idx = range.begin(); samp_idx < range.end();
samp_idx++) {
auto bytes_written=write_sample(inbuf, in[samp_idx], seq);
stream.next_in=inbuf;
stream.avail_in=bytes_written;
auto err = deflate(&stream, Z_NO_FLUSH);
assert(stream.avail_out);
if (err!=Z_OK) {
fprintf(stderr, "%d\n",err);
}
assert(err==Z_OK);
output();
}
//auto err =
deflate(&stream, Z_FINISH);
//assert(err==Z_STREAM_END);
out_mutex.lock();
auto written_bytes=write(fd, outbuf, stream.next_out-outbuf);
if (written_bytes!=stream.next_out-outbuf) {
fprintf(stderr, "Couldn't output\n");
exit(EXIT_FAILURE);
}
out_mutex.unlock();
}
~Batch_Printer() {
if (inbuf) {
free(inbuf);
free(outbuf);
deflateEnd(&stream);
}
}
};
int main(int argc, char **argv) {
po::options_description desc{"Options"};
uint32_t num_cores = tbb::task_scheduler_init::default_num_threads();
std::string output_fa_file;
std::string input_path;
std::string rename_file;
uint32_t num_threads;
std::string reference;
std::string num_threads_message = "Number of threads to use when possible "
"[DEFAULT uses all available cores, " +
std::to_string(num_cores) +
" detected on this machine]";
desc.add_options()(
"fa,o", po::value<std::string>(&output_fa_file)->required(),
"Output FASTA file (in uncompressed or gzip-compressed .gz format) ")(
"threads,T",
po::value<uint32_t>(&num_threads)->default_value(num_cores),
num_threads_message
.c_str())("reference,r",
po::value<std::string>(&reference)->required(),
"Reference file")("samples,s",
po::value<std::string>(&rename_file),
"rename file")("output_path,i",
po::value<std::string>(
&input_path)
->required(),
"Load transposed VCF");
po::options_description all_options;
all_options.add(desc);
po::variables_map vm;
try {
po::store(
po::command_line_parser(argc, argv).options(all_options).run(), vm);
po::notify(vm);
} catch (std::exception &e) {
std::cerr << desc << std::endl;
// Return with error code 1 unless the user specifies help
if (vm.count("help"))
return 0;
else
return 1;
}
std::unordered_map<std::string, std::string> rename_mapping;
if (rename_file != "") {
parse_rename_file(rename_file, rename_mapping);
}
tbb::task_scheduler_init init(num_threads);
load_reference(reference.c_str(), chrom, ref);
All_Sample_Appender appender;
load_mutations(input_path.c_str(), 80, appender);
std::vector<Sample_Pos_Mut> all_samples;
if (rename_mapping.empty()) {
for (auto &sample_block : sample_pos_mut_local) {
all_samples.insert(all_samples.end(),
std::make_move_iterator(sample_block.begin()),
std::make_move_iterator(sample_block.end()));
}
} else {
all_samples.reserve(rename_mapping.size());
for (auto &sample_block : sample_pos_mut_local) {
for (const auto &sample : sample_block) {
auto iter = rename_mapping.find(sample.name);
if (iter != rename_mapping.end()) {
all_samples.push_back(std::move(sample));
all_samples.back().name = iter->second;
rename_mapping.erase(iter);
}
}
sample_block.clear();
}
}
for (const auto &name : rename_mapping) {
fprintf(stderr, "sample %s not found \n", name.first.c_str());
}
size_t max_name_len=0;
for(const auto& samp:all_samples) {
max_name_len=std::max(max_name_len,samp.name.size());
}
auto inbuf_size=max_name_len+ref.size()+8;
auto out_fd=open(output_fa_file.c_str(),O_WRONLY|O_CREAT|O_TRUNC,S_IRWXU|S_IRWXG|S_IRWXO);
std::mutex f_mutex;
tbb::parallel_for(tbb::blocked_range<size_t>(0,all_samples.size(),all_samples.size()/num_threads), Batch_Printer{all_samples,ref,inbuf_size,out_fd,f_mutex});
close(out_fd);
}
| 36.984127 | 161 | 0.587039 | abschneider |
4cb793464cc29ff53929ee5a538f85ec609d9828 | 3,614 | cpp | C++ | src/cpp/event/PeriodicEventHandler.cpp | rockstarartist/DDS-Router | 245099e5e1be584e9d37e9b16648183ab383d727 | [
"Apache-2.0"
] | 1 | 2021-11-15T08:16:58.000Z | 2021-11-15T08:16:58.000Z | src/cpp/event/PeriodicEventHandler.cpp | rockstarartist/DDS-Router | 245099e5e1be584e9d37e9b16648183ab383d727 | [
"Apache-2.0"
] | 18 | 2021-08-30T09:19:30.000Z | 2021-11-16T07:17:38.000Z | src/cpp/event/PeriodicEventHandler.cpp | rockstarartist/DDS-Router | 245099e5e1be584e9d37e9b16648183ab383d727 | [
"Apache-2.0"
] | null | null | null | // Copyright 2021 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// 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.
/**
* @file PeriodicEventHandler.cpp
*
*/
#include <ddsrouter/types/Log.hpp>
#include <ddsrouter/event/PeriodicEventHandler.hpp>
#include <ddsrouter/exceptions/InitializationException.hpp>
namespace eprosima {
namespace ddsrouter {
namespace event {
PeriodicEventHandler::PeriodicEventHandler(
Duration_ms period_time)
: EventHandler<>()
, period_time_(period_time)
, timer_active_(false)
{
// In case period time is set to 0, the object is not created
if (period_time <= 0)
{
throw InitializationException("Periodic Event Handler could no be created with period time 0");
}
logDebug(
DDSROUTER_PERIODICHANDLER,
"Periodic Event Handler created with period time " << period_time_ << " .");
}
PeriodicEventHandler::PeriodicEventHandler(
std::function<void()> callback,
Duration_ms period_time)
: PeriodicEventHandler(period_time)
{
set_callback(callback);
}
PeriodicEventHandler::~PeriodicEventHandler()
{
unset_callback();
}
void PeriodicEventHandler::period_thread_routine_() noexcept
{
while (timer_active_.load())
{
std::unique_lock<std::mutex> lock(periodic_wait_mutex_);
// Wait for period time or awake if object has been disabled
wait_condition_variable_.wait_for(
lock,
std::chrono::milliseconds(period_time_),
[this]
{
// Exit if number of events is bigger than expected n
// or if callback is no longer set
return !timer_active_.load();
});
if (!timer_active_.load())
{
break;
}
event_occurred_();
}
}
void PeriodicEventHandler::start_period_thread_nts_() noexcept
{
{
std::unique_lock<std::mutex> lock(periodic_wait_mutex_);
timer_active_.store(true);
}
period_thread_ = std::thread(
&PeriodicEventHandler::period_thread_routine_, this);
logDebug(
DDSROUTER_PERIODICHANDLER,
"Periodic Event Handler thread starts with period time " << period_time_ << " .");
}
void PeriodicEventHandler::stop_period_thread_nts_() noexcept
{
// Set timer as inactive and awake thread so it stops
{
std::unique_lock<std::mutex> lock(periodic_wait_mutex_);
timer_active_.store(false);
}
periodic_wait_condition_variable_.notify_one();
// Wait for the periodic thread to finish as it will skip sleep due to the condition variable
period_thread_.join();
logDebug(
DDSROUTER_PERIODICHANDLER,
"Periodic Event Handler thread stops.");
}
void PeriodicEventHandler::callback_set_nts_() noexcept
{
if (!timer_active_)
{
start_period_thread_nts_();
}
}
void PeriodicEventHandler::callback_unset_nts_() noexcept
{
if (timer_active_)
{
stop_period_thread_nts_();
}
}
} /* namespace event */
} /* namespace ddsrouter */
} /* namespace eprosima */
| 26.573529 | 103 | 0.676259 | rockstarartist |
4cb7ca5381c511d77aceb7fa90f1be690b5aae74 | 586 | cpp | C++ | LeetCode/Solutions/LC0064.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 54 | 2019-05-13T12:13:09.000Z | 2022-02-27T02:59:00.000Z | LeetCode/Solutions/LC0064.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 2 | 2020-10-02T07:16:43.000Z | 2020-10-19T04:36:19.000Z | LeetCode/Solutions/LC0064.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 20 | 2020-05-26T09:48:13.000Z | 2022-03-18T15:18:27.000Z | /*
Problem Statement: https://leetcode.com/problems/minimum-path-sum/
*/
class Solution {
public:
int minPathSum(vector< vector<int> >& grid) {
int m, n;
m = grid.size();
n = grid[0].size();
int dp[m][n];
// base cases
dp[0][0] = grid[0][0];
for (int i = 1; i < m; i++)
dp[i][0] = grid[i][0] + dp[i - 1][0];
for (int i = 1; i < n; i++)
dp[0][i] = grid[0][i] + dp[0][i - 1];
// dynamic programming
for (int i = 1; i < m; i++)
for (int j = 1; j < n; j++)
dp[i][j] = grid[i][j] + min(dp[i - 1][j], dp[i][j - 1]);
return dp[m - 1][n - 1];
}
}; | 21.703704 | 66 | 0.481229 | Mohammed-Shoaib |
4cb9fbf799d1276b3e2e8c3c7446c741e780dcf1 | 7,204 | cpp | C++ | hash.cpp | grasslog/HashFile | e584a0920037ef80dd155142dc39b03e38071430 | [
"MIT"
] | 3 | 2019-08-28T14:59:21.000Z | 2019-09-11T20:01:21.000Z | hash.cpp | grasslog/HashFile | e584a0920037ef80dd155142dc39b03e38071430 | [
"MIT"
] | null | null | null | hash.cpp | grasslog/HashFile | e584a0920037ef80dd155142dc39b03e38071430 | [
"MIT"
] | 1 | 2022-01-03T07:21:59.000Z | 2022-01-03T07:21:59.000Z | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h> // access()
#include <string.h>
#include <string>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <regex>
#define HASH_FILE_PATH "/home/grasslog/tmp/IP/ip_data.dat"
#define HASH_GENERATION_PATH "/home/grasslog/tmp/hashfile"
#define BUFFER_SIZE 20
const int num = 100000000; // url number
const int TOP_URL_NUMBER = 100;
const int HASH_FILE_NUMBER = 1000;
node top_heap[TOP_URL_NUMBER];
bool is_top_heap = false;
unsigned int iton(char *ip);
void ntoi(unsigned int num, char *ip);
int fileexist(char *path); // judge file exit
void fclose_all(FILE **t); // close all files
int random_write(const char *path); // random generation url address
// calculate top IP address
void count(char *hashfile, unsigned int *data, unsigned int *num);
void sort(unsigned int *max, unsigned int *ip, int n); // sort url
inline unsigned int hash(unsigned int ip) // hash function
{ return (ip % HASH_FILE_NUMBER); }
void swap(node &a, node &b); // local swap struct node function
typedef struct node // storage struct node
{
std::string ip; // IP
unsigned int n; // occurrence number
node(std::string _ip, unsigned int _n):ip(_ip),n(_n) {}
node():ip(""),n(0) {}
}node;
// min root heap
void insert_heap(node *a, int n, int m);
void make_heap(node *a, int m);
int main(void)
{
FILE *in = NULL;
FILE *tmpfile[HASH_FILE_NUMBER];
const char *path = HASH_FILE_PATH;
char hashfile[HASH_FILE_NUMBER];
char buf[BUFFER_SIZE];
unsigned int add, data, n;
unsigned int ip[TOP_URL_NUMBER], max[TOP_URL_NUMBER]; // top 10 IP
unsigned int t1, t2, s, e; // record the time
int i, j, len, now; // IP number
node top_heap[TOP_URL_NUMBER];
bool is_top_heap = false;
printf("Generating data %s\n\n", path);
if (!random_write(path)) return 0; // random generation IP log file
// judge file exit, access() == 0 exit
if (access(HASH_GENERATION_PATH, 0) == 0)
system("rm -r HASH_GENERATION_PATH");
system("mkdir HASH_GENERATION_PATH"); // mkdir /home/grasslog/tmp/hashfile working drectory
//system("attrib +h /home/grasslog/tmp/hashfile");
in = fopen(path, "rt"); // open IP log file
if (in == NULL) return 0;
for (i=0; i<TOP_URL_NUMBER; i++) tmpfile[i] = NULL;
// make 1000000000 IP hash in 1005 small files
printf("\r hashing %s\n\n", "/home/grasslog/tmp/hashfile");
e = s = t1 = clock(); // start time
now = 0;
while (fscanf(in, "%s", buf) != EOF)
{
if(!is_IPAddress_valid(buf)) continue;
data = iton(buf); // IP digitization
add = hash(data); // math hash address
sprintf(hashfile, "/home/grasslog/tmp/hashfile/hashfile_%u.dat", add);
if (tmpfile[add] == NULL)
tmpfile[add] = fopen(hashfile, "a");
sprintf(buf, "%u\n", data);
len = strlen(buf);
// write IP in files, I/O just be the bottlenneck
fwrite(buf, len, 1, tmpfile[add]);
now++;
e = clock();
if (e - s > 1000) // calculate rate of progress
{
printf("\rProcessing progress %0.2f %%\t", (now * 100.0) / num);
s = e;
}
}
fclose(in);
fclose_all(tmpfile);
remove(path);
// calculate top IP in each small files
for (i=0; i<10; i++) max[i] = 0;
for (i=0; i<HASH_FILE_NUMBER; i++)
{
sprintf(hashfile, "/home/grasslog/tmp/hashfile/hashfile_%d.dat", i);
if (fileexist(hashfile))
{
printf("\rProcessing hashfile_%d.dat\t", i);
count(hashfile, &data, &n);
unsigned int min = 0xFFFFFFFF, pos;
for (j=0; j<10; j++)
{
if (max[j] < min)
{
min = max[j];
pos = j;
}
}
if (n > min)
{
max[pos] = n;
ip[pos] = data;
}
}
}
t2 = clock(); // end time
sort(max, ip, 10);
FILE *log = NULL; // record in /home/grasslog/tmp/hashfile/ip_result.txt
log = fopen("/home/grasslog/tmp/hashfile/ip_result.txt", "wt");
fprintf(log, "\ntop 10 IP:\n\n");
fprintf(log, " %-15s%s\n", "IP", "Visits");
printf("\n\ntop 10 IP:\n\n");
printf(" %-15s%s\n", "IP", "Visits");
for (i=0; i<10; i++)
{
ntoi(ip[i], buf); // decord
printf(" %-20s%u\n", buf, max[i]);
fprintf(log, " %-20s%u\n", buf, max[i]);
}
fprintf(log, "\n--- spent %0.3f second\n", (t2 - t1) / 1000.0);
printf("\n--- spent %0.3f second\n\n", (t2 - t1) / 1000.0);
fclose(log);
return 0;
}
void fclose_all(FILE **t) // close all files
{
int i;
for (i=0; i<TOP_URL_NUMBER; i++)
{
if (t[i])
{
fclose(t[i]);
t[i] = NULL;
}
}
}
// random generation url address
int random_write(const char *path)
{
FILE *out = NULL;
int i, j, b;
char buf[20];
char *cur;
unsigned int s, e;
out = fopen(path, "wt");
if (out == NULL) return 0;
srand(time(NULL));
e = s = clock();
for (i=0; i<num; i++)
{
e = clock();
if (e - s > 1000) // calculate rate of progress
{
printf("\rProcessing progress %0.2f %%\t", (i * 100.0) / num);
s = e;
}
for (j=0; j<BUFFER_SIZE; j++) buf[j] = '\0';
cur = buf;
for (j=0; j<4; j++)
{
b = rand() % 256;
sprintf(cur, "%d.", b);
while (*cur != '\0') cur++;
}
*(cur - 1) = '\n';
fwrite(buf, cur-(char *)buf, 1, out);
}
fclose(out); // close IO stream
return 1;
}
// calculate top IP in hashfile
void count(char *hashfile)
{
FILE *in = NULL;
std::string ip;
std::unordered_map<std::string,int> ump;
in = fopen(hashfile, "rt");
while(fscanf(in, "%s", &ip) != EOF)
{
ump[ip]++;
}
std::vector<node> vec_node;
typedef std::unordered_map<std::string,int>::iterator ump_iterator;
for(ump_iterator it=ump.begin(); it!=ump.end(); ++it)
{
node t(it->first,it->second);
vec_node.push_back(t);
}
fclose(in);
if(!is_top_heap)
{
is_top_heap = !is_top_heap;
memcpy(top_heap,&vec_node,sizeof(struct node)*TOP_URL_NUMBER);
make_heap(top_heap,TOP_URL_NUMBER);
for(int i=100; i<vec_node.size(); i++)
{
node t = vec_node[i];
int w = top_heap[0].n;
if(t.n > w)
{
swap(t,top_heap[0]); // local swap function
}
insert_heap(top_heap,0,TOP_URL_NUMBER);
}
}
else
{
for(int i=0; i<vec_node.size(); i++)
{
node t = vec_node[i];
int w = top_heap[0].n;
if(t.n > w)
{
swap(t, top_heap[0]);
}
insert_heap(top_heap,0,TOP_URL_NUMBER);
}
}
}
void insert_heap(node *heap, int n, int m)
{
node t = heap[n];
int w = t.n;
int i = n;
int j = 2 * i + 1;
while(j < m)
{
if(j+1<m && heap[j+1].n<heap[j].n)
++j;
if(heap[j].n < w)
heap[i] = heap[j];
else break;
i = j;
j = 2 * i + 1;
}
heap[j] = t;
}
void make_heap(node *heap, int m)
{
for(int i=m/2; i>=0; i--)
{
insert_heap(heap,i,m);
}
}
// judge file exist
int fileexist(char *path)
{
FILE *fp = NULL;
fp = fopen(path, "rt");
if (fp)
{
fclose(fp);
return 1;
}
else return 0;
}
// IP to int
unsigned int iton(char *ip)
{
unsigned int r = 0;
unsigned int t;
int i, j;
for (j=i=0; i<4; i++)
{
sscanf(ip + j, "%d", &t);
if (i < 3)
while (ip[j++] != '.');
r = r << 8;
r += t;
}
return r;
}
// bool url address legal
bool is_IPAddress_valid(const std::string& ipaddress)
{
const std::regex pattern("(\\d{1,3}).(\\d{1,3}).(\\d{1,3}).(\\d{1,3})");
std:: match_results<std::string::const_iterator> result;
bool valid = std::regex_match(ipaddress, result, pattern);
return valid;
} | 22.09816 | 94 | 0.605636 | grasslog |
4cbf1d8d76975a10680f733bfe3ee46c047394e4 | 5,382 | hh | C++ | netstar/port.hh | yxd886/seastar | 23792b7077e6c39aed2148ba3bf90c7de7c7295c | [
"Apache-2.0"
] | null | null | null | netstar/port.hh | yxd886/seastar | 23792b7077e6c39aed2148ba3bf90c7de7c7295c | [
"Apache-2.0"
] | null | null | null | netstar/port.hh | yxd886/seastar | 23792b7077e6c39aed2148ba3bf90c7de7c7295c | [
"Apache-2.0"
] | null | null | null | #ifndef _PORT_HH
#define _PORT_HH
#include <memory>
#include <experimental/optional>
#include "core/future.hh"
#include "core/stream.hh"
#include "core/circular_buffer.hh"
#include "core/semaphore.hh"
#include "core/queue.hh"
#include "netstar/qp_wrapper.hh"
using namespace seastar;
namespace netstar{
// A regular port. Applications can directly fetch
// and send packets from this port using the exposed
// public methods.
class port{
uint16_t _port_id;
qp_wrapper _qp_wrapper;
unsigned _failed_send_count;
circular_buffer<net::packet> _sendq;
std::unique_ptr<semaphore> _queue_space;
bool _receive_configured;
std::experimental::optional<subscription<net::packet>> _sub;
seastar::queue<net::packet> _receiveq;
public:
explicit port(boost::program_options::variables_map opts,
net::device* dev,
uint16_t port_id) :
_port_id(port_id),
_qp_wrapper(opts, dev, engine().cpu_id()),
_failed_send_count(0), _receive_configured(false),
_receiveq(100){
if(_qp_wrapper.get_qid() < _qp_wrapper.get_hw_queues_count()){
_qp_wrapper.register_packet_provider([this](){
std::experimental::optional<net::packet> p;
if (!_sendq.empty()) {
p = std::move(_sendq.front());
_sendq.pop_front();
}
return p;
});
}
_queue_space = std::make_unique<semaphore>(212992);
}
~port(){
// Extend the life time of _queue_space.
// When port is deconstructed, both _sendq and _qp contain some packets with a customized deletor like this:
// [qs = _queue_space.get(), len] { qs->signal(len); }.
// These packets will also be deconstructed when deconstructing the port.
// Therefore we must ensure that _queue_space lives until the port is completely deconstructed.
// What we have done here is to move the _queue_space into a fifo, that will be called later after the port.
// Because the we use per_core_objs to construct the port, the port is actually placed in a position that
// is closer to the head of the fifo. So we guarantee that _queue_space lives until port is fully deconstructed.
// However, we do have to ensure that the port is constructed only by per_core_objs, otherwise this hack
// doesn't work and abort seastar exit processs.
// BTW: This hack saves about 100000pkts/s send rate, which I think to be important.
engine().at_destroy([queue_space_sptr = std::move(_queue_space)]{});
}
// port can only be constructed by per_core_objs,
// so all the copy and move constructors/assignments are deleted
port(const port& other) = delete;
port(port&& other) = delete;
port& operator=(const port& other) = delete;
port& operator=(port&& other) = delete;
// stop() has to be added so that port can be
// constructed by per_core_objs.
future<> stop(){
return make_ready_future<>();
}
public:
// Send the packet out.
// Assert that we are sending out from correct qp type.
// Need to wait for enough space in the _queue_space.
inline future<> send(net::packet p){
assert(_qp_wrapper.get_qid()<_qp_wrapper.get_hw_queues_count());
auto len = p.len();
return _queue_space->wait(len).then([this, len, p = std::move(p)] () mutable {
p = net::packet(std::move(p), make_deleter([qs = _queue_space.get(), len] { qs->signal(len); }));
_sendq.push_back(std::move(p));
});
}
// Lineraize the packet and then send the packet out.
// This is primarily used by mica_client.
inline future<> linearize_and_send(net::packet p){
assert(_qp_wrapper.get_qid()<_qp_wrapper.get_hw_queues_count());
auto len = p.len();
return _queue_space->wait(len).then([this, len, p = std::move(p)] () mutable {
p = net::packet(std::move(p), make_deleter([qs = _queue_space.get(), len] { qs->signal(len); }));
p.linearize();
_sendq.push_back(std::move(p));
});
}
// Provide a customized receive function for the underlying qp.
subscription<net::packet>
receive(std::function<future<> (net::packet)> next_packet) {
assert(!_receive_configured);
_receive_configured = true;
return _qp_wrapper.receive(std::move(next_packet));
}
// Expose qp_wrapper. Some functionality in netstar
// requires to access the public methods exposed by qp_wrapper
qp_wrapper& get_qp_wrapper(){
return _qp_wrapper;
}
public:
// Enable on_new_pkt() function. Once this is called
// on_new_pkt() will return a future that is going to
// be eventually resolved. Otherwise, the future returned
// by on_new_pkt will never be resolved.
void enable_on_new_pkt(){
assert(!_receive_configured);
_receive_configured = true;
_sub.emplace(
_qp_wrapper.receive([this](net::packet pkt){
_receiveq.push(std::move(pkt));
return make_ready_future<>();
})
);
}
future<net::packet> on_new_pkt(){
return _receiveq.pop_eventually();
}
};
} // namespace netstar
#endif // _PORT_REFACTOR_HH
| 37.636364 | 120 | 0.639911 | yxd886 |
4cc030fb1d143f231a2144a35c6ea53f9aa46167 | 362 | cpp | C++ | POO/Exercitii_examen/Exercitii/038.cpp | andrei-micuda/teme-fmi | d31c032c45e0e910d75fc05faab3681d421aac7c | [
"MIT"
] | 1 | 2020-06-07T09:45:17.000Z | 2020-06-07T09:45:17.000Z | POO/Exercitii_examen/Exercitii/038.cpp | micu01/teme-fmi | d31c032c45e0e910d75fc05faab3681d421aac7c | [
"MIT"
] | null | null | null | POO/Exercitii_examen/Exercitii/038.cpp | micu01/teme-fmi | d31c032c45e0e910d75fc05faab3681d421aac7c | [
"MIT"
] | 2 | 2020-04-09T19:27:36.000Z | 2020-06-28T17:45:14.000Z | #include<iostream>
using namespace std;
template<class X, class Y>
X f(X x, Y y)
{
// x si y sunt pointeri si nu ii poti aduna
return x+y;
}
int *f(int *x,int y)
{
return x-y;
}
int main()
{
int *a=new int(200), *b=a; // o solutie poate fi sa il facem pe b int
cout<<a+b<<"\n"; // nu se pot aduna 2 pointeri
cout<<*f(a,b);
return 0;
} | 19.052632 | 73 | 0.582873 | andrei-micuda |
4cc1366aad4b0ffcf6344293f4343c7ec8545722 | 219 | cpp | C++ | compiler-rt/test/sanitizer_common/TestCases/NetBSD/uid_from_user.cpp | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | compiler-rt/test/sanitizer_common/TestCases/NetBSD/uid_from_user.cpp | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | compiler-rt/test/sanitizer_common/TestCases/NetBSD/uid_from_user.cpp | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | // RUN: %clangxx -O0 -g %s -o %t && %run %t
#include <pwd.h>
#include <stdlib.h>
int main(void) {
uid_t nobody;
if (uid_from_user("nobody", &nobody) == -1)
exit(1);
if (nobody)
exit(0);
return 0;
}
| 12.882353 | 45 | 0.547945 | medismailben |
4cc172bcf8fda07b80f44d708011859e28dac03d | 3,615 | cpp | C++ | source/fir/Types/UnionType.cpp | zhiayang/flax | a7ead8ad3ff4ea377297495751bd4802f809547b | [
"Apache-2.0"
] | 1 | 2021-02-07T08:42:06.000Z | 2021-02-07T08:42:06.000Z | source/fir/Types/UnionType.cpp | zhiayang/flax | a7ead8ad3ff4ea377297495751bd4802f809547b | [
"Apache-2.0"
] | null | null | null | source/fir/Types/UnionType.cpp | zhiayang/flax | a7ead8ad3ff4ea377297495751bd4802f809547b | [
"Apache-2.0"
] | null | null | null | // UnionType.cpp
// Copyright (c) 2014 - 2016, zhiayang@gmail.com
// Licensed under the Apache License Version 2.0.
#include "errors.h"
#include "ir/type.h"
#include "pts.h"
namespace fir
{
// structs
UnionType::UnionType(const Identifier& name, const std::unordered_map<std::string, std::pair<size_t, Type*>>& mems)
: Type(TypeKind::Union)
{
this->unionName = name;
this->setBody(mems);
}
static std::unordered_map<Identifier, UnionType*> typeCache;
UnionType* UnionType::create(const Identifier& name, const std::unordered_map<std::string, std::pair<size_t, Type*>>& mems)
{
if(auto it = typeCache.find(name); it != typeCache.end())
error("Union with name '%s' already exists", name.str());
else
return (typeCache[name] = new UnionType(name, mems));
}
UnionType* UnionType::createWithoutBody(const Identifier& name)
{
return UnionType::create(name, { });
}
// various
std::string UnionType::str()
{
return "union(" + this->unionName.name + ")";
}
std::string UnionType::encodedStr()
{
return this->unionName.str();
}
bool UnionType::isTypeEqual(Type* other)
{
if(other->kind != TypeKind::Union)
return false;
return (this->unionName == other->toUnionType()->unionName);
}
// struct stuff
Identifier UnionType::getTypeName()
{
return this->unionName;
}
size_t UnionType::getVariantCount()
{
return this->variants.size();
}
size_t UnionType::getIdOfVariant(const std::string& name)
{
if(auto it = this->variants.find(name); it != this->variants.end())
return it->second->variantId;
else
error("no variant with name '%s'", name);
}
std::unordered_map<std::string, UnionVariantType*> UnionType::getVariants()
{
return this->variants;
}
bool UnionType::hasVariant(const std::string& name)
{
return this->variants.find(name) != this->variants.end();
}
UnionVariantType* UnionType::getVariant(size_t id)
{
if(auto it = this->indexMap.find(id); it != this->indexMap.end())
return it->second;
else
error("no variant with id %d", id);
}
UnionVariantType* UnionType::getVariant(const std::string& name)
{
if(auto it = this->variants.find(name); it != this->variants.end())
return it->second;
else
error("no variant named '%s' in union '%s'", name, this->getTypeName().str());
}
void UnionType::setBody(const std::unordered_map<std::string, std::pair<size_t, Type*>>& members)
{
for(const auto& [ n, p ] : members)
{
auto uvt = new UnionVariantType(this, p.first, n, p.second);
this->variants[n] = uvt;
this->indexMap[p.first] = uvt;
}
}
fir::Type* UnionType::substitutePlaceholders(const std::unordered_map<Type*, Type*>& subst)
{
if(this->containsPlaceholders())
error("not supported!");
return this;
}
std::string UnionVariantType::str()
{
return this->parent->str() + "." + this->name;
}
std::string UnionVariantType::encodedStr()
{
return this->parent->encodedStr() + "." + this->name;
}
bool UnionVariantType::isTypeEqual(Type* other)
{
if(auto uvt = dcast(UnionVariantType, other))
return uvt->parent == this->parent && uvt->name == this->name;
return false;
}
fir::Type* UnionVariantType::substitutePlaceholders(const std::unordered_map<fir::Type*, fir::Type*>& subst)
{
if(this->containsPlaceholders())
error("not supported!");
return this;
}
UnionVariantType::UnionVariantType(UnionType* p, size_t id, const std::string& name, Type* actual) : Type(TypeKind::UnionVariant)
{
this->parent = p;
this->name = name;
this->variantId = id;
this->interiorType = actual;
}
}
| 18.634021 | 130 | 0.665007 | zhiayang |
4cc37a5ce2af03fd72be7c3592df653c4bb64e34 | 3,424 | cpp | C++ | src/LSSS/Schur_Matrices.cpp | karannewatia/SCALE-MAMBA | 467b33a6c80050789204ea3ee3b5cf0113354f85 | [
"BSD-2-Clause"
] | 196 | 2018-05-25T11:41:56.000Z | 2022-03-12T05:49:50.000Z | src/LSSS/Schur_Matrices.cpp | karannewatia/SCALE-MAMBA | 467b33a6c80050789204ea3ee3b5cf0113354f85 | [
"BSD-2-Clause"
] | 49 | 2018-07-17T15:49:41.000Z | 2021-01-19T11:35:31.000Z | src/LSSS/Schur_Matrices.cpp | karannewatia/SCALE-MAMBA | 467b33a6c80050789204ea3ee3b5cf0113354f85 | [
"BSD-2-Clause"
] | 90 | 2018-05-25T11:41:42.000Z | 2022-03-23T19:15:10.000Z | /*
Copyright (c) 2017, The University of Bristol, Senate House, Tyndall Avenue, Bristol, BS8 1TH, United Kingdom.
Copyright (c) 2021, COSIC-KU Leuven, Kasteelpark Arenberg 10, bus 2452, B-3001 Leuven-Heverlee, Belgium.
All rights reserved
*/
#include "Schur_Matrices.h"
template<class T>
ostream &operator<<(ostream &s, const Schur_Matrices<T> &S)
{
s << S.Schur.size() << endl;
for (unsigned int i= 0; i < S.Schur.size(); i++)
{
s << S.Schur[i] << endl;
s << S.iSchur[i] << endl;
}
return s;
}
template<class T>
istream &operator>>(istream &s, Schur_Matrices<T> &S)
{
unsigned int np;
s >> np;
S.Schur.resize(np);
S.iSchur.resize(np);
for (unsigned int j= 0; j < np; j++)
{
s >> S.Schur[j] >> S.iSchur[j];
}
return s;
}
template<class T>
void tensor(vector<T> &z, const vector<T> &x, const vector<T> &y)
{
for (unsigned int i= 0; i < x.size(); i++)
{
for (unsigned int j= 0; j < x.size(); j++)
{
z[i * y.size() + j].mul(x[i], y[j]);
}
}
}
template<class T>
bool Schur_Matrices<T>::initialize(const MSP<T> &M)
{
unsigned int cws= 0, k= M.col_dim();
for (unsigned int i= 0; i < M.nplayers(); i++)
{
cws+= M.shares_per_player(i) * M.shares_per_player(i);
}
// First form the matrix of Tensor's of each parties share vectors
vector<vector<T>> TT(k * k, vector<T>(cws + 1));
vector<T> zz(k * k);
int Tc= 0, Gr= 0;
for (unsigned int i= 0; i < M.nplayers(); i++)
{
for (unsigned int j0= 0; j0 < M.shares_per_player(i); j0++)
{
for (unsigned int j1= 0; j1 < M.shares_per_player(i); j1++)
{
tensor(zz, M.G(Gr + j0), M.G(Gr + j1));
for (unsigned int t= 0; t < k * k; t++)
{
TT[t][Tc]= zz[t];
}
Tc++;
}
}
Gr+= M.shares_per_player(i);
}
// Add in the target vector
for (unsigned int i= 0; i < TT.size(); i++)
{
TT[i][cws].assign_one();
}
// If not a solution then MSP is not multiplicative
bool result= Solvable(TT);
if (result == false)
{
return false;
}
/* Now back substitute to get how to express the reconstruction
* vector in terms of the tensors */
vector<T> z(TT[0].size() - 1);
BackSubst(z, TT);
Schur.resize(M.nplayers());
iSchur.resize(M.nplayers());
Tc= 0;
for (unsigned int i= 0; i < M.nplayers(); i++)
{
Schur[i].resize(M.shares_per_player(i),
vector<T>(M.shares_per_player(i)));
iSchur[i].resize(M.shares_per_player(i),
vector<int>(M.shares_per_player(i)));
for (unsigned int j0= 0; j0 < Schur[i].size(); j0++)
{
for (unsigned int j1= 0; j1 < Schur[i].size(); j1++)
{
Schur[i][j0][j1]= z[Tc];
iSchur[i][j0][j1]= 0;
if (!z[Tc].is_zero())
{
iSchur[i][j0][j1]= 1;
}
Tc++;
}
}
}
return true;
}
template class Schur_Matrices<gfp>;
template class Schur_Matrices<gf2>;
template istream &operator>>(istream &s, Schur_Matrices<gfp> &M);
template istream &operator>>(istream &s, Schur_Matrices<gf2> &M);
template ostream &operator<<(ostream &s, const Schur_Matrices<gfp> &M);
template ostream &operator<<(ostream &s, const Schur_Matrices<gf2> &M);
| 26.542636 | 110 | 0.539428 | karannewatia |
4cc6d8d77fb76a8f2098c58bd1faa240ff981ee2 | 333 | hpp | C++ | example/include/my_components.hpp | wtfsystems/wtengine | 0fb56d6eb2ac6359509e7a52876c8656da6b3ce0 | [
"MIT"
] | 7 | 2020-06-16T18:47:35.000Z | 2021-08-25T13:41:13.000Z | example/include/my_components.hpp | wtfsystems/wtengine | 0fb56d6eb2ac6359509e7a52876c8656da6b3ce0 | [
"MIT"
] | 15 | 2020-07-23T14:03:39.000Z | 2022-01-28T02:32:07.000Z | example/include/my_components.hpp | wtfsystems/wtengine | 0fb56d6eb2ac6359509e7a52876c8656da6b3ce0 | [
"MIT"
] | null | null | null | /*
* WTEngine Demo
* By: Matthew Evans
* File: my_components.hpp
*
* See LICENSE.txt for copyright information
*
* Include all custom components here.
*/
#ifndef MY_COMPONENTS_HPP
#define MY_COMPONENTS_HPP
#include "damage.hpp"
#include "energy.hpp"
#include "health.hpp"
#include "size.hpp"
#include "stars.hpp"
#endif
| 15.857143 | 44 | 0.720721 | wtfsystems |
4cc7b5ebae3b2887407e1c7365e42cefabdf25f6 | 13,970 | cpp | C++ | src/bckp/08-12/a/waves.cpp | antocreo/BYO_Master | d92e049f10775d99fc6ef8aab7093c923142e664 | [
"MIT"
] | null | null | null | src/bckp/08-12/a/waves.cpp | antocreo/BYO_Master | d92e049f10775d99fc6ef8aab7093c923142e664 | [
"MIT"
] | 1 | 2017-02-12T15:28:29.000Z | 2017-02-23T10:34:04.000Z | src/bckp/08-12/a/waves.cpp | antocreo/BYO_Master | d92e049f10775d99fc6ef8aab7093c923142e664 | [
"MIT"
] | null | null | null | //
// Mfcc_obj.cpp
// OculusRenderingBasic
//
// Created by Let it Brain on 28/03/2015.
//
//
#include "Mfcc_obj.h"
#include "maximilian.h"/* include the lib */
#include "time.h"
//-------------------------------------------------------------
Mfcc_obj::Mfcc_obj() {
}
//-------------------------------------------------------------
Mfcc_obj::~Mfcc_obj() {
}
//--------------------------------------------------------------
void Mfcc_obj::setup(){
/* some standard setup stuff*/
// ofEnableAlphaBlending();
// ofSetupScreen();
// ofBackground(0, 0, 0);
// ofSetFrameRate(60);
// ofSetVerticalSync(true);
/* This is stuff you always need.*/
sampleRate = 44100; /* Sampling Rate */
initialBufferSize = 512; /* Buffer Size. you have to fill this buffer with sound*/
lAudioOut = new float[initialBufferSize];/* outputs */
rAudioOut = new float[initialBufferSize];
lAudioIn = new float[initialBufferSize];/* inputs */
rAudioIn = new float[initialBufferSize];
/* This is a nice safe piece of code */
memset(lAudioOut, 0, initialBufferSize * sizeof(float));
memset(rAudioOut, 0, initialBufferSize * sizeof(float));
memset(lAudioIn, 0, initialBufferSize * sizeof(float));
memset(rAudioIn, 0, initialBufferSize * sizeof(float));
fftSize = 1024;
mfft.setup(fftSize, 512, 256);
ifft.setup(fftSize, 512, 256);
nAverages = 13;
oct.setup(sampleRate, fftSize/2, nAverages);
mfccs = (double*) malloc(sizeof(double) * nAverages);
vowel = (double*) malloc(sizeof(double) * nAverages);
mfcc.setup(512, 56, nAverages, 20, 20000, sampleRate);
ofxMaxiSettings::setup(sampleRate, 2, initialBufferSize);
// ofSoundStreamSetup(2,2, this, sampleRate, initialBufferSize, 4);/* Call this last ! *///this is the original one contains "this" that is not accepted here.... why???
//i repleaced it with this line.
ofSoundStreamSetup(2,2, sampleRate, initialBufferSize, 4);/* Call this last ! */
//
mousePos.set(ofGetMouseX(), ofGetMouseY());
//setting boolean all to false
recording, recordingEnded = false;
recordingA,recordingE,recordingI,recordingO,recordingU =false;
//GL
glEnable(GL_DEPTH_TEST);
glEnable(GL_NORMALIZE);
ofVec3f dummyPos(0,0,0);
for (int i=0; i<nAverages; i++) {
mesh.addVertex(dummyPos);
mesh2.addVertex(dummyPos);
}
// strip.getMesh() = meshWarped;
// = ofMesh::sphere(200,300);
centroid2 = mesh2.getCentroid();
centroid1 = mesh.getCentroid();
}
//--------------------------------------------------------------
void Mfcc_obj::update(){
for (int i=0; i<meshPoints.size(); i++) {
if (mfccs[0]>1.2 ) {
//this is the displacement factor vector that I will multiply on the original vector strip.getMesh.getVert
displacementVec.set(mfccs[i+0], mfccs[i+1], mfccs[i+2]);
//once I get the displacement vec I need to multiply (getCrossed) with the original vector.getMesh.getVert
ofVec3f rmsvec(rms,rms,rms);
meshPoints[i] = (meshPoints[i] + displacementVec + rms);
// meshPoints[i] += displacementVec.getCrossed(rmsvec);
// meshPoints[i] = meshPoints[i] + mesh.getVertex(i);
// meshPoints[i] = meshPoints[i].interpolate((meshPoints[i].getCrossed(displacementVec)),1);
newCentr1 = centroid1;
newCentr2 = centroid2;
} else {
meshPoints[i] = originalMesh[i];
}
}
}
//--------------------------------------------------------------
void Mfcc_obj::draw(){
//grid
// ofPushStyle();
// ofSetColor(100, 0, 0,100);
// ofDrawGrid(ofGetHeight(), 50.0f, false, false, false, true);
// ofPopStyle();
//end grid
//show bitmap info
// bitmapInfo();
// draw MFcc bar chart
// drawMfccBars( 10, 100);
// draw RMS
// drawRms(10, 50);
/*---------------------------*/
//polygon and centroid
if (mfccs[0]>1.2) {
distancentroids1 = centroid1.distance(newCentr1);
distancentroids2 = centroid2.distance(newCentr2);
// doodle lines
ofPushStyle();
ofNoFill();
ofPushMatrix();
mesh.setMode(OF_PRIMITIVE_LINE_LOOP);
ofTranslate(ofGetWidth()/2, ofGetHeight()/2);
int scaleFactor = 50;
for (int i=0; i<nAverages; i++) {
mesh.addVertex(ofVec2f(mfccs[i+1]*scaleFactor,mfccs[i]*scaleFactor));
mesh.addColor(255);
}
mesh.draw();
//centroid
centroid1 = mesh.getCentroid();
ofDrawBitmapStringHighlight("centroid1 - " + ofToString( centroid1 ), 100,70);
ofSetColor(255,0,0);
ofCircle(centroid1.x, centroid1.y, mfccs[0]*2);
mesh.clear();
ofPopMatrix();
ofPopStyle();
/*---------------------------*/
//graph
ofPushStyle();
ofPushMatrix();
// mesh2.setMode(OF_PRIMITIVE_LINE_LOOP);
// mesh2.setMode(OF_PRIMITIVE_TRIANGLE_STRIP );
mesh2.setMode(OF_PRIMITIVE_TRIANGLE_FAN );
ofTranslate(0, ofGetHeight()/2-100);
int scaleFactor2 = 30;
for (int i=0; i<nAverages; i++) {
mesh2.addVertex(ofVec2f(mfccs[0]*scaleFactor2*i,mfccs[i]*scaleFactor2));
mesh2.addColor(255);
}
// mesh2.addVertex(ofVec2f(mfccs[nAverages]*scaleFactor2,mfccs[0]*scaleFactor2*nAverages));
mesh2.draw();
//centroid
centroid2 = mesh2.getCentroid();
ofDrawBitmapStringHighlight("centroid2 - " + ofToString( centroid2 ), 100,70);
ofSetColor(255,0,0);
ofSetCircleResolution(100);
ofCircle(centroid2.x, centroid2.y, mfccs[0]*scaleFactor/4);
mesh2.clear();
ofPopMatrix();
ofPopStyle();
}
/*---------------------------*/
glEnable(GL_DEPTH_TEST);
for(int i = 0; i < meshPoints.size(); i++){
ofDrawBitmapStringHighlight(ofToString( meshPoints.size() ), 10,50);
ofDrawBitmapStringHighlight(ofToString( sizeof(mfccs) ), 10,80);
ofDrawBitmapStringHighlight(ofToString( ofToString( mfccs[i] ) ), 10,110);
ofDrawBitmapStringHighlight(ofToString( ofToString( displacementVec ) ), 10, 140);
ofDrawBitmapStringHighlight(ofToString( ofToString( mesh.getNumVertices() ) ), 10, 160);
glDisable(GL_DEPTH_TEST);
strip.generate(meshPoints, 5+mfccs[i%nAverages], ofPoint (0,0.5,0.5) );
float colorvoice = 100*(meshPoints.size()%255 * mfccs[i%nAverages]);
ofSetColor(200, 0,0 );
// ofQuaternion orientation(90, 0, 0, 0);
// cam.setOrientation(orientation);
// cam.setTarget(meshPoints[i]);
// cam.setPosition(cam.worldToScreen(meshPoints[i]));
}
// cam.begin();
strip.getMesh().draw();
// cam.end();
}
//--------------------------------------------------------------
void Mfcc_obj::audioRequested (float * output, int bufferSize, int nChannels){
// static double tm;
for (int i = 0; i < bufferSize; i++){
wave = lAudioIn[i];
//get fft
if (mfft.process(wave)) {
mfcc.mfcc(mfft.magnitudes, mfccs);
//cout << mfft.spectralFlatness() << ", " << mfft.spectralCentroid() << endl;
}
}
getVowel();
}
//--------------------------------------------------------------
void Mfcc_obj::audioReceived (float * input, int bufferSize, int nChannels){
//rms
// calculate a rough volume
/* You can just grab this input and stick it in a double, then use it above to create output*/
for (int i = 0; i < bufferSize; i++){
/* you can also grab the data out of the arrays*/
lAudioIn[i] = input[i*2];
rAudioIn[i] = input[i*2+1];
// cout << lAudioIn[i] << endl;
rms =sqrt( (lAudioIn[i]*lAudioIn[i])+(lAudioIn[i]*lAudioIn[i])/bufferSize );
// cout << rms << endl;
}
}
//--------------------------------------------------------------
void Mfcc_obj::getRms(){
// alternative code
rms = 0.0;
int numCounted = 0;
for (int i = 0; i < initialBufferSize; i++){
float leftSample = lAudioIn[i] * 0.5;
float rightSample = rAudioIn[i] * 0.5;
rms += leftSample * leftSample;
rms += rightSample * rightSample;
numCounted += 2;
}
rms /= (float)numCounted;
rms = sqrt(rms);
// rms is now calculated
}
//--------------------------------------------------------------
void Mfcc_obj::getVowel(){
//checking that the coeff[0] > 0 and therefore there is someone speaking
//until there is voice assign the values of mfcc to vowel
for (int i=0; i<nAverages; i++) {
if (mfccs[0]>=1.2) {
vowel[i]=mfccs[i];
storing.push_back(mfccs[i]);
// vowel.push_back(mfccs[i]);
}
}
}
//--------------------------------------------------------------
void Mfcc_obj::drawMfccBars( float x, float y){
ofPushMatrix();
ofTranslate( x, y);
// cout << "\nMFCCS: ";
ofSetColor(255, 0, 0,100);
float xinc = 900.0 / nAverages;
for(int i=0; i < nAverages; i++) {
float height = mfccs[i]*250;
height = ofClamp(height, 0, 250);
ofRect(10 + (i*xinc),600 - height,40, height);
// cout << mfccs[i] << ",";
if (vowel[0]>1) {
// ofRect(ofGetWidth()/2, ofGetHeight()/2, 100, 100);
}
}
// cout << "\n-------" << endl;
// cout << callTime << endl;
ofPopMatrix();
}
//--------------------------------------------------------------
void Mfcc_obj::drawRms(float x, float y){
// rms peak
for(int i=0; i < initialBufferSize; i++) {
ofRect(x, y, rms*1000.0f, 100);
}
}
//--------------------------------------------------------------
void Mfcc_obj::bitmapInfo(){
/// bitmap info
ofPushStyle();
for(int i=0; i < nAverages; i++) {
ofDrawBitmapStringHighlight("rms " + ofToString( rms ),10,30);
ofDrawBitmapStringHighlight("mfcc elem [" +ofToString(i) +"] " + ofToString( mfccs[i] ),300,50+20*i);
// ofDrawBitmapStringHighlight("vowel elem [" +ofToString(i) +"] " + ofToString( vowel[i] ),10,50+20*i);
// if (storing.size()>0) {
// ofDrawBitmapStringHighlight("storing elem [" +ofToString(i) +"] " + ofToString( storing[i] ),10,50+20*i);
// ofDrawBitmapStringHighlight("storing size" + ofToString(storing.size()),10,50+20*i+20);
// }
if (mfccComponent.size()>0) {
ofDrawBitmapStringHighlight("component elem [" +ofToString(i) +"] " + ofToString( mfccComponent[i] ),10,50+20*i);
ofDrawBitmapStringHighlight("component size" + ofToString(mfccComponent.size()),10,50+20*i+20);
}
}
ofPopStyle();
}
//--------------------------------------------------------------
void Mfcc_obj::tempStorage(vector<double> tempVec){
}
//--------------------------------------------------------------
void Mfcc_obj::keyPressed(int key){
if (key == ' ') {
recording = ! recording;
if (recording==true) {
}
}
if (key ==OF_KEY_BACKSPACE) {
meshPoints.clear();
polyMesh.clear();
}
}
//--------------------------------------------------------------
void Mfcc_obj::keyReleased(int key){
}
//--------------------------------------------------------------
void Mfcc_obj::mouseMoved(int x, int y ){
ofVec3f mouseP(x,y);
if (x>1 && y >1) {
meshPoints.push_back(mouseP);
originalMesh = meshPoints;
}
}
//--------------------------------------------------------------
void Mfcc_obj::mouseDragged(int x, int y, int button){
// ofVec3f mouseP(x,y);
// if (x>1 && y >1) {
// meshPoints.push_back(mouseP);
// originalMesh = meshPoints;
//
//
// }
}
//--------------------------------------------------------------
void Mfcc_obj::mousePressed(int x, int y, int button){
}
//--------------------------------------------------------------
void Mfcc_obj::mouseReleased(int x, int y, int button){
}
//--------------------------------------------------------------
void Mfcc_obj::windowResized(int w, int h){
}
//--------------------------------------------------------------
void Mfcc_obj::eucliDistanc(){
/*euclidean distance
the first value of the mfcc od actually the pwer of the voice. if I say that mfcc[0]< some value (i need to map it) the I can start detecting the single value)
*/
// for(int i=0; i < nAverages; i++) {
// eucliDist = sqrt(mfcc[i] )
//
// }
}
| 26.358491 | 175 | 0.475734 | antocreo |
4cc7f3eb8d7ef3b806956583b7acec23cb238b21 | 2,133 | cpp | C++ | CmdPacketDownload.cpp | lotusczp/XcpMaster | 47cf2df7e111e823525347faf1cc6cbca6ec3c5d | [
"MIT"
] | 1 | 2021-09-04T12:23:20.000Z | 2021-09-04T12:23:20.000Z | CmdPacketDownload.cpp | lotusczp/XcpMaster | 47cf2df7e111e823525347faf1cc6cbca6ec3c5d | [
"MIT"
] | null | null | null | CmdPacketDownload.cpp | lotusczp/XcpMaster | 47cf2df7e111e823525347faf1cc6cbca6ec3c5d | [
"MIT"
] | 1 | 2021-11-16T06:57:56.000Z | 2021-11-16T06:57:56.000Z | #include "CmdPacketDownload.h"
CmdPacketDownload::CmdPacketDownload()
: CmdPacket()
{
m_idField.append(CTO::DOWNLOAD);
m_dataField.resize(5);
}
void CmdPacketDownload::setNumberOfDataElements(uint8_t a_byNum)
{
m_dataField[0] = a_byNum;
}
uint8_t CmdPacketDownload::getNumberOfDataElements()
{
return m_dataField[0];
}
uint32_t CmdPacketDownload::getDataElements(bool a_bIsLittleEndian)
{
if(a_bIsLittleEndian) {
return (((uint32_t)m_dataField[4]) << 24) | (((uint32_t)m_dataField[3]) << 16) | (((uint32_t)m_dataField[2]) << 8) | m_dataField[1];
}
else {
//do byte-swap
return (((uint32_t)m_dataField[1]) << 24) | (((uint32_t)m_dataField[2]) << 16) | (((uint32_t)m_dataField[3]) << 8) | m_dataField[4];
}
}
void CmdPacketDownload::setDataElements(uint32_t a_dwData, bool a_bIsLittleEndian)
{
uint8_t i1, i2, i3, i4;
i1 = a_dwData & 0xFF;
i2 = (a_dwData >> 8) & 0xFF;
i3 = (a_dwData >> 16) & 0xFF;
i4 = (a_dwData >> 24) & 0xFF;
if(a_bIsLittleEndian) {
if(m_dataField[0] == 4) {
m_dataField[1] = i1;
m_dataField[2] = i2;
m_dataField[3] = i3;
m_dataField[4] = i4;
}
else if(m_dataField[0] == 2) {
m_dataField[1] = i1;
m_dataField[2] = i2;
m_dataField[3] = 0;
m_dataField[4] = 0;
}
else if(m_dataField[0] == 1) {
m_dataField[1] = i1;
m_dataField[2] = 0;
m_dataField[3] = 0;
m_dataField[4] = 0;
}
}
else {
if(m_dataField[0] == 4) {
m_dataField[1] = i4;
m_dataField[2] = i3;
m_dataField[3] = i2;
m_dataField[4] = i1;
}
else if(m_dataField[0] == 2) {
m_dataField[1] = i2;
m_dataField[2] = i1;
m_dataField[3] = 0;
m_dataField[4] = 0;
}
else if(m_dataField[0] == 1) {
m_dataField[1] = i1;
m_dataField[2] = 0;
m_dataField[3] = 0;
m_dataField[4] = 0;
}
}
}
| 26.6625 | 141 | 0.524144 | lotusczp |
4cc7f41de52bf5dc37c2db2d46827347bc049e87 | 7,047 | cpp | C++ | src/BabylonCpp/src/cameras/inputs/follow_camera_keyboard_move_input.cpp | samdauwe/BabylonCpp | eea9f761a49bb460ff1324c20e4674ef120e94f1 | [
"Apache-2.0"
] | 277 | 2017-05-18T08:27:10.000Z | 2022-03-26T01:31:37.000Z | src/BabylonCpp/src/cameras/inputs/follow_camera_keyboard_move_input.cpp | samdauwe/BabylonCpp | eea9f761a49bb460ff1324c20e4674ef120e94f1 | [
"Apache-2.0"
] | 77 | 2017-09-03T15:35:02.000Z | 2022-03-28T18:47:20.000Z | src/BabylonCpp/src/cameras/inputs/follow_camera_keyboard_move_input.cpp | samdauwe/BabylonCpp | eea9f761a49bb460ff1324c20e4674ef120e94f1 | [
"Apache-2.0"
] | 37 | 2017-03-30T03:36:24.000Z | 2022-01-28T08:28:36.000Z | #include <babylon/cameras/inputs/follow_camera_keyboard_move_input.h>
#include <babylon/engines/engine.h>
#include <babylon/engines/scene.h>
#include <babylon/events/keyboard_event_types.h>
namespace BABYLON {
FollowCameraKeyboardMoveInput::FollowCameraKeyboardMoveInput()
: keysHeightOffsetModifierAlt{false}
, keysHeightOffsetModifierCtrl{false}
, keysHeightOffsetModifierShift{false}
, keysRotationOffsetModifierAlt{false}
, keysRotationOffsetModifierCtrl{false}
, keysRotationOffsetModifierShift{false}
, keysRadiusModifierAlt{false}
, keysRadiusModifierCtrl{false}
, keysRadiusModifierShift{false}
, heightSensibility{1.f}
, rotationSensibility{1.f}
, radiusSensibility{1.f}
, _noPreventDefault{false}
, _onCanvasBlurObserver{nullptr}
, _onKeyboardObserver{nullptr}
, _engine{nullptr}
, _scene{nullptr}
{
keysHeightOffsetIncr.emplace_back(38);
keysHeightOffsetDecr.emplace_back(40);
keysRotationOffsetIncr.emplace_back(37);
keysRotationOffsetDecr.emplace_back(39);
keysRadiusIncr.emplace_back(40);
keysRadiusDecr.emplace_back(38);
}
FollowCameraKeyboardMoveInput::~FollowCameraKeyboardMoveInput() = default;
void FollowCameraKeyboardMoveInput::attachControl(bool noPreventDefault)
{
if (_onCanvasBlurObserver) {
return;
}
_noPreventDefault = noPreventDefault;
_scene = camera->getScene();
_engine = _scene->getEngine();
_onCanvasBlurObserver
= _engine->onCanvasBlurObservable.add([this](Engine*, EventState&) { _keys.clear(); });
_onKeyboardObserver = _scene->onKeyboardObservable.add([this](KeyboardInfo* info, EventState&) {
const auto& evt = info->event;
if (!evt.metaKey) {
if (info->type == KeyboardEventTypes::KEYDOWN) {
_ctrlPressed = evt.ctrlKey;
_altPressed = evt.altKey;
_shiftPressed = evt.shiftKey;
const auto keyCode = evt.keyCode;
if ((std::find(keysHeightOffsetIncr.begin(), keysHeightOffsetIncr.end(), keyCode)
!= keysHeightOffsetIncr.end())
|| (std::find(keysHeightOffsetDecr.begin(), keysHeightOffsetDecr.end(), keyCode)
!= keysHeightOffsetDecr.end())
|| (std::find(keysRotationOffsetIncr.begin(), keysRotationOffsetIncr.end(), keyCode)
!= keysRotationOffsetIncr.end())
|| (std::find(keysRotationOffsetDecr.begin(), keysRotationOffsetDecr.end(), keyCode)
!= keysRotationOffsetDecr.end())
|| (std::find(keysRadiusIncr.begin(), keysRadiusIncr.end(), keyCode)
!= keysRadiusIncr.end())
|| (std::find(keysRadiusDecr.begin(), keysRadiusDecr.end(), keyCode)
!= keysRadiusDecr.end())) {
if (std::find(_keys.begin(), _keys.end(), keyCode) == _keys.end()) {
_keys.emplace_back(keyCode);
}
if (!_noPreventDefault) {
evt.preventDefault();
}
}
}
else {
const auto keyCode = evt.keyCode;
if ((std::find(keysHeightOffsetIncr.begin(), keysHeightOffsetIncr.end(), keyCode)
!= keysHeightOffsetIncr.end())
|| (std::find(keysHeightOffsetDecr.begin(), keysHeightOffsetDecr.end(), keyCode)
!= keysHeightOffsetDecr.end())
|| (std::find(keysRotationOffsetIncr.begin(), keysRotationOffsetIncr.end(), keyCode)
!= keysRotationOffsetIncr.end())
|| (std::find(keysRotationOffsetDecr.begin(), keysRotationOffsetDecr.end(), keyCode)
!= keysRotationOffsetDecr.end())
|| (std::find(keysRadiusIncr.begin(), keysRadiusIncr.end(), keyCode)
!= keysRadiusIncr.end())
|| (std::find(keysRadiusDecr.begin(), keysRadiusDecr.end(), keyCode)
!= keysRadiusDecr.end())) {
_keys.erase(std::remove(_keys.begin(), _keys.end(), keyCode), _keys.end());
if (!_noPreventDefault) {
evt.preventDefault();
}
}
}
}
});
}
void FollowCameraKeyboardMoveInput::detachControl(ICanvas* /*ignored*/)
{
if (_scene) {
if (_onKeyboardObserver) {
_scene->onKeyboardObservable.remove(_onKeyboardObserver);
}
if (_onCanvasBlurObserver) {
_engine->onCanvasBlurObservable.remove(_onCanvasBlurObserver);
}
_onKeyboardObserver = nullptr;
_onCanvasBlurObserver = nullptr;
}
_keys.clear();
}
void FollowCameraKeyboardMoveInput::checkInputs()
{
if (_onKeyboardObserver) {
for (auto keyCode : _keys) {
if ((std::find(keysHeightOffsetIncr.begin(), keysHeightOffsetIncr.end(), keyCode)
!= keysHeightOffsetIncr.end())
&& _modifierHeightOffset()) {
camera->heightOffset += heightSensibility;
}
else if ((std::find(keysHeightOffsetDecr.begin(), keysHeightOffsetDecr.end(), keyCode)
!= keysHeightOffsetDecr.end())
&& _modifierHeightOffset()) {
camera->heightOffset -= heightSensibility;
}
else if ((std::find(keysRotationOffsetIncr.begin(), keysRotationOffsetIncr.end(), keyCode)
!= keysRotationOffsetIncr.end())
&& _modifierRotationOffset()) {
camera->rotationOffset += rotationSensibility;
camera->rotationOffset = std::fmod(camera->rotationOffset, 360.f);
}
else if ((std::find(keysRotationOffsetDecr.begin(), keysRotationOffsetDecr.end(), keyCode)
!= keysRotationOffsetDecr.end())
&& _modifierRotationOffset()) {
camera->rotationOffset -= rotationSensibility;
camera->rotationOffset = std::fmod(camera->rotationOffset, 360.f);
}
else if ((std::find(keysRadiusIncr.begin(), keysRadiusIncr.end(), keyCode)
!= keysRadiusIncr.end())
&& _modifierRadius()) {
camera->radius += radiusSensibility;
}
else if ((std::find(keysRadiusDecr.begin(), keysRadiusDecr.end(), keyCode)
!= keysRadiusDecr.end())
&& _modifierRadius()) {
camera->radius -= radiusSensibility;
}
}
}
}
std::string FollowCameraKeyboardMoveInput::getClassName() const
{
return "FollowCameraKeyboardMoveInput";
}
std::string FollowCameraKeyboardMoveInput::getSimpleName() const
{
return "keyboard";
}
bool FollowCameraKeyboardMoveInput::_modifierHeightOffset() const
{
return (keysHeightOffsetModifierAlt == _altPressed && keysHeightOffsetModifierCtrl == _ctrlPressed
&& keysHeightOffsetModifierShift == _shiftPressed);
}
bool FollowCameraKeyboardMoveInput::_modifierRotationOffset() const
{
return (keysRotationOffsetModifierAlt == _altPressed
&& keysRotationOffsetModifierCtrl == _ctrlPressed
&& keysRotationOffsetModifierShift == _shiftPressed);
}
bool FollowCameraKeyboardMoveInput::_modifierRadius() const
{
return (keysRadiusModifierAlt == _altPressed && keysRadiusModifierCtrl == _ctrlPressed
&& keysRadiusModifierShift == _shiftPressed);
}
} // end of namespace BABYLON
| 35.954082 | 100 | 0.660849 | samdauwe |
4cc87792db2800736bc48a6d16c62a5c8d2498e5 | 9,957 | cpp | C++ | p1-path-planning/class-quizzes/behavior-planner/behavior-planner/src/vehicle.cpp | Deborah-Digges/SDC-ND-term-3 | 23e879b6d6d0c2b3a3bb78802c50f6b023ba2076 | [
"Apache-2.0"
] | 1 | 2018-02-22T08:49:31.000Z | 2018-02-22T08:49:31.000Z | p1-path-planning/class-quizzes/behavior-planner/behavior-planner/src/vehicle.cpp | Deborah-Digges/SDC-ND-term-3 | 23e879b6d6d0c2b3a3bb78802c50f6b023ba2076 | [
"Apache-2.0"
] | null | null | null | p1-path-planning/class-quizzes/behavior-planner/behavior-planner/src/vehicle.cpp | Deborah-Digges/SDC-ND-term-3 | 23e879b6d6d0c2b3a3bb78802c50f6b023ba2076 | [
"Apache-2.0"
] | 4 | 2017-10-12T16:32:20.000Z | 2020-07-27T09:01:43.000Z | #include <iostream>
#include "vehicle.h"
#include <iostream>
#include <math.h>
#include <map>
#include <string>
#include <iterator>
/**
* Initializes Vehicle
*/
Vehicle::Vehicle(int lane, int s, int v, int a) {
this->lane = lane;
this->s = s;
this->v = v;
this->a = a;
state = "CS";
max_acceleration = -1;
}
Vehicle::~Vehicle() {}
vector<string> find_possible_next_states(string current_state) {
if(current_state == "KL") {
return {"KL", "PLCL", "PLCR"};
}
if(current_state == "LCL") {
return {"LCL", "KL"};
}
if(current_state == "LCR") {
return {"LCR", "KL"};
}
if(current_state == "PLCL") {
return {"KL", "LCL"};
}
if(current_state == "PLCR") {
return {"KL", "LCR"};
}
}
// TODO - Implement this method.
void Vehicle::update_state(map<int,vector < vector<int> > > predictions) {
/*
Updates the "state" of the vehicle by assigning one of the
following values to 'self.state':
"KL" - Keep Lane
- The vehicle will attempt to drive its target speed, unless there is
traffic in front of it, in which case it will slow down.
"LCL" or "LCR" - Lane Change Left / Right
- The vehicle will IMMEDIATELY change lanes and then follow longitudinal
behavior for the "KL" state in the new lane.
"PLCL" or "PLCR" - Prepare for Lane Change Left / Right
- The vehicle will find the nearest vehicle in the adjacent lane which is
BEHIND itself and will adjust speed to try to get behind that vehicle.
INPUTS
- predictions
A dictionary. The keys are ids of other vehicles and the values are arrays
where each entry corresponds to the vehicle's predicted location at the
corresponding timestep. The FIRST element in the array gives the vehicle's
current position. Example (showing a car with id 3 moving at 2 m/s):
{
3 : [
{"s" : 4, "lane": 0},
{"s" : 6, "lane": 0},
{"s" : 8, "lane": 0},
{"s" : 10, "lane": 0},
]
}
*/
vector<string> states = find_possible_next_states(this->state);
//vector<string> states = {"KL", "LCL", "LCR", "PLCL", "PLCR"};
vector<double> costs;
double cost;
for (string test_state : states) {
cost = 0;
// create copy of our vehicle
Vehicle test_v = Vehicle(this->lane, this->s, this->v, this->a);
test_v.state = test_state;
test_v.realize_state(predictions);
// predict one step into future, for selected state
vector<int> test_v_state = test_v.state_at(1);
int pred_lane = test_v_state[0];
int pred_s = test_v_state[1];
int pred_v = test_v_state[2];
int pred_a = test_v_state[3];
//cout << "pred lane: " << pred_lane << " s: " << pred_s << " v: " << pred_v << " a: " << pred_a << endl;
cout << "tested state: " << test_state << endl;
// check for collisions
map<int, vector<vector<int> > >::iterator it = predictions.begin();
vector<vector<vector<int> > > in_front;
while(it != predictions.end())
{
int index = it->first;
vector<vector<int>> v = it->second;
// check predictions one step in future as well
if ((v[1][0] == pred_lane) && (abs(v[1][1] - pred_s) <= L) && index != -1) {
cout << "coll w/ car: " << index << ", "
<< v[1][0] << " " << pred_lane << ", "
<< v[1][1] << " " << pred_s << endl;
cost += 1000;
}
it++;
}
cost += 1*(10 - pred_v);
cost += 1*(pow(3 - pred_lane, 2));
//cost += 10*(1 - exp(-abs(pred_lane - 3)/(300 - (double)pred_s)));
if (pred_lane < 0 || pred_lane > 3) {
cost += 1000;
}
cout << "cost: " << cost << endl;
costs.push_back(cost);
}
double min_cost = 9999999;
int min_cost_index = 0;
for (int i = 0; i < costs.size(); i++) {
//cout << "cost[" << i << "]: " << costs[i] << endl;
if (costs[i] < min_cost) {
min_cost = costs[i];
min_cost_index = i;
}
}
state = states[min_cost_index];
//state = "LCR";
cout << "chosen state: " << state << endl;
}
void Vehicle::configure(vector<int> road_data)
{
target_speed = road_data[0];
lanes_available = road_data[1];
goal_s = road_data[2];
goal_lane = road_data[3];
max_acceleration = road_data[4];
}
string Vehicle::display() {
ostringstream oss;
oss << "s: " << this->s << "\n";
oss << "lane: " << this->lane << "\n";
oss << "v: " << this->v << "\n";
oss << "a: " << this->a << "\n";
return oss.str();
}
void Vehicle::increment(int dt = 1) {
this->s += this->v * dt;
this->v += this->a * dt;
}
vector<int> Vehicle::state_at(int t) {
/*
Predicts state of vehicle in t seconds (assuming constant acceleration)
*/
int s = this->s + this->v * t + this->a * t * t / 2;
int v = this->v + this->a * t;
return {this->lane, s, v, this->a};
}
bool Vehicle::collides_with(Vehicle other, int at_time) {
/*
Simple collision detection.
*/
vector<int> check1 = state_at(at_time);
vector<int> check2 = other.state_at(at_time);
return (check1[0] == check2[0]) && (abs(check1[1]-check2[1]) <= L);
}
Vehicle::collider Vehicle::will_collide_with(Vehicle other, int timesteps) {
Vehicle::collider collider_temp;
collider_temp.collision = false;
collider_temp.time = -1;
for (int t = 0; t < timesteps+1; t++)
{
if( collides_with(other, t) )
{
collider_temp.collision = true;
collider_temp.time = t;
return collider_temp;
}
}
return collider_temp;
}
void Vehicle::realize_state(map<int,vector < vector<int> > > predictions) {
/*
Given a state, realize it by adjusting acceleration and lane.
Note - lane changes happen instantaneously.
*/
string state = this->state;
if(state.compare("CS") == 0)
{
realize_constant_speed();
}
else if(state.compare("KL") == 0)
{
realize_keep_lane(predictions);
}
else if(state.compare("LCL") == 0)
{
realize_lane_change(predictions, "L");
}
else if(state.compare("LCR") == 0)
{
realize_lane_change(predictions, "R");
}
else if(state.compare("PLCL") == 0)
{
realize_prep_lane_change(predictions, "L");
}
else if(state.compare("PLCR") == 0)
{
realize_prep_lane_change(predictions, "R");
}
}
void Vehicle::realize_constant_speed() {
a = 0;
}
int Vehicle::_max_accel_for_lane(map<int,vector<vector<int> > > predictions, int lane, int s) {
int delta_v_til_target = target_speed - v;
int max_acc = min(max_acceleration, delta_v_til_target);
map<int, vector<vector<int> > >::iterator it = predictions.begin();
vector<vector<vector<int> > > in_front;
while(it != predictions.end())
{
int v_id = it->first;
vector<vector<int> > v = it->second;
if((v[0][0] == lane) && (v[0][1] > s))
{
in_front.push_back(v);
}
it++;
}
if(in_front.size() > 0)
{
int min_s = 1000;
vector<vector<int>> leading = {};
for(int i = 0; i < in_front.size(); i++)
{
if((in_front[i][0][1]-s) < min_s)
{
min_s = (in_front[i][0][1]-s);
leading = in_front[i];
}
}
int next_pos = leading[1][1];
int my_next = s + this->v;
int separation_next = next_pos - my_next;
int available_room = separation_next - preferred_buffer;
max_acc = min(max_acc, available_room);
}
return max_acc;
}
void Vehicle::realize_keep_lane(map<int,vector< vector<int> > > predictions) {
this->a = _max_accel_for_lane(predictions, this->lane, this->s);
}
void Vehicle::realize_lane_change(map<int,vector< vector<int> > > predictions, string direction) {
int delta = -1;
if (direction.compare("L") == 0)
{
delta = 1;
}
this->lane += delta;
int lane = this->lane;
int s = this->s;
this->a = _max_accel_for_lane(predictions, lane, s);
}
void Vehicle::realize_prep_lane_change(map<int,vector<vector<int> > > predictions, string direction) {
int delta = -1;
if (direction.compare("L") == 0)
{
delta = 1;
}
int lane = this->lane + delta;
map<int, vector<vector<int> > >::iterator it = predictions.begin();
vector<vector<vector<int> > > at_behind;
while(it != predictions.end())
{
int v_id = it->first;
vector<vector<int> > v = it->second;
if((v[0][0] == lane) && (v[0][1] <= this->s))
{
at_behind.push_back(v);
}
it++;
}
if(at_behind.size() > 0)
{
int max_s = -1000;
vector<vector<int> > nearest_behind = {};
for(int i = 0; i < at_behind.size(); i++)
{
if((at_behind[i][0][1]) > max_s)
{
max_s = at_behind[i][0][1];
nearest_behind = at_behind[i];
}
}
int target_vel = nearest_behind[1][1] - nearest_behind[0][1];
int delta_v = this->v - target_vel;
int delta_s = this->s - nearest_behind[0][1];
if(delta_v != 0)
{
int time = -2 * delta_s/delta_v;
int a;
if (time == 0)
{
a = this->a;
}
else
{
a = delta_v/time;
}
if(a > this->max_acceleration)
{
a = this->max_acceleration;
}
if(a < -this->max_acceleration)
{
a = -this->max_acceleration;
}
this->a = a;
}
else
{
int my_min_acc = max(-this->max_acceleration,-delta_s);
this->a = my_min_acc;
}
}
}
vector<vector<int> > Vehicle::generate_predictions(int horizon = 10) {
vector<vector<int> > predictions;
for( int i = 0; i < horizon; i++)
{
vector<int> check1 = state_at(i);
vector<int> lane_s = {check1[0], check1[1]};
predictions.push_back(lane_s);
}
return predictions;
}
| 25.335878 | 113 | 0.559506 | Deborah-Digges |
4cc95a026a02849a021e18ca1cf64d57ffdbea9f | 10,635 | cpp | C++ | src/RShaders.cpp | chilingg/Redopera | a898eb269d5d3eba9ba5b14ef9b4209f615f4547 | [
"MIT"
] | null | null | null | src/RShaders.cpp | chilingg/Redopera | a898eb269d5d3eba9ba5b14ef9b4209f615f4547 | [
"MIT"
] | null | null | null | src/RShaders.cpp | chilingg/Redopera | a898eb269d5d3eba9ba5b14ef9b4209f615f4547 | [
"MIT"
] | null | null | null | #include <RShaders.h>
#include <RDebug.h>
#include <stdexcept>
using namespace Redopera;
thread_local GLuint RRPI::current = 0;
thread_local int RRPI::count = 0;
RRPI::~RRPI()
{
--count;
if(count == 0)
{
glUseProgram(0);
current = 0;
}
}
void RRPI::setUniform(GLint loc, GLfloat v1) const
{
glUniform1f(loc, v1);
}
void RRPI::setUniform(GLint loc, GLfloat v1, GLfloat v2) const
{
glUniform2f(loc, v1, v2);
}
void RRPI::setUniform(GLint loc, GLfloat v1, GLfloat v2, GLfloat v3) const
{
glUniform3f(loc, v1, v2, v3);
}
void RRPI::setUniform(GLint loc, GLfloat v1, GLfloat v2, GLfloat v3, GLfloat v4) const
{
glUniform4f(loc, v1, v2, v3, v4);
}
void RRPI::setUniform(GLint loc, glm::vec3 vec) const
{
glUniform3f(loc, vec.x, vec.y, vec.z);
}
void RRPI::setUniform(GLint loc, glm::vec4 vec) const
{
glUniform4f(loc, vec.x, vec.y, vec.z, vec.w);
}
void RRPI::setUniform(GLint loc, GLint v1) const
{
glUniform1i(loc, v1);
}
void RRPI::setUniform(GLint loc, GLint v1, GLint v2) const
{
glUniform2i(loc, v1, v2);
}
void RRPI::setUniform(GLint loc, GLint v1, GLint v2, GLint v3) const
{
glUniform3i(loc, v1, v2, v3);
}
void RRPI::setUniform(GLint loc, GLint v1, GLint v2, GLint v3, GLint v4) const
{
glUniform4i(loc, v1, v2, v3, v4);
}
void RRPI::setUniform(GLint loc, glm::ivec3 vec) const
{
glUniform3i(loc, vec.x, vec.y, vec.z);
}
void RRPI::setUniform(GLint loc, glm::ivec4 vec) const
{
glUniform4i(loc, vec.x, vec.y, vec.z, vec.w);
}
void RRPI::setUniform(GLint loc, GLuint v1) const
{
glUniform1ui(loc, v1);
}
void RRPI::setUniform(GLint loc, GLuint v1, GLuint v2) const
{
glUniform2ui(loc, v1, v2);
}
void RRPI::setUniform(GLint loc, GLuint v1, GLuint v2, GLuint v3) const
{
glUniform3ui(loc, v1, v2, v3);
}
void RRPI::setUniform(GLint loc, GLuint v1, GLuint v2, GLuint v3, GLuint v4) const
{
glUniform4ui(loc, v1, v2, v3, v4);
}
void RRPI::setUniform(GLint loc, glm::uvec3 vec) const
{
glUniform3ui(loc, vec.x, vec.y, vec.z);
}
void RRPI::setUniform(GLint loc, glm::uvec4 vec) const
{
glUniform4ui(loc, vec.x, vec.y, vec.z, vec.w);
}
void RRPI::setUniform(GLint loc, GLsizei size, GLfloat *vp, GLsizei count) const
{
switch(size) {
case 1:
glUniform1fv(loc, count, vp);
break;
case 2:
glUniform2fv(loc, count, vp);
break;
case 3:
glUniform3fv(loc, count, vp);
break;
case 4:
glUniform4fv(loc, count, vp);
break;
default:
throw std::invalid_argument("Set Invalid size argument for Uniform" + std::to_string(size) + "fv");
}
}
void RRPI::setUniform(GLint loc, GLsizei size, GLint *vp, GLsizei count) const
{
switch(size) {
case 1:
glUniform1iv(loc, count, vp);
break;
case 2:
glUniform2iv(loc, count, vp);
break;
case 3:
glUniform3iv(loc, count, vp);
break;
case 4:
glUniform4iv(loc, count, vp);
break;
default:
throw std::invalid_argument("Invalid size argument for Uniform" + std::to_string(size) + "iv");
break;
}
}
void RRPI::setUniform(GLint loc, GLsizei size, GLuint *vp, GLsizei count) const
{
switch(size) {
case 1:
glUniform1uiv(loc, count, vp);
break;
case 2:
glUniform2uiv(loc, count, vp);
break;
case 3:
glUniform3uiv(loc, count, vp);
break;
case 4:
glUniform4uiv(loc, count, vp);
break;
default:
throw std::invalid_argument("Invalid size argument for Uniform" + std::to_string(size) + "uiv");
break;
}
}
void RRPI::setUniform(GLint loc, glm::vec3 *vec, GLsizei count) const
{
glUniform3fv(loc, count, &vec->x);
}
void RRPI::setUniform(GLint loc, glm::vec4 *vec, GLsizei count) const
{
glUniform4fv(loc, count, &vec->x);
}
void RRPI::setUniform(GLint loc, glm::ivec3 *vec, GLsizei count) const
{
glUniform3iv(loc, count, &vec->x);
}
void RRPI::setUniform(GLint loc, glm::ivec4 *vec, GLsizei count) const
{
glUniform4iv(loc, count, &vec->x);
}
void RRPI::setUniform(GLint loc, glm::uvec3 *vec, GLsizei count) const
{
glUniform3uiv(loc, count, &vec->x);
}
void RRPI::setUniform(GLint loc, glm::uvec4 *vec, GLsizei count) const
{
glUniform4uiv(loc, count, &vec->x);
}
void RRPI::setUniformMat(GLint loc, const glm::mat2 &mat) const
{
glUniformMatrix2fv(loc, 1, GL_FALSE, glm::value_ptr(mat));
}
void RRPI::setUniformMat(GLint loc, const glm::mat3 &mat) const
{
glUniformMatrix3fv(loc, 1, GL_FALSE, glm::value_ptr(mat));
}
void RRPI::setUniformMat(GLint loc, const glm::mat4 &mat) const
{
glUniformMatrix4fv(loc, 1, GL_FALSE, glm::value_ptr(mat));
}
void RRPI::setUniformMat(GLint loc, const glm::dmat2 &mat) const
{
glUniformMatrix2dv(loc, 1, GL_FALSE, glm::value_ptr(mat));
}
void RRPI::setUniformMat(GLint loc, const glm::dmat3 &mat) const
{
glUniformMatrix3dv(loc, 1, GL_FALSE, glm::value_ptr(mat));
}
void RRPI::setUniformMat(GLint loc, const glm::dmat4 &mat) const
{
glUniformMatrix4dv(loc, 1, GL_FALSE, glm::value_ptr(mat));
}
void RRPI::setUniformMat(GLint loc, const glm::mat2 *mat, GLsizei count) const
{
glUniformMatrix2fv(loc, count, GL_FALSE, glm::value_ptr(*mat));
}
void RRPI::setUniformMat(GLint loc, const glm::mat3 *mat, GLsizei count) const
{
glUniformMatrix3fv(loc, count, GL_FALSE, glm::value_ptr(*mat));
}
void RRPI::setUniformMat(GLint loc, const glm::mat4 *mat, GLsizei count) const
{
glUniformMatrix4fv(loc, count, GL_FALSE, glm::value_ptr(*mat));
}
void RRPI::setUniformMat(GLint loc, const glm::dmat2 *mat, GLsizei count) const
{
glUniformMatrix2dv(loc, count, GL_FALSE, glm::value_ptr(*mat));
}
void RRPI::setUniformMat(GLint loc, const glm::dmat3 *mat, GLsizei count) const
{
glUniformMatrix3dv(loc, count, GL_FALSE, glm::value_ptr(*mat));
}
void RRPI::setUniformMat(GLint loc, const glm::dmat4 *mat, GLsizei count) const
{
glUniformMatrix4dv(loc, count, GL_FALSE, glm::value_ptr(*mat));
}
void RRPI::setUniformMat(GLint loc, GLsizei order, GLfloat *vp, GLsizei count, GLboolean transpose) const
{
switch(order) {
case 2:
glUniformMatrix2fv(loc, count, transpose, vp);
break;
case 3:
glUniformMatrix3fv(loc, count, transpose, vp);
break;
case 4:
glUniformMatrix4fv(loc, count, transpose, vp);
break;
default:
throw std::invalid_argument("Invalid size argument for UniformMatrix" + std::to_string(order) + "fv");
break;
}
}
void RRPI::setUniformMat(GLint loc, GLsizei order, GLdouble *vp, GLsizei count, GLboolean transpose) const
{
switch(order) {
case 2:
glUniformMatrix2dv(loc, count, transpose, vp);
break;
case 3:
glUniformMatrix3dv(loc, count, transpose, vp);
break;
case 4:
glUniformMatrix4dv(loc, count, transpose, vp);
break;
default:
throw std::invalid_argument("Invalid size argument for UniformMatrix" + std::to_string(order) + "dv");
break;
}
}
void RRPI::setUniformSubroutines(RShader::Type type, GLsizei count, const GLuint *indices)
{
glUniformSubroutinesuiv(static_cast<GLenum>(type), count, indices);
}
void RRPI::release()
{
if(count != 1)
throw std::logic_error("The current thread has other <RRPI> is using!");
current = 0;
}
RRPI::RRPI(GLuint id)
{
if(current)
{
if(current != id)
throw std::logic_error("The current thread has other <RRPI> is using!");
else
++count;
}
else
{
current = id;
++count;
glUseProgram(id);
}
}
RShaders::RShaders(std::initializer_list<RShader> list)
{
for(auto &shader : list)
stages_.emplace(shader.type(), shader);
linkProgram();
}
RShaders::RShaders(const RShaders &program):
id_(program.id_),
stages_(program.stages_)
{
}
RShaders::RShaders(const RShaders &&program):
id_(std::move(program.id_)),
stages_(std::move(program.stages_))
{
}
RShaders &RShaders::operator=(RShaders program)
{
swap(program);
return *this;
}
void RShaders::swap(RShaders &program)
{
id_.swap(program.id_);
stages_.swap(program.stages_);
}
bool RShaders::isValid() const
{
return id_ != nullptr;
}
bool RShaders::isAttachedShader(RShader::Type type) const
{
return stages_.count(type);
}
GLuint RShaders::id() const
{
return *id_;
}
RRPI RShaders::use() const
{
return RRPI(*id_);
}
GLint RShaders::getUniformLoc(const std::string &name) const
{
GLint loc = glGetUniformLocation(*id_, name.c_str());
#ifndef NDEBUG
rCheck(loc < 0, "Invalid locale <" + name + '>');
#endif
return loc;
}
GLint RShaders::getSubroutineUniformLoc(RShader::Type type, const std::string &name) const
{
GLint loc = glGetSubroutineUniformLocation(*id_, static_cast<GLenum>(type), name.c_str());
#ifndef NDEBUG
rCheck(loc < 0, "Invalid subroutine locale <" + name + '>');
#endif
return loc;
}
GLuint RShaders::getSubroutineIndex(RShader::Type type, const std::string &name) const
{
GLuint i = glGetSubroutineIndex(*id_, static_cast<GLenum>(type), name.c_str());
#ifndef NDEBUG
rCheck(i == GL_INVALID_INDEX, "Invalid subroutine index <" + name + '>');
#endif
return i;
}
void RShaders::attachShader(const RShader &shader)
{
stages_.emplace(shader.type(), shader);
}
void RShaders::attachShader(std::initializer_list<RShader> list)
{
for(auto &shader : list)
stages_.emplace(shader.type(), shader);
}
void RShaders::detachShader(RShader::Type type)
{
stages_.erase(type);
}
bool RShaders::linkProgram()
{
std::shared_ptr<GLuint> id(std::shared_ptr<GLuint>(new GLuint(glCreateProgram()), deleteShaderProgram));
for(auto& shader: stages_)
glAttachShader(*id, shader.second.id());
glLinkProgram(*id);
int success;
glGetProgramiv(*id, GL_LINK_STATUS, &success);
if(rCheck(!success, "Failed to link shader program"))
{
char infoLog[256];
glGetProgramInfoLog(*id, sizeof(infoLog), nullptr, infoLog);
rPrError(infoLog);
return false;
}
id_.swap(id);
releaseShader();
return true;
}
void RShaders::reLinkProgram()
{
glLinkProgram(*id_);
}
void RShaders::releaseShader()
{
std::map<RShader::Type, RShader> temp;
stages_.swap(temp);
}
void RShaders::release()
{
id_.reset();
}
void RShaders::deleteShaderProgram(GLuint *id)
{
glDeleteProgram(*id);
delete id;
}
void swap(RShaders &prog1, RShaders &prog2)
{
prog1.swap(prog2);
}
| 22.484144 | 110 | 0.653597 | chilingg |
4ccae1f6e170f819e22815cfdbf2b8839a4908f3 | 3,861 | cpp | C++ | GUIDialogs/HoldupsEditor/HoldupsEditor.cpp | FlowsheetSimulation/Dyssol-open | 557d57d959800868e1b3fd161b26cad16481382b | [
"BSD-3-Clause"
] | 7 | 2020-12-02T02:54:31.000Z | 2022-03-08T20:37:46.000Z | GUIDialogs/HoldupsEditor/HoldupsEditor.cpp | FlowsheetSimulation/Dyssol-open | 557d57d959800868e1b3fd161b26cad16481382b | [
"BSD-3-Clause"
] | 33 | 2021-03-26T12:20:18.000Z | 2022-02-23T11:37:56.000Z | GUIDialogs/HoldupsEditor/HoldupsEditor.cpp | FlowsheetSimulation/Dyssol-open | 557d57d959800868e1b3fd161b26cad16481382b | [
"BSD-3-Clause"
] | 6 | 2020-07-17T08:17:37.000Z | 2022-02-24T13:45:16.000Z | /* Copyright (c) 2020, Dyssol Development Team. All rights reserved. This file is part of Dyssol. See LICENSE file for license information. */
#include "HoldupsEditor.h"
#include "Flowsheet.h"
#include "BaseUnit.h"
#include "BaseStream.h"
CHoldupsEditor::CHoldupsEditor(CFlowsheet* _pFlowsheet, CMaterialsDatabase* _materialsDB, QWidget *parent) :
QDialog(parent),
m_pFlowsheet{ _pFlowsheet },
m_pSelectedModel{ nullptr },
m_nLastModel{ 0 },
m_nLastHoldup{ 0 }
{
ui.setupUi(this);
ui.widgetHoldupsEditor->SetFlowsheet(_pFlowsheet, _materialsDB);
setWindowFlags(windowFlags() | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint);
}
void CHoldupsEditor::InitializeConnections() const
{
connect(ui.modelsList, &QTableWidget::itemSelectionChanged, this, &CHoldupsEditor::UpdateHoldupsList);
connect(ui.holdupsList, &QTableWidget::itemSelectionChanged, this, &CHoldupsEditor::NewHoldupSelected);
connect(ui.widgetHoldupsEditor, &CBasicStreamEditor::DataChanged, this, &CHoldupsEditor::ChangeData);
}
void CHoldupsEditor::UpdateWholeView()
{
UpdateUnitsList();
UpdateHoldupsList();
}
void CHoldupsEditor::UpdateHoldupsList()
{
QSignalBlocker blocker(ui.holdupsList);
const auto oldPos = ui.modelsList->CurrentCellPos();
ui.holdupsList->setColumnCount(1);
ui.holdupsList->setRowCount(0);
m_pSelectedModel = ui.modelsList->currentRow() != -1 ? m_pFlowsheet->GetUnit(ui.modelsList->GetItemUserData(ui.modelsList->currentRow(), 0).toStdString()) : nullptr;
if (m_pSelectedModel && m_pSelectedModel->GetModel())
{
for (const auto& stream : m_pSelectedModel->GetModel()->GetStreamsManager().GetAllInit())
{
ui.holdupsList->insertRow(ui.holdupsList->rowCount());
ui.holdupsList->SetItemNotEditable(ui.holdupsList->rowCount() - 1, 0, stream->GetName());
}
}
ui.holdupsList->RestoreSelectedCell(oldPos);
NewHoldupSelected();
}
void CHoldupsEditor::UpdateUnitsList() const
{
QSignalBlocker blocker(ui.modelsList);
const auto oldPos = ui.modelsList->CurrentCellPos();
ui.modelsList->setColumnCount(1);
ui.modelsList->setRowCount(0);
for (const auto& unit : m_pFlowsheet->GetAllUnits())
{
if (unit && unit->GetModel() && !unit->GetModel()->GetStreamsManager().GetAllInit().empty())
{
ui.modelsList->insertRow(ui.modelsList->rowCount());
ui.modelsList->SetItemNotEditable(ui.modelsList->rowCount() - 1, 0, unit->GetName(), QString::fromStdString(unit->GetKey()));
}
}
ui.modelsList->RestoreSelectedCell(oldPos);
}
void CHoldupsEditor::setVisible( bool _bVisible )
{
QDialog::setVisible(_bVisible);
if (_bVisible)
{
UpdateWholeView();
LoadViewState();
}
else
SaveViewState();
}
void CHoldupsEditor::SaveViewState()
{
m_nLastModel = ui.modelsList->currentRow() == -1 ? 0 : ui.modelsList->currentRow();
m_nLastHoldup = ui.holdupsList->currentRow() == -1 ? 0 : ui.holdupsList->currentRow();
}
void CHoldupsEditor::LoadViewState() const
{
QApplication::setOverrideCursor(Qt::WaitCursor);
if (m_nLastModel < ui.modelsList->rowCount())
ui.modelsList->setCurrentCell(m_nLastModel, 0);
if (m_nLastHoldup < ui.holdupsList->rowCount())
ui.holdupsList->setCurrentCell(m_nLastHoldup, 0);
QApplication::restoreOverrideCursor();
}
void CHoldupsEditor::NewHoldupSelected() const
{
CBaseStream* pSelectedHoldup = nullptr;
if (m_pSelectedModel != nullptr)
if (ui.holdupsList->currentRow() >= 0 && m_pSelectedModel->GetModel() && int(m_pSelectedModel->GetModel()->GetStreamsManager().GetAllInit().size()) > ui.holdupsList->currentRow())
pSelectedHoldup = m_pSelectedModel->GetModel()->GetStreamsManager().GetAllInit()[ui.holdupsList->currentRow()];
ui.widgetHoldupsEditor->SetStream(pSelectedHoldup);
}
void CHoldupsEditor::ChangeData()
{
emit DataChanged();
}
| 32.445378 | 182 | 0.72805 | FlowsheetSimulation |
4ccd06ffc691d348b359b1209a8d217a74d5d192 | 3,314 | cpp | C++ | src/models/metasprite/compiler/animationcompiler.cpp | undisbeliever/untech-editor | 8598097baf6b2ac0b5580bc000e9adc3bf682043 | [
"MIT"
] | 13 | 2016-05-02T09:00:42.000Z | 2020-11-07T11:21:07.000Z | src/models/metasprite/compiler/animationcompiler.cpp | undisbeliever/untech-editor | 8598097baf6b2ac0b5580bc000e9adc3bf682043 | [
"MIT"
] | 3 | 2016-09-28T13:36:29.000Z | 2020-12-22T12:22:43.000Z | src/models/metasprite/compiler/animationcompiler.cpp | undisbeliever/untech-editor | 8598097baf6b2ac0b5580bc000e9adc3bf682043 | [
"MIT"
] | 1 | 2016-05-08T09:26:01.000Z | 2016-05-08T09:26:01.000Z | /*
* This file is part of the UnTech Editor Suite.
* Copyright (c) 2016 - 2021, Marcus Rowe <undisbeliever@gmail.com>.
* Distributed under The MIT License: https://opensource.org/licenses/MIT
*/
#include "animationcompiler.h"
#include "compiler.h"
#include <algorithm>
#include <climits>
namespace UnTech::MetaSprite::Compiler {
namespace MS = UnTech::MetaSprite::MetaSprite;
namespace ANI = UnTech::MetaSprite::Animation;
template <typename T>
static inline auto indexOf_throw(const std::vector<T>& vector, const T& item)
{
auto it = std::find(vector.begin(), vector.end(), item);
if (it == vector.end()) {
throw std::out_of_range("item not found in vector");
}
return std::distance(vector.begin(), it);
}
static std::vector<uint8_t> processAnimation(const AnimationListEntry& aniEntry,
const FrameSetExportList& exportList)
{
const auto& frameSet = exportList.frameSet;
const auto& frames = exportList.frames;
const auto& animations = exportList.animations;
assert(aniEntry.animation != nullptr);
const ANI::Animation& animation = *aniEntry.animation;
assert(animation.frames.empty() == false);
uint8_t nextAnimationId = 0xff;
{
if (animation.oneShot == false) {
const ANI::Animation* nextAnimation = &animation;
if (animation.nextAnimation.isValid()) {
nextAnimation = &frameSet.animations.find(animation.nextAnimation).value();
}
nextAnimationId = indexOf_throw(animations, { nextAnimation, aniEntry.hFlip, aniEntry.vFlip });
}
}
std::vector<uint8_t> data;
data.reserve(3 + animation.frames.size() * 2);
data.push_back(nextAnimationId); // nextAnimation
data.push_back(animation.durationFormat.engineValue()); // durationFormat
data.push_back(animation.frames.size() * 2); // frameTableSize
for (const auto& aFrame : animation.frames) {
const auto& frameRef = aFrame.frame;
uint8_t frameId = indexOf_throw(frames, { &*frameSet.frames.find(frameRef.name),
static_cast<bool>(frameRef.hFlip ^ aniEntry.hFlip),
static_cast<bool>(frameRef.vFlip ^ aniEntry.vFlip) });
data.push_back(frameId); // Frames.frameId
data.push_back(aFrame.duration); // Frames.duration
}
return data;
}
std::vector<std::vector<uint8_t>> processAnimations(const FrameSetExportList& exportList)
{
const size_t nAnimations = exportList.animations.size();
std::vector<std::vector<uint8_t>> ret;
ret.reserve(nAnimations);
assert(nAnimations <= MAX_EXPORT_NAMES);
for (const auto& ani : exportList.animations) {
ret.push_back(processAnimation(ani, exportList));
}
return ret;
}
uint16_t saveAnimations(const std::vector<std::vector<uint8_t>>& animations, CompiledRomData& out)
{
if (animations.size() == 0) {
return 0;
}
DataBlock table(animations.size() * 2);
for (const auto& aData : animations) {
uint16_t index = out.animationData.addData_Index(aData);
table.addWord(index);
}
return out.animationList.addData_Index(table.data());
}
}
| 30.971963 | 107 | 0.643935 | undisbeliever |
4cce39a65283560fbfc63401aa9e9a8e5add1b9c | 977 | hpp | C++ | src/mbgl/layout/merge_lines.hpp | mueschm/mapbox-gl-native | b07db0f8d01f855dcd336aa1baabde94c5c1740d | [
"BSL-1.0",
"Apache-2.0"
] | 4,234 | 2015-01-09T08:10:16.000Z | 2022-03-30T14:13:55.000Z | src/mbgl/layout/merge_lines.hpp | leejing397/GeoMap | d94d3f275234ad4434858e08a6b42e72c44dc6db | [
"BSL-1.0",
"Apache-2.0"
] | 12,771 | 2015-01-01T20:27:42.000Z | 2022-03-24T18:14:44.000Z | src/mbgl/layout/merge_lines.hpp | leejing397/GeoMap | d94d3f275234ad4434858e08a6b42e72c44dc6db | [
"BSL-1.0",
"Apache-2.0"
] | 1,571 | 2015-01-08T08:24:53.000Z | 2022-03-28T06:30:53.000Z | #pragma once
#include <mbgl/tile/geometry_tile_data.hpp>
#include <unordered_map>
#include <string>
#include <vector>
namespace mbgl {
class SymbolFeature;
namespace util {
unsigned int mergeFromRight(std::vector<SymbolFeature> &features,
std::unordered_map<std::string, unsigned int> &rightIndex,
std::unordered_map<std::string, unsigned int>::iterator left,
std::string &rightKey,
GeometryCollection &geom);
unsigned int mergeFromLeft(std::vector<SymbolFeature> &features,
std::unordered_map<std::string, unsigned int> &leftIndex,
std::string &leftKey,
std::unordered_map<std::string, unsigned int>::iterator right,
GeometryCollection &geom);
void mergeLines(std::vector<SymbolFeature> &features);
} // end namespace util
} // end namespace mbgl
| 31.516129 | 89 | 0.599795 | mueschm |
4ccfa3c7fefe54828ca899648b3ef77caafbcadf | 4,344 | cpp | C++ | c++/alg/a_star.cpp | Zeyu-Li/quick_algorithm | 5fcbb18f94b49ff164c61f412cf9e13cb7d53e6e | [
"MIT"
] | 6 | 2020-12-31T14:11:45.000Z | 2021-12-07T17:44:13.000Z | c++/alg/a_star.cpp | Zeyu-Li/quick_algorithm | 5fcbb18f94b49ff164c61f412cf9e13cb7d53e6e | [
"MIT"
] | null | null | null | c++/alg/a_star.cpp | Zeyu-Li/quick_algorithm | 5fcbb18f94b49ff164c61f412cf9e13cb7d53e6e | [
"MIT"
] | 1 | 2021-01-03T00:55:11.000Z | 2021-01-03T00:55:11.000Z | /*
* A Star (A*, aka Dijkstra++) Algorithm
* using 2D euclidean distance
*
* Note A Star does not guaranteed to be the shortest path,
* just a more time efficient solution
*/
#include <algorithm>
#include <math.h>
#include <limits.h>
#include "../structs/matrix_graph.cpp"
class Graph_a_star: public Graph_m {
public:
Graph_a_star(): Graph_m() {};
Graph_a_star(bool a): Graph_m(a) {};
Graph_a_star(int a): Graph_m(a) {};
Graph_a_star(bool a, int b): Graph_m(a, b) {};
// returns a vector of the result of a star's alg
std::vector<int> a_star(int, int);
// stores a_star results in second argument
void a_star(int, int, std::vector<int>&);
// returns shortest path given start and end
int a_star_length(int, int);
// pass in a list of form [...[int x, int y]] and will be copied not as an instance
void define_positions(std::vector<std::pair<int, int>>);
bool debug = false;
private:
// gets min distance
int min_dist(std::vector<int>&, std::vector<bool>&);
std::vector<std::pair<int, int>> positions;
bool defined_postion = false;
};
int Graph_a_star::min_dist(std::vector<int>& dist, std::vector<bool>& shortest_path) {
int min = INT_MAX, min_index;
// for each vertex
for (int v = 0; v < size; v++) {
// if is connected and smaller than current min, swap to that one
// add heuristic?
if ((!shortest_path[v]) && dist[v] <= min) {
min = dist[v];
min_index = v;
}
}
return min_index;
}
std::vector<int> Graph_a_star::a_star(int start, int end) {
if (!this->defined_postion) {
throw "Positions not defined";
} else if (size != this->positions.size()) {
throw "Postion size mismatch";
}
std::vector<int> g_score(size); // shortest path distance of each point
std::fill_n(g_score.begin(), size, INT_MAX);
std::vector<int> f_distance(size); // shortest path distance of each point
std::fill_n(f_distance.begin(), size, INT_MAX);
std::vector<bool> shortest_path(size);
std::fill_n(shortest_path.begin(), size, false);
// start of path is of distance 0
g_score[start] = 0;
// init f score with euclidean distance
f_distance[start] = g_score[start] + round(sqrt((positions[end].first-positions[start].first)*(positions[end].first-positions[start].first) + (positions[end].second-positions[start].second) * (positions[end].second-positions[start].second)));
// for every vertex
for (int i = 0; i < size - 1; i++) {
// gets shortest path to work off of
int u = min_dist(f_distance, shortest_path);
// check the current node
shortest_path[u] = true;
// update dist of adjacent vertices to the shortest path if it is connect and shorter than previous entry (dp)
for (int v = 0; v < size; v++) {
if (!shortest_path[v] && matrix[u][v] && f_distance[u] != INT_MAX && f_distance[u] + matrix[u][v] < f_distance[v]) {
g_score[v] = g_score[u] + matrix[u][v];
// f-score is the g-score + euclidean distance
f_distance[v] = g_score[v] + round(sqrt((positions[end].first-positions[v].first)*(positions[end].first-positions[v].first) + (positions[end].second-positions[v].second) * (positions[end].second-positions[v].second)));
}
}
// ends early
if (u == end) break;
}
if (debug) {
// return the distances of all nodes with the added heuristic for debug
return f_distance;
}
return g_score;
}
void Graph_a_star::a_star(int start, int end, std::vector<int>&path) {
std::vector<int> d_path = a_star(start, end);
// copy vectors
for(int i=0; i<d_path.size(); ++i) path.push_back(d_path[i]);
}
/// defines all the positions in 1 function
/// pass in a list of form [int node, [int x, int y]]
/// will be copied
void Graph_a_star::define_positions(std::vector<std::pair<int, int>> positions) {
// copy vectors
this->positions = positions;
this->defined_postion = true;
}
int Graph_a_star::a_star_length(int start, int end) {
std::vector<int> d_path = a_star(start, end);
// return length of shortest path
return d_path.size();
}
| 37.128205 | 246 | 0.617403 | Zeyu-Li |
4ccfeefe86cf13c8d9689491d05a34f89814a36e | 518 | cpp | C++ | LZL/Solution/codeforces/ok/A.cpp | xiyoulinuxgroup-2019-summer/TeamF | 7a661b172f7410583bd11335a3b049f9df8797a3 | [
"MIT"
] | null | null | null | LZL/Solution/codeforces/ok/A.cpp | xiyoulinuxgroup-2019-summer/TeamF | 7a661b172f7410583bd11335a3b049f9df8797a3 | [
"MIT"
] | null | null | null | LZL/Solution/codeforces/ok/A.cpp | xiyoulinuxgroup-2019-summer/TeamF | 7a661b172f7410583bd11335a3b049f9df8797a3 | [
"MIT"
] | 1 | 2019-07-15T06:28:11.000Z | 2019-07-15T06:28:11.000Z | #include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<unordered_map>
#include<list>
#include<vector>
#include<cstdlib>
#include<utility>
#include<cstring>
const int maxn=1010;
using namespace std;
map<int,int>mp;
int m,n,tmp;
int book[maxn];
int main()
{
cin >> m >> n;
for(int i=0;i<m;i++)
{
cin >> tmp;
mp[tmp]++;
}
int ans=0;
int tmep=0;
for(int i=1;i<=n;i++)
{
ans+=((mp[i]/2));
}
cout << ((m+1)/2-ans)+ans*2;
} | 16.1875 | 32 | 0.567568 | xiyoulinuxgroup-2019-summer |
4cd0d1b5223f8d472a242c18bec54efeb8e4b809 | 5,783 | cpp | C++ | test/src/tello/tello_test.cpp | LucaRitz/tello | 3874db477cc2ad6a7127494d4321baac440ac88e | [
"Apache-2.0"
] | 3 | 2021-01-05T15:49:12.000Z | 2021-06-30T12:42:04.000Z | test/src/tello/tello_test.cpp | LucaRitz/tello | 3874db477cc2ad6a7127494d4321baac440ac88e | [
"Apache-2.0"
] | 2 | 2020-08-15T09:47:44.000Z | 2020-08-29T12:52:17.000Z | test/src/tello/tello_test.cpp | LucaRitz/tello | 3874db477cc2ad6a7127494d4321baac440ac88e | [
"Apache-2.0"
] | 2 | 2021-01-12T12:00:14.000Z | 2021-02-11T12:50:42.000Z | #include <gtest/gtest.h>
#include <tello/tello.hpp>
#include <future>
#include <tello/response/query_response.hpp>
#define TELLO_IP_ADDRESS (ip_address)0xC0A80A01 // 192.168.10.1
using tello::Command;
using tello::Tello;
using tello::Response;
using tello::QueryResponse;
using tello::Status;
using std::string;
using std::promise;
using std::future;
using tello::QueryResponse;
TEST(Tello, BasicFlightCommands) {
Tello tello(TELLO_IP_ADDRESS);
future<Response> command_future = tello.command();
command_future.wait();
ASSERT_NE(Status::FAIL, command_future.get().status());
future<QueryResponse> wifi_future = tello.read_wifi();
wifi_future.wait();
ASSERT_NE(Status::FAIL, wifi_future.get().status());
future<Response> takeoff_future = tello.takeoff();
takeoff_future.wait();
ASSERT_NE(Status::FAIL, takeoff_future.get().status());
future<Response> up_future = tello.up(30);
up_future.wait();
ASSERT_NE(Status::FAIL, up_future.get().status());
future<Response> down_future = tello.down(30);
down_future.wait();
ASSERT_NE(Status::FAIL, down_future.get().status());
future<Response> left_future = tello.left(30);
left_future.wait();
ASSERT_NE(Status::FAIL, left_future.get().status());
future<Response> right_future = tello.right(30);
right_future.wait();
ASSERT_NE(Status::FAIL, right_future.get().status());
future<Response> forward_future = tello.forward(30);
forward_future.wait();
ASSERT_NE(Status::FAIL, forward_future.get().status());
future<Response> back_future = tello.back(30);
back_future.wait();
ASSERT_NE(Status::FAIL, back_future.get().status());
future<Response> clockwise_turn_future = tello.clockwise_turn(180);
clockwise_turn_future.wait();
ASSERT_NE(Status::FAIL, clockwise_turn_future.get().status());
future<Response> counter_clockwise_turn_future = tello.counterclockwise_turn(180);
counter_clockwise_turn_future.wait();
ASSERT_NE(Status::FAIL, counter_clockwise_turn_future.get().status());
future<Response> land_future = tello.land();
land_future.wait();
ASSERT_NE(Status::FAIL, land_future.get().status());
}
TEST(Tello, SpeedCommands) {
Tello tello(TELLO_IP_ADDRESS);
future<Response> command_future = tello.command();
command_future.wait();
ASSERT_NE(Status::FAIL, command_future.get().status());
//Read default speed
future<QueryResponse> get_speed_future = tello.read_speed();
get_speed_future.wait();
QueryResponse get_speed_default_response = get_speed_future.get();
ASSERT_NE(Status::FAIL, get_speed_default_response.status());
int defaultVelocity = get_speed_default_response.value();
//Set speed to max 100
int maxVelocity = 100;
future<Response> set_speed_future= tello.set_speed(maxVelocity);
set_speed_future.wait();
ASSERT_NE(Status::FAIL, set_speed_future.get().status());
//Read that speed is max
get_speed_future = tello.read_speed();
get_speed_future.wait();
QueryResponse get_speed_response = get_speed_future.get();
ASSERT_NE(Status::FAIL, get_speed_response.status());
ASSERT_EQ(maxVelocity, get_speed_response.value());
//Reset speed to default speed
set_speed_future = tello.set_speed(defaultVelocity);
set_speed_future.wait();
ASSERT_NE(Status::FAIL, set_speed_future.get().status());
//Check if speed was rested to default speed
get_speed_future = tello.read_speed();
get_speed_future.wait();
QueryResponse get_speed_future_reset_response = get_speed_future.get();
ASSERT_NE(Status::FAIL, get_speed_future_reset_response.status());
ASSERT_EQ(defaultVelocity, get_speed_future_reset_response.value());
}
TEST(Tello, RCControlCommandFlyCircle) {
Tello tello(TELLO_IP_ADDRESS);
future<Response> command_future = tello.command();
command_future.wait();
ASSERT_EQ(Status::OK, command_future.get().status());
future<Response> takeoff_future = tello.takeoff();
takeoff_future.wait();
ASSERT_EQ(Status::OK, takeoff_future.get().status());
future<Response> rc_control_future1 = tello.rc_control(10, -10, 0, 0);
rc_control_future1.wait();
ASSERT_EQ(Status::UNKNOWN, rc_control_future1.get().status());
future<Response> rc_control_future2 = tello.rc_control(0, -10, 0, 0);
rc_control_future2.wait();
ASSERT_EQ(Status::UNKNOWN, rc_control_future2.get().status());
future<Response> rc_control_future3 = tello.rc_control(-10, -10, 0, 0);
rc_control_future3.wait();
ASSERT_EQ(Status::UNKNOWN, rc_control_future3.get().status());
future<Response> rc_control_future4 = tello.rc_control(-10, 0, 0, 0);
rc_control_future4.wait();
ASSERT_EQ(Status::UNKNOWN, rc_control_future4.get().status());
future<Response> rc_control_future5 = tello.rc_control(-10, 10, 0, 0);
rc_control_future5.wait();
ASSERT_EQ(Status::UNKNOWN, rc_control_future5.get().status());
future<Response> rc_control_future6 = tello.rc_control(0, 10, 0, 0);
rc_control_future6.wait();
ASSERT_EQ(Status::UNKNOWN, rc_control_future6.get().status());
future<Response> rc_control_future7 = tello.rc_control(10, 10, 0, 0);
rc_control_future7.wait();
ASSERT_EQ(Status::UNKNOWN, rc_control_future7.get().status());
future<Response> rc_control_future8 = tello.rc_control(10, 0, 0, 0);
rc_control_future8.wait();
ASSERT_EQ(Status::UNKNOWN, rc_control_future8.get().status());
future<Response> rc_control_future9 = tello.rc_control(0, 0, 0, 0);
rc_control_future9.wait();
ASSERT_EQ(Status::UNKNOWN, rc_control_future9.get().status());
future<Response> land_future = tello.land();
land_future.wait();
ASSERT_EQ(Status::OK, land_future.get().status());
} | 36.14375 | 86 | 0.721771 | LucaRitz |
4cd17cf6cce2527e963dc29a563fb19e9cbf5d27 | 2,243 | hpp | C++ | include/nbla/solver/rmsprop.hpp | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 2,792 | 2017-06-26T13:05:44.000Z | 2022-03-28T07:55:26.000Z | include/nbla/solver/rmsprop.hpp | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 138 | 2017-06-27T07:04:44.000Z | 2022-02-28T01:37:15.000Z | include/nbla/solver/rmsprop.hpp | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 380 | 2017-06-26T13:23:52.000Z | 2022-03-25T16:51:30.000Z | // Copyright 2017,2018,2019,2020,2021 Sony 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.
#ifndef __NBLA_SOLVER_RMSPROP_HPP__
#define __NBLA_SOLVER_RMSPROP_HPP__
#include <nbla/solver.hpp>
#include <nbla/solver_registry.hpp>
namespace nbla {
NBLA_REGISTER_SOLVER_HEADER(RMSprop, float /*lr*/, float /*decay*/,
float /*eps*/);
/** RMSprop. This is defined as
\f[
g_t \leftarrow \Delta w_t\\
v_t \leftarrow \gamma v_{t-1} + \left(1 - \gamma \right) g_t^2\\
w_{t+1} \leftarrow w_t - \eta \frac{g_t}{\sqrt{v_t} + \epsilon}
\f]
@param lr \f$\eta\f$ Learning rate.
@param decay \f$\gamma\f$ Decay rate.
@param eps \f$\epsilon\f$ Tiny factor for avoiding 0-division.
@sa See the paper linked below for more details.
Geoff Hinton
Lecture 6a : Overview of mini-batch gradient descent
http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
\ingroup SolverImplGrp
*/
template <typename T> class NBLA_API RMSprop : public Solver {
public:
RMSprop(const Context &ctx, float lr, float decay, float eps);
virtual ~RMSprop();
virtual string name() { return "RMSprop"; }
virtual float learning_rate() { return lr_; }
virtual void set_learning_rate(float lr) { lr_ = lr; }
protected:
float lr_; ///< learning rate
float decay_; ///< decay factor
float eps_; ///< small value
virtual void set_state_impl(const string &key, VariablePtr param);
virtual void remove_state_impl(const string &key);
virtual void update_impl(const string &key, VariablePtr param);
NBLA_DECL_WEIGHT_DECAY();
NBLA_DECL_CLIP_GRAD_BY_NORM();
NBLA_DECL_CHECK_INF_GRAD();
NBLA_DECL_CHECK_NAN_GRAD();
NBLA_DECL_CHECK_INF_OR_NAN_GRAD();
NBLA_DECL_SCALE_GRAD();
};
}
#endif
| 31.591549 | 75 | 0.727151 | daniel-falk |
4cd534a1282be84405c166bc3bae0ad98d5e6d98 | 13,272 | cpp | C++ | src/libsetuptools/Xcp_Interface_Can_J2534_Interface.cpp | hgmelectronics/xcpsetup | 646d22537f58e59c3fe324da08c4dbe0d5881efa | [
"BSD-2-Clause"
] | null | null | null | src/libsetuptools/Xcp_Interface_Can_J2534_Interface.cpp | hgmelectronics/xcpsetup | 646d22537f58e59c3fe324da08c4dbe0d5881efa | [
"BSD-2-Clause"
] | null | null | null | src/libsetuptools/Xcp_Interface_Can_J2534_Interface.cpp | hgmelectronics/xcpsetup | 646d22537f58e59c3fe324da08c4dbe0d5881efa | [
"BSD-2-Clause"
] | null | null | null | #include "Xcp_Interface_Can_J2534_Interface.h"
namespace SetupTools {
namespace Xcp {
namespace Interface {
namespace Can {
namespace J2534 {
#ifdef J2534_INTFC
quint32 idFlags(Id id)
{
return (id.type == Id::Type::Ext) ? quint32(Library::TxFlags::Can29BitId) : 0;
}
void setMessageId(Library::PassThruMessage & message, quint32 addr)
{
message.data[0] = addr >> 24;
message.data[1] = addr >> 16;
message.data[2] = addr >> 8;
message.data[3] = addr;
}
Interface::Interface(QObject *parent) :
::SetupTools::Xcp::Interface::Can::Interface(parent),
mLibrary(),
mDeviceId(),
mChannelId(),
mFilterId(),
mFilter({0, Id::Type::Ext}, 0, true),
mBitrate(500000)
{}
Interface::Interface(QString dllPath, QObject *parent) :
::SetupTools::Xcp::Interface::Can::Interface(parent),
mLibrary(),
mDeviceId(),
mChannelId(),
mFilterId(),
mFilter({0, Id::Type::Ext}, 0, true),
mBitrate(500000)
{
setup(dllPath);
}
Interface::~Interface() {
teardown();
mLibrary.setDllPath("");
}
OpResult Interface::setup(QString dllPath)
{
teardown();
if(!mLibrary.setDllPath(dllPath))
return OpResult::IntfcConfigError;
Library::DeviceId devId;
Library::Result result = mLibrary.open(nullptr, &devId);
if(result != Library::Result::NoError)
{
qDebug() << mLibrary.lastErrorInfo(result);
return OpResult::IntfcConfigError;
}
mDeviceId = devId;
doSetFilterBitrate();
return OpResult::Success;
}
OpResult Interface::teardown()
{
if(mFilterId)
{
mLibrary.stopMsgFilter(mChannelId.get(), mFilterId.get());
mFilterId.reset();
}
if(mChannelId)
{
mLibrary.disconnect(mChannelId.get());
mChannelId.reset();
}
if(mDeviceId)
{
mLibrary.close(mDeviceId.get());
mDeviceId.reset();
}
return OpResult::Success;
}
OpResult Interface::connect(SlaveId addr)
{
if(!mDeviceId)
return OpResult::InvalidOperation;
mActiveFilter = ExactFilter(addr.res);
OpResult res = doSetFilterBitrate();
if(res == OpResult::Success)
{
mSlaveAddr = addr;
emit slaveIdChanged();
clearReceived();
return OpResult::Success;
}
else
{
mSlaveAddr.reset();
mActiveFilter.reset();
emit slaveIdChanged();
doSetFilterBitrate();
return res;
}
}
OpResult Interface::disconnect()
{
if(!mDeviceId)
return OpResult::InvalidOperation;
mSlaveAddr.reset();
mActiveFilter.reset();
emit slaveIdChanged();
return doSetFilterBitrate();
}
OpResult Interface::transmit(const std::vector<quint8> & data, bool replyExpected)
{
if(!mDeviceId)
return OpResult::InvalidOperation;
Q_ASSERT(mSlaveAddr);
return transmitTo(data, mSlaveAddr.get().cmd, replyExpected);
}
OpResult Interface::transmitTo(const std::vector<quint8> & data, Id id, bool replyExpected)
{
Q_UNUSED(replyExpected);
if(!mDeviceId || !mChannelId)
return OpResult::InvalidOperation;
if(data.size() > 8)
return OpResult::InvalidArgument;
Library::PassThruMessage message;
message.protocolID = Library::ProtocolId::Can;
message.txFlags = idFlags(id);
message.dataSize = data.size() + 4;
setMessageId(message, id.addr);
std::copy(data.begin(), data.end(), message.data + 4);
quint32 nMsgs = 1;
if(mPacketLogEnabled)
{
Frame frame(id, data);
qDebug() << QString(frame);
}
Library::Result result = mLibrary.writeMsgs(mChannelId.get(), &message, &nMsgs, SEND_TIMEOUT_MS);
switch(result)
{
case Library::Result::NoError:
if(nMsgs == 1)
return OpResult::Success;
else
{
qDebug() << "TX nMsgs" << nMsgs;
return OpResult::IntfcUnexpectedResponse;
}
case Library::Result::ErrTimeout:
return OpResult::Timeout;
default:
qDebug() << "TX failed, PassThru error" << int(result);
return OpResult::IntfcIoError;
}
}
OpResult Interface::setPacketLog(bool enable)
{
mPacketLogEnabled = enable;
return OpResult::Success;
}
OpResult Interface::receiveFrames(int timeoutMsec, std::vector<Frame> &out, const Filter filter, bool (*validator)(const Frame &))
{
if(!mDeviceId || !mChannelId)
return OpResult::InvalidOperation;
if(timeoutMsec < 0)
return OpResult::InvalidArgument;
QElapsedTimer timer;
timer.start();
Library::Result result;
do
{
int queueReadTimeout = std::max(timeoutMsec - int(timer.elapsed()), 0);
Library::PassThruMessage msg;
quint32 nMsgs = 1;
result = mLibrary.readMsgs(mChannelId.get(), &msg, &nMsgs, queueReadTimeout);
if(result != Library::Result::NoError && result != Library::Result::ErrTimeout && result != Library::Result::ErrBufferEmpty)
{
qDebug() << "RX failed, PassThru error" << int(result);
return OpResult::IntfcIoError;
}
if(nMsgs > 1)
return OpResult::IntfcUnexpectedResponse;
if(msg.protocolID != Library::ProtocolId::Can || msg.dataSize < 4 || msg.dataSize > 12
|| (msg.rxStatus & Library::RxStatus::TxMsgType))
continue;
Frame frame;
frame.id.addr = msg.data[0] << 24 | msg.data[1] << 16 | msg.data[2] << 8 | msg.data[3];
frame.id.type = msg.rxStatus & Library::Can29BitId ? Id::Type::Ext : Id::Type::Std;
frame.data.resize(msg.dataSize - 4);
std::copy(msg.data + 4, msg.data + msg.dataSize, frame.data.data());
if(filter.Matches(frame.id) && (!validator || validator(frame)))
{
out.push_back(frame);
if(mPacketLogEnabled)
qDebug() << QString(frame);
}
} while(timer.elapsed() <= timeoutMsec && !out.size());
if(out.size() > 0)
return OpResult::Success;
else
return OpResult::Timeout;
}
OpResult Interface::clearReceived()
{
if(!mDeviceId || !mChannelId)
return OpResult::InvalidOperation;
Library::Result result = mLibrary.ioctl(mChannelId.get(), Library::IoctlId::ClearRXBuffer, nullptr, nullptr);
if(result != Library::Result::NoError)
{
qDebug() << mLibrary.lastErrorInfo(result);
return OpResult::IntfcConfigError;
}
return OpResult::Success;
}
OpResult Interface::setBitrate(int bps)
{
mBitrate = bps;
return doSetFilterBitrate();
}
OpResult Interface::setFilter(Filter filt)
{
mFilter = filt;
return doSetFilterBitrate();
}
bool Interface::hasReliableTx()
{
return true;
}
bool Interface::allowsMultipleReplies()
{
return true;
}
int Interface::maxReplyTimeout()
{
return std::numeric_limits<int>::max();
}
OpResult Interface::doSetFilterBitrate()
{
Library::Result result;
if(mFilterId)
{
mLibrary.stopMsgFilter(mChannelId.get(), mFilterId.get());
mFilterId.reset();
}
if(mChannelId)
{
mLibrary.disconnect(mChannelId.get());
mChannelId.reset();
}
Filter & filter = mActiveFilter ? mActiveFilter.get() : mFilter;
Library::ChannelId channelId;
quint32 flags = filter.filt.type == Id::Type::Ext ? quint32(Library::TxFlags::Can29BitId) : 0;
result = mLibrary.connect(mDeviceId.get(), Library::ProtocolId::Can, flags, mBitrate, &channelId);
if(result != Library::Result::NoError)
{
qDebug() << mLibrary.lastErrorInfo(result);
return OpResult::IntfcConfigError;
}
mChannelId = channelId;
Q_ASSERT(filter.maskEff);
Library::PassThruMessage patternMsg;
patternMsg.protocolID = Library::ProtocolId::Can;
patternMsg.txFlags = flags;
patternMsg.dataSize = 4;
setMessageId(patternMsg, filter.filt.addr);
Library::PassThruMessage maskMsg;
maskMsg.protocolID = Library::ProtocolId::Can;
maskMsg.txFlags = Library::TxFlags::Can29BitId;
maskMsg.dataSize = 4;
setMessageId(maskMsg, filter.maskId);
Library::MessageId filterId;
result = mLibrary.startMsgFilter(channelId, Library::FilterType::Pass, &maskMsg, &patternMsg, nullptr, &filterId);
if(result != Library::Result::NoError)
{
qDebug() << mLibrary.lastErrorInfo(result);
return OpResult::IntfcConfigError;
}
mFilterId = filterId;
mLibrary.ioctl(channelId, Library::IoctlId::ClearRXBuffer, nullptr, nullptr);
return OpResult::Success;
}
QList<QUrl> Registry::avail()
{
QList<QUrl> uris;
const std::array<QString, 2> keys {
"HKEY_LOCAL_MACHINE\\SOFTWARE\\PassThruSupport.04.04",
"HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\PassThruSupport.04.04"
};
for(QString regkey : keys)
{
QSettings passthru(regkey, QSettings::NativeFormat);
for(QString name : passthru.childGroups())
{
passthru.beginGroup(name);
QString dllPath = passthru.value("FunctionLibrary").toString();
passthru.endGroup();
Library library;
if(!library.setDllPath(dllPath))
continue;
// Check if it can actually be opened - this may or may not be a good idea,
// if multiple devices of the same flavor are attached the user will get a dialog every time we refresh the menu
// Unfortunately there is no "silently check if any device is present" function in the PassThru API
Library::DeviceId deviceId;
Library::Result openResult = library.open(nullptr, &deviceId);
if(openResult != Library::Result::NoError)
continue;
library.close(deviceId);
QUrl uri = QUrl::fromLocalFile(dllPath);
uri.setScheme("j2534");
QUrlQuery nameQuery;
nameQuery.addQueryItem("name", QUrl::toPercentEncoding(name));
uri.setQuery(nameQuery);
uris.append(uri);
}
}
return uris;
}
Interface * Registry::make(QUrl uri)
{
if(QString::compare(uri.scheme(), "j2534", Qt::CaseInsensitive) != 0)
return nullptr;
Interface *intfc = new Interface();
uri.setScheme("file"); // needed for toLocalFile to work
if(intfc->setup(uri.toLocalFile()) != OpResult::Success)
{
delete intfc;
return NULL;
}
bool setBitrate = false;
QUrlQuery uriQuery(uri.query());
QString bitrateStr = uriQuery.queryItemValue("bitrate");
int bitrate = bitrateStr.toInt(&setBitrate);
if(setBitrate)
{
if(intfc->setBitrate(bitrate) != OpResult::Success)
{
delete intfc;
return NULL;
}
}
return intfc;
}
QString Registry::desc(QUrl uri)
{
if(QString::compare(uri.scheme(), "j2534", Qt::CaseInsensitive) != 0)
return QString("");
QString name = QUrlQuery(uri.query()).queryItemValue("name");
return QString("%1 (J2534)").arg(name);
}
#else /* J2534_INTFC */
Interface::Interface(QObject *parent) :
::SetupTools::Xcp::Interface::Can::Interface(parent)
{}
Interface::Interface(QString dllPath, QObject *parent) :
::SetupTools::Xcp::Interface::Can::Interface(parent)
{
Q_UNUSED(dllPath);
}
Interface::~Interface() {
}
OpResult Interface::setup(QString ifName)
{
Q_UNUSED(ifName);
return OpResult::InvalidOperation;
}
OpResult Interface::teardown()
{
return OpResult::InvalidOperation;
}
OpResult Interface::connect(SlaveId addr)
{
Q_UNUSED(addr);
return OpResult::InvalidOperation;
}
OpResult Interface::disconnect()
{
return OpResult::InvalidOperation;
}
OpResult Interface::transmit(const std::vector<quint8> & data, bool replyExpected)
{
Q_UNUSED(data);
Q_UNUSED(replyExpected);
return OpResult::InvalidOperation;
}
OpResult Interface::transmitTo(const std::vector<quint8> & data, Id id, bool replyExpected)
{
Q_UNUSED(data);
Q_UNUSED(id);
Q_UNUSED(replyExpected);
return OpResult::InvalidOperation;
}
OpResult Interface::receiveFrames(int timeoutMsec, std::vector<Frame> &out, const Filter filter, bool (*validator)(const Frame &))
{
Q_UNUSED(timeoutMsec);
Q_UNUSED(out);
Q_UNUSED(filter);
Q_UNUSED(validator);
return OpResult::InvalidOperation;
}
OpResult Interface::clearReceived()
{
return OpResult::InvalidOperation;
}
OpResult Interface::setBitrate(int bps)
{
Q_UNUSED(bps);
return OpResult::InvalidOperation;
}
OpResult Interface::setFilter(Filter filt)
{
Q_UNUSED(filt);
return OpResult::InvalidOperation;
}
OpResult Interface::setPacketLog(bool enable)
{
Q_UNUSED(enable);
return OpResult::InvalidOperation;
}
bool Interface::hasReliableTx()
{
return true;
}
bool Interface::allowsMultipleReplies()
{
return true;
}
int Interface::maxReplyTimeout()
{
return std::numeric_limits<int>::max();
}
QList<QUrl> Registry::avail()
{
return QList<QUrl>();
}
Interface *Registry::make(QUrl uri)
{
Q_UNUSED(uri);
return nullptr;
}
QString Registry::desc(QUrl uri)
{
Q_UNUSED(uri);
return QString("");
}
#endif /* J2534_INTFC */
} // namespace J2534
} // namespace Can
} // namespace Interface
} // namespace Xcp
} // namespace SetupTools
| 24.623377 | 132 | 0.641426 | hgmelectronics |
4cd592b82e5b2735686d0fc75528e0e179d03dea | 3,570 | cpp | C++ | samples/GuiAPI_PropertyWin/PropertyWin.cpp | odayibasi/swengine | ef07b7c9125d01596837a423a9f3dcbced1f5aa7 | [
"Zlib",
"MIT"
] | 3 | 2021-03-01T20:41:13.000Z | 2021-07-10T13:45:47.000Z | samples/GuiAPI_PropertyWin/PropertyWin.cpp | odayibasi/swengine | ef07b7c9125d01596837a423a9f3dcbced1f5aa7 | [
"Zlib",
"MIT"
] | null | null | null | samples/GuiAPI_PropertyWin/PropertyWin.cpp | odayibasi/swengine | ef07b7c9125d01596837a423a9f3dcbced1f5aa7 | [
"Zlib",
"MIT"
] | null | null | null | #include "../../include/SWEngine.h"
#pragma comment (lib,"../../lib/SWUtil.lib")
#pragma comment (lib,"../../lib/SWTypes.lib")
#pragma comment (lib,"../../lib/SWCore.lib")
#pragma comment (lib,"../../lib/SWEngine.lib")
#pragma comment (lib,"../../lib/SWGame.lib")
#pragma comment (lib,"../../lib/SWGui.lib")
#pragma comment (lib,"../../lib/SWServices.lib")
swApplication propertyWinApp;
int windowID=-1;
int windowTexID=-1;
swRect window={0,0,800,600};
typedef enum _eBoundaryStyle{
BOUNDARY_POINT,
BOUNDARY_LINE,
}eBoundaryStyle;
//Boundary
int boundaryStyle=BOUNDARY_LINE;
swColor boundaryColor={1,0,0,0};
float boundarySize=5;
//Inner
swColor innerColor={0,1,0,0};
//Elips
swPoint elipsPos={400,300};
swDimension elipsDim={250,150};
int elipsSmoothness=60;
swKeyboardState keybState;
swMouseState mousState;
char lineName[5]="line";
char pointName[6]="point";
//-------------------------------------------------------------------------------------------
void GameLoop(){
swInputListenKeyboard(&keybState);
swInputListenMouse(&mousState);
swInteractionManagerExecute(&keybState,&mousState);
swGraphicsBeginScene();
swGraphicsSetBgColor1(0,0,0,0);
//Fill Elips
swGraphicsSetColor1(&innerColor);
swGraphicsRenderSolidElips1(&elipsPos,&elipsDim,elipsSmoothness);
//Draw Elips Boundary
swGraphicsSetColor1(&boundaryColor);
if(boundaryStyle==BOUNDARY_POINT){
swGraphicsRenderPointElips1(&elipsPos,&elipsDim,elipsSmoothness,boundarySize);
}else if(boundaryStyle==BOUNDARY_LINE){
swGraphicsRenderLineElips1(&elipsPos,&elipsDim,elipsSmoothness,boundarySize);
}
//Manage GUI System
swDispManagerExecute();
//Display Cursor
//swGraphicsSetColor1(&SWCOLOR_BLUE);
//swGraphicsRenderPoint0(mousState.x,mousState.y,10);
swGraphicsEndScene();
if(keybState.keyESCAPE){
swEngineExit();
}
}
//-------------------------------------------------------------------------------------------
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
{
//Application Settings
propertyWinApp.hInstance=hInstance;
propertyWinApp.fullScreen=false;
propertyWinApp.cursor=true;
propertyWinApp.width=800;
propertyWinApp.height=600;
propertyWinApp.title="PropertyWin";
propertyWinApp.path="\\rsc\\PropertyWin\\";
propertyWinApp.appRun=GameLoop;
//Application Execution
swEngineInit(&propertyWinApp);
//Set Resource Path (Logo, Font, IconSet)
swNumPropWinSetPath("NumPropWinRsc\\");
//CreateEnumList
int enumList=swLinkedListCreate();
swLinkedListAdd(enumList,lineName);
swLinkedListAdd(enumList,pointName);
//Create Windows
int winID=swNumPropWinCreate("Elips Property",200,200,300,4);
int winElipsPosID=swNumPropPointWinCreate("Center",300,300,&elipsPos);
int winElipsDimID=swNumPropDimWinCreate("Size",300,300,&elipsDim);
int winInnerColorID=swNumPropColorWinCreate("Fill Color",300,300,&innerColor);
int winBoundaryColorID=swNumPropColorWinCreate("Boundary Color",300,300,&boundaryColor);
//Add Property To WinID(Elips Property Win)
swNumPropWinAddInt(winID,"Smooth",&elipsSmoothness,3,100,1);
swNumPropWinAddEnum(winID,"BoundaryType",&boundaryStyle,enumList);
swNumPropWinAddFloat(winID,"BoundarySize",&boundarySize,0.0f,10.0f,1.0f);
swNumPropWinAddSubWin(winID,winElipsPosID);
swNumPropWinAddSubWin(winID,winElipsDimID);
swNumPropWinAddSubWin(winID,winInnerColorID);
swNumPropWinAddSubWin(winID,winBoundaryColorID);
swNumPropWinSetVisible(winID,true);
swEngineRun();
swEngineExit();
return 0;
}
| 27.045455 | 93 | 0.721289 | odayibasi |
4cd6155637fc2da4bc4aafbb230baffde2de1a1f | 571 | hpp | C++ | itickable.hpp | getopenmono/pong | f0b111bd9d24aff998e41243d333989455246520 | [
"MIT"
] | null | null | null | itickable.hpp | getopenmono/pong | f0b111bd9d24aff998e41243d333989455246520 | [
"MIT"
] | null | null | null | itickable.hpp | getopenmono/pong | f0b111bd9d24aff998e41243d333989455246520 | [
"MIT"
] | null | null | null | // This software is part of OpenMono, see http://developer.openmono.com
// Released under the MIT license, see LICENSE.txt
#ifndef pong_itickable_h
#define pong_itickable_h
#include "shared-state.hpp"
/**
* All visible objects in the game implement this interface, which only
* requires that the object can be ticked by a global scheduler. The only way
* that objects can communicate with each other is though the shared state
* provided through the tick.
*/
class ITickable
{
public:
virtual void tick (SharedState & state) = 0;
};
#endif // pong_itickable_h
| 27.190476 | 78 | 0.754816 | getopenmono |
4cd63f37c47041f67fc30e9ff83978c66863da00 | 1,918 | cc | C++ | src/kudu/server/rpcz-path-handler.cc | kv-zuiwanyuan/kudu | 251defb69b1a252cedd5d707d9c84b67cf63726d | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/kudu/server/rpcz-path-handler.cc | kv-zuiwanyuan/kudu | 251defb69b1a252cedd5d707d9c84b67cf63726d | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/kudu/server/rpcz-path-handler.cc | kv-zuiwanyuan/kudu | 251defb69b1a252cedd5d707d9c84b67cf63726d | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | // Copyright 2014 Cloudera, 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 "kudu/server/rpcz-path-handler.h"
#include <boost/bind.hpp>
#include <tr1/memory>
#include <fstream>
#include <string>
#include "kudu/gutil/map-util.h"
#include "kudu/gutil/strings/numbers.h"
#include "kudu/rpc/messenger.h"
#include "kudu/rpc/rpc_introspection.pb.h"
#include "kudu/server/webserver.h"
using kudu::rpc::Messenger;
using kudu::rpc::DumpRunningRpcsRequestPB;
using kudu::rpc::DumpRunningRpcsResponsePB;
using std::stringstream;
namespace kudu {
namespace {
void RpczPathHandler(const std::tr1::shared_ptr<Messenger>& messenger,
const Webserver::WebRequest& req, stringstream* output) {
DumpRunningRpcsRequestPB dump_req;
DumpRunningRpcsResponsePB dump_resp;
string arg = FindWithDefault(req.parsed_args, "include_traces", "false");
dump_req.set_include_traces(ParseLeadingBoolValue(arg.c_str(), false));
messenger->DumpRunningRpcs(dump_req, &dump_resp);
JsonWriter writer(output, JsonWriter::PRETTY);
writer.Protobuf(dump_resp);
}
} // anonymous namespace
void AddRpczPathHandlers(const std::tr1::shared_ptr<Messenger>& messenger, Webserver* webserver) {
webserver->RegisterPathHandler("/rpcz", "RPCs",
boost::bind(RpczPathHandler, messenger, _1, _2),
false, true);
}
} // namespace kudu
| 31.966667 | 98 | 0.725756 | kv-zuiwanyuan |
4cd8077f98e57886a24f4303f861b07392fda2c7 | 150 | cpp | C++ | src/util/time.cpp | free1978/mapbox-gl-native | 2a50fccd24e762d0de5a53bac358e5ddfea8d213 | [
"BSD-2-Clause"
] | 2 | 2017-02-28T22:41:54.000Z | 2020-02-13T20:54:55.000Z | src/util/time.cpp | free1978/mapbox-gl-native | 2a50fccd24e762d0de5a53bac358e5ddfea8d213 | [
"BSD-2-Clause"
] | null | null | null | src/util/time.cpp | free1978/mapbox-gl-native | 2a50fccd24e762d0de5a53bac358e5ddfea8d213 | [
"BSD-2-Clause"
] | null | null | null | #include <mbgl/util/time.hpp>
#include <mbgl/util/uv_detail.hpp>
namespace mbgl {
namespace util {
timestamp now() {
return uv_hrtime();
}
}
}
| 11.538462 | 34 | 0.68 | free1978 |
4cd970766e3328a97ef6e383458bd0685cba9b3b | 5,572 | cpp | C++ | qlogerr/src/logBlaster.cpp | nholthaus/logerr | 3dbf9f49a10d1f300c22adcbb03eb5716aba2873 | [
"MIT"
] | 3 | 2020-10-17T15:41:38.000Z | 2021-02-14T02:18:39.000Z | qlogerr/src/logBlaster.cpp | nholthaus/logerr | 3dbf9f49a10d1f300c22adcbb03eb5716aba2873 | [
"MIT"
] | null | null | null | qlogerr/src/logBlaster.cpp | nholthaus/logerr | 3dbf9f49a10d1f300c22adcbb03eb5716aba2873 | [
"MIT"
] | null | null | null | //--------------------------------------------------------------------------------------------------
//
// LOGERR
//
//--------------------------------------------------------------------------------------------------
//
// The MIT License (MIT)
//
// 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.
//
//--------------------------------------------------------------------------------------------------
//
// Copyright (c) 2020 Nic Holthaus
//
//--------------------------------------------------------------------------------------------------
//
// ATTRIBUTION:
//
// ---------------------------------------------------------------------------------------------------------------------
//
/// @brief
/// @details
//
// ---------------------------------------------------------------------------------------------------------------------
//----------------------------
// INCLUDES
//----------------------------
#include "logBlaster.h"
#include <logerrMacros.h>
#include <concurrent_queue.h>
#include <qCoreAppThread.h>
#include <thread>
#include <QUdpSocket>
#include <utility>
//----------------------------
// USING DECLARATIONS
//----------------------------
using namespace std::chrono_literals;
//----------------------------------------------------------------------------------------------------------------------
// CLASS: LogBlasterPrivate
//----------------------------------------------------------------------------------------------------------------------
class LogBlasterPrivate
{
public:
ENSURE_QAPP
QHostAddress m_host;
quint16 m_port = 0;
std::thread m_udpThread;
concurrent_queue<std::string> m_logQueue;
std::atomic_bool m_joinAll = false;
};
//----------------------------------------------------------------------------------------------------------------------
// FUNCTION: Constructor [public]
//----------------------------------------------------------------------------------------------------------------------
/// @brief Constructor
//----------------------------------------------------------------------------------------------------------------------
LogBlaster::LogBlaster(QHostAddress host, quint16 port)
: d_ptr(new LogBlasterPrivate)
{
Q_D(LogBlaster);
d->m_host = std::move(host);
d->m_port = port;
d->m_udpThread = std::thread([this]()
{
Q_D(LogBlaster);
QScopedPointer<QUdpSocket> socket(new QUdpSocket);
EXPECTS(socket->bind(QHostAddress(QHostAddress::AnyIPv4), 0));
socket->setSocketOption(QAbstractSocket::MulticastTtlOption, 1);
std::string logMessage;
while (!d->m_joinAll)
{
if (d->m_logQueue.try_pop_for(logMessage, 10ms))
socket->writeDatagram(logMessage.data(), logMessage.size(), d->m_host, d->m_port);
}
// on join, blast whatever is immediately available
while (d->m_logQueue.try_pop_for(logMessage, 0ms))
socket->writeDatagram(logMessage.data(), logMessage.size(), d->m_host, d->m_port);
});
}
//----------------------------------------------------------------------------------------------------------------------
// FUNCTION: DESTRUCTOR [public]
//----------------------------------------------------------------------------------------------------------------------
/// @brief Destructor
//----------------------------------------------------------------------------------------------------------------------
LogBlaster::~LogBlaster()
{
Q_D(LogBlaster);
d->m_joinAll = true;
if (d->m_udpThread.joinable())
d->m_udpThread.join();
}
//----------------------------------------------------------------------------------------------------------------------
// FUNCTION: blast [public]
//----------------------------------------------------------------------------------------------------------------------
/// @brief queues log messages to be multicasted
/// @param str log message
//----------------------------------------------------------------------------------------------------------------------
void LogBlaster::blast(std::string str)
{
Q_D(LogBlaster);
d->m_logQueue.emplace(std::move(str));
} | 42.861538 | 120 | 0.384422 | nholthaus |
4cdaf172d5c59787a3fed30b4a31288c3e7a8d74 | 8,798 | cpp | C++ | pop/src/commands/FetchEmailCommand.cpp | webOS-ports/mojomail | 49358ac2878e010f5c6e3bd962f047c476c11fc3 | [
"Apache-2.0"
] | 6 | 2015-01-09T02:20:27.000Z | 2021-01-02T08:14:23.000Z | mojomail/pop/src/commands/FetchEmailCommand.cpp | openwebos/app-services | 021d509d609fce0cb41a0e562650bdd1f3bf4e32 | [
"Apache-2.0"
] | 3 | 2019-05-11T19:17:56.000Z | 2021-11-24T16:04:36.000Z | mojomail/pop/src/commands/FetchEmailCommand.cpp | openwebos/app-services | 021d509d609fce0cb41a0e562650bdd1f3bf4e32 | [
"Apache-2.0"
] | 6 | 2015-01-09T02:21:13.000Z | 2021-01-02T02:37:10.000Z | // @@@LICENSE
//
// Copyright (c) 2009-2013 LG Electronics, 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.
//
// LICENSE@@@
#include "commands/DownloadEmailPartsCommand.h"
#include "commands/FetchEmailCommand.h"
#include "data/EmailSchema.h"
#include "data/UidMap.h"
#include "exceptions/MailException.h"
#include "exceptions/ExceptionUtils.h"
#include "PopDefs.h"
FetchEmailCommand::FetchEmailCommand(PopSession& session, Request::RequestPtr request)
: PopSessionPowerCommand(session, "Fetch email"),
m_request(request),
m_email(new PopEmail()),
m_loadEmailResponseSlot(this, &FetchEmailCommand::LoadEmailResponse),
m_clearPartsResponseSlot(this, &FetchEmailCommand::ClearPreviousPartsResponse),
m_getEmailBodyResponseSlot(this, &FetchEmailCommand::GetEmailBodyResponse),
m_updateEmailSummaryResponseSlot(this, &FetchEmailCommand::UpdateEmailSummaryResponse),
m_updateEmailPartsResponseSlot(this, &FetchEmailCommand::UpdateEmailPartsResponse)
{
}
FetchEmailCommand::~FetchEmailCommand()
{
}
void FetchEmailCommand::RunImpl()
{
if (m_session.GetSyncSession().get() && m_session.GetSyncSession()->IsActive()) {
m_session.GetSyncSession()->RegisterCommand(this);
}
LoadEmail();
}
void FetchEmailCommand::LoadEmail()
{
try {
m_loadEmailResponseSlot.cancel();
m_session.GetDatabaseInterface().GetEmail(m_loadEmailResponseSlot, m_request->GetEmailId());
} catch (const std::exception& ex) {
Failure(ex);
} catch (...) {
Failure(MailException("Unable to load email", __FILE__, __LINE__));
}
}
MojErr FetchEmailCommand::LoadEmailResponse(MojObject& response, MojErr err)
{
try {
ErrorToException(err);
MojObject results;
err = response.getRequired("results", results);
ErrorToException(err);
MojObject::ArrayIterator itr;
err = results.arrayBegin(itr);
ErrorToException(err);
if (itr == results.arrayEnd()) {
// no need to fetch email since email is not found
Complete();
return MojErrNone;
} else {
PopEmailAdapter::ParseDatabasePopObject(*itr, *m_email);
}
if (m_request->GetPriority() == Request::Priority_Low && m_email->IsDownloaded()) {
// this is an auto download and it will not download an email that has been
// downloaded by an on demand download.
Complete();
return MojErrNone;
} else if (m_request->GetPriority() == Request::Priority_High && m_email->IsDownloaded()) {
ClearPreviousParts();
return MojErrNone;
}
FetchEmailBody();
} catch (const std::exception& ex) {
Failure(ex);
} catch (...) {
Failure(MailException("Error in loading email response", __FILE__, __LINE__));
}
return MojErrNone;
}
void FetchEmailCommand::ClearPreviousParts()
{
try {
EmailPartList emptyParts;
m_email->SetPartList(emptyParts);
m_email->SetDownloaded(false);
MojObject mojEmail;
PopEmailAdapter::SerializeToDatabasePopObject(*m_email, mojEmail);
m_session.GetDatabaseInterface().UpdateItem(m_clearPartsResponseSlot, mojEmail);
} catch (const std::exception& ex) {
Failure(ex);
} catch (...) {
Failure(MailException("Error in clearing email parts", __FILE__, __LINE__));
}
}
MojErr FetchEmailCommand::ClearPreviousPartsResponse(MojObject& response, MojErr err)
{
try {
ErrorToException(err);
FetchEmailBody();
} catch (const std::exception& ex) {
Failure(ex);
} catch (...) {
Failure(MailException("Error in clearing email parts response", __FILE__, __LINE__));
}
return MojErrNone;
}
void FetchEmailCommand::FetchEmailBody()
{
try {
std::string uid = m_email->GetServerUID();
boost::shared_ptr<UidMap> uidMap = m_session.GetUidMap();
int msgNum = uidMap->GetMessageNumber(uid);
int msgSize = uidMap->GetMessageSize(uid);
m_downloadBodyResult.reset(new PopCommandResult(m_getEmailBodyResponseSlot));
MojLogInfo(m_log, "Downloading email body using message number %d with uid '%s'", msgNum, uid.c_str());
m_downloadBodyCommand.reset(new DownloadEmailPartsCommand(m_session,
msgNum, msgSize, m_email,
m_session.GetFileCacheClient(),
m_request));
m_downloadBodyCommand->SetResult(m_downloadBodyResult);
m_downloadBodyCommand->Run();
} catch (const std::exception& ex) {
Failure(ex);
} catch (...) {
Failure(MailException("Unable to fetch email body", __FILE__, __LINE__));
}
}
MojErr FetchEmailCommand::GetEmailBodyResponse()
{
MojLogInfo(m_log, "Got email body response from server");
try {
m_downloadBodyCommand->GetResult()->CheckException();
UpdateEmailSummary(m_email);
} catch (const MailFileCacheNotCreatedException& fex) {
MojLogError(m_log, "Unable to get filecache for the mail: %s", fex.what());
m_session.Reconnect();
UpdateEmailParts(m_email);
} catch (const std::exception& ex) {
MojLogError(m_log, "Unable to get email body: %s", ex.what());
UpdateEmailParts(m_email);
} catch (...) {
MojLogError(m_log, "Unable to get email body due to unknown error");
UpdateEmailParts(m_email);
}
return MojErrNone;
}
void FetchEmailCommand::UpdateEmailSummary(const PopEmail::PopEmailPtr& emailPtr)
{
try {
if (!emailPtr.get()) {
// this should not happen
Failure(MailException("Unable to update parts: mail pointer is invalid", __FILE__, __LINE__));
return;
}
MojString m_summary;
m_summary.append(emailPtr->GetPreviewText().c_str());
MojLogDebug(m_log, "Saving email with summary"); //: '%s'", emailPtr->GetPreviewText().c_str());
m_updateEmailSummaryResponseSlot.cancel();
m_session.GetDatabaseInterface().UpdateEmailSummary(m_updateEmailSummaryResponseSlot, emailPtr->GetId(), m_summary);
} catch (const std::exception& ex) {
MojLogError(m_log, "Unable to persist email preview text: %s", ex.what());
UpdateEmailParts(m_email);
} catch (...) {
MojLogError(m_log, "Unable to update email preview text due to unknown error");
UpdateEmailParts(m_email);
}
}
MojErr FetchEmailCommand::UpdateEmailSummaryResponse(MojObject& response, MojErr err)
{
try {
ErrorToException(err);
} catch (const std::exception& ex) {
MojLogError(m_log, "Unable to persist email preview text: %s", ex.what());
} catch (...) {
MojLogError(m_log, "Unable to update email preview text due to unknown error");
}
UpdateEmailParts(m_email);
return MojErrNone;
}
void FetchEmailCommand::UpdateEmailParts(const PopEmail::PopEmailPtr& emailPtr)
{
try {
if (!emailPtr.get()) {
// this should not happen
Failure(MailException("Unable to update parts: mail pointer is invalid", __FILE__, __LINE__));
return;
}
MojObject mojEmail;
MojLogDebug(m_log, "Serializing pop email '%s' parts list", emailPtr->GetServerUID().c_str());
PopEmailAdapter::SerializeToDatabasePopObject(*emailPtr, mojEmail);
MojObject m_parts;
MojErr err = mojEmail.getRequired(EmailSchema::PARTS, m_parts);
ErrorToException(err);
MojLogInfo(m_log, "Saving parts of email '%s' to database", AsJsonString(emailPtr->GetId()).c_str());
m_updateEmailPartsResponseSlot.cancel();
m_session.GetDatabaseInterface().UpdateEmailParts(m_updateEmailPartsResponseSlot, emailPtr->GetId(), m_parts, !emailPtr->IsDownloaded());
} catch (const std::exception& ex) {
Failure(ex);
} catch (...) {
Failure(MailException("Unable to update email parts", __FILE__, __LINE__));
}
}
MojErr FetchEmailCommand::UpdateEmailPartsResponse(MojObject& response, MojErr err)
{
try {
ErrorToException(err);
m_request->Done();
Complete();
} catch (const std::exception& ex) {
Failure(ex);
} catch (...) {
Failure(MailException("Unable to update email parts", __FILE__, __LINE__));
}
return MojErrNone;
}
void FetchEmailCommand::Complete()
{
if (m_session.GetSyncSession().get() && m_session.GetSyncSession()->IsActive()) {
m_session.GetSyncSession()->CommandCompleted(this);
}
PopSessionPowerCommand::Complete();
}
void FetchEmailCommand::Failure(const std::exception& ex)
{
if (m_session.GetSyncSession().get() && m_session.GetSyncSession()->IsActive()) {
m_session.GetSyncSession()->CommandFailed(this, ex);
}
PopSessionPowerCommand::Failure(ex);
}
void FetchEmailCommand::Status(MojObject& status) const
{
MojErr err;
PopSessionPowerCommand::Status(status);
if (m_downloadBodyCommand.get()) {
MojObject downloadBodyStatus;
m_downloadBodyCommand->Status(downloadBodyStatus);
err = status.put("downloadBodyCommand", downloadBodyStatus);
}
}
| 30.442907 | 139 | 0.73835 | webOS-ports |
4cdb232cf55550dc35e9203912c27696145a4bb4 | 2,029 | cpp | C++ | src/meshrenderer.cpp | Sirithang/webgine | c76248fe8fe71ae4616e7b7adf66cdd873ed574a | [
"MIT"
] | 3 | 2016-04-16T14:31:41.000Z | 2018-11-06T12:06:36.000Z | src/meshrenderer.cpp | Sirithang/webgine | c76248fe8fe71ae4616e7b7adf66cdd873ed574a | [
"MIT"
] | null | null | null | src/meshrenderer.cpp | Sirithang/webgine | c76248fe8fe71ae4616e7b7adf66cdd873ed574a | [
"MIT"
] | null | null | null | #include "meshrenderer.h"
#include "vector3.h"
#include <stdio.h>
IMPLEMENT_MANAGED(MeshRenderer);
MeshRendererID meshrenderer::create(EntityID owner)
{
MeshRendererID ret = gMeshRendererManager.add();
MeshRenderer& m = getMeshRenderer(ret);
if(owner != -1)
{
m.transform = getEntity(owner)._transform;
}
else
{
m.transform = -1;
}
m.material = -1;
m.mesh = -1;
entity::addComponent(owner, ret, MESHRENDERER);
return ret;
}
void meshrenderer::setMaterial(MeshRendererID mrId, MaterialID matID)
{
MeshRenderer& r = getMeshRenderer(mrId);
r.material = matID;
}
void meshrenderer::setMesh(MeshRendererID mrId, MeshID meshID)
{
MeshRenderer& r = getMeshRenderer(mrId);
r.mesh = meshID;
}
RenderKey meshrenderer::createRenderKey(MeshRenderer& renderer)
{
RenderKey key;
if(renderer.material != -1)
{
Material& mat = getMaterial(renderer.material);
if(mat._flags & MAT_TRANSPARENT)
{
key.sortKey.transparent = 1;
}
else
{
key.sortKey.transparent = 0;
key.sortKey.op_material = renderer.material;
key.sortKey.op_shader = mat._shader;
}
key.shader = mat._shader;
key.statedat = mat.states;
}
key.material = renderer.material;
key.mesh = renderer.mesh;
if(renderer.transform != -1)
{
key.transform = getTransform(renderer.transform)._matrix;
}
return key;
}
void meshrenderer::renderForView(CameraID cam)
{
Camera& c = getCamera(cam);
alfar::Vector3 camPos = transform::getWorldPosition(c._tn);
for(int i = 0; i < gMeshRendererManager._num_objects; ++i)
{
MeshRenderer& m = gMeshRendererManager._objects[i];
if(m.transform == -1 || m.material == -1 || m.mesh == -1)
continue;//it's not fully set, ignore
alfar::Vector3 objPos = transform::getWorldPosition(m.transform);
RenderKey key = meshrenderer::createRenderKey(m);
key.sortKey.transp_dist = alfar::vector3::sqrMagnitude(alfar::vector3::sub(camPos, objPos));
key.sortKey.cameraID = cam;
key.sortKey.layer = 5;//default layer for everything
renderer::addRenderable(key);
}
} | 21.135417 | 94 | 0.709709 | Sirithang |
4ce939de7784d2f04c97c229c5a3b89ebb102dc8 | 5,357 | cpp | C++ | Platform/BridgeRT/AllJoynProperty.cpp | alljoyn/dsb | 5f76998b1db8b6c940799f4dcc9ff47018ea1da3 | [
"Apache-2.0"
] | null | null | null | Platform/BridgeRT/AllJoynProperty.cpp | alljoyn/dsb | 5f76998b1db8b6c940799f4dcc9ff47018ea1da3 | [
"Apache-2.0"
] | null | null | null | Platform/BridgeRT/AllJoynProperty.cpp | alljoyn/dsb | 5f76998b1db8b6c940799f4dcc9ff47018ea1da3 | [
"Apache-2.0"
] | null | null | null | //
//
// IN Copyright (c) %s, Microsoft Corporation
// IN
// IN SPDX-License-Identifier: Apache-2.0 *
// IN
// IN All rights reserved. This program and the accompanying materials are
// IN made available under the terms of the Apache License, Version 2.0
// IN which accompanies this distribution, and is available at
// IN http://www.apache.org/licenses/LICENSE-2.0
// IN
// IN Permission to use, copy, modify, and/or distribute this software for
// IN any purpose with or without fee is hereby granted, provided that the
// IN above copyright notice and this permission notice appear in all
// IN copies.
// IN
// IN THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
// IN WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
// IN WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
// IN AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
// IN DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
// IN PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
// IN TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// IN PERFORMANCE OF THIS SOFTWARE.
//
#include "pch.h"
#include <sstream>
#include "AllJoynProperty.h"
#include "PropertyInterface.h"
#include "AllJoynHelper.h"
using namespace BridgeRT;
using namespace std;
using namespace Windows::Foundation;
AllJoynProperty::AllJoynProperty()
: m_parent(nullptr),
m_originalName(nullptr),
m_dsbType(Platform::TypeCode::Empty),
m_dsbSubType(PropertyType::Empty),
m_annotations(nullptr),
m_access(E_ACCESS_TYPE::ACCESS_READWRITE)
{
}
AllJoynProperty::~AllJoynProperty()
{
}
QStatus AllJoynProperty::Create(IAdapterAttribute ^adapterAttribute, PropertyInterface *parent)
{
QStatus status = ER_OK;
// sanity check
if (nullptr == adapterAttribute || nullptr == adapterAttribute->Value)
{
status = ER_BAD_ARG_1;
goto leave;
}
if (nullptr == parent)
{
status = ER_BAD_ARG_2;
goto leave;
}
m_parent = parent;
m_originalName = adapterAttribute->Value->Name;
m_annotations = adapterAttribute->Annotations;
m_access = adapterAttribute->Access;
m_covBehavior = adapterAttribute->COVBehavior;
m_dsbType = Platform::Type::GetTypeCode(adapterAttribute->Value->Data->GetType());
status = SetName(m_originalName);
if (ER_OK != status)
{
goto leave;
}
m_signature.clear();
{
//check if the dsbValue is of type IPropertyValue
auto propertyValue = dynamic_cast<IPropertyValue^>(adapterAttribute->Value->Data);
if (nullptr == propertyValue)
{
status = ER_BAD_ARG_1;
goto leave;
}
m_dsbSubType = propertyValue->Type;
status = AllJoynHelper::GetSignature(propertyValue->Type, m_signature);
if (ER_OK != status)
{
goto leave;
}
}
leave:
if (ER_OK != status)
{
m_parent = nullptr;
m_signature.clear();
m_exposedName.clear();
m_originalName = nullptr;
m_dsbType = Platform::TypeCode::Empty;
m_dsbSubType = PropertyType::Empty;
}
return status;
}
QStatus AllJoynProperty::SetName(Platform::String ^name)
{
QStatus status = ER_OK;
m_exposedName.clear();
if (name->IsEmpty())
{
status = ER_INVALID_DATA;
goto leave;
}
AllJoynHelper::EncodePropertyOrMethodOrSignalName(name, m_exposedName);
if (!m_parent->IsAJPropertyNameUnique(m_exposedName))
{
// append unique id
std::ostringstream tempString;
m_exposedName += '_';
tempString << m_parent->GetIndexForAJProperty();
m_exposedName += tempString.str();
}
leave:
return status;
}
bool AllJoynProperty::IsSameType(IAdapterAttribute ^adapterAttribute)
{
bool retval = false;
if (adapterAttribute != nullptr && adapterAttribute->Value != nullptr &&
adapterAttribute->Value->Data != nullptr &&
m_originalName == adapterAttribute->Value->Name &&
m_dsbType == Platform::Type::GetTypeCode(adapterAttribute->Value->Data->GetType()) &&
m_access == adapterAttribute->Access &&
m_covBehavior == adapterAttribute->COVBehavior &&
AreAnnotationsSame(adapterAttribute->Annotations))
{
retval = true;
auto propertyValue = dynamic_cast<IPropertyValue^>(adapterAttribute->Value->Data);
if (propertyValue != nullptr && propertyValue->Type != m_dsbSubType)
{
retval = false;
}
}
return retval;
}
bool AllJoynProperty::AreAnnotationsSame(_In_ IAnnotationMap ^annotations)
{
if (m_annotations && annotations)
{
if (m_annotations->Size != annotations->Size)
{
return false;
}
auto iter1 = m_annotations->First();
while (iter1->HasCurrent)
{
auto key = iter1->Current->Key;
auto value = iter1->Current->Value;
if (value != annotations->Lookup(key))
{
return false;
}
iter1->MoveNext();
}
}
else if(m_annotations || annotations)
{
//return false if only one of them have annotations and not both
return false;
}
return true;
} | 27.613402 | 95 | 0.649804 | alljoyn |
4ceb6334c2f0d4876254dc3bc1f7e21a728b6cb1 | 2,115 | cpp | C++ | benchmarks/matrix_multiplication/omp.cpp | alexbriskin/taskflow | da69f8989f26f8ff7bc731dbafb2f6ce171934fc | [
"MIT"
] | 3,457 | 2018-06-09T15:36:42.000Z | 2020-06-01T22:09:25.000Z | benchmarks/matrix_multiplication/omp.cpp | alexbriskin/taskflow | da69f8989f26f8ff7bc731dbafb2f6ce171934fc | [
"MIT"
] | 146 | 2018-06-11T04:11:22.000Z | 2020-06-01T20:59:21.000Z | benchmarks/matrix_multiplication/omp.cpp | alexbriskin/taskflow | da69f8989f26f8ff7bc731dbafb2f6ce171934fc | [
"MIT"
] | 426 | 2018-06-06T18:01:16.000Z | 2020-06-01T05:26:17.000Z | #include "matrix_multiplication.hpp"
#include <omp.h>
// matrix_multiplication_omp
// reference: https://computing.llnl.gov/tutorials/openMP/samples/C/omp_mm.c
void matrix_multiplication_omp(unsigned nthreads) {
omp_set_num_threads(nthreads);
int i, j, k;
#pragma omp parallel for private(i, j)
for(i=0; i<N; ++i) {
for(j=0; j<N; j++) {
a[i][j] = i + j;
}
}
#pragma omp parallel for private(i, j)
for(i=0; i<N; ++i) {
for(j=0; j<N; j++) {
b[i][j] = i * j;
}
}
#pragma omp parallel for private(i, j)
for(i=0; i<N; ++i) {
for(j=0; j<N; j++) {
c[i][j] = 0;
}
}
#pragma omp parallel for private(i, j, k)
for(i=0; i<N; ++i) {
for(j=0; j<N; j++) {
for (k=0; k<N; k++) {
c[i][j] += a[i][k] * b[k][j];
}
}
}
//int edge;
//#pragma omp parallel shared(a, b, c, nthreads) private(i, j, k)
//{
// #pragma omp single private(i, j)
// for(i = 0; i<N; i++) {
// #pragma omp task private(j) firstprivate(i) depend(out: edge)
// for (j=0; j<N; j++)
// a[i][j]= i+j;
// }
// #pragma omp single private(i, j)
// for(i = 0; i<N; i++) {
// #pragma omp task private(j) firstprivate(i) depend(out: edge)
// for (j=0; j<N; j++)
// b[i][j]= i*j;
// }
// #pragma omp single private(i, j)
// for(i = 0; i<N; i++) {
// #pragma omp task private(j) firstprivate(i) depend(out: edge)
// for (j=0; j<N; j++)
// c[i][j]= 0;
// }
// #pragma omp single private(i, j)
// for(i = 0; i<N; i++) {
// #pragma omp task private(j, k) firstprivate(i) depend(in: edge)
// for(j=0; j<N; j++) {
// for (k=0; k<N; k++) {
// c[i][j] += a[i][k] * b[k][j];
// }
// }
// }
//}
//std::cout << reduce_sum() << std::endl;
}
std::chrono::microseconds measure_time_omp(unsigned num_threads) {
auto beg = std::chrono::high_resolution_clock::now();
matrix_multiplication_omp(num_threads);
auto end = std::chrono::high_resolution_clock::now();
return std::chrono::duration_cast<std::chrono::microseconds>(end - beg);
}
| 24.310345 | 76 | 0.519149 | alexbriskin |
4cee0622752c595916063ee7aad0be76d335fb36 | 882 | cxx | C++ | dataclasses/private/dataclasses/I3Matrix.cxx | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 1 | 2020-12-24T22:00:01.000Z | 2020-12-24T22:00:01.000Z | dataclasses/private/dataclasses/I3Matrix.cxx | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | null | null | null | dataclasses/private/dataclasses/I3Matrix.cxx | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 3 | 2020-07-17T09:20:29.000Z | 2021-03-30T16:44:18.000Z |
#include <icetray/serialization.h>
#include <dataclasses/I3Matrix.h>
std::ostream& I3Matrix::Print(std::ostream& oss) const{
oss << "I3Matrix:\n";
for(size_t i=0; i<size1(); i++){
oss << (i>0 ? " [" : "[[");
for(size_t j=0; j<size2(); j++){
oss << (*this)(i,j);
if(j<size2()-1)
oss << ", ";
}
oss << (i<size1()-1 ? "]\n" : "]]");
}
return oss;
}
std::ostream& operator<<(std::ostream& os, const I3Matrix& m){
return(m.Print(os));
}
template <typename Archive>
void
I3Matrix::serialize(Archive &ar, unsigned int version)
{
ar & icecube::serialization::make_nvp("I3FrameObject", icecube::serialization::base_object<I3FrameObject>(*this));
ar & icecube::serialization::make_nvp("Matrix", icecube::serialization::base_object<ublas_matrix_shim>(*this));
}
I3_SERIALIZABLE(ublas_storage_shim);
I3_SERIALIZABLE(ublas_matrix_shim);
I3_SERIALIZABLE(I3Matrix);
| 25.941176 | 115 | 0.664399 | hschwane |
4cee78916ad6b9de425c24f5503b68fbba48399b | 3,517 | cpp | C++ | src/core/directed_acyclic_graph/Graph.cpp | balintfodor/Build3D | b735129e380a414d62a1d91556f5f52674f1f6f9 | [
"MIT"
] | null | null | null | src/core/directed_acyclic_graph/Graph.cpp | balintfodor/Build3D | b735129e380a414d62a1d91556f5f52674f1f6f9 | [
"MIT"
] | 5 | 2021-03-19T09:28:07.000Z | 2022-03-12T00:09:14.000Z | src/core/directed_acyclic_graph/Graph.cpp | balintfodor/Build3D | b735129e380a414d62a1d91556f5f52674f1f6f9 | [
"MIT"
] | 1 | 2019-12-23T16:44:49.000Z | 2019-12-23T16:44:49.000Z | #include "Graph.h"
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <list>
#include <stdexcept>
#include "Node.h"
using namespace core::directed_acyclic_graph;
using namespace std;
GraphPtr Graph::create(const std::string& name)
{
return GraphPtr(new Graph(name));
}
Graph::Graph(const std::string& name) : m_name(name)
{}
bool Graph::empty() const
{
return m_nodes.empty();
}
size_t Graph::size() const
{
return m_nodes.size();
}
NodePtr Graph::add(const std::string& name)
{
m_nodes.push_back(Node::create(name));
m_nodes.back()->m_owner = shared_from_this();
return m_nodes.back();
}
NodePtr Graph::add(NodePtr node)
{
auto it = find(m_nodes.begin(), m_nodes.end(), node);
if (it != m_nodes.end()) {
return node;
}
vector<TraversalMode> modes = {TraversalMode::InputsOnly, TraversalMode::OutputsOnly};
for (auto mode : modes) {
Traversal t = node->traverse(mode);
while (t.hasNext()) {
NodePtr current = t.next();
if (find(m_nodes.begin(), m_nodes.end(), current) == m_nodes.end()) {
m_nodes.push_back(current);
}
if (current->hasOwner() && current->m_owner.lock() != shared_from_this()) {
current->m_owner.lock()->remove(current);
}
current->m_owner = shared_from_this();
}
}
return node;
}
void Graph::remove(NodePtr node)
{
auto it = find(m_nodes.begin(), m_nodes.end(), node);
if (it != m_nodes.end()) {
// NOTE: disconnect(node) implicitly can invalidate
// iterators to m_inputs!
// Here we iterate through a copy of m_inputs
// TODO: find a safer solution
vector<WeakNodePtr> inputsCopy((*it)->m_inputs);
for (auto w : inputsCopy) {
w.lock()->disconnect(node);
}
// NOTE: same as above
std::vector<NodePtr> outputsCopy((*it)->m_outputs);
for (auto n : outputsCopy) {
n->disconnect(node);
}
(*it)->m_owner.reset();
m_nodes.erase(it);
}
}
void Graph::clear()
{
for_each(m_nodes.begin(), m_nodes.end(),
[](NodePtr& n) { n->m_owner.reset(); });
m_nodes.clear();
}
std::string Graph::name() const
{
return m_name;
}
Graph::~Graph()
{
clear();
}
DependencyTraversal Graph::traverse()
{
return DependencyTraversal(shared_from_this());
}
DependencyTraversal::DependencyTraversal(GraphPtr graph) : m_graph(graph)
{
for (NodePtr n : m_graph->m_nodes) {
n->m_ready = n->m_inputs.empty();
if (n->m_ready) {
m_readyList.push_back(n);
} else {
m_waitingList.insert(n);
}
}
}
bool DependencyTraversal::hasNext()
{
return !m_readyList.empty();
}
NodePtr DependencyTraversal::next()
{
if (m_readyList.empty()) {
return NodePtr();
}
NodePtr current = m_readyList.front();
m_readyList.pop_front();
current->m_ready = true;
for (NodePtr n : current->m_outputs) {
auto it = find(m_waitingList.begin(), m_waitingList.end(), n);
if (it == m_waitingList.end()) {
continue;
}
bool ready = all_of(n->m_inputs.begin(), n->m_inputs.end(),
[](const WeakNodePtr& w) {
return w.lock()->m_ready;
});
if (ready) {
m_readyList.push_back(n);
m_waitingList.erase(it);
}
}
return current;
} | 22.544872 | 90 | 0.581177 | balintfodor |
4cf24f6d5925d61b5bbaad67b65628a56a40e5e1 | 1,311 | cpp | C++ | cpp/Euler4.cpp | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | cpp/Euler4.cpp | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | cpp/Euler4.cpp | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | // Project Euler - Problem 4 solution in C++
#include<iostream>
#include<ctime>
using namespace std;
// NOTE: the multiplication of numbers larger than 4 digits could lead to
// products bigger than 2 billion (needs to use 64-bit type!)
// OBS: the original problem asks for only 3 digits (a 32-bit int would suffice)
// i.e. a long or an int (in a 32-bit compiler/architecture)
const long long MIN = 10000;
const long long MAX = 99999;
long long reverse(long number)
{
int reversed = 0;
while (number > 0) {
reversed = reversed * 10 + number % 10;
number /= 10;
}
return reversed;
}
bool isPalindrome(long long number)
{
return number == reverse(number);
}
int main(int argc, char* argv[])
{
int max = 0;
for (long long i = MAX; i >= MIN; i--) { // reversed the order
for (long long j = i; j >= MIN; j--) { // j = i halves the number of calculations needed!
long long product = i * j;
if (product <= max) // since the order is reversed
break; // break when found a product smaller for the current j
if (isPalindrome(product)) {
max = product;
cout << "Found a bigger palindrome: " << i << " * " << j;
cout << " = " << product << " (time: " << time(NULL) << ")\n";
}
}
}
cout << "Biggest found: " << max << '\n';
cin.get();
return 0;
}
| 25.705882 | 91 | 0.617849 | feliposz |
4cf3a535d21e15a6f101bd7bce76f205cbd52264 | 17,035 | cpp | C++ | test/tTraceChartWidget.cpp | dbulk/ROIVert | 01c8affc4e9c94cec15563bbc74943ea66bd69f0 | [
"BSD-3-Clause"
] | null | null | null | test/tTraceChartWidget.cpp | dbulk/ROIVert | 01c8affc4e9c94cec15563bbc74943ea66bd69f0 | [
"BSD-3-Clause"
] | null | null | null | test/tTraceChartWidget.cpp | dbulk/ROIVert | 01c8affc4e9c94cec15563bbc74943ea66bd69f0 | [
"BSD-3-Clause"
] | null | null | null | #include <QMainWindow>
#include <cmath>
#include <QtTest/QtTest>
#include "tTraceChartWidget.h"
#include "widgets/TraceChartWidget.h"
#include "ChartStyle.h"
#include "opencv2/opencv.hpp"
namespace {
std::shared_ptr<TraceChartSeries> makeSeriesHelper(double xmin, double xmax, std::vector<float> yvalues, std::shared_ptr<ChartStyle> style) {
cv::Mat data(1, yvalues.size(), CV_32F);
for (size_t i = 0; i < yvalues.size(); ++i) {
data.at<float>(0, i) = yvalues[i];
}
auto ret = std::make_shared<TraceChartSeries>(style);
ret->setData(data);
ret->setXMin(xmin);
ret->setXMax(xmax);
return ret;
}
}
void tTraceChartWidget::init() {
defstyle = std::make_shared<ChartStyle>();
chart = new TraceChartWidget(defstyle);
xaxis = chart->getXAxis();
xaxis = chart->getXAxis();
yaxis = chart->getYAxis();
}
void tTraceChartWidget::cleanup() {
delete chart;
chart = nullptr;
}
void tTraceChartWidget::tstyle() {
auto stylea = std::make_shared<ChartStyle>();
auto styleb = std::make_shared<ChartStyle>();
chart->setStyle(stylea);
QCOMPARE(chart->getStyle(), stylea.get());
chart->setStyle(styleb);
QCOMPARE(chart->getStyle(), styleb.get());
auto chartb = std::make_unique<TraceChartWidget>(styleb);
QCOMPARE(chartb->getStyle(), styleb.get());
// the style should fan out to x and y axis, to test this use a proxy that
// the style was set...axis thickness following a change in font size.
stylea->setTickLabelFontSize(5);
styleb->setTickLabelFontSize(25);
chart->setStyle(stylea);
chart->updateStyle();
int xthicka = xaxis->getThickness();
int ythicka = yaxis->getThickness();
chart->setStyle(styleb);
chart->updateStyle();
int xthickb = xaxis->getThickness();
int ythickb = yaxis->getThickness();
QVERIFY(xthickb > xthicka);
QVERIFY(ythickb > ythicka);
}
void tTraceChartWidget::tnormalization_data() {
QTest::addColumn<int>("norm");
QTest::addColumn<QString>("label");
QTest::addColumn<float>("ymin");
QTest::addColumn<float>("ymax");
QTest::newRow("L1NORM") << (int)ROIVert::NORMALIZATION::L1NORM << "df/f (L1 Norm)" << 0.f << 0.4f;
QTest::newRow("L2NORM") << (int)ROIVert::NORMALIZATION::L2NORM << "df/f (L2 Norm)" << 0.f << .73f;
QTest::newRow("MEDIQR") << (int)ROIVert::NORMALIZATION::MEDIQR << "df/f (IQR units)" << -1.f << 1.f;
QTest::newRow("NONE") << (int)ROIVert::NORMALIZATION::NONE << "df/f" << 0.f << 4.f;
QTest::newRow("ZEROTOONE") << (int)ROIVert::NORMALIZATION::ZEROTOONE << "df/f (0-1)" << 0.f << 1.f;
QTest::newRow("ZSCORE") << (int)ROIVert::NORMALIZATION::ZSCORE << "df/f (z units)" << -sqrtf(2.f) << sqrtf(2.f);
}
void tTraceChartWidget::tnormalization() {
QFETCH(int, norm);
QFETCH(QString, label);
QFETCH(float, ymin);
QFETCH(float, ymax);
auto style = std::make_shared<ChartStyle>();
style->setNormalization(static_cast<ROIVert::NORMALIZATION>(norm + 1 % 6));
auto series = makeSeriesHelper(0, 1, { 0.f, 1.f, 2.f, 3.f, 4.f }, style);
chart->addSeries(series);
style->setNormalization(static_cast<ROIVert::NORMALIZATION>(norm));
chart->setStyle(style);
chart->updateStyle();
QCOMPARE(yaxis->getLabel(), label);
QVERIFY(std::abs(ymin - series->getYMin()) < .001);
QVERIFY(std::abs(ymax - series->getYMax()) < .001);
}
void tTraceChartWidget::taddremoveseries() {
auto series1 = makeSeriesHelper(1., 3., { 0.f, 2.f }, defstyle);
auto series2 = makeSeriesHelper(5., 7., { 3.f, 4.f }, defstyle);
QCOMPARE(std::get<0>(xaxis->getExtents()), 0);
QCOMPARE(std::get<1>(xaxis->getExtents()), 1);
QCOMPARE(std::get<0>(yaxis->getExtents()), 0);
QCOMPARE(std::get<1>(yaxis->getExtents()), 1);
QCOMPARE(chart->getSeries().size(), 0);
chart->addSeries(series1);
QCOMPARE(std::get<0>(xaxis->getExtents()), 1);
QCOMPARE(std::get<1>(xaxis->getExtents()), 3);
QCOMPARE(std::get<0>(yaxis->getExtents()), 0);
QCOMPARE(std::get<1>(yaxis->getExtents()), 2);
QCOMPARE(chart->getSeries().size(), 1);
QCOMPARE(chart->getSeries()[0].get(), series1.get());
chart->addSeries(series2);
QCOMPARE(std::get<0>(xaxis->getExtents()), 1);
QCOMPARE(std::get<1>(xaxis->getExtents()), 7);
QCOMPARE(std::get<0>(yaxis->getExtents()), 0);
QCOMPARE(std::get<1>(yaxis->getExtents()), 4);
QCOMPARE(chart->getSeries().size(), 2);
QCOMPARE(chart->getSeries()[0].get(), series1.get());
QCOMPARE(chart->getSeries()[1].get(), series2.get());
chart->removeSeries(series1);
QCOMPARE(std::get<0>(xaxis->getExtents()), 5);
QCOMPARE(std::get<1>(xaxis->getExtents()), 7);
QCOMPARE(std::get<0>(yaxis->getExtents()), 3);
QCOMPARE(std::get<1>(yaxis->getExtents()), 4);
QCOMPARE(chart->getSeries().size(), 1);
QCOMPARE(chart->getSeries()[0].get(), series2.get());
}
void tTraceChartWidget::ttitle() {
QCOMPARE(chart->getTitle(), "");
chart->setTitle("ABCD");
QCOMPARE(chart->getTitle(), "ABCD");
}
void tTraceChartWidget::tantialiasing() {
chart->setAntiAliasing(true);
QCOMPARE(chart->getAntiAliasing(), true);
chart->setAntiAliasing(false);
QCOMPARE(chart->getAntiAliasing(), false);
}
void tTraceChartWidget::tclick() {
// this test is going to depend on painting, so:
// set up a main window
// use a separate chart object as deleting the window will destroy the chart
auto win = std::make_unique<QMainWindow>();
win->setFixedSize(500, 500);
auto testchart = new TraceChartWidget(defstyle, win.get());
win->setCentralWidget(testchart);
bool clickfired = false;
std::vector<TraceChartSeries*> hitseries;
connect(testchart, &TraceChartWidget::chartClicked,
[&](TraceChartWidget*, std::vector<TraceChartSeries*> ser, Qt::KeyboardModifiers)
{
clickfired = true;
hitseries = ser;
}
);
auto series1 = makeSeriesHelper(0., 1., { 1.f, 1.f, 0.f, 0.f, 0.f }, defstyle);
auto series2 = makeSeriesHelper(0., 1., { 0.f, 0.f, 0.f, 1.f, 1.f }, defstyle);
testchart->addSeries(series1);
testchart->addSeries(series2);
win->show();
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
//click outside:
auto rect = testchart->contentsRect();
QPoint clicklocation(-1, -1);
QTest::mouseClick(testchart, Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, clicklocation);
QCOMPARE(clickfired, true);
QCOMPARE(hitseries.size(), 0);
// click left:
clickfired = false;
clicklocation.setX(rect.x() + rect.width() * .25);
clicklocation.setY(rect.y() + rect.height() * .5);
QTest::mouseClick(testchart, Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, clicklocation);
QCOMPARE(clickfired, true);
QCOMPARE(hitseries.size(), 1);
QCOMPARE(hitseries[0], series1.get());
// click right:
clickfired = false;
clicklocation.setX(rect.x() + rect.width() * .75);
clicklocation.setY(rect.y() + rect.height() * .5);
QTest::mouseClick(testchart, Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, clicklocation);
QCOMPARE(clickfired, true);
QCOMPARE(hitseries.size(), 1);
QCOMPARE(hitseries[0], series2.get());
// click right and get two series:
auto series3 = makeSeriesHelper(0., 1., { 0.f, 0.f, 0.f, 1.f, 1.f }, defstyle);
testchart->addSeries(series3);
clickfired = false;
clicklocation.setX(rect.x() + rect.width() * .75);
clicklocation.setY(rect.y() + rect.height() * .5);
QTest::mouseClick(testchart, Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, clicklocation);
QCOMPARE(clickfired, true);
QCOMPARE(hitseries.size(), 2);
QCOMPARE(hitseries[0], series2.get());
QCOMPARE(hitseries[1], series3.get());
// click middle and get an empty:
clickfired = false;
clicklocation.setX(rect.x() + rect.width() * .55);
clicklocation.setY(rect.y() + rect.height() * .5);
QTest::mouseClick(testchart, Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier, clicklocation);
QCOMPARE(clickfired, true);
QCOMPARE(hitseries.size(), 0);
}
void tTraceChartWidget::tseriesdata() {
// series extents tested elsewhere, test set/get with a swap:
auto series1 = makeSeriesHelper(0, 1, { 0.f, 1.f }, defstyle);
auto series2 = makeSeriesHelper(2, 3, { 2.f, 3.f }, defstyle);
cv::Mat data1 = series1->getData();
cv::Mat data2 = series2->getData();
series1->setData(data2);
series2->setData(data1);
QCOMPARE(series1->getData().at<float>(0), 2.f);
QCOMPARE(series1->getData().at<float>(1), 3.f);
QCOMPARE(series2->getData().at<float>(0), 0.f);
QCOMPARE(series2->getData().at<float>(1), 1.f);
// coercion out of float test:
cv::Mat dataint(1, 2, CV_8U);
dataint.at<uint8_t>(0, 0) = 1;
dataint.at<uint8_t>(0, 1) = 2;
series1->setData(dataint);
QCOMPARE(series1->getData().at<float>(0), 1.f);
QCOMPARE(series1->getData().at<float>(1), 2.f);
}
void tTraceChartWidget::tseriesextents() {
double xmin = 2., xmax = 3.;
float ymin = 4., ymax = 5.;
auto series = makeSeriesHelper(xmin, xmax, { ymin, ymax, (ymin + ymax) / 2.f }, defstyle);
QCOMPARE(series->getXMin(), xmin);
QCOMPARE(series->getXMax(), xmax);
QCOMPARE(series->getYMin(), ymin);
QCOMPARE(series->getYMax(), ymax);
QCOMPARE(series->getExtents(), QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax)));
}
void tTraceChartWidget::tseriesoffset() {
auto series = makeSeriesHelper(0, 1, { 1.f, 2.f }, defstyle);
series->setOffset(4.2f);
QCOMPARE(series->getOffset(), 4.2f);
QCOMPARE(series->getYMin(), 5.2f);
QCOMPARE(series->getYMax(), 6.2f);
}
void tTraceChartWidget::tseriesdegendata() {
// absent data for a series:
TraceChartSeries nodataseries;
QCOMPARE(nodataseries.getYMin(), 0);
QCOMPARE(nodataseries.getYMax(), 1);
auto style = std::make_shared<ChartStyle>();
auto novarseries = makeSeriesHelper(0., 1., { 1.5f, 1.5f, 1.5f, 1.5f }, style);
QCOMPARE(novarseries->getYMin(), 0.5);
QCOMPARE(novarseries->getYMax(), 2.5);
style->setNormalization(ROIVert::NORMALIZATION::MEDIQR);
novarseries->updatePoly();
QCOMPARE(novarseries->getYMin(), -1.);
QCOMPARE(novarseries->getYMax(), 1.);
style->setNormalization(ROIVert::NORMALIZATION::ZSCORE);
novarseries->updatePoly();
QCOMPARE(novarseries->getYMin(), -1.);
QCOMPARE(novarseries->getYMax(), 1.);
}
void tTraceChartWidget::tseriessetstyle() {
auto style1 = std::make_shared<ChartStyle>();
auto style2 = std::make_shared<ChartStyle>();
style1->setNormalization(ROIVert::NORMALIZATION::NONE);
style2->setNormalization(ROIVert::NORMALIZATION::ZEROTOONE);
auto series = makeSeriesHelper(0, 1, { 1., 100. }, style1);
QCOMPARE(series->getYMax(), 100.);
series->setStyle(style2);
series->updatePoly();
QVERIFY(std::abs(series->getYMax() - 1.) < .001);
}
void tTraceChartWidget::taxislimits() {
auto style = std::make_shared<ChartStyle>();
style->setXLimitStyle(ROIVert::LIMITSTYLE::AUTO);
TraceChartVAxis ax(style);
ax.setExtents(1., 2.);
QCOMPARE(std::get<0>(ax.getExtents()), 1.);
QCOMPARE(std::get<1>(ax.getExtents()), 2.);
QCOMPARE(std::get<0>(ax.getLimits()), 1.);
QCOMPARE(std::get<1>(ax.getLimits()), 2.);
ax.setExtents(-std::sqrt(2), 3.49);
QCOMPARE(std::get<0>(ax.getExtents()), -std::sqrt(2));
QCOMPARE(std::get<1>(ax.getExtents()), 3.49);
QCOMPARE(std::get<0>(ax.getLimits()), -1.5);
QCOMPARE(std::get<1>(ax.getLimits()), 3.5);
style->setYLimitStyle(ROIVert::LIMITSTYLE::TIGHT);
QCOMPARE(std::get<0>(ax.getLimits()), -std::sqrt(2));
QCOMPARE(std::get<1>(ax.getLimits()), 3.49);
style->setYLimitStyle(ROIVert::LIMITSTYLE::MANAGED);
ax.setManualLimits(4., 5.);
QCOMPARE(std::get<0>(ax.getLimits()), 4.);
QCOMPARE(std::get<1>(ax.getLimits()), 5.);
style->setNormalization(ROIVert::NORMALIZATION::ZEROTOONE);
QCOMPARE(std::get<0>(ax.getLimits()), 0.);
QCOMPARE(std::get<1>(ax.getLimits()), 1.);
// todo: test for hax non-auto limits
TraceChartHAxis hax(style);
hax.setExtents(-std::sqrt(2), 3.49);
QCOMPARE(std::get<0>(hax.getExtents()), -std::sqrt(2));
QCOMPARE(std::get<1>(hax.getExtents()), 3.49);
QCOMPARE(std::get<0>(hax.getLimits()), -1.5);
QCOMPARE(std::get<1>(hax.getLimits()), 3.5);
}
void tTraceChartWidget::taxisticks() {
auto style = std::make_shared<ChartStyle>();
TraceChartVAxis ax(style);
ax.setExtents(0, 10.);
// the actual ticks will be up to 2 more than the setting...
ax.setMaxNTicks(5);
QCOMPARE(ax.getTickValues(), std::vector<double>({ 0., 2., 4., 6., 8., 10. }));
ax.setMaxNTicks(11);
QCOMPARE(ax.getTickValues(), std::vector<double>({ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10. }));
ax.setMaxNTicks(20);
QCOMPARE(ax.getTickValues(), std::vector<double>({ 0., .5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10. }));
int withdec = ax.getThickness();
ax.setMaxNTicks(2);
QCOMPARE(ax.getTickValues(), std::vector<double>({ 0., 5., 10. }));
int withoutdec = ax.getThickness();
QVERIFY(withoutdec < withdec);
}
void tTraceChartWidget::taxisthickness_data() {
QTest::addColumn<QString>("font");
QTest::addColumn<int>("tickfontsize");
QTest::addColumn<int>("lblfontsize");
QTest::addColumn<int>("ticklength");
QTest::addColumn<int>("labelspacing");
QTest::addColumn<int>("ticklabelspacing");
QTest::addColumn<int>("tickmarkspacing");
QTest::addColumn<QString>("label");
QTest::newRow("1") << "Arial" << 5 << 10 << 3 << 1 << 2 << 3 << "ABC";
QTest::newRow("2") << "Arial" << 10 << 10 << 3 << 1 << 2 << 3 << "ABC";
QTest::newRow("3") << "Arial" << 5 << 20 << 3 << 1 << 2 << 3 << "ABC";
QTest::newRow("4") << "Arial" << 10 << 20 << 3 << 1 << 2 << 3 << "ABC";
QTest::newRow("5") << "Arial" << 5 << 10 << 5 << 7 << 3 << 5 << "ABC";
QTest::newRow("6") << "Arial" << 10 << 10 << 6 << 9 << 4 << 6 << "ABC";
QTest::newRow("7") << "Arial" << 5 << 20 << 7 << 9 << 5 << 7 << "ABC";
QTest::newRow("8") << "Arial" << 10 << 20 << 9 << 10 << 6 << 8 << "ABC";
QTest::newRow("9") << "Arial" << 5 << 20 << 7 << 9 << 5 << 7 << "ABC";
QTest::newRow("10") << "Arial" << 5 << 20 << 7 << 9 << 5 << 7 << "ABCDEFG";
QTest::newRow("11") << "Courier" << 5 << 20 << 7 << 9 << 5 << 7 << "ABC";
}
void tTraceChartWidget::taxisthickness() {
// return + ticklength;
QFETCH(QString, font);
QFETCH(int, tickfontsize);
QFETCH(int, lblfontsize);
QFETCH(int, ticklength);
QFETCH(int, labelspacing);
QFETCH(int, ticklabelspacing);
QFETCH(int, tickmarkspacing);
QFETCH(QString, label);
auto style = std::make_shared<ChartStyle>();
style->setFontFamily(font);
style->setTickLabelFontSize(tickfontsize);
style->setLabelFontSize(lblfontsize);
TraceChartHAxis hax(style);
hax.setTickLength(ticklength);
hax.setSpacings(labelspacing, ticklabelspacing, tickmarkspacing);
hax.setLabel(label);
TraceChartVAxis vax(style);
vax.setTickLength(ticklength);
vax.setSpacings(labelspacing, ticklabelspacing, tickmarkspacing);
vax.setLabel(label);
auto tickheight = QFontMetrics(QFont(font, tickfontsize)).height();
auto tickwidth = QFontMetrics(QFont(font, tickfontsize)).width("0.9");
auto labelheight = QFontMetrics(QFont(font, lblfontsize)).height();
auto exp_h = tickheight + labelheight + ticklength + labelspacing + ticklabelspacing + tickmarkspacing;
auto exp_v = tickwidth + labelheight + ticklength + labelspacing + ticklabelspacing + tickmarkspacing;
QCOMPARE(hax.getThickness(), exp_h);
QCOMPARE(vax.getThickness(), exp_v);
hax.setVisible(false);
vax.setVisible(false);
QCOMPARE(hax.getThickness(), 0.);
QCOMPARE(vax.getThickness(), 0.);
}
void tTraceChartWidget::tridgeline() {
auto ridge = RidgeLineWidget();
QCOMPARE(ridge.getYAxis()->getVisible(), false);
QCOMPARE(ridge.getXAxis()->getVisible(), true);
QCOMPARE(ridge.getXAxis()->getLabel(), "Time (s)");
ridge.offset = 1.5;
auto series1 = makeSeriesHelper(0, 1, { 0.f }, defstyle);
ridge.addSeries(series1);
auto series2 = makeSeriesHelper(0, 1, { 4.f }, defstyle);
ridge.addSeries(series2);
auto series3 = makeSeriesHelper(0, 1, { 4.f }, defstyle);
ridge.addSeries(series3);
ridge.updateOffsets();
QCOMPARE(series1->getOffset(), 0.);
QCOMPARE(series2->getOffset(), -1.5);
QCOMPARE(series3->getOffset(), -3.);
}
// todo:
// unclear how to test paint in general, other than a snapshot
// saveasimage...feels like it might belong in fileio, needs a file fixture? But maybe this is the snapshot test?
// minimumsizehint...waiting for this until more progress on sizing and AR | 37.771619 | 152 | 0.636748 | dbulk |
e0786e8c690b685a2ef440bf9c06eac8a4b4f1b7 | 1,754 | cpp | C++ | src/BFS_seq.cpp | FeLusiani/Parallel_BFS | bf5aa329a86ce2d5a3ce133516e5a2809bf42272 | [
"MIT"
] | null | null | null | src/BFS_seq.cpp | FeLusiani/Parallel_BFS | bf5aa329a86ce2d5a3ce133516e5a2809bf42272 | [
"MIT"
] | null | null | null | src/BFS_seq.cpp | FeLusiani/Parallel_BFS | bf5aa329a86ce2d5a3ce133516e5a2809bf42272 | [
"MIT"
] | null | null | null | #include <Parallel_BFS/BFS_seq.hpp>
#include <set>
#include <thread>
#include <chrono>
#include <numeric>
#include "../src/utimer.hpp"
int BFS_seq(int x, const vector<Node> &nodes)
{
unsigned long counter = 0;
vector<int> frontier{0};
frontier.reserve(nodes.size() / 2);
vector<int> next_frontier{};
next_frontier.reserve(nodes.size() / 2);
vector<bool> explored_nodes(nodes.size(), false);
while (!frontier.empty())
{
for (int n_id : frontier)
{
if (explored_nodes[n_id]) continue;
explored_nodes[n_id] = true;
counter += nodes[n_id].value == x;
next_frontier.insert(
next_frontier.end(),
nodes[n_id].children.begin(),
nodes[n_id].children.end()
);
}
frontier = move(next_frontier);
next_frontier.clear();
}
return counter;
}
/*
BFS SEQ using sets
int BFS_seq(int x, const vector<Node> &nodes)
{
int counter = 0;
set<int> frontier{0};
set<int> next_frontier{};
vector<bool> explored_nodes(nodes.size(), false);
// vector<int> frontier_size;
while (!frontier.empty())
{
// frontier_size.push_back(frontier.size());
for (int n_id : frontier)
{
if (explored_nodes[n_id])
continue;
explored_nodes[n_id] = true;
counter += nodes[n_id].value == x;
for (int child : nodes[n_id].children)
if (!explored_nodes[child])
next_frontier.insert(child);
}
frontier = next_frontier;
next_frontier.clear();
}
// cout << "frontier sizes: " << frontier_size << endl;
return counter;
}
*/ | 24.704225 | 59 | 0.559293 | FeLusiani |
e08043b2707eb73de096fd612b127feab974d601 | 16,351 | cpp | C++ | src/chainparams.cpp | MassGrid/MassGrid | 5634dda1b9997c3d230678b1b19b6af17b590a3d | [
"MIT"
] | 18 | 2018-01-31T10:02:27.000Z | 2021-04-16T14:22:31.000Z | src/chainparams.cpp | MassGrid/MassGrid | 5634dda1b9997c3d230678b1b19b6af17b590a3d | [
"MIT"
] | null | null | null | src/chainparams.cpp | MassGrid/MassGrid | 5634dda1b9997c3d230678b1b19b6af17b590a3d | [
"MIT"
] | 14 | 2018-02-11T02:07:00.000Z | 2022-03-18T10:28:06.000Z | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Copyright (c) 2017-2019 The MassGrid developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chainparams.h"
#include "consensus/merkle.h"
#include "tinyformat.h"
#include "util.h"
#include "utilstrencodings.h"
#include <assert.h>
#include <boost/assign/list_of.hpp>
#include "chainparamsseeds.h"
// #include "arith_uint256.h"
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
CMutableTransaction txNew;
txNew.nVersion = 1;
txNew.vin.resize(1);
txNew.vout.resize(1);
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
txNew.vout[0].nValue = genesisReward;
txNew.vout[0].scriptPubKey = genesisOutputScript;
CBlock genesis;
genesis.nTime = nTime;
genesis.nBits = nBits;
genesis.nNonce = nNonce;
genesis.nVersion = nVersion;
genesis.vtx.push_back(txNew);
genesis.hashPrevBlock.SetNull();
genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
return genesis;
}
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
const char* pszTimestamp = "MLGB create first block in Shenzhen, on 27th July., 2017";
const CScript genesisOutputScript = CScript() << ParseHex("0486661df18672bc959f622d09ad550f56154a4b3c812671ea601aff934324ed1cf8457b9015290d3c94fb6c140e92f3c1a59dddb07e49a12df41b2f2ea687b8e6") << OP_CHECKSIG;
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}
/**
* Main network
*/
/**
* What makes a good checkpoint block?
* + Is surrounded by blocks with reasonable timestamps
* (no blocks before with a timestamp after, none after with
* timestamp before)
* + Contains no strange transactions
*/
class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = "main";
consensus.nSubsidyHalvingInterval = 420768; //4 years
consensus.nMasternodePaymentsStartBlock = 111000; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 17568; // actual historical value 2 month 288*61
consensus.nInstantSendKeepLock = 24;
consensus.nGovernanceMinQuorum = 10;
consensus.nGovernanceFilterElements = 20000;
consensus.nMasternodeMinimumConfirmations = 15;
consensus.nMajorityEnforceBlockUpgrade = 750;
consensus.nMajorityRejectBlockOutdated = 950;
consensus.nMajorityWindow = 1000;
consensus.BIP34Height = 1;
consensus.BIP34Hash = uint256S("0x000007d91d1254d60e2dd1ae580383070a4ddffa4c64c2eeb4a2f9ecc0414343");
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 24 * 60 * 60; // MassGrid: 1 day
consensus.nPowTargetSpacing = 5 * 60; // MassGrid: 5 minutes
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false; // Retargeting
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000013ceafdd3e7344d8"); // 77922 // total POW
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x0000000000019144f85ab6fb476b11bea0c87f4bf2915873e04d7c9ad8736ff5"); // 77922
/**
* The message start string is designed to be unlikely to occur in normal data.
* The characters are rarely used upper ASCII, not valid as UTF-8, and produce
* a large 32-bit integer with any alignment.
*/
pchMessageStart[0] = 0x35;
pchMessageStart[1] = 0x65;
pchMessageStart[2] = 0x01;
pchMessageStart[3] = 0x22;
vAlertPubKey = ParseHex("038CEB40FA498FFEE9C53DDAA72ACD65048BCDDC752C796C7AECBBBA377A733D1D");
nDefaultPort = 9443;
nMaxTipAge = 24 * 60 * 60;
nDelayGetHeadersTime = 24 * 60 * 60;
nPruneAfterHeight = 100000;
genesis = CreateGenesisBlock(1507956294, 53408, 0x1e0ffff0, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x000006cda968d9b220b264050676efed86e2db52e29619ed3ef94fcf23cd86f4"));
assert(genesis.hashMerkleRoot == uint256S("0x010150a88cf516ade90a91f9198bc80eb59a110134c1f84abe75377165f82dc0"));
vFixedSeeds.clear();
vSeeds.clear();
vSeeds.push_back(CDNSSeedData("seed1.massgrid.net", "seed1.massgrid.net"));
vSeeds.push_back(CDNSSeedData("seed2.massgrid.net", "seed2.massgrid.net"));
vSeeds.push_back(CDNSSeedData("seed3.massgrid.net", "seed3.massgrid.net"));
vSeeds.push_back(CDNSSeedData("seed4.massgrid.net", "seed4.massgrid.net"));
vSeeds.push_back(CDNSSeedData("seed5.massgrid.net", "seed5.massgrid.net"));
vSeeds.push_back(CDNSSeedData("seed6.massgrid.net", "seed6.massgrid.net"));
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,50);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,38);
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,25);
// MassGrid BIP32 pubkeys start with 'xpub' (MassGrid defaults)
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x88)(0xB2)(0x1E).convert_to_container<std::vector<unsigned char> >();
// MassGrid BIP32 prvkeys start with 'xprv' (MassGrid defaults)
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x88)(0xAD)(0xE4).convert_to_container<std::vector<unsigned char> >();
// MassGrid BIP44 coin type is '5'
nExtCoinType = 5;
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false;
fRequireStandard = true;
fMineBlocksOnDemand = false;
fTestnetToBeDeprecatedFieldRPC = false;
nPoolMaxTransactions = 3;
nFulfilledRequestExpireTime = 60*60; // fulfilled requests expire in 1 hour
strSporkPubKey = "038CEB40FA498FFEE9C53DDAA72ACD65048BCDDC752C796C7AECBBBA377A733D1D";
checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 77922, uint256S("0x0000000000019144f85ab6fb476b11bea0c87f4bf2915873e04d7c9ad8736ff5")),
1530526800, // * UNIX timestamp of last checkpoint block
0, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
60000.0 // * estimated number of transactions per day after checkpoint
};
}
};
static CMainParams mainParams;
/**
* Testnet (v3)
*/
class CTestNetParams : public CChainParams {
public:
CTestNetParams() {
strNetworkID = "test";
consensus.nSubsidyHalvingInterval = 1;
consensus.nMasternodePaymentsStartBlock = 100; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 87840; // actual historical value 2 month 1440*61
consensus.nInstantSendKeepLock = 6;
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 500;
consensus.nMasternodeMinimumConfirmations = 1;
consensus.nMajorityEnforceBlockUpgrade = 51;
consensus.nMajorityRejectBlockOutdated = 75;
consensus.nMajorityWindow = 100;
consensus.BIP34Height = 1;
consensus.BIP34Hash = uint256S("0x000007d91d1254d60e2dd1ae580383070a4ddffa4c64c2eeb4a2f9ecc0414343");
consensus.powLimit = uint256S("0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 60 * 60; //60 blocks
consensus.nPowTargetSpacing = 1 * 60; //a minutes
consensus.fPowAllowMinDifficultyBlocks = true; // AllowMinDifficultyBlocks
consensus.fPowNoRetargeting = false; // // Retargeting
consensus.nMinimumChainWork = uint256S("0x00"); // 00
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x00"); // 0
pchMessageStart[0] = 0x87;
pchMessageStart[1] = 0x81;
pchMessageStart[2] = 0x35;
pchMessageStart[3] = 0x25;
vAlertPubKey = ParseHex("03E85467AF94A912DB61CABB54D6CBB08A5148A97D69024657665744AB8EA559C5");
nDefaultPort = 19443;
nMaxTipAge = 0x7fffffff;
nMaxTipAge = 0x7fffffff;
nPruneAfterHeight = 1000;
// /*get testnet genesis block*/
// uint32_t nonce=0;
// int64_t time=GetTime();
// for(;UintToArith256(genesis.GetHash()) > arith_uint256().SetCompact(0x1e0ffff0);++nonce){
// genesis = CreateGenesisBlock(time, nonce, 0x1e0ffff0, 1, 50 * COIN);
// if ((nonce& 0xffff) == 0)
// {
// std::cout<<"run out"<<std::endl;
// time=GetTime();
// nonce=0;
// }
// }
// --nonce;
// std::cout<<"result : "<<genesis.GetHash().ToString()<<std::endl<<
// "time : "<<time<<std::endl<<"nonce : "<<nonce<<std::endl<<
// "target : "<<arith_uint256().SetCompact(0x1e0ffff0).GetHex()<<std::endl;
// /*get testnet genesis block*/
genesis = CreateGenesisBlock(1551684552, 46315, 0x1e0ffff0, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x000004d4842fcce4b741b48e0dffdb721ae326954dcbdd68e1788cf9c0a3e4bf"));
assert(genesis.hashMerkleRoot == uint256S("0x010150a88cf516ade90a91f9198bc80eb59a110134c1f84abe75377165f82dc0"));
vFixedSeeds.clear();
vSeeds.clear();
vSeeds.push_back(CDNSSeedData("testseed1.massgrid.net", "testseed1.massgrid.net"));
vSeeds.push_back(CDNSSeedData("testseed2.massgrid.net", "testseed2.massgrid.net"));
vSeeds.push_back(CDNSSeedData("testseed3.massgrid.net", "testseed3.massgrid.net"));
vSeeds.push_back(CDNSSeedData("testseed4.massgrid.net", "testseed4.massgrid.net"));
vSeeds.push_back(CDNSSeedData("testseed5.massgrid.net", "testseed5.massgrid.net"));
vSeeds.push_back(CDNSSeedData("testseed6.massgrid.net", "testseed6.massgrid.net"));
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
// Testnet MassGrid BIP32 pubkeys start with 'tpub' (MassGrid defaults)
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >();
// Testnet MassGrid BIP32 prvkeys start with 'tprv' (MassGrid defaults)
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >();
// Testnet MassGrid BIP44 coin type is '1' (All coin's testnet default)
nExtCoinType = 1;
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false;
fRequireStandard = false;
fMineBlocksOnDemand = false;
fTestnetToBeDeprecatedFieldRPC = true;
nPoolMaxTransactions = 3;
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
strSporkPubKey = "03E85467AF94A912DB61CABB54D6CBB08A5148A97D69024657665744AB8EA559C5";
checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 0, uint256S("0x0000000020bc2c5ec220e3f660c5a9b59ff2f21ca054bcbe8c207eaa0292cce2")),
1501262349,
0,
300
};
}
};
static CTestNetParams testNetParams;
/**
* Regression test
*/
class CRegTestParams : public CChainParams {
public:
CRegTestParams() {
strNetworkID = "regtest";
consensus.nSubsidyHalvingInterval = 150;
consensus.nMasternodePaymentsStartBlock = 240;
consensus.nMasternodePaymentsIncreaseBlock = 87840;
consensus.nInstantSendKeepLock = 6;
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 100;
consensus.nMasternodeMinimumConfirmations = 1;
consensus.nMajorityEnforceBlockUpgrade = 750;
consensus.nMajorityRejectBlockOutdated = 950;
consensus.nMajorityWindow = 1000;
consensus.BIP34Height = -1; // BIP34 has not necessarily activated on regtest
consensus.BIP34Hash = uint256();
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 60 * 60; // two weeks
consensus.nPowTargetSpacing = 1 * 60;
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = true;
consensus.nMinimumChainWork = uint256S("0x00");
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x00");
pchMessageStart[0] = 0x45;
pchMessageStart[1] = 0x65;
pchMessageStart[2] = 0x76;
pchMessageStart[3] = 0x10;
nMaxTipAge = 24 * 60 * 60;
nDefaultPort = 18444;
nPruneAfterHeight = 1000;
genesis = CreateGenesisBlock(1506050827, 17367, 0x1e0ffff0, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x0000029a36746cc135f8ef8ae452a79b7f5d18a25e6f1fcd59cb39bf9a3bd08b"));
assert(genesis.hashMerkleRoot == uint256S("0x010150a88cf516ade90a91f9198bc80eb59a110134c1f84abe75377165f82dc0"));
vFixedSeeds.clear(); //! Regtest mode doesn't have any fixed seeds.
vSeeds.clear(); //! Regtest mode doesn't have any DNS seeds.
fMiningRequiresPeers = false;
fDefaultConsistencyChecks = true;
fRequireStandard = false;
fMineBlocksOnDemand = true;
fTestnetToBeDeprecatedFieldRPC = false;
checkpointData = (CCheckpointData){
boost::assign::map_list_of
( 0, uint256S("0x001")),
0,
0,
0
};
// Regtest MassGrid addresses start with 'y'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >();
// Regtest MassGrid BIP44 coin type is '1' (All coin's testnet default)
nExtCoinType = 1;
}
};
static CRegTestParams regTestParams;
static CChainParams *pCurrentParams = 0;
const CChainParams &Params() {
assert(pCurrentParams);
return *pCurrentParams;
}
CChainParams& Params(const std::string& chain)
{
if (chain == CBaseChainParams::MAIN)
return mainParams;
else if (chain == CBaseChainParams::TESTNET)
return testNetParams;
else if (chain == CBaseChainParams::REGTEST)
return regTestParams;
else
throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
}
void SelectParams(const std::string& network)
{
SelectBaseParams(network);
pCurrentParams = &Params(network);
}
| 46.320113 | 215 | 0.6906 | MassGrid |
e08254d83fc705762801ca6314e393389a0b3313 | 8,158 | cc | C++ | cnn/training.cc | ndnlp/cnn | aad187cda88f478a915dfd436115d573c347f9ca | [
"Apache-2.0"
] | null | null | null | cnn/training.cc | ndnlp/cnn | aad187cda88f478a915dfd436115d573c347f9ca | [
"Apache-2.0"
] | null | null | null | cnn/training.cc | ndnlp/cnn | aad187cda88f478a915dfd436115d573c347f9ca | [
"Apache-2.0"
] | null | null | null | #include "cnn/training.h"
#include "cnn/gpu-ops.h"
namespace cnn {
using namespace std;
Trainer::~Trainer() {}
float Trainer::clip_gradients() {
float gscale = 1;
if (clipping_enabled) {
float gg = model->gradient_l2_norm();
if (gg > clip_threshold) {
++clips;
gscale = clip_threshold / gg;
}
}
return gscale;
}
void SimpleSGDTrainer::update(real scale) {
const float gscale = clip_gradients();
for (auto p : model->parameters_list()) {
#if HAVE_CUDA
gpu::sgd_update(p->values.d.size(), p->g.v, p->values.v, eta * scale * gscale, lambda);
#else
auto reg = (*p->values) * lambda;
*p->values -= ((eta * scale * gscale) * *p->g + reg);
#endif
p->clear();
}
for (auto p : model->lookup_parameters_list()) {
for (auto i : p->non_zero_grads) {
#if HAVE_CUDA
gpu::sgd_update(p->values[i].d.size(), p->grads[i].v, p->values[i].v, eta * scale * gscale, lambda);
#else
auto reg = (*p->values[i]) * lambda;
*p->values[i] -= (*p->grads[i] * (eta * scale * gscale) + reg);
#endif
}
p->clear();
}
++updates;
}
void MomentumSGDTrainer::update(real scale) {
// executed on the first iteration to create vectors to
// store the velocity
if (!velocity_allocated) {
vp = AllocateShadowParameters(*model);
vlp = AllocateShadowLookupParameters(*model);
velocity_allocated = true;
}
const float gscale = clip_gradients();
unsigned pi = 0;
for (auto p : model->parameters_list()) {
Tensor& v = vp[pi++].h;
auto reg = *p->values * lambda;
(*v) = momentum * (*v) - (eta * scale * gscale) * (*p->g);
*p->values += *v - reg;
p->clear();
}
pi = 0;
for (auto p : model->lookup_parameters_list()) {
vector<Tensor>& vx = vlp[pi++].h;
for (auto i : p->non_zero_grads) {
Tensor& v = vx[i];
auto reg = (*p->values[i]) * lambda;
(*v) = momentum * (*v) - (eta * scale * gscale) * (*p->grads[i]);
*p->values[i] += *v - reg;
}
p->clear();
}
++updates;
}
void AdagradTrainer::update(real scale) {
unsigned pi;
if (!shadow_params_allocated) {
vp = AllocateShadowParameters(*model);
vlp = AllocateShadowLookupParameters(*model);
shadow_params_allocated = true;
}
pi = 0;
const float gscale = clip_gradients();
for (auto p : model->parameters_list()) {
Tensor& v = vp[pi++].h;
auto reg = (*p->values) * lambda;
auto g2 = (*p->g).cwiseProduct(*p->g);
(*v) += g2;
auto delta = -(eta * scale * gscale) * (*p->g).cwiseQuotient(((*v).array() + epsilon).matrix().cwiseSqrt());
*p->values += delta - reg;
p->clear();
}
pi = 0;
for (auto p : model->lookup_parameters_list()) {
vector<Tensor>& vx = vlp[pi++].h;
for (auto i : p->non_zero_grads) {
Tensor& v = vx[i];
auto reg = (*p->values[i]) * lambda;
auto g2 = (*p->grads[i]).cwiseProduct(*p->grads[i]);
(*v) += g2;
auto delta = -(eta * scale * gscale) * (*p->grads[i]).cwiseQuotient(((*v).array() + epsilon).matrix().cwiseSqrt());
*p->values[i] += delta - reg;
}
p->clear();
}
++updates;
}
void AdadeltaTrainer::update(real scale) {
unsigned pi;
if (!shadow_params_allocated) {
hg = AllocateShadowParameters(*model);
hlg = AllocateShadowLookupParameters(*model);
hd = AllocateShadowParameters(*model);
hld = AllocateShadowLookupParameters(*model);
/*pi = 0;
for (auto p : model->parameters_list()) {
TensorTools::Constant(hg[pi].h, epsilon);
TensorTools::Constant(hd[pi].h, epsilon);
++pi;
}
pi = 0;
for (auto p : model->lookup_parameters_list()) {
vector<Tensor>& hgx = hlg[pi].h;
vector<Tensor>& hdx = hld[pi].h;
for (unsigned i = 0; i < hgx.size(); ++i) {
TensorTools::Constant(hgx[i], epsilon);
TensorTools::Constant(hdx[i], epsilon);
}
++pi;
}*/
shadow_params_allocated = true;
}
const float gscale = clip_gradients();
pi = 0;
for (auto p : model->parameters_list()) {
auto& g = (scale * gscale) * *p->g;
Tensor& hgv = hg[pi].h;
Tensor& hdv = hd[pi].h;
auto reg = (*p->values) * lambda;
auto g2 = g.cwiseProduct(g);
*hgv = rho * *hgv + (1.0 - rho) * g2;
auto num = -g.cwiseProduct(((*hdv).array() + epsilon).matrix().cwiseSqrt());
auto den = ((*hgv).array() + epsilon).matrix().cwiseSqrt();
auto delta = num.cwiseQuotient(den);
auto d2 = delta.cwiseProduct(delta);
*hdv = rho * *hdv + (1.0 - rho) * d2;
*p->values += delta - reg;
p->clear();
pi++;
}
pi = 0;
for (auto p : model->lookup_parameters_list()) {
vector<Tensor>& hgvx = hlg[pi].h;
vector<Tensor>& hdvx = hld[pi].h;
for (auto i : p->non_zero_grads) {
Tensor& hgv = hgvx[i];
Tensor& hdv = hdvx[i];
auto& g = scale * gscale * *p->grads[i];
auto reg = (*p->values[i]) * lambda;
auto g2 = g.cwiseProduct(g);
*hgv = rho * *hgv + (1.0 - rho) * g2;
auto num = -g.cwiseProduct(((*hdv).array() + epsilon).matrix().cwiseSqrt());
auto den = ((*hgv).array() + epsilon).matrix().cwiseSqrt();
auto delta = num.cwiseQuotient(den);
auto d2 = delta.cwiseProduct(delta);
*hdv = rho * *hdv + (1.0 - rho) * d2;
*p->values[i] += delta - reg;
}
p->clear();
pi++;
}
++updates;
}
void RmsPropTrainer::update(real scale) {
unsigned pi = 0;
if (!shadow_params_allocated) {
hg.resize(model->parameters_list().size());
pi = 0;
hlg.resize(model->lookup_parameters_list().size());
for (auto p : model->lookup_parameters_list()) {
hlg[pi++].resize(p->size());
}
shadow_params_allocated = true;
}
const float gscale = clip_gradients();
pi = 0;
for (auto p : model->parameters_list()) {
real& d2 = hg[pi++];
auto reg = (*p->values) * lambda;
real g2 = (*p->g).squaredNorm();
d2 = rho * d2 + (1.0 - rho) * g2;
*p->values -= ((eta * scale * gscale / sqrt(d2 + epsilon)) * *p->g + reg);
p->clear();
}
pi = 0;
for (auto p : model->lookup_parameters_list()) {
vector<real>& hlgx = hlg[pi++];
for (auto i : p->non_zero_grads) {
real& d2 = hlgx[i];
auto reg = (*p->values[i]) * lambda;
real g2 = (*p->grads[i]).squaredNorm();
d2 = rho * d2 + (1.0 - rho) * g2;
*p->values[i] -= ((eta * scale * gscale / sqrt(d2 + epsilon)) * *p->grads[i] + reg);
}
p->clear();
}
++updates;
}
void AdamTrainer::update(real scale) {
unsigned pi;
if (!shadow_params_allocated) {
m = AllocateShadowParameters(*model);
lm = AllocateShadowLookupParameters(*model);
v = AllocateShadowParameters(*model);
lv = AllocateShadowLookupParameters(*model);
shadow_params_allocated = true;
}
const float gscale = clip_gradients();
pi = 0;
static unsigned t = 0;
for (auto p : model->parameters_list()) {
++t;
auto g_t = (scale * gscale) * *p->g;
auto m_t = *m[pi].h;
auto v_t = *v[pi].h;
auto reg = (*p->values) * lambda;
m_t = beta_1 * m_t + (1 - beta_1) * g_t;
auto g2 = g_t.cwiseProduct(g_t);
v_t = beta_2 * v_t + (1 - beta_2) * g2;
float s1 = 1 - pow(beta_1, t);
float s2 = 1 - pow(beta_2, t);
auto mhat = m_t / s1;
auto vhat = v_t / s2;
auto delta = (-eta * mhat).cwiseQuotient((vhat.array().sqrt() + eps).matrix());
*p->values += delta - reg;
p->clear();
pi++;
}
pi = 0;
for (auto p : model->lookup_parameters_list()) {
vector<Tensor>& vm = lm[pi].h;
vector<Tensor>& vv = lv[pi].h;
for (auto i : p->non_zero_grads) {
auto m_t = *vm[i];
auto v_t = *vv[i];
auto g_t = scale * gscale * *p->grads[i];
auto g2 = g_t.cwiseProduct(g_t);
auto reg = (*p->values[i]) * lambda;
m_t = beta_1 * m_t + (1 - beta_1) * g_t;
v_t = beta_2 * v_t + (1 - beta_2) * g2;
float s1 = 1 - pow(beta_1, t);
float s2 = 1 - pow(beta_2, t);
auto mhat = m_t / s1;
auto vhat = v_t / s2;
auto delta = (-eta * mhat).cwiseQuotient((vhat.array().sqrt() + eps).matrix());
*p->values[i] += delta - reg;
}
p->clear();
pi++;
}
++updates;
}
} // namespace cnn
| 28.425087 | 121 | 0.561535 | ndnlp |
e08513bc19bce2818256ad1d49b825828a5098ff | 9,640 | hpp | C++ | include/Avocado/backend/testing/testing_helpers.hpp | AvocadoML/Avocado | 9595cc5994d916f0ecb24873a5afa98437977fb5 | [
"Apache-2.0"
] | null | null | null | include/Avocado/backend/testing/testing_helpers.hpp | AvocadoML/Avocado | 9595cc5994d916f0ecb24873a5afa98437977fb5 | [
"Apache-2.0"
] | null | null | null | include/Avocado/backend/testing/testing_helpers.hpp | AvocadoML/Avocado | 9595cc5994d916f0ecb24873a5afa98437977fb5 | [
"Apache-2.0"
] | null | null | null | /*
* testing_helpers.hpp
*
* Created on: Sep 13, 2020
* Author: Maciej Kozarzewski
*/
#ifndef AVOCADO_UTILS_TESTING_HELPERS_HPP_
#define AVOCADO_UTILS_TESTING_HELPERS_HPP_
#include "../backend_defs.h"
#include "wrappers.hpp"
#include <string>
namespace avocado
{
namespace backend
{
void setMasterContext(avDeviceIndex_t deviceIndex, bool useDefault);
const ContextWrapper& getMasterContext();
bool supportsType(avDataType_t dtype);
bool isDeviceAvailable(const std::string &str);
void initForTest(TensorWrapper &t, double offset, double minValue = -1.0, double maxValue = 1.0);
double diffForTest(const TensorWrapper &lhs, const TensorWrapper &rhs);
double normForTest(const TensorWrapper &tensor);
void absForTest(TensorWrapper &tensor);
double epsilonForTest(avDataType_t dtype);
class ActivationTester
{
private:
avActivationType_t act;
TensorWrapper input;
TensorWrapper gradientOut;
TensorWrapper output_baseline;
TensorWrapper output_tested;
TensorWrapper gradientIn_baseline;
TensorWrapper gradientIn_tested;
public:
ActivationTester(avActivationType_t activation, std::initializer_list<int> shape, avDataType_t dtype);
double getDifferenceForward(const void *alpha, const void *beta) noexcept;
double getDifferenceBackward(const void *alpha, const void *beta) noexcept;
};
class SoftmaxTester
{
private:
avSoftmaxMode_t mode;
TensorWrapper input;
TensorWrapper gradientOut;
TensorWrapper output_baseline;
TensorWrapper output_tested;
TensorWrapper gradientIn_baseline;
TensorWrapper gradientIn_tested;
public:
SoftmaxTester(avSoftmaxMode_t mode, std::initializer_list<int> shape, avDataType_t dtype);
double getDifferenceForward(const void *alpha, const void *beta) noexcept;
double getDifferenceBackward(const void *alpha, const void *beta) noexcept;
};
class GemmTester
{
private:
avGemmOperation_t op_A, op_B;
TensorWrapper A;
TensorWrapper B;
TensorWrapper C_baseline;
TensorWrapper C_tested;
public:
GemmTester(int M, int N, int K, avGemmOperation_t opA, avGemmOperation_t opB, avDataType_t C_type, avDataType_t AB_type);
GemmTester(int M, int N, int K, avGemmOperation_t opA, avGemmOperation_t opB, avDataType_t dtype);
double getDifference(const void *alpha, const void *beta) noexcept;
};
class ConcatTester
{
private:
std::vector<int> shape;
avDataType_t dtype;
public:
ConcatTester(std::initializer_list<int> shape, avDataType_t dtype);
double getDifference() noexcept;
};
class SplitTester
{
private:
std::vector<int> shape;
avDataType_t dtype;
public:
SplitTester(std::initializer_list<int> shape, avDataType_t dtype);
double getDifference() noexcept;
};
class TransposeTester
{
private:
std::vector<int> shape;
avDataType_t dtype;
public:
TransposeTester(std::initializer_list<int> shape, avDataType_t dtype);
double getDifference(const std::vector<int> &ordering) noexcept;
};
class ScaleTester
{
private:
std::vector<int> shape;
avDataType_t dtype;
public:
ScaleTester(std::initializer_list<int> shape, avDataType_t dtype);
double getDifference(const void *alpha) noexcept;
};
class AddScalarTester
{
private:
std::vector<int> shape;
avDataType_t dtype;
public:
AddScalarTester(std::initializer_list<int> shape, avDataType_t dtype);
double getDifference(const void *scalar) noexcept;
};
class AddTensorsTester
{
private:
std::vector<int> shape;
avDataType_t input_dtype;
avDataType_t output_dtype;
public:
AddTensorsTester(std::initializer_list<int> shape, avDataType_t dtype);
AddTensorsTester(std::initializer_list<int> shape, avDataType_t input_dtype, avDataType_t output_dtype);
double getDifference(const void *alpha, const void *beta) noexcept;
};
class AddBiasTester
{
private:
std::vector<int> shape;
avDataType_t input_dtype;
avDataType_t output_dtype;
avDataType_t bias_dtype;
public:
AddBiasTester(std::initializer_list<int> shape, avDataType_t dtype);
AddBiasTester(std::initializer_list<int> shape, avDataType_t input_dtype, avDataType_t output_dtype, avDataType_t bias_dtype);
double getDifference(const void *alpha1, const void *alpha2, const void *beta1, const void *beta2, const void *beta3) noexcept;
};
class UnaryOpTester
{
private:
avUnaryOp_t op;
TensorWrapper input;
TensorWrapper output_baseline;
TensorWrapper output_tested;
public:
UnaryOpTester(avUnaryOp_t operation, std::initializer_list<int> shape, avDataType_t dtype);
double getDifference(const void *alpha, const void *beta) noexcept;
};
class BinaryOpTester
{
private:
avBinaryOp_t op;
TensorWrapper input;
TensorWrapper input_same;
TensorWrapper input_1d;
TensorWrapper input_single;
TensorWrapper output_baseline;
TensorWrapper output_tested;
public:
BinaryOpTester(avBinaryOp_t operation, std::initializer_list<int> shape, avDataType_t dtype);
double getDifferenceSame(const void *alpha1, const void *alpha2, const void *beta) noexcept;
double getDifference1D(const void *alpha1, const void *alpha2, const void *beta) noexcept;
double getDifferenceSingle(const void *alpha1, const void *alpha2, const void *beta) noexcept;
};
class ReductionTester
{
private:
avReduceOp_t op;
TensorWrapper input;
TensorWrapper output_baseline_1d;
TensorWrapper output_tested_1d;
TensorWrapper output_baseline_single;
TensorWrapper output_tested_single;
public:
ReductionTester(avReduceOp_t operation, std::initializer_list<int> shape, avDataType_t dtype);
double getDifference1D(const void *alpha, const void *beta) noexcept;
double getDifferenceSingle(const void *alpha, const void *beta) noexcept;
};
class BatchNormTester
{
private:
std::vector<int> shape;
avDataType_t dtype;
public:
BatchNormTester(std::vector<int> shape, avDataType_t dtype);
double getDifferenceInference(const void *alpha, const void *beta) noexcept;
double getDifferenceForward(const void *alpha, const void *beta) noexcept;
double getDifferenceBackward(const void *alpha, const void *beta, const void *alpha2, const void *beta2) noexcept;
};
class LossFunctionTester
{
private:
avLossType_t loss_type;
std::vector<int> shape;
avDataType_t dtype;
public:
LossFunctionTester(avLossType_t loss_type, std::vector<int> shape, avDataType_t dtype);
double getDifferenceLoss() noexcept;
double getDifferenceGradient(const void *alpha, const void *beta, bool isFused) noexcept;
};
class OptimizerTester
{
private:
OptimizerWrapper optimizer;
std::vector<int> shape;
avDataType_t dtype;
public:
OptimizerTester(std::vector<int> shape, avDataType_t dtype);
void set(avOptimizerType_t type, int64_t steps, double learningRate, const std::array<double, 4> &coefficients, const std::array<bool, 4> &flags);
double getDifference(const void *alpha, const void *beta) noexcept;
};
class RegularizerTest
{
private:
std::vector<int> shape;
avDataType_t dtype;
public:
RegularizerTest(std::vector<int> shape, avDataType_t dtype);
double getDifference(const void *scale, const void *offset) noexcept;
};
class Im2rowTest
{
private:
ConvolutionWrapper config;
std::vector<int> input_shape;
std::vector<int> filter_shape;
avDataType_t dtype;
public:
Im2rowTest(std::vector<int> inputShape, std::vector<int> filterShape, avDataType_t dtype);
void set(avConvolutionMode_t mode, const std::array<int, 3> &padding, const std::array<int, 3> &strides,
const std::array<int, 3> &dilation, int groups, const void *paddingValue);
double getDifference() noexcept;
};
class WinogradTest
{
private:
ConvolutionWrapper config;
std::vector<int> input_shape;
std::vector<int> filter_shape;
avDataType_t dtype;
int transform_size;
public:
WinogradTest(std::vector<int> inputShape, std::vector<int> filterShape, avDataType_t dtype, int transformSize);
void set(avConvolutionMode_t mode, const std::array<int, 3> &strides, const std::array<int, 3> &padding, int groups,
const void *paddingValue);
double getDifferenceWeight() noexcept;
double getDifferenceInput() noexcept;
double getDifferenceOutput(const void *alpha1, const void *alpha2, const void *beta, bool useBias, bool useExt) noexcept;
double getDifferenceGradient() noexcept;
double getDifferenceUpdate(const void *alpha, const void *beta) noexcept;
};
class ConvolutionTest
{
private:
ConvolutionWrapper config;
std::vector<int> input_shape;
std::vector<int> filter_shape;
avDataType_t dtype;
public:
ConvolutionTest(std::vector<int> inputShape, std::vector<int> filterShape, avDataType_t dtype);
void set(avConvolutionMode_t mode, const std::array<int, 3> &strides, const std::array<int, 3> &padding,
const std::array<int, 3> &dilation, int groups, const void *paddingValue);
double getDifferenceInference(const void *alpha, const void *beta) noexcept;
double getDifferenceForward(const void *alpha, const void *beta) noexcept;
double getDifferenceBackward(const void *alpha, const void *beta) noexcept;
double getDifferenceUpdate(const void *alpha, const void *beta) noexcept;
};
} /* namespace backend */
} /* namespace avocado */
#endif /* AVOCADO_UTILS_TESTING_HELPERS_HPP_ */
| 33.013699 | 150 | 0.735373 | AvocadoML |
e08a66c5f0126b3828706d41ffe45b98734c2cc1 | 400 | cpp | C++ | algorithms/delete-columns-to-make-sorted.cpp | Chronoviser/leetcode-1 | 65ee0504d64c345f822f216fef6e54dd62b8f858 | [
"MIT"
] | 41 | 2018-07-03T07:35:30.000Z | 2021-09-25T09:33:43.000Z | algorithms/delete-columns-to-make-sorted.cpp | Chronoviser/leetcode-1 | 65ee0504d64c345f822f216fef6e54dd62b8f858 | [
"MIT"
] | 2 | 2018-07-23T10:50:11.000Z | 2020-10-06T07:34:29.000Z | algorithms/delete-columns-to-make-sorted.cpp | Chronoviser/leetcode-1 | 65ee0504d64c345f822f216fef6e54dd62b8f858 | [
"MIT"
] | 7 | 2018-07-06T13:43:18.000Z | 2020-10-06T02:29:57.000Z | class Solution
{
public:
int minDeletionSize(vector<string>& A)
{
int result = 0;
for (int col = 0; col < A[0].length(); col++) {
for (int row = 0; row < A.size() - 1; row++) {
if (A[row][col] > A[row + 1][col]) {
result += 1;
break;
}
}
}
return result;
}
};
| 22.222222 | 58 | 0.3675 | Chronoviser |
e08c79bf9f445a8ea0f14e4089ff589ecf06f4ab | 5,424 | cpp | C++ | src/Nazara/Widgets/DefaultWidgetTheme.cpp | jayrulez/NazaraEngine | e0310cd141f3cc11dbe8abfd5bfedf6b61de1a99 | [
"BSD-3-Clause-Clear",
"Apache-2.0",
"MIT"
] | 11 | 2019-11-27T00:40:43.000Z | 2020-01-29T14:31:52.000Z | src/Nazara/Widgets/DefaultWidgetTheme.cpp | jayrulez/NazaraEngine | e0310cd141f3cc11dbe8abfd5bfedf6b61de1a99 | [
"BSD-3-Clause-Clear",
"Apache-2.0",
"MIT"
] | 7 | 2019-11-27T00:29:08.000Z | 2020-01-08T18:53:39.000Z | src/Nazara/Widgets/DefaultWidgetTheme.cpp | jayrulez/NazaraEngine | e0310cd141f3cc11dbe8abfd5bfedf6b61de1a99 | [
"BSD-3-Clause-Clear",
"Apache-2.0",
"MIT"
] | 7 | 2019-11-27T10:27:40.000Z | 2020-01-15T17:43:33.000Z | // Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Widgets module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Widgets/DefaultWidgetTheme.hpp>
#include <Nazara/Graphics/BasicMaterial.hpp>
#include <Nazara/Graphics/Material.hpp>
#include <Nazara/Graphics/MaterialPass.hpp>
#include <Nazara/Widgets/SimpleWidgetStyles.hpp>
#include <Nazara/Widgets/Widgets.hpp>
#include <Nazara/Widgets/Debug.hpp>
namespace Nz
{
namespace
{
const UInt8 s_defaultThemeButtonImage[] = {
#include <Nazara/Widgets/Resources/DefaultTheme/Button.png.h>
};
const UInt8 s_defaultThemeButtonHoveredImage[] = {
#include <Nazara/Widgets/Resources/DefaultTheme/ButtonHovered.png.h>
};
const UInt8 s_defaultThemeButtonPressedImage[] = {
#include <Nazara/Widgets/Resources/DefaultTheme/ButtonPressed.png.h>
};
const UInt8 s_defaultThemeButtonPressedHoveredImage[] = {
#include <Nazara/Widgets/Resources/DefaultTheme/ButtonPressedHovered.png.h>
};
const UInt8 s_defaultThemeCheckboxBackgroundImage[] = {
#include <Nazara/Widgets/Resources/DefaultTheme/CheckboxBackground.png.h>
};
const UInt8 s_defaultThemeCheckboxBackgroundHoveredImage[] = {
#include <Nazara/Widgets/Resources/DefaultTheme/CheckboxBackgroundHovered.png.h>
};
const UInt8 s_defaultThemeCheckboxCheckImage[] = {
#include <Nazara/Widgets/Resources/DefaultTheme/CheckboxCheck.png.h>
};
const UInt8 s_defaultThemeCheckboxTristateImage[] = {
#include <Nazara/Widgets/Resources/DefaultTheme/CheckboxTristate.png.h>
};
}
DefaultWidgetTheme::DefaultWidgetTheme()
{
TextureParams texParams;
texParams.renderDevice = Graphics::Instance()->GetRenderDevice();
texParams.loadFormat = PixelFormat::RGBA8_SRGB;
auto CreateMaterialFromTexture = [](std::shared_ptr<Texture> texture)
{
std::shared_ptr<MaterialPass> buttonMaterialPass = std::make_shared<MaterialPass>(BasicMaterial::GetSettings());
buttonMaterialPass->EnableDepthBuffer(true);
buttonMaterialPass->EnableDepthWrite(false);
buttonMaterialPass->EnableBlending(true);
buttonMaterialPass->SetBlendEquation(BlendEquation::Add, BlendEquation::Add);
buttonMaterialPass->SetBlendFunc(BlendFunc::SrcAlpha, BlendFunc::InvSrcAlpha, BlendFunc::One, BlendFunc::One);
std::shared_ptr<Material> material = std::make_shared<Material>();
material->AddPass("ForwardPass", buttonMaterialPass);
BasicMaterial buttonBasicMat(*buttonMaterialPass);
buttonBasicMat.SetDiffuseMap(texture);
return material;
};
// Button material
m_buttonMaterial = CreateMaterialFromTexture(Texture::LoadFromMemory(s_defaultThemeButtonImage, sizeof(s_defaultThemeButtonImage), texParams));
m_buttonHoveredMaterial = CreateMaterialFromTexture(Texture::LoadFromMemory(s_defaultThemeButtonHoveredImage, sizeof(s_defaultThemeButtonHoveredImage), texParams));
m_buttonPressedMaterial = CreateMaterialFromTexture(Texture::LoadFromMemory(s_defaultThemeButtonPressedImage, sizeof(s_defaultThemeButtonPressedImage), texParams));
m_buttonPressedHoveredMaterial = CreateMaterialFromTexture(Texture::LoadFromMemory(s_defaultThemeButtonPressedHoveredImage, sizeof(s_defaultThemeButtonPressedHoveredImage), texParams));
// Checkbox material
m_checkboxBackgroundMaterial = CreateMaterialFromTexture(Texture::LoadFromMemory(s_defaultThemeCheckboxBackgroundImage, sizeof(s_defaultThemeCheckboxBackgroundImage), texParams));
m_checkboxBackgroundHoveredMaterial = CreateMaterialFromTexture(Texture::LoadFromMemory(s_defaultThemeCheckboxBackgroundHoveredImage, sizeof(s_defaultThemeCheckboxBackgroundHoveredImage), texParams));
m_checkboxCheckMaterial = CreateMaterialFromTexture(Texture::LoadFromMemory(s_defaultThemeCheckboxCheckImage, sizeof(s_defaultThemeCheckboxCheckImage), texParams));
m_checkboxTristateMaterial = CreateMaterialFromTexture(Texture::LoadFromMemory(s_defaultThemeCheckboxTristateImage, sizeof(s_defaultThemeCheckboxTristateImage), texParams));
}
std::unique_ptr<ButtonWidgetStyle> DefaultWidgetTheme::CreateStyle(ButtonWidget* buttonWidget) const
{
SimpleButtonWidgetStyle::StyleConfig styleConfig;
styleConfig.cornerSize = 20.f;
styleConfig.cornerTexCoords = 20.f / 128.f;
styleConfig.hoveredMaterial = m_buttonHoveredMaterial;
styleConfig.material = m_buttonMaterial;
styleConfig.pressedHoveredMaterial = m_buttonPressedHoveredMaterial;
styleConfig.pressedMaterial = m_buttonPressedMaterial;
return std::make_unique<SimpleButtonWidgetStyle>(buttonWidget, styleConfig);
}
std::unique_ptr<CheckboxWidgetStyle> DefaultWidgetTheme::CreateStyle(CheckboxWidget* checkboxWidget) const
{
SimpleCheckboxWidgetStyle::StyleConfig styleConfig;
styleConfig.backgroundCornerSize = 10.f;
styleConfig.backgroundCornerTexCoords = 10.f / 64.f;
styleConfig.backgroundHoveredMaterial = m_checkboxBackgroundHoveredMaterial;
styleConfig.backgroundMaterial = m_checkboxBackgroundMaterial;
styleConfig.checkMaterial = m_checkboxCheckMaterial;
styleConfig.tristateMaterial = m_checkboxTristateMaterial;
return std::make_unique<SimpleCheckboxWidgetStyle>(checkboxWidget, styleConfig);
}
std::unique_ptr<LabelWidgetStyle> DefaultWidgetTheme::CreateStyle(LabelWidget* labelWidget) const
{
return std::make_unique<SimpleLabelWidgetStyle>(labelWidget, Widgets::Instance()->GetTransparentMaterial());
}
}
| 45.966102 | 202 | 0.817478 | jayrulez |
e08e8562eea94dfd43c7163d9de1978d01819562 | 10,001 | cpp | C++ | obs-studio/UI/qt-wrappers.cpp | noelemahcz/libobspp | 029472b973e5a1985f883242f249848385df83a3 | [
"MIT"
] | null | null | null | obs-studio/UI/qt-wrappers.cpp | noelemahcz/libobspp | 029472b973e5a1985f883242f249848385df83a3 | [
"MIT"
] | null | null | null | obs-studio/UI/qt-wrappers.cpp | noelemahcz/libobspp | 029472b973e5a1985f883242f249848385df83a3 | [
"MIT"
] | null | null | null | /******************************************************************************
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
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, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include "qt-wrappers.hpp"
#include "obs-app.hpp"
#include <graphics/graphics.h>
#include <util/threading.h>
#include <QWidget>
#include <QLayout>
#include <QComboBox>
#include <QMessageBox>
#include <QDataStream>
#include <QKeyEvent>
#include <QFileDialog>
#include <QStandardItemModel>
#if !defined(_WIN32) && !defined(__APPLE__)
#include <obs-nix-platform.h>
#endif
#ifdef ENABLE_WAYLAND
#include <qpa/qplatformnativeinterface.h>
#endif
static inline void OBSErrorBoxva(QWidget *parent, const char *msg, va_list args)
{
char full_message[4096];
vsnprintf(full_message, 4095, msg, args);
QMessageBox::critical(parent, "Error", full_message);
}
void OBSErrorBox(QWidget *parent, const char *msg, ...)
{
va_list args;
va_start(args, msg);
OBSErrorBoxva(parent, msg, args);
va_end(args);
}
QMessageBox::StandardButton
OBSMessageBox::question(QWidget *parent, const QString &title,
const QString &text,
QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton)
{
QMessageBox mb(QMessageBox::Question, title, text, buttons, parent);
mb.setDefaultButton(defaultButton);
if (buttons & QMessageBox::Ok)
mb.setButtonText(QMessageBox::Ok, QTStr("OK"));
#define translate_button(x) \
if (buttons & QMessageBox::x) \
mb.setButtonText(QMessageBox::x, QTStr(#x));
translate_button(Open);
translate_button(Save);
translate_button(Cancel);
translate_button(Close);
translate_button(Discard);
translate_button(Apply);
translate_button(Reset);
translate_button(Yes);
translate_button(No);
translate_button(Abort);
translate_button(Retry);
translate_button(Ignore);
#undef translate_button
return (QMessageBox::StandardButton)mb.exec();
}
void OBSMessageBox::information(QWidget *parent, const QString &title,
const QString &text)
{
QMessageBox mb(QMessageBox::Information, title, text, QMessageBox::Ok,
parent);
mb.setButtonText(QMessageBox::Ok, QTStr("OK"));
mb.exec();
}
void OBSMessageBox::warning(QWidget *parent, const QString &title,
const QString &text, bool enableRichText)
{
QMessageBox mb(QMessageBox::Warning, title, text, QMessageBox::Ok,
parent);
if (enableRichText)
mb.setTextFormat(Qt::RichText);
mb.setButtonText(QMessageBox::Ok, QTStr("OK"));
mb.exec();
}
void OBSMessageBox::critical(QWidget *parent, const QString &title,
const QString &text)
{
QMessageBox mb(QMessageBox::Critical, title, text, QMessageBox::Ok,
parent);
mb.setButtonText(QMessageBox::Ok, QTStr("OK"));
mb.exec();
}
bool QTToGSWindow(QWindow *window, gs_window &gswindow)
{
bool success = true;
#ifdef _WIN32
gswindow.hwnd = (HWND)window->winId();
#elif __APPLE__
gswindow.view = (id)window->winId();
#else
switch (obs_get_nix_platform()) {
case OBS_NIX_PLATFORM_X11_GLX:
case OBS_NIX_PLATFORM_X11_EGL:
gswindow.id = window->winId();
gswindow.display = obs_get_nix_platform_display();
break;
#ifdef ENABLE_WAYLAND
case OBS_NIX_PLATFORM_WAYLAND:
QPlatformNativeInterface *native =
QGuiApplication::platformNativeInterface();
gswindow.display =
native->nativeResourceForWindow("surface", window);
success = gswindow.display != nullptr;
break;
#endif
}
#endif
return success;
}
uint32_t TranslateQtKeyboardEventModifiers(Qt::KeyboardModifiers mods)
{
int obsModifiers = INTERACT_NONE;
if (mods.testFlag(Qt::ShiftModifier))
obsModifiers |= INTERACT_SHIFT_KEY;
if (mods.testFlag(Qt::AltModifier))
obsModifiers |= INTERACT_ALT_KEY;
#ifdef __APPLE__
// Mac: Meta = Control, Control = Command
if (mods.testFlag(Qt::ControlModifier))
obsModifiers |= INTERACT_COMMAND_KEY;
if (mods.testFlag(Qt::MetaModifier))
obsModifiers |= INTERACT_CONTROL_KEY;
#else
// Handle windows key? Can a browser even trap that key?
if (mods.testFlag(Qt::ControlModifier))
obsModifiers |= INTERACT_CONTROL_KEY;
if (mods.testFlag(Qt::MetaModifier))
obsModifiers |= INTERACT_COMMAND_KEY;
#endif
return obsModifiers;
}
QDataStream &operator<<(QDataStream &out,
const std::vector<std::shared_ptr<OBSSignal>> &)
{
return out;
}
QDataStream &operator>>(QDataStream &in,
std::vector<std::shared_ptr<OBSSignal>> &)
{
return in;
}
QDataStream &operator<<(QDataStream &out, const OBSScene &scene)
{
return out << QString(obs_source_get_name(obs_scene_get_source(scene)));
}
QDataStream &operator>>(QDataStream &in, OBSScene &scene)
{
QString sceneName;
in >> sceneName;
OBSSourceAutoRelease source =
obs_get_source_by_name(QT_TO_UTF8(sceneName));
scene = obs_scene_from_source(source);
return in;
}
QDataStream &operator<<(QDataStream &out, const OBSSceneItem &si)
{
obs_scene_t *scene = obs_sceneitem_get_scene(si);
obs_source_t *source = obs_sceneitem_get_source(si);
return out << QString(obs_source_get_name(obs_scene_get_source(scene)))
<< QString(obs_source_get_name(source));
}
QDataStream &operator>>(QDataStream &in, OBSSceneItem &si)
{
QString sceneName;
QString sourceName;
in >> sceneName >> sourceName;
OBSSourceAutoRelease sceneSource =
obs_get_source_by_name(QT_TO_UTF8(sceneName));
obs_scene_t *scene = obs_scene_from_source(sceneSource);
si = obs_scene_find_source(scene, QT_TO_UTF8(sourceName));
return in;
}
void DeleteLayout(QLayout *layout)
{
if (!layout)
return;
for (;;) {
QLayoutItem *item = layout->takeAt(0);
if (!item)
break;
QLayout *subLayout = item->layout();
if (subLayout) {
DeleteLayout(subLayout);
} else {
delete item->widget();
delete item;
}
}
delete layout;
}
class QuickThread : public QThread {
public:
explicit inline QuickThread(std::function<void()> func_) : func(func_)
{
}
private:
virtual void run() override { func(); }
std::function<void()> func;
};
QThread *CreateQThread(std::function<void()> func)
{
return new QuickThread(func);
}
volatile long insideEventLoop = 0;
void ExecuteFuncSafeBlock(std::function<void()> func)
{
QEventLoop eventLoop;
auto wait = [&]() {
func();
QMetaObject::invokeMethod(&eventLoop, "quit",
Qt::QueuedConnection);
};
os_atomic_inc_long(&insideEventLoop);
QScopedPointer<QThread> thread(CreateQThread(wait));
thread->start();
eventLoop.exec();
thread->wait();
os_atomic_dec_long(&insideEventLoop);
}
void ExecuteFuncSafeBlockMsgBox(std::function<void()> func,
const QString &title, const QString &text)
{
QMessageBox dlg;
dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowCloseButtonHint);
dlg.setWindowTitle(title);
dlg.setText(text);
dlg.setStandardButtons(QMessageBox::StandardButtons());
auto wait = [&]() {
func();
QMetaObject::invokeMethod(&dlg, "accept", Qt::QueuedConnection);
};
os_atomic_inc_long(&insideEventLoop);
QScopedPointer<QThread> thread(CreateQThread(wait));
thread->start();
dlg.exec();
thread->wait();
os_atomic_dec_long(&insideEventLoop);
}
static bool enable_message_boxes = false;
void EnableThreadedMessageBoxes(bool enable)
{
enable_message_boxes = enable;
}
void ExecThreadedWithoutBlocking(std::function<void()> func,
const QString &title, const QString &text)
{
if (!enable_message_boxes)
ExecuteFuncSafeBlock(func);
else
ExecuteFuncSafeBlockMsgBox(func, title, text);
}
bool LineEditCanceled(QEvent *event)
{
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = reinterpret_cast<QKeyEvent *>(event);
return keyEvent->key() == Qt::Key_Escape;
}
return false;
}
bool LineEditChanged(QEvent *event)
{
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = reinterpret_cast<QKeyEvent *>(event);
switch (keyEvent->key()) {
case Qt::Key_Tab:
case Qt::Key_Backtab:
case Qt::Key_Enter:
case Qt::Key_Return:
return true;
}
} else if (event->type() == QEvent::FocusOut) {
return true;
}
return false;
}
void SetComboItemEnabled(QComboBox *c, int idx, bool enabled)
{
QStandardItemModel *model =
dynamic_cast<QStandardItemModel *>(c->model());
QStandardItem *item = model->item(idx);
item->setFlags(enabled ? Qt::ItemIsSelectable | Qt::ItemIsEnabled
: Qt::NoItemFlags);
}
void setThemeID(QWidget *widget, const QString &themeID)
{
if (widget->property("themeID").toString() != themeID) {
widget->setProperty("themeID", themeID);
/* force style sheet recalculation */
QString qss = widget->styleSheet();
widget->setStyleSheet("/* */");
widget->setStyleSheet(qss);
}
}
QString SelectDirectory(QWidget *parent, QString title, QString path)
{
QString dir = QFileDialog::getExistingDirectory(
parent, title, path,
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
return dir;
}
QString SaveFile(QWidget *parent, QString title, QString path,
QString extensions)
{
QString file =
QFileDialog::getSaveFileName(parent, title, path, extensions);
return file;
}
QString OpenFile(QWidget *parent, QString title, QString path,
QString extensions)
{
QString file =
QFileDialog::getOpenFileName(parent, title, path, extensions);
return file;
}
QStringList OpenFiles(QWidget *parent, QString title, QString path,
QString extensions)
{
QStringList files =
QFileDialog::getOpenFileNames(parent, title, path, extensions);
return files;
}
| 24.693827 | 80 | 0.721828 | noelemahcz |
e08f1cafd3e31cfce506114367d2ea2fe80adb43 | 236 | cpp | C++ | src/autowiring/SystemThreadPool.cpp | CaseyCarter/autowiring | 48e95a71308318c8ffb7ed1348e034fd9110f70c | [
"Apache-2.0"
] | 87 | 2015-01-18T00:43:06.000Z | 2022-02-11T17:40:50.000Z | src/autowiring/SystemThreadPool.cpp | CaseyCarter/autowiring | 48e95a71308318c8ffb7ed1348e034fd9110f70c | [
"Apache-2.0"
] | 274 | 2015-01-03T04:50:49.000Z | 2021-03-08T09:01:09.000Z | src/autowiring/SystemThreadPool.cpp | CaseyCarter/autowiring | 48e95a71308318c8ffb7ed1348e034fd9110f70c | [
"Apache-2.0"
] | 15 | 2015-09-30T20:58:43.000Z | 2020-12-19T21:24:56.000Z | // Copyright (C) 2012-2018 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "SystemThreadPool.h"
using namespace autowiring;
SystemThreadPool::SystemThreadPool(void)
{}
SystemThreadPool::~SystemThreadPool(void)
{}
| 19.666667 | 65 | 0.771186 | CaseyCarter |
e094a2f52013c03c6b963811714185f8b24fdb22 | 1,630 | cpp | C++ | graph/bellman_ford (spfa).cpp | New2World/algorithm-template | ecef386e7d485ce0bd1e11de422be7a818239506 | [
"MIT"
] | null | null | null | graph/bellman_ford (spfa).cpp | New2World/algorithm-template | ecef386e7d485ce0bd1e11de422be7a818239506 | [
"MIT"
] | null | null | null | graph/bellman_ford (spfa).cpp | New2World/algorithm-template | ecef386e7d485ce0bd1e11de422be7a818239506 | [
"MIT"
] | null | null | null | /*
洛谷 P3385 - 负环
*/
#include <bits/stdc++.h>
#define MAXV 2005
#define MAXE 6005
#define inf 0x3f3f3f3f
using namespace std;
struct _edge {
int v, w, next;
_edge(){}
_edge(int v, int w, int next):v(v), w(w), next(next){}
};
int edges, n;
int head[MAXV];
int dis[MAXV], cnt[MAXV];
bool vis[MAXV];
_edge edge[MAXE];
void addedge(int u, int v, int w){
edge[edges] = _edge(v, w, head[u]);
head[u] = edges++;
}
bool spfa(int s, int n){ // TODO: SFL & LLL
int u, v, w;
queue<int> q;
dis[s] = 0;
q.push(s);
while(!q.empty()){
u = q.front();
q.pop();
vis[u] = false;
cnt[u]++;
for(int i = head[u];i >= 0;i = edge[i].next){
v = edge[i].v;
w = edge[i].w;
if(dis[v] > dis[u] + w){
dis[v] = dis[u] + w;
if(cnt[v] >= n) return false;
if(!vis[v]){
q.push(v);
vis[v] = true;
}
}
}
}
return true;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("test.txt", "r", stdin);
#endif
int T, m, u, v, w;
scanf("%d", &T);
while(T--){
scanf("%d %d", &n, &m);
for(int i = 1;i <= n;i++){
vis[i] = false;
dis[i] = inf;
head[i] = -1;
cnt[i] = 0;
}
edges = 0;
for(int i = 0;i < m;i++){
scanf("%d %d %d", &u, &v, &w);
addedge(u, v, w);
if(w >= 0)
addedge(v, u, w);
}
printf(spfa(1, n)?"NO\n":"YES\n");
}
return 0;
} | 20.123457 | 58 | 0.398773 | New2World |
e09599a21109971ede4ff355f1d86b96c8bcc20a | 3,529 | cpp | C++ | src/io/field_io.cpp | lanl/shoccs | 6fd72a612e872df62749eec6b010bd1f1e5ee1e7 | [
"BSD-3-Clause"
] | null | null | null | src/io/field_io.cpp | lanl/shoccs | 6fd72a612e872df62749eec6b010bd1f1e5ee1e7 | [
"BSD-3-Clause"
] | 2 | 2022-02-18T22:43:06.000Z | 2022-02-18T22:43:19.000Z | src/io/field_io.cpp | lanl/shoccs | 6fd72a612e872df62749eec6b010bd1f1e5ee1e7 | [
"BSD-3-Clause"
] | null | null | null | #include "field_io.hpp"
#include <filesystem>
#include <fstream>
#include <iomanip>
#include "mesh/cartesian.hpp"
#include "temporal/step_controller.hpp"
#include <fmt/core.h>
#include <range/v3/range/conversion.hpp>
#include <range/v3/view/transform.hpp>
#include <sol/sol.hpp>
using namespace std::literals;
namespace ccs
{
namespace fs = std::filesystem;
field_io::field_io(xdmf&& xdmf_w,
field_data&& field_data_w,
d_interval&& dump_interval,
std::string&& io_dir,
int suffix_length,
bool enable_logging)
: xdmf_w{MOVE(xdmf_w)},
field_data_w{MOVE(field_data_w)},
dump_interval{MOVE(dump_interval)},
io_dir{MOVE(io_dir)},
suffix_length{suffix_length},
logger{enable_logging, "field_io"}
{
}
bool field_io::write(std::span<const std::string> names,
field_view f,
const step_controller& step,
real dt,
tuple<std::span<const mesh_object_info>,
std::span<const mesh_object_info>,
std::span<const mesh_object_info>> r)
{
if (!dump_interval(step, dt)) return false;
fs::path io{io_dir};
if ((int)step == 0) fs::create_directories(io);
int n = dump_interval.current_dump();
// prepare data for xdmf writer
auto xmf_file_names = names | vs::transform([n, l = suffix_length](auto&& name) {
return fmt::format("{}.{:0{}d}", name, n, l);
}) |
rs::to<std::vector<std::string>>();
xdmf_w.write(n, step, names, xmf_file_names, r, logger);
if (n == 0) {
auto file_names = std::vector<std::string>{io / "rx", io / "ry", io / "rz"};
field_data_w.write_geom(file_names, r);
}
auto data_file_names = xmf_file_names |
vs::transform([io](auto&& name) { return io / name; }) |
rs::to<std::vector<std::string>>();
field_data_w.write(f, data_file_names);
++dump_interval;
return true;
}
std::optional<field_io> field_io::from_lua(const sol::table& tbl, const logs& logger)
{
auto cart_opt = cartesian::from_lua(tbl);
if (!cart_opt) return std::nullopt;
auto io = tbl["io"];
if (!io.valid()) return field_io{};
sol::optional<int> write_every_step = io["write_every_step"];
sol::optional<real> write_every_time = io["write_every_time"];
std::string dir = io["dir"].get_or("io"s);
int len = io["suffix_length"].get_or(6);
std::string xmf_base = io["xdmf_filename"].get_or("view.xmf"s);
if (write_every_step) {
logger(
spdlog::level::info, "field io will write every {} steps", *write_every_step);
} else if (write_every_time) {
logger(spdlog::level::info,
"field io will write every {} time interval",
*write_every_time);
} else {
logger(spdlog::level::info, "field io will not output data");
}
auto d = fs::path{dir};
auto&& [ix, dom] = *cart_opt;
auto xdmf_w = xdmf{d / xmf_base, ix, dom};
auto data_w = field_data{ix};
auto step = write_every_step ? interval<int>{*write_every_step} : interval<int>{};
auto time = write_every_time ? interval<real>{*write_every_time} : interval<real>{};
return field_io{
MOVE(xdmf_w), MOVE(data_w), d_interval{step, time}, MOVE(dir), len, logger};
}
} // namespace ccs
| 31.508929 | 90 | 0.587985 | lanl |
e096317ac142c3dbeee71b27c4f2b395f984f84f | 185 | cpp | C++ | src/main.cpp | AleksanderSiwek/Fluide_Engine | 12c626105b079a3dd21a3cc95b7d98342d041f5d | [
"MIT"
] | null | null | null | src/main.cpp | AleksanderSiwek/Fluide_Engine | 12c626105b079a3dd21a3cc95b7d98342d041f5d | [
"MIT"
] | null | null | null | src/main.cpp | AleksanderSiwek/Fluide_Engine | 12c626105b079a3dd21a3cc95b7d98342d041f5d | [
"MIT"
] | null | null | null | #include <iostream>
#include "./common/frame.hpp"
int main()
{
Frame frame;
std::cout << "hello peter!\n";
std::cout << "Frame index = " << frame.GetIndex() << std::endl;
} | 20.555556 | 67 | 0.583784 | AleksanderSiwek |
e09825fb9b63d5e5d316b01ff3877ef012fddccb | 6,800 | cpp | C++ | mugsy-seqan/projects/tests/index/test_index_creation.cpp | kloetzl/mugsy | 8ccdf32858a7a5ab2f7b9b084d2190970feb97ec | [
"Artistic-2.0"
] | null | null | null | mugsy-seqan/projects/tests/index/test_index_creation.cpp | kloetzl/mugsy | 8ccdf32858a7a5ab2f7b9b084d2190970feb97ec | [
"Artistic-2.0"
] | null | null | null | mugsy-seqan/projects/tests/index/test_index_creation.cpp | kloetzl/mugsy | 8ccdf32858a7a5ab2f7b9b084d2190970feb97ec | [
"Artistic-2.0"
] | null | null | null | #include <iostream>
#include <fstream>
#include <typeinfo>
#include <time.h>
#include <cstdio>
#include <vector>
#include <time.h>
#define SEQAN_PROFILE
//#define SEQAN_DEBUG
//#define SEQAN_DEBUG_INDEX
//#define SEQAN_TEST
//#define SEQAN_TEST_SKEW3
//#define SEQAN_TEST_SKEW7
#include "test_index_creation.h"
#include <seqan/index.h>
using namespace std;
using namespace seqan;
//////////////////////////////////////////////////////////////////////////////
bool testIndexCreation()
{
typedef String<char> TText;
typedef String<unsigned> TArray;
TText text;
TArray sa;
TArray lcp;
TArray child, childExt;
TText bwt;
const int runs = 10; // conduct 10 test runs
const int maxSize = 20 * 1024 * 1024; // max text size is 20 megabyte
bool result = true;
_proFloat timeDelta[12];
_proFloat timeSum[12];
for(int i = 0; i < 10; ++i)
timeSum[i] = 0;
__int64 textSum = 0;
static const char* algNames[] = {
"Skew3 ",
"Skew7 ",
"ManberMyers ",
"LarssonSadake",
"SAQSort ",
"SAQSortQGSR ",
"Skew3Ext ",
"Skew7Ext ",
"Kasai ",
"KasaiInPlace ",
"KasaiExt ",
"ChildTab ",
"ChildTabExt "
};
int TI;
for(int i = 0; i < runs; ++i) {
cout << "*** RUN " << i << " ***";
int size = rand() % maxSize;
TI = 0;
//___randomize_text___________________________________________________________
resize(text,size);
/* if (i < runs/2)
randomize(text);
else
*/ textRandomize(text);
/* String<char,External<> > errorText; // read in text causing an error
open(errorText,"error.txt");
text = errorText;
*/
/* text = "MISSISSIPPI";
size = length(text);
cout << "text created (n=" << size << ")" << endl;
*/
cout << " textSize: " << length(text) << endl;
//___create_suffix_array______________________________________________________
resize(sa, size);
/* timeDelta[TI] = -SEQAN_PROGETTIME;
createSuffixArray(sa, text, Skew3());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isSuffixArray(sa, text)) {
cout << "suffix array creation (internal Skew3) failed" << endl;
result = false;
}
*/ cout << "."; cout.flush();
blank(sa);
/* timeDelta[TI] = -SEQAN_PROGETTIME;
createSuffixArray(sa, text, Skew7());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isSuffixArray(sa, text)) {
cout << "suffix array creation (internal Skew7) failed" << endl;
result = false;
}
*/ cout << "."; cout.flush();
blank(sa);
/* timeDelta[TI] = -SEQAN_PROGETTIME;
createSuffixArray(sa, text, ManberMyers());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isSuffixArray(sa, text)) {
cout << "suffix array creation (internal ManberMyers) failed" << endl;
result = false;
}
*/ cout << "."; cout.flush();
blank(sa);
/* timeDelta[TI] = -SEQAN_PROGETTIME;
createSuffixArrayExt(sa, text, LarssonSadakane());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isSuffixArray(sa, text)) {
cout << "suffix array creation (external LarssonSadakane) failed" << endl;
result = false;
}
*/ cout << "."; cout.flush();
blank(sa);
timeDelta[TI] = -SEQAN_PROGETTIME;
createSuffixArray(sa, text, SAQSort());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isSuffixArray(sa, text)) {
cout << "suffix array creation (internal SAQSort) failed" << endl;
result = false;
}
cout << "."; cout.flush();
/*
blank(sa);
timeDelta[TI] = -SEQAN_PROGETTIME;
createSuffixArray(sa, text, QSQGSR(), 3);
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isSuffixArray(sa, text)) {
cout << "suffix array creation (internal QSQGSR) failed" << endl;
result = false;
}
cout << "."; cout.flush();
*/
blank(sa);
/* timeDelta[TI] = -SEQAN_PROGETTIME;
createSuffixArrayExt(sa, text, Skew3());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isSuffixArray(sa, text)) {
cout << "suffix array creation (external Skew3) failed" << endl;
result = false;
}
cout << "."; cout.flush();
blank(sa);
timeDelta[TI] = -SEQAN_PROGETTIME;
createSuffixArrayExt(sa, text, Skew7());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isSuffixArray(sa, text)) {
cout << "suffix array creation (external Skew7) failed" << endl;
result = false;
}
cout << "."; cout.flush();
//___create_lcp_table_________________________________________________________
resize(lcp, size);
timeDelta[TI] = -SEQAN_PROGETTIME;
createLCPTable(lcp, text, sa, KasaiOriginal());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isLCPTable(lcp, sa, text)) {
cout << "suffix array creation (internal Kasai) failed" << endl;
result = false;
}
cout << "."; cout.flush();
blank(lcp);
timeDelta[TI] = -SEQAN_PROGETTIME;
createLCPTable(lcp, text, sa, Kasai());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isLCPTable(lcp, sa, text)) {
cout << "suffix array creation (internal in-place Kasai) failed" << endl;
result = false;
}
cout << "."; cout.flush();
blank(lcp);
timeDelta[TI] = -SEQAN_PROGETTIME;
createLCPTableExt(lcp, text, sa, Kasai());
timeDelta[TI++] += SEQAN_PROGETTIME;
if (!isLCPTable(lcp, sa, text)) {
cout << "suffix array creation (external Kasai) failed" << endl;
result = false;
}
cout << "."; cout.flush();
//___create_child_table_______________________________________________________
resize(child, size);
for(int i=0; i<size; ++i)
child[i] = supremumValue<unsigned>();
timeDelta[TI] = -SEQAN_PROGETTIME;
createChildTable(child, lcp);
timeDelta[TI++] += SEQAN_PROGETTIME;
cout << "."; cout.flush();
unsigned undefs=0;
for(int i=0; i<size; ++i)
if (child[i] == supremumValue<unsigned>()) ++undefs;
if (undefs) ::std::cout << undefs << " undefined values";
resize(childExt, size);
timeDelta[TI] = -SEQAN_PROGETTIME;
createChildTableExt(childExt, lcp);
timeDelta[TI++] += SEQAN_PROGETTIME;
cout << "."; cout.flush();
if (!isEqual(child, childExt)) {
cout << "child table creation failed" << endl;
result = false;
}
*/
//___update_performance_table_________________________________________________
for(int i=0; i<TI; ++i) {
timeSum[i] += timeDelta[i];
textSum += length(text);
}
cout << " OK!" << endl;
}
cout << "*** TIME RESULTS (sec/MB) ***" << endl;
for(int i=0; i<TI; ++i)
cout << algNames[i] << " " << 1024.0*1024.0 * timeSum[i] / textSum << endl;
return result;
}
/*
int main() {
return (testIndexCreation())? 0: 1;
}
*/
| 26.87747 | 79 | 0.592941 | kloetzl |
e0996f1e19cf81dd6375a52b4d420425fdbb5a8d | 14,670 | cpp | C++ | src/gbGraphics/Renderer.cpp | ComicSansMS/GhulbusVulkan | b24ffb892a7573c957aed443a3fbd7ec281556e7 | [
"MIT"
] | null | null | null | src/gbGraphics/Renderer.cpp | ComicSansMS/GhulbusVulkan | b24ffb892a7573c957aed443a3fbd7ec281556e7 | [
"MIT"
] | null | null | null | src/gbGraphics/Renderer.cpp | ComicSansMS/GhulbusVulkan | b24ffb892a7573c957aed443a3fbd7ec281556e7 | [
"MIT"
] | null | null | null | #include <gbGraphics/Renderer.hpp>
#include <gbGraphics/CommandPoolRegistry.hpp>
#include <gbGraphics/Exceptions.hpp>
#include <gbGraphics/GraphicsInstance.hpp>
#include <gbGraphics/Image2d.hpp>
#include <gbGraphics/Program.hpp>
#include <gbGraphics/Window.hpp>
#include <gbVk/CommandBuffer.hpp>
#include <gbVk/Exceptions.hpp>
#include <gbVk/Device.hpp>
#include <gbVk/Image.hpp>
#include <gbVk/PhysicalDevice.hpp>
#include <gbVk/Queue.hpp>
#include <gbVk/RenderPassBuilder.hpp>
#include <gbVk/Swapchain.hpp>
#include <gbBase/Assert.hpp>
namespace GHULBUS_GRAPHICS_NAMESPACE
{
Renderer::Renderer(GraphicsInstance& instance, Program& program, GhulbusVulkan::Swapchain& swapchain)
:m_instance(&instance), m_program(&program), m_swapchain(&swapchain),
m_state(createRendererState(instance, swapchain)),
m_renderFinishedSemaphore(instance.getVulkanDevice().createSemaphore()),
m_clearColor(0.5f, 0.f, 0.5f, 1.f)
{
}
uint32_t Renderer::addPipelineBuilder(GhulbusVulkan::PipelineLayout&& layout)
{
m_pipelineBuilders.emplace_back(
m_instance->getVulkanDevice().createGraphicsPipelineBuilder(m_swapchain->getWidth(), m_swapchain->getHeight()),
std::move(layout));
m_drawRecordings.emplace_back();
GHULBUS_ASSERT(m_pipelineBuilders.size() == m_drawRecordings.size());
return static_cast<uint32_t>(m_pipelineBuilders.size() - 1);
}
uint32_t Renderer::clonePipelineBuilder(uint32_t source_index)
{
GHULBUS_PRECONDITION((source_index >= 0) && (source_index < m_pipelineBuilders.size()));
m_pipelineBuilders.emplace_back(m_pipelineBuilders[source_index]);
m_drawRecordings.emplace_back();
GHULBUS_ASSERT(m_pipelineBuilders.size() == m_drawRecordings.size());
return static_cast<uint32_t>(m_pipelineBuilders.size() - 1);
}
GhulbusVulkan::PipelineBuilder& Renderer::getPipelineBuilder(uint32_t index)
{
GHULBUS_PRECONDITION((index >= 0) && (index < m_pipelineBuilders.size()));
return m_pipelineBuilders[index].builder;
}
GhulbusVulkan::PipelineLayout& Renderer::getPipelineLayout(uint32_t index)
{
GHULBUS_PRECONDITION((index >= 0) && (index < m_pipelineBuilders.size()));
return *m_pipelineBuilders[index].layout;
}
void Renderer::recreateAllPipelines()
{
GHULBUS_PRECONDITION(m_state);
GHULBUS_PRECONDITION(!m_pipelineBuilders.empty());
m_pipelines.clear();
for (auto& [builder, layout] : m_pipelineBuilders) {
builder.clearVertexBindings();
auto const& program_bindings = m_program->getVertexInputBindings();
auto const& program_attributes = m_program->getVertexInputAttributeDescriptions();
builder.addVertexBindings(program_bindings.data(), static_cast<uint32_t>(program_bindings.size()),
program_attributes.data(), static_cast<uint32_t>(program_attributes.size()));
builder.adjustViewportDimensions(m_swapchain->getWidth(), m_swapchain->getHeight());
m_pipelines.emplace_back(
builder.create(*layout, m_program->getShaderStageCreateInfos(), m_program->getNumberOfShaderStages(),
m_state->renderPass.getVkRenderPass()));
}
uint32_t const n_pipelines = static_cast<uint32_t>(m_pipelineBuilders.size());
uint32_t const n_targets = m_swapchain->getNumberOfImages();
m_commandBuffers = m_instance->getCommandPoolRegistry().allocateCommandBuffersGraphics(n_targets * n_pipelines);
GHULBUS_ASSERT(m_pipelineBuilders.size() == m_drawRecordings.size());
GHULBUS_ASSERT(m_state->framebuffers.size() == n_targets);
for (uint32_t pipeline_index = 0; pipeline_index < n_pipelines; ++pipeline_index) {
for(uint32_t target_index = 0; target_index < n_targets; ++target_index) {
GhulbusVulkan::CommandBuffer& command_buffer =
m_commandBuffers.getCommandBuffer(getCommandBufferIndex(pipeline_index, target_index));
command_buffer.begin(VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT);
VkRenderPassBeginInfo render_pass_info;
render_pass_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
render_pass_info.pNext = nullptr;
render_pass_info.renderPass = m_state->renderPass.getVkRenderPass();
render_pass_info.framebuffer = m_state->framebuffers[target_index].getVkFramebuffer();
render_pass_info.renderArea.offset.x = 0;
render_pass_info.renderArea.offset.y = 0;
render_pass_info.renderArea.extent.width = m_swapchain->getWidth();
render_pass_info.renderArea.extent.height = m_swapchain->getHeight();
std::array<VkClearValue, 2> clear_color;
clear_color[0].color.float32[0] = m_clearColor.r;
clear_color[0].color.float32[1] = m_clearColor.g;
clear_color[0].color.float32[2] = m_clearColor.b;
clear_color[0].color.float32[3] = m_clearColor.a;
clear_color[1].depthStencil.depth = 1.0f;
clear_color[1].depthStencil.stencil = 0;
render_pass_info.clearValueCount = static_cast<uint32_t>(clear_color.size());
render_pass_info.pClearValues = clear_color.data();
vkCmdBeginRenderPass(command_buffer.getVkCommandBuffer(), &render_pass_info, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(command_buffer.getVkCommandBuffer(),
VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipelines[pipeline_index].getVkPipeline());
for(auto const& draw_cb : m_drawRecordings[pipeline_index]) {
draw_cb(command_buffer, target_index);
}
vkCmdEndRenderPass(command_buffer.getVkCommandBuffer());
command_buffer.end();
}
}
}
void Renderer::render(uint32_t pipeline_index, Window& target_window)
{
GHULBUS_PRECONDITION((pipeline_index >= 0) && (pipeline_index < m_pipelines.size()));
GHULBUS_ASSERT(m_pipelines.size() == m_drawRecordings.size());
GhulbusVulkan::SubmitStaging loop_stage;
loop_stage.addWaitingSemaphore(target_window.getCurrentImageAcquireSemaphore(),
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT);
uint32_t const frame_image_index = target_window.getCurrentImageSwapchainIndex();
auto& command_buffer = m_commandBuffers.getCommandBuffer(getCommandBufferIndex(pipeline_index, frame_image_index));
loop_stage.addCommandBuffer(command_buffer);
loop_stage.addSignalingSemaphore(m_renderFinishedSemaphore);
m_instance->getGraphicsQueue().stageSubmission(std::move(loop_stage));
Window::PresentStatus const present_status = target_window.present(m_renderFinishedSemaphore);
if(present_status != Window::PresentStatus::Ok) {
target_window.recreateSwapchain();
m_state.reset();
m_state.emplace(createRendererState(*m_instance, *m_swapchain));
recreateAllPipelines();
}
m_instance->getGraphicsQueue().clearAllStaged();
}
GhulbusVulkan::Pipeline& Renderer::getPipeline(uint32_t index)
{
GHULBUS_PRECONDITION((index >= 0) && (index < m_pipelines.size()));
return m_pipelines[index];
}
uint32_t Renderer::recordDrawCommands(uint32_t pipeline_index, DrawRecordingCallback const& recording_cb)
{
GHULBUS_PRECONDITION((pipeline_index >= 0) && (pipeline_index < m_pipelineBuilders.size()));
GHULBUS_ASSERT(m_drawRecordings.size() == m_pipelineBuilders.size());
m_drawRecordings[pipeline_index].push_back(recording_cb);
return static_cast<uint32_t>(m_drawRecordings[pipeline_index].size()) - 1;
}
void Renderer::forceInvokeDrawCallback(uint32_t pipeline_index, uint32_t target_index)
{
GHULBUS_PRECONDITION((pipeline_index >= 0) && (pipeline_index < m_pipelineBuilders.size()));
GHULBUS_ASSERT(m_drawRecordings.size() == m_pipelineBuilders.size());
GhulbusVulkan::CommandBuffer& command_buffer =
m_commandBuffers.getCommandBuffer(getCommandBufferIndex(pipeline_index, target_index));
command_buffer.reset();
command_buffer.begin(VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT);
VkRenderPassBeginInfo render_pass_info;
render_pass_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
render_pass_info.pNext = nullptr;
render_pass_info.renderPass = m_state->renderPass.getVkRenderPass();
render_pass_info.framebuffer = m_state->framebuffers[target_index].getVkFramebuffer();
render_pass_info.renderArea.offset.x = 0;
render_pass_info.renderArea.offset.y = 0;
render_pass_info.renderArea.extent.width = m_swapchain->getWidth();
render_pass_info.renderArea.extent.height = m_swapchain->getHeight();
std::array<VkClearValue, 2> clear_color;
clear_color[0].color.float32[0] = m_clearColor.r;
clear_color[0].color.float32[1] = m_clearColor.g;
clear_color[0].color.float32[2] = m_clearColor.b;
clear_color[0].color.float32[3] = m_clearColor.a;
clear_color[1].depthStencil.depth = 1.0f;
clear_color[1].depthStencil.stencil = 0;
render_pass_info.clearValueCount = static_cast<uint32_t>(clear_color.size());
render_pass_info.pClearValues = clear_color.data();
vkCmdBeginRenderPass(command_buffer.getVkCommandBuffer(), &render_pass_info, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(command_buffer.getVkCommandBuffer(),
VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipelines[pipeline_index].getVkPipeline());
for(auto const& draw_cb : m_drawRecordings[pipeline_index]) {
draw_cb(command_buffer, target_index);
}
vkCmdEndRenderPass(command_buffer.getVkCommandBuffer());
command_buffer.end();
}
uint32_t Renderer::copyDrawCommands(uint32_t source_pipeline_index, uint32_t source_draw_command_index,
uint32_t destination_pipeline_index)
{
GHULBUS_PRECONDITION((source_pipeline_index >= 0) && (source_pipeline_index < m_pipelineBuilders.size()));
GHULBUS_PRECONDITION((destination_pipeline_index >= 0) &&
(destination_pipeline_index < m_pipelineBuilders.size()));
GHULBUS_ASSERT(m_drawRecordings.size() == m_pipelineBuilders.size());
auto const& src_commands = m_drawRecordings[source_pipeline_index];
auto& dst_commands = m_drawRecordings[destination_pipeline_index];
GHULBUS_PRECONDITION((source_draw_command_index >= 0) && (source_draw_command_index < src_commands.size()));
dst_commands.push_back(src_commands[source_draw_command_index]);
return static_cast<uint32_t>(dst_commands.size()) - 1;
}
GhulbusVulkan::RenderPass& Renderer::getRenderPass()
{
GHULBUS_PRECONDITION(m_state);
return m_state->renderPass;
}
GhulbusVulkan::Framebuffer& Renderer::getFramebufferByIndex(uint32_t idx)
{
GHULBUS_PRECONDITION((idx >= 0) && (idx < m_state->framebuffers.size()));
GHULBUS_PRECONDITION(m_state);
return m_state->framebuffers[idx];
}
void Renderer::setClearColor(GhulbusMath::Color4f const& clear_color)
{
m_clearColor = clear_color;
}
GenericImage Renderer::createDepthBuffer(GraphicsInstance& instance, uint32_t width, uint32_t height)
{
GhulbusVulkan::PhysicalDevice physical_device = instance.getVulkanPhysicalDevice();
auto const depth_buffer_opt_format = physical_device.findDepthBufferFormat();
if (!depth_buffer_opt_format) {
GHULBUS_THROW(GhulbusVulkan::Exceptions::VulkanError(),
"No supported depth buffer format found.");
}
VkFormat const depth_buffer_format = *depth_buffer_opt_format;
return GenericImage(instance, VkExtent3D{ width, height, 1 }, depth_buffer_format, 1, 1, VK_SAMPLE_COUNT_1_BIT,
VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, MemoryUsage::GpuOnly);
}
bool Renderer::isStencilFormat(VkFormat format)
{
return (format == VK_FORMAT_D16_UNORM_S8_UINT) ||
(format == VK_FORMAT_D24_UNORM_S8_UINT) ||
(format == VK_FORMAT_D32_SFLOAT_S8_UINT);
}
GhulbusVulkan::ImageView Renderer::createDepthBufferImageView(GenericImage& depth_buffer)
{
return depth_buffer.createImageView(VK_IMAGE_VIEW_TYPE_2D, VK_IMAGE_ASPECT_DEPTH_BIT |
(isStencilFormat(depth_buffer.getFormat()) ? VK_IMAGE_ASPECT_STENCIL_BIT : 0));
}
GhulbusVulkan::RenderPass Renderer::createRenderPass(GraphicsInstance& instance,
VkFormat target_format, VkFormat depth_buffer_format)
{
GhulbusVulkan::RenderPassBuilder builder = instance.getVulkanDevice().createRenderPassBuilder();
builder.addSubpassGraphics();
builder.addColorAttachment(target_format);
builder.addDepthStencilAttachment(depth_buffer_format);
return builder.create();
}
std::vector<GhulbusVulkan::Framebuffer> Renderer::createFramebuffers(GraphicsInstance& instance,
GhulbusVulkan::Swapchain& swapchain,
GhulbusVulkan::RenderPass& render_pass,
GhulbusVulkan::ImageView& depth_image_view)
{
return instance.getVulkanDevice().createFramebuffers(swapchain, render_pass, depth_image_view);
}
uint32_t Renderer::getCommandBufferIndex(uint32_t pipeline_index, uint32_t target_index) const
{
uint32_t const n_targets = m_swapchain->getNumberOfImages();
return (pipeline_index * n_targets) + target_index;
}
Renderer::RendererState::RendererState(GenericImage&& depth_buffer, GhulbusVulkan::ImageView&& depth_buffer_image_view,
GhulbusVulkan::RenderPass&& render_pass,
std::vector<GhulbusVulkan::Framebuffer> n_framebuffers)
:depthBuffer(std::move(depth_buffer)), depthBufferImageView(std::move(depth_buffer_image_view)),
renderPass(std::move(render_pass)), framebuffers(std::move(n_framebuffers))
{}
Renderer::RendererState Renderer::createRendererState(GraphicsInstance& instance,
GhulbusVulkan::Swapchain& swapchain)
{
GhulbusGraphics::GenericImage depth_buffer =
createDepthBuffer(instance, swapchain.getWidth(), swapchain.getHeight());
GhulbusVulkan::ImageView image_view = createDepthBufferImageView(depth_buffer);
GhulbusVulkan::RenderPass render_pass =
createRenderPass(instance, swapchain.getFormat(), depth_buffer.getFormat());
std::vector<GhulbusVulkan::Framebuffer> framebuffers =
createFramebuffers(instance, swapchain, render_pass, image_view);
return RendererState(std::move(depth_buffer), std::move(image_view),
std::move(render_pass), std::move(framebuffers));
}
}
| 47.785016 | 119 | 0.728289 | ComicSansMS |
e099947be9049bee63d6d8bfc16f75245d190291 | 15,778 | cpp | C++ | Benchmarks/Serial_code/srad/srad_v1/main.cpp | HPCCS/XAPR | 0dbd0c064ca1b858be065aef00a5260d46a60d06 | [
"MIT"
] | null | null | null | Benchmarks/Serial_code/srad/srad_v1/main.cpp | HPCCS/XAPR | 0dbd0c064ca1b858be065aef00a5260d46a60d06 | [
"MIT"
] | null | null | null | Benchmarks/Serial_code/srad/srad_v1/main.cpp | HPCCS/XAPR | 0dbd0c064ca1b858be065aef00a5260d46a60d06 | [
"MIT"
] | null | null | null | //====================================================================================================100
// UPDATE
//====================================================================================================100
// 2006.03 Rob Janiczek
// --creation of prototype version
// 2006.03 Drew Gilliam
// --rewriting of prototype version into current version
// --got rid of multiple function calls, all code in a
// single function (for speed)
// --code cleanup & commenting
// --code optimization efforts
// 2006.04 Drew Gilliam
// --added diffusion coefficent saturation on [0,1]
// 2009.12 Lukasz G. Szafaryn
// -- reading from image, command line inputs
// 2010.01 Lukasz G. Szafaryn
// --comments
//====================================================================================================100
// DEFINE / INCLUDE
//====================================================================================================100
#include <stdlib.h>
#include <math.h>
#include <string.h>
//#include <omp.h>
#include <chrono>
#include <iostream>
#include "define.c"
#include "graphics.c"
#include "resize.c"
#include "timer.c"
//====================================================================================================100
//====================================================================================================100
// MAIN FUNCTION
//====================================================================================================100
//====================================================================================================100
using namespace std;
int main(int argc, char *argv []){
//================================================================================80
// VARIABLES
//================================================================================80
// time
long long time0;
long long time1;
long long time2;
long long time3;
long long time4;
long long time5;
long long time6;
long long time7;
long long time8;
long long time9;
long long time10;
time0 = get_time();
// inputs image, input paramenters
fp* image_ori; // originalinput image
int image_ori_rows;
int image_ori_cols;
long image_ori_elem;
// inputs image, input paramenters
fp* image; // input image
long Nr,Nc; // IMAGE nbr of rows/cols/elements
long Ne;
// algorithm parameters
int niter; // nbr of iterations
fp lambda; // update step size
// size of IMAGE
int r1,r2,c1,c2; // row/col coordinates of uniform ROI
long NeROI; // ROI nbr of elements
// ROI statistics
fp meanROI, varROI, q0sqr; //local region statistics
// surrounding pixel indicies
int *iN,*iS,*jE,*jW;
// center pixel value
fp Jc;
// directional derivatives
fp *dN,*dS,*dW,*dE;
// calculation variables
fp tmp,sum,sum2;
fp G2,L,num,den,qsqr,D;
// diffusion coefficient
fp *c;
fp cN,cS,cW,cE;
// counters
int iter; // primary loop
long i,j; // image row/col
long k; // image single index
// number of threads
int threads;
time1 = get_time();
//================================================================================80
// GET INPUT PARAMETERS
//================================================================================80
if(argc != 6){
printf("ERROR: wrong number of arguments\n");
return 0;
}
else{
niter = atoi(argv[1]);
lambda = atof(argv[2]);
Nr = atoi(argv[3]); // it is 502 in the original image
Nc = atoi(argv[4]); // it is 458 in the original image
threads = atoi(argv[5]);
}
//omp_set_num_threads(threads);
// printf("THREAD %d\n", omp_get_thread_num());
// printf("NUMBER OF THREADS: %d\n", omp_get_num_threads());
time2 = get_time();
//================================================================================80
// READ IMAGE (SIZE OF IMAGE HAS TO BE KNOWN)
//================================================================================80
// read image
image_ori_rows = 502;
image_ori_cols = 458;
image_ori_elem = image_ori_rows * image_ori_cols;
image_ori = (fp*)malloc(sizeof(fp) * image_ori_elem);
read_graphics( "../../../data/srad/image.pgm",
image_ori,
image_ori_rows,
image_ori_cols,
1);
time3 = get_time();
//================================================================================80
// RESIZE IMAGE (ASSUMING COLUMN MAJOR STORAGE OF image_orig)
//================================================================================80
Ne = Nr*Nc;
image = (fp*)malloc(sizeof(fp) * Ne);
resize( image_ori,
image_ori_rows,
image_ori_cols,
image,
Nr,
Nc,
1);
time4 = get_time();
//================================================================================80
// SETUP
//================================================================================80
r1 = 0; // top row index of ROI
r2 = Nr - 1; // bottom row index of ROI
c1 = 0; // left column index of ROI
c2 = Nc - 1; // right column index of ROI
// ROI image size
NeROI = (r2-r1+1)*(c2-c1+1); // number of elements in ROI, ROI size
// allocate variables for surrounding pixels
iN = (int*)malloc(sizeof(int*)*Nr) ; // north surrounding element
iS = (int*)malloc(sizeof(int*)*Nr) ; // south surrounding element
jW = (int*)malloc(sizeof(int*)*Nc) ; // west surrounding element
jE = (int*)malloc(sizeof(int*)*Nc) ; // east surrounding element
// allocate variables for directional derivatives
dN = (fp*)malloc(sizeof(fp)*Ne) ; // north direction derivative
dS = (fp*)malloc(sizeof(fp)*Ne) ; // south direction derivative
dW = (fp*)malloc(sizeof(fp)*Ne) ; // west direction derivative
dE = (fp*)malloc(sizeof(fp)*Ne) ; // east direction derivative
// allocate variable for diffusion coefficient
c = (fp*)malloc(sizeof(fp)*Ne) ; // diffusion coefficient
// N/S/W/E indices of surrounding pixels (every element of IMAGE)
// #pragma omp parallel
for (i=0; i<Nr; i++) {
iN[i] = i-1; // holds index of IMAGE row above
iS[i] = i+1; // holds index of IMAGE row below
}
// #pragma omp parallel
for (j=0; j<Nc; j++) {
jW[j] = j-1; // holds index of IMAGE column on the left
jE[j] = j+1; // holds index of IMAGE column on the right
}
// N/S/W/E boundary conditions, fix surrounding indices outside boundary of IMAGE
iN[0] = 0; // changes IMAGE top row index from -1 to 0
iS[Nr-1] = Nr-1; // changes IMAGE bottom row index from Nr to Nr-1
jW[0] = 0; // changes IMAGE leftmost column index from -1 to 0
jE[Nc-1] = Nc-1; // changes IMAGE rightmost column index from Nc to Nc-1
time5 = get_time();
//================================================================================80
// SCALE IMAGE DOWN FROM 0-255 TO 0-1 AND EXTRACT
//================================================================================80
// #pragma omp parallel
for (i=0; i<Ne; i++) { // do for the number of elements in input IMAGE
image[i] = exp(image[i]/255); // exponentiate input IMAGE and copy to output image
}
time6 = get_time();
//================================================================================80
// COMPUTATION
//================================================================================80
// printf("iterations: ");
// primary loop
for (iter=0; iter<niter; iter++){ // do for the number of iterations input parameter
// printf("%d ", iter);
// fflush(NULL);
// ROI statistics for entire ROI (single number for ROI)
sum=0;
sum2=0;
for (i=r1; i<=r2; i++) { // do for the range of rows in ROI
for (j=c1; j<=c2; j++) { // do for the range of columns in ROI
tmp = image[i + Nr*j]; // get coresponding value in IMAGE
sum += tmp ; // take corresponding value and add to sum
sum2 += tmp*tmp; // take square of corresponding value and add to sum2
}
}
meanROI = sum / NeROI; // gets mean (average) value of element in ROI
varROI = (sum2 / NeROI) - meanROI*meanROI; // gets variance of ROI
q0sqr = varROI / (meanROI*meanROI); // gets standard deviation of ROI
// directional derivatives, ICOV, diffusion coefficent
//#pragma omp parallel for shared(image, dN, dS, dW, dE, c, Nr, Nc, iN, iS, jW, jE) private(i, j, k, Jc, G2, L, num, den, qsqr)
for (j=0; j<Nc; j++) { // do for the range of columns in IMAGE
for (i=0; i<Nr; i++) { // do for the range of rows in IMAGE
// current index/pixel
k = i + Nr*j; // get position of current element
Jc = image[k]; // get value of the current element
// directional derivates (every element of IMAGE)
dN[k] = image[iN[i] + Nr*j] - Jc; // north direction derivative
dS[k] = image[iS[i] + Nr*j] - Jc; // south direction derivative
dW[k] = image[i + Nr*jW[j]] - Jc; // west direction derivative
dE[k] = image[i + Nr*jE[j]] - Jc; // east direction derivative
// normalized discrete gradient mag squared (equ 52,53)
G2 = (dN[k]*dN[k] + dS[k]*dS[k] // gradient (based on derivatives)
+ dW[k]*dW[k] + dE[k]*dE[k]) / (Jc*Jc);
// normalized discrete laplacian (equ 54)
L = (dN[k] + dS[k] + dW[k] + dE[k]) / Jc; // laplacian (based on derivatives)
// ICOV (equ 31/35)
num = (0.5*G2) - ((1.0/16.0)*(L*L)) ; // num (based on gradient and laplacian)
den = 1 + (.25*L); // den (based on laplacian)
qsqr = num/(den*den); // qsqr (based on num and den)
// diffusion coefficent (equ 33) (every element of IMAGE)
den = (qsqr-q0sqr) / (q0sqr * (1+q0sqr)) ; // den (based on qsqr and q0sqr)
c[k] = 1.0 / (1.0+den) ; // diffusion coefficient (based on den)
// saturate diffusion coefficent to 0-1 range
if (c[k] < 0) // if diffusion coefficient < 0
{c[k] = 0;} // ... set to 0
else if (c[k] > 1) // if diffusion coefficient > 1
{c[k] = 1;} // ... set to 1
}
}
// divergence & image update
// #pragma omp parallel for shared(image, c, Nr, Nc, lambda) private(i, j, k, D, cS, cN, cW, cE)
for (j=0; j<Nc; j++) { // do for the range of columns in IMAGE
// printf("NUMBER OF THREADS: %d\n", omp_get_num_threads());
for (i=0; i<Nr; i++) { // do for the range of rows in IMAGE
// current index
k = i + Nr*j; // get position of current element
// diffusion coefficent
cN = c[k]; // north diffusion coefficient
cS = c[iS[i] + Nr*j]; // south diffusion coefficient
cW = c[k]; // west diffusion coefficient
cE = c[i + Nr*jE[j]]; // east diffusion coefficient
// divergence (equ 58)
D = cN*dN[k] + cS*dS[k] + cW*dW[k] + cE*dE[k]; // divergence
// image update (equ 61) (every element of IMAGE)
image[k] = image[k] + 0.25*lambda*D; // updates image (based on input time step and divergence)
}
}
}
// printf("\n");
time7 = get_time();
//================================================================================80
// SCALE IMAGE UP FROM 0-1 TO 0-255 AND COMPRESS
//================================================================================80
// #pragma omp parallel
auto start = chrono::steady_clock::now();
for (i=0; i<Ne; i++) { // do for the number of elements in IMAGE
image[i] = log(image[i])*255; // take logarithm of image, log compress
}
auto end = chrono::steady_clock::now();
cout<< "Elapsed time in seconds: "
<< chrono::duration_cast<chrono::milliseconds>(end-start).count() << " ms" <<endl;
time8 = get_time();
//================================================================================80
// WRITE IMAGE AFTER PROCESSING
//================================================================================80
write_graphics( "image_out.pgm",
image,
Nr,
Nc,
1,
255);
time9 = get_time();
//================================================================================80
// DEALLOCATE
//================================================================================80
free(image_ori);
free(image);
free(iN); free(iS); free(jW); free(jE); // deallocate surrounding pixel memory
free(dN); free(dS); free(dW); free(dE); // deallocate directional derivative memory
free(c); // deallocate diffusion coefficient memory
time10 = get_time();
//================================================================================80
// DISPLAY TIMING
//================================================================================80
printf("Time spent in different stages of the application:\n");
printf("%.12f s, %.12f % : SETUP VARIABLES\n", (float) (time1-time0) / 1000000, (float) (time1-time0) / (float) (time10-time0) * 100);
printf("%.12f s, %.12f % : READ COMMAND LINE PARAMETERS\n", (float) (time2-time1) / 1000000, (float) (time2-time1) / (float) (time10-time0) * 100);
printf("%.12f s, %.12f % : READ IMAGE FROM FILE\n", (float) (time3-time2) / 1000000, (float) (time3-time2) / (float) (time10-time0) * 100);
printf("%.12f s, %.12f % : RESIZE IMAGE\n", (float) (time4-time3) / 1000000, (float) (time4-time3) / (float) (time10-time0) * 100);
printf("%.12f s, %.12f % : SETUP, MEMORY ALLOCATION\n", (float) (time5-time4) / 1000000, (float) (time5-time4) / (float) (time10-time0) * 100);
printf("%.12f s, %.12f % : EXTRACT IMAGE\n", (float) (time6-time5) / 1000000, (float) (time6-time5) / (float) (time10-time0) * 100);
printf("%.12f s, %.12f % : COMPUTE\n", (float) (time7-time6) / 1000000, (float) (time7-time6) / (float) (time10-time0) * 100);
printf("%.12f s, %.12f % : COMPRESS IMAGE\n", (float) (time8-time7) / 1000000, (float) (time8-time7) / (float) (time10-time0) * 100);
printf("%.12f s, %.12f % : SAVE IMAGE INTO FILE\n", (float) (time9-time8) / 1000000, (float) (time9-time8) / (float) (time10-time0) * 100);
printf("%.12f s, %.12f % : FREE MEMORY\n", (float) (time10-time9) / 1000000, (float) (time10-time9) / (float) (time10-time0) * 100);
printf("Total time:\n");
printf("%.12f s\n", (float) (time10-time0) / 1000000);
//====================================================================================================100
// END OF FILE
//====================================================================================================100
}
| 39.743073 | 149 | 0.448219 | HPCCS |
e09b86fc2121d33e1ade788e15efcedbdb839931 | 1,088 | cxx | C++ | panda/src/mathutil/test_tri.cxx | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | panda/src/mathutil/test_tri.cxx | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | panda/src/mathutil/test_tri.cxx | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | /**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file test_tri.cxx
* @author drose
* @date 2007-01-19
*/
#include "pandabase.h"
#include "triangulator.h"
int main(int argc, char *argv[]) {
Triangulator t;
t.add_vertex(0, 0);
t.add_vertex(4, 0);
t.add_vertex(4, 4);
t.add_vertex(0, 4);
t.add_vertex(1, 1);
t.add_vertex(2, 1);
t.add_vertex(2, 2);
t.add_vertex(1, 2);
t.add_polygon_vertex(0);
t.add_polygon_vertex(1);
t.add_polygon_vertex(2);
t.add_polygon_vertex(3);
t.begin_hole();
t.add_hole_vertex(7);
t.add_hole_vertex(6);
t.add_hole_vertex(5);
t.add_hole_vertex(4);
t.triangulate();
for (int i = 0; i < t.get_num_triangles(); ++i) {
std::cerr << "tri: " << t.get_triangle_v0(i) << " "
<< t.get_triangle_v1(i) << " "
<< t.get_triangle_v2(i) << "\n";
}
return 0;
}
| 20.923077 | 70 | 0.634191 | cmarshall108 |
e09dbbdcdc2f01026c62c1abf1178438052b400d | 312,486 | cpp | C++ | App/Il2CppOutputProject/Source/il2cppOutput/Il2CppCCWs64.cpp | JBrentJ/MRDL_Unity_Surfaces | 155c97eb7803af90ef1b7e95dfe7969694507575 | [
"MIT"
] | null | null | null | App/Il2CppOutputProject/Source/il2cppOutput/Il2CppCCWs64.cpp | JBrentJ/MRDL_Unity_Surfaces | 155c97eb7803af90ef1b7e95dfe7969694507575 | [
"MIT"
] | null | null | null | App/Il2CppOutputProject/Source/il2cppOutput/Il2CppCCWs64.cpp | JBrentJ/MRDL_Unity_Surfaces | 155c97eb7803af90ef1b7e95dfe7969694507575 | [
"MIT"
] | null | null | null | #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.Collections.Generic.IDictionary`2<UnityEngine.UI.Graphic,System.Int32>
struct IDictionary_2_t5090CA4C4371A10E20C400FECBD3D3B6D24F663F;
// System.Collections.Generic.IDictionary`2<System.Guid,System.Tuple`2<System.Guid,System.Int32>>
struct IDictionary_2_tD8284B1226EC524A83F719EA1A6FCDAED7A6626F;
// System.Collections.Generic.IDictionary`2<System.Guid,System.Int32>
struct IDictionary_2_t4F2B75A2D1260FAD7B8C1623C8A6AF78D65BB6F4;
// System.Collections.Generic.IDictionary`2<Microsoft.MixedReality.Toolkit.Utilities.Handedness,Microsoft.MixedReality.Toolkit.Input.BaseController>
struct IDictionary_2_t79B55BEF2E3DF9C38E87711238CAB419B0131720;
// System.Collections.Generic.IDictionary`2<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Bounds>
struct IDictionary_2_t0184CEAE2A311BE948197E0FB8EBE7C8D69C47F3;
// System.Collections.Generic.IDictionary`2<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Matrix4x4>
struct IDictionary_2_t6A9500569B6CDD5B0DF7C1D82E2F6B5CA6CEE7D5;
// System.Collections.Generic.IDictionary`2<System.Threading.IAsyncLocal,System.Object>
struct IDictionary_2_t1370D0F658956F6FEB8F61E7149BA5589ADADAAB;
// System.Collections.Generic.IDictionary`2<UnityEngine.UI.ICanvasElement,System.Int32>
struct IDictionary_2_t0782113ABAFEAF499BC81B0FFB46CA74DCF63953;
// System.Collections.Generic.IDictionary`2<UnityEngine.UI.IClipper,System.Int32>
struct IDictionary_2_tB3D9555372025D2C6E57CACBA3ECD328043ED0C2;
// System.Collections.Generic.IDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityController,UnityEngine.Vector3>
struct IDictionary_2_t9A2EC5B3F3153C735E6ACFCC7D219EA966FF5A0A;
// System.Collections.Generic.IDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource,System.Collections.Generic.HashSet`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer>>
struct IDictionary_2_tAB795870996F559BCD3C1F916A09255FFAF4FB7C;
// System.Collections.Generic.IDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,System.UInt32>
struct IDictionary_2_t8921A4D707BCED7A54AC403116B01F2A1FA7E41D;
// System.Collections.Generic.IDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,Microsoft.MixedReality.Toolkit.Input.DefaultPrimaryPointerSelector/PointerInfo>
struct IDictionary_2_tE08123B66827D77DB820E060DDCE7578557D104F;
// System.Collections.Generic.IDictionary`2<Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.IMixedRealityService>>
struct IDictionary_2_tD6C37767CFACC309558F98170DA8822F705A1655;
// System.Collections.Generic.IDictionary`2<Microsoft.MixedReality.Toolkit.UI.BoundsControl.IProximityEffectObjectProvider,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.BoundsControl.ProximityEffect/ObjectProximityInfo>>
struct IDictionary_2_t8A0632D50057F79D22E0F63E86CAD2B013B92A93;
// System.Collections.Generic.IDictionary`2<UnityEngine.XR.InputDevice,Microsoft.MixedReality.Toolkit.XRSDK.Input.GenericXRSDKController>
struct IDictionary_2_tB06AA235D89216EFEAA2C788169E6A89055F7088;
// System.Collections.Generic.IDictionary`2<System.Int32,System.Tuple`2<Microsoft.MixedReality.Toolkit.Input.KeyBinding/KeyType,System.Int32>>
struct IDictionary_2_t917F0994A423D0934B98D104E1E0DB1AD192065C;
// System.Collections.Generic.IDictionary`2<System.Int32,System.Boolean>
struct IDictionary_2_t005AE4D73FFFD0650C0A2FF160AAA2C68ABECAC6;
// System.Collections.Generic.IDictionary`2<System.Int32,System.Char>
struct IDictionary_2_t4B6B0151688328E1C2537E9939C41C52A209BC37;
// System.Collections.Generic.IDictionary`2<System.Int32,System.Globalization.CultureInfo>
struct IDictionary_2_t9A86FE390A494376C4227F9E82A847B33365630E;
// System.Collections.Generic.IDictionary`2<System.Int32,UnityEngine.InputSystem.InputDevice>
struct IDictionary_2_t2EEF1024C04938FC57ACC933E8122EE407407090;
// System.Collections.Generic.IDictionary`2<System.Int32,System.Int32>
struct IDictionary_2_tB4ED1E49E19CD2B265408862C51CC25A6B8C102B;
// System.Collections.Generic.IDictionary`2<System.Int32,System.Int64>
struct IDictionary_2_t664C1D3BCB1C8EBF972F119CC992F64026AE9152;
// System.Collections.Generic.IDictionary`2<System.Int32,UnityEngine.Material>
struct IDictionary_2_t6E7495F388ACE69C55E7ADADF0B11373952D48B6;
// System.Collections.Generic.IDictionary`2<System.Int32,UnityEngine.EventSystems.PointerEventData>
struct IDictionary_2_tD84C16F551159C33A6136F635C212A64F8F8ACED;
// System.Collections.Generic.IDictionary`2<System.Int32,Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject>
struct IDictionary_2_t229FC06F24B9EEF9B6299ECBF5A016792792D695;
// System.Collections.Generic.IDictionary`2<System.Int32,System.String>
struct IDictionary_2_tB4E97D5B9CF7274B9297433145AC382F20ACCF14;
// System.Collections.Generic.IDictionary`2<System.Int32,TMPro.TMP_ColorGradient>
struct IDictionary_2_t4DB94C7DEC8FAAA338CE57C4EAF67E4A36380D19;
// System.Collections.Generic.IDictionary`2<System.Int32,TMPro.TMP_FontAsset>
struct IDictionary_2_tC3F2C4F2C0380B106616FD643F3320D914BB92D5;
// System.Collections.Generic.IDictionary`2<System.Int32,TMPro.TMP_SpriteAsset>
struct IDictionary_2_tFB5F3DBCF6E633229FF97AA01A0991AB4ECD1983;
// System.Collections.Generic.IDictionary`2<System.Int32,TMPro.TMP_Style>
struct IDictionary_2_t0DB6316713067D963420FE02135DAAB2C950EEEA;
// System.Collections.Generic.IDictionary`2<System.Int32,System.Threading.Tasks.Task>
struct IDictionary_2_tF50F4A67D2B5A75E3480EF3D1B73810753B2CF1C;
// System.Collections.Generic.IDictionary`2<System.Int32,System.TimeType>
struct IDictionary_2_t534EEC2845AE6C866A1DC87D49B69C6CC58F5089;
// System.Collections.Generic.IDictionary`2<System.Int32,Microsoft.MixedReality.Toolkit.Input.UnityInput.UnityTouchController>
struct IDictionary_2_t35A1830301162D164A6397AF3889857F975DAF35;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<UnityEngine.UI.Graphic,System.Int32>
struct KeyCollection_t0A2060F350137EC79AA6202BC9F9B46054C5F413;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Guid,System.Tuple`2<System.Guid,System.Int32>>
struct KeyCollection_t100B1159B7C4D5DF1C2C275F15E37E8AB8BD728B;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Guid,System.Int32>
struct KeyCollection_t21B7557DDE03CCE9A21FCC99E16D10C7C3BEA4D0;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<Microsoft.MixedReality.Toolkit.Utilities.Handedness,Microsoft.MixedReality.Toolkit.Input.BaseController>
struct KeyCollection_tFE0508786785717E1220641183B4B03396C154AA;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Bounds>
struct KeyCollection_tC307CE3C0584060B71E846520F2333406A798601;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Matrix4x4>
struct KeyCollection_t3B9ADC9A5032ACFC3F89AE07A06747A46576C7E5;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Threading.IAsyncLocal,System.Object>
struct KeyCollection_t71AB40EE74360EFE07FB14B096FF8E90A076C2A2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<UnityEngine.UI.ICanvasElement,System.Int32>
struct KeyCollection_tD6341EBDD23DD00939DFE208E567F42BA7E9AEA3;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<UnityEngine.UI.IClipper,System.Int32>
struct KeyCollection_t59831B456A0A136751FDDA7712D94C87D2A51470;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<Microsoft.MixedReality.Toolkit.Input.IMixedRealityController,UnityEngine.Vector3>
struct KeyCollection_t48563FBAA98ED07855563CE8A1782835286BD582;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource,System.Collections.Generic.HashSet`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer>>
struct KeyCollection_tBEC3B14C7A10B2495ABD1B4112B38C814A5A9BC6;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,System.UInt32>
struct KeyCollection_tFEB6B4E692B58CA77DF4149F0C5842395524CD2C;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,Microsoft.MixedReality.Toolkit.Input.DefaultPrimaryPointerSelector/PointerInfo>
struct KeyCollection_t7B8A284F5BB2D6A8776FF2297A0B573FA411AA04;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.IMixedRealityService>>
struct KeyCollection_t5D53234AE8258A492CE3C07FA9227A0CFB961F88;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<Microsoft.MixedReality.Toolkit.UI.BoundsControl.IProximityEffectObjectProvider,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.BoundsControl.ProximityEffect/ObjectProximityInfo>>
struct KeyCollection_tBAA30400F1432B3D327E6632A4AC38DF006858EA;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<UnityEngine.XR.InputDevice,Microsoft.MixedReality.Toolkit.XRSDK.Input.GenericXRSDKController>
struct KeyCollection_tBEA1F3FD683D48327E87C82DAD888F9F4D371773;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,System.Tuple`2<Microsoft.MixedReality.Toolkit.Input.KeyBinding/KeyType,System.Int32>>
struct KeyCollection_t6EA44DB82958C829DE5A6694A39503F16420DEFC;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,System.Boolean>
struct KeyCollection_tC152F08EF8CC08ADE84F34B3E1A3B65E6334851E;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,System.Char>
struct KeyCollection_t0ECA6CB1949FA275ECDB3D8F05460076C20C785A;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,System.Globalization.CultureInfo>
struct KeyCollection_t1120F859B0671105D509AC98AAB21F7CFC2049D4;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,UnityEngine.InputSystem.InputDevice>
struct KeyCollection_t7DABB128B3068790E06730049F25B17B6075B377;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,System.Int32>
struct KeyCollection_tEB01E49AAD44CFB3D07C82E1566073576FAB2A80;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,System.Int64>
struct KeyCollection_t1EE17E2E96FCA88DA7F88AD27E77B687940AC6F0;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,UnityEngine.Material>
struct KeyCollection_t3CE094E958DC2A4E1855D6EAC1A8BACE08E4FE5D;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,UnityEngine.EventSystems.PointerEventData>
struct KeyCollection_t36E68F717226925CBAC6C90C1AB8AAB176DD2BB7;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject>
struct KeyCollection_t11C6480A0AA8BA2524E09FAD4CB06EA43D014E62;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,System.String>
struct KeyCollection_t6932AD9E99EA6C71F8A923A002967381B381BF53;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,TMPro.TMP_ColorGradient>
struct KeyCollection_tC74D8AF310675B9B8E60837F9E1812820ABD12B4;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,TMPro.TMP_FontAsset>
struct KeyCollection_tC603D277AC671F95A1044519C8EAD316174FBF84;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,TMPro.TMP_SpriteAsset>
struct KeyCollection_tCEC377A32BD5D2F233A8F2E12FE9E705FFF439F5;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,TMPro.TMP_Style>
struct KeyCollection_t0B22698FC2260E4BA6DE3CF4FB74255D959C1084;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,System.Threading.Tasks.Task>
struct KeyCollection_tB40DBF9D9498664FB66CF52AD1E1FB018C857D89;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,System.TimeType>
struct KeyCollection_t8801AB37735B63E5DFEA7B114BDB81C78F2E5D79;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<System.Int32,Microsoft.MixedReality.Toolkit.Input.UnityInput.UnityTouchController>
struct KeyCollection_t2D88D7F45C442875C6C68906155E7A30B9B7D878;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<UnityEngine.UI.Graphic,System.Int32>
struct ValueCollection_t30AD529B9F75532560A194BC17C58F7FC6730EED;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Guid,System.Tuple`2<System.Guid,System.Int32>>
struct ValueCollection_t6A5B0DF4354EAC00C0B894C9DA2A5EEC7D797A3F;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Guid,System.Int32>
struct ValueCollection_t36A365EF75A9898A232CCFD4C304FC50183E03D6;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<Microsoft.MixedReality.Toolkit.Utilities.Handedness,Microsoft.MixedReality.Toolkit.Input.BaseController>
struct ValueCollection_t624E6BB132EEF360597BC843A6FC0EBACC55B0C1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Bounds>
struct ValueCollection_t882BE2B5D75F12EBEACBB7E06D4904385DAF768C;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Matrix4x4>
struct ValueCollection_tD538828B74F6A2AFFA25CBE1BBA7CC842EDBC88B;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Threading.IAsyncLocal,System.Object>
struct ValueCollection_t829D1A2C21BCE93FBCBE9E029CCC77E24419ADC3;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<UnityEngine.UI.ICanvasElement,System.Int32>
struct ValueCollection_tDFE3548B5884867CBB3AD8597EAF0B6F4F6E80D8;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<UnityEngine.UI.IClipper,System.Int32>
struct ValueCollection_t576049C739ADEC4FC22A6AD4A068322B2F5A5C90;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<Microsoft.MixedReality.Toolkit.Input.IMixedRealityController,UnityEngine.Vector3>
struct ValueCollection_t81D2BF8746FC87C321D1790D5F591BB5A6B76F0F;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource,System.Collections.Generic.HashSet`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer>>
struct ValueCollection_t88AA7D05C30935D79B0F526379376400C14E702C;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,System.UInt32>
struct ValueCollection_tB480898DF164ED876E680EC1EE7C30B6D36F49A2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,Microsoft.MixedReality.Toolkit.Input.DefaultPrimaryPointerSelector/PointerInfo>
struct ValueCollection_tB47F0DF77B94F9350BE7C867B06C986D34668EF9;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.IMixedRealityService>>
struct ValueCollection_t1C094DC8B02A38D900447BE3DA01769218D9FC20;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<Microsoft.MixedReality.Toolkit.UI.BoundsControl.IProximityEffectObjectProvider,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.BoundsControl.ProximityEffect/ObjectProximityInfo>>
struct ValueCollection_tCCF0B4ADEB7AF959B18D1C2BD27233D34F5D7E16;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<UnityEngine.XR.InputDevice,Microsoft.MixedReality.Toolkit.XRSDK.Input.GenericXRSDKController>
struct ValueCollection_t7CF71AEE7B0495C5EF2FC5BA6F959C77A1B74196;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,System.Tuple`2<Microsoft.MixedReality.Toolkit.Input.KeyBinding/KeyType,System.Int32>>
struct ValueCollection_tBB1F6159FF25E88DDF1B397279E98E15EA1A211E;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,System.Boolean>
struct ValueCollection_tB51F603A239485F05720315028C603D2DC30180E;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,System.Char>
struct ValueCollection_t65BF5F1537D952260730F9EF31DFBCA90DA7FC5A;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,System.Globalization.CultureInfo>
struct ValueCollection_t76A1D105429D1EF9CA00AED8B612D7F5DEA1A0E1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,UnityEngine.InputSystem.InputDevice>
struct ValueCollection_t29CE86D517873AF2A288A323DE337E04664AEE6A;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,System.Int32>
struct ValueCollection_t48B58DEA6F5CF1E9959CC08347044FD1199BB39C;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,System.Int64>
struct ValueCollection_tDD3A2A47F1254D88628C68D87D830A584722012F;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,UnityEngine.Material>
struct ValueCollection_tE6DD53C28F18E9D5F05F965551F3C88178BF15B4;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,UnityEngine.EventSystems.PointerEventData>
struct ValueCollection_t9FEB03EF99A5A4FEC35B8B143F9A805C36347399;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject>
struct ValueCollection_t286FC8F90BCF5633CB10F1F4AA4431C4A66F2399;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,System.String>
struct ValueCollection_tE8B618071B897471AC32AAF06060B187610CFB43;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,TMPro.TMP_ColorGradient>
struct ValueCollection_tF3E06E1B7F3F827575625D735B684EDF94431971;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,TMPro.TMP_FontAsset>
struct ValueCollection_t468EF4114E5E829EEC9AFCCDF8745C4D2E301C88;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,TMPro.TMP_SpriteAsset>
struct ValueCollection_tA7D37A794F6B8768525831C895952CD93ED21510;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,TMPro.TMP_Style>
struct ValueCollection_tD45AF1B120128FB336471F76D41131B907650C04;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,System.Threading.Tasks.Task>
struct ValueCollection_tC0EF51948EA6CC2782B13B162C154C832EFEC3E1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,System.TimeType>
struct ValueCollection_t06DE7C9B1AF6C21F3D792B24ED702715CB5C9B80;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<System.Int32,Microsoft.MixedReality.Toolkit.Input.UnityInput.UnityTouchController>
struct ValueCollection_t111F98392C1525CC0317CC7584CA2762FD80A412;
// System.Security.Cryptography.RandomNumberGenerator
struct RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50;
struct IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB;
struct IIterator_1_t08AEA15D8898425B3BBB6D82FDB5DB8877E45871;
struct IIterator_1_t2C43A7E52B7CC8D1B2DA6DD4EC3E72A84A4CF8F2;
struct IIterator_1_t90E26C41183EBF622D2BBB227E37A898BAA6B97B;
struct IIterator_1_tA84C89A77204275A66F65440F1A1802C6D307207;
struct IIterator_1_tAB0C1B446829B226CAAD72C2FBCB3E1FBB5A4C71;
struct IIterator_1_tCAC42F4EF69B7F9727A04F84FB9773E96CB8DFC9;
struct IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355;
struct IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A;
struct IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61;
struct IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93;
struct IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D;
struct IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7;
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.Collections.IIterable`1<System.Collections.Generic.KeyValuePair`2<System.Guid,System.Int32>>
struct NOVTABLE IIterable_1_t1A5E333D12640BC7AB143CBE013FDE40AFB4F475 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IIterable_1_First_m86DE4489A430066D4958BD2839105D891E5521D7(IIterator_1_t2C43A7E52B7CC8D1B2DA6DD4EC3E72A84A4CF8F2** comReturnValue) = 0;
};
// Windows.Foundation.Collections.IIterable`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Boolean>>
struct NOVTABLE IIterable_1_t24BEE69C80E58630BDE330EE63AEDC24029850BB : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IIterable_1_First_mF1B3E048A0581C18F58EDA631F1294A18A139660(IIterator_1_t08AEA15D8898425B3BBB6D82FDB5DB8877E45871** comReturnValue) = 0;
};
// Windows.Foundation.Collections.IIterable`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Char>>
struct NOVTABLE IIterable_1_t7F2949B13FCF6A4E25D160B9CD47BFB85A8FBAE6 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IIterable_1_First_m47FB691D69387BB0A2E88AC4091E471841209411(IIterator_1_tA84C89A77204275A66F65440F1A1802C6D307207** comReturnValue) = 0;
};
// Windows.Foundation.Collections.IIterable`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int32>>
struct NOVTABLE IIterable_1_tD388FA3CB5D870407558B6357E3097F22416E7E3 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IIterable_1_First_m9E67B40CA2B0E8AB40AC60919F35CDBAF4907598(IIterator_1_tAB0C1B446829B226CAAD72C2FBCB3E1FBB5A4C71** comReturnValue) = 0;
};
// Windows.Foundation.Collections.IIterable`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int64>>
struct NOVTABLE IIterable_1_tD7A5412C67484BA2083059C445DC95E7BC6041C7 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IIterable_1_First_mC90DE28333E7B75BCEE7ADDA4E3BE0A56EEEB649(IIterator_1_tCAC42F4EF69B7F9727A04F84FB9773E96CB8DFC9** comReturnValue) = 0;
};
// Windows.Foundation.Collections.IIterable`1<System.Collections.Generic.KeyValuePair`2<System.Int32,System.String>>
struct NOVTABLE IIterable_1_tFC0F28A8493453E790566AD9BF521EB99E862227 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IIterable_1_First_m14DE8FC349ACC550CA242FB49577D6B0AF1C1EB1(IIterator_1_t90E26C41183EBF622D2BBB227E37A898BAA6B97B** comReturnValue) = 0;
};
// Windows.Foundation.Collections.IMapView`2<System.Int32,System.Boolean>
struct NOVTABLE IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m469C905EF54DAF27213804F57584265C5B7D385F(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_m10976D2AD6CC3487D1E144A0B90AEF311AD58741(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_mC9D5B78679E2271BEC5EFE9FF3C581BFCB326EF4(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m7D8CCBA5B295FA5DE3EE144F6D77940AA1979BDF(IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93** ___first0, IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93** ___second1) = 0;
};
// Windows.Foundation.Collections.IMapView`2<System.Int32,System.Char>
struct NOVTABLE IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m49957256BD4125F303D3D1E0A9E9C68799FAC75E(int32_t ___key0, Il2CppChar* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_m9F2BF8DAD00F504EB40FD8BF8227FCAB4954F656(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_mC5A2469DD85823295D7EF1D09E0CE24802EEB601(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m2DEF44547499ABB3BB70543866731DFF51939791(IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355** ___first0, IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355** ___second1) = 0;
};
// Windows.Foundation.Collections.IMapView`2<System.Int32,System.Int32>
struct NOVTABLE IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_mEB4A4831069E064FC0A807E20E51095F61208AAF(int32_t ___key0, int32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_mDBDA039F45FE7DAB8B299F8284D620683947C20D(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_m3BE9E9A164CFAD5EBF9879319054D86AAA4D529C(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m6869EE64C18723F0BB0D10417E11AA80918D1295(IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61** ___first0, IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61** ___second1) = 0;
};
// Windows.Foundation.Collections.IMapView`2<System.Int32,System.Int64>
struct NOVTABLE IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m1D42C30FE9DDE2255F85A4128C70FBC74070E24A(int32_t ___key0, int64_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_mE5B4042270AF83F3467CED1201613AF6870931F1(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_m70F1D85335051378EC9751B6CF4AAEE9F5AB6288(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m5ACA09637DDBA456BDE48B599992DD4316CEDC0A(IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7** ___first0, IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7** ___second1) = 0;
};
// Windows.Foundation.Collections.IMapView`2<System.Int32,System.String>
struct NOVTABLE IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m6C3FB595F2E75BA520D8DD9CAA9B6D3F73DD9E81(int32_t ___key0, Il2CppHString* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_m3EE77EBA65F7B85780CE3CD3E9FBEED16D13FBEB(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_m6F79F442D9D546B542483DBCC15739DF4C1CA6A0(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m12E007F56F41C3C40A71A9B19D78FDE3485A68BF(IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A** ___first0, IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A** ___second1) = 0;
};
// Windows.Foundation.Collections.IMap`2<System.Int32,System.Boolean>
struct NOVTABLE IMap_2_t7A9DC49D30935DDE44DED4A1E3A0D986EDE6958D : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMap_2_Lookup_mA933DB0545BDD0696DE178C26B213DBF50649112(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_m0B41DBAB888FFCC00B592003BE3893CE879D6AC1(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_mBE38A8C334050C874D03DDD694809724D1C388D0(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_m4270DE4E8EE35DDC27AB4E46731FA7CBC1CDA96B(IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93** comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_mF49C0F471888E5414C278642DB7F2D7A28AD15A2(int32_t ___key0, bool ___value1, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_mDCFFF6A68115E9EC6F0A01A27361BB97FD93BE07(int32_t ___key0) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_m314D7501B86EED681697C87FA6E1424A7B88865A() = 0;
};
// Windows.Foundation.Collections.IMap`2<System.Int32,System.Char>
struct NOVTABLE IMap_2_tC55ED98B37E17834DDE8B154F875F82A31862872 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMap_2_Lookup_mA996412DE91A9F64D733F7112D47096E9561BAB6(int32_t ___key0, Il2CppChar* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_mDF4551C75FF9F39FD763A76F88B9863AA292DC04(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m4DCE9F553416C914F1B0A7091E9B6D6EAAB6E40B(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_m871DFD46103269D5E3B1491ED9337E2B85E08D83(IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355** comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_mD6F83BA5B05B98C960AB70F1E76CEC5BCD12DA9E(int32_t ___key0, Il2CppChar ___value1, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_m5086C3460B92AAD73B31F9680AD39274D3C722A4(int32_t ___key0) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_m07C59EB72EB1EE931F96F4D665C5A28FD5794D08() = 0;
};
// Windows.Foundation.Collections.IMap`2<System.Int32,System.Int32>
struct NOVTABLE IMap_2_t2D2887BEE348A15C28549CB5E6D3D465077579B1 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMap_2_Lookup_mAB2557F89B67970660EAEA867C160D8B4519A59B(int32_t ___key0, int32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_mA1A1CCC776D0A04E6CB464990ACA1A8A24B8FB99(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m09F3138AF64D40439835CED4FA397E6A5567B69F(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_m49BD462B6D6FBA94E03FC317B3F348E400D8D059(IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61** comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_m26A58381A4B7979D7635D8C6BABB43581F277A1E(int32_t ___key0, int32_t ___value1, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_mBEBB5F63E6AF3D5EC5F85CEC6FF599CF27892CA3(int32_t ___key0) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_mFC61A1262C6FF5614B12B0D00A26C3B01B909312() = 0;
};
// Windows.Foundation.Collections.IMap`2<System.Int32,System.Int64>
struct NOVTABLE IMap_2_t131C1AAB31D1D45DD27D52AC64C0A5BCD9788170 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMap_2_Lookup_mD086C909F276F0A409C254386A5433BA1D8E4DA1(int32_t ___key0, int64_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_mF7543BFD7482B050F35BE3CABFB5B6A903300CE7(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m1543A9B7F80B3A5489328F1F77CB0691655EA012(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_mF5636C470F31A6C155D5AAA77FB9BD0442C34E04(IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7** comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_mD8D2C48C925DF3B8A1F36EB5D923E7798AAD25AD(int32_t ___key0, int64_t ___value1, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_m588519BFAFF613E05C992F17D2D10A9104A5C511(int32_t ___key0) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_mF043DFCA2742D3F57D3380D0D42A6D7DD46867C7() = 0;
};
// Windows.Foundation.Collections.IMap`2<System.Int32,System.String>
struct NOVTABLE IMap_2_t6D83CFC4BB5F39D14238C2A6C38DB1D7D36E9EE3 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMap_2_Lookup_mDB3DE71A1EF4936EF85DC58F72AE18C4DEA7AEA4(int32_t ___key0, Il2CppHString* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_m6F21CB368462EE986560EFB89B18F2EB87266C65(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m1C1D3DFD5C4CFE039AB133F6FCD00923AA128825(int32_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_m388C3012C136C6DF202561F3223E1937B3126DC5(IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A** comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_mD0EE050C010FEBDF35A137076BB5B9C8D7C134F8(int32_t ___key0, Il2CppHString ___value1, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_mC0F7A2C3AA571DFBB44D55A01F218C9303BF0005(int32_t ___key0) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_m2B14C4BB95BEBBA259CCB82E215F6D503A0B8708() = 0;
};
// Windows.UI.Xaml.Interop.IBindableIterable
struct NOVTABLE IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) = 0;
};
// System.Object
// System.Collections.ObjectModel.ReadOnlyDictionary`2<UnityEngine.UI.Graphic,System.Int32>
struct ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t0A2060F350137EC79AA6202BC9F9B46054C5F413 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t30AD529B9F75532560A194BC17C58F7FC6730EED * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914, ___m_keys_2)); }
inline KeyCollection_t0A2060F350137EC79AA6202BC9F9B46054C5F413 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t0A2060F350137EC79AA6202BC9F9B46054C5F413 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t0A2060F350137EC79AA6202BC9F9B46054C5F413 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914, ___m_values_3)); }
inline ValueCollection_t30AD529B9F75532560A194BC17C58F7FC6730EED * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t30AD529B9F75532560A194BC17C58F7FC6730EED ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t30AD529B9F75532560A194BC17C58F7FC6730EED * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Guid,System.Tuple`2<System.Guid,System.Int32>>
struct ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t100B1159B7C4D5DF1C2C275F15E37E8AB8BD728B * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t6A5B0DF4354EAC00C0B894C9DA2A5EEC7D797A3F * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F, ___m_keys_2)); }
inline KeyCollection_t100B1159B7C4D5DF1C2C275F15E37E8AB8BD728B * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t100B1159B7C4D5DF1C2C275F15E37E8AB8BD728B ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t100B1159B7C4D5DF1C2C275F15E37E8AB8BD728B * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F, ___m_values_3)); }
inline ValueCollection_t6A5B0DF4354EAC00C0B894C9DA2A5EEC7D797A3F * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t6A5B0DF4354EAC00C0B894C9DA2A5EEC7D797A3F ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t6A5B0DF4354EAC00C0B894C9DA2A5EEC7D797A3F * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Guid,System.Int32>
struct ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t21B7557DDE03CCE9A21FCC99E16D10C7C3BEA4D0 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t36A365EF75A9898A232CCFD4C304FC50183E03D6 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E, ___m_keys_2)); }
inline KeyCollection_t21B7557DDE03CCE9A21FCC99E16D10C7C3BEA4D0 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t21B7557DDE03CCE9A21FCC99E16D10C7C3BEA4D0 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t21B7557DDE03CCE9A21FCC99E16D10C7C3BEA4D0 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E, ___m_values_3)); }
inline ValueCollection_t36A365EF75A9898A232CCFD4C304FC50183E03D6 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t36A365EF75A9898A232CCFD4C304FC50183E03D6 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t36A365EF75A9898A232CCFD4C304FC50183E03D6 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Utilities.Handedness,Microsoft.MixedReality.Toolkit.Input.BaseController>
struct ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tFE0508786785717E1220641183B4B03396C154AA * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t624E6BB132EEF360597BC843A6FC0EBACC55B0C1 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0, ___m_keys_2)); }
inline KeyCollection_tFE0508786785717E1220641183B4B03396C154AA * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tFE0508786785717E1220641183B4B03396C154AA ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tFE0508786785717E1220641183B4B03396C154AA * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0, ___m_values_3)); }
inline ValueCollection_t624E6BB132EEF360597BC843A6FC0EBACC55B0C1 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t624E6BB132EEF360597BC843A6FC0EBACC55B0C1 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t624E6BB132EEF360597BC843A6FC0EBACC55B0C1 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Bounds>
struct ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tC307CE3C0584060B71E846520F2333406A798601 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t882BE2B5D75F12EBEACBB7E06D4904385DAF768C * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B, ___m_keys_2)); }
inline KeyCollection_tC307CE3C0584060B71E846520F2333406A798601 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tC307CE3C0584060B71E846520F2333406A798601 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tC307CE3C0584060B71E846520F2333406A798601 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B, ___m_values_3)); }
inline ValueCollection_t882BE2B5D75F12EBEACBB7E06D4904385DAF768C * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t882BE2B5D75F12EBEACBB7E06D4904385DAF768C ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t882BE2B5D75F12EBEACBB7E06D4904385DAF768C * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Matrix4x4>
struct ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t3B9ADC9A5032ACFC3F89AE07A06747A46576C7E5 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tD538828B74F6A2AFFA25CBE1BBA7CC842EDBC88B * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93, ___m_keys_2)); }
inline KeyCollection_t3B9ADC9A5032ACFC3F89AE07A06747A46576C7E5 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t3B9ADC9A5032ACFC3F89AE07A06747A46576C7E5 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t3B9ADC9A5032ACFC3F89AE07A06747A46576C7E5 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93, ___m_values_3)); }
inline ValueCollection_tD538828B74F6A2AFFA25CBE1BBA7CC842EDBC88B * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tD538828B74F6A2AFFA25CBE1BBA7CC842EDBC88B ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tD538828B74F6A2AFFA25CBE1BBA7CC842EDBC88B * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Threading.IAsyncLocal,System.Object>
struct ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t71AB40EE74360EFE07FB14B096FF8E90A076C2A2 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t829D1A2C21BCE93FBCBE9E029CCC77E24419ADC3 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2, ___m_keys_2)); }
inline KeyCollection_t71AB40EE74360EFE07FB14B096FF8E90A076C2A2 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t71AB40EE74360EFE07FB14B096FF8E90A076C2A2 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t71AB40EE74360EFE07FB14B096FF8E90A076C2A2 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2, ___m_values_3)); }
inline ValueCollection_t829D1A2C21BCE93FBCBE9E029CCC77E24419ADC3 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t829D1A2C21BCE93FBCBE9E029CCC77E24419ADC3 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t829D1A2C21BCE93FBCBE9E029CCC77E24419ADC3 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<UnityEngine.UI.ICanvasElement,System.Int32>
struct ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tD6341EBDD23DD00939DFE208E567F42BA7E9AEA3 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tDFE3548B5884867CBB3AD8597EAF0B6F4F6E80D8 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F, ___m_keys_2)); }
inline KeyCollection_tD6341EBDD23DD00939DFE208E567F42BA7E9AEA3 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tD6341EBDD23DD00939DFE208E567F42BA7E9AEA3 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tD6341EBDD23DD00939DFE208E567F42BA7E9AEA3 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F, ___m_values_3)); }
inline ValueCollection_tDFE3548B5884867CBB3AD8597EAF0B6F4F6E80D8 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tDFE3548B5884867CBB3AD8597EAF0B6F4F6E80D8 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tDFE3548B5884867CBB3AD8597EAF0B6F4F6E80D8 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<UnityEngine.UI.IClipper,System.Int32>
struct ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t59831B456A0A136751FDDA7712D94C87D2A51470 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t576049C739ADEC4FC22A6AD4A068322B2F5A5C90 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B, ___m_keys_2)); }
inline KeyCollection_t59831B456A0A136751FDDA7712D94C87D2A51470 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t59831B456A0A136751FDDA7712D94C87D2A51470 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t59831B456A0A136751FDDA7712D94C87D2A51470 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B, ___m_values_3)); }
inline ValueCollection_t576049C739ADEC4FC22A6AD4A068322B2F5A5C90 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t576049C739ADEC4FC22A6AD4A068322B2F5A5C90 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t576049C739ADEC4FC22A6AD4A068322B2F5A5C90 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityController,UnityEngine.Vector3>
struct ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t48563FBAA98ED07855563CE8A1782835286BD582 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t81D2BF8746FC87C321D1790D5F591BB5A6B76F0F * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895, ___m_keys_2)); }
inline KeyCollection_t48563FBAA98ED07855563CE8A1782835286BD582 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t48563FBAA98ED07855563CE8A1782835286BD582 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t48563FBAA98ED07855563CE8A1782835286BD582 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895, ___m_values_3)); }
inline ValueCollection_t81D2BF8746FC87C321D1790D5F591BB5A6B76F0F * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t81D2BF8746FC87C321D1790D5F591BB5A6B76F0F ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t81D2BF8746FC87C321D1790D5F591BB5A6B76F0F * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource,System.Collections.Generic.HashSet`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer>>
struct ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tBEC3B14C7A10B2495ABD1B4112B38C814A5A9BC6 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t88AA7D05C30935D79B0F526379376400C14E702C * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E, ___m_keys_2)); }
inline KeyCollection_tBEC3B14C7A10B2495ABD1B4112B38C814A5A9BC6 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tBEC3B14C7A10B2495ABD1B4112B38C814A5A9BC6 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tBEC3B14C7A10B2495ABD1B4112B38C814A5A9BC6 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E, ___m_values_3)); }
inline ValueCollection_t88AA7D05C30935D79B0F526379376400C14E702C * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t88AA7D05C30935D79B0F526379376400C14E702C ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t88AA7D05C30935D79B0F526379376400C14E702C * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,System.UInt32>
struct ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tFEB6B4E692B58CA77DF4149F0C5842395524CD2C * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tB480898DF164ED876E680EC1EE7C30B6D36F49A2 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0, ___m_keys_2)); }
inline KeyCollection_tFEB6B4E692B58CA77DF4149F0C5842395524CD2C * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tFEB6B4E692B58CA77DF4149F0C5842395524CD2C ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tFEB6B4E692B58CA77DF4149F0C5842395524CD2C * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0, ___m_values_3)); }
inline ValueCollection_tB480898DF164ED876E680EC1EE7C30B6D36F49A2 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tB480898DF164ED876E680EC1EE7C30B6D36F49A2 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tB480898DF164ED876E680EC1EE7C30B6D36F49A2 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,Microsoft.MixedReality.Toolkit.Input.DefaultPrimaryPointerSelector/PointerInfo>
struct ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t7B8A284F5BB2D6A8776FF2297A0B573FA411AA04 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tB47F0DF77B94F9350BE7C867B06C986D34668EF9 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA, ___m_keys_2)); }
inline KeyCollection_t7B8A284F5BB2D6A8776FF2297A0B573FA411AA04 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t7B8A284F5BB2D6A8776FF2297A0B573FA411AA04 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t7B8A284F5BB2D6A8776FF2297A0B573FA411AA04 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA, ___m_values_3)); }
inline ValueCollection_tB47F0DF77B94F9350BE7C867B06C986D34668EF9 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tB47F0DF77B94F9350BE7C867B06C986D34668EF9 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tB47F0DF77B94F9350BE7C867B06C986D34668EF9 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.IMixedRealityService>>
struct ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t5D53234AE8258A492CE3C07FA9227A0CFB961F88 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t1C094DC8B02A38D900447BE3DA01769218D9FC20 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD, ___m_keys_2)); }
inline KeyCollection_t5D53234AE8258A492CE3C07FA9227A0CFB961F88 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t5D53234AE8258A492CE3C07FA9227A0CFB961F88 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t5D53234AE8258A492CE3C07FA9227A0CFB961F88 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD, ___m_values_3)); }
inline ValueCollection_t1C094DC8B02A38D900447BE3DA01769218D9FC20 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t1C094DC8B02A38D900447BE3DA01769218D9FC20 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t1C094DC8B02A38D900447BE3DA01769218D9FC20 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.UI.BoundsControl.IProximityEffectObjectProvider,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.BoundsControl.ProximityEffect/ObjectProximityInfo>>
struct ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tBAA30400F1432B3D327E6632A4AC38DF006858EA * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tCCF0B4ADEB7AF959B18D1C2BD27233D34F5D7E16 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB, ___m_keys_2)); }
inline KeyCollection_tBAA30400F1432B3D327E6632A4AC38DF006858EA * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tBAA30400F1432B3D327E6632A4AC38DF006858EA ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tBAA30400F1432B3D327E6632A4AC38DF006858EA * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB, ___m_values_3)); }
inline ValueCollection_tCCF0B4ADEB7AF959B18D1C2BD27233D34F5D7E16 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tCCF0B4ADEB7AF959B18D1C2BD27233D34F5D7E16 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tCCF0B4ADEB7AF959B18D1C2BD27233D34F5D7E16 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<UnityEngine.XR.InputDevice,Microsoft.MixedReality.Toolkit.XRSDK.Input.GenericXRSDKController>
struct ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tBEA1F3FD683D48327E87C82DAD888F9F4D371773 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t7CF71AEE7B0495C5EF2FC5BA6F959C77A1B74196 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025, ___m_keys_2)); }
inline KeyCollection_tBEA1F3FD683D48327E87C82DAD888F9F4D371773 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tBEA1F3FD683D48327E87C82DAD888F9F4D371773 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tBEA1F3FD683D48327E87C82DAD888F9F4D371773 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025, ___m_values_3)); }
inline ValueCollection_t7CF71AEE7B0495C5EF2FC5BA6F959C77A1B74196 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t7CF71AEE7B0495C5EF2FC5BA6F959C77A1B74196 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t7CF71AEE7B0495C5EF2FC5BA6F959C77A1B74196 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Tuple`2<Microsoft.MixedReality.Toolkit.Input.KeyBinding/KeyType,System.Int32>>
struct ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t6EA44DB82958C829DE5A6694A39503F16420DEFC * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tBB1F6159FF25E88DDF1B397279E98E15EA1A211E * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD, ___m_keys_2)); }
inline KeyCollection_t6EA44DB82958C829DE5A6694A39503F16420DEFC * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t6EA44DB82958C829DE5A6694A39503F16420DEFC ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t6EA44DB82958C829DE5A6694A39503F16420DEFC * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD, ___m_values_3)); }
inline ValueCollection_tBB1F6159FF25E88DDF1B397279E98E15EA1A211E * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tBB1F6159FF25E88DDF1B397279E98E15EA1A211E ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tBB1F6159FF25E88DDF1B397279E98E15EA1A211E * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Boolean>
struct ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tC152F08EF8CC08ADE84F34B3E1A3B65E6334851E * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tB51F603A239485F05720315028C603D2DC30180E * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41, ___m_keys_2)); }
inline KeyCollection_tC152F08EF8CC08ADE84F34B3E1A3B65E6334851E * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tC152F08EF8CC08ADE84F34B3E1A3B65E6334851E ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tC152F08EF8CC08ADE84F34B3E1A3B65E6334851E * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41, ___m_values_3)); }
inline ValueCollection_tB51F603A239485F05720315028C603D2DC30180E * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tB51F603A239485F05720315028C603D2DC30180E ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tB51F603A239485F05720315028C603D2DC30180E * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Char>
struct ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t0ECA6CB1949FA275ECDB3D8F05460076C20C785A * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t65BF5F1537D952260730F9EF31DFBCA90DA7FC5A * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F, ___m_keys_2)); }
inline KeyCollection_t0ECA6CB1949FA275ECDB3D8F05460076C20C785A * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t0ECA6CB1949FA275ECDB3D8F05460076C20C785A ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t0ECA6CB1949FA275ECDB3D8F05460076C20C785A * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F, ___m_values_3)); }
inline ValueCollection_t65BF5F1537D952260730F9EF31DFBCA90DA7FC5A * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t65BF5F1537D952260730F9EF31DFBCA90DA7FC5A ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t65BF5F1537D952260730F9EF31DFBCA90DA7FC5A * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Globalization.CultureInfo>
struct ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t1120F859B0671105D509AC98AAB21F7CFC2049D4 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t76A1D105429D1EF9CA00AED8B612D7F5DEA1A0E1 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B, ___m_keys_2)); }
inline KeyCollection_t1120F859B0671105D509AC98AAB21F7CFC2049D4 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t1120F859B0671105D509AC98AAB21F7CFC2049D4 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t1120F859B0671105D509AC98AAB21F7CFC2049D4 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B, ___m_values_3)); }
inline ValueCollection_t76A1D105429D1EF9CA00AED8B612D7F5DEA1A0E1 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t76A1D105429D1EF9CA00AED8B612D7F5DEA1A0E1 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t76A1D105429D1EF9CA00AED8B612D7F5DEA1A0E1 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,UnityEngine.InputSystem.InputDevice>
struct ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t7DABB128B3068790E06730049F25B17B6075B377 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t29CE86D517873AF2A288A323DE337E04664AEE6A * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA, ___m_keys_2)); }
inline KeyCollection_t7DABB128B3068790E06730049F25B17B6075B377 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t7DABB128B3068790E06730049F25B17B6075B377 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t7DABB128B3068790E06730049F25B17B6075B377 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA, ___m_values_3)); }
inline ValueCollection_t29CE86D517873AF2A288A323DE337E04664AEE6A * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t29CE86D517873AF2A288A323DE337E04664AEE6A ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t29CE86D517873AF2A288A323DE337E04664AEE6A * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Int32>
struct ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tEB01E49AAD44CFB3D07C82E1566073576FAB2A80 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t48B58DEA6F5CF1E9959CC08347044FD1199BB39C * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72, ___m_keys_2)); }
inline KeyCollection_tEB01E49AAD44CFB3D07C82E1566073576FAB2A80 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tEB01E49AAD44CFB3D07C82E1566073576FAB2A80 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tEB01E49AAD44CFB3D07C82E1566073576FAB2A80 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72, ___m_values_3)); }
inline ValueCollection_t48B58DEA6F5CF1E9959CC08347044FD1199BB39C * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t48B58DEA6F5CF1E9959CC08347044FD1199BB39C ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t48B58DEA6F5CF1E9959CC08347044FD1199BB39C * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Int64>
struct ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t1EE17E2E96FCA88DA7F88AD27E77B687940AC6F0 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tDD3A2A47F1254D88628C68D87D830A584722012F * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B, ___m_keys_2)); }
inline KeyCollection_t1EE17E2E96FCA88DA7F88AD27E77B687940AC6F0 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t1EE17E2E96FCA88DA7F88AD27E77B687940AC6F0 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t1EE17E2E96FCA88DA7F88AD27E77B687940AC6F0 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B, ___m_values_3)); }
inline ValueCollection_tDD3A2A47F1254D88628C68D87D830A584722012F * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tDD3A2A47F1254D88628C68D87D830A584722012F ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tDD3A2A47F1254D88628C68D87D830A584722012F * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,UnityEngine.Material>
struct ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t3CE094E958DC2A4E1855D6EAC1A8BACE08E4FE5D * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tE6DD53C28F18E9D5F05F965551F3C88178BF15B4 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6, ___m_keys_2)); }
inline KeyCollection_t3CE094E958DC2A4E1855D6EAC1A8BACE08E4FE5D * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t3CE094E958DC2A4E1855D6EAC1A8BACE08E4FE5D ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t3CE094E958DC2A4E1855D6EAC1A8BACE08E4FE5D * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6, ___m_values_3)); }
inline ValueCollection_tE6DD53C28F18E9D5F05F965551F3C88178BF15B4 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tE6DD53C28F18E9D5F05F965551F3C88178BF15B4 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tE6DD53C28F18E9D5F05F965551F3C88178BF15B4 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,UnityEngine.EventSystems.PointerEventData>
struct ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t36E68F717226925CBAC6C90C1AB8AAB176DD2BB7 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t9FEB03EF99A5A4FEC35B8B143F9A805C36347399 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E, ___m_keys_2)); }
inline KeyCollection_t36E68F717226925CBAC6C90C1AB8AAB176DD2BB7 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t36E68F717226925CBAC6C90C1AB8AAB176DD2BB7 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t36E68F717226925CBAC6C90C1AB8AAB176DD2BB7 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E, ___m_values_3)); }
inline ValueCollection_t9FEB03EF99A5A4FEC35B8B143F9A805C36347399 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t9FEB03EF99A5A4FEC35B8B143F9A805C36347399 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t9FEB03EF99A5A4FEC35B8B143F9A805C36347399 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject>
struct ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t11C6480A0AA8BA2524E09FAD4CB06EA43D014E62 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t286FC8F90BCF5633CB10F1F4AA4431C4A66F2399 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024, ___m_keys_2)); }
inline KeyCollection_t11C6480A0AA8BA2524E09FAD4CB06EA43D014E62 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t11C6480A0AA8BA2524E09FAD4CB06EA43D014E62 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t11C6480A0AA8BA2524E09FAD4CB06EA43D014E62 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024, ___m_values_3)); }
inline ValueCollection_t286FC8F90BCF5633CB10F1F4AA4431C4A66F2399 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t286FC8F90BCF5633CB10F1F4AA4431C4A66F2399 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t286FC8F90BCF5633CB10F1F4AA4431C4A66F2399 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.String>
struct ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t6932AD9E99EA6C71F8A923A002967381B381BF53 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tE8B618071B897471AC32AAF06060B187610CFB43 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C, ___m_keys_2)); }
inline KeyCollection_t6932AD9E99EA6C71F8A923A002967381B381BF53 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t6932AD9E99EA6C71F8A923A002967381B381BF53 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t6932AD9E99EA6C71F8A923A002967381B381BF53 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C, ___m_values_3)); }
inline ValueCollection_tE8B618071B897471AC32AAF06060B187610CFB43 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tE8B618071B897471AC32AAF06060B187610CFB43 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tE8B618071B897471AC32AAF06060B187610CFB43 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,TMPro.TMP_ColorGradient>
struct ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tC74D8AF310675B9B8E60837F9E1812820ABD12B4 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tF3E06E1B7F3F827575625D735B684EDF94431971 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3, ___m_keys_2)); }
inline KeyCollection_tC74D8AF310675B9B8E60837F9E1812820ABD12B4 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tC74D8AF310675B9B8E60837F9E1812820ABD12B4 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tC74D8AF310675B9B8E60837F9E1812820ABD12B4 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3, ___m_values_3)); }
inline ValueCollection_tF3E06E1B7F3F827575625D735B684EDF94431971 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tF3E06E1B7F3F827575625D735B684EDF94431971 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tF3E06E1B7F3F827575625D735B684EDF94431971 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,TMPro.TMP_FontAsset>
struct ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tC603D277AC671F95A1044519C8EAD316174FBF84 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t468EF4114E5E829EEC9AFCCDF8745C4D2E301C88 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8, ___m_keys_2)); }
inline KeyCollection_tC603D277AC671F95A1044519C8EAD316174FBF84 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tC603D277AC671F95A1044519C8EAD316174FBF84 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tC603D277AC671F95A1044519C8EAD316174FBF84 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8, ___m_values_3)); }
inline ValueCollection_t468EF4114E5E829EEC9AFCCDF8745C4D2E301C88 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t468EF4114E5E829EEC9AFCCDF8745C4D2E301C88 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t468EF4114E5E829EEC9AFCCDF8745C4D2E301C88 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,TMPro.TMP_SpriteAsset>
struct ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tCEC377A32BD5D2F233A8F2E12FE9E705FFF439F5 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tA7D37A794F6B8768525831C895952CD93ED21510 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC, ___m_keys_2)); }
inline KeyCollection_tCEC377A32BD5D2F233A8F2E12FE9E705FFF439F5 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tCEC377A32BD5D2F233A8F2E12FE9E705FFF439F5 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tCEC377A32BD5D2F233A8F2E12FE9E705FFF439F5 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC, ___m_values_3)); }
inline ValueCollection_tA7D37A794F6B8768525831C895952CD93ED21510 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tA7D37A794F6B8768525831C895952CD93ED21510 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tA7D37A794F6B8768525831C895952CD93ED21510 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,TMPro.TMP_Style>
struct ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t0B22698FC2260E4BA6DE3CF4FB74255D959C1084 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tD45AF1B120128FB336471F76D41131B907650C04 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20, ___m_keys_2)); }
inline KeyCollection_t0B22698FC2260E4BA6DE3CF4FB74255D959C1084 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t0B22698FC2260E4BA6DE3CF4FB74255D959C1084 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t0B22698FC2260E4BA6DE3CF4FB74255D959C1084 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20, ___m_values_3)); }
inline ValueCollection_tD45AF1B120128FB336471F76D41131B907650C04 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tD45AF1B120128FB336471F76D41131B907650C04 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tD45AF1B120128FB336471F76D41131B907650C04 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Threading.Tasks.Task>
struct ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_tB40DBF9D9498664FB66CF52AD1E1FB018C857D89 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_tC0EF51948EA6CC2782B13B162C154C832EFEC3E1 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7, ___m_keys_2)); }
inline KeyCollection_tB40DBF9D9498664FB66CF52AD1E1FB018C857D89 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_tB40DBF9D9498664FB66CF52AD1E1FB018C857D89 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_tB40DBF9D9498664FB66CF52AD1E1FB018C857D89 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7, ___m_values_3)); }
inline ValueCollection_tC0EF51948EA6CC2782B13B162C154C832EFEC3E1 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_tC0EF51948EA6CC2782B13B162C154C832EFEC3E1 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_tC0EF51948EA6CC2782B13B162C154C832EFEC3E1 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.TimeType>
struct ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t8801AB37735B63E5DFEA7B114BDB81C78F2E5D79 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t06DE7C9B1AF6C21F3D792B24ED702715CB5C9B80 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC, ___m_keys_2)); }
inline KeyCollection_t8801AB37735B63E5DFEA7B114BDB81C78F2E5D79 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t8801AB37735B63E5DFEA7B114BDB81C78F2E5D79 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t8801AB37735B63E5DFEA7B114BDB81C78F2E5D79 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC, ___m_values_3)); }
inline ValueCollection_t06DE7C9B1AF6C21F3D792B24ED702715CB5C9B80 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t06DE7C9B1AF6C21F3D792B24ED702715CB5C9B80 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t06DE7C9B1AF6C21F3D792B24ED702715CB5C9B80 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,Microsoft.MixedReality.Toolkit.Input.UnityInput.UnityTouchController>
struct ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540 : public RuntimeObject
{
public:
// System.Collections.Generic.IDictionary`2<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_dictionary
RuntimeObject* ___m_dictionary_0;
// System.Object System.Collections.ObjectModel.ReadOnlyDictionary`2::m_syncRoot
RuntimeObject * ___m_syncRoot_1;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_keys
KeyCollection_t2D88D7F45C442875C6C68906155E7A30B9B7D878 * ___m_keys_2;
// System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection<TKey,TValue> System.Collections.ObjectModel.ReadOnlyDictionary`2::m_values
ValueCollection_t111F98392C1525CC0317CC7584CA2762FD80A412 * ___m_values_3;
public:
inline static int32_t get_offset_of_m_dictionary_0() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540, ___m_dictionary_0)); }
inline RuntimeObject* get_m_dictionary_0() const { return ___m_dictionary_0; }
inline RuntimeObject** get_address_of_m_dictionary_0() { return &___m_dictionary_0; }
inline void set_m_dictionary_0(RuntimeObject* value)
{
___m_dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_m_syncRoot_1() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540, ___m_syncRoot_1)); }
inline RuntimeObject * get_m_syncRoot_1() const { return ___m_syncRoot_1; }
inline RuntimeObject ** get_address_of_m_syncRoot_1() { return &___m_syncRoot_1; }
inline void set_m_syncRoot_1(RuntimeObject * value)
{
___m_syncRoot_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_syncRoot_1), (void*)value);
}
inline static int32_t get_offset_of_m_keys_2() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540, ___m_keys_2)); }
inline KeyCollection_t2D88D7F45C442875C6C68906155E7A30B9B7D878 * get_m_keys_2() const { return ___m_keys_2; }
inline KeyCollection_t2D88D7F45C442875C6C68906155E7A30B9B7D878 ** get_address_of_m_keys_2() { return &___m_keys_2; }
inline void set_m_keys_2(KeyCollection_t2D88D7F45C442875C6C68906155E7A30B9B7D878 * value)
{
___m_keys_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_keys_2), (void*)value);
}
inline static int32_t get_offset_of_m_values_3() { return static_cast<int32_t>(offsetof(ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540, ___m_values_3)); }
inline ValueCollection_t111F98392C1525CC0317CC7584CA2762FD80A412 * get_m_values_3() const { return ___m_values_3; }
inline ValueCollection_t111F98392C1525CC0317CC7584CA2762FD80A412 ** get_address_of_m_values_3() { return &___m_values_3; }
inline void set_m_values_3(ValueCollection_t111F98392C1525CC0317CC7584CA2762FD80A412 * value)
{
___m_values_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_values_3), (void*)value);
}
};
// 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.Guid
struct Guid_t
{
public:
// System.Int32 System.Guid::_a
int32_t ____a_1;
// System.Int16 System.Guid::_b
int16_t ____b_2;
// System.Int16 System.Guid::_c
int16_t ____c_3;
// System.Byte System.Guid::_d
uint8_t ____d_4;
// System.Byte System.Guid::_e
uint8_t ____e_5;
// System.Byte System.Guid::_f
uint8_t ____f_6;
// System.Byte System.Guid::_g
uint8_t ____g_7;
// System.Byte System.Guid::_h
uint8_t ____h_8;
// System.Byte System.Guid::_i
uint8_t ____i_9;
// System.Byte System.Guid::_j
uint8_t ____j_10;
// System.Byte System.Guid::_k
uint8_t ____k_11;
public:
inline static int32_t get_offset_of__a_1() { return static_cast<int32_t>(offsetof(Guid_t, ____a_1)); }
inline int32_t get__a_1() const { return ____a_1; }
inline int32_t* get_address_of__a_1() { return &____a_1; }
inline void set__a_1(int32_t value)
{
____a_1 = value;
}
inline static int32_t get_offset_of__b_2() { return static_cast<int32_t>(offsetof(Guid_t, ____b_2)); }
inline int16_t get__b_2() const { return ____b_2; }
inline int16_t* get_address_of__b_2() { return &____b_2; }
inline void set__b_2(int16_t value)
{
____b_2 = value;
}
inline static int32_t get_offset_of__c_3() { return static_cast<int32_t>(offsetof(Guid_t, ____c_3)); }
inline int16_t get__c_3() const { return ____c_3; }
inline int16_t* get_address_of__c_3() { return &____c_3; }
inline void set__c_3(int16_t value)
{
____c_3 = value;
}
inline static int32_t get_offset_of__d_4() { return static_cast<int32_t>(offsetof(Guid_t, ____d_4)); }
inline uint8_t get__d_4() const { return ____d_4; }
inline uint8_t* get_address_of__d_4() { return &____d_4; }
inline void set__d_4(uint8_t value)
{
____d_4 = value;
}
inline static int32_t get_offset_of__e_5() { return static_cast<int32_t>(offsetof(Guid_t, ____e_5)); }
inline uint8_t get__e_5() const { return ____e_5; }
inline uint8_t* get_address_of__e_5() { return &____e_5; }
inline void set__e_5(uint8_t value)
{
____e_5 = value;
}
inline static int32_t get_offset_of__f_6() { return static_cast<int32_t>(offsetof(Guid_t, ____f_6)); }
inline uint8_t get__f_6() const { return ____f_6; }
inline uint8_t* get_address_of__f_6() { return &____f_6; }
inline void set__f_6(uint8_t value)
{
____f_6 = value;
}
inline static int32_t get_offset_of__g_7() { return static_cast<int32_t>(offsetof(Guid_t, ____g_7)); }
inline uint8_t get__g_7() const { return ____g_7; }
inline uint8_t* get_address_of__g_7() { return &____g_7; }
inline void set__g_7(uint8_t value)
{
____g_7 = value;
}
inline static int32_t get_offset_of__h_8() { return static_cast<int32_t>(offsetof(Guid_t, ____h_8)); }
inline uint8_t get__h_8() const { return ____h_8; }
inline uint8_t* get_address_of__h_8() { return &____h_8; }
inline void set__h_8(uint8_t value)
{
____h_8 = value;
}
inline static int32_t get_offset_of__i_9() { return static_cast<int32_t>(offsetof(Guid_t, ____i_9)); }
inline uint8_t get__i_9() const { return ____i_9; }
inline uint8_t* get_address_of__i_9() { return &____i_9; }
inline void set__i_9(uint8_t value)
{
____i_9 = value;
}
inline static int32_t get_offset_of__j_10() { return static_cast<int32_t>(offsetof(Guid_t, ____j_10)); }
inline uint8_t get__j_10() const { return ____j_10; }
inline uint8_t* get_address_of__j_10() { return &____j_10; }
inline void set__j_10(uint8_t value)
{
____j_10 = value;
}
inline static int32_t get_offset_of__k_11() { return static_cast<int32_t>(offsetof(Guid_t, ____k_11)); }
inline uint8_t get__k_11() const { return ____k_11; }
inline uint8_t* get_address_of__k_11() { return &____k_11; }
inline void set__k_11(uint8_t value)
{
____k_11 = value;
}
};
struct Guid_t_StaticFields
{
public:
// System.Guid System.Guid::Empty
Guid_t ___Empty_0;
// System.Object System.Guid::_rngAccess
RuntimeObject * ____rngAccess_12;
// System.Security.Cryptography.RandomNumberGenerator System.Guid::_rng
RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * ____rng_13;
// System.Security.Cryptography.RandomNumberGenerator System.Guid::_fastRng
RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * ____fastRng_14;
public:
inline static int32_t get_offset_of_Empty_0() { return static_cast<int32_t>(offsetof(Guid_t_StaticFields, ___Empty_0)); }
inline Guid_t get_Empty_0() const { return ___Empty_0; }
inline Guid_t * get_address_of_Empty_0() { return &___Empty_0; }
inline void set_Empty_0(Guid_t value)
{
___Empty_0 = value;
}
inline static int32_t get_offset_of__rngAccess_12() { return static_cast<int32_t>(offsetof(Guid_t_StaticFields, ____rngAccess_12)); }
inline RuntimeObject * get__rngAccess_12() const { return ____rngAccess_12; }
inline RuntimeObject ** get_address_of__rngAccess_12() { return &____rngAccess_12; }
inline void set__rngAccess_12(RuntimeObject * value)
{
____rngAccess_12 = value;
Il2CppCodeGenWriteBarrier((void**)(&____rngAccess_12), (void*)value);
}
inline static int32_t get_offset_of__rng_13() { return static_cast<int32_t>(offsetof(Guid_t_StaticFields, ____rng_13)); }
inline RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * get__rng_13() const { return ____rng_13; }
inline RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 ** get_address_of__rng_13() { return &____rng_13; }
inline void set__rng_13(RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * value)
{
____rng_13 = value;
Il2CppCodeGenWriteBarrier((void**)(&____rng_13), (void*)value);
}
inline static int32_t get_offset_of__fastRng_14() { return static_cast<int32_t>(offsetof(Guid_t_StaticFields, ____fastRng_14)); }
inline RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * get__fastRng_14() const { return ____fastRng_14; }
inline RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 ** get_address_of__fastRng_14() { return &____fastRng_14; }
inline void set__fastRng_14(RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * value)
{
____fastRng_14 = value;
Il2CppCodeGenWriteBarrier((void**)(&____fastRng_14), (void*)value);
}
};
// Windows.Foundation.Collections.IMapView`2<System.Guid,System.Int32>
struct NOVTABLE IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m8BA42B864F6C257CAF439CE9100A97CEE92D724E(Guid_t ___key0, int32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_mD73D070366AE35969606856EC6DCE120156A04C6(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_mDBE6CAD4DC9F39869E13AF1FB63DAC74067469B4(Guid_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_mD6707386A8CE8C51DA82754F5FEB54A97C534D79(IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D** ___first0, IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D** ___second1) = 0;
};
// Windows.Foundation.Collections.IMap`2<System.Guid,System.Int32>
struct NOVTABLE IMap_2_t75BDDB1CFEAC14E79B70B14045B988FAF9452816 : Il2CppIInspectable
{
static const Il2CppGuid IID;
virtual il2cpp_hresult_t STDCALL IMap_2_Lookup_m5A2C6329228538B3BF494DDCE75894E45C227006(Guid_t ___key0, int32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_mB95CF8DDB7BC957A2D29CCAF524A4DEB324B6A6B(uint32_t* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m14675BEA8F14DE9A11D7120490357CE9E0E2B186(Guid_t ___key0, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_mB29A5BFB8C664366432EFA898B5EB6CB29DBF7DA(IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D** comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_m3A6AFEFD6A9D612698EA64C485D9C32A28B60866(Guid_t ___key0, int32_t ___value1, bool* comReturnValue) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_m9D2145EC9500E960251BCF88A1F98EE285E5C38D(Guid_t ___key0) = 0;
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_m6EDE8265C25BA4410FBD18F11D17E5E3E8905889() = 0;
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
il2cpp_hresult_t IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue);
il2cpp_hresult_t IMap_2_Lookup_m5A2C6329228538B3BF494DDCE75894E45C227006_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Guid_t ___key0, int32_t* comReturnValue);
il2cpp_hresult_t IMap_2_get_Size_mB95CF8DDB7BC957A2D29CCAF524A4DEB324B6A6B_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMap_2_HasKey_m14675BEA8F14DE9A11D7120490357CE9E0E2B186_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Guid_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMap_2_GetView_mB29A5BFB8C664366432EFA898B5EB6CB29DBF7DA_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D** comReturnValue);
il2cpp_hresult_t IMap_2_Insert_m3A6AFEFD6A9D612698EA64C485D9C32A28B60866_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Guid_t ___key0, int32_t ___value1, bool* comReturnValue);
il2cpp_hresult_t IMap_2_Remove_m9D2145EC9500E960251BCF88A1F98EE285E5C38D_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Guid_t ___key0);
il2cpp_hresult_t IMap_2_Clear_m6EDE8265C25BA4410FBD18F11D17E5E3E8905889_ComCallableWrapperProjectedMethod(RuntimeObject* __this);
il2cpp_hresult_t IIterable_1_First_m86DE4489A430066D4958BD2839105D891E5521D7_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_t2C43A7E52B7CC8D1B2DA6DD4EC3E72A84A4CF8F2** comReturnValue);
il2cpp_hresult_t IMapView_2_Lookup_m8BA42B864F6C257CAF439CE9100A97CEE92D724E_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Guid_t ___key0, int32_t* comReturnValue);
il2cpp_hresult_t IMapView_2_get_Size_mD73D070366AE35969606856EC6DCE120156A04C6_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMapView_2_HasKey_mDBE6CAD4DC9F39869E13AF1FB63DAC74067469B4_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Guid_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMapView_2_Split_mD6707386A8CE8C51DA82754F5FEB54A97C534D79_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D** ___first0, IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D** ___second1);
il2cpp_hresult_t IMap_2_Lookup_mA933DB0545BDD0696DE178C26B213DBF50649112_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMap_2_get_Size_m0B41DBAB888FFCC00B592003BE3893CE879D6AC1_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMap_2_HasKey_mBE38A8C334050C874D03DDD694809724D1C388D0_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMap_2_GetView_m4270DE4E8EE35DDC27AB4E46731FA7CBC1CDA96B_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93** comReturnValue);
il2cpp_hresult_t IMap_2_Insert_mF49C0F471888E5414C278642DB7F2D7A28AD15A2_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool ___value1, bool* comReturnValue);
il2cpp_hresult_t IMap_2_Remove_mDCFFF6A68115E9EC6F0A01A27361BB97FD93BE07_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0);
il2cpp_hresult_t IMap_2_Clear_m314D7501B86EED681697C87FA6E1424A7B88865A_ComCallableWrapperProjectedMethod(RuntimeObject* __this);
il2cpp_hresult_t IIterable_1_First_mF1B3E048A0581C18F58EDA631F1294A18A139660_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_t08AEA15D8898425B3BBB6D82FDB5DB8877E45871** comReturnValue);
il2cpp_hresult_t IMapView_2_Lookup_m469C905EF54DAF27213804F57584265C5B7D385F_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMapView_2_get_Size_m10976D2AD6CC3487D1E144A0B90AEF311AD58741_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMapView_2_HasKey_mC9D5B78679E2271BEC5EFE9FF3C581BFCB326EF4_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMapView_2_Split_m7D8CCBA5B295FA5DE3EE144F6D77940AA1979BDF_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93** ___first0, IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93** ___second1);
il2cpp_hresult_t IMap_2_Lookup_mA996412DE91A9F64D733F7112D47096E9561BAB6_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, Il2CppChar* comReturnValue);
il2cpp_hresult_t IMap_2_get_Size_mDF4551C75FF9F39FD763A76F88B9863AA292DC04_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMap_2_HasKey_m4DCE9F553416C914F1B0A7091E9B6D6EAAB6E40B_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMap_2_GetView_m871DFD46103269D5E3B1491ED9337E2B85E08D83_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355** comReturnValue);
il2cpp_hresult_t IMap_2_Insert_mD6F83BA5B05B98C960AB70F1E76CEC5BCD12DA9E_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, Il2CppChar ___value1, bool* comReturnValue);
il2cpp_hresult_t IMap_2_Remove_m5086C3460B92AAD73B31F9680AD39274D3C722A4_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0);
il2cpp_hresult_t IMap_2_Clear_m07C59EB72EB1EE931F96F4D665C5A28FD5794D08_ComCallableWrapperProjectedMethod(RuntimeObject* __this);
il2cpp_hresult_t IIterable_1_First_m47FB691D69387BB0A2E88AC4091E471841209411_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_tA84C89A77204275A66F65440F1A1802C6D307207** comReturnValue);
il2cpp_hresult_t IMapView_2_Lookup_m49957256BD4125F303D3D1E0A9E9C68799FAC75E_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, Il2CppChar* comReturnValue);
il2cpp_hresult_t IMapView_2_get_Size_m9F2BF8DAD00F504EB40FD8BF8227FCAB4954F656_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMapView_2_HasKey_mC5A2469DD85823295D7EF1D09E0CE24802EEB601_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMapView_2_Split_m2DEF44547499ABB3BB70543866731DFF51939791_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355** ___first0, IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355** ___second1);
il2cpp_hresult_t IMap_2_Lookup_mAB2557F89B67970660EAEA867C160D8B4519A59B_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, int32_t* comReturnValue);
il2cpp_hresult_t IMap_2_get_Size_mA1A1CCC776D0A04E6CB464990ACA1A8A24B8FB99_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMap_2_HasKey_m09F3138AF64D40439835CED4FA397E6A5567B69F_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMap_2_GetView_m49BD462B6D6FBA94E03FC317B3F348E400D8D059_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61** comReturnValue);
il2cpp_hresult_t IMap_2_Insert_m26A58381A4B7979D7635D8C6BABB43581F277A1E_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, int32_t ___value1, bool* comReturnValue);
il2cpp_hresult_t IMap_2_Remove_mBEBB5F63E6AF3D5EC5F85CEC6FF599CF27892CA3_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0);
il2cpp_hresult_t IMap_2_Clear_mFC61A1262C6FF5614B12B0D00A26C3B01B909312_ComCallableWrapperProjectedMethod(RuntimeObject* __this);
il2cpp_hresult_t IIterable_1_First_m9E67B40CA2B0E8AB40AC60919F35CDBAF4907598_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_tAB0C1B446829B226CAAD72C2FBCB3E1FBB5A4C71** comReturnValue);
il2cpp_hresult_t IMapView_2_Lookup_mEB4A4831069E064FC0A807E20E51095F61208AAF_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, int32_t* comReturnValue);
il2cpp_hresult_t IMapView_2_get_Size_mDBDA039F45FE7DAB8B299F8284D620683947C20D_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMapView_2_HasKey_m3BE9E9A164CFAD5EBF9879319054D86AAA4D529C_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMapView_2_Split_m6869EE64C18723F0BB0D10417E11AA80918D1295_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61** ___first0, IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61** ___second1);
il2cpp_hresult_t IMap_2_Lookup_mD086C909F276F0A409C254386A5433BA1D8E4DA1_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, int64_t* comReturnValue);
il2cpp_hresult_t IMap_2_get_Size_mF7543BFD7482B050F35BE3CABFB5B6A903300CE7_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMap_2_HasKey_m1543A9B7F80B3A5489328F1F77CB0691655EA012_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMap_2_GetView_mF5636C470F31A6C155D5AAA77FB9BD0442C34E04_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7** comReturnValue);
il2cpp_hresult_t IMap_2_Insert_mD8D2C48C925DF3B8A1F36EB5D923E7798AAD25AD_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, int64_t ___value1, bool* comReturnValue);
il2cpp_hresult_t IMap_2_Remove_m588519BFAFF613E05C992F17D2D10A9104A5C511_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0);
il2cpp_hresult_t IMap_2_Clear_mF043DFCA2742D3F57D3380D0D42A6D7DD46867C7_ComCallableWrapperProjectedMethod(RuntimeObject* __this);
il2cpp_hresult_t IIterable_1_First_mC90DE28333E7B75BCEE7ADDA4E3BE0A56EEEB649_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_tCAC42F4EF69B7F9727A04F84FB9773E96CB8DFC9** comReturnValue);
il2cpp_hresult_t IMapView_2_Lookup_m1D42C30FE9DDE2255F85A4128C70FBC74070E24A_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, int64_t* comReturnValue);
il2cpp_hresult_t IMapView_2_get_Size_mE5B4042270AF83F3467CED1201613AF6870931F1_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMapView_2_HasKey_m70F1D85335051378EC9751B6CF4AAEE9F5AB6288_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMapView_2_Split_m5ACA09637DDBA456BDE48B599992DD4316CEDC0A_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7** ___first0, IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7** ___second1);
il2cpp_hresult_t IMap_2_Lookup_mDB3DE71A1EF4936EF85DC58F72AE18C4DEA7AEA4_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, Il2CppHString* comReturnValue);
il2cpp_hresult_t IMap_2_get_Size_m6F21CB368462EE986560EFB89B18F2EB87266C65_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMap_2_HasKey_m1C1D3DFD5C4CFE039AB133F6FCD00923AA128825_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMap_2_GetView_m388C3012C136C6DF202561F3223E1937B3126DC5_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A** comReturnValue);
il2cpp_hresult_t IMap_2_Insert_mD0EE050C010FEBDF35A137076BB5B9C8D7C134F8_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, Il2CppHString ___value1, bool* comReturnValue);
il2cpp_hresult_t IMap_2_Remove_mC0F7A2C3AA571DFBB44D55A01F218C9303BF0005_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0);
il2cpp_hresult_t IMap_2_Clear_m2B14C4BB95BEBBA259CCB82E215F6D503A0B8708_ComCallableWrapperProjectedMethod(RuntimeObject* __this);
il2cpp_hresult_t IIterable_1_First_m14DE8FC349ACC550CA242FB49577D6B0AF1C1EB1_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_t90E26C41183EBF622D2BBB227E37A898BAA6B97B** comReturnValue);
il2cpp_hresult_t IMapView_2_Lookup_m6C3FB595F2E75BA520D8DD9CAA9B6D3F73DD9E81_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, Il2CppHString* comReturnValue);
il2cpp_hresult_t IMapView_2_get_Size_m3EE77EBA65F7B85780CE3CD3E9FBEED16D13FBEB_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue);
il2cpp_hresult_t IMapView_2_HasKey_m6F79F442D9D546B542483DBCC15739DF4C1CA6A0_ComCallableWrapperProjectedMethod(RuntimeObject* __this, int32_t ___key0, bool* comReturnValue);
il2cpp_hresult_t IMapView_2_Split_m12E007F56F41C3C40A71A9B19D78FDE3485A68BF_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A** ___first0, IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A** ___second1);
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<UnityEngine.UI.Graphic,System.Int32>
struct ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t589BC223A24DB32CFF8F9497D6DDBBC52F799914_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Guid,System.Tuple`2<System.Guid,System.Int32>>
struct ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t0F76C9FA54D039979C6BE2DEED91F496A7186F3F_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Guid,System.Int32>
struct ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E_ComCallableWrapper>, IMap_2_t75BDDB1CFEAC14E79B70B14045B988FAF9452816, IIterable_1_t1A5E333D12640BC7AB143CBE013FDE40AFB4F475, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D
{
inline ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E_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, &IMap_2_t75BDDB1CFEAC14E79B70B14045B988FAF9452816::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMap_2_t75BDDB1CFEAC14E79B70B14045B988FAF9452816*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IIterable_1_t1A5E333D12640BC7AB143CBE013FDE40AFB4F475::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IIterable_1_t1A5E333D12640BC7AB143CBE013FDE40AFB4F475*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D*>(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>(4);
interfaceIds[0] = IMap_2_t75BDDB1CFEAC14E79B70B14045B988FAF9452816::IID;
interfaceIds[1] = IIterable_1_t1A5E333D12640BC7AB143CBE013FDE40AFB4F475::IID;
interfaceIds[2] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID;
interfaceIds[3] = IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D::IID;
*iidCount = 4;
*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 IMap_2_Lookup_m5A2C6329228538B3BF494DDCE75894E45C227006(Guid_t ___key0, int32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Lookup_m5A2C6329228538B3BF494DDCE75894E45C227006_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_mB95CF8DDB7BC957A2D29CCAF524A4DEB324B6A6B(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_get_Size_mB95CF8DDB7BC957A2D29CCAF524A4DEB324B6A6B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m14675BEA8F14DE9A11D7120490357CE9E0E2B186(Guid_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_HasKey_m14675BEA8F14DE9A11D7120490357CE9E0E2B186_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_mB29A5BFB8C664366432EFA898B5EB6CB29DBF7DA(IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D** comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_GetView_mB29A5BFB8C664366432EFA898B5EB6CB29DBF7DA_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_m3A6AFEFD6A9D612698EA64C485D9C32A28B60866(Guid_t ___key0, int32_t ___value1, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Insert_m3A6AFEFD6A9D612698EA64C485D9C32A28B60866_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, ___value1, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_m9D2145EC9500E960251BCF88A1F98EE285E5C38D(Guid_t ___key0) IL2CPP_OVERRIDE
{
return IMap_2_Remove_m9D2145EC9500E960251BCF88A1F98EE285E5C38D_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_m6EDE8265C25BA4410FBD18F11D17E5E3E8905889() IL2CPP_OVERRIDE
{
return IMap_2_Clear_m6EDE8265C25BA4410FBD18F11D17E5E3E8905889_ComCallableWrapperProjectedMethod(GetManagedObjectInline());
}
virtual il2cpp_hresult_t STDCALL IIterable_1_First_m86DE4489A430066D4958BD2839105D891E5521D7(IIterator_1_t2C43A7E52B7CC8D1B2DA6DD4EC3E72A84A4CF8F2** comReturnValue) IL2CPP_OVERRIDE
{
return IIterable_1_First_m86DE4489A430066D4958BD2839105D891E5521D7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m8BA42B864F6C257CAF439CE9100A97CEE92D724E(Guid_t ___key0, int32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_Lookup_m8BA42B864F6C257CAF439CE9100A97CEE92D724E_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_mD73D070366AE35969606856EC6DCE120156A04C6(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_get_Size_mD73D070366AE35969606856EC6DCE120156A04C6_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_mDBE6CAD4DC9F39869E13AF1FB63DAC74067469B4(Guid_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_HasKey_mDBE6CAD4DC9F39869E13AF1FB63DAC74067469B4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_mD6707386A8CE8C51DA82754F5FEB54A97C534D79(IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D** ___first0, IMapView_2_t9A58F4156E13C5BBE7909B211D8219AA55795F2D** ___second1) IL2CPP_OVERRIDE
{
return IMapView_2_Split_mD6707386A8CE8C51DA82754F5FEB54A97C534D79_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___first0, ___second1);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tD462022E4E4B0AD53034DDFB300958BCCB83F22E_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Utilities.Handedness,Microsoft.MixedReality.Toolkit.Input.BaseController>
struct ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t18E7205C2A1B62A6E609903631E36766B2034CF0_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Bounds>
struct ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tC1C8C13E520C19C41B2D5F2760A5ACA52FB4B73B_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Utilities.Handedness,UnityEngine.Matrix4x4>
struct ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tF5B4631E580E9FC237E64AADB3F46F314345AA93_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Threading.IAsyncLocal,System.Object>
struct ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tE4E6255D89D037BC58155EF2F32DF47F552AE8C2_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<UnityEngine.UI.ICanvasElement,System.Int32>
struct ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tF0212F89F7D36E986C3C595EEEEEB745BE43570F_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<UnityEngine.UI.IClipper,System.Int32>
struct ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t07979764650AD2B7B7A8C0902A16963B7D5F922B_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityController,UnityEngine.Vector3>
struct ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tBBB688585DBC90E7D01B007DC1C6B31120A4A895_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource,System.Collections.Generic.HashSet`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer>>
struct ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tE7E76E2887662C60271C758FFBDECA49F1461C2E_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,System.UInt32>
struct ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t60A21AD25E18B34C6E5CA536A4B84DD0B2EC73E0_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,Microsoft.MixedReality.Toolkit.Input.DefaultPrimaryPointerSelector/PointerInfo>
struct ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t355C7EDB9B6C77C20807C42898DBE6FAD53EE6EA_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.IMixedRealityService>>
struct ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t8D414CBB2D11EF4127BD9396AA24CB25C79047FD_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<Microsoft.MixedReality.Toolkit.UI.BoundsControl.IProximityEffectObjectProvider,System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.BoundsControl.ProximityEffect/ObjectProximityInfo>>
struct ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t2C64EC8C2260929DA802816DC4C54B4CB37AE6CB_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<UnityEngine.XR.InputDevice,Microsoft.MixedReality.Toolkit.XRSDK.Input.GenericXRSDKController>
struct ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t2A89CD4732A508A45E70FA4BFC1B769F94003025_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Tuple`2<Microsoft.MixedReality.Toolkit.Input.KeyBinding/KeyType,System.Int32>>
struct ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t96CCE215E4673D46C76833E37AC5BECFAA3318DD_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Boolean>
struct ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41_ComCallableWrapper>, IMap_2_t7A9DC49D30935DDE44DED4A1E3A0D986EDE6958D, IIterable_1_t24BEE69C80E58630BDE330EE63AEDC24029850BB, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93
{
inline ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41_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, &IMap_2_t7A9DC49D30935DDE44DED4A1E3A0D986EDE6958D::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMap_2_t7A9DC49D30935DDE44DED4A1E3A0D986EDE6958D*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IIterable_1_t24BEE69C80E58630BDE330EE63AEDC24029850BB::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IIterable_1_t24BEE69C80E58630BDE330EE63AEDC24029850BB*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93*>(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>(4);
interfaceIds[0] = IMap_2_t7A9DC49D30935DDE44DED4A1E3A0D986EDE6958D::IID;
interfaceIds[1] = IIterable_1_t24BEE69C80E58630BDE330EE63AEDC24029850BB::IID;
interfaceIds[2] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID;
interfaceIds[3] = IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93::IID;
*iidCount = 4;
*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 IMap_2_Lookup_mA933DB0545BDD0696DE178C26B213DBF50649112(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Lookup_mA933DB0545BDD0696DE178C26B213DBF50649112_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_m0B41DBAB888FFCC00B592003BE3893CE879D6AC1(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_get_Size_m0B41DBAB888FFCC00B592003BE3893CE879D6AC1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_mBE38A8C334050C874D03DDD694809724D1C388D0(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_HasKey_mBE38A8C334050C874D03DDD694809724D1C388D0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_m4270DE4E8EE35DDC27AB4E46731FA7CBC1CDA96B(IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93** comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_GetView_m4270DE4E8EE35DDC27AB4E46731FA7CBC1CDA96B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_mF49C0F471888E5414C278642DB7F2D7A28AD15A2(int32_t ___key0, bool ___value1, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Insert_mF49C0F471888E5414C278642DB7F2D7A28AD15A2_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, ___value1, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_mDCFFF6A68115E9EC6F0A01A27361BB97FD93BE07(int32_t ___key0) IL2CPP_OVERRIDE
{
return IMap_2_Remove_mDCFFF6A68115E9EC6F0A01A27361BB97FD93BE07_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_m314D7501B86EED681697C87FA6E1424A7B88865A() IL2CPP_OVERRIDE
{
return IMap_2_Clear_m314D7501B86EED681697C87FA6E1424A7B88865A_ComCallableWrapperProjectedMethod(GetManagedObjectInline());
}
virtual il2cpp_hresult_t STDCALL IIterable_1_First_mF1B3E048A0581C18F58EDA631F1294A18A139660(IIterator_1_t08AEA15D8898425B3BBB6D82FDB5DB8877E45871** comReturnValue) IL2CPP_OVERRIDE
{
return IIterable_1_First_mF1B3E048A0581C18F58EDA631F1294A18A139660_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m469C905EF54DAF27213804F57584265C5B7D385F(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_Lookup_m469C905EF54DAF27213804F57584265C5B7D385F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_m10976D2AD6CC3487D1E144A0B90AEF311AD58741(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_get_Size_m10976D2AD6CC3487D1E144A0B90AEF311AD58741_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_mC9D5B78679E2271BEC5EFE9FF3C581BFCB326EF4(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_HasKey_mC9D5B78679E2271BEC5EFE9FF3C581BFCB326EF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m7D8CCBA5B295FA5DE3EE144F6D77940AA1979BDF(IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93** ___first0, IMapView_2_t76FAEFDF2F73C8244B1A2D59D0213EE9BD77DC93** ___second1) IL2CPP_OVERRIDE
{
return IMapView_2_Split_m7D8CCBA5B295FA5DE3EE144F6D77940AA1979BDF_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___first0, ___second1);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t94A33E2725F41E442736837A86C17F9DF4FBFE41_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Char>
struct ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F_ComCallableWrapper>, IMap_2_tC55ED98B37E17834DDE8B154F875F82A31862872, IIterable_1_t7F2949B13FCF6A4E25D160B9CD47BFB85A8FBAE6, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355
{
inline ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F_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, &IMap_2_tC55ED98B37E17834DDE8B154F875F82A31862872::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMap_2_tC55ED98B37E17834DDE8B154F875F82A31862872*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IIterable_1_t7F2949B13FCF6A4E25D160B9CD47BFB85A8FBAE6::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IIterable_1_t7F2949B13FCF6A4E25D160B9CD47BFB85A8FBAE6*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355*>(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>(4);
interfaceIds[0] = IMap_2_tC55ED98B37E17834DDE8B154F875F82A31862872::IID;
interfaceIds[1] = IIterable_1_t7F2949B13FCF6A4E25D160B9CD47BFB85A8FBAE6::IID;
interfaceIds[2] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID;
interfaceIds[3] = IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355::IID;
*iidCount = 4;
*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 IMap_2_Lookup_mA996412DE91A9F64D733F7112D47096E9561BAB6(int32_t ___key0, Il2CppChar* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Lookup_mA996412DE91A9F64D733F7112D47096E9561BAB6_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_mDF4551C75FF9F39FD763A76F88B9863AA292DC04(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_get_Size_mDF4551C75FF9F39FD763A76F88B9863AA292DC04_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m4DCE9F553416C914F1B0A7091E9B6D6EAAB6E40B(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_HasKey_m4DCE9F553416C914F1B0A7091E9B6D6EAAB6E40B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_m871DFD46103269D5E3B1491ED9337E2B85E08D83(IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355** comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_GetView_m871DFD46103269D5E3B1491ED9337E2B85E08D83_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_mD6F83BA5B05B98C960AB70F1E76CEC5BCD12DA9E(int32_t ___key0, Il2CppChar ___value1, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Insert_mD6F83BA5B05B98C960AB70F1E76CEC5BCD12DA9E_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, ___value1, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_m5086C3460B92AAD73B31F9680AD39274D3C722A4(int32_t ___key0) IL2CPP_OVERRIDE
{
return IMap_2_Remove_m5086C3460B92AAD73B31F9680AD39274D3C722A4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_m07C59EB72EB1EE931F96F4D665C5A28FD5794D08() IL2CPP_OVERRIDE
{
return IMap_2_Clear_m07C59EB72EB1EE931F96F4D665C5A28FD5794D08_ComCallableWrapperProjectedMethod(GetManagedObjectInline());
}
virtual il2cpp_hresult_t STDCALL IIterable_1_First_m47FB691D69387BB0A2E88AC4091E471841209411(IIterator_1_tA84C89A77204275A66F65440F1A1802C6D307207** comReturnValue) IL2CPP_OVERRIDE
{
return IIterable_1_First_m47FB691D69387BB0A2E88AC4091E471841209411_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m49957256BD4125F303D3D1E0A9E9C68799FAC75E(int32_t ___key0, Il2CppChar* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_Lookup_m49957256BD4125F303D3D1E0A9E9C68799FAC75E_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_m9F2BF8DAD00F504EB40FD8BF8227FCAB4954F656(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_get_Size_m9F2BF8DAD00F504EB40FD8BF8227FCAB4954F656_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_mC5A2469DD85823295D7EF1D09E0CE24802EEB601(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_HasKey_mC5A2469DD85823295D7EF1D09E0CE24802EEB601_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m2DEF44547499ABB3BB70543866731DFF51939791(IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355** ___first0, IMapView_2_t236311C03D3697267453A2EA550A5DCCA91C3355** ___second1) IL2CPP_OVERRIDE
{
return IMapView_2_Split_m2DEF44547499ABB3BB70543866731DFF51939791_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___first0, ___second1);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tECE6F11A04B83CA76EB0421A48A02199D94D121F_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Globalization.CultureInfo>
struct ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t15BF2A22CB6B8F99DCE85F98E69AF13B6A3A952B_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,UnityEngine.InputSystem.InputDevice>
struct ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t45EB00AB090BB608BCCAC13290FE825A44436BAA_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Int32>
struct ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72_ComCallableWrapper>, IMap_2_t2D2887BEE348A15C28549CB5E6D3D465077579B1, IIterable_1_tD388FA3CB5D870407558B6357E3097F22416E7E3, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61
{
inline ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72_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, &IMap_2_t2D2887BEE348A15C28549CB5E6D3D465077579B1::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMap_2_t2D2887BEE348A15C28549CB5E6D3D465077579B1*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IIterable_1_tD388FA3CB5D870407558B6357E3097F22416E7E3::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IIterable_1_tD388FA3CB5D870407558B6357E3097F22416E7E3*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61*>(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>(4);
interfaceIds[0] = IMap_2_t2D2887BEE348A15C28549CB5E6D3D465077579B1::IID;
interfaceIds[1] = IIterable_1_tD388FA3CB5D870407558B6357E3097F22416E7E3::IID;
interfaceIds[2] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID;
interfaceIds[3] = IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61::IID;
*iidCount = 4;
*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 IMap_2_Lookup_mAB2557F89B67970660EAEA867C160D8B4519A59B(int32_t ___key0, int32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Lookup_mAB2557F89B67970660EAEA867C160D8B4519A59B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_mA1A1CCC776D0A04E6CB464990ACA1A8A24B8FB99(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_get_Size_mA1A1CCC776D0A04E6CB464990ACA1A8A24B8FB99_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m09F3138AF64D40439835CED4FA397E6A5567B69F(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_HasKey_m09F3138AF64D40439835CED4FA397E6A5567B69F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_m49BD462B6D6FBA94E03FC317B3F348E400D8D059(IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61** comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_GetView_m49BD462B6D6FBA94E03FC317B3F348E400D8D059_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_m26A58381A4B7979D7635D8C6BABB43581F277A1E(int32_t ___key0, int32_t ___value1, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Insert_m26A58381A4B7979D7635D8C6BABB43581F277A1E_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, ___value1, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_mBEBB5F63E6AF3D5EC5F85CEC6FF599CF27892CA3(int32_t ___key0) IL2CPP_OVERRIDE
{
return IMap_2_Remove_mBEBB5F63E6AF3D5EC5F85CEC6FF599CF27892CA3_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_mFC61A1262C6FF5614B12B0D00A26C3B01B909312() IL2CPP_OVERRIDE
{
return IMap_2_Clear_mFC61A1262C6FF5614B12B0D00A26C3B01B909312_ComCallableWrapperProjectedMethod(GetManagedObjectInline());
}
virtual il2cpp_hresult_t STDCALL IIterable_1_First_m9E67B40CA2B0E8AB40AC60919F35CDBAF4907598(IIterator_1_tAB0C1B446829B226CAAD72C2FBCB3E1FBB5A4C71** comReturnValue) IL2CPP_OVERRIDE
{
return IIterable_1_First_m9E67B40CA2B0E8AB40AC60919F35CDBAF4907598_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_mEB4A4831069E064FC0A807E20E51095F61208AAF(int32_t ___key0, int32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_Lookup_mEB4A4831069E064FC0A807E20E51095F61208AAF_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_mDBDA039F45FE7DAB8B299F8284D620683947C20D(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_get_Size_mDBDA039F45FE7DAB8B299F8284D620683947C20D_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_m3BE9E9A164CFAD5EBF9879319054D86AAA4D529C(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_HasKey_m3BE9E9A164CFAD5EBF9879319054D86AAA4D529C_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m6869EE64C18723F0BB0D10417E11AA80918D1295(IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61** ___first0, IMapView_2_t548EA6D6E616674BC67D13E4562AA912021A4E61** ___second1) IL2CPP_OVERRIDE
{
return IMapView_2_Split_m6869EE64C18723F0BB0D10417E11AA80918D1295_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___first0, ___second1);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t94495832C53252F67C5CCB49E8CBCABBC1F8CA72_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Int64>
struct ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B_ComCallableWrapper>, IMap_2_t131C1AAB31D1D45DD27D52AC64C0A5BCD9788170, IIterable_1_tD7A5412C67484BA2083059C445DC95E7BC6041C7, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7
{
inline ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B_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, &IMap_2_t131C1AAB31D1D45DD27D52AC64C0A5BCD9788170::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMap_2_t131C1AAB31D1D45DD27D52AC64C0A5BCD9788170*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IIterable_1_tD7A5412C67484BA2083059C445DC95E7BC6041C7::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IIterable_1_tD7A5412C67484BA2083059C445DC95E7BC6041C7*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7*>(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>(4);
interfaceIds[0] = IMap_2_t131C1AAB31D1D45DD27D52AC64C0A5BCD9788170::IID;
interfaceIds[1] = IIterable_1_tD7A5412C67484BA2083059C445DC95E7BC6041C7::IID;
interfaceIds[2] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID;
interfaceIds[3] = IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7::IID;
*iidCount = 4;
*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 IMap_2_Lookup_mD086C909F276F0A409C254386A5433BA1D8E4DA1(int32_t ___key0, int64_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Lookup_mD086C909F276F0A409C254386A5433BA1D8E4DA1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_mF7543BFD7482B050F35BE3CABFB5B6A903300CE7(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_get_Size_mF7543BFD7482B050F35BE3CABFB5B6A903300CE7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m1543A9B7F80B3A5489328F1F77CB0691655EA012(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_HasKey_m1543A9B7F80B3A5489328F1F77CB0691655EA012_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_mF5636C470F31A6C155D5AAA77FB9BD0442C34E04(IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7** comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_GetView_mF5636C470F31A6C155D5AAA77FB9BD0442C34E04_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_mD8D2C48C925DF3B8A1F36EB5D923E7798AAD25AD(int32_t ___key0, int64_t ___value1, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Insert_mD8D2C48C925DF3B8A1F36EB5D923E7798AAD25AD_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, ___value1, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_m588519BFAFF613E05C992F17D2D10A9104A5C511(int32_t ___key0) IL2CPP_OVERRIDE
{
return IMap_2_Remove_m588519BFAFF613E05C992F17D2D10A9104A5C511_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_mF043DFCA2742D3F57D3380D0D42A6D7DD46867C7() IL2CPP_OVERRIDE
{
return IMap_2_Clear_mF043DFCA2742D3F57D3380D0D42A6D7DD46867C7_ComCallableWrapperProjectedMethod(GetManagedObjectInline());
}
virtual il2cpp_hresult_t STDCALL IIterable_1_First_mC90DE28333E7B75BCEE7ADDA4E3BE0A56EEEB649(IIterator_1_tCAC42F4EF69B7F9727A04F84FB9773E96CB8DFC9** comReturnValue) IL2CPP_OVERRIDE
{
return IIterable_1_First_mC90DE28333E7B75BCEE7ADDA4E3BE0A56EEEB649_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m1D42C30FE9DDE2255F85A4128C70FBC74070E24A(int32_t ___key0, int64_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_Lookup_m1D42C30FE9DDE2255F85A4128C70FBC74070E24A_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_mE5B4042270AF83F3467CED1201613AF6870931F1(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_get_Size_mE5B4042270AF83F3467CED1201613AF6870931F1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_m70F1D85335051378EC9751B6CF4AAEE9F5AB6288(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_HasKey_m70F1D85335051378EC9751B6CF4AAEE9F5AB6288_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m5ACA09637DDBA456BDE48B599992DD4316CEDC0A(IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7** ___first0, IMapView_2_tA6FA0DF533C0B6B506D0CE1F81728364B83DFBC7** ___second1) IL2CPP_OVERRIDE
{
return IMapView_2_Split_m5ACA09637DDBA456BDE48B599992DD4316CEDC0A_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___first0, ___second1);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t4391F61D869EFF27D62F24AB1B96134018F1E61B_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,UnityEngine.Material>
struct ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tADA942D1C550BE3C1CD830C3961E9B5FD33B03C6_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,UnityEngine.EventSystems.PointerEventData>
struct ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tED34D95FE4136B90678C98308D100993304BD55E_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject>
struct ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t182C5D313E8FBD5006FF18745C797DF932540024_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.String>
struct ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C_ComCallableWrapper>, IMap_2_t6D83CFC4BB5F39D14238C2A6C38DB1D7D36E9EE3, IIterable_1_tFC0F28A8493453E790566AD9BF521EB99E862227, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A
{
inline ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C_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, &IMap_2_t6D83CFC4BB5F39D14238C2A6C38DB1D7D36E9EE3::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMap_2_t6D83CFC4BB5F39D14238C2A6C38DB1D7D36E9EE3*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IIterable_1_tFC0F28A8493453E790566AD9BF521EB99E862227::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IIterable_1_tFC0F28A8493453E790566AD9BF521EB99E862227*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this);
AddRefImpl();
return IL2CPP_S_OK;
}
if (::memcmp(&iid, &IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A*>(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>(4);
interfaceIds[0] = IMap_2_t6D83CFC4BB5F39D14238C2A6C38DB1D7D36E9EE3::IID;
interfaceIds[1] = IIterable_1_tFC0F28A8493453E790566AD9BF521EB99E862227::IID;
interfaceIds[2] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID;
interfaceIds[3] = IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A::IID;
*iidCount = 4;
*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 IMap_2_Lookup_mDB3DE71A1EF4936EF85DC58F72AE18C4DEA7AEA4(int32_t ___key0, Il2CppHString* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Lookup_mDB3DE71A1EF4936EF85DC58F72AE18C4DEA7AEA4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_get_Size_m6F21CB368462EE986560EFB89B18F2EB87266C65(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_get_Size_m6F21CB368462EE986560EFB89B18F2EB87266C65_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_HasKey_m1C1D3DFD5C4CFE039AB133F6FCD00923AA128825(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_HasKey_m1C1D3DFD5C4CFE039AB133F6FCD00923AA128825_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_GetView_m388C3012C136C6DF202561F3223E1937B3126DC5(IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A** comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_GetView_m388C3012C136C6DF202561F3223E1937B3126DC5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Insert_mD0EE050C010FEBDF35A137076BB5B9C8D7C134F8(int32_t ___key0, Il2CppHString ___value1, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMap_2_Insert_mD0EE050C010FEBDF35A137076BB5B9C8D7C134F8_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, ___value1, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Remove_mC0F7A2C3AA571DFBB44D55A01F218C9303BF0005(int32_t ___key0) IL2CPP_OVERRIDE
{
return IMap_2_Remove_mC0F7A2C3AA571DFBB44D55A01F218C9303BF0005_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0);
}
virtual il2cpp_hresult_t STDCALL IMap_2_Clear_m2B14C4BB95BEBBA259CCB82E215F6D503A0B8708() IL2CPP_OVERRIDE
{
return IMap_2_Clear_m2B14C4BB95BEBBA259CCB82E215F6D503A0B8708_ComCallableWrapperProjectedMethod(GetManagedObjectInline());
}
virtual il2cpp_hresult_t STDCALL IIterable_1_First_m14DE8FC349ACC550CA242FB49577D6B0AF1C1EB1(IIterator_1_t90E26C41183EBF622D2BBB227E37A898BAA6B97B** comReturnValue) IL2CPP_OVERRIDE
{
return IIterable_1_First_m14DE8FC349ACC550CA242FB49577D6B0AF1C1EB1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Lookup_m6C3FB595F2E75BA520D8DD9CAA9B6D3F73DD9E81(int32_t ___key0, Il2CppHString* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_Lookup_m6C3FB595F2E75BA520D8DD9CAA9B6D3F73DD9E81_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_get_Size_m3EE77EBA65F7B85780CE3CD3E9FBEED16D13FBEB(uint32_t* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_get_Size_m3EE77EBA65F7B85780CE3CD3E9FBEED16D13FBEB_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_HasKey_m6F79F442D9D546B542483DBCC15739DF4C1CA6A0(int32_t ___key0, bool* comReturnValue) IL2CPP_OVERRIDE
{
return IMapView_2_HasKey_m6F79F442D9D546B542483DBCC15739DF4C1CA6A0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___key0, comReturnValue);
}
virtual il2cpp_hresult_t STDCALL IMapView_2_Split_m12E007F56F41C3C40A71A9B19D78FDE3485A68BF(IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A** ___first0, IMapView_2_t34DF605D0FD6600E1AFA0C5217689101A8E2683A** ___second1) IL2CPP_OVERRIDE
{
return IMapView_2_Split_m12E007F56F41C3C40A71A9B19D78FDE3485A68BF_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___first0, ___second1);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t2FD7EF7C2953A0FA2E5770F98E8DC7D5A406599C_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,TMPro.TMP_ColorGradient>
struct ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tE6409BCCF10FB75849663B26651762A7CA1151C3_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,TMPro.TMP_FontAsset>
struct ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tC7DBF5CF62D79BBA614B58FA679552C1290249D8_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,TMPro.TMP_SpriteAsset>
struct ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tA55D7BA1D60482A27FACAB54040185A7B5A2CFDC_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,TMPro.TMP_Style>
struct ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_tA73602853F6D5B9273669E30C61B542EC0C44A20_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.Threading.Tasks.Task>
struct ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t1CE2C5DE301204F93936F43A7A89CA8CD1CDCEF7_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,System.TimeType>
struct ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t6B7EE201299560D35CC7303AD96690BFC044B0BC_ComCallableWrapper(obj));
}
// COM Callable Wrapper for System.Collections.ObjectModel.ReadOnlyDictionary`2<System.Int32,Microsoft.MixedReality.Toolkit.Input.UnityInput.UnityTouchController>
struct ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8
{
inline ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540_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, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0)
{
*object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(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] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::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 IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE
{
return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue);
}
};
IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540(RuntimeObject* obj)
{
void* memory = il2cpp::utils::Memory::Malloc(sizeof(ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540_ComCallableWrapper));
if (memory == NULL)
{
il2cpp_codegen_raise_out_of_memory_exception();
}
return static_cast<Il2CppIManagedObjectHolder*>(new(memory) ReadOnlyDictionary_2_t03DE3A7AA85F77422769E20DA7643E5660AC7540_ComCallableWrapper(obj));
}
| 50.539544 | 432 | 0.836649 | JBrentJ |
e09e14ae609c62d2934946f9f2d2b8a22d9e074b | 1,511 | hpp | C++ | runtime/include/cloe/utility/std_extensions.hpp | Sidharth-S-S/cloe | 974ef649e7dc6ec4e6869e4cf690c5b021e5091e | [
"Apache-2.0"
] | 20 | 2020-07-07T18:28:35.000Z | 2022-03-21T04:35:28.000Z | runtime/include/cloe/utility/std_extensions.hpp | Sidharth-S-S/cloe | 974ef649e7dc6ec4e6869e4cf690c5b021e5091e | [
"Apache-2.0"
] | 46 | 2021-01-20T10:13:09.000Z | 2022-03-29T12:27:19.000Z | runtime/include/cloe/utility/std_extensions.hpp | Sidharth-S-S/cloe | 974ef649e7dc6ec4e6869e4cf690c5b021e5091e | [
"Apache-2.0"
] | 12 | 2021-01-25T08:01:24.000Z | 2021-07-27T10:09:53.000Z | /*
* Copyright 2020 Robert Bosch GmbH
*
* 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.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* \file cloe/utility/std_extensions.hpp
* \see cloe/utility/std_extensions.cpp
*
* This file contains useful functions for dealing with standard datatypes.
*/
#pragma once
#ifndef CLOE_UTILITY_STD_EXTENSIONS_HPP_
#define CLOE_UTILITY_STD_EXTENSIONS_HPP_
#include <map> // for map<>
#include <string> // for string
#include <vector> // for vector<>
namespace cloe {
namespace utility {
std::string join_vector(const std::vector<std::string>& v, const std::string& sep);
std::vector<std::string> split_string(std::string&& s, const std::string& sep);
template <typename T>
std::vector<std::string> map_keys(const std::map<std::string, T>& m) {
std::vector<std::string> result;
result.reserve(m.size());
for (const auto& kv : m) {
result.emplace_back(kv.first);
}
return result;
}
} // namespace utility
} // namespace cloe
#endif
| 27.981481 | 83 | 0.717406 | Sidharth-S-S |
e0a5a1366a0301bcd3961c26d735aca5f47aff3e | 5,817 | cpp | C++ | Felix/excelexporter_test.cpp | ultimatezen/felix | 5a7ad298ca4dcd5f1def05c60ae3c84519ec54c4 | [
"MIT"
] | null | null | null | Felix/excelexporter_test.cpp | ultimatezen/felix | 5a7ad298ca4dcd5f1def05c60ae3c84519ec54c4 | [
"MIT"
] | null | null | null | Felix/excelexporter_test.cpp | ultimatezen/felix | 5a7ad298ca4dcd5f1def05c60ae3c84519ec54c4 | [
"MIT"
] | null | null | null | #include "stdafx.h"
#include "excelexporter.h"
#include "memory_local.h"
#include "record_local.h"
#include "felix_factory.h"
#ifdef UNIT_TEST
#include <boost/test/unit_test.hpp>
#include "ExcelInterfaceFake.h"
#include "MockListener.h"
#include "input_device_fake.h"
using namespace mem_engine ;
BOOST_AUTO_TEST_SUITE( TestCExcelExporter )
BOOST_AUTO_TEST_CASE( process_cell_text_empty)
{
wstring text ;
wstring out = process_cell_text(text) ;
BOOST_CHECK(out.empty()) ;
}
BOOST_AUTO_TEST_CASE( process_cell_text_foo)
{
wstring text = L"foo";
wstring out = process_cell_text(text) ;
BOOST_CHECK_EQUAL(string2string(out), "foo") ;
}
BOOST_AUTO_TEST_CASE( process_cell_text_equals_sign)
{
wstring text = L"=foo" ;
wstring out = process_cell_text(text) ;
BOOST_CHECK_EQUAL(string2string(out), "\'=foo") ;
}
// write_header
BOOST_AUTO_TEST_CASE( test_write_header_cells )
{
ExcelInterfaceFake *excel = new ExcelInterfaceFake ;
ExcelInterfacePtr excelptr(excel) ;
CMockListener listener ;
CExcelExporter exporter(&listener, excelptr) ;
exporter.write_header() ;
typedef ExcelInterfaceFake::celltext celltext;
typedef ExcelInterfaceFake::cellcoord cellcoord;
std::vector<celltext> expected ;
expected += celltext(cellcoord(1, 1), L"Source"),
celltext(cellcoord(1, 2), L"Trans"),
celltext(cellcoord(1, 3), L"Context"),
celltext(cellcoord(1, 4), L"Reliability"),
celltext(cellcoord(1, 5), L"Created"),
celltext(cellcoord(1, 6), L"Modified"),
celltext(cellcoord(1, 7), L"Verified") ;
for (size_t i = 0 ; i < expected.size() ; ++i)
{
BOOST_CHECK_EQUAL(excel->m_cell_text[i].first.first, expected[i].first.first) ;
BOOST_CHECK_EQUAL(excel->m_cell_text[i].first.second, expected[i].first.second) ;
BOOST_CHECK_EQUAL(excel->m_cell_text[i].second, expected[i].second) ;
}
}
BOOST_AUTO_TEST_CASE( test_write_header_bold )
{
ExcelInterfaceFake *excel = new ExcelInterfaceFake ;
ExcelInterfacePtr excelptr(excel) ;
CMockListener listener ;
CExcelExporter exporter(&listener, excelptr) ;
exporter.write_header() ;
typedef ExcelInterfaceFake::cellcoord cellcoord;
std::vector<cellcoord> expected ;
expected += cellcoord(1, 1),
cellcoord(1, 2),
cellcoord(1, 3),
cellcoord(1, 4),
cellcoord(1, 5),
cellcoord(1, 6),
cellcoord(1, 7) ;
for (size_t i = 0 ; i < expected.size() ; ++i)
{
BOOST_CHECK_EQUAL(excel->m_bold_cells[i].first, expected[i].first) ;
BOOST_CHECK_EQUAL(excel->m_bold_cells[i].second, expected[i].second) ;
}
BOOST_CHECK(excel->m_location == L"") ;
}
// write_record
BOOST_AUTO_TEST_CASE( test_write_record )
{
ExcelInterfaceFake *excel = new ExcelInterfaceFake ;
ExcelInterfacePtr excelptr(excel) ;
CMockListener listener ;
CExcelExporter exporter(&listener, excelptr) ;
record_pointer rec(new record_local) ;
rec->set_source(L"source") ;
rec->set_trans(L"<bold>trans</bold>") ;
rec->set_context(L"<foo>") ;
rec->set_reliability(1u) ;
rec->set_created(L"1999/10/01 09:15:14") ;
rec->set_modified(L"2008/11/12 11:12:13") ;
exporter.write_record(rec, 2) ;
typedef ExcelInterfaceFake::celltext celltext;
typedef ExcelInterfaceFake::cellcoord cellcoord;
std::vector<celltext> expected ;
expected += celltext(cellcoord(2, 1), L"source"),
celltext(cellcoord(2, 2), L"trans"),
celltext(cellcoord(2, 3), L"<foo>"),
celltext(cellcoord(2, 4), L"1"),
celltext(cellcoord(2, 5), L"1999/10/01 09:15:14"),
celltext(cellcoord(2, 6), L"2008/11/12 11:12:13"),
celltext(cellcoord(2, 7), L"false") ;
for (size_t i = 0 ; i < expected.size() ; ++i)
{
BOOST_CHECK_EQUAL(excel->m_cell_text[i].first.first, expected[i].first.first) ;
BOOST_CHECK_EQUAL(excel->m_cell_text[i].first.second, expected[i].first.second) ;
BOOST_CHECK_EQUAL(excel->m_cell_text[i].second, expected[i].second) ;
}
}
// export_excel
BOOST_AUTO_TEST_CASE( test_export_excel_empty_mem )
{
ExcelInterfaceFake *excel = new ExcelInterfaceFake ;
ExcelInterfacePtr excelptr(excel) ;
CMockListener listener ;
CExcelExporter exporter(&listener, excelptr) ;
mem_engine::memory_pointer mem = FelixFactory().make_memory() ;
input_device_ptr input(new InputDeviceFake) ;
exporter.export_excel(mem, _T("foo.xls"), input) ;
typedef ExcelInterfaceFake::cellcoord cellcoord;
std::vector<cellcoord> expected ;
expected += cellcoord(1, 1),
cellcoord(1, 2),
cellcoord(1, 3),
cellcoord(1, 4),
cellcoord(1, 5),
cellcoord(1, 6),
cellcoord(1, 7) ;
for (size_t i = 0 ; i < expected.size() ; ++i)
{
BOOST_CHECK_EQUAL(excel->m_bold_cells[i].first, expected[i].first) ;
BOOST_CHECK_EQUAL(excel->m_bold_cells[i].second, expected[i].second) ;
}
BOOST_CHECK_EQUAL(7u, excel->m_cell_text.size()) ;
BOOST_CHECK(excel->m_location == L"foo.xls") ;
}
BOOST_AUTO_TEST_CASE( test_export_excel_non_empty_mem )
{
ExcelInterfaceFake *excel = new ExcelInterfaceFake ;
ExcelInterfacePtr excelptr(excel) ;
CMockListener listener ;
CExcelExporter exporter(&listener, excelptr) ;
mem_engine::memory_pointer mem = FelixFactory().make_memory() ;
record_pointer rec(new record_local) ;
rec->set_source(L"source") ;
rec->set_trans(L"<bold>trans</bold>") ;
mem->add_record(rec) ;
input_device_ptr input(new InputDeviceFake) ;
exporter.export_excel(mem, _T("foo.xls"), input) ;
typedef ExcelInterfaceFake::cellcoord cellcoord;
BOOST_CHECK_EQUAL(excel->m_cell_text[7].second, wstring(L"source")) ;
BOOST_CHECK_EQUAL(excel->m_cell_text[8].second, wstring(L"trans")) ;
}
BOOST_AUTO_TEST_SUITE_END()
#endif | 30.296875 | 85 | 0.691937 | ultimatezen |
e0a5b466bb65e73e84ae4cb00262f06a6b3d6188 | 3,302 | hxx | C++ | main/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 679 | 2015-01-06T06:34:58.000Z | 2022-03-30T01:06:03.000Z | main/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 102 | 2017-11-07T08:51:31.000Z | 2022-03-17T12:13:49.000Z | main/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx | Grosskopf/openoffice | 93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7 | [
"Apache-2.0"
] | 331 | 2015-01-06T11:40:55.000Z | 2022-03-14T04:07:51.000Z | /**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef DBACCESS_DBDOCRECOVERY_HXX
#define DBACCESS_DBDOCRECOVERY_HXX
#include "dbaccessdllapi.h"
/** === begin UNO includes === **/
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/frame/XController.hpp>
/** === end UNO includes === **/
#include <vector>
#include <memory>
namespace comphelper
{
class ComponentContext;
}
//........................................................................
namespace dbaccess
{
//........................................................................
//====================================================================
//= DatabaseDocumentRecovery
//====================================================================
struct DatabaseDocumentRecovery_Data;
class DBACCESS_DLLPRIVATE DatabaseDocumentRecovery
{
public:
DatabaseDocumentRecovery(
const ::comphelper::ComponentContext& i_rContext
);
~DatabaseDocumentRecovery();
/** saves the modified sub components of the given controller(s) to the "recovery" sub storage of the document
storage.
@throws ::com::sun::star::uno::Exception
in case of an error.
*/
void saveModifiedSubComponents(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rTargetStorage,
const ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > >& i_rControllers
);
/** recovery sub components from the given document storage, if applicable
If the given document storage does not contain a recovery folder, the method silently returns.
@throws ::com::sun::star::uno::Exception
in case of an error.
*/
void recoverSubDocuments(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rDocumentStorage,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& i_rTargetController
);
private:
const ::std::auto_ptr< DatabaseDocumentRecovery_Data > m_pData;
};
//........................................................................
} // namespace dbaccess
//........................................................................
#endif // DBACCESS_DBDOCRECOVERY_HXX
| 36.285714 | 127 | 0.555724 | Grosskopf |
e0a5b95c43991d01c16a814fb5da558fe1aa1535 | 1,066 | cpp | C++ | 0300/70/376b.cpp | actium/cf | d7be128c3a9adb014a231a399f1c5f19e1ab2a38 | [
"Unlicense"
] | 1 | 2020-07-03T15:55:52.000Z | 2020-07-03T15:55:52.000Z | 0300/70/376b.cpp | actium/cf | d7be128c3a9adb014a231a399f1c5f19e1ab2a38 | [
"Unlicense"
] | null | null | null | 0300/70/376b.cpp | actium/cf | d7be128c3a9adb014a231a399f1c5f19e1ab2a38 | [
"Unlicense"
] | 3 | 2020-10-01T14:55:28.000Z | 2021-07-11T11:33:58.000Z | #include <iostream>
#include <vector>
void answer(unsigned v)
{
std::cout << v << '\n';
}
void solve(std::vector<std::vector<unsigned>>& c, std::vector<std::vector<unsigned>>& d)
{
const size_t n = c.size();
for (size_t i = 0; i < n; ++i) {
for (size_t j = 0; j < n; ++j) {
for (size_t k = 0; d[i][j] != 0 && k < n; ++k) {
const unsigned a = std::min(c[i][k], d[i][j]);
c[i][k] -= a;
c[j][k] += a;
c[j][i] -= a;
d[i][j] -= a;
}
}
}
unsigned s = 0;
for (size_t i = 0; i < n; ++i) {
for (size_t j = 0; j < n; ++j)
s += d[i][j];
}
answer(s);
}
int main()
{
size_t n, m;
std::cin >> n >> m;
std::vector<std::vector<unsigned>> c(n, std::vector<unsigned>(n)), d(n, std::vector<unsigned>(n));
for (size_t i = 0; i < m; ++i) {
unsigned x, y, z;
std::cin >> x >> y >> z;
c[y-1][x-1] = z;
d[x-1][y-1] = z;
}
solve(c, d);
return 0;
}
| 20.113208 | 102 | 0.395872 | actium |
e0ae06e96bd09a83737f5cde9d9baeb929f5fbed | 1,456 | hpp | C++ | miopengemm/include/miopengemm/findparams.hpp | pruthvistony/MIOpenGEMM | 8f844e134d54244a6138504a4190486d8702e8fd | [
"MIT"
] | 52 | 2017-06-30T06:45:19.000Z | 2021-11-04T01:53:48.000Z | miopengemm/include/miopengemm/findparams.hpp | pruthvistony/MIOpenGEMM | 8f844e134d54244a6138504a4190486d8702e8fd | [
"MIT"
] | 31 | 2017-08-01T03:17:25.000Z | 2022-03-22T18:19:41.000Z | miopengemm/include/miopengemm/findparams.hpp | pruthvistony/MIOpenGEMM | 8f844e134d54244a6138504a4190486d8702e8fd | [
"MIT"
] | 23 | 2017-07-17T02:09:17.000Z | 2021-11-10T00:38:19.000Z | /*******************************************************************************
* Copyright (C) 2017 Advanced Micro Devices, Inc. All rights reserved.
*******************************************************************************/
#ifndef GUARD_MIOPENGEMM_FINDPARAMS_HPP
#define GUARD_MIOPENGEMM_FINDPARAMS_HPP
#include <string>
#include <vector>
#include <miopengemm/kernelstring.hpp>
namespace MIOpenGEMM
{
std::string get_sumstatkey(SummStat::E sumstat);
class Halt
{
public:
size_t max_runs;
size_t min_runs;
double max_time;
double min_time;
Halt(std::array<size_t, Xtr::E::N> runs, std::array<double, Xtr::E::N> time);
Halt() = default;
bool halt(size_t ri, double et) const;
std::string get_status(size_t ri, double et) const;
std::string get_string() const;
};
class FindParams
{
public:
// for the outer find loop (number of descents, total time)
Halt hl_outer;
// for the (inner) core gemm loop (number of GEMMs, max time per kernel)
Halt hl_core;
SummStat::E sumstat;
FindParams(std::array<size_t, Xtr::E::N> descents,
std::array<double, Xtr::E::N> time_outer,
std::array<size_t, Xtr::E::N> per_kernel,
std::array<double, Xtr::E::N> time_core,
SummStat::E sumstat);
FindParams() = default;
std::string get_string() const;
};
FindParams get_at_least_n_seconds(double seconds);
FindParams get_at_least_n_restarts(size_t restarts);
}
#endif
| 25.103448 | 81 | 0.619505 | pruthvistony |
e0b5f2e277853f23a47ae0f36805b650aeb07a65 | 3,986 | hpp | C++ | include/native/helper/trace.hpp | nodenative/nodenative | cf988c9399e0793b1b8c29a8ffd09e910d1a0cb3 | [
"MIT"
] | 16 | 2016-03-16T22:16:18.000Z | 2021-04-05T04:46:38.000Z | include/native/helper/trace.hpp | nodenative/nodenative | cf988c9399e0793b1b8c29a8ffd09e910d1a0cb3 | [
"MIT"
] | 11 | 2016-03-16T22:02:26.000Z | 2021-04-04T02:20:51.000Z | include/native/helper/trace.hpp | nodenative/nodenative | cf988c9399e0793b1b8c29a8ffd09e910d1a0cb3 | [
"MIT"
] | 5 | 2016-03-22T14:03:34.000Z | 2021-01-06T18:08:46.000Z | #ifndef __NATIVE_HELPER_TRACE_HPP__
#define __NATIVE_HELPER_TRACE_HPP__
#include <iostream>
#include <sstream>
#include <stdexcept>
#define NNATIVE_INFO(log) std::cout << __FILE__ << ":" << __LINE__ << " (INFO): " << log << "\n";
#define PROMISE_REJECT(promise, msg) \
{ \
std::stringstream ss; \
ss << msg; \
native::FutureError err(ss.str(), __FILE__, __LINE__, __PRETTY_FUNCTION__); \
(promise).reject(ss.str()); \
}
#define ERROR_COPY(dest, source) dest(source, __FILE__, __LINE__, __PRETTY_FUNCTION__);
#ifndef NNATIVE_NO_ASSERT
#define NNATIVE_ASSERT(condition) \
if (!(condition)) { \
std::stringstream ss; \
ss << __PRETTY_FUNCTION__ << ": Assertion \"" << #condition << "\" failed"; \
NNATIVE_INFO(ss.str()); \
throw std::runtime_error(ss.str()); \
}
#define NNATIVE_ASSERT_MSG(condition, msg) \
if (!(condition)) { \
std::stringstream ss; \
ss << __PRETTY_FUNCTION__ << ": Assertion \"" << #condition << "\" failed. Message:" << msg; \
NNATIVE_INFO(msg); \
throw std::runtime_error(ss.str()); \
}
#define NNATIVE_CHECK_LOOP_THREAD(iLoop) \
NNATIVE_ASSERT_MSG(iLoop && iLoop->isOnEventLoopThread(), "Not on the event Loop thread")
#else /* NNATIVE_NO_ASSERT */
#define NNATIVE_ASSERT(condition)
#define NNATIVE_ASSERT_MSG(condition, msg)
#define NNATIVE_CHECK_LOOP_THREAD(iLoop)
#endif /* NNATIVE_NO_ASSERT */
#ifdef DEBUG
#include <cstdlib>
#include <string>
#define NNATIVE_DEBUG(log) std::cout << __FILE__ << ":" << __LINE__ << " (DBG): " << log << "\n";
#define NNATIVE_FCALL() native::helper::TraceFunction __currFunction(__FILE__, __LINE__, __PRETTY_FUNCTION__);
#define NNATIVE_MCALL() native::helper::TraceFunction __currFunction(__FILE__, __LINE__, __PRETTY_FUNCTION__);
namespace native {
namespace helper {
struct TraceFunction {
const std::string _file;
const unsigned int _line;
const std::string _function;
TraceFunction(const std::string &iFile, unsigned int iLine, const std::string &iFunction)
: _file(iFile), _line(iLine), _function(iFunction) {
std::cout << _file << ":" << _line << ":>> enter " << _function << "\n";
}
~TraceFunction() { std::cout << _file << ":" << _line << ":<< exit " << _function << "\n"; }
};
} /* namespace native */
} /* namespace native */
#else
#define NNATIVE_DEBUG(log)
#define NNATIVE_FCALL()
#define NNATIVE_MCALL()
#endif /* DEBUG */
#endif /* __NATIVE_HELPER_TRACE_HPP__ */
| 46.894118 | 120 | 0.413949 | nodenative |
e0b5fc1bd5e9a7de3744a2ca413bd67df684e558 | 5,108 | cpp | C++ | src/libzerocoin/PubcoinSignature.cpp | jskitty-repos/veil | 075f51693a5ac39e4c8bf22a9f12cd851fb29a1c | [
"MIT"
] | 124 | 2018-12-25T00:01:18.000Z | 2021-12-26T19:38:43.000Z | src/libzerocoin/PubcoinSignature.cpp | MatWaller/veil | 072cc3a63bda5f0c47c09cdc74635ee3bc68e160 | [
"MIT"
] | 702 | 2018-12-16T18:07:18.000Z | 2022-03-18T16:52:14.000Z | src/libzerocoin/PubcoinSignature.cpp | MatWaller/veil | 072cc3a63bda5f0c47c09cdc74635ee3bc68e160 | [
"MIT"
] | 151 | 2018-12-13T07:33:34.000Z | 2022-01-29T11:35:23.000Z | /**
* @file PubcoinSignature.cpp
*
* @brief De-anonymize zerocoins for times that the integrity of the accumulators or related libzerocoin zkp's are broken.
*
* @author presstab https://github.com/presstab, random-zebra https://github.com/random-zebra
* @date April 2019
*
* @copyright Copyright 2019 The Veil Developers, Copyright 2019 The PIVX Developers
* @license This project is released under the MIT license.
**/
#include "PubcoinSignature.h"
namespace libzerocoin {
/**
* Prove ownership of a pubcoin and prove that it links to the C1 commitment
*
* @param params: zerocoin params
* @param bnPubcoin: pubcoin value that is being spent
* @param C1: serialCommitmentToCoinValue
* @return PubcoinSignature object containing C1 randomness and pubcoin value
*/
PubcoinSignature::PubcoinSignature(const ZerocoinParams* params, const CBigNum& bnPubcoin, const Commitment& C1)
{
SetNull();
m_params = params;
m_version = C1_VERSION;
m_bnPubcoin = bnPubcoin;
m_bnRandomness = C1.getRandomness();
}
/**
* Reveal a pubcoin's secrets
*
* @param params: zerocoin params
* @param bnPubcoin: pubcoin value that is being spent
* @param bnRandomness: coin randomness
* @param bnSerial: coin serial
* @return PubcoinSignature object containing pubcoin randomness
*/
PubcoinSignature::PubcoinSignature(const ZerocoinParams* params, const CBigNum& bnPubcoin, const CBigNum& bnRandomness, const uint256& txidFrom, int vout)
{
SetNull();
m_params = params;
m_version = CURRENT_VERSION;
m_bnPubcoin = bnPubcoin;
m_bnRandomness = bnRandomness; //Randomness is the coin's randomness
m_hashTxFrom = txidFrom;
m_nOutpointPos = vout;
}
/**
* Validate signature by revealing C1's (a commitment to pubcoin) randomness, building a new commitment
* C(pubcoin, C1.randomness) and checking equality between C and C1.
*
* @param bnC1 - This C1 value must be the same value as the serialCommitmentToCoinValue in the coinspend object
* @return true if bnPubcoin matches the value that was committed to in C1
*/
bool PubcoinSignature::VerifyV1(const CBigNum& bnC1, std::string& strError) const
{
// Check that given member vars are as expected
if (m_version == 0) {
strError = "version is 0";
return false;
}
if (m_bnRandomness <= CBigNum(0)) {
strError = strprintf("randomness is equal to or less than 0 %s", m_bnRandomness.GetHex());
return false;
}
if (m_bnRandomness >= m_params->serialNumberSoKCommitmentGroup.groupOrder) {
strError = strprintf("randomness greater than max allowed amount %s", m_bnRandomness.GetHex());
return false;
}
// Check that the pubcoin is valid according to libzerocoin::PublicCoin standards (denom does not matter here)
try {
PublicCoin pubcoin(m_params, m_bnPubcoin, CoinDenomination::ZQ_TEN);
if (!pubcoin.validate()) {
strError = "pubcoin did not validate";
return false;
}
} catch (...) {
strError = "pubcoin threw an error";
return false;
}
// Check that C1, the commitment to the pubcoin under serial params, uses the same pubcoin
Commitment commitmentCheck(&m_params->serialNumberSoKCommitmentGroup, m_bnPubcoin, m_bnRandomness);
return commitmentCheck.getCommitmentValue() == bnC1;
}
/**
* Validate signature by revealing a pubcoin's randomness and importing its serial from the coinspend. Check that
* the pubcoin opens to a commitment of the randomness and the serial.
*
* @param bnSerial - The serial of the coinspend object
* @param bnPubcoin - The pubcoin value that is taken directly from the blockchain
* @return true if the commitment is equal to the provided pubcoin value
*/
bool PubcoinSignature::VerifyV2(const CBigNum& bnSerial, const CBigNum& bnPubcoin, std::string strError) const
{
if (m_version != 2 || m_bnRandomness < CBigNum(0) || m_bnRandomness >= m_params->coinCommitmentGroup.groupOrder || m_hashTxFrom.IsNull()) {
strError = "member var sanity check failed";
return false;
}
Commitment commitment(&m_params->coinCommitmentGroup, bnSerial, m_bnRandomness);
if (commitment.getCommitmentValue() != bnPubcoin) {
strError = "pubcoin value does not open to serial and randomness combination";
return false;
}
if (m_bnPubcoin != bnPubcoin) {
strError = "mismatched pubcoin value";
return false;
}
return true;
}
bool PubcoinSignature::GetMintOutpoint(uint256& txid, int& n) const
{
if (m_version < 2)
return false;
txid = m_hashTxFrom;
n = m_nOutpointPos;
return true;
}
}
| 37.837037 | 158 | 0.649765 | jskitty-repos |
e0bcadff81bbf209880ba8e97c26bee6cb652e5a | 220 | cpp | C++ | chapter-13/13.50.cpp | zero4drift/Cpp-Primer-5th-Exercises | d3d0f0d228e8c2c5a3b3fe1fd03ce34e0894e93f | [
"MIT"
] | null | null | null | chapter-13/13.50.cpp | zero4drift/Cpp-Primer-5th-Exercises | d3d0f0d228e8c2c5a3b3fe1fd03ce34e0894e93f | [
"MIT"
] | null | null | null | chapter-13/13.50.cpp | zero4drift/Cpp-Primer-5th-Exercises | d3d0f0d228e8c2c5a3b3fe1fd03ce34e0894e93f | [
"MIT"
] | null | null | null | // When the vector<String> object does not have enough space and then processes memory reallocation, it would use move constructor instead of copy constructor of String type during the reallocation of original elements.
| 110 | 219 | 0.822727 | zero4drift |
e0bf45b25c31b20894960583a23ba34345dd005b | 1,021 | cpp | C++ | NativeLibraries/StarskyMain/StarskyMain/Dx/D3dStructWrappers.cpp | sssr33/Starsky | 2be4e0d9305adc2a3c4ac644b5f3d3a6f21614c6 | [
"MIT"
] | null | null | null | NativeLibraries/StarskyMain/StarskyMain/Dx/D3dStructWrappers.cpp | sssr33/Starsky | 2be4e0d9305adc2a3c4ac644b5f3d3a6f21614c6 | [
"MIT"
] | null | null | null | NativeLibraries/StarskyMain/StarskyMain/Dx/D3dStructWrappers.cpp | sssr33/Starsky | 2be4e0d9305adc2a3c4ac644b5f3d3a6f21614c6 | [
"MIT"
] | null | null | null | #include "pch.h"
#include "D3dStructWrappers.h"
WD3D11_SAMPLER_DESC::WD3D11_SAMPLER_DESC() {
this->Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
this->AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
this->AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
this->AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
this->MinLOD = -FLT_MAX;
this->MaxLOD = FLT_MAX;
this->MipLODBias = 0.0f;
this->MaxAnisotropy = 1;
this->ComparisonFunc = D3D11_COMPARISON_NEVER;
this->BorderColor[0] = this->BorderColor[1] =
this->BorderColor[2] = this->BorderColor[3] = 0.0f;
}
WD3D11_SAMPLER_DESC::WD3D11_SAMPLER_DESC(D3D11_FILTER filter) {
this->Filter = filter;
this->AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
this->AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
this->AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
this->MinLOD = -FLT_MAX;
this->MaxLOD = FLT_MAX;
this->MipLODBias = 0.0f;
this->MaxAnisotropy = 1;
this->ComparisonFunc = D3D11_COMPARISON_NEVER;
this->BorderColor[0] = this->BorderColor[1] =
this->BorderColor[2] = this->BorderColor[3] = 0.0f;
} | 34.033333 | 63 | 0.757101 | sssr33 |
e0c1075723abd5256e0d42e099fefe95ec613239 | 4,890 | cpp | C++ | src/Miner/Miner.cpp | JacopoDT/numerare-core | a98b32150a9b2e6ea7535d12b7e8e1aac0589e2f | [
"MIT-0"
] | null | null | null | src/Miner/Miner.cpp | JacopoDT/numerare-core | a98b32150a9b2e6ea7535d12b7e8e1aac0589e2f | [
"MIT-0"
] | null | null | null | src/Miner/Miner.cpp | JacopoDT/numerare-core | a98b32150a9b2e6ea7535d12b7e8e1aac0589e2f | [
"MIT-0"
] | null | null | null | /***
MIT License
Copyright (c) 2018 NUMERARE
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.
Parts of this file are originally Copyright (c) 2012-2017 The CryptoNote developers, The Bytecoin developers
***/
#include "Miner.h"
#include <functional>
#include "crypto/crypto.h"
#include "CryptoNoteCore/CachedBlock.h"
#include "CryptoNoteCore/CryptoNoteFormatUtils.h"
#include <System/InterruptedException.h>
namespace CryptoNote {
Miner::Miner(System::Dispatcher& dispatcher, Logging::ILogger& logger) :
m_dispatcher(dispatcher),
m_miningStopped(dispatcher),
m_state(MiningState::MINING_STOPPED),
m_logger(logger, "Miner") {
}
Miner::~Miner() {
assert(m_state != MiningState::MINING_IN_PROGRESS);
}
BlockTemplate Miner::mine(const BlockMiningParameters& blockMiningParameters, size_t threadCount) {
if (threadCount == 0) {
throw std::runtime_error("Miner requires at least one thread");
}
if (m_state == MiningState::MINING_IN_PROGRESS) {
throw std::runtime_error("Mining is already in progress");
}
m_state = MiningState::MINING_IN_PROGRESS;
m_miningStopped.clear();
runWorkers(blockMiningParameters, threadCount);
assert(m_state != MiningState::MINING_IN_PROGRESS);
if (m_state == MiningState::MINING_STOPPED) {
m_logger(Logging::DEBUGGING) << "Mining has been stopped";
throw System::InterruptedException();
}
assert(m_state == MiningState::BLOCK_FOUND);
return m_block;
}
void Miner::stop() {
MiningState state = MiningState::MINING_IN_PROGRESS;
if (m_state.compare_exchange_weak(state, MiningState::MINING_STOPPED)) {
m_miningStopped.wait();
m_miningStopped.clear();
}
}
void Miner::runWorkers(BlockMiningParameters blockMiningParameters, size_t threadCount) {
assert(threadCount > 0);
m_logger(Logging::INFO) << "Starting mining for difficulty " << blockMiningParameters.difficulty;
try {
blockMiningParameters.blockTemplate.nonce = Crypto::rand<uint32_t>();
for (size_t i = 0; i < threadCount; ++i) {
m_workers.emplace_back(std::unique_ptr<System::RemoteContext<void>> (
new System::RemoteContext<void>(m_dispatcher, std::bind(&Miner::workerFunc, this, blockMiningParameters.blockTemplate, blockMiningParameters.difficulty, threadCount)))
);
blockMiningParameters.blockTemplate.nonce++;
}
m_workers.clear();
} catch (std::exception& e) {
m_logger(Logging::ERROR) << "Error occurred during mining: " << e.what();
m_state = MiningState::MINING_STOPPED;
}
m_miningStopped.set();
}
void Miner::workerFunc(const BlockTemplate& blockTemplate, Difficulty difficulty, uint32_t nonceStep) {
try {
BlockTemplate block = blockTemplate;
Crypto::cn_context cryptoContext;
while (m_state == MiningState::MINING_IN_PROGRESS) {
CachedBlock cachedBlock(block);
Crypto::Hash hash = cachedBlock.getBlockLongHash(cryptoContext);
if (check_hash(hash, difficulty)) {
m_logger(Logging::INFO) << "Found block for difficulty " << difficulty;
if (!setStateBlockFound()) {
m_logger(Logging::DEBUGGING) << "block is already found or mining stopped";
return;
}
m_block = block;
return;
}
block.nonce += nonceStep;
}
} catch (std::exception& e) {
m_logger(Logging::ERROR) << "Miner got error: " << e.what();
m_state = MiningState::MINING_STOPPED;
}
}
bool Miner::setStateBlockFound() {
auto state = m_state.load();
for (;;) {
switch (state) {
case MiningState::BLOCK_FOUND:
return false;
case MiningState::MINING_IN_PROGRESS:
if (m_state.compare_exchange_weak(state, MiningState::BLOCK_FOUND)) {
return true;
}
break;
case MiningState::MINING_STOPPED:
return false;
default:
assert(false);
return false;
}
}
}
} //namespace CryptoNote
| 30.185185 | 175 | 0.714928 | JacopoDT |
e0c1e3d29163b99c6b187ec78ac6723d70324337 | 1,209 | cpp | C++ | game/server/Angelscript/ScriptAPI/ASEffects.cpp | HLSources/HLEnhanced | 7510a8f7049293b5094b9c6e14e0aa0869c8dba2 | [
"Unlicense"
] | 83 | 2016-06-10T20:49:23.000Z | 2022-02-13T18:05:11.000Z | game/server/Angelscript/ScriptAPI/ASEffects.cpp | HLSources/HLEnhanced | 7510a8f7049293b5094b9c6e14e0aa0869c8dba2 | [
"Unlicense"
] | 26 | 2016-06-16T22:27:24.000Z | 2019-04-30T19:25:51.000Z | game/server/Angelscript/ScriptAPI/ASEffects.cpp | HLSources/HLEnhanced | 7510a8f7049293b5094b9c6e14e0aa0869c8dba2 | [
"Unlicense"
] | 58 | 2016-06-10T23:52:33.000Z | 2021-12-30T02:30:50.000Z | #include <string>
#include <angelscript.h>
#include "extdll.h"
#include "util.h"
#include "ASEffects.h"
namespace Effects
{
void LightStyle( int iStyle, const std::string& szValue )
{
if( iStyle < 0 || iStyle >= MAX_LIGHTSTYLES )
{
Alert( at_warning, "Effects::LightStyle: Style index \"%d\" out of range [ 0, %d ]!\n", iStyle, MAX_LIGHTSTYLES );
return;
}
g_engfuncs.pfnLightStyle( iStyle, STRING( ALLOC_STRING( szValue.c_str() ) ) );
}
}
void RegisterScriptEffects( asIScriptEngine& engine )
{
const std::string szOldNS = engine.GetDefaultNamespace();
engine.SetDefaultNamespace( "Effects" );
engine.RegisterGlobalFunction(
"void ParticleEffect(const Vector& in vecOrigin, const Vector& in vecDirection, const uint ulColor, const uint ulCount)",
asFUNCTION( UTIL_ParticleEffect ), asCALL_CDECL );
engine.RegisterGlobalFunction(
"void LightStyle(int iStyle, const string& in szValue)",
asFUNCTION( Effects::LightStyle ), asCALL_CDECL );
engine.RegisterGlobalFunction(
"void StaticDecal(const Vector& in vecOrigin, int decalIndex, int entityIndex, int modelIndex)",
asFUNCTION( g_engfuncs.pfnStaticDecal ), asCALL_CDECL );
engine.SetDefaultNamespace( szOldNS.c_str() );
}
| 27.477273 | 123 | 0.740281 | HLSources |
e0c1e470074d1dbfe4e01316e5a9bafb47b7a0a5 | 849 | hpp | C++ | android-28/android/hardware/SensorDirectChannel.hpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 12 | 2020-03-26T02:38:56.000Z | 2022-03-14T08:17:26.000Z | android-28/android/hardware/SensorDirectChannel.hpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 1 | 2021-01-27T06:07:45.000Z | 2021-11-13T19:19:43.000Z | android-29/android/hardware/SensorDirectChannel.hpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 3 | 2021-02-02T12:34:55.000Z | 2022-03-08T07:45:57.000Z | #pragma once
#include "../../JObject.hpp"
namespace android::hardware
{
class Sensor;
}
namespace android::hardware
{
class SensorManager;
}
namespace android::hardware
{
class SensorDirectChannel : public JObject
{
public:
// Fields
static jint RATE_FAST();
static jint RATE_NORMAL();
static jint RATE_STOP();
static jint RATE_VERY_FAST();
static jint TYPE_HARDWARE_BUFFER();
static jint TYPE_MEMORY_FILE();
// QJniObject forward
template<typename ...Ts> explicit SensorDirectChannel(const char *className, const char *sig, Ts...agv) : JObject(className, sig, std::forward<Ts>(agv)...) {}
SensorDirectChannel(QJniObject obj);
// Constructors
// Methods
void close() const;
jint configure(android::hardware::Sensor arg0, jint arg1) const;
jboolean isOpen() const;
};
} // namespace android::hardware
| 21.225 | 160 | 0.713781 | YJBeetle |
e0c797bb51340f30b1f49293edab194844302b38 | 380 | cpp | C++ | cpp/abc132_b/main.cpp | kokosabu/atcoder | 8d512587d234eb45941a2f6341c4dd003e6c9ad3 | [
"Apache-2.0"
] | null | null | null | cpp/abc132_b/main.cpp | kokosabu/atcoder | 8d512587d234eb45941a2f6341c4dd003e6c9ad3 | [
"Apache-2.0"
] | null | null | null | cpp/abc132_b/main.cpp | kokosabu/atcoder | 8d512587d234eb45941a2f6341c4dd003e6c9ad3 | [
"Apache-2.0"
] | null | null | null | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int p1, p2;
cin >> p1 >> p2;
int count = 0;
for(int i = 2; i < n; i++) {
int p3;
cin >> p3;
if((p1 < p2 && p2 < p3) || (p1 > p2 && p2 > p3)) {
count += 1;
}
p1 = p2;
p2 = p3;
}
cout << count << endl;
return 0;
}
| 16.521739 | 58 | 0.376316 | kokosabu |
e0c8294c9304b522fa531d60176fab0b26031c6f | 1,381 | hpp | C++ | Code/Source/Plugins/CSPARSE/CsparsePlugin.hpp | christinazavou/Thea | f68293c4a4f5ddc3abda18e2e0b679bcf5163e93 | [
"BSD-3-Clause"
] | 77 | 2016-11-06T17:25:54.000Z | 2022-03-29T16:30:34.000Z | Code/Source/Plugins/CSPARSE/CsparsePlugin.hpp | christinazavou/Thea | f68293c4a4f5ddc3abda18e2e0b679bcf5163e93 | [
"BSD-3-Clause"
] | 1 | 2017-04-22T16:47:04.000Z | 2017-04-22T16:47:04.000Z | Code/Source/Plugins/CSPARSE/CsparsePlugin.hpp | christinazavou/Thea | f68293c4a4f5ddc3abda18e2e0b679bcf5163e93 | [
"BSD-3-Clause"
] | 20 | 2015-10-17T20:38:50.000Z | 2022-02-18T09:56:27.000Z | //============================================================================
//
// This file is part of the Thea toolkit.
//
// This software is distributed under the BSD license, as detailed in the
// accompanying LICENSE.txt file. Portions are derived from other works:
// their respective licenses and copyright information are reproduced in
// LICENSE.txt and/or in the relevant source files.
//
// Author: Siddhartha Chaudhuri
// First version: 2009
//
//============================================================================
#ifndef __Thea_Algorithms_CsparsePlugin_hpp__
#define __Thea_Algorithms_CsparsePlugin_hpp__
#include "../../IPlugin.hpp"
#include "CsparseCommon.hpp"
namespace Thea {
namespace Algorithms {
// Forward declaration
class CsparseLinearSolverFactory;
/** A CSPARSE-based plugin for solving sparse systems of linear equations. */
class THEA_CSPARSE_DLL_LOCAL CsparsePlugin : public virtual IPlugin
{
public:
/** Default constructor. */
CsparsePlugin(IFactoryRegistry * registry_);
/** Destructor. */
~CsparsePlugin();
char const * getName() const;
void install();
void startup();
void shutdown();
void uninstall();
private:
IFactoryRegistry * registry;
CsparseLinearSolverFactory * factory;
bool started;
}; // class CsparsePlugin
} // namespace Algorithms
} // namespace Thea
#endif
| 25.574074 | 78 | 0.648805 | christinazavou |
e0c9b1e27c248f7bfe4912a3ab7df8c1efaa2b5d | 1,530 | cpp | C++ | aws-cpp-sdk-xray/source/model/GetSamplingStatisticSummariesResult.cpp | lintonv/aws-sdk-cpp | 15e19c265ffce19d2046b18aa1b7307fc5377e58 | [
"Apache-2.0"
] | 1 | 2022-02-10T08:06:54.000Z | 2022-02-10T08:06:54.000Z | aws-cpp-sdk-xray/source/model/GetSamplingStatisticSummariesResult.cpp | lintonv/aws-sdk-cpp | 15e19c265ffce19d2046b18aa1b7307fc5377e58 | [
"Apache-2.0"
] | 1 | 2022-01-03T23:59:37.000Z | 2022-01-03T23:59:37.000Z | aws-cpp-sdk-xray/source/model/GetSamplingStatisticSummariesResult.cpp | ravindra-wagh/aws-sdk-cpp | 7d5ff01b3c3b872f31ca98fb4ce868cd01e97696 | [
"Apache-2.0"
] | 1 | 2021-11-09T11:58:03.000Z | 2021-11-09T11:58:03.000Z | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/xray/model/GetSamplingStatisticSummariesResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::XRay::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
GetSamplingStatisticSummariesResult::GetSamplingStatisticSummariesResult()
{
}
GetSamplingStatisticSummariesResult::GetSamplingStatisticSummariesResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
GetSamplingStatisticSummariesResult& GetSamplingStatisticSummariesResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("SamplingStatisticSummaries"))
{
Array<JsonView> samplingStatisticSummariesJsonList = jsonValue.GetArray("SamplingStatisticSummaries");
for(unsigned samplingStatisticSummariesIndex = 0; samplingStatisticSummariesIndex < samplingStatisticSummariesJsonList.GetLength(); ++samplingStatisticSummariesIndex)
{
m_samplingStatisticSummaries.push_back(samplingStatisticSummariesJsonList[samplingStatisticSummariesIndex].AsObject());
}
}
if(jsonValue.ValueExists("NextToken"))
{
m_nextToken = jsonValue.GetString("NextToken");
}
return *this;
}
| 30.6 | 170 | 0.794118 | lintonv |
e0cd12763cf8f3fbd9a949e310b8e3fc3d9f61d8 | 1,490 | hpp | C++ | willow/include/popart/op/sgd2combo.hpp | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 61 | 2020-07-06T17:11:46.000Z | 2022-03-12T14:42:51.000Z | willow/include/popart/op/sgd2combo.hpp | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 1 | 2021-02-25T01:30:29.000Z | 2021-11-09T11:13:14.000Z | willow/include/popart/op/sgd2combo.hpp | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 6 | 2020-07-15T12:33:13.000Z | 2021-11-07T06:55:00.000Z | // Copyright (c) 2021 Graphcore Ltd. All rights reserved.
#ifndef GUARD_NEURALNET_SGD2VARUPDATECOMBOOP_HPP
#define GUARD_NEURALNET_SGD2VARUPDATECOMBOOP_HPP
#include <popart/op/sgdcombobase.hpp>
#include <popart/optimizervaluemap.hpp>
namespace popart {
enum class OptimizerReductionType;
/**
* \brief A single Op that encapsulates all the information needed to describe
* an SGD2 optimiser step.
*
* The "2" in the name signifies that two extra optimiser tensors (the accum
* and accl1 tensors) may be required. \sa SGD for the definition of what SGD2
* is.
*
* The "Combo" in the name signifies that this Op will later be decomposed into
* many Ops and Tensors that actually implement the optimiser step. In this
* case, by the SGD2Decompose pattern. \sa SGD2Decompose for the definition of
* this decomposition.
*/
class SGD2ComboOp final : public SGDMComboBaseOp {
public:
SGD2ComboOp(OptimizerValue initialSmm1,
OptimizerValue initialDpsf1,
OptimizerValue initialSwd1,
OptimizerValue initialSlr1,
bool withGradAccum_,
OptimizerReductionType reductionType_,
DataType accumType_,
DataType accl1Type_,
const Op::Settings &);
// Gradient accumulation
const bool withGradAccum;
// Data type of accumulator and momentum
const DataType accumType;
const DataType accl1Type;
std::unique_ptr<Op> clone() const final;
};
} // namespace popart
#endif
| 29.8 | 79 | 0.72349 | gglin001 |
e0d09ba2c574650cab87a524d00e7caadd09c1be | 11,926 | cpp | C++ | gef_abertay/graphics/scene.cpp | LadyVolk/FinalGameCMP208 | abb5cc3fa48b5fb1238ac092960a4f5ef99aa770 | [
"MIT"
] | null | null | null | gef_abertay/graphics/scene.cpp | LadyVolk/FinalGameCMP208 | abb5cc3fa48b5fb1238ac092960a4f5ef99aa770 | [
"MIT"
] | null | null | null | gef_abertay/graphics/scene.cpp | LadyVolk/FinalGameCMP208 | abb5cc3fa48b5fb1238ac092960a4f5ef99aa770 | [
"MIT"
] | null | null | null | #include <graphics/scene.h>
#include <graphics/mesh.h>
#include <graphics/mesh_data.h>
#include <graphics/texture.h>
#include <animation/skeleton.h>
#include <animation/animation.h>
#include <system/platform.h>
#include <graphics/image_data.h>
#include <assets/png_loader.h>
#include <graphics/material.h>
#include <system/file.h>
#include <system/memory_stream_buffer.h>
#include <fstream>
#include <assert.h>
#include "system/debug_log.h"
namespace gef
{
Scene::~Scene()
{
// free up skeletons
for(std::list<Skeleton*>::iterator skeleton_iter = skeletons.begin(); skeleton_iter != skeletons.end(); ++skeleton_iter)
delete *skeleton_iter;
// free up mesh_data
// for(std::list<MeshData>::iterator mesh_iter = mesh_data.begin(); mesh_iter != mesh_data.end(); ++mesh_iter)
// delete *mesh_iter;
// free up textures
for(std::list<Texture*>::iterator texture_iter = textures.begin(); texture_iter != textures.end(); ++texture_iter)
delete *texture_iter;
// free up materials
for(std::list<Material*>::iterator material_iter = materials.begin(); material_iter != materials.end(); ++material_iter)
delete *material_iter;
// free up meshes
for (std::list<Mesh*>::iterator mesh_iter = meshes.begin(); mesh_iter != meshes.end(); ++mesh_iter)
delete *mesh_iter;
// free up animations
for(std::map<gef::StringId, Animation*>::iterator animation_iter = animations.begin(); animation_iter != animations.end(); ++animation_iter)
delete animation_iter->second;
}
Mesh* Scene::CreateMesh(Platform& platform, const MeshData& mesh_data, const bool read_only)
{
Mesh* mesh = new Mesh(platform);
mesh->set_aabb(mesh_data.aabb);
mesh->set_bounding_sphere(gef::Sphere(mesh->aabb()));
mesh->InitVertexBuffer(platform, mesh_data.vertex_data.vertices, mesh_data.vertex_data.num_vertices, mesh_data.vertex_data.vertex_byte_size, read_only);
mesh->AllocatePrimitives((Int32)mesh_data.primitives.size());
Int32 prim_index=0;
for(std::vector<PrimitiveData*>::const_iterator prim_iter=mesh_data.primitives.begin();prim_iter != mesh_data.primitives.end();++prim_iter, ++prim_index)
{
Primitive* primitive = mesh->GetPrimitive(prim_index);
primitive->set_type((*prim_iter)->type);
primitive->InitIndexBuffer(platform, (*prim_iter)->indices, (*prim_iter)->num_indices, (*prim_iter)->index_byte_size, read_only);
if ((*prim_iter)->material_name_id != 0)
{
primitive->set_material(materials_map[(*prim_iter)->material_name_id]);
}
//if((*prim_iter)->material)
//{
// if((*prim_iter)->material->diffuse_texture != "")
// {
// gef::StringId texture_name_id = gef::GetStringId((*prim_iter)->material->diffuse_texture);
// Texture* texture = textures_map[texture_name_id];
// if(texture)
// primitive->set_material(materials_map[(*prim_iter)->material->name_id]);
// }
//}
}
return mesh;
}
void Scene::CreateMeshes(Platform& platform, const bool read_only)
{
for (std::list<MeshData>::const_iterator meshIter = mesh_data.begin(); meshIter != mesh_data.end(); ++meshIter)
{
meshes.push_back(CreateMesh(platform, *meshIter, read_only));
}
}
void Scene::CreateMaterials(const Platform& platform)
{
// go through all the materials and create new textures for them
// for(std::map<std::string, std::string>::iterator materialIter = materials_.begin();materialIter!=materials_.end();++materialIter)
for(std::list<MaterialData>::iterator materialIter = material_data.begin();materialIter!=material_data.end();++materialIter)
{
Material* material = new Material();
materials.push_back(material);
materials_map[materialIter->name_id] = material;
// colour
material->set_colour(materialIter->colour);
// texture
if(materialIter->diffuse_texture != "")
{
gef::StringId texture_name_id = gef::GetStringId(materialIter->diffuse_texture);
std::map<gef::StringId, Texture*>::iterator find_result = textures_map.find(texture_name_id);
if(find_result == textures_map.end())
{
string_id_table.Add(materialIter->diffuse_texture);
ImageData image_data;
PNGLoader png_loader;
png_loader.Load(materialIter->diffuse_texture.c_str(), platform, image_data);
if(image_data.image() != NULL)
{
Texture* texture = Texture::Create(platform, image_data);
textures.push_back(texture);
textures_map[texture_name_id] = texture;
material->set_texture(texture);
}
}
else
{
material->set_texture(find_result->second);
}
}
}
}
bool Scene::WriteSceneToFile(const Platform& platform, const char* filename) const
{
bool success = true;
std::ofstream file_stream(filename, std::ios::out | std::ios::binary);
if(file_stream.is_open())
{
success = WriteScene(file_stream);
}
else
{
success = false;
}
file_stream.close();
return success;
}
bool Scene::ReadSceneFromFile(const Platform& platform, const char* filename)
{
bool success = true;
void* file_data = NULL;
File* file = gef::File::Create();
Int32 file_size;
success = file->Open(filename);
if(success)
{
success = file->GetSize(file_size);
if(success)
{
file_data = malloc(file_size);
success = file_data != NULL;
if(success)
{
Int32 bytes_read;
success = file->Read(file_data, file_size, bytes_read);
if(success)
success = bytes_read == file_size;
}
if(success)
{
gef::MemoryStreamBuffer stream_buffer((char*)file_data, file_size);
std::istream input_stream(&stream_buffer);
success = ReadScene(input_stream);
// don't need the font file data any more
free(file_data);
file_data = NULL;
}
}
file->Close();
}
return success;
}
bool Scene::ReadScene(std::istream& stream)
{
bool success = true;
Int32 mesh_count;
Int32 material_count;
Int32 skeleton_count;
Int32 animation_count;
Int32 string_count;
stream.read((char*)&mesh_count, sizeof(Int32));
stream.read((char*)&material_count, sizeof(Int32));
stream.read((char*)&skeleton_count, sizeof(Int32));
stream.read((char*)&animation_count, sizeof(Int32));
stream.read((char*)&string_count, sizeof(Int32));
// string table
for(Int32 string_num=0;string_num<string_count;++string_num)
{
std::string the_string = "";
char string_character;
do
{
stream.read(&string_character, 1);
if(string_character != 0)
the_string.push_back(string_character);
}
while(string_character != 0);
string_id_table.Add(the_string);
}
// materials
for(Int32 material_num=0;material_num<material_count;++material_num)
{
material_data.push_back(MaterialData());
MaterialData& material = material_data.back();
material.Read(stream);
material_data_map[material.name_id] = &material;
}
// mesh_data
for(Int32 mesh_num=0;mesh_num<mesh_count;++mesh_num)
{
mesh_data.push_back(MeshData());
MeshData& mesh = mesh_data.back();
mesh.Read(stream);
// go through all primitives and try and find material to use
//for(std::vector<PrimitiveData*>::iterator prim_iter =mesh.primitives.begin(); prim_iter != mesh.primitives.end(); ++prim_iter)
//{
// gef::StringId material_name_id = (gef::StringId)((*prim_iter)->material->name_id);
// std::map<gef::StringId, MaterialData*>::const_iterator material_iter = material_data_map.find(material_name_id);
// if(material_iter != material_data_map.end())
// (*prim_iter)->material = material_iter->second;
//}
}
// skeletons
for(Int32 skeleton_num=0;skeleton_num<skeleton_count;++skeleton_num)
{
Skeleton* skeleton = new Skeleton();
skeleton->Read(stream);
skeletons.push_back(skeleton);
}
// animations
for(Int32 animation_num=0;animation_num<animation_count;++animation_num)
{
Animation* animation = new Animation();
animation->Read(stream);
animations[animation->name_id()] = animation;
}
return success;
}
bool Scene::WriteScene(std::ostream& stream) const
{
bool success = true;
Int32 mesh_count = (Int32)mesh_data.size();
Int32 material_count = (Int32)material_data.size();
Int32 skeleton_count = (Int32)skeletons.size();
Int32 animation_count = (Int32)animations.size();
Int32 string_count = (Int32)string_id_table.table().size();
stream.write((char*)&mesh_count, sizeof(Int32));
stream.write((char*)&material_count, sizeof(Int32));
stream.write((char*)&skeleton_count, sizeof(Int32));
stream.write((char*)&animation_count, sizeof(Int32));
stream.write((char*)&string_count, sizeof(Int32));
// string table
for(std::map<gef::StringId, std::string>::const_iterator string_iter = string_id_table.table().begin(); string_iter != string_id_table.table().end(); ++string_iter)
{
//Int32 string_length = string_iter->second.length();
stream.write(string_iter->second.c_str(), string_iter->second.length()+1);
}
// materials
for(std::list<MaterialData>::const_iterator material_iter = material_data.begin(); material_iter != material_data.end(); ++material_iter)
material_iter->Write(stream);
// mesh_data
for(std::list<MeshData>::const_iterator mesh_iter = mesh_data.begin(); mesh_iter != mesh_data.end(); ++mesh_iter)
mesh_iter->Write(stream);
// skeletons
for(std::list<Skeleton*>::const_iterator skeleton_iter = skeletons.begin();skeleton_iter != skeletons.end(); ++skeleton_iter)
(*skeleton_iter)->Write(stream);
// animations
for(std::map<gef::StringId, Animation*>::const_iterator animation_iter = animations.begin(); animation_iter != animations.end(); ++animation_iter)
animation_iter->second->Write(stream);
return success;
}
Skeleton* Scene::FindSkeleton(const MeshData& mesh_data)
{
Skeleton* result = NULL;
if((mesh_data.vertex_data.num_vertices > 0) && (mesh_data.vertex_data.vertex_byte_size == sizeof(Mesh::SkinnedVertex)))
{
// get the first vertex
Mesh::SkinnedVertex* skinned_vertex = (Mesh::SkinnedVertex*)mesh_data.vertex_data.vertices;
// get string id of cluster link from first influence
StringId joint_name_id = skin_cluster_name_ids[skinned_vertex->bone_indices[0]];
// go through all skeletons looking a skeleton that contains the joint name
for(std::list<Skeleton*>::iterator skeleton_iter = skeletons.begin(); skeleton_iter != skeletons.end(); ++skeleton_iter)
{
if((*skeleton_iter)->FindJoint(joint_name_id))
{
result = *skeleton_iter;
break;
}
}
}
return result;
}
void Scene::FixUpSkinWeights()
{
for(std::list<MeshData>::iterator mesh_iter = mesh_data.begin(); mesh_iter != mesh_data.end(); ++mesh_iter)
{
if((mesh_iter->vertex_data.num_vertices > 0) && (mesh_iter->vertex_data.vertex_byte_size == sizeof(Mesh::SkinnedVertex)))
{
Skeleton* skeleton = FindSkeleton(*mesh_iter);
if(skeleton)
{
Mesh::SkinnedVertex* skinned_vertices = (Mesh::SkinnedVertex*)mesh_iter->vertex_data.vertices;
// go through all vertices and change cluster indices to joint indices
for(Int32 vertex_num=0;vertex_num<mesh_iter->vertex_data.num_vertices;++vertex_num)
{
Mesh::SkinnedVertex* skinned_vertex = skinned_vertices+vertex_num;
// calculate weight total to normalise weights
float weight_total = skinned_vertex->bone_weights[0]+skinned_vertex->bone_weights[1]+skinned_vertex->bone_weights[2]+skinned_vertex->bone_weights[3];
for(Int32 influence_index=0;influence_index < 4;++influence_index)
{
// normalise weight
skinned_vertex->bone_weights[influence_index] /= weight_total;
// fix up joint index
Int32 joint_index = skeleton->FindJointIndex(skin_cluster_name_ids[skinned_vertex->bone_indices[influence_index]]);
if(joint_index >= 0)
{
skinned_vertex->bone_indices[influence_index] = joint_index;
}
assert(joint_index >= 0);
}
}
}
}
}
}
}
| 30.501279 | 166 | 0.702415 | LadyVolk |
e0d149acb76247d6dea93c2f9ddbdc8bdb39792d | 14,945 | cpp | C++ | chapter07/ch07_calculator.cpp | ClassAteam/stroustrup-ppp | ea9e85d4ea9890038eb5611c3bc82734c8706ce7 | [
"MIT"
] | 124 | 2018-06-23T10:16:56.000Z | 2022-03-19T15:16:12.000Z | chapter07/ch07_calculator.cpp | therootfolder/stroustrup-ppp | b1e936c9a67b9205fdc9712c42496b45200514e2 | [
"MIT"
] | 23 | 2018-02-08T20:57:46.000Z | 2021-10-08T13:58:29.000Z | chapter07/ch07_calculator.cpp | ClassAteam/stroustrup-ppp | ea9e85d4ea9890038eb5611c3bc82734c8706ce7 | [
"MIT"
] | 65 | 2019-05-27T03:05:56.000Z | 2022-03-26T03:43:05.000Z | //
// Stroustrup - Programming Principles & Practice
//
// Chapter 7 - Simple Calculator
//
// Drill - adds sqrt and pow funcitonality
// Ex 2 - allows underscores in variable names
// Ex 3 - provides constant variabls
// Ex 4 - moves Variable related functions to Symbol_table class
// Ex 5 - Token_stream reads \n as print
// Ex 6 - help page added (?)
// Ex 7 - help and quit commands expanded to strings
// Ex 8 - Grammar updated
// Ex 9 - Added sin and cos
//
/*
The grammar for input is:
Calculation:
Statement
Print
Help
Quit
Calculation Statement
Statemant:
Declaration
Expression
Print:
;
Quit:
q
Declaration:
"let" Name "=" Expression
Expression:
Term
Expression + Term
Expression - Term
Term:
Secondary
Term * Secondary
Term / Secondary
Term % Secondary
Secondary:
Primary "!"
"Sqrt (" Expression ")"
"Pow (" Expression "," Expression ")"
Primary:
Number
( Expression )
{ Expression }
- Primary
+ Primary
Variable
"sqrt"( Expression )
"pow(" Expression "," narrow_cast<int>(Expression) ")"
"sin"( Expression )
"cos"( Expression )
Number:
floating-point-literal
Input comes from cin through the Token_stream called ts.
*/
#include "../text_lib/std_lib_facilities.h"
// §7.6.1 Symbolic constants
const char number = '8';
const char quit = 'q';
const char print = ';';
const char name = 'a';
const char let = 'L'; // declaration token
const char help = '?';
const char c_sin = 's';
const char c_cos = 'c';
const string prompt = "> ";
const string result = "= ";
const string declkey = "let"; //declaration keywork
// drill
const char square_root = '@';
const char exponent = '^';
const string sqrtkey = "sqrt";
const string expkey = "pow";
const string sinkey = "sin";
const string coskey = "cos";
const string quitkey = "quit";
const string helpkey = "help";
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
class Token {
public:
char kind;
double value;
string name;
Token(char k) : kind{k}, value{0} { }
Token(char k, double v) : kind{k}, value{v} { }
Token(char k, string n) : kind{k}, value{0}, name{n} { }
};
class Token_stream {
public:
Token get(); // get a Token
void putback(Token t); // put a token back
void ignore(char c); // discard characters up to and including a c
private:
bool full { false }; // is there a Token in the buffer?
Token buffer {'0'}; // here is where putback() stores a Token
};
void Token_stream::ignore(char c)
// c represents the kind of Token
{
// first look in buffer
if (full && c == buffer.kind) {
full = false;
return;
}
full = false;
// now search for input
char ch = 0;
while (cin >> ch)
if (ch == c) return;
}
void Token_stream::putback(Token t)
{
buffer = t; // copy t to buffer
full = true; // buffer is now full
};
Token Token_stream::get()
{
if (full) { // do we already have a Token?
full = false; // remove Token from buffer
return buffer;
}
char ch;
cin.get(ch); // look for any char including whitespace
while (isspace(ch) && ch != '\n') cin.get(ch);
switch (ch) {
case '\n':
return Token{print};
case print:
case quit:
case help:
case '(':
case ')':
case '{':
case '}':
case '!':
case '+':
case '-':
case '*':
case '/':
case '%':
case '=':
case ',':
return Token { ch }; // let each character represent itself
case '.':
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
{
cin.putback(ch); // put digit back into input stream
double val;
cin >> val; // read floating-point number
return Token { number, val };
}
default:
if (isalpha(ch)) {
string s;
s += ch;
while (cin.get(ch) &&
((isalpha(ch) || isdigit(ch) || ch == '_')))
s += ch;
cin.putback(ch);
if (s == declkey) return Token{let}; // declaration keyword
else if (s == sqrtkey) return Token{square_root};
else if (s == expkey) return Token{exponent};
else if (s == sinkey) return Token{c_sin};
else if (s == coskey) return Token{c_cos};
else if (s == quitkey) return Token{quit};
else if (s == helpkey) return Token{help};
else return Token{name, s};
}
error("Bad token");
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
class Variable {
public:
string name;
double value;
bool constant;
Variable(string n, double v, bool c = false)
: name{n}, value{v}, constant{c} { }
};
class Symbol_table {
vector<Variable> var_table;
public:
bool is_declared(string);
double get_value(string);
double set_value(string, double);
double define_name(string, double, bool con = false);
};
bool Symbol_table::is_declared(string var)
// is var already in var_table?
{
for (const Variable& v : var_table)
if (v.name == var) return true;
return false;
}
double Symbol_table::get_value(string s)
// return the value of the Variable named s
{
for (const Variable& v : var_table)
if (v.name == s) return v.value;
error("get: undefined variable ", s);
}
double Symbol_table::set_value(string s, double d)
// set the Variable named s to d
{
for (Variable& v : var_table)
if (v.name == s) {
if (v.constant) error("Can't overwrite constant variable");
v.value = d;
return d;
}
error("set: undefined variable ", s);
}
double Symbol_table::define_name(string var, double val, bool con)
// add {var,val,con} to var_table
{
if (is_declared(var)) error(var, " declared twice");
var_table.push_back(Variable{var,val,con});
return val;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// globals(?)
Symbol_table st; // allows Variable storage and retrieval
Token_stream ts; // provides get() and putback()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// additional calculator functions
double expression(); // forward declaration for primary to call
double calc_sqrt()
{
char ch;
if (cin.get(ch) && ch != '(') error("'(' expected");
cin.putback(ch);
double d = expression();
if (d < 0) error("sqrt: negative val is imaginary");
return sqrt(d);
}
double calc_pow()
{
Token t = ts.get();
if (t.kind != '(') error("'(' expected");
double base = expression();
t = ts.get();
if (t.kind != ',') error("',' expected");
int power = narrow_cast<int>(expression());
t = ts.get();
if (t.kind != ')') error("')' expected");
return pow(base, power);
}
double calc_sin()
{
char ch;
if (cin.get(ch) && ch != '(') error("'(' expected");
cin.putback(ch);
double d = expression();
if (d == 0 || d == 180) return 0; // return true zero
return sin(d*3.1415926535/180);
}
double calc_cos()
{
char ch;
if (cin.get(ch) && ch != '(') error("'(' expected");
cin.putback(ch);
double d = expression();
if (d == 90 || d == 270) return 0; // return 0 instead of 8.766e-11
return cos(d*3.1415926535/180);
}
double handle_variable(Token& t)
{
Token t2 = ts.get();
if (t2.kind == '=')
return st.set_value(t.name, expression());
else {
ts.putback(t2);
return st.get_value(t.name); // missing in text!
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// input grammar functions
double primary() // deal with numbers and parenthesis
// ex 2 - added '{' case
{
Token t = ts.get();
switch (t.kind) {
case '(': // handle '(' expression ')'
{
double d = expression();
t = ts.get();
if (t.kind != ')') error("')' expected");
return d;
}
case '{':
{
double d = expression();
t = ts.get();
if (t.kind != '}') error("'}' expected");
return d;
}
case number:
return t.value; // return the number's value
case name:
return handle_variable(t);
case '-':
return -primary();
case '+':
return primary();
case square_root:
return calc_sqrt();
case exponent:
return calc_pow();
case c_sin:
return calc_sin();
case c_cos:
return calc_cos();
default:
error("primary expected");
}
}
double secondary()
// ex 3 - Add a factorial operator '!'
{
double left = primary();
Token t = ts.get();
while (true) {
switch (t.kind) {
case '!':
if (left == 0) return 1;
for (int i = left - 1; i > 0; --i) left *= i;
t = ts.get();
break;
default:
ts.putback(t);
return left;
}
}
}
double term() // deal with * and /
{
double left = secondary();
Token t = ts.get(); // get next token from Token_stream
while (true) {
switch (t.kind) {
case '*':
left *= secondary();
t = ts.get();
break;
case '/':
{
double d = secondary();
if (d == 0) error("divide by zero");
left /= d;
t = ts.get();
break;
}
case '%':
{
double d = secondary();
if (d == 0) error("%: divide by zero");
left = fmod(left, d);
t = ts.get();
break;
}
default:
ts.putback(t); // put t back into the Token_stream
return left;
}
}
}
double expression() // deal with + and -
{
double left = term(); // read and evaluate a term
Token t = ts.get(); // get next token from Token_stream
while (true) {
switch (t.kind) {
case '+':
left += term(); // evaluate term and add
t = ts.get();
break;
case '-':
left -= term(); // evaluate term and subtract
t = ts.get();
break;
default:
ts.putback(t); // put t back into the token stream
return left;
}
}
}
double declaration()
// assume we have seen "let"
// handle: name = expression
// declare a variable called "name" with the initial value "expression"
{
Token t = ts.get();
if (t.kind != name) error("name expected in declaration");
string var_name = t.name;
Token t2 = ts.get();
if (t2.kind != '=') error("= missing in declaration of ", var_name);
double d = expression();
st.define_name(var_name, d);
return d;
}
double statement()
{
Token t = ts.get();
switch (t.kind) {
case let:
return declaration();
default:
ts.putback(t);
return expression();
}
}
void print_help()
{
cout << "Simple Calculator Manual\n"
<< "========================\n"
<< "This calculator program supports +, -, *, and / operations\n"
<< "Enter any form of compound statement followed by ';' for result\n"
<< "- ex: 4 + 1; (5-2)/{6*(8+14)}\n"
<< "The modulo operator % may be used on all numbers\n"
<< "An '!' placed after a value will calculate the factorial of it\n"
<< "- ex: 4! = 4 * 3 * 2 * 1\n"
<< "Square root and exponentiation are provided by 'sqrt' and 'pow'\n"
<< "- ex: sqrt(25) = 5, pow(5,2) = 25\n"
<< "Variable assignment is provided using the 'let' keyword:\n"
<< "- ex: let x = 37; x * 2 = 74; x = 4; x * 2 = 8\n\n";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// expression evaluation loop
// §7.7 recovering from errors
void clean_up_mess()
{
ts.ignore(print);
}
// §7.6.2 separate main's extra action
void calculate()
{
while (cin)
try {
cout << prompt;
Token t = ts.get();
while (t.kind == print) t = ts.get(); // discard extra 'prints'
if (t.kind == help) print_help();
else if (t.kind == quit) return;
else {
ts.putback(t);
cout << result << statement() << '\n';
}
}
catch (exception& e) {
cerr << e.what() << '\n'; // write error message to user
clean_up_mess();
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
int main()
try {
st.define_name("pi", 3.1415926535, true); // hardcoded constants
st.define_name("e", 2.7182818284, true);
cout << "Simple Calculator (type ? for help)\n";
calculate();
return 0;
}
catch(exception& e) {
cerr << "Exception: " << e.what() << '\n';
return 1;
}
catch(...) {
cerr << "Unknown exception\n";
return 2;
}
/*
Feb 18, 2018
Returning to this after months of moving on I can see where I got lost. I
had followed the text all along but when I neared the end of Chapter 7 I
could not figure out why my code wouldn't work as the text suggests.
In §7.8.2 we alter the Token_stream to accept names, specifically in the
default clause of our switch statement. Then we add constructors to Token
to allow for the creation of variable names. What we don't cover in the
text is modifying primary() to work with variable names.
This was the cause of a major table_flipping moment for me and I hope that
if someone reads this they can save themselves the frustration.
*/
| 26.831239 | 79 | 0.486852 | ClassAteam |
e0d17b5e856c41f3c85eed9cbc1cf0389de98077 | 9,040 | hpp | C++ | src/core/callers/cancer_caller.hpp | alimanfoo/octopus | f3cc3f567f02fafe33f5a06e5be693d6ea985ee3 | [
"MIT"
] | 1 | 2018-08-21T23:34:28.000Z | 2018-08-21T23:34:28.000Z | src/core/callers/cancer_caller.hpp | alimanfoo/octopus | f3cc3f567f02fafe33f5a06e5be693d6ea985ee3 | [
"MIT"
] | null | null | null | src/core/callers/cancer_caller.hpp | alimanfoo/octopus | f3cc3f567f02fafe33f5a06e5be693d6ea985ee3 | [
"MIT"
] | null | null | null | // Copyright (c) 2015-2018 Daniel Cooke
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#ifndef cancer_caller_hpp
#define cancer_caller_hpp
#include <vector>
#include <unordered_map>
#include <memory>
#include <functional>
#include <typeindex>
#include <boost/optional.hpp>
#include "config/common.hpp"
#include "core/types/haplotype.hpp"
#include "core/types/cancer_genotype.hpp"
#include "core/models/genotype/cancer_genotype_prior_model.hpp"
#include "core/models/genotype/genotype_prior_model.hpp"
#include "core/models/mutation/coalescent_model.hpp"
#include "core/models/mutation/somatic_mutation_model.hpp"
#include "core/models/genotype/individual_model.hpp"
#include "core/models/genotype/cnv_model.hpp"
#include "core/models/genotype/tumour_model.hpp"
#include "basics/phred.hpp"
#include "caller.hpp"
namespace octopus {
class GenomicRegion;
class ReadPipe;
class Variant;
class VariantCall;
class CancerCaller : public Caller
{
public:
using Caller::CallTypeSet;
struct Parameters
{
enum class NormalContaminationRisk { high, low };
Phred<double> min_variant_posterior, min_somatic_posterior, min_refcall_posterior;
unsigned ploidy;
boost::optional<SampleName> normal_sample;
boost::optional<CoalescentModel::Parameters> germline_prior_model_params;
SomaticMutationModel::Parameters somatic_mutation_model_params;
double min_expected_somatic_frequency, credible_mass, min_credible_somatic_frequency;
std::size_t max_genotypes = 20000;
NormalContaminationRisk normal_contamination_risk = NormalContaminationRisk::low;
double cnv_normal_alpha = 50.0, cnv_tumour_alpha = 0.5;
double somatic_normal_germline_alpha = 50.0, somatic_normal_somatic_alpha = 0.05;
double somatic_tumour_germline_alpha = 1.5, somatic_tumour_somatic_alpha = 1.0;
};
CancerCaller() = delete;
CancerCaller(Caller::Components&& components,
Caller::Parameters general_parameters,
Parameters specific_parameters);
CancerCaller(const CancerCaller&) = delete;
CancerCaller& operator=(const CancerCaller&) = delete;
CancerCaller(CancerCaller&&) = delete;
CancerCaller& operator=(CancerCaller&&) = delete;
~CancerCaller() = default;
private:
using GermlineModel = model::IndividualModel;
using CNVModel = model::CNVModel;
using TumourModel = model::TumourModel;
class Latents;
friend Latents;
struct ModelProbabilities
{
double germline, cnv, somatic;
};
using ModelPriors = ModelProbabilities;
using ModelPosteriors = ModelProbabilities;
Parameters parameters_;
// overrides
std::string do_name() const override;
CallTypeSet do_call_types() const override;
std::unique_ptr<Caller::Latents>
infer_latents(const std::vector<Haplotype>& haplotypes,
const HaplotypeLikelihoodCache& haplotype_likelihoods) const override;
boost::optional<double>
calculate_model_posterior(const std::vector<Haplotype>& haplotypes,
const HaplotypeLikelihoodCache& haplotype_likelihoods,
const Caller::Latents& latents) const override;
boost::optional<double>
calculate_model_posterior(const std::vector<Haplotype>& haplotypes,
const HaplotypeLikelihoodCache& haplotype_likelihoods,
const Latents& latents) const;
std::vector<std::unique_ptr<VariantCall>>
call_variants(const std::vector<Variant>& candidates, const Caller::Latents& latents) const override;
std::vector<std::unique_ptr<VariantCall>>
call_variants(const std::vector<Variant>& candidates, const Latents& latents) const;
std::vector<std::unique_ptr<ReferenceCall>>
call_reference(const std::vector<Allele>& alleles, const Caller::Latents& latents,
const ReadMap& reads) const override;
bool has_normal_sample() const noexcept;
const SampleName& normal_sample() const;
using GenotypeVector = std::vector<Genotype<Haplotype>>;
using CancerGenotypeVector = std::vector<CancerGenotype<Haplotype>>;
using GermlineGenotypeReference = Genotype<Haplotype>;
using GermlineGenotypeProbabilityMap = std::unordered_map<GermlineGenotypeReference, double>;
using ProbabilityVector = std::vector<double>;
void generate_germline_genotypes(Latents& latents, const std::vector<Haplotype>& haplotypes) const;
void generate_cancer_genotypes(Latents& latents, const HaplotypeLikelihoodCache& haplotype_likelihoods) const;
void generate_cancer_genotypes_with_clean_normal(Latents& latents, const HaplotypeLikelihoodCache& haplotype_likelihoods) const;
void generate_cancer_genotypes_with_contaminated_normal(Latents& latents, const HaplotypeLikelihoodCache& haplotype_likelihoods) const;
void generate_cancer_genotypes_with_no_normal(Latents& latents, const HaplotypeLikelihoodCache& haplotype_likelihoods) const;
void generate_cancer_genotypes(Latents& latents, const std::vector<Genotype<Haplotype>>& germline_genotypes) const;
bool has_high_normal_contamination_risk(const Latents& latents) const;
void evaluate_germline_model(Latents& latents, const HaplotypeLikelihoodCache& haplotype_likelihoods) const;
void evaluate_cnv_model(Latents& latents, const HaplotypeLikelihoodCache& haplotype_likelihoods) const;
void evaluate_tumour_model(Latents& latents, const HaplotypeLikelihoodCache& haplotype_likelihoods) const;
void evaluate_noise_model(Latents& latents, const HaplotypeLikelihoodCache& haplotype_likelihoods) const;
void set_model_priors(Latents& latents) const;
void set_model_posteriors(Latents& latents) const;
std::unique_ptr<GenotypePriorModel> make_germline_prior_model(const std::vector<Haplotype>& haplotypes) const;
CNVModel::Priors get_cnv_model_priors(const GenotypePriorModel& prior_model) const;
TumourModel::Priors get_somatic_model_priors(const CancerGenotypePriorModel& prior_model) const;
TumourModel::Priors get_noise_model_priors(const CancerGenotypePriorModel& prior_model) const;
CNVModel::Priors get_normal_noise_model_priors(const GenotypePriorModel& prior_model) const;
GermlineGenotypeProbabilityMap
calculate_germline_genotype_posteriors(const Latents& latents, const ModelPosteriors& model_posteriors) const;
ProbabilityVector calculate_probability_samples_not_somatic(const Latents& inferences) const;
Phred<double> calculate_somatic_probability(const ProbabilityVector& sample_somatic_posteriors,
const ModelPosteriors& model_posteriors) const;
};
class CancerCaller::Latents : public Caller::Latents
{
public:
using Caller::Latents::HaplotypeProbabilityMap;
using Caller::Latents::GenotypeProbabilityMap;
Latents() = delete;
Latents(const std::vector<Haplotype>& haplotypes,
const std::vector<SampleName>& samples);
std::shared_ptr<HaplotypeProbabilityMap> haplotype_posteriors() const override;
std::shared_ptr<GenotypeProbabilityMap> genotype_posteriors() const override;
private:
std::reference_wrapper<const std::vector<Haplotype>> haplotypes_;
std::vector<Genotype<Haplotype>> germline_genotypes_;
std::vector<CancerGenotype<Haplotype>> cancer_genotypes_;
boost::optional<std::vector<std::vector<unsigned>>> germline_genotype_indices_ = boost::none;
boost::optional<std::vector<std::pair<std::vector<unsigned>, unsigned>>> cancer_genotype_indices_ = boost::none;
std::reference_wrapper<const std::vector<SampleName>> samples_;
boost::optional<std::reference_wrapper<const SampleName>> normal_sample_ = boost::none;
CancerCaller::ModelPriors model_priors_;
std::unique_ptr<GenotypePriorModel> germline_prior_model_ = nullptr;
boost::optional<CancerGenotypePriorModel> cancer_genotype_prior_model_ = boost::none;
std::unique_ptr<GermlineModel> germline_model_ = nullptr;
GermlineModel::InferredLatents germline_model_inferences_;
CNVModel::InferredLatents cnv_model_inferences_;
TumourModel::InferredLatents tumour_model_inferences_;
boost::optional<TumourModel::InferredLatents> noise_model_inferences_ = boost::none;
boost::optional<GermlineModel::InferredLatents> normal_germline_inferences_ = boost::none;
CancerCaller::ModelPosteriors model_posteriors_;
mutable std::shared_ptr<HaplotypeProbabilityMap> haplotype_posteriors_ = nullptr;
mutable std::shared_ptr<GenotypeProbabilityMap> genotype_posteriors_ = nullptr;
friend CancerCaller;
void compute_genotype_posteriors() const;
void compute_haplotype_posteriors() const;
};
} // namespace octopus
#endif
| 45.2 | 139 | 0.746792 | alimanfoo |
e0d322d26991dcf615faf886372c7c5d821278a4 | 536 | cpp | C++ | flite/src/synthcommon/utt_utils.cpp | Barath-Kannan/flite | 236f91a9a1e60fd25f1deed6d48022567cd7100f | [
"Apache-2.0"
] | 7 | 2017-12-10T23:02:22.000Z | 2021-08-05T21:12:11.000Z | flite/src/synthcommon/utt_utils.cpp | Barath-Kannan/flite | 236f91a9a1e60fd25f1deed6d48022567cd7100f | [
"Apache-2.0"
] | null | null | null | flite/src/synthcommon/utt_utils.cpp | Barath-Kannan/flite | 236f91a9a1e60fd25f1deed6d48022567cd7100f | [
"Apache-2.0"
] | 3 | 2018-10-28T03:47:09.000Z | 2020-06-04T08:54:23.000Z | #include "flite/synthcommon/utt_utils.hpp"
cst_wave* utt_wave(cst_utterance* u)
{
if (u)
return val_wave(feat_val(u->features, "wave"));
else
return 0;
}
int utt_set_wave(cst_utterance* u, cst_wave* w)
{
feat_set(u->features, "wave", wave_val(w));
return 0;
}
const char* utt_input_text(cst_utterance* u)
{
return val_string(feat_val(u->features, "input_text"));
}
int utt_set_input_text(cst_utterance* u, const char* text)
{
feat_set_string(u->features, "input_text", text);
return 0;
}
| 19.851852 | 59 | 0.675373 | Barath-Kannan |
e0d4c20bb3cd7196f79e0e29ec9a9fb3dafc818b | 1,400 | cpp | C++ | N0289-Game-of-Life/solution1.cpp | loyio/leetcode | 366393c29a434a621592ef6674a45795a3086184 | [
"CC0-1.0"
] | null | null | null | N0289-Game-of-Life/solution1.cpp | loyio/leetcode | 366393c29a434a621592ef6674a45795a3086184 | [
"CC0-1.0"
] | null | null | null | N0289-Game-of-Life/solution1.cpp | loyio/leetcode | 366393c29a434a621592ef6674a45795a3086184 | [
"CC0-1.0"
] | 2 | 2022-01-25T05:31:31.000Z | 2022-02-26T07:22:23.000Z | class Solution {
public:
void gameOfLife(vector<vector<int>>& board) {
int neighbors[3] = {0, 1, -1};
int rows = board.size();
int cols = board[0].size();
vector<vector<int>> copyBoard(rows, vector<int>(cols, 0));
for(int i = 0; i < rows; ++i){
for(int j = 0; j < cols; ++j){
copyBoard[i][j] = board[i][j];
}
}
for(int row = 0; row < rows; ++row){
for(int col = 0; col < cols; ++col){
int liveNeighbors = 0;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (!(neighbors[i] == 0 && neighbors[j] == 0)) {
int r = (row + neighbors[i]);
int c = (col + neighbors[j]);
if ((r < rows && r >= 0) && (c < cols && c >= 0) && (copyBoard[r][c] == 1)) {
liveNeighbors += 1;
}
}
}
}
if ((copyBoard[row][col] == 1) && (liveNeighbors < 2 || liveNeighbors > 3)) {
board[row][col] = 0;
}
if (copyBoard[row][col] == 0 && liveNeighbors == 3) {
board[row][col] = 1;
}
}
}
}
};
| 31.111111 | 105 | 0.336429 | loyio |
e0dd59295496e028a229ebf6ddbe1de5f7a496b9 | 281 | cpp | C++ | tests/main.cpp | mtrempoltsev/v8capi | e8772521250a82714d734e2337f39b42be1055b9 | [
"MIT"
] | 1 | 2021-01-28T03:32:05.000Z | 2021-01-28T03:32:05.000Z | tests/main.cpp | mtrempoltsev/v8capi | e8772521250a82714d734e2337f39b42be1055b9 | [
"MIT"
] | null | null | null | tests/main.cpp | mtrempoltsev/v8capi | e8772521250a82714d734e2337f39b42be1055b9 | [
"MIT"
] | null | null | null | #include <gtest/gtest.h>
#include "../include/v8capi.h"
int main(int argc, char* argv[])
{
v8_instance* v8 = v8_new_instance(0, argv[0]);
::testing::InitGoogleTest(&argc, argv);
const auto result = RUN_ALL_TESTS();
v8_delete_instance(v8);
return result;
}
| 17.5625 | 50 | 0.654804 | mtrempoltsev |
e0de6a6f493af66a115fbbca34c3b8071981129a | 7,136 | cpp | C++ | src/apg.cpp | whulizhen/iers2010 | 3b1c9587510074a7658e0042ce6b1e737560ca23 | [
"WTFPL"
] | null | null | null | src/apg.cpp | whulizhen/iers2010 | 3b1c9587510074a7658e0042ce6b1e737560ca23 | [
"WTFPL"
] | null | null | null | src/apg.cpp | whulizhen/iers2010 | 3b1c9587510074a7658e0042ce6b1e737560ca23 | [
"WTFPL"
] | 2 | 2017-08-01T22:01:45.000Z | 2018-10-13T09:06:04.000Z | #include "iers2010.hpp"
/**
* @details This subroutine determines the asymmetric delay d in meters caused
* by gradients. The north and east gradients are also provided.
* They are based on Spherical Harmonics up to degree and order 9.
* If the north and east gradients are used, they should be used
* with the gradient model by Chen and Herring (1997). See Reference 1
* and last lines of this subroutine.
* This function is a translation/wrapper for the fortran APG
* subroutine, found here :
* http://maia.usno.navy.mil/conv2010/software.html
*
* @param[in] dlat Latitude given in radians (North Latitude)
* @param[in] dlon Longitude given in radians (East Longitude)
* @param[in] az Azimuth from north in radians
* @param[in] el Elevation angle in radians
* @param[out] d Delay in meters
* @param[out] grn North gradient in mm
* @param[out] gre East gradient in mm
* @return An integer
*
* @note
* -# This a priori model cannot replace the (additional) estimation of
* gradient parameters, if observations at elevation angles below
* 15 degrees are analyzed.
* -# Status: Class 1 model
*
* @verbatim
* Test case:
* Kashima 11 Station information retrieved at:
* ftp://ivscc.gsfc.nasa.gov/pub/config/ns/kashim11.config.txt
*
* given input: DLAT = 0.6274877539940092D0 radians (KASHIMA 11, Japan)
* DLON = 2.454994088489240D0 radians
* AZ = 0.2617993877991494D0 radians
* EL = 0.8726646259971648D0 radians
*
* expected output: D = -0.9677190006296187757D-4 meters
* GRN = -0.1042668498001996791D0 mm
* GRE = 0.4662515377110782594D-1 mm
* @endverbatim
*
* @version 2010 September 29
*
* @cite iers2010
* Chen, G. and Herring, T. A., 1997, ``Effects of atmospheric azimuthal
* asymmetry on the analysis of space geodetic data,"
* J. Geophys. Res., 102(B9), pp. 20,489--20,502, doi: 10.1029/97JB01739.
*
*/
int iers2010::apg (const double& dlat,const double& dlon,const double& az,
const double&el,double& d,double& grn,double& gre)
{
// degree n and order m
constexpr int nmax = 9;
constexpr int mmax = 9;
static constexpr double a_n[] = {
2.8959e-02,-4.6440e-01,-8.6531e-03, 1.1836e-01,-2.4168e-02,
-6.9072e-05, 2.6783e-01,-1.1697e-03,-2.3396e-03,-1.6206e-03,
-7.4883e-02, 1.3583e-02, 1.7750e-03, 3.2496e-04, 8.8051e-05,
9.6532e-02, 1.3192e-02, 5.5250e-04, 4.0507e-04,-5.4758e-06,
9.4260e-06,-1.0872e-01, 5.7551e-03, 5.3986e-05,-2.3753e-04,
-3.8241e-05, 1.7377e-06,-4.4135e-08, 2.1863e-01, 2.0228e-02,
-2.0127e-04,-3.3669e-04, 8.7575e-06, 7.0461e-07,-4.0001e-08,
-4.5911e-08,-3.1945e-03,-5.1369e-03, 3.0684e-04, 2.4459e-05,
7.6575e-06,-5.5319e-07, 3.5133e-08, 1.1074e-08, 3.4623e-09,
-1.5845e-01,-2.0376e-02,-4.0081e-04, 2.2062e-04,-7.9179e-06,
-1.6441e-07,-5.0004e-08, 8.0689e-10,-2.3813e-10,-2.4483e-10
};
static constexpr double b_n[] = {
0.0000e+00, 0.0000e+00,-1.1930e-02, 0.0000e+00, 9.8349e-03,
-1.6861e-03, 0.0000e+00, 4.3338e-03, 6.1707e-03, 7.4635e-04,
0.0000e+00, 3.5124e-03, 2.1967e-03, 4.2029e-04, 2.4476e-06,
0.0000e+00, 4.1373e-04,-2.3281e-03, 2.7382e-04,-8.5220e-05,
1.4204e-05, 0.0000e+00,-8.0076e-03, 4.5587e-05,-5.8053e-05,
-1.1021e-05, 7.2338e-07,-1.9827e-07, 0.0000e+00,-3.9229e-03,
-4.0697e-04,-1.6992e-04, 5.4705e-06,-4.4594e-06, 2.0121e-07,
-7.7840e-08, 0.0000e+00,-3.2916e-03,-1.2302e-03,-6.5735e-06,
-3.1840e-06,-8.9836e-07, 1.1870e-07,-5.8781e-09,-2.9124e-09,
0.0000e+00, 1.0759e-02,-6.6074e-05,-4.0635e-05, 8.7141e-06,
6.4567e-07,-4.4684e-08,-5.0293e-11, 2.7723e-10, 1.6903e-10
};
static constexpr double a_e[] = {
-2.4104e-03, 1.1408e-04,-3.4621e-04, 1.6565e-03,-4.0620e-03,
-6.8424e-03,-3.3718e-04, 7.3857e-03,-1.3324e-03,-1.5645e-03,
4.6444e-03, 1.0296e-03, 3.6253e-03, 4.0329e-04, 3.1943e-04,
-7.1992e-04, 4.8706e-03, 9.4300e-04, 2.0765e-04,-5.0987e-06,
-7.1741e-06,-1.3131e-02, 2.9099e-04,-2.2509e-04, 2.6716e-04,
-8.1815e-05, 8.4297e-06,-9.2378e-07,-5.8095e-04, 2.7501e-03,
4.3659e-04,-8.2990e-06,-1.4808e-05, 2.2033e-06,-3.3215e-07,
2.8858e-08, 9.9968e-03, 4.9291e-04, 3.3739e-05, 2.4696e-06,
-8.1749e-06,-9.0052e-07, 2.0153e-07,-1.0271e-08, 1.8249e-09,
3.0578e-03, 1.1229e-03,-1.9977e-04, 4.4581e-06,-7.6921e-06,
-2.8308e-07, 1.0305e-07,-6.9026e-09, 1.5523e-10,-1.0395e-10
};
static constexpr double b_e[] = {
0.0000e+00, 0.0000e+00,-2.5396e-03, 0.0000e+00, 9.2146e-03,
-7.5836e-03, 0.0000e+00, 1.2765e-02,-1.1436e-03, 1.7909e-04,
0.0000e+00, 2.9318e-03,-6.8541e-04, 9.5775e-04, 2.4596e-05,
0.0000e+00, 3.5662e-03,-1.3949e-03,-3.4597e-04,-5.8236e-05,
5.6956e-06, 0.0000e+00,-5.0164e-04,-6.5585e-04, 1.1134e-05,
2.3315e-05,-4.0521e-06,-4.1747e-07, 0.0000e+00, 5.1650e-04,
-1.0483e-03, 5.8109e-06, 1.6406e-05,-1.6261e-06, 6.2992e-07,
1.3134e-08, 0.0000e+00,-6.1449e-03,-3.2511e-04, 1.7646e-04,
7.5326e-06,-1.1946e-06, 5.1217e-08, 2.4618e-08, 3.6290e-09,
0.0000e+00, 3.6769e-03,-9.7683e-04,-3.2096e-07, 1.3860e-06,
-6.2832e-09, 2.6918e-09, 2.5705e-09,-2.4401e-09,-3.7917e-11
};
// unit vector
double x = cos(dlat) * cos(dlon);
double y = cos(dlat) * sin(dlon);
double z = sin(dlat);
// Legendre polynomials
double v[10][10], w[10][10];
v[0][0] = 1e0;
w[0][0] = 0e0;
v[1][0] = z * v[0][0];
w[1][0] = 0e0;
for (int n=1;n<nmax;n++) {
int N ( n + 1 );
v[n+1][0] = ( (2*N-1) * z * v[n][0] - (N-1) * v[n-1][0] ) / (double) N;
w[n+1][0] = 0e0;
}
for (int m=0;m<mmax;m++) {
int M ( m + 1 );
v[m+1][m+1] = (double) (2*M-1) * ( x*v[m][m] - y*w[m][m] );
w[m+1][m+1] = (double) (2*M-1) * ( x*w[m][m] + y*v[m][m] );
if (m<mmax-1) {
v[m+2][m+1] = (2*M+1) * z* v[m+1][m+1];
w[m+2][m+1] = (2*M+1) * z* w[m+1][m+1];
}
int N = M + 2;
for (int n=m+2;n<nmax;n++) {
v[n+1][m+1] = ( (2*N-1)*z*v[n][m+1] - (N+M-1)*v[n-1][m+1] )
/ (double) (N-M);
w[n+1][m+1] = ( (2*N-1)*z*w[n][m+1] - (N+M-1)*w[n-1][m+1] )
/ (double) (N-M);
N++;
}
}
// Surface pressure on the geoid
grn = 0e0;
gre = 0e0;
int i = 0;
for (int n=0;n<=nmax;n++) {
for (int m=0;m<=n;m++) {
grn += ( a_n[i]*v[n][m] + b_n[i]*w[n][m] );
gre += ( a_e[i]*v[n][m] + b_e[i]*w[n][m] );
i++;
}
}
// calculation of the asymmetric delay in m (Chen and Herring 1997)
d = 1.e0 / ( sin(el)*tan(el)+0.0031e0 )*( grn*cos(az)+gre*sin(az) ); // mm
d = d / 1000.e0; // m
// Finished
return 0;
}
| 41.730994 | 80 | 0.548487 | whulizhen |
e0df83db432b1feb811ef98d8cdd73eadefae4a5 | 34,336 | cpp | C++ | Lib/Shared/Edif.General.cpp | kapigames/NoiseExtension | e3ce550a61f33eea4c71a050c610986ac51e3e8e | [
"MIT"
] | 2 | 2021-12-10T17:58:33.000Z | 2022-01-03T10:30:16.000Z | Lib/Shared/Edif.General.cpp | kapigames/NoiseExtension | e3ce550a61f33eea4c71a050c610986ac51e3e8e | [
"MIT"
] | 1 | 2021-12-17T21:25:14.000Z | 2021-12-17T21:25:14.000Z | Lib/Shared/Edif.General.cpp | kapigames/NoiseExtension | e3ce550a61f33eea4c71a050c610986ac51e3e8e | [
"MIT"
] | null | null | null | // ============================================================================
// Edif General:
// The following routines are used internally by Fusion, and should not need to
// be modified.
// ============================================================================
#include "Common.h"
#include "DarkEdif.h"
#ifdef _WIN32
// ============================================================================
// LIBRARY ENTRY & QUIT POINTS
// ============================================================================
HINSTANCE hInstLib = NULL;
// Entry point for DLL, when DLL is attached to by Fusion, or detached; or threads attach/detach
__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hDLL, std::uint32_t dwReason, LPVOID lpReserved)
{
// DLL is attaching to the address space of the current process.
if (dwReason == DLL_PROCESS_ATTACH && hInstLib == NULL)
{
hInstLib = hDLL; // Store HINSTANCE
// no thread attach/detach for dynamic CRT, due to a small memory loss
#ifdef _DLL
DisableThreadLibraryCalls(hDLL);
#endif
}
return TRUE;
}
// Called when the extension is loaded into memory.
// DarkEdif users shouldn't need to modify this function.
int FusionAPI Initialize(mv *mV, int quiet)
{
#pragma DllExportHint
return Edif::Init(mV, quiet != FALSE);
}
// The counterpart of Initialize(). Called just before freeing the DLL.
// DarkEdif users shouldn't need to modify this function.
int FusionAPI Free(mv *mV)
{
#pragma DllExportHint
// Edif is singleton, so no clean-up needed
// But if the update checker thread is running, we don't want it to try to write to memory it can't access.
#if USE_DARKEDIF_UPDATE_CHECKER
extern HANDLE updateThread;
if (updateThread != NULL && WaitForSingleObject(updateThread, 3000) == WAIT_TIMEOUT)
TerminateThread(updateThread, 2);
#endif
return 0; // No error
}
// ============================================================================
// GENERAL INFO
// ============================================================================
// Routine called for each object when the object is read from the MFA file (edit time)
// or from the CCN or EXE file (run time).
// DarkEdif users shouldn't need to modify this function.
int FusionAPI LoadObject(mv * mV, const char * fileName, EDITDATA * edPtr, int reserved)
{
#pragma DllExportHint
Edif::Init(mV, edPtr);
return 0;
}
// The counterpart of LoadObject(): called just before the object is
// deleted from the frame.
// DarkEdif users shouldn't need to modify this function.
void FusionAPI UnloadObject(mv * mV, EDITDATA * edPtr, int reserved)
{
#pragma DllExportHint
}
const TCHAR ** Dependencies = 0;
const TCHAR ** FusionAPI GetDependencies()
{
#pragma DllExportHint
if (!Dependencies)
{
const json_value &DependenciesJSON = SDK->json["Dependencies"];
Dependencies = new const TCHAR * [DependenciesJSON.u.object.length + 2];
int Offset = 0;
if (Edif::ExternalJSON)
{
TCHAR JSONFilename [MAX_PATH];
GetModuleFileName (hInstLib, JSONFilename, sizeof (JSONFilename) / sizeof(*JSONFilename));
TCHAR * Iterator = JSONFilename + _tcslen(JSONFilename) - 1;
while(*Iterator != _T('.'))
-- Iterator;
_tcscpy(++ Iterator, _T("json"));
Iterator = JSONFilename + _tcslen(JSONFilename) - 1;
while(*Iterator != _T('\\') && *Iterator != _T('/'))
-- Iterator;
Dependencies [Offset ++] = ++ Iterator;
}
std::uint32_t i = 0;
for(; i < DependenciesJSON.u.object.length; ++ i)
{
TCHAR* tstr = Edif::ConvertString(DependenciesJSON[i]);
Dependencies[Offset + i] = tstr;
Edif::FreeString(tstr);
}
Dependencies[Offset + i] = 0;
}
return Dependencies;
}
/// <summary> Called every time the extension is being created from nothing.
/// Default property contents should be loaded from JSON. </summary>
std::int16_t FusionAPI GetRunObjectInfos(mv * mV, kpxRunInfos * infoPtr)
{
#pragma DllExportHint
infoPtr->Conditions = &::SDK->ConditionJumps[0];
infoPtr->Actions = &::SDK->ActionJumps[0];
infoPtr->Expressions = &::SDK->ExpressionJumps[0];
infoPtr->NumOfConditions = CurLang["Conditions"].u.object.length;
infoPtr->NumOfActions = CurLang["Actions"].u.object.length;
infoPtr->NumOfExpressions = CurLang["Expressions"].u.object.length;
static unsigned short EDITDATASize = 0;
if (EDITDATASize == 0)
{
infoPtr->EDITDATASize = sizeof(EDITDATA);
#ifndef NOPROPS
const json_value& JSON = CurLang["Properties"];
size_t fullSize = sizeof(EDITDATA);
// Store one bit per property, for any checkboxes
fullSize += (int)ceil(JSON.u.array.length / ((float)CHAR_BIT));
for (unsigned int i = 0; i < JSON.u.array.length; ++i)
{
const json_value& propjson = *JSON.u.array.values[i];
const char* curPropType = propjson["Type"];
if (!_strnicmp(curPropType, "Editbox String", sizeof("Editbox String") - 1))
{
const char* defaultText = CurLang["Properties"]["DefaultState"];
fullSize += (defaultText ? strlen(defaultText) : 0) + 1; // UTF-8
}
// Stores a number (in combo box, an index)
else if (!_stricmp(curPropType, "Editbox Number") || !_stricmp(curPropType, "Editbox Float") || !_stricmp(curPropType, "Combo Box"))
fullSize += sizeof(int);
// No content, or already stored in checkbox part before this for loop
else if (!_stricmp(curPropType, "Text") || !_stricmp(curPropType, "Checkbox") ||
// Folder or FolderEnd - no data, folders are cosmetic
!_strnicmp(curPropType, "Folder", sizeof("Folder") - 1) ||
// Buttons - no data, they're just clickable
!_stricmp(curPropType, "Edit button") ||
!_stricmp(curPropType, "Group"))
{
// skip 'em, no changeable data
}
else
{
DarkEdif::MsgBox::Error(_T("Property error"), _T("Property type \"%hs\" has no code for storing its value"),
curPropType);
}
}
// Too large for EDITDATASize
if (fullSize > UINT16_MAX)
DarkEdif::MsgBox::Error(_T("Property error"), _T("Property default sizes are too large (%zu bytes)."), fullSize);
else
infoPtr->EDITDATASize = EDITDATASize = (unsigned short)fullSize;
#else // NOPROPS
EDITDATASize = infoPtr->EDITDATASize;
#endif // NOPROPS
}
//+(GetPropertyChbx(edPtr, CurLang["Properties"].u.object.length+1)-&edPtr);
infoPtr->WindowProcPriority = Extension::WindowProcPriority;
infoPtr->EditFlags = Extension::OEFLAGS;
infoPtr->EditPrefs = Extension::OEPREFS;
memcpy(&infoPtr->Identifier, ::SDK->json["Identifier"], 4);
infoPtr->Version = Extension::Version;
return TRUE;
}
std::uint32_t FusionAPI GetInfos(int info)
{
#pragma DllExportHint
switch ((KGI)info)
{
case KGI::VERSION:
return 0x300; // I'm a MMF2 extension!
case KGI::PLUGIN:
return 0x100; // Version 1 type o' plugin
case KGI::PRODUCT:
#ifdef PROEXT
return 3; // MMF Developer
#endif
#ifdef TGFEXT
return 1; // TGF2
#endif
return 2; // MMF Standard
case KGI::BUILD:
return Extension::MinimumBuild;
#ifdef _UNICODE
case KGI::UNICODE_:
return TRUE; // I'm building in Unicode
#endif
default:
return 0;
}
}
std::int16_t FusionAPI CreateRunObject(RUNDATA * rdPtr, EDITDATA * edPtr, CreateObjectInfo * cobPtr)
{
#pragma DllExportHint
/* Global to all extensions! Use the constructor of your Extension class (Extension.cpp) instead! */
rdPtr->pExtension = new Extension(rdPtr, edPtr, cobPtr);
rdPtr->pExtension->Runtime.ObjectSelection.pExtension = rdPtr->pExtension;
return 0;
}
/* Don't touch any of these, they're global to all extensions! See Extension.cpp */
std::int16_t FusionAPI DestroyRunObject(RUNDATA * rdPtr, long fast)
{
#pragma DllExportHint
delete rdPtr->pExtension;
rdPtr->pExtension = NULL;
return 0;
}
REFLAG FusionAPI HandleRunObject(RUNDATA * rdPtr)
{
#pragma DllExportHint
return rdPtr->pExtension->Handle();
}
#ifdef VISUAL_EXTENSION
REFLAG FusionAPI DisplayRunObject(RUNDATA * rdPtr)
{
#pragma DllExportHint
return rdPtr->pExtension->Display();
}
#endif
std::uint16_t FusionAPI GetRunObjectDataSize(RunHeader * rhPtr, EDITDATA * edPtr)
{
#pragma DllExportHint
return (sizeof(RUNDATA));
}
std::int16_t FusionAPI PauseRunObject(RUNDATA * rdPtr)
{
#pragma DllExportHint
// Note: PauseRunObject is required, or runtime will crash when pausing.
return rdPtr->pExtension->FusionRuntimePaused();
}
std::int16_t FusionAPI ContinueRunObject(RUNDATA * rdPtr)
{
#pragma DllExportHint
return rdPtr->pExtension->FusionRuntimeContinued();
}
#elif defined(__ANDROID__)
ProjectFunc jint getNumberOfConditions(JNIEnv *, jobject, jlong cptr)
{
//raise(SIGTRAP);
return CurLang["Conditions"].u.array.length;
}
typedef jobject ByteBufferDirect;
typedef jobject CCreateObjectInfo;
static RuntimeFunctions runFuncs;
ProjectFunc jlong createRunObject(JNIEnv * env, jobject javaExtPtr, ByteBufferDirect edPtr, CCreateObjectInfo coi, jint version)
{
void * edPtrReal = mainThreadJNIEnv->GetDirectBufferAddress(edPtr);
LOGI("Note: mainThreadJNIEnv is %p, env is %p; javaExtPtr is %p, edPtr %p, edPtrReal %p, coi %p.", mainThreadJNIEnv, env, javaExtPtr, edPtr, edPtrReal, coi);
global<jobject> javaExtP(javaExtPtr, "createRunObject javaExtPtr");
runFuncs.ext = javaExtP;
Extension * ext = new Extension(runFuncs, (EDITDATA *)edPtrReal, javaExtPtr);
runFuncs.ext = ext->javaExtPtr; // this is global so it's safer
ext->Runtime.ObjectSelection.pExtension = ext;
return (jlong)ext;
}
ProjectFunc void destroyRunObject(JNIEnv *, jobject, jlong ext, jboolean fast)
{
JNIExceptionCheck();
LOGV("Running " PROJECT_NAME " extension dtor in destroyRunObject...");
delete ((Extension *)ext);
JNIExceptionCheck();
LOGV("Ran " PROJECT_NAME " extension dtor OK.");
}
ProjectFunc REFLAG handleRunObject(JNIEnv *, jobject, jlong ext)
{
return ((Extension *)ext)->Handle();
}
ProjectFunc REFLAG displayRunObject(JNIEnv *, jobject, jlong ext)
{
// WARNING: not sure if this will work. Function signature was not in native SDK.
return ((Extension *)ext)->Display();
}
ProjectFunc short pauseRunObject(JNIEnv *, jobject, jlong ext)
{
return ((Extension *)ext)->FusionRuntimePaused();
}
ProjectFunc short continueRunObject(JNIEnv *, jobject, jlong ext)
{
return ((Extension *)ext)->FusionRuntimeContinued();
}
extern thread_local JNIEnv * threadEnv;
jclass GetExtClass(void * javaExtPtr) {
assert(threadEnv && mainThreadJNIEnv == threadEnv);
static global<jclass> clazz(mainThreadJNIEnv->GetObjectClass((jobject)javaExtPtr), "static global<> ext class, GetExtClass(), from javaExtPtr");
return clazz;
};
jobject GetRH(void * javaExtPtr) {
assert(threadEnv && mainThreadJNIEnv == threadEnv);
static jfieldID getRH(mainThreadJNIEnv->GetFieldID(GetExtClass(javaExtPtr), "rh", "LRunLoop/CRun;"));
return mainThreadJNIEnv->GetObjectField((jobject)javaExtPtr, getRH);
};
int act_getParamExpression(void * javaExtPtr, void * act) {
static global<jclass> actClass(mainThreadJNIEnv->GetObjectClass((jobject)act), "static global<> actClass, from act_getParamExpression");
static jmethodID getActExpr(mainThreadJNIEnv->GetMethodID(actClass, "getParamExpression", "(LRunLoop/CRun;I)I"));
return mainThreadJNIEnv->CallIntMethod((jobject)act, getActExpr, GetRH(javaExtPtr), -1);
}
RuntimeFunctions::string act_getParamExpString(void * javaExtPtr, void * act) {
static global<jclass> actClass(mainThreadJNIEnv->GetObjectClass((jobject)act), "static global<> actClass, from act_getParamExpString");
static jmethodID getActExpr(mainThreadJNIEnv->GetMethodID(actClass, "getParamFilename2", "(LRunLoop/CRun;I)Ljava/lang/String;"));
RuntimeFunctions::string str;
str.ctx = (jstring)mainThreadJNIEnv->CallObjectMethod((jobject)act, getActExpr, GetRH(javaExtPtr), -1);
str.ptr = mainThreadJNIEnv->GetStringUTFChars((jstring)str.ctx, NULL);
return str;
}
float act_getParamExpFloat(void * javaExtPtr, void * act) {
static global<jclass> actClass(mainThreadJNIEnv->GetObjectClass((jobject)act), "static global<>actClass, from act_getParamExpFloat");
static jmethodID getActExpr(mainThreadJNIEnv->GetMethodID(actClass, "getParamExpFloat", "(LRunLoop/CRun;I)F"));
return mainThreadJNIEnv->CallFloatMethod((jobject)act, getActExpr, GetRH(javaExtPtr), -1);
}
int cnd_getParamExpression(void * javaExtPtr, void * cnd) {
static global<jclass> cndClass(mainThreadJNIEnv->GetObjectClass((jobject)cnd), "static global<>cndClass, from cnd_getParamExpression");
static jmethodID getcndExpr(mainThreadJNIEnv->GetMethodID(cndClass, "getParamExpression", "(LRunLoop/CRun;I)I"));
return mainThreadJNIEnv->CallIntMethod((jobject)cnd, getcndExpr, GetRH(javaExtPtr), -1);
}
RuntimeFunctions::string cnd_getParamExpString(void * javaExtPtr, void * cnd) {
static global<jclass> cndClass(mainThreadJNIEnv->GetObjectClass((jobject)cnd), "static global<>cndClass, from cnd_getParamExpString");
static jmethodID getcndExpr(mainThreadJNIEnv->GetMethodID(cndClass, "getParamFilename2", "(LRunLoop/CRun;I)Ljava/lang/String;"));
RuntimeFunctions::string str;
str.ctx = (jstring)mainThreadJNIEnv->CallObjectMethod((jobject)cnd, getcndExpr, GetRH(javaExtPtr), -1);
str.ptr = mainThreadJNIEnv->GetStringUTFChars((jstring)str.ctx, NULL);
return str;
}
float cnd_getParamExpFloat(void * javaExtPtr, void * cnd) {
static global<jclass> cndClass(mainThreadJNIEnv->GetObjectClass((jobject)cnd), "static global<> cndClass, from cnd_getParamExpFloat");
static jmethodID getcndExpr(mainThreadJNIEnv->GetMethodID(cndClass, "getParamExpFloat", "(LRunLoop/CRun;I)F"));
float f = mainThreadJNIEnv->CallFloatMethod((jobject)cnd, getcndExpr, GetRH(javaExtPtr), -1);
return f;
}
int exp_getParamExpression(void * javaExtPtr, void * exp) {
static global<jclass> expClass(mainThreadJNIEnv->GetObjectClass((jobject)exp), "static global<> expClass, from exp_getParamExpression");
static jmethodID getexpExpr(mainThreadJNIEnv->GetMethodID(expClass, "getParamInt", "()I"));
return mainThreadJNIEnv->CallIntMethod((jobject)exp, getexpExpr);
}
RuntimeFunctions::string exp_getParamExpString(void * javaExtPtr, void * exp) {
static global<jclass> expClass(mainThreadJNIEnv->GetObjectClass((jobject)exp), "static global<> expClass, from exp_getParamExpString");
static jmethodID getexpExpr(mainThreadJNIEnv->GetMethodID(expClass, "getParamString", "()Ljava/lang/String;"));
RuntimeFunctions::string str;
str.ctx = (jstring)mainThreadJNIEnv->CallObjectMethod((jobject)exp, getexpExpr);
str.ptr = mainThreadJNIEnv->GetStringUTFChars((jstring)str.ctx, NULL);
return str;
}
float exp_getParamExpFloat(void * javaExtPtr, void * exp) {
static global<jclass> expClass(mainThreadJNIEnv->GetObjectClass((jobject)exp), "static global<> expClass, from exp_getParamExpFloat");
static jmethodID setexpExpr(mainThreadJNIEnv->GetMethodID(expClass, "getParamFloat", "()F"));
return mainThreadJNIEnv->CallFloatMethod((jobject)exp, setexpExpr);
}
void exp_setReturnInt(void * javaExtPtr, void * exp, int val) {
static global<jclass> expClass(mainThreadJNIEnv->GetObjectClass((jobject)exp), "static global<> expClass, from exp_setReturnInt");
static jmethodID setexpExpr(mainThreadJNIEnv->GetMethodID(expClass, "setReturnInt", "(I)V"));
mainThreadJNIEnv->CallVoidMethod((jobject)exp, setexpExpr, val);
}
static std::uint8_t UTF8_CHAR_WIDTH[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x1F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x3F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x5F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x7F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x9F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xBF
0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xDF
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xEF
4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xFF
};
// This is set in Edif::Runtime
thread_local JNIEnv * threadEnv = nullptr;
jstring CStrToJStr(const char * String)
{
#ifdef _DEBUG
if (threadEnv->ExceptionCheck())
LOGF("Already a bug when returning a string!! Error %s, text to return %s.", GetJavaExceptionStr().c_str(), String);
if (String == nullptr)
LOGF("String pointer is null in CStrToJStr()!");
#endif
// Java doesn't use regular UTF-8, but "modified" UTF-8, or CESU-8.
// In Java, UTF-8 null and UTF8 4-byte characters aren't allowed. They will need re-encoding.
// Thankfully, they're not common in English usage. So, we'll quickly check.
// We can ignore the check for embedded null, as strlen() will stop at first null anyway, and Runtime.CopyString() is
// only for expressions returning non-null strings.
unsigned char * bytes = (unsigned char *)String;
size_t strU8Len = strlen(String);
jstring jstr = nullptr;
for (int k = 0; k < strU8Len; k++)
{
// 4-byte UTF-8, welp.
if (bytes[k] >= 0xF0 && bytes[k] <= 0xF5)
goto reconvert;
}
LOGV("UTF-8 String \"%s\" should already be valid Modified UTF-8.", String);
// No 4-byte characters, safe to convert directly
jstr = threadEnv->NewStringUTF(String);
if (threadEnv->ExceptionCheck())
LOGE("Failed to convert string, got error %s.", GetJavaExceptionStr().c_str());
return jstr;
reconvert:
LOGV("Reconverting UTF-8 to Modified UTF-8 in Runtime.CopyStringEx().");
std::string newString(strU8Len + (strU8Len >> 2), '\0');
int inputByteIndex = 0, outputByteIndex = 0;
while (inputByteIndex < strU8Len) {
std::uint8_t b = bytes[inputByteIndex];
/*
// Null byte, but since we use strlen above, this won't happen
if (b == 0) {
assert(false && "Null byte inside expression return");
// Null bytes in Java are encoded as 0xc0, 0x80
newString[outputByteIndex++] = 0xC0;
newString[outputByteIndex++] = 0x80;
inputByteIndex++;
}
else */
if (b < 128) {
// Pass ASCII through quickly.
newString[outputByteIndex++] = bytes[inputByteIndex++];
}
else {
// Figure out how many bytes we need for this character.
int w = UTF8_CHAR_WIDTH[bytes[inputByteIndex]];
assert(w <= 4);
assert(inputByteIndex + w <= strU8Len);
if (w == 4) {
// Assume valid UTF-8 was already confirmed; we have a 4-byte UTF-8 we need to convert to a UTF-32.
// Convert using https://gist.github.com/ozdemirburak/89a7a1673cb65ce83469#file-converter-c-L190
unsigned int charAsUTF32 = ((bytes[inputByteIndex] & 0x07) << 18) | ((bytes[inputByteIndex + 1] & 0x3f) << 12) | ((bytes[inputByteIndex + 2] & 0x3f) << 6) | (bytes[inputByteIndex + 3] & 0x3f);
unsigned int charAsUTF32Modified = charAsUTF32 - 0x10000;
std::uint16_t surrogates[] = { 0, 0 };
surrogates[0] = ((std::uint16_t)(charAsUTF32Modified >> 10)) | 0xD800;
surrogates[1] = ((std::uint16_t)(charAsUTF32Modified & 0x3FF)) | 0xDC00;
auto enc_surrogate = [&outputByteIndex, &newString](std::uint16_t surrogate) {
assert(0xD800 <= surrogate && surrogate <= 0xDFFF);
// 1110xxxx 10xxxxxx 10xxxxxx
newString[outputByteIndex++] = 0b11100000 | ((surrogate & 0b1111000000000000) >> 12);
newString[outputByteIndex++] = 0b10000000 | ((surrogate & 0b0000111111000000) >> 6);
newString[outputByteIndex++] = 0b10000000 | ((surrogate & 0b0000000000111111));
};
enc_surrogate(surrogates[0]);
enc_surrogate(surrogates[1]);
}
else // Pass through short UTF-8 sequences unmodified.
{
// Basically just memcpy(newString.data() + outputByteIndex, &bytes[inputByteIndex], w);
if (w == 1)
*((std::uint8_t *)&newString[outputByteIndex]) = bytes[inputByteIndex];
else if (w == 2)
*((std::uint16_t *)&newString[outputByteIndex]) = *(std::uint16_t *)&bytes[inputByteIndex];
else // w == 3
{
*((std::uint8_t *)&newString[outputByteIndex]) = bytes[inputByteIndex];
*((std::uint16_t *)&newString[outputByteIndex + 1]) = *(std::uint16_t *)&bytes[inputByteIndex + 1];
}
outputByteIndex += w;
}
inputByteIndex += w;
}
}
newString.resize(outputByteIndex);
jstr = threadEnv->NewStringUTF(String);
if (threadEnv->ExceptionCheck())
LOGE("Failed to convert string, got error %s.", GetJavaExceptionStr().c_str());
return jstr;
}
// Converts std::thread::id to a std::string
std::string ThreadIDToStr(std::thread::id id)
{
// Most compatible way
std::ostringstream str;
if (id != std::this_thread::get_id())
{
LOGE("Not the right ID.");
str << std::hex << id;
}
else
str << gettid();
return str.str();
}
void exp_setReturnString(void * javaExtPtr, void * exp, const char * val) {
static global<jclass> expClass(mainThreadJNIEnv->GetObjectClass((jobject)exp), "static global<> expClass, from exp_setReturnString");
static jmethodID setexpExpr(mainThreadJNIEnv->GetMethodID(expClass, "setReturnString", "(Ljava/lang/String;)V"));
// Convert into Java memory
jstring jStr = CStrToJStr(val);
mainThreadJNIEnv->CallVoidMethod((jobject)exp, setexpExpr, jStr);
JNIExceptionCheck();
mainThreadJNIEnv->DeleteLocalRef(jStr); // not strictly needed
JNIExceptionCheck();
}
void exp_setReturnFloat(void * javaExtPtr, void * exp, float val) {
static global<jclass> expClass(mainThreadJNIEnv->GetObjectClass((jobject)exp), "static global<> expClass, from exp_setReturnFloat");
static jmethodID getexpExpr(mainThreadJNIEnv->GetMethodID(expClass, "setReturnFloat", "(F)V"));
mainThreadJNIEnv->CallVoidMethod((jobject)exp, getexpExpr, val);
}
void freeString(void * ext, RuntimeFunctions::string str)
{
threadEnv->ReleaseStringUTFChars((jstring)str.ctx, str.ptr);
JNIExceptionCheck();
str = { NULL, NULL };
}
void generateEvent(void * javaExtPtr, int code, int param) {
LOGW("GenerateEvent ID %i attempting...", code);
static global<jclass> expClass(threadEnv->GetObjectClass((jobject)javaExtPtr), "static global<> expClass, from generateEvent");
static jfieldID getHo(threadEnv->GetFieldID(expClass, "ho", "LObjects/CExtension;")); // ?
jobject ho = threadEnv->GetObjectField((jobject)javaExtPtr, getHo);
static global<jclass> hoClass(threadEnv->GetObjectClass(ho), "static global<> ho, from generateEvent");
static jmethodID genEvent(threadEnv->GetMethodID(hoClass, "generateEvent", "(II)V"));
threadEnv->CallVoidMethod(ho, genEvent, code, param);
};
void pushEvent(void * javaExtPtr, int code, int param) {
static global<jclass> expClass(threadEnv->GetObjectClass((jobject)javaExtPtr), "static global<> expClass, from pushEvent");
static jfieldID getHo(threadEnv->GetFieldID(expClass, "ho", "LObjects/CExtension;")); // ?
jobject ho = threadEnv->GetObjectField((jobject)javaExtPtr, getHo);
static global<jclass> hoClass(threadEnv->GetObjectClass(ho), "static global<> ho, from pushEvent");
static jmethodID pushEvent(threadEnv->GetMethodID(hoClass, "pushEvent", "(II)V"));
threadEnv->CallVoidMethod(ho, pushEvent, code, param);
};
void LOGF(const char * x, ...)
{
va_list va;
va_start(va, x);
__android_log_vprint(ANDROID_LOG_ERROR, PROJECT_NAME_UNDERSCORES, x, va);
va_end(va);
__android_log_write(ANDROID_LOG_FATAL, PROJECT_NAME_UNDERSCORES, "Killed by extension " PROJECT_NAME ".");
if (threadEnv)
threadEnv->FatalError("Killed by extension " PROJECT_NAME ". Look at previous logcat entries from " PROJECT_NAME_UNDERSCORES " for details.");
else
{
__android_log_write(ANDROID_LOG_FATAL, PROJECT_NAME_UNDERSCORES, "Killed from unattached thread! Running exit.");
exit(EXIT_FAILURE);
}
}
// Call via JNIExceptionCheck(). If a Java exception is pending, instantly dies.
void Indirect_JNIExceptionCheck(const char * file, const char * func, int line)
{
if (!threadEnv)
{
LOGF("JNIExceptionCheck() called before threadEnv was inited.");
return;
}
if (!threadEnv->ExceptionCheck())
return;
jthrowable exc = threadEnv->ExceptionOccurred();
threadEnv->ExceptionClear(); // else GetObjectClass fails, which is dumb enough.
jclass exccls = threadEnv->GetObjectClass(exc);
jmethodID getMsgMeth = threadEnv->GetMethodID(exccls, "toString", "()Ljava/lang/String;");
jstring excStr = (jstring)threadEnv->CallObjectMethod(exc, getMsgMeth);
const char * c = threadEnv->GetStringUTFChars(excStr, NULL);
LOGF("JNIExceptionCheck() in file \"%s\", func \"%s\", line %d, found a JNI exception: %s.",
file, func, line, c);
raise(SIGINT);
threadEnv->ReleaseStringUTFChars(excStr, c);
return;
}
std::string GetJavaExceptionStr()
{
if (!threadEnv->ExceptionCheck())
return std::string("No exception!");
jthrowable exc = threadEnv->ExceptionOccurred();
threadEnv->ExceptionClear(); // else GetObjectClass fails, which is dumb enough.
jclass exccls = threadEnv->GetObjectClass(exc);
jmethodID getMsgMeth = threadEnv->GetMethodID(exccls, "toString", "()Ljava/lang/String;");
jstring excStr = (jstring)threadEnv->CallObjectMethod(exc, getMsgMeth);
const char * c = threadEnv->GetStringUTFChars(excStr, NULL);
std::string ret(c);
threadEnv->ReleaseStringUTFChars(excStr, c);
return ret;
}
#ifdef _DEBUG
#include <iostream>
#include <iomanip>
#include <unwind.h>
#include <dlfcn.h>
namespace {
struct BacktraceState
{
void ** current;
void ** end;
};
static _Unwind_Reason_Code unwindCallback(struct _Unwind_Context * context, void * arg)
{
BacktraceState * state = static_cast<BacktraceState *>(arg);
uintptr_t pc = _Unwind_GetIP(context);
if (pc) {
if (state->current == state->end) {
return _URC_END_OF_STACK;
}
else {
*state->current++ = reinterpret_cast<void *>(pc);
}
}
return _URC_NO_REASON;
}
}
// Taken from https://stackoverflow.com/a/28858941
size_t captureBacktrace(void ** buffer, size_t max)
{
BacktraceState state = { buffer, buffer + max };
_Unwind_Backtrace(unwindCallback, &state);
return state.current - buffer;
}
#include <cxxabi.h>
void dumpBacktrace(std::ostream & os, void ** buffer, size_t count)
{
os << "Call stack, last function is bottommost:\n";
size_t outputMemSize = 512;
char * outputMem = (char *)malloc(outputMemSize);
for (int idx = count - 1; idx >= 0; idx--) {
// for (size_t idx = 0; idx < count; ++idx) {
const void * addr = buffer[idx];
const char * symbol = "";
Dl_info info;
if (dladdr(addr, &info) && info.dli_sname) {
symbol = info.dli_sname;
}
memset(outputMem, 0, outputMemSize);
int status = 0;
abi::__cxa_demangle(symbol, outputMem, &outputMemSize, &status);
os << " #" << std::setw(2) << idx << ": " << addr << " " << (status == 0 ? outputMem : symbol) << "\n";
}
free(outputMem);
}
//int signalCatches[] = { SIGABRT, SIGSEGV, SIGBUS, SIGPIPE };
struct Signal {
int signalNum;
const char * signalName;
Signal(int s, const char * n) : signalNum(s), signalName(n) {}
};
static Signal signalCatches[] = {
//{SIGSEGV, "SIGSEGV" },
{SIGBUS, "SIGBUS"},
{SIGPIPE, "SIGPIPE"}
};
static void my_handler(const int code, siginfo_t * const si, void * const sc)
{
static size_t numCatches = 0;
if (++numCatches > 3) {
exit(0);
return;
}
#if DARKEDIF_MIN_LOG_LEVEL <= DARKEDIF_LOG_ERROR
const char * signalName = "Unknown";
for (size_t i = 0; i < std::size(signalCatches); i++)
{
if (signalCatches[i].signalNum == code)
{
signalName = signalCatches[i].signalName;
break;
}
}
#endif
const size_t max = 30;
void * buffer[max];
std::ostringstream oss;
dumpBacktrace(oss, buffer, captureBacktrace(buffer, max));
LOGI("%s", oss.str().c_str());
LOGE("signal code raised: %d, %s.", code, signalName);
// Breakpoint
#ifdef _DEBUG
raise(SIGTRAP);
#endif
}
static bool didSignals = false;
static void prepareSignals()
{
didSignals = true;
for (int i = 0; i < std::size(signalCatches); i++) {
struct sigaction sa;
struct sigaction sa_old;
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_sigaction = my_handler;
sa.sa_flags = SA_SIGINFO;
if (sigaction(signalCatches[i].signalNum, &sa, &sa_old) != 0) {
LOGW("Failed to set up %s sigaction.", signalCatches[i].signalName);
}
#if 0 && __ANDROID_API__ >= 28
struct sigaction64 sa64;
struct sigaction64 sa64_old;
memset(&sa64, 0, sizeof(sa64));
sigemptyset(&sa64.sa_mask);
sa.sa_sigaction = my_handler;
sa.sa_flags = SA_SIGINFO;
if (sigaction64(signalCatches[i].signalNum, &sa64, &sa64_old) != 0) {
LOGW("Failed to set up %s sigaction (64 bit).", signalCatches[i].signalName);
}
#endif
}
LOGI("Set up %zu sigactions.", std::size(signalCatches));
}
#endif // _DEBUG
// Included from root dir
#if __has_include("ExtraAndroidNatives.h")
#include <ExtraAndroidNatives.h>
#endif
#ifndef EXTRAFUNCS
#define EXTRAFUNCS /* none*/
#endif
ProjectFunc jlong conditionJump(JNIEnv*, jobject, jlong extPtr, jint cndID, CCndExtension cnd);
ProjectFunc void actionJump(JNIEnv*, jobject, jlong extPtr, jint actID, CActExtension act);
ProjectFunc void expressionJump(JNIEnv*, jobject, jlong extPtr, jint expID, CNativeExpInstance exp);
ProjectFunc jint JNICALL JNI_OnLoad(JavaVM * vm, void * reserved) {
// https://developer.android.com/training/articles/perf-jni.html#native_libraries
jint error = vm->GetEnv(reinterpret_cast<void **>(&mainThreadJNIEnv), JNI_VERSION_1_6);
if (error != JNI_OK) {
LOGF("GetEnv failed with error %d.", error);
return -1;
}
global_vm = vm;
LOGV("GetEnv OK, returned %p.", mainThreadJNIEnv);
JavaVMAttachArgs args;
args.version = JNI_VERSION_1_6; // choose your JNI version
args.name = PROJECT_NAME ", JNI_Load"; // you might want to give the java thread a name
args.group = NULL; // you might want to assign the java thread to a ThreadGroup
if ((error = vm->AttachCurrentThread(&mainThreadJNIEnv, NULL)) != JNI_OK) {
LOGF("AttachCurrentThread failed with error %d.", error);
return -1;
}
// Get jclass with mainThreadJNIEnv->FindClass.
// Register methods with mainThreadJNIEnv->RegisterNatives.
std::string classNameCRun("Extensions/" "CRun" PROJECT_NAME_UNDERSCORES);
std::string className("Extensions/" PROJECT_NAME_UNDERSCORES);
LOGV("Looking for class %s... [1/2]", classNameCRun.c_str());
jclass clazz = mainThreadJNIEnv->FindClass(classNameCRun.c_str());
if (clazz == NULL) {
LOGV("Couldn't find %s, now looking for %s... [2/2]", classNameCRun.c_str(), className.c_str());
if (mainThreadJNIEnv->ExceptionCheck()) {
mainThreadJNIEnv->ExceptionClear();
LOGV("EXCEPTION [1] %d", 0);
}
clazz = mainThreadJNIEnv->FindClass(className.c_str());
if (clazz == NULL)
{
if (mainThreadJNIEnv->ExceptionCheck()) {
mainThreadJNIEnv->ExceptionClear();
LOGV("EXCEPTION [2] %d", 0);
}
LOGF("Couldn't find class %s. Aborting load of extension.", className.c_str());
return JNI_VERSION_1_6;
}
LOGV("Found %s. [2/2]", className.c_str());
}
else
LOGV("Found %s. [1/2]", classNameCRun.c_str());
#define method(a,b) { "darkedif_" #a, b, (void *)&a }
//public native long DarkEdif_createRunObject(ByteBuffer edPtr, CCreateObjectInfo cob, int version);
static JNINativeMethod methods[] = {
method(getNumberOfConditions, "(J)I"),
method(createRunObject, "(Ljava/nio/ByteBuffer;LRunLoop/CCreateObjectInfo;I)J"),
method(destroyRunObject, "(JZ)V"),
method(handleRunObject, "(J)S"),
method(displayRunObject, "(J)S"),
method(pauseRunObject, "(J)S"),
method(continueRunObject, "(J)S"),
method(conditionJump, "(JILConditions/CCndExtension;)J"),
method(actionJump, "(JILActions/CActExtension;)V"),
method(expressionJump, "(JILExpressions/CNativeExpInstance;)V"),
EXTRAFUNCS
};
LOGV("Registering natives for %s...", PROJECT_NAME);
if (mainThreadJNIEnv->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])) < 0) {
threadEnv = mainThreadJNIEnv;
std::string excStr = GetJavaExceptionStr();
LOGF("Failed to register natives for ext %s; error %s.", PROJECT_NAME, excStr.c_str());
}
else
LOGV("Registered natives for ext %s successfully.", PROJECT_NAME);
mainThreadJNIEnv->DeleteLocalRef(clazz);
runFuncs.ext = NULL;
// could be Actions.RunLoop.CRun
runFuncs.act_getParamExpression = act_getParamExpression;
runFuncs.act_getParamExpString = act_getParamExpString;
runFuncs.act_getParamExpFloat = act_getParamExpFloat;
runFuncs.cnd_getParamExpression = cnd_getParamExpression;
runFuncs.cnd_getParamExpString = cnd_getParamExpString;
runFuncs.cnd_getParamExpFloat = cnd_getParamExpFloat;
runFuncs.exp_getParamInt = exp_getParamExpression;
runFuncs.exp_getParamString = exp_getParamExpString;
runFuncs.exp_getParamFloat = exp_getParamExpFloat;
runFuncs.exp_setReturnInt = exp_setReturnInt;
runFuncs.exp_setReturnString = exp_setReturnString;
runFuncs.exp_setReturnFloat = exp_setReturnFloat;
runFuncs.freeString = freeString;
runFuncs.generateEvent = generateEvent;
threadEnv = mainThreadJNIEnv;
#ifdef _DEBUG
if (!didSignals)
prepareSignals();
#endif
mv * mV = NULL;
if (!::SDK) {
LOGV("The SDK is being initialized.");
Edif::Init(mV, false);
}
return JNI_VERSION_1_6;
}
ProjectFunc void JNICALL JNI_OnUnload(JavaVM * vm, void * reserved)
{
LOGV("JNI_Unload.");
#ifdef _DEBUG
// Reset signals
if (didSignals)
{
for (int i = 0; i < std::size(signalCatches); i++)
signal(signalCatches[i].signalNum, SIG_DFL);
}
#endif
}
#else // iOS
#include "Extension.h"
class CValue;
// Raw creation func
ProjectFunc void PROJ_FUNC_GEN(PROJECT_NAME_RAW, _init())
{
mv * mV = NULL;
if (!::SDK) {
LOGV("The SDK is being initialized.\n");
Edif::Init(mV, false);
}
}
// Last Objective-C class was freed
ProjectFunc void PROJ_FUNC_GEN(PROJECT_NAME_RAW, _dealloc())
{
LOGV("The SDK is being freed.\n");
}
ProjectFunc int PROJ_FUNC_GEN(PROJECT_NAME_RAW, _getNumberOfConditions())
{
return CurLang["Conditions"].u.array.length;
}
ProjectFunc void * PROJ_FUNC_GEN(PROJECT_NAME_RAW, _createRunObject(void * file, int cob, int version, void * objCExtPtr))
{
EDITDATA * edPtr = (EDITDATA *)file;
LOGV("Note: objCExtPtr is %p, edPtr %p.\n", objCExtPtr, edPtr);
RuntimeFunctions * runFuncs = new RuntimeFunctions();
Extension * cppExt = new Extension(*runFuncs, (EDITDATA *)edPtr, objCExtPtr);
cppExt->Runtime.ObjectSelection.pExtension = cppExt;
return cppExt;
}
ProjectFunc short PROJ_FUNC_GEN(PROJECT_NAME_RAW, _handleRunObject)(void * cppExt)
{
return (short) ((Extension *)cppExt)->Handle();
}
ProjectFunc void PROJ_FUNC_GEN(PROJECT_NAME_RAW, _destroyRunObject)(void * cppExt, bool bFast)
{
delete ((Extension *)cppExt);
}
#endif
| 34.717897 | 196 | 0.70445 | kapigames |
e0e0326b8e88fbe029704df6b7d9dc156f55ce51 | 1,068 | cpp | C++ | FPSLighting/Dependencies/DIRECTX/Utilities/Source/Sas/stdafx.cpp | billionare/FPSLighting | c7d646f51cf4dee360dcc7c8e2fd2821b421b418 | [
"MIT"
] | 4 | 2019-12-09T05:28:04.000Z | 2021-02-18T14:05:09.000Z | FPSLighting/Dependencies/DIRECTX/Utilities/Source/Sas/stdafx.cpp | billionare/FPSLighting | c7d646f51cf4dee360dcc7c8e2fd2821b421b418 | [
"MIT"
] | null | null | null | FPSLighting/Dependencies/DIRECTX/Utilities/Source/Sas/stdafx.cpp | billionare/FPSLighting | c7d646f51cf4dee360dcc7c8e2fd2821b421b418 | [
"MIT"
] | 3 | 2018-10-22T11:45:38.000Z | 2020-04-24T19:52:47.000Z | //--------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#include "stdafx.h"
void WCharToWString( const WCHAR* source, std::wstring& dest )
{
try
{
dest = source;
}
catch( ... )
{}
}
void CharToString( const CHAR* source, std::string& dest )
{
try
{
dest = source;
}
catch( ... )
{}
}
void CharToWString( const CHAR* source, std::wstring& dest )
{
try
{
size_t size = 0;
StringCchLengthA(source, STRSAFE_MAX_CCH, &size);
size++;
WCHAR* tmp = (WCHAR*) alloca( size * sizeof(WCHAR) );
StringCchPrintfW(tmp, size, L"%S", source);
dest = tmp;
}
catch( ... )
{}
}
void WCharToString( const WCHAR* source, std::string& dest )
{
try
{
size_t size = 0;
StringCchLengthW(source, STRSAFE_MAX_CCH, &size);
size++;
CHAR* tmp = (CHAR*) alloca( size * sizeof(CHAR) );
StringCchPrintfA(tmp, size, "%S", source);
dest = tmp;
}
catch( ... )
{}
}
| 18.101695 | 88 | 0.514045 | billionare |
e0e6eb59828a6efeb85ec336ce9b9f2b9ee5c1e0 | 9,181 | cpp | C++ | Programs/UnitTests/Sources/Tests/Input/InputElementsTest.cpp | stinvi/dava.engine | 2b396ca49cdf10cdc98ad8a9ffcf7768a05e285e | [
"BSD-3-Clause"
] | 26 | 2018-09-03T08:48:22.000Z | 2022-02-14T05:14:50.000Z | Programs/UnitTests/Sources/Tests/Input/InputElementsTest.cpp | ANHELL-blitz/dava.engine | ed83624326f000866e29166c7f4cccfed1bb41d4 | [
"BSD-3-Clause"
] | null | null | null | Programs/UnitTests/Sources/Tests/Input/InputElementsTest.cpp | ANHELL-blitz/dava.engine | ed83624326f000866e29166c7f4cccfed1bb41d4 | [
"BSD-3-Clause"
] | 45 | 2018-05-11T06:47:17.000Z | 2022-02-03T11:30:55.000Z | #include "UnitTests/UnitTests.h"
#include <Input/InputElements.h>
using namespace DAVA;
DAVA_TESTCLASS (InputElementsTestClass)
{
DAVA_TEST (InputElementsMetaDataTest)
{
// Check input element info:
// - name is not empty
// - type is correct
// - Is*InputElement methods return correct values
// Keyboard
for (uint32 i = static_cast<uint32>(eInputElements::KB_FIRST); i <= static_cast<uint32>(eInputElements::KB_LAST); ++i)
{
eInputElements element = static_cast<eInputElements>(i);
InputElementInfo info = GetInputElementInfo(element);
TEST_VERIFY(!info.name.empty());
TEST_VERIFY(info.type == eInputElementTypes::DIGITAL);
TEST_VERIFY(IsKeyboardInputElement(element));
TEST_VERIFY(!IsMouseInputElement(element));
TEST_VERIFY(!IsMouseButtonInputElement(element));
TEST_VERIFY(!IsGamepadInputElement(element));
TEST_VERIFY(!IsGamepadButtonInputElement(element));
TEST_VERIFY(!IsGamepadAxisInputElement(element));
TEST_VERIFY(!IsTouchInputElement(element));
TEST_VERIFY(!IsTouchClickInputElement(element));
TEST_VERIFY(!IsTouchPositionInputElement(element));
}
// Mouse
for (uint32 i = static_cast<uint32>(eInputElements::MOUSE_FIRST_BUTTON); i <= static_cast<uint32>(eInputElements::MOUSE_LAST_BUTTON); ++i)
{
eInputElements element = static_cast<eInputElements>(i);
InputElementInfo info = GetInputElementInfo(element);
TEST_VERIFY(!info.name.empty());
TEST_VERIFY(info.type == eInputElementTypes::DIGITAL);
TEST_VERIFY(!IsKeyboardInputElement(element));
TEST_VERIFY(!IsKeyboardModifierInputElement(element));
TEST_VERIFY(!IsKeyboardSystemInputElement(element));
TEST_VERIFY(IsMouseInputElement(element));
TEST_VERIFY(IsMouseButtonInputElement(element));
TEST_VERIFY(!IsGamepadInputElement(element));
TEST_VERIFY(!IsGamepadButtonInputElement(element));
TEST_VERIFY(!IsGamepadAxisInputElement(element));
TEST_VERIFY(!IsTouchInputElement(element));
TEST_VERIFY(!IsTouchClickInputElement(element));
TEST_VERIFY(!IsTouchPositionInputElement(element));
}
InputElementInfo mouseWheelInfo = GetInputElementInfo(eInputElements::MOUSE_WHEEL);
TEST_VERIFY(!mouseWheelInfo.name.empty());
TEST_VERIFY(mouseWheelInfo.type == eInputElementTypes::ANALOG);
TEST_VERIFY(!IsKeyboardInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(!IsKeyboardModifierInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(!IsKeyboardSystemInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(IsMouseInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(!IsMouseButtonInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(!IsGamepadInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(!IsGamepadButtonInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(!IsGamepadAxisInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(!IsTouchInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(!IsTouchClickInputElement(eInputElements::MOUSE_WHEEL));
TEST_VERIFY(!IsTouchPositionInputElement(eInputElements::MOUSE_WHEEL));
InputElementInfo mousePositionInfo = GetInputElementInfo(eInputElements::MOUSE_POSITION);
TEST_VERIFY(!mousePositionInfo.name.empty());
TEST_VERIFY(mousePositionInfo.type == eInputElementTypes::ANALOG);
TEST_VERIFY(!IsKeyboardInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(!IsKeyboardModifierInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(!IsKeyboardSystemInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(IsMouseInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(!IsMouseButtonInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(!IsGamepadInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(!IsGamepadButtonInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(!IsGamepadAxisInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(!IsTouchInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(!IsTouchClickInputElement(eInputElements::MOUSE_POSITION));
TEST_VERIFY(!IsTouchPositionInputElement(eInputElements::MOUSE_POSITION));
// Gamepad
for (uint32 i = static_cast<uint32>(eInputElements::GAMEPAD_FIRST_BUTTON); i <= static_cast<uint32>(eInputElements::GAMEPAD_LAST_BUTTON); ++i)
{
eInputElements element = static_cast<eInputElements>(i);
InputElementInfo info = GetInputElementInfo(element);
TEST_VERIFY(!info.name.empty());
TEST_VERIFY(info.type == eInputElementTypes::DIGITAL);
TEST_VERIFY(!IsKeyboardInputElement(element));
TEST_VERIFY(!IsKeyboardModifierInputElement(element));
TEST_VERIFY(!IsKeyboardSystemInputElement(element));
TEST_VERIFY(!IsMouseInputElement(element));
TEST_VERIFY(!IsMouseButtonInputElement(element));
TEST_VERIFY(IsGamepadInputElement(element));
TEST_VERIFY(IsGamepadButtonInputElement(element));
TEST_VERIFY(!IsGamepadAxisInputElement(element));
TEST_VERIFY(!IsTouchInputElement(element));
TEST_VERIFY(!IsTouchClickInputElement(element));
TEST_VERIFY(!IsTouchPositionInputElement(element));
}
for (uint32 i = static_cast<uint32>(eInputElements::GAMEPAD_FIRST_AXIS); i <= static_cast<uint32>(eInputElements::GAMEPAD_LAST_AXIS); ++i)
{
eInputElements element = static_cast<eInputElements>(i);
InputElementInfo info = GetInputElementInfo(element);
TEST_VERIFY(!info.name.empty());
TEST_VERIFY(info.type == eInputElementTypes::ANALOG);
TEST_VERIFY(!IsKeyboardInputElement(element));
TEST_VERIFY(!IsKeyboardModifierInputElement(element));
TEST_VERIFY(!IsKeyboardSystemInputElement(element));
TEST_VERIFY(!IsMouseInputElement(element));
TEST_VERIFY(!IsMouseButtonInputElement(element));
TEST_VERIFY(IsGamepadInputElement(element));
TEST_VERIFY(!IsGamepadButtonInputElement(element));
TEST_VERIFY(IsGamepadAxisInputElement(element));
TEST_VERIFY(!IsTouchInputElement(element));
TEST_VERIFY(!IsTouchClickInputElement(element));
TEST_VERIFY(!IsTouchPositionInputElement(element));
}
// Touch screen
for (uint32 i = static_cast<uint32>(eInputElements::TOUCH_FIRST_CLICK); i <= static_cast<uint32>(eInputElements::TOUCH_LAST_CLICK); ++i)
{
eInputElements element = static_cast<eInputElements>(i);
InputElementInfo info = GetInputElementInfo(element);
TEST_VERIFY(!info.name.empty());
TEST_VERIFY(info.type == eInputElementTypes::DIGITAL);
TEST_VERIFY(!IsKeyboardInputElement(element));
TEST_VERIFY(!IsKeyboardModifierInputElement(element));
TEST_VERIFY(!IsKeyboardSystemInputElement(element));
TEST_VERIFY(!IsMouseInputElement(element));
TEST_VERIFY(!IsMouseButtonInputElement(element));
TEST_VERIFY(!IsGamepadInputElement(element));
TEST_VERIFY(!IsGamepadButtonInputElement(element));
TEST_VERIFY(!IsGamepadAxisInputElement(element));
TEST_VERIFY(IsTouchInputElement(element));
TEST_VERIFY(IsTouchClickInputElement(element));
TEST_VERIFY(!IsTouchPositionInputElement(element));
TEST_VERIFY(GetTouchPositionElementFromClickElement(element) == static_cast<eInputElements>(eInputElements::TOUCH_FIRST_POSITION + (i - eInputElements::TOUCH_FIRST_CLICK)));
}
for (uint32 i = static_cast<uint32>(eInputElements::TOUCH_FIRST_POSITION); i <= static_cast<uint32>(eInputElements::TOUCH_LAST_POSITION); ++i)
{
eInputElements element = static_cast<eInputElements>(i);
InputElementInfo info = GetInputElementInfo(element);
TEST_VERIFY(!info.name.empty());
TEST_VERIFY(info.type == eInputElementTypes::ANALOG);
TEST_VERIFY(!IsKeyboardInputElement(element));
TEST_VERIFY(!IsKeyboardModifierInputElement(element));
TEST_VERIFY(!IsKeyboardSystemInputElement(element));
TEST_VERIFY(!IsMouseInputElement(element));
TEST_VERIFY(!IsMouseButtonInputElement(element));
TEST_VERIFY(!IsGamepadInputElement(element));
TEST_VERIFY(!IsGamepadButtonInputElement(element));
TEST_VERIFY(!IsGamepadAxisInputElement(element));
TEST_VERIFY(IsTouchInputElement(element));
TEST_VERIFY(!IsTouchClickInputElement(element));
TEST_VERIFY(IsTouchPositionInputElement(element));
}
}
}; | 52.764368 | 185 | 0.697092 | stinvi |
e0e8493fc5c18bca91a1b5e9c7473fda9dcfbcba | 5,080 | cpp | C++ | mdsobjects/cpp/testing/MdsTreeSegments.cpp | consorzio-rfx/mdsplus | 81cdbfc759d92b101d84328e6eb7b3a6e6e22103 | [
"BSD-2-Clause"
] | null | null | null | mdsobjects/cpp/testing/MdsTreeSegments.cpp | consorzio-rfx/mdsplus | 81cdbfc759d92b101d84328e6eb7b3a6e6e22103 | [
"BSD-2-Clause"
] | null | null | null | mdsobjects/cpp/testing/MdsTreeSegments.cpp | consorzio-rfx/mdsplus | 81cdbfc759d92b101d84328e6eb7b3a6e6e22103 | [
"BSD-2-Clause"
] | null | null | null | /*
Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <mdsobjects.h>
#include <treeshr.h>
#include "testing.h"
#include "testutils/unique_ptr.h"
#include "testutils/String.h"
//#include "mdsplus/AutoPointer.hpp"
#ifdef _WIN32
#include <windows.h>
#define setenv(name,val,extra) _putenv_s(name,val)
#endif
using namespace testing;
using namespace MDSplus;
#define TEST_SEGMENT_FLOAT(node,seg,test) do{\
unique_ptr<Array> signal = node->getSegment(seg);\
int length = 0;\
float* array = signal->getFloatArray(&length);\
try{\
for (int i = 0 ; i<length ; i++)\
if (!(test)) TEST1(test);\
} catch (MDSplus::MdsException) {\
delete[] array;\
throw;\
}\
delete[] array;\
}while(0);
void putSegment(){
float times[1000];
float data[1000];
for(int i = 0; i < 1000; i++){
times[i] = i*100;
data[i] = i*10;
}
{
unique_ptr<Tree> t = new MDSplus::Tree("t_treeseg",1,"NEW");
unique_ptr<TreeNode> n[] = {t->addNode("PS0","SIGNAL"),t->addNode("PS1","SIGNAL")};
{
unique_ptr<Float32Array> dim = new MDSplus::Float32Array(times, 1000);
unique_ptr<Array> dat = (MDSplus::Array*)MDSplus::execute("ZERO([1000],1e0)");
unique_ptr<Float32> start = new MDSplus::Float32(0);
unique_ptr<Float32> end = new MDSplus::Float32(999);
n[0]->beginSegment(start, end, dim, dat);
n[1]->beginSegment(start, end, dim, dat);
}
TEST_SEGMENT_FLOAT(n[0],0,array[i]==0.);
TEST_SEGMENT_FLOAT(n[1],0,array[i]==0.);
for(int i = 0; i < 10; i++){
unique_ptr<Float32Array> chunk = new MDSplus::Float32Array(&data[i*100], 100);
n[0]->putSegment(chunk, -1);
n[1]->putSegment(chunk, -1);
}
TEST_SEGMENT_FLOAT(n[0],0,array[i]==data[i]);
TEST_SEGMENT_FLOAT(n[1],0,array[i]==data[i]);
}
}
void BlockAndRows(){
unique_ptr<Tree> t = new MDSplus::Tree("t_treeseg",1,"NEW");
unique_ptr<TreeNode> n = t->addNode("BAR","SIGNAL");
t->write();
{
int d[2] = {0,7}; unique_ptr<Int32Array> s = new Int32Array(d,2);
n->beginTimestampedSegment(s);
}
TEST1(AutoString(unique_ptr<Data>(n->getData())->decompile()).string == "Build_Signal(0, [], *, [])");
// beginning adding row increments next_row to 1
{
int d[1] = {1}; unique_ptr<Int32Array> s = new Int32Array(d,1);
int64_t t= -1;
n->putRow(s,&t,10);
}
TEST1(AutoString(unique_ptr<Data>(n->getData() )->decompile()).string == "Build_Signal(0, [1], *, [-1Q])");
TEST1(AutoString(unique_ptr<Data>(n->getSegment(0))->decompile()).string == "[1]");
/**************************************************************
beginning a new block set next_row back to 0 of the new block
the previous block is assumed to be full as the tailing zero could be valid data
**************************************************************/
{
int d[2] = {0,0}; unique_ptr<Int32Array> s = new Int32Array(d,2);
n->beginTimestampedSegment(s);
}
TEST1(AutoString(unique_ptr<Data>(n->getData() )->decompile()).string == "Build_Signal(0, [1,7], *, [-1Q,0Q])");
TEST1(AutoString(unique_ptr<Data>(n->getSegment(0))->decompile()).string == "[1,7]");
n->setSegmentScale(unique_ptr<Data>(compile("$VALUE*2")));
TEST1(AutoString(unique_ptr<Data>(n->getSegmentScale())->decompile()).string == "$VALUE * 2");
TEST1(AutoString(unique_ptr<Data>(n->getData() )->decompile()).string == "Build_Signal(0, $VALUE * 2, [1,7], [-1Q,0Q])");
std::vector<int> data = n->getIntArray();
TEST1(data[0]==2);
TEST1(data[1]==14);
}
#define TEST(prcedure) do{BEGIN_TESTING(prcedure); prcedure(); END_TESTING;}while(0)
int main(int argc UNUSED_ARGUMENT, char *argv[] UNUSED_ARGUMENT){
setenv("t_treeseg_path",".",1);
TEST(putSegment);
TEST(BlockAndRows);
}
| 39.076923 | 126 | 0.661024 | consorzio-rfx |
e0ea37e560cf150fa90595c4193512718d085dac | 2,457 | cpp | C++ | src/Spanish/parse/es_LanguageSpecificFunctions.cpp | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | 1 | 2022-03-24T19:57:00.000Z | 2022-03-24T19:57:00.000Z | src/Spanish/parse/es_LanguageSpecificFunctions.cpp | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | src/Spanish/parse/es_LanguageSpecificFunctions.cpp | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | // Copyright 2008 by BBN Technologies Corp.
// All Rights Reserved.
#include "Generic/common/leak_detection.h"
#include "Spanish/parse/es_LanguageSpecificFunctions.h"
#include <boost/algorithm/string.hpp>
#include "Spanish/parse/es_STags.h"
bool SpanishLanguageSpecificFunctions::isHyphen(Symbol sym) {
return false;
}
bool SpanishLanguageSpecificFunctions::isBasicPunctuationOrConjunction(Symbol sym){
return false;
}
bool SpanishLanguageSpecificFunctions::isNoCrossPunctuation(Symbol sym){
return false;
}
bool SpanishLanguageSpecificFunctions::isSentenceEndingPunctuation(Symbol sym){
return false;
}
bool SpanishLanguageSpecificFunctions::isNPtypeLabel(Symbol sym){
return false;
}
bool SpanishLanguageSpecificFunctions::isPPLabel(Symbol sym){
return false;
}
Symbol SpanishLanguageSpecificFunctions::getNPlabel(){
return SpanishSTags::SN;
}
Symbol SpanishLanguageSpecificFunctions::getNameLabel(){
// JD 2015-08-04 - JSerif/Metro parser do not reimplement the name constraints
// changing the Spanish name label is a partial workaround
return SpanishSTags::SN;
}
Symbol SpanishLanguageSpecificFunctions::getCoreNPlabel(){
return SpanishSTags::NPA;
}
Symbol SpanishLanguageSpecificFunctions::getDateLabel(){
return SpanishSTags::POS_W;
}
Symbol SpanishLanguageSpecificFunctions::getProperNounLabel(){
return SpanishSTags::POS_NP;
}
bool SpanishLanguageSpecificFunctions::isCoreNPLabel(Symbol sym){
return false;
}
bool SpanishLanguageSpecificFunctions::isPrimaryNamePOStag(Symbol sym, EntityType type){
return false;
}
bool SpanishLanguageSpecificFunctions::isSecondaryNamePOStag(Symbol sym, EntityType type){
return false;
}
Symbol SpanishLanguageSpecificFunctions::getDefaultNamePOStag(EntityType type){
return SpanishSTags::POS_NP;
}
bool SpanishLanguageSpecificFunctions::isNPtypePOStag(Symbol sym){
return false;
}
Symbol SpanishLanguageSpecificFunctions::getSymbolForParseNodeLeaf(Symbol sym){
std::wstring str = sym.to_string();
boost::to_lower(str);
// If any parens made it this far, then quote them now. This can
// happen eg if our input tokenization contains URLs with URLs in
// them.
boost::replace_all(str, L"(", L"-LRB-");
boost::replace_all(str, L")", L"-RRB-");
return Symbol(str.c_str());
}
bool SpanishLanguageSpecificFunctions::matchesHeadToken(Mention *, CorrectMention *){
return false;
}
bool SpanishLanguageSpecificFunctions::matchesHeadToken(const SynNode *, CorrectMention *){
return false;
}
| 32.328947 | 91 | 0.805861 | BBN-E |
e0ea8b5b01f63dfd10394f0d39e0a8d94d9b14d5 | 508 | cpp | C++ | AtCoder/ABC125/b.cpp | Takumi1122/data-structure-algorithm | 6b9f26e4dbba981f034518a972ecfc698b86d837 | [
"MIT"
] | null | null | null | AtCoder/ABC125/b.cpp | Takumi1122/data-structure-algorithm | 6b9f26e4dbba981f034518a972ecfc698b86d837 | [
"MIT"
] | null | null | null | AtCoder/ABC125/b.cpp | Takumi1122/data-structure-algorithm | 6b9f26e4dbba981f034518a972ecfc698b86d837 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n;
cin >> n;
vector<int> v(n), c(n);
rep(i, n) cin >> v[i];
rep(i, n) cin >> c[i];
int ans = 0;
for (int bit = 0; bit < (1 << n); ++bit) {
int x = 0;
int y = 0;
rep(i, n) {
if (bit & (1 << i)) {
x += v[i];
y += c[i];
}
}
ans = max(ans, x - y);
}
cout << ans << endl;
return 0;
} | 17.517241 | 47 | 0.425197 | Takumi1122 |
e0eb150b8316e273ce6b4d734e2898eb11eeb905 | 114 | cpp | C++ | 07_class_multiples/shooter.cpp | acc-cosc-1337-spring-2019/midterm-spring-2019-rdawson210 | 04d3f6b7cf8313fb0e08f9e18b760ddce097fee8 | [
"MIT"
] | null | null | null | 07_class_multiples/shooter.cpp | acc-cosc-1337-spring-2019/midterm-spring-2019-rdawson210 | 04d3f6b7cf8313fb0e08f9e18b760ddce097fee8 | [
"MIT"
] | null | null | null | 07_class_multiples/shooter.cpp | acc-cosc-1337-spring-2019/midterm-spring-2019-rdawson210 | 04d3f6b7cf8313fb0e08f9e18b760ddce097fee8 | [
"MIT"
] | null | null | null | #include "shooter.h"
Roll Shooter::shoot(Die & d1, Die & d2)
{
Roll game(d1, d2);
game.roll();
return game;
}
| 12.666667 | 39 | 0.622807 | acc-cosc-1337-spring-2019 |
e0ee7e5787f6e47fc5429ab26cc97790f25e900a | 5,883 | cpp | C++ | thirdparty/DecompROS/decomp_ros_utils/src/polyhedron_array_display.cpp | shubham-shahh/mader | 7cbe46438b348a1ad9545146734083d0b6436bd4 | [
"BSD-3-Clause"
] | 489 | 2020-03-19T15:48:17.000Z | 2022-03-31T08:22:55.000Z | thirdparty/DecompROS/decomp_ros_utils/src/polyhedron_array_display.cpp | shubham-shahh/mader | 7cbe46438b348a1ad9545146734083d0b6436bd4 | [
"BSD-3-Clause"
] | 37 | 2020-05-08T13:51:32.000Z | 2022-02-16T07:43:21.000Z | thirdparty/DecompROS/decomp_ros_utils/src/polyhedron_array_display.cpp | shubham-shahh/mader | 7cbe46438b348a1ad9545146734083d0b6436bd4 | [
"BSD-3-Clause"
] | 116 | 2020-03-19T20:37:44.000Z | 2022-03-30T03:51:21.000Z | #include "polyhedron_array_display.h"
namespace decomp_rviz_plugins {
PolyhedronArrayDisplay::PolyhedronArrayDisplay() {
mesh_color_property_ =
new rviz::ColorProperty("MeshColor", QColor(0, 170, 255), "Mesh color.",
this, SLOT(updateMeshColorAndAlpha()));
bound_color_property_ =
new rviz::ColorProperty("BoundColor", QColor(255, 0, 0), "Bound color.",
this, SLOT(updateBoundColorAndAlpha()));
alpha_property_ = new rviz::FloatProperty(
"Alpha", 0.2,
"0 is fully transparent, 1.0 is fully opaque, only affect mesh", this,
SLOT(updateMeshColorAndAlpha()));
scale_property_ = new rviz::FloatProperty("Scale", 0.1, "bound scale.", this,
SLOT(updateScale()));
vs_scale_property_ = new rviz::FloatProperty("VsScale", 1.0, "Vs scale.", this,
SLOT(updateVsScale()));
vs_color_property_ =
new rviz::ColorProperty("VsColor", QColor(0, 255, 0), "Vs color.",
this, SLOT(updateVsColorAndAlpha()));
state_property_ = new rviz::EnumProperty(
"State", "Mesh", "A Polygon can be represented as two states: Mesh and "
"Bound, this option allows selecting visualizing Polygon"
"in corresponding state",
this, SLOT(updateState()));
state_property_->addOption("Mesh", 0);
state_property_->addOption("Bound", 1);
state_property_->addOption("Both", 2);
state_property_->addOption("Vs", 3);
}
void PolyhedronArrayDisplay::onInitialize() { MFDClass::onInitialize(); }
PolyhedronArrayDisplay::~PolyhedronArrayDisplay() {}
void PolyhedronArrayDisplay::reset() {
MFDClass::reset();
visual_mesh_ = nullptr;
visual_bound_ = nullptr;
visual_vector_ = nullptr;
}
void PolyhedronArrayDisplay::processMessage(const decomp_ros_msgs::PolyhedronArray::ConstPtr &msg) {
if (!context_->getFrameManager()->getTransform(
msg->header.frame_id, msg->header.stamp, position_, orientation_)) {
ROS_DEBUG("Error transforming from frame '%s' to frame '%s'",
msg->header.frame_id.c_str(), qPrintable(fixed_frame_));
return;
}
vertices_.clear();
vs_.clear();
const auto polys = DecompROS::ros_to_polyhedron_array(*msg);
for(const auto& polyhedron: polys){
vec_E<vec_Vec3f> bds = cal_vertices(polyhedron);
vertices_.insert(vertices_.end(), bds.begin(), bds.end());
const auto vs = polyhedron.cal_normals();
vs_.insert(vs_.end(), vs.begin(), vs.end());
}
int state = state_property_->getOptionInt();
visualizeMessage(state);
}
void PolyhedronArrayDisplay::visualizeMesh() {
std::shared_ptr<MeshVisual> visual_mesh;
visual_mesh.reset(new MeshVisual(context_->getSceneManager(), scene_node_));
visual_mesh->setMessage(vertices_);
visual_mesh->setFramePosition(position_);
visual_mesh->setFrameOrientation(orientation_);
float alpha = alpha_property_->getFloat();
Ogre::ColourValue color = mesh_color_property_->getOgreColor();
visual_mesh->setColor(color.r, color.g, color.b, alpha);
visual_mesh_ = visual_mesh;
}
void PolyhedronArrayDisplay::visualizeBound() {
std::shared_ptr<BoundVisual> visual_bound;
visual_bound.reset(new BoundVisual(context_->getSceneManager(), scene_node_));
visual_bound->setMessage(vertices_);
visual_bound->setFramePosition(position_);
visual_bound->setFrameOrientation(orientation_);
Ogre::ColourValue color = bound_color_property_->getOgreColor();
visual_bound->setColor(color.r, color.g, color.b, 1.0);
float scale = scale_property_->getFloat();
visual_bound->setScale(scale);
visual_bound_ = visual_bound;
}
void PolyhedronArrayDisplay::visualizeVs() {
std::shared_ptr<VectorVisual> visual_vector;
visual_vector.reset(new VectorVisual(context_->getSceneManager(), scene_node_));
visual_vector->setMessage(vs_);
visual_vector->setFramePosition(position_);
visual_vector->setFrameOrientation(orientation_);
Ogre::ColourValue color = vs_color_property_->getOgreColor();
visual_vector->setColor(color.r, color.g, color.b, 1.0);
visual_vector_ = visual_vector;
}
void PolyhedronArrayDisplay::visualizeMessage(int state) {
switch (state) {
case 0:
visual_bound_ = nullptr;
visual_vector_ = nullptr;
visualizeMesh();
break;
case 1:
visual_mesh_ = nullptr;
visual_vector_ = nullptr;
visualizeBound();
break;
case 2:
visual_vector_ = nullptr;
visualizeMesh();
visualizeBound();
break;
case 3:
visualizeVs();
break;
default:
std::cout << "Invalid State: " << state << std::endl;
}
}
void PolyhedronArrayDisplay::updateMeshColorAndAlpha() {
float alpha = alpha_property_->getFloat();
Ogre::ColourValue color = mesh_color_property_->getOgreColor();
if(visual_mesh_)
visual_mesh_->setColor(color.r, color.g, color.b, alpha);
}
void PolyhedronArrayDisplay::updateBoundColorAndAlpha() {
Ogre::ColourValue color = bound_color_property_->getOgreColor();
if(visual_bound_)
visual_bound_->setColor(color.r, color.g, color.b, 1.0);
}
void PolyhedronArrayDisplay::updateState() {
int state = state_property_->getOptionInt();
visualizeMessage(state);
}
void PolyhedronArrayDisplay::updateScale() {
float s = scale_property_->getFloat();
if(visual_bound_)
visual_bound_->setScale(s);
}
void PolyhedronArrayDisplay::updateVsScale() {
float s = vs_scale_property_->getFloat();
if(visual_vector_)
visual_vector_->setScale(s);
}
void PolyhedronArrayDisplay::updateVsColorAndAlpha() {
Ogre::ColourValue color = vs_color_property_->getOgreColor();
if(visual_vector_)
visual_vector_->setColor(color.r, color.g, color.b, 1);
}
}
#include <pluginlib/class_list_macros.h>
PLUGINLIB_EXPORT_CLASS(decomp_rviz_plugins::PolyhedronArrayDisplay, rviz::Display)
| 31.459893 | 100 | 0.703383 | shubham-shahh |
e0eef3ab40709c83448df1a7057ef93e6a255e5f | 945 | cpp | C++ | src/outils/couleur.cpp | SaladTomatOignon/RayTracing | 8e9db4d8254fb2c1ceaae9ce993c279efb063815 | [
"MIT"
] | null | null | null | src/outils/couleur.cpp | SaladTomatOignon/RayTracing | 8e9db4d8254fb2c1ceaae9ce993c279efb063815 | [
"MIT"
] | null | null | null | src/outils/couleur.cpp | SaladTomatOignon/RayTracing | 8e9db4d8254fb2c1ceaae9ce993c279efb063815 | [
"MIT"
] | null | null | null | #include "../../include/outils/couleur.h"
#include <algorithm>
using namespace std;
Couleur::Couleur() : Couleur(0, 0, 0) {
}
Couleur::Couleur(double r, double g, double b) {
this->r = r;
this->g = g;
this->b = b;
}
Couleur::Couleur(const Couleur& couleur) : Couleur(couleur.r, couleur.g, couleur.b) {
}
Couleur::~Couleur() {
}
Couleur Couleur::operator*(const double& reel) {
return Couleur(r*reel, g*reel, b*reel);
}
Couleur Couleur::operator*(const Couleur& autre) {
return Couleur(r * autre.r, g * autre.g, b * autre.b);
}
Couleur Couleur::operator+(const Couleur& autre) {
return Couleur(r + autre.r, g + autre.g, b + autre.b);
}
Couleur Couleur::operator/(const double& reel) {
return Couleur(r / reel, g / reel, b / reel);
}
Couleur Couleur::clamp() {
double rClamp = min(r, 1.0);
double gClamp = min(g, 1.0);
double bClamp = min(b, 1.0);
return Couleur(rClamp, gClamp, bClamp);
} | 20.543478 | 85 | 0.630688 | SaladTomatOignon |
e0f022253db2213e5cee83170c534bb5a71a88cd | 2,927 | hpp | C++ | RobWork/src/rw/kinematics/StateCache.hpp | ZLW07/RobWork | e713881f809d866b9a0749eeb15f6763e64044b3 | [
"Apache-2.0"
] | 1 | 2021-12-29T14:16:27.000Z | 2021-12-29T14:16:27.000Z | RobWork/src/rw/kinematics/StateCache.hpp | ZLW07/RobWork | e713881f809d866b9a0749eeb15f6763e64044b3 | [
"Apache-2.0"
] | null | null | null | RobWork/src/rw/kinematics/StateCache.hpp | ZLW07/RobWork | e713881f809d866b9a0749eeb15f6763e64044b3 | [
"Apache-2.0"
] | null | null | null | /********************************************************************************
* Copyright 2009 The Robotics Group, The Maersk Mc-Kinney Moller Institute,
* Faculty of Engineering, University of Southern Denmark
*
* 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 RW_KINEMATICS_STATECACHE_HPP
#define RW_KINEMATICS_STATECACHE_HPP
/**
@file StateCache.hpp
*/
#if !defined(SWIG)
#include <rw/core/Ptr.hpp>
#endif
namespace rw { namespace kinematics {
/** @addtogroup kinematics */
/*@{*/
/**
* @brief the basic building block for the stateless desing using
* the StateStructure class. A StateCache represents a size,
* a unique id, and a unique name, when inserted into the StateStructure.
* The size will allocate "size"-doubles in State objects originating from the
* StateStructure.
*/
class StateCache
{
public:
//! Smart pointer type
typedef rw::core::Ptr< StateCache > Ptr;
/**
* @brief destructor
*/
virtual ~StateCache (){};
/**
* @brief An integer ID for the StateCache.
*
* IDs are assigned to the state data upon insertion State.
* StateCache that are not in a State have an ID of -1.
*
* StateCache present in different trees may have identical IDs.
*
* IDs are used for the efficient implementation of State. Normally,
* you should not make use of frame IDs yourself.
*
* @return An integer ID for the frame.
*/
// inline int getID() const { return _id; }
/**
* @brief The number of doubles allocated by this StateCache in
* each State object.
*
* @return The number of doubles allocated by the StateCache
*/
virtual size_t size () const = 0;
/**
* @brief this creates a deep copy of this cache
*/
virtual rw::core::Ptr< StateCache > clone () const = 0;
protected:
StateCache (){};
// StateCache should not be copied by other than its inherited class.
// StateCache(const StateCache&);
// StateCache& operator=(const StateCache&);
private:
};
/*@}*/
}} // namespace rw::kinematics
#endif /*RW_KINEMATICS_STATEDATA_HPP*/
| 32.522222 | 82 | 0.59549 | ZLW07 |
e0f8668c2635ebda6d94fd5bfcc97b09b9f01f0c | 5,932 | cpp | C++ | distributed-implementation/legacy-first-attempt/MctsTreeMerger.cpp | AleksanderGondek/GUT_Manycore_Architectures_MCTS | 43607dff9cee76f9a686c56e481ce1a70ad831b7 | [
"Apache-2.0"
] | 2 | 2016-12-29T22:58:49.000Z | 2018-09-17T17:15:06.000Z | distributed-implementation/legacy-first-attempt/MctsTreeMerger.cpp | AleksanderGondek/GUT_Manycore_Architectures_MCTS | 43607dff9cee76f9a686c56e481ce1a70ad831b7 | [
"Apache-2.0"
] | null | null | null | distributed-implementation/legacy-first-attempt/MctsTreeMerger.cpp | AleksanderGondek/GUT_Manycore_Architectures_MCTS | 43607dff9cee76f9a686c56e481ce1a70ad831b7 | [
"Apache-2.0"
] | null | null | null | //
// Created by agondek on 12/6/15.
//
#include <algorithm>
#include <vector>
#include "MctsTreeMerger.h"
//tmp
#include <mpi.h>
void BalanceNodes(MctsNode* local, MctsNode* remote)
{
//std::cout << "Balacing the following nodes" << std::endl;
//std::cout << "Local node: " << local->representation() << std::endl;
//std::cout << "Remote node: " << remote->representation() << std::endl;
//std::cout << "Balacing wins" << std::endl;
// int winsDelta = local->wins - remote->wins;
// if(winsDelta > 0)
// {
// // If remote has less wins in this node, adjust this nodes wins down
// local->wins -= winsDelta;
// }
// else if (winsDelta < 0)
// {
// // IF remote has more wins in this node, adjust this node wins up
// local->wins += winsDelta;
// }
//
//
// int visitsDelta = local->visits - remote->visits;
// if(visitsDelta > 0)
// {
// // If remote has less wins in this node, adjust this nodes wins down
// local->visits -= visitsDelta;
// }
// else if (visitsDelta < 0)
// {
// // IF remote has more wins in this node, adjust this node wins up
// local->visits += visitsDelta;
// }
local->wins += remote->wins;
//std::cout << "Balacing visits" << std::endl;
local->visits += remote->visits;
// Get the rank of the process
// int world_rank;
// MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
// if((local->wins < 0 || local->visits < 0) && world_rank == 0)
// {
// std::cout << "ERROR BALANCING NODES" << std::endl;
// std::cout << "Local node: " << local->representation() << std::endl;
// std::cout << "Remote node: " << remote->representation() << std::endl;
// }
//std::cout << "Balancing actions not taken" << std::endl;
// Compare actions not taken
// If remote has no actions taken and locally we have some left
if(remote->actionsNotTaken.size() == 0 && local->actionsNotTaken.size() > 0)
{
local->actionsNotTaken.clear();
}
// If remote has some actions taken and we have none left
else if(remote->actionsNotTaken.size() > 0 && local->actionsNotTaken.size() == 0)
{
;
// NOOP
}
// If remote and local differs but none are empty
else if (remote->actionsNotTaken.size() > 0 && local->actionsNotTaken.size() > 0 &&
remote->actionsNotTaken.size() != local->actionsNotTaken.size())
{
//std::cout << "Started comparistion of actions not taken" << std::endl;
// We should ignore actions that we don't have but remote has
// But we should remove actions that remote has not and we do
std::vector<int>::iterator it = local->actionsNotTaken.begin();
std::vector<int> toBeRemoved;
while(it != local->actionsNotTaken.end())
{
////std::cout << "Checking remote: " << *it << std::endl;
if(std::find(remote->actionsNotTaken.begin(), remote->actionsNotTaken.end(), *it) == remote->actionsNotTaken.end())
{
if(*it == 0)
{
continue;
}
toBeRemoved.push_back(*it);
}
++it;
}
for(std::vector<int>::iterator removeIt = toBeRemoved.begin(); removeIt != toBeRemoved.end(); ++removeIt)
{
local->actionsNotTaken.erase(std::remove(
local->actionsNotTaken.begin(),
local->actionsNotTaken.end(),
*removeIt),
local->actionsNotTaken.end());
}
}
//std::cout << "Balacing children nodes" << std::endl;
// Merge all remote children
std::vector<MctsNode>::iterator it = remote->childNodes.begin();
while(it != remote->childNodes.end())
{
// Find same node in the local children
MctsNode* foundElement = NULL;
for(std::vector<MctsNode>::iterator localIt = local->childNodes.begin(); localIt != local->childNodes.end(); ++localIt)
{
if(localIt->previousAction == it->previousAction)
{
foundElement = &(*localIt);
break;
}
}
// If child was found
if(foundElement != NULL)
{
BalanceNodes(foundElement, &(*it));
}
//Child was not found
else
{
MctsNode remoteNewNode = *it;
MctsNode newNode(remoteNewNode.previousAction, local, NULL);
MctsNode* newNodePtr = &newNode;
newNode.lastActivePlayer = 0;
newNode.actionsNotTaken = remoteNewNode.actionsNotTaken;
// Remove action from possible actions
local->actionsNotTaken.erase(std::remove(local->actionsNotTaken.begin(),
local->actionsNotTaken.end(),
remoteNewNode.previousAction),
local->actionsNotTaken.end());
// Add node
local->childNodes.push_back(newNode);
// Recursive
BalanceNodes(newNodePtr, &remoteNewNode);
}
++it;
}
}
void MctsTreeMerger::MergeTrees(MctsNode *local, MctsNode *remote)
{
int world_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
if((local->wins < 0 || local->visits < 0 || remote->wins < 0 || remote->visits <0 ) && world_rank == 0)
{
std::cout << "ERROR BALANCING NODES" << std::endl;
std::cout << "Local node: " << local->representation() << std::endl;
std::cout << "Remote node: " << remote->representation() << std::endl;
}
MctsNode* localRoot = local;
MctsNode* remoteRoot = remote;
BalanceNodes(localRoot, remoteRoot);
}
| 35.100592 | 127 | 0.540121 | AleksanderGondek |
e0f8f0dc7c57c6afd4d0e07602681e3c1c61dbeb | 4,725 | hpp | C++ | Sources/ParameterSpaces/b_spline_basis_function.hpp | j042/SplineLib | db92df816b9af44f2d4f4275897f9ed3341a6646 | [
"MIT"
] | null | null | null | Sources/ParameterSpaces/b_spline_basis_function.hpp | j042/SplineLib | db92df816b9af44f2d4f4275897f9ed3341a6646 | [
"MIT"
] | null | null | null | Sources/ParameterSpaces/b_spline_basis_function.hpp | j042/SplineLib | db92df816b9af44f2d4f4275897f9ed3341a6646 | [
"MIT"
] | null | null | null | /* Copyright (c) 2018–2021 SplineLib
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef SOURCES_PARAMETERSPACES_B_SPLINE_BASIS_FUNCTION_HPP_
#define SOURCES_PARAMETERSPACES_B_SPLINE_BASIS_FUNCTION_HPP_
#include <array>
#include <memory>
#include <vector>
#include "Sources/ParameterSpaces/knot_vector.hpp"
#include "Sources/Utilities/named_type.hpp"
namespace splinelib::sources::parameter_spaces {
// BSplineBasisFunctions N_{i,p} are non-negative, piecewise polynomial functions of degree p forming a basis of the
// vector space of all piecewise polynomial functions of degree p corresponding to some knot vector. The B-spline basis
// functions have local support only and form a partition of unity. Actual implementations for evaluating them (as well
// as their derivatives) on their support are (Non)ZeroDegreeBSplineBasisFunctions.
//
// Example (see NURBS book Exa. 2.1):
// KnotVector::Knot_ const k0_0{0.0}, k1_0{1.0};
// KnotVector const kKnotVector{k0_0, k0_0, k0_0, k1_0, k1_0, k1_0};
// ParametricCoordinate const k0_25{0.25};
// BSplineBasisFunction const * const basis_function_2_0{CreateDynamic(kKnotVector, KnotSpan{2}, Degree{})},
// * const basis_function_0_2{CreateDynamic(kKnotVector, KnotSpan{}, Degree{2})};
// BSplineBasisFunctions::Type_ const &evaluated_2_0 = (*basis_function_2_0)(k0_25), // N_{2,0}(0.25) = 1.0.
// const &evaluated_0_2 = (*basis_function_0_2)(k0_25); // N_{0,2}(0.25) = 0.5625.
class BSplineBasisFunction {
public:
using Type_ = ParametricCoordinate::Type_;
static BSplineBasisFunction * CreateDynamic(KnotVector const &knot_vector, KnotSpan const &start_of_support,
Degree degree, Tolerance const &tolerance = kEpsilon);
virtual ~BSplineBasisFunction() = default;
// Comparison based on tolerance.
friend bool IsEqual(BSplineBasisFunction const &lhs, BSplineBasisFunction const &rhs, Tolerance const &tolerance);
// Comparison based on numeric_operations::GetEpsilon<Tolerance>().
friend bool operator==(BSplineBasisFunction const &lhs, BSplineBasisFunction const &rhs);
virtual Type_ operator()(ParametricCoordinate const ¶metric_coordinate, Tolerance const &tolerance = kEpsilon)
const = 0;
virtual Type_ operator()(ParametricCoordinate const ¶metric_coordinate, Derivative const &derivative,
Tolerance const &tolerance = kEpsilon) const = 0;
protected:
BSplineBasisFunction() = default;
BSplineBasisFunction(KnotVector const &knot_vector, KnotSpan const &start_of_support, Degree degree,
Tolerance const &tolerance = kEpsilon);
BSplineBasisFunction(BSplineBasisFunction const &other) = default;
BSplineBasisFunction(BSplineBasisFunction &&other) noexcept = default;
BSplineBasisFunction & operator=(BSplineBasisFunction const &rhs) = default;
BSplineBasisFunction & operator=(BSplineBasisFunction &&rhs) noexcept = default;
// The last knot is treated in a special way (cf. KnotVector::FindSpan).
bool IsInSupport(ParametricCoordinate const ¶metric_coordinate, Tolerance const &tolerance = kEpsilon) const;
Degree degree_;
ParametricCoordinate start_knot_, end_knot_;
bool end_knot_equals_last_knot_;
};
bool IsEqual(BSplineBasisFunction const &lhs, BSplineBasisFunction const &rhs, Tolerance const &tolerance = kEpsilon);
bool operator==(BSplineBasisFunction const &lhs, BSplineBasisFunction const &rhs);
template<int parametric_dimensionality>
using BSplineBasisFunctions = std::array<std::vector<std::shared_ptr<BSplineBasisFunction>>, parametric_dimensionality>;
} // namespace splinelib::sources::parameter_spaces
#endif // SOURCES_PARAMETERSPACES_B_SPLINE_BASIS_FUNCTION_HPP_
| 55.588235 | 120 | 0.773122 | j042 |
803d6b1ca16ab147a4f4264f3eb90e79c117f22e | 2,131 | cpp | C++ | mockcpp/src/TypelessConstraintAdapter.cpp | danncy/authz | 489e37ed2b270272bca3ed8ca915d271af3d1886 | [
"Apache-2.0"
] | 1 | 2020-02-06T07:10:19.000Z | 2020-02-06T07:10:19.000Z | mockcpp/src/TypelessConstraintAdapter.cpp | danncy/authz | 489e37ed2b270272bca3ed8ca915d271af3d1886 | [
"Apache-2.0"
] | null | null | null | mockcpp/src/TypelessConstraintAdapter.cpp | danncy/authz | 489e37ed2b270272bca3ed8ca915d271af3d1886 | [
"Apache-2.0"
] | null | null | null | /***
mockcpp is a generic C/C++ mock framework.
Copyright (C) <2009> <Darwin Yuan: darwin.yuan@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include <mockcpp/TypelessConstraintAdapter.h>
#include <mockcpp/TypelessConstraint.h>
MOCKCPP_NS_START
//////////////////////////////////////////////////////////////////////////
struct TypelessConstraintAdapterImpl
{
TypelessConstraint* typelessConstraint;
TypelessConstraintAdapterImpl(TypelessConstraint* c)
: typelessConstraint(c)
{}
~TypelessConstraintAdapterImpl()
{
delete typelessConstraint;
}
};
//////////////////////////////////////////////////////////////////////////
TypelessConstraintAdapter::TypelessConstraintAdapter(TypelessConstraint* tc)
: This(new TypelessConstraintAdapterImpl(tc))
{
}
//////////////////////////////////////////////////////////////////////////
TypelessConstraintAdapter::~TypelessConstraintAdapter()
{
delete This;
}
//////////////////////////////////////////////////////////////////////////
bool
TypelessConstraintAdapter::eval(const RefAny& p) const
{
return This->typelessConstraint->eval();
}
//////////////////////////////////////////////////////////////////////////
TypelessConstraint*
TypelessConstraintAdapter::getAdaptedConstraint() const
{
return This->typelessConstraint;
}
//////////////////////////////////////////////////////////////////////////
std::string TypelessConstraintAdapter::toString() const
{
return This->typelessConstraint->toString();
}
MOCKCPP_NS_END
| 29.597222 | 76 | 0.602065 | danncy |
803f55a16f408b27b74d9a9bbc2bff44b2b0ebf6 | 1,403 | cpp | C++ | src/CustomThrow.cpp | terickson87/CustomThrow | 542c727cef75c96da57f6cfc2df8eed6ca40ae9e | [
"MIT"
] | null | null | null | src/CustomThrow.cpp | terickson87/CustomThrow | 542c727cef75c96da57f6cfc2df8eed6ca40ae9e | [
"MIT"
] | null | null | null | src/CustomThrow.cpp | terickson87/CustomThrow | 542c727cef75c96da57f6cfc2df8eed6ca40ae9e | [
"MIT"
] | null | null | null |
#include "CustomThrow.h"
CustomThrow::CustomThrow(const std::string& message, const std::string& fileName, unsigned int fileLineNumber)
: m_Message(message), m_FileName(fileName), m_FileLineNumber(fileLineNumber), m_FullMessage("") {
this->buildFullMessage();
}
CustomThrow::CustomThrow(const char* message, const std::string& fileName, unsigned int fileLineNumber)
: m_Message(message), m_FileName(fileName), m_FileLineNumber(fileLineNumber), m_FullMessage("") {
this->buildFullMessage();
}
CustomThrow::CustomThrow(const std::string& message, const char* fileName, unsigned int fileLineNumber)
: m_Message(message), m_FileName(fileName), m_FileLineNumber(fileLineNumber), m_FullMessage("") {
this->buildFullMessage();
}
CustomThrow::CustomThrow(const char* message, const char* fileName, unsigned int fileLineNumber)
: m_Message(message), m_FileName(fileName), m_FileLineNumber(fileLineNumber), m_FullMessage("") {
this->buildFullMessage();
}
const char* CustomThrow::what() const throw() {
return m_FullMessage.c_str();
}
void CustomThrow::buildFullMessage() {
std::ostringstream oStringBuilder;
oStringBuilder << "Exception: " << m_Message << ". ";
oStringBuilder << "File: " << m_FileName;
oStringBuilder << ", Line: " << m_FileLineNumber << "." << std::endl;
std::string fullMessage = oStringBuilder.str();
m_FullMessage = fullMessage.c_str();
} | 40.085714 | 110 | 0.736279 | terickson87 |
804018b7775d227c70f5f2af8ac6d14eac796ee1 | 495 | cpp | C++ | src/dioptre/keyboard/handlers/toggle_debug.cpp | tobscher/rts | 7f30faf6a13d309e4db828be8be3c05d28c05364 | [
"MIT"
] | 2 | 2015-05-14T16:07:30.000Z | 2015-07-27T21:08:48.000Z | src/dioptre/keyboard/handlers/toggle_debug.cpp | tobscher/rts | 7f30faf6a13d309e4db828be8be3c05d28c05364 | [
"MIT"
] | null | null | null | src/dioptre/keyboard/handlers/toggle_debug.cpp | tobscher/rts | 7f30faf6a13d309e4db828be8be3c05d28c05364 | [
"MIT"
] | null | null | null | #include "dioptre/keyboard/handlers/toggle_debug.h"
#include "dioptre/locator.h"
#include "dioptre/keyboard/keys.h"
namespace dioptre {
namespace keyboard {
namespace handlers {
dioptre::keyboard::Key ToggleDebug::handles() {
return dioptre::keyboard::KEY_D;
}
void ToggleDebug::update() {
auto physics =
dioptre::Locator::getInstance<dioptre::physics::PhysicsInterface>(
dioptre::Module::M_PHYSICS);
physics->toggleDebug();
}
} // handlers
} // keyboard
} // dioptre
| 20.625 | 72 | 0.715152 | tobscher |