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
109
| 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
48.5k
⌀ | 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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
80414079621538b5fd8948bf0a13bfa4c5831ccc
| 3,705
|
cpp
|
C++
|
fastflow/tests/test_ofarm.cpp
|
robzan8/prefixsum
|
5be9ae17473a3dd06406f614e6515c31ac68a219
|
[
"MIT"
] | 2
|
2017-11-09T11:32:14.000Z
|
2021-09-12T20:26:36.000Z
|
fastflow/tests/test_ofarm.cpp
|
robzan8/prefixsum
|
5be9ae17473a3dd06406f614e6515c31ac68a219
|
[
"MIT"
] | null | null | null |
fastflow/tests/test_ofarm.cpp
|
robzan8/prefixsum
|
5be9ae17473a3dd06406f614e6515c31ac68a219
|
[
"MIT"
] | null | null | null |
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* ***************************************************************************
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* As a special exception, you may use this file as part of a free software
* library without restriction. Specifically, if other files instantiate
* templates or use macros or inline functions from this file, or you compile
* this file and link it with other files to produce an executable, this
* file does not by itself cause the resulting executable to be covered by
* the GNU General Public License. This exception does not however
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
****************************************************************************
*/
/*
* 3-stages pipeline
*
* --> Worker1 -->
* | |
* Start ----> --> Worker1 --> -----> Stop
* | |
* --> Worker1 -->
*
* farm
*
* This test shows how to implement an ordered farm. In this case
* the farm respects the FIFO ordering of tasks.....
*
*
*/
#include <vector>
#include <iostream>
#include <ff/farm.hpp>
#include <ff/pipeline.hpp>
#include <ff/node.hpp>
using namespace ff;
class Start: public ff_node {
public:
Start(int streamlen):streamlen(streamlen) {}
void* svc(void*) {
for (int j=0;j<streamlen;j++) {
ff_send_out(new long(j));
}
return NULL;
}
private:
int streamlen;
};
class Worker1: public ff_node {
public:
void * svc(void * task) {
usleep(random() % 20000);
return task;
}
};
class Stop: public ff_node {
public:
Stop():expected(0) {}
void* svc(void* task) {
long t = *(long*)task;
if (t != expected)
printf("ERROR: task received out of order, received %ld expected %ld\n", t, expected);
expected++;
return GO_ON;
}
private:
long expected;
};
int main(int argc, char * argv[]) {
int nworkers = 3;
int streamlen = 1000;
if (argc>1) {
if (argc<3) {
std::cerr << "use: "
<< argv[0]
<< " nworkers streamlen\n";
return -1;
}
nworkers=atoi(argv[1]);
streamlen=atoi(argv[2]);
}
if (nworkers<=0 || streamlen<=0) {
std::cerr << "Wrong parameters values\n";
return -1;
}
srandom(131071);
ff_pipeline pipe;
Start start(streamlen);
pipe.add_stage(&start);
ff_ofarm ofarm;
std::vector<ff_node *> w;
for(int i=0;i<nworkers;++i) w.push_back(new Worker1);
ofarm.add_workers(w);
pipe.add_stage(&ofarm);
Stop stop;
pipe.add_stage(&stop);
pipe.run_and_wait_end();
std::cerr << "DONE\n";
return 0;
}
| 27.043796
| 98
| 0.546289
|
robzan8
|
8046d814225032655eff98b65bd7c499539e10af
| 2,290
|
hh
|
C++
|
src/device/timer.hh
|
othieno/invaders
|
89cb19d8d305943897530e636e0ba69b8c2ad8d6
|
[
"MIT"
] | null | null | null |
src/device/timer.hh
|
othieno/invaders
|
89cb19d8d305943897530e636e0ba69b8c2ad8d6
|
[
"MIT"
] | null | null | null |
src/device/timer.hh
|
othieno/invaders
|
89cb19d8d305943897530e636e0ba69b8c2ad8d6
|
[
"MIT"
] | null | null | null |
/*
* This file is part of the Space Invaders clone project.
* https://github.com/othieno/invaders
*
* Copyright (c) 2016 Jeremy Othieno.
*
* 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.
*/
#ifndef DEVICE_TIMER_HH
#define DEVICE_TIMER_HH
namespace device {
#define TIMERFREQ_SYS 0x0000
#define TIMERFREQ_64 0x0001
#define TIMERFREQ_256 0x0002
#define TIMERFREQ_1024 0x0003
#define TIMER_CASCADE 0x0004
#define TIMER_IRQ 0x0040
#define ENABLE_TIMER 0x0080
#ifdef COMMENT
// Store the address of the interrupt handler.
//REG_INTERRUPT = (unsigned int) interruptHandler;
// Initialize TIMER0. Steps to take to calculate the number of ticks:
// 1. How many microseconds or nanoseconds make one second?
// 2. Substract this value from 2^16 and voila, your initial value.
// Suppose we are using a 256 frequency (each clock cycle takes 15.256 microseconds), then this
// would give (10^6/61.05 = 16380.xyz). Our initial value would then be:
//REG_TM0D = 65536 - 16380;
//REG_TM0CNT = ENABLE_TIMER | ENABLE_TIMER_IRQ | FREQ_1024;
// Activate TIMER0 interrupt in REG_IE.
//REG_IE |= IRQ_TIMER0;
#endif
} // namespace device
#endif // DEVICE_TIMER_HH
| 32.253521
| 98
| 0.734934
|
othieno
|
804d793560b541fcb2452448b6cd1e33c00042f5
| 6,032
|
cc
|
C++
|
iree/base/dynamic_library_win32.cc
|
3alireza32109/iree
|
fd32e47b1695f105d20c06b8b20a29ef65c5e54c
|
[
"Apache-2.0"
] | 2
|
2021-10-03T15:58:09.000Z
|
2021-11-17T10:34:35.000Z
|
iree/base/dynamic_library_win32.cc
|
3alireza32109/iree
|
fd32e47b1695f105d20c06b8b20a29ef65c5e54c
|
[
"Apache-2.0"
] | null | null | null |
iree/base/dynamic_library_win32.cc
|
3alireza32109/iree
|
fd32e47b1695f105d20c06b8b20a29ef65c5e54c
|
[
"Apache-2.0"
] | null | null | null |
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://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 "absl/memory/memory.h"
#include "absl/strings/str_replace.h"
#include "iree/base/dynamic_library.h"
#include "iree/base/internal/file_path.h"
#include "iree/base/target_platform.h"
#include "iree/base/tracing.h"
#if defined(IREE_PLATFORM_WINDOWS)
// TODO(benvanik): support PDB overlays when tracy is not enabled too; we'll
// need to rearrange how the dbghelp lock is handled for that (probably moving
// it here and having the tracy code redirect to this).
#if defined(TRACY_ENABLE)
#define IREE_HAVE_DYNAMIC_LIBRARY_PDB_SUPPORT 1
#pragma warning(disable : 4091)
#include <dbghelp.h>
extern "C" void IREEDbgHelpLock();
extern "C" void IREEDbgHelpUnlock();
#endif // TRACY_ENABLE
namespace iree {
// We need to match the expected paths from dbghelp exactly or else we'll get
// spurious warnings during module resolution. AFAICT our approach here with
// loading the PDBs directly with a module base/size of the loaded module will
// work regardless but calls like SymRefreshModuleList will still attempt to
// load from system symbol search paths if things don't line up.
static void CanonicalizePath(std::string* path) {
absl::StrReplaceAll({{"/", "\\"}}, path);
absl::StrReplaceAll({{"\\\\", "\\"}}, path);
}
class DynamicLibraryWin : public DynamicLibrary {
public:
~DynamicLibraryWin() override {
IREE_TRACE_SCOPE();
// TODO(benvanik): disable if we want to get profiling results.
// Sometimes closing the library can prevent proper symbolization on
// crashes or in sampling profilers.
::FreeLibrary(library_);
}
static Status Load(absl::Span<const char* const> search_file_names,
std::unique_ptr<DynamicLibrary>* out_library) {
IREE_TRACE_SCOPE();
out_library->reset();
for (int i = 0; i < search_file_names.size(); ++i) {
HMODULE library = ::LoadLibraryA(search_file_names[i]);
if (library) {
out_library->reset(
new DynamicLibraryWin(search_file_names[i], library));
return OkStatus();
}
}
return iree_make_status(
IREE_STATUS_UNAVAILABLE,
"unable to open dynamic library, not found on search paths");
}
#if defined(IREE_HAVE_DYNAMIC_LIBRARY_PDB_SUPPORT)
void AttachDebugDatabase(const char* database_file_name) override {
IREE_TRACE_SCOPE();
// Derive the base module name (path stem) for the loaded module.
// For example, the name of 'C:\Dev\foo.dll' would be 'foo'.
// This name is used by dbghelp for listing loaded modules and we want to
// ensure we match the name of the PDB module with the library module.
std::string module_name = file_name_;
size_t last_slash = module_name.find_last_of('\\');
if (last_slash != std::string::npos) {
module_name = module_name.substr(last_slash + 1);
}
size_t dot = module_name.find_last_of('.');
if (dot != std::string::npos) {
module_name = module_name.substr(0, dot);
}
IREEDbgHelpLock();
// Useful for debugging; will print search paths and results:
// SymSetOptions(SYMOPT_LOAD_LINES | SYMOPT_DEBUG);
// Enumerates all loaded modules in the process to extract the module
// base/size parameters we need to overlay the PDB. There's other ways to
// get this (such as registering a LdrDllNotification callback and snooping
// the values during LoadLibrary or using CreateToolhelp32Snapshot), however
// EnumerateLoadedModules is in dbghelp which we are using anyway.
ModuleEnumCallbackState state;
state.module_file_path = file_name_.c_str();
EnumerateLoadedModules64(GetCurrentProcess(), EnumLoadedModulesCallback,
&state);
// Load the PDB file and overlay it onto the already-loaded module at the
// address range it got loaded into.
if (state.module_base != 0) {
SymLoadModuleEx(GetCurrentProcess(), NULL, database_file_name,
module_name.c_str(), state.module_base, state.module_size,
NULL, 0);
}
IREEDbgHelpUnlock();
}
#endif // IREE_HAVE_DYNAMIC_LIBRARY_PDB_SUPPORT
void* GetSymbol(const char* symbol_name) const override {
return reinterpret_cast<void*>(::GetProcAddress(library_, symbol_name));
}
private:
DynamicLibraryWin(std::string file_name, HMODULE library)
: DynamicLibrary(std::move(file_name)), library_(library) {
CanonicalizePath(&file_name_);
}
#if defined(IREE_HAVE_DYNAMIC_LIBRARY_PDB_SUPPORT)
struct ModuleEnumCallbackState {
const char* module_file_path = NULL;
DWORD64 module_base = 0;
ULONG module_size = 0;
};
static BOOL EnumLoadedModulesCallback(PCSTR ModuleName, DWORD64 ModuleBase,
ULONG ModuleSize, PVOID UserContext) {
auto* state = reinterpret_cast<ModuleEnumCallbackState*>(UserContext);
if (strcmp(ModuleName, state->module_file_path) != 0) {
return TRUE; // not a match; continue
}
state->module_base = ModuleBase;
state->module_size = ModuleSize;
return FALSE; // match found; stop enumeration
}
#endif // IREE_HAVE_DYNAMIC_LIBRARY_PDB_SUPPORT
HMODULE library_ = NULL;
};
// static
Status DynamicLibrary::Load(absl::Span<const char* const> search_file_names,
std::unique_ptr<DynamicLibrary>* out_library) {
return DynamicLibraryWin::Load(search_file_names, out_library);
}
} // namespace iree
#endif // IREE_PLATFORM_*
| 37.465839
| 80
| 0.706233
|
3alireza32109
|
804e1d28dc4634b129850c1120594c76640aa6f9
| 770
|
hpp
|
C++
|
Deitel/Chapter13/exercises/13.16/SavingsAccount.hpp
|
SebastianTirado/Cpp-Learning-Archive
|
fb83379d0cc3f9b2390cef00119464ec946753f4
|
[
"MIT"
] | 19
|
2019-09-15T12:23:51.000Z
|
2020-06-18T08:31:26.000Z
|
Deitel/Chapter13/exercises/13.16/SavingsAccount.hpp
|
eirichan/CppLearingArchive
|
07a4baf63f0765d41eb0cc6d32a4c9d2ae1d5bac
|
[
"MIT"
] | 15
|
2021-12-07T06:46:03.000Z
|
2022-01-31T07:55:32.000Z
|
Deitel/Chapter13/exercises/13.16/SavingsAccount.hpp
|
eirichan/CppLearingArchive
|
07a4baf63f0765d41eb0cc6d32a4c9d2ae1d5bac
|
[
"MIT"
] | 13
|
2019-06-29T02:58:27.000Z
|
2020-05-07T08:52:22.000Z
|
/*
* =====================================================================================
*
* Filename: SavingsAccount.hpp
*
* Description: Exercise 12.10 - Account Inheritance Hierarchy
*
* Version: 1.0
* Created: 24/07/16 20:27:54
* Revision: none
* Compiler: gcc
*
* Author: Siidney Watson - siidney.watson.work@gmail.com
* Organization: LolaDog Studio
*
* =====================================================================================
*/
#pragma once
#include "Account.hpp"
class SavingsAccount : public Account {
public:
SavingsAccount(double, double);
double calculateInterest() const;
void credit(double);
bool debit(double);
private:
double interestRate;
};
| 22.647059
| 88
| 0.480519
|
SebastianTirado
|
804f874a6c67bc61047e95b341f9589d0da4ff42
| 5,699
|
cpp
|
C++
|
framework/src/minko/component/Camera.cpp
|
aerys/minko
|
edc3806a4e01570c5cb21f3402223ca695d08d22
|
[
"BSD-3-Clause"
] | 478
|
2015-01-04T16:59:53.000Z
|
2022-03-07T20:28:07.000Z
|
framework/src/minko/component/Camera.cpp
|
aerys/minko
|
edc3806a4e01570c5cb21f3402223ca695d08d22
|
[
"BSD-3-Clause"
] | 83
|
2015-01-15T21:45:06.000Z
|
2021-11-08T11:01:48.000Z
|
framework/src/minko/component/Camera.cpp
|
aerys/minko
|
edc3806a4e01570c5cb21f3402223ca695d08d22
|
[
"BSD-3-Clause"
] | 175
|
2015-01-04T03:30:39.000Z
|
2020-01-27T17:08:14.000Z
|
/*
Copyright (c) 2014 Aerys
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "minko/component/Camera.hpp"
#include "minko/scene/Node.hpp"
#include "minko/data/Provider.hpp"
#include "minko/math/Ray.hpp"
#include "minko/component/Transform.hpp"
#include "minko/scene/Node.hpp"
#include "minko/component/SceneManager.hpp"
#include "minko/file/AssetLibrary.hpp"
#include "minko/render/AbstractContext.hpp"
using namespace minko;
using namespace minko::component;
Camera::Camera(const math::mat4& projection,
const math::mat4& postProjection) :
_data(data::Provider::create()),
_view(math::mat4(1.f)),
_position(),
_direction(0.f, 0.f, 1.f),
_postProjection(postProjection),
_projectionMatrixChanged(Signal<>::create())
{
_data
->set("eyeDirection", _direction)
->set("eyePosition", _position)
->set("viewMatrix", _view)
->set("projectionMatrix", _projection);
projectionMatrix(projection);
}
// TODO #Clone
/*
Camera::Camera(const Camera& camera, const CloneOption& option) :
_data(camera._data->clone()),
_fov(camera._fov),
_aspectRatio(camera._aspectRatio),
_zNear(camera._zNear),
_zFar(camera._zFar),
_view(Matrix4x4::create()),
_projection(Matrix4x4::create()->perspective(camera._fov, camera._aspectRatio, camera._zNear, camera._zFar)),
_viewProjection(Matrix4x4::create()->copyFrom(_projection)),
_position(Vector3::create()),
_postProjection(camera._postProjection)
{
}
AbstractComponent::Ptr
Camera::clone(const CloneOption& option)
{
auto ctrl = std::shared_ptr<Camera>(new Camera(*this, option));
return ctrl;
}
*/
void
Camera::targetAdded(NodePtr target)
{
target->data().addProvider(_data);
_modelToWorldChangedSlot = target->data().propertyChanged("modelToWorldMatrix").connect(
[&](data::Store& data, data::Provider::Ptr, const data::Provider::PropertyName&)
{
localToWorldChangedHandler(data);
});
if (target->data().hasProperty("modelToWorldMatrix"))
updateMatrices(target->data().get<math::mat4>("modelToWorldMatrix"));
}
void
Camera::targetRemoved(NodePtr target)
{
target->data().removeProvider(_data);
}
void
Camera::localToWorldChangedHandler(data::Store& data)
{
updateMatrices(data.get<math::mat4>("modelToWorldMatrix"));
}
void
Camera::updateMatrices(const math::mat4& modelToWorldMatrix)
{
_position = (modelToWorldMatrix * math::vec4(0.f, 0.f, 0.f, 1.f)).xyz();
_direction = math::normalize(math::mat3(modelToWorldMatrix) * math::vec3(0.f, 0.f, 1.f));
_view = math::inverse(modelToWorldMatrix);
_data
->set("eyeDirection", _direction)
->set("eyePosition", _position)
->set("viewMatrix", _view);
updateWorldToScreenMatrix();
}
void
Camera::updateWorldToScreenMatrix()
{
_projection = _postProjection * _projection;
_viewProjection = _projection * _view;
_data
->set("projectionMatrix", _projection)
->set("worldToScreenMatrix", _viewProjection);
}
std::shared_ptr<math::Ray>
Camera::unproject(float x, float y)
{
// Should take normalized X and Y coordinates (between -1 and 1)
const auto viewport = math::vec4(-1.f, -1.f, 2.f, 2.f);
// GLM unProject function expect coordinates with the origin at the lower left corner
const auto rayWorldOrigin = math::unProject(
math::vec3(x, -y, 0.f),
_view,
_projection,
viewport
);
const auto unprojectedWorldPosition = math::unProject(
math::vec3(x, -y, 1.f),
_view,
_projection,
viewport
);
const auto rayWorldDirection = math::normalize(unprojectedWorldPosition - rayWorldOrigin);
return math::Ray::create(rayWorldOrigin, rayWorldDirection);
}
math::vec3
Camera::project(const math::vec3& worldPosition) const
{
auto context = target()->root()->component<SceneManager>()->assets()->context();
return project(
worldPosition,
context->viewportWidth(),
context->viewportHeight(),
_view,
_viewProjection
);
}
math::vec3
Camera::project(const math::vec3& worldPosition,
unsigned int viewportWidth,
unsigned int viewportHeight,
const math::mat4& viewMatrix,
const math::mat4& viewProjectionMatrix)
{
const auto width = viewportWidth;
const auto height = viewportHeight;
const auto pos = math::vec4(worldPosition, 1.f);
auto vector = viewProjectionMatrix * pos;
vector /= vector.w;
return math::vec3(
width * ((vector.x + 1.0f) * .5f),
height * ((1.0f - ((vector.y + 1.0f) * .5f))),
-(viewMatrix * pos).z
);
}
| 29.994737
| 111
| 0.689244
|
aerys
|
805515743fe5be5e0f0d06a47b0c056c0c6e7e1f
| 1,483
|
cpp
|
C++
|
src/Dimmer.cpp
|
foxostro/CheeseTesseract
|
737ebbd19cee8f5a196bf39a11ca793c561e56cb
|
[
"MIT"
] | 1
|
2016-05-17T03:36:52.000Z
|
2016-05-17T03:36:52.000Z
|
src/Dimmer.cpp
|
foxostro/CheeseTesseract
|
737ebbd19cee8f5a196bf39a11ca793c561e56cb
|
[
"MIT"
] | null | null | null |
src/Dimmer.cpp
|
foxostro/CheeseTesseract
|
737ebbd19cee8f5a196bf39a11ca793c561e56cb
|
[
"MIT"
] | null | null | null |
#include "stdafx.h"
#include "color.h"
#include "Dimmer.h"
float Dimmer::alphaBlur = 1.0f;
Dimmer::Dimmer() {}
void Dimmer::draw() const {
if (alphaBlur < FLT_EPSILON) {
alphaBlur = 0.0f;
return;
}
glPushAttrib(GL_ALL_ATTRIB_BITS);
glColor4f(0, 0, 0, alphaBlur);
glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_FOG);
glDisable(GL_DEPTH_TEST);
glDisable(GL_TEXTURE_2D);
glDisable(GL_ALPHA_TEST);
glDisable(GL_CULL_FACE);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
/*glBlendFunc(GL_SRC_ALPHA, GL_ONE);*/
// Save the projection matrix
glMatrixMode(GL_PROJECTION);
glPushMatrix();
// Set up the projection matrix for 2D
glLoadIdentity();
glOrtho(0.0f, 1024.0f, 0.0f, 768.0f, -1.0f, 1.0f);
// Save the model view matrix
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
// Set up the model view matrix
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -0.2f);
// Render a quad over the screen
glBegin(GL_QUADS);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(1024.0f, 0.0f, 0.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(1024.0f, 768.0f, 0.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f( 0.0f, 768.0f, 0.0f);
glTexCoord2f(0.0f, 0.0f);
glVertex3f( 0.0f, 0.0f, 0.0f);
glEnd();
// Restore the model view matrix
glPopMatrix();
// Restore the projection matrix
glMatrixMode(GL_PROJECTION);
glPopMatrix();
// Use modelview mode
glMatrixMode(GL_MODELVIEW);
// Restore settings
glPopAttrib();
}
| 20.887324
| 51
| 0.700607
|
foxostro
|
8056f7a227e5adb5c357004ba1b2c4bc92866c89
| 1,025
|
cpp
|
C++
|
leetcode.com/0393 UTF-8 Validation/main.cpp
|
sky-bro/AC
|
29bfa3f13994612887e18065fa6e854b9a29633d
|
[
"MIT"
] | 1
|
2020-08-20T11:02:49.000Z
|
2020-08-20T11:02:49.000Z
|
leetcode.com/0393 UTF-8 Validation/main.cpp
|
sky-bro/AC
|
29bfa3f13994612887e18065fa6e854b9a29633d
|
[
"MIT"
] | null | null | null |
leetcode.com/0393 UTF-8 Validation/main.cpp
|
sky-bro/AC
|
29bfa3f13994612887e18065fa6e854b9a29633d
|
[
"MIT"
] | 1
|
2022-01-01T23:23:13.000Z
|
2022-01-01T23:23:13.000Z
|
#include <iostream>
#include <vector>
using namespace std;
class Solution {
private:
int count_bytes(int first_byte) {
int mask = 1 << 7;
int res = 0;
for (int i = 0; i < 4; ++i) {
if (first_byte & mask) {
++res;
} else {
break;
}
mask >>= 1;
}
// res could only be 0, 2, 3, 4
if ((first_byte & mask) || res == 1) return 0;
return res ? res : 1;
}
public:
bool validUtf8(vector<int>& data) {
int n = data.size();
for (int i = 0; i < n;) {
int bytes_cnt = count_bytes(data[i]);
if (bytes_cnt == 0 || i + bytes_cnt > n) return false;
i += bytes_cnt;
for (int j = i - bytes_cnt + 1; j < i; ++j) {
if ((data[j] & 0xC0) != 0x80) return false;
}
}
return true;
}
};
int main(int argc, char const* argv[]) {
Solution sol;
vector<int> data = {197, 130, 1}; // true
cout << sol.validUtf8(data) << endl;
data = {235, 140, 4}; // false
cout << sol.validUtf8(data) << endl;
return 0;
}
| 21.354167
| 60
| 0.513171
|
sky-bro
|
8059f8cdd9388e4674d4c42704c862bf4f3528aa
| 46,477
|
cc
|
C++
|
test_atp.cc
|
wwmfdb/ATP-Engine
|
00eaf0f551907c9d6e2db446d5e78364364531d4
|
[
"BSD-3-Clause-Clear"
] | 16
|
2020-05-19T16:13:10.000Z
|
2022-02-05T19:22:37.000Z
|
test_atp.cc
|
wwmfdb/ATP-Engine
|
00eaf0f551907c9d6e2db446d5e78364364531d4
|
[
"BSD-3-Clause-Clear"
] | 6
|
2020-07-16T14:30:02.000Z
|
2021-11-08T22:10:18.000Z
|
test_atp.cc
|
wwmfdb/ATP-Engine
|
00eaf0f551907c9d6e2db446d5e78364364531d4
|
[
"BSD-3-Clause-Clear"
] | 12
|
2020-05-21T17:56:34.000Z
|
2022-01-19T02:07:15.000Z
|
/*
* SPDX-License-Identifier: BSD-3-Clause-Clear
*
* Copyright (c) 2015, 2017 ARM Limited
* All rights reserved
* Created on: Oct 19, 2015
* Author: Matteo Andreozzi
* Riken Gohil
*/
#include "test_atp.hh"
#include "event.hh"
#include "stats.hh"
#include "fifo.hh"
#include "packet_desc.hh"
#include <vector>
#include <sstream>
#include <algorithm>
#include <cassert>
#include "traffic_profile_desc.hh"
#include "utilities.hh"
#include "kronos.hh"
#ifndef CPPUNIT_ASSERT
#define CPPUNIT_ASSERT(x)
#endif
using namespace std;
namespace TrafficProfiles {
TestAtp::TestAtp(): tpm(nullptr), configuration(nullptr) {
}
TestAtp::~TestAtp() {
tearDown();
}
// test helper functions
PatternConfiguration* TestAtp::makePatternConfiguration(PatternConfiguration* t, const Command cmd, const Command wait) {
t->set_cmd(cmd);
t->set_wait_for(wait);
return t;
}
FifoConfiguration* TestAtp::makeFifoConfiguration(FifoConfiguration* t, const uint64_t fullLevel,
const FifoConfiguration::StartupLevel level,const uint64_t ot, const uint64_t total, const uint64_t rate) {
t->set_full_level(fullLevel);
t->set_start_fifo_level(level);
t->set_ot_limit(ot);
t->set_total_txn(total);
t->set_rate(std::to_string(rate));
return t;
}
void
TestAtp::makeProfile(Profile *p, const ProfileDescription &desc) const {
p->set_name(desc.name);
p->set_type(desc.type);
if (desc.master) {
p->set_master_id(*desc.master);
}
else {
p->set_master_id(desc.name);
}
if (desc.waitFor) {
for (const auto& a: *desc.waitFor) {
p->add_wait_for(a);
}
}
}
// test specific functions
void TestAtp::setUp() {
// create new TPM
tpm = new TrafficProfileManager();
// load the Configuration into the TPM
if (configuration) {
tpm->configure(*configuration);
// Dump the TPM configuration
string out;
if (!tpm->print(out)) {
ERROR("unable to dump TPM");
}
// display the TPM
LOG(out);
}
}
void TestAtp::tearDown() {
if (tpm) {
delete tpm;
tpm = nullptr;
}
if (configuration) {
delete configuration;
configuration = nullptr;
}
}
bool TestAtp::buildManager_fromFile(const string& fileName) {
// create new TPM if not created yet
if (nullptr == tpm) {
tpm = new TrafficProfileManager();
}
// load the Configuration into the TPM
return (tpm->load(fileName));
}
void TestAtp::dumpStats() {
if (tpm) {
LOG ("TestAtp::dumpStats dumping TPM stats");
PRINT("Global TPM Stats:", tpm->getStats().dump());
for (auto&m: tpm->getMasters()) {
PRINT(m,"Stats:",tpm->getMasterStats(m).dump());
}
}
}
void TestAtp::testAgainstInternalSlave(const string& rate,
const string& latency) {
PRINT("ATP Engine running in standalone execution mode. "
"Internal slave configuration:",rate,latency);
// the TPM should already be created and loaded with masters
// query the TPM for masters and assign all unassigned masters to
// an internal slave
Profile slave;
// fill the configuration
makeProfile(&slave, ProfileDescription { "TestAtp::InternalSlave::",
Profile::READ });
// fill in the slave field
SlaveConfiguration* slave_cfg = slave.mutable_slave();
slave_cfg->set_latency(latency);
slave_cfg->set_rate(rate);
slave_cfg->set_granularity(64);
slave_cfg->set_ot_limit(0);
// request list of all masters and add unassigned ones to internal slave
auto& masters = tpm->getMasters();
auto& masterSlaves = tpm->getMasterSlaves();
for (auto&m : masters) {
if (masterSlaves.find(m)==masterSlaves.end()) {
slave_cfg->add_master(m);
}
}
// register (overwrite) slave with TPM
tpm->configureProfile(slave, make_pair(1,1), true);
// request packets to masters and route to the internal slave
tpm->loop();
dumpStats();
}
// unit tests
void
TestAtp::testAtp_fifo() {
Fifo fifo;
// start with an empty FIFO, which fills every time by 1000
fifo.init(nullptr, Profile::READ,1000,1,0,2000,true);
uint64_t next = 0;
uint64_t request_time=0;
bool underrun=false, overrun=false;
uint64_t i = 0;
for (; i< 2; ++i){
// read 1000 every time
fifo.send(underrun, overrun, next, request_time, i, 1000);
CPPUNIT_ASSERT(fifo.getOt() == 1);
fifo.receive(underrun, overrun, i, 1000);
CPPUNIT_ASSERT(fifo.getOt() == 0);
}
// checks to see if send allocation was successful
CPPUNIT_ASSERT(fifo.getLevel() == 1000);
// consume last data
fifo.send(underrun, overrun, next, request_time, i, 0);
CPPUNIT_ASSERT(fifo.getOt() == 0);
fifo.receive(underrun, overrun, i,0);
CPPUNIT_ASSERT(fifo.getOt() == 0);
// we should have an empty FIFO here
CPPUNIT_ASSERT(fifo.getLevel() == 0);
CPPUNIT_ASSERT(!underrun);
CPPUNIT_ASSERT(!overrun);
// checks for having multiple outstanding transactions
fifo.send(underrun, overrun, next, request_time, i, 1000);
fifo.send(underrun, overrun, next, request_time, ++i, 1000);
CPPUNIT_ASSERT(fifo.getOt() == 2);
fifo.receive(underrun, overrun, i, 1000);
fifo.receive(underrun, overrun, ++i, 1000);
CPPUNIT_ASSERT(fifo.getOt() == 0);
// we should underrun now
fifo.send(underrun, overrun, next, request_time, ++i, 0);
CPPUNIT_ASSERT(fifo.getOt() == 0);
fifo.receive(underrun, overrun, i,0);
CPPUNIT_ASSERT(fifo.getOt() == 0);
CPPUNIT_ASSERT(underrun);
CPPUNIT_ASSERT(!overrun);
// clear flags
underrun=overrun=false;
// start with a full WRITE FIFO, which fills every time by 1000
fifo.init(nullptr, Profile::WRITE,1000,1,2000,2000,true);
i=0;
for (;i< 2; ++i){
// read 1000 every time, receive partial 500 twice
fifo.send(underrun, overrun, next, request_time, i, 1000);
CPPUNIT_ASSERT(fifo.getOt() == 1);
fifo.receive(underrun, overrun, i, 500);
fifo.receive(underrun, overrun, i, 500);
CPPUNIT_ASSERT(fifo.getOt() == 0);
}
// checks to see if send removal was successful
CPPUNIT_ASSERT(fifo.getLevel() == 1000);
// cause FIFO update
fifo.send(underrun, overrun, next, request_time, i, 0);
CPPUNIT_ASSERT(fifo.getOt() == 0);
fifo.receive(underrun, overrun, i,0);
CPPUNIT_ASSERT(fifo.getOt() == 0);
// we should have a full FIFO here
CPPUNIT_ASSERT(fifo.getLevel() == 2000);
CPPUNIT_ASSERT(!underrun);
CPPUNIT_ASSERT(!overrun);
// we should overrun now
fifo.send(underrun, overrun, next, request_time, ++i, 0);
CPPUNIT_ASSERT(fifo.getOt() == 0);
fifo.receive(underrun, overrun, i,0);
CPPUNIT_ASSERT(fifo.getOt() == 0);
CPPUNIT_ASSERT(!underrun);
CPPUNIT_ASSERT(overrun);
CPPUNIT_ASSERT(fifo.getLevel() == 2000);
// consume 1000
fifo.send(underrun, overrun, next, request_time, i, 1000);
CPPUNIT_ASSERT(fifo.getOt() == 1);
CPPUNIT_ASSERT(fifo.getLevel() == 2000);
fifo.receive(underrun, overrun, i,1000);
CPPUNIT_ASSERT(fifo.getLevel() == 1000);
// reset the FIFO
fifo.reset();
// verify that the FIFO is back to startup values
CPPUNIT_ASSERT(fifo.getOt() == 0);
CPPUNIT_ASSERT(fifo.getLevel() == 2000);
for (;i< 2; ++i){
// read 1000 every time, receive partial 500 twice
fifo.send(underrun, overrun, next, request_time, i, 1000);
CPPUNIT_ASSERT(fifo.getOt() == 1);
fifo.receive(underrun, overrun, i, 500);
fifo.receive(underrun, overrun, i, 500);
CPPUNIT_ASSERT(fifo.getOt() == 0);
}
// test mid-update cycle activation
// start with a full READ FIFO, which depletes every 10 units by 1000
fifo.init(nullptr, Profile::READ,1000,10,2000,2000,true);
// send request at time 3
bool ok = fifo.send(underrun, overrun, next, request_time, 13, 1000);
// verify that we get next time 23 and not 10
CPPUNIT_ASSERT(!ok);
CPPUNIT_ASSERT(next == 23);
ok = fifo.send(underrun, overrun, next, request_time, 21, 1000);
// verify that we get next time 23 and not 10
CPPUNIT_ASSERT(!ok);
CPPUNIT_ASSERT(next == 23);
// verify that the next send time is correct and that the FIFO transmits
ok = fifo.send(underrun, overrun, next, request_time, next, 1000);
CPPUNIT_ASSERT(ok);
// note : as the FIFO is now at level 1000 with 1000 in-flight, next is 0
CPPUNIT_ASSERT(next==0);
// set the time to 33 and see if we get another transaction
fifo.receive(underrun, overrun, 33, 1000);
// verify that the 2nd next send time is correct
ok = fifo.send(underrun, overrun, next, request_time, 33, 1000);
CPPUNIT_ASSERT(ok);
}
void
TestAtp::testAtp_event() {
Event ev1(Event::NONE,Event::AWAITED,0,0),
ev2(Event::NONE,Event::AWAITED,0,0),
ev3(Event::NONE,Event::TRIGGERED,0,0),
ev4(Event::TERMINATION,Event::AWAITED,0,0),
ev5(Event::NONE,Event::TRIGGERED,1,0);
// test comparison of event objects
CPPUNIT_ASSERT(ev1==ev2);
// a triggered and awaited event compare equal
CPPUNIT_ASSERT(ev1==ev3);
CPPUNIT_ASSERT(ev1!=ev4);
CPPUNIT_ASSERT(ev1!=ev5);
// test parsing event objects from string
string event = "testAtp_event TERMINATION";
string name ="";
Event::Type type = Event::NONE;
CPPUNIT_ASSERT(Event::parse(type, name, event));
CPPUNIT_ASSERT(type == Event::TERMINATION);
CPPUNIT_ASSERT(name == "testAtp_event");
event = "ERROR ERROR";
CPPUNIT_ASSERT(!Event::parse(type, name, event));
}
void TestAtp::testAtp_packetDesc() {
Profile config;
// fill the configuration
makeProfile(&config, ProfileDescription { "testAtp_packetDesc_profile",
Profile::READ });
// fill the FIFO configuration - pointer, maxLevel,
// startup level, OT, transactions, rate
makeFifoConfiguration(config.mutable_fifo(),
0, FifoConfiguration::EMPTY, 0, 0, 0);
// ATP Packet descriptor
PacketDesc pd;
// fill the Google Protocol Buffer configuration object
makePatternConfiguration(config.mutable_pattern(),
Command::READ_REQ, Command::READ_RESP);
// configure the packet address and size generation policies
auto* pk = config.mutable_pattern();
pk->set_size(64);
PatternConfiguration::Address* address = pk->mutable_address();
address->set_base(0);
// set increment
address->set_increment(0x1FBE);
// set local id limits
pk->set_lowid(10);
pk->set_highid(11);
// initialize the Packet Descriptor and checks if initialized correctly
pd.init(0, *config.mutable_pattern());
CPPUNIT_ASSERT(pd.isInitialized());
CPPUNIT_ASSERT(pd.waitingFor() == Command::READ_RESP);
// register profile
tpm->configureProfile(config);
// request a packet three times
for (uint64_t i=0; i< 3 ; ++i) {
Packet * p(nullptr);
bool ok = pd.send(p,0);
CPPUNIT_ASSERT(ok);
// test local id generation
CPPUNIT_ASSERT(p->id()== (10+i>11?10:10+i));
// set correct type of packet and receive
p->set_cmd(Command::READ_RESP);
ok = pd.receive(0, p);
CPPUNIT_ASSERT(ok);
// delete packet
delete p;
}
// descriptor re-initialisation to test range reset
pd.addressReconfigure(0xBEEF, 0x3F7C);
for (uint64_t i=0; i< 3 ; ++i) {
Packet * p(nullptr);
bool ok = pd.send(p,0);
CPPUNIT_ASSERT(ok);
// test address reconfiguration
CPPUNIT_ASSERT(p->addr() ==
(i == 0 || i == 2 ? 0xBEEF: 0xDEAD));
// set correct type of packet and receive
p->set_cmd(Command::READ_RESP);
ok = pd.receive(0, p);
CPPUNIT_ASSERT(ok);
// delete packet
delete p;
}
/*
* test autoRange - first call fails as autoRange
* cannot extend an existing range
* so we still get the old range returned
*/
CPPUNIT_ASSERT(pd.autoRange(1023) == 0x3F7C);
// force the packet descriptor autoRange
CPPUNIT_ASSERT(pd.autoRange(1023, true) == 0x7ED842);
// test new range applies
for (uint64_t i=0; i< 3 ; ++i) {
Packet * p(nullptr);
// reset before the third packet is sent
if (i==2) pd.reset();
bool ok = pd.send(p,0);
CPPUNIT_ASSERT(ok);
// test address reconfiguration
// second packet shouldn't wrap around anymore
// third packet should now have the base address due to reset
if (i==0) {
CPPUNIT_ASSERT(p->addr() == 0xDEAD);
} else if (i==1) {
CPPUNIT_ASSERT(p->addr() == 0xfe6b);
} else {
CPPUNIT_ASSERT(p->addr() == 0xBEEF);
}
// set correct type of packet and receive
p->set_cmd(Command::READ_RESP);
ok = pd.receive(0, p);
CPPUNIT_ASSERT(ok);
// delete packet
delete p;
}
// test striding autorange - re-init the pd
auto* stride = pk->mutable_stride();
pk->mutable_address()->set_increment(10);
stride->set_increment(64);
stride->set_range("640");
pd.init(0, *pk);
// test that the range is 640 times the strides (10) times the increment
CPPUNIT_ASSERT(pd.autoRange(100)==6400);
// reduce the increment to and test the autoRange again
address->set_increment(640);
pd.init(0, *pk);
pd.autoRange(100);
Packet * p(nullptr);
// TEMP test packet generation doesn't wrap
for (uint64_t i=0; i< 100 ; ++i) {
bool ok = pd.send(p,0);
// verify that no wrap-around has occurred
CPPUNIT_ASSERT(p->addr() == i*64);
delete p;
}
}
void TestAtp::testAtp_stats() {
Stats s1, s2, s3, s4;
// record sending 1000 bytes every 2 ticks
for (uint64_t i=0; i <= 10; i+=2) {
s1.send(i, 1000);
}
// data transferred should be 6KB and rate should be
// 600 B/tick
CPPUNIT_ASSERT(s1.dataSent == 6000);
CPPUNIT_ASSERT(s1.sendRate() == 600);
CPPUNIT_ASSERT(s1.sent == 6);
CPPUNIT_ASSERT(s1.received == 0);
CPPUNIT_ASSERT(s1.dataReceived == 0);
s1.reset();
// data should now be back to 0
CPPUNIT_ASSERT(s1.dataSent == 0);
// test reception
s1.receive(0, 0, 0.0);
s1.receive(10, 1000, 0.0);
CPPUNIT_ASSERT(s1.dataReceived == 1000);
CPPUNIT_ASSERT(s1.receiveRate() == 100);
CPPUNIT_ASSERT(s1.sent == 0);
CPPUNIT_ASSERT(s1.received == 2);
// tests to make sure add and sum operator are working correctly
s1.reset();
for (uint64_t i=0; i <= 10; i+=2) {
s1.send(i, 1000);
s2.send(i+12, 1000);
}
for (uint64_t i=0; i <= 22; i+=2) {
s3.send(i, 1000);
}
s4 = s1 + s2;
CPPUNIT_ASSERT(s4.dump() == s3.dump());
s2 += s1;
CPPUNIT_ASSERT(s2.dump() == s3.dump());
}
void TestAtp::testAtp_trafficProfile() {
// configuration object
Profile config;
// fill the configuration
makeProfile(&config, ProfileDescription { "testAtp_trafficProfile",
Profile::READ });
CPPUNIT_ASSERT(!config.has_pattern());
CPPUNIT_ASSERT(!config.wait_for_size());
CPPUNIT_ASSERT(!config.has_fifo());
// fill the FIFO configuration - pointer,
// maxLevel, startup level, OT, transactions, rate
makeFifoConfiguration(config.mutable_fifo(), 1000,
FifoConfiguration::EMPTY, 1, 1, 10);
// fill the Packet Descriptor configuration
PatternConfiguration* pk = makePatternConfiguration(config.mutable_pattern(),
Command::READ_REQ,
Command::READ_RESP);
// configure the packet address and size generation policies
pk->set_size(64);
PatternConfiguration::Address* address = pk->mutable_address();
address->set_base(0);
address->set_increment(0);
// register this profile in the TPM
tpm->configureProfile(config);
// add a wait on a PLAY event and register as new profile
config.add_wait_for("testAtp_trafficProfile_to_play ACTIVATION");
config.set_name("testAtp_trafficProfile_to_play");
// register this profile in the TPM
tpm->configureProfile(config);
// remove the wait for field from the config object
config.clear_wait_for();
// delete the packet configuration from the config object
config.release_pattern();
// change name
config.set_name("testAtp_trafficProfile_checker");
// set the checker to monitor test_profile
config.add_check("testAtp_trafficProfile");
// register this profile in the TPM
tpm->configureProfile(config);
// get the ATP Profile Descriptors
TrafficProfileDescriptor* pd = tpm->profiles.at(0);
TrafficProfileDescriptor* wait = tpm->profiles.at(1);
TrafficProfileDescriptor* checker = tpm->profiles.at(2);
// test packet send and receive
bool locked = false;
Packet* p(nullptr),*empty(nullptr);
uint64_t next=0;
CPPUNIT_ASSERT(pd->send(locked, p, next));
CPPUNIT_ASSERT(checker->send(locked, p, next));
p->set_cmd(Command::READ_RESP);
// profile should be locked, not active
CPPUNIT_ASSERT(!pd->active(locked));
CPPUNIT_ASSERT(locked);
// profile should not accept a send request at this time
CPPUNIT_ASSERT(!pd->send(locked, empty, next));
// receive two partial responses
p->set_size(32);
CPPUNIT_ASSERT(pd->receive(next, p, .0));
CPPUNIT_ASSERT(pd->receive(next, p, .0));
// update checker
checker->receive(next, p, .0);
// profile should now terminate - not active, not locked
CPPUNIT_ASSERT(!pd->active(locked));
CPPUNIT_ASSERT(!locked);
// checker should have terminated
CPPUNIT_ASSERT(!checker->active(locked));
CPPUNIT_ASSERT(!locked);
// reset the checker
checker->reset();
// checker is active again
CPPUNIT_ASSERT(checker->active(locked));
// test locked profile
CPPUNIT_ASSERT(!wait->send(locked, p, next));
CPPUNIT_ASSERT(locked);
// issue PLAY event
CPPUNIT_ASSERT(wait->receiveEvent(Event(Event::ACTIVATION,
Event::TRIGGERED,wait->getId(),0)));
// test packet is now sent
CPPUNIT_ASSERT(wait->send(locked, p, next));
CPPUNIT_ASSERT(!locked);
}
void
TestAtp::testAtp_tpm() {
const string profile_0 = "testAtp_tpm_profile_0";
const string profile_1 = "testAtp_tpm_profile_1";
const unordered_set<string> profiles = {profile_0, profile_1};
// profile configuration object
Profile config_0, config_1;
// fill the configuration
makeProfile(&config_0, ProfileDescription { profile_0, Profile::READ });
// fill the FIFO configuration - pointer, maxLevel,
// startup level, OT, transactions, rate
makeFifoConfiguration(config_0.mutable_fifo(), 1000,
FifoConfiguration::EMPTY, 1, 4, 10);
// fill the Packet Descriptor configuration
PatternConfiguration* pk =
makePatternConfiguration(config_0.mutable_pattern(),
Command::READ_REQ,
Command::READ_RESP);
// configure the packet address and size generation policies
pk->set_size(32);
PatternConfiguration::Address* address = pk->mutable_address();
address->set_base(0);
address->set_increment(64);
PatternConfiguration::Stride* stride = pk->mutable_stride();
stride->set_increment(1);
stride->set_range("3B");
// register 1st profile
tpm->configureProfile(config_0);
// change fields for 2nd profile
// 2nd profile waits on 1st to complete
config_1 = config_0;
config_1.set_name(profile_1);
config_1.set_master_id(profile_1);
config_1.add_wait_for(profile_0);
// register 2nd profile
tpm->configureProfile(config_1);
// checks to see if list of masters was set correctly
CPPUNIT_ASSERT(tpm->getMasters() == profiles);
// checks to see if the number of slaves is 0
CPPUNIT_ASSERT(tpm->getMasterSlaves().empty());
// request packets to TPM
bool locked = false;
uint64_t next = 0, time = 0;
// every time a packet is generated, send a response
// to terminate test_profile and unlock test_profile2
// reuse request as response, so that it gets deallocated by ATP
// each profile sends 3 packets , then terminates
for (uint64_t i = 0; i < 4 ; ++i) {
auto packets = tpm->send(locked, next, time);
// only one masters sent packets
CPPUNIT_ASSERT(packets.size() == 1);
// test_profile sent a packet
CPPUNIT_ASSERT(packets.find(profile_0) != packets.end());
// one master is locked, so flag on
CPPUNIT_ASSERT(locked);
Packet* p = (packets.find(profile_0)->second);
CPPUNIT_ASSERT(p->addr()==(i<3?i:64));
p->set_cmd(Command::READ_RESP);
tpm->receive(0, p);
}
for (uint64_t i = 0; i < 4 ; ++i) {
// "test_profile2" is now unlocked
auto packets = tpm->send(locked, next, time);
// test_profile2 sent a packet
CPPUNIT_ASSERT(packets.find(profile_1) != packets.end());
// test_profile2 is locked, waiting for response
CPPUNIT_ASSERT(locked);
// TPM is waiting for responses
CPPUNIT_ASSERT(tpm->waiting());
// send the response
Packet* p = (packets.find(profile_1)->second);
CPPUNIT_ASSERT(p->addr()==(i<3?i:64));
p->set_cmd(Command::READ_RESP);
tpm->receive(0, p);
}
CPPUNIT_ASSERT(!tpm->waiting());
// no packets left to send
auto packets = tpm->send(locked, next, time);
CPPUNIT_ASSERT(packets.empty());
// check that the stream composed by profile 0 and 1 is completed
const uint64_t pId = tpm->profileId("testAtp_tpm_profile_0");
CPPUNIT_ASSERT(tpm->streamTerminated(pId));
// reset the stream from profile 0
tpm->streamReset(pId);
CPPUNIT_ASSERT(!tpm->streamTerminated(pId));
// play profile 0 again.
for (uint64_t i = 0; i < 4 ; ++i) {
auto packets = tpm->send(locked, next, time);
// only one masters sent packets
CPPUNIT_ASSERT(packets.size() == 1);
// test_profile sent a packet
CPPUNIT_ASSERT(packets.find(profile_0) != packets.end());
// one master is locked, so flag on
CPPUNIT_ASSERT(locked);
Packet* p = (packets.find(profile_0)->second);
CPPUNIT_ASSERT(p->addr()==(i<3?i:64));
p->set_cmd(Command::READ_RESP);
tpm->receive(0, p);
}
for (uint64_t i = 0; i < 4 ; ++i) {
// "test_profile2" is now unlocked
auto packets = tpm->send(locked, next, time);
// test_profile2 sent a packet
CPPUNIT_ASSERT(packets.find(profile_1) != packets.end());
// test_profile2 is locked, waiting for response
CPPUNIT_ASSERT(locked);
// TPM is waiting for responses
CPPUNIT_ASSERT(tpm->waiting());
// send the response
Packet* p = (packets.find(profile_1)->second);
CPPUNIT_ASSERT(p->addr()==(i<3?i:64));
p->set_cmd(Command::READ_RESP);
tpm->receive(0, p);
}
CPPUNIT_ASSERT(tpm->streamTerminated(pId));
// reset the TPM - this causes profiles to be reloaded
tpm->reset();
// register 1st profile
tpm->configureProfile(config_0);
// register 2nd profile
tpm->configureProfile(config_1);
// define a new profile, which also waits on profile 0
const string profile_2 = "testAtp_tpm_profile_2";
Profile config_2(config_1);
config_2.set_name(profile_2);
config_2.set_master_id(profile_2);
// change type to WRITE
config_2.set_type(Profile::WRITE);
// register 3nd profile
tpm->configureProfile(config_2);
// define a new profile, which waits on profile 1 and 2
const string profile_3 = "testAtp_tpm_profile_3";
Profile config_3(config_0);
config_3.set_name(profile_3);
config_3.set_master_id(profile_3);
config_3.add_wait_for(profile_1);
config_3.add_wait_for(profile_2);
// register 3nd profile
tpm->configureProfile(config_3);
/*
* profile 1 and profile 2 wait on profile 0 - all READ profiles,
* whilst profile 3 is of type WRITE and waits on 1 and 2.
* They all are configured with 4 transactions of 64 bytes each.
* They form a diamond-shaped stream.
* Each of them streams 3 packets with a stride of 1 byte distance,
* then jumps with an increment of 64 to issue the fourth.
* We therefore reconfigure the stream to constrain it to
* 64 (first increment) + 1 (left over packet) = 65 bytes per profile
* with a starting address base of 0x00FF
*/
const uint64_t rootId = tpm->profileId("testAtp_tpm_profile_0");
const uint64_t newRange =
tpm->addressStreamReconfigure(rootId, 0x00FF, 388);
// verify that the new range has been applied
CPPUNIT_ASSERT(newRange == 260);
// send all packets
for (uint64_t i = 0; i < 16 ; ++i) {
auto packets = tpm->send(locked, next, time);
if (!locked) time = next;
for (auto p: packets) {
p.second->set_cmd(Command::READ_RESP);
tpm->receive(time, p.second);
}
}
/* uniqueStream */
config_0.add_wait_for(profile_0 + " ACTIVATION");
auto reset { [this, &config_0, &config_1]() {
tpm->reset();
tpm->configureProfile(config_0); tpm->configureProfile(config_1);
} };
/* 1. First usage should return Root Profile ID of Original */
reset(); tpm->streamCacheUpdate();
uint64_t orig_id { tpm->profileId(profile_0) };
TrafficProfileDescriptor *orig { tpm->getProfile(orig_id) };
uint64_t clone0_id { tpm->uniqueStream(orig_id) };
TrafficProfileDescriptor *clone0 { tpm->getProfile(clone0_id) };
CPPUNIT_ASSERT(tpm->getStreamCache().size() == 1);
CPPUNIT_ASSERT(tpm->getProfileMap().size() == 2);
CPPUNIT_ASSERT(orig_id == clone0_id); CPPUNIT_ASSERT(orig == clone0);
/* 2. Non-first usage should create Clone and return its Root Profile ID
Clone name should be different from Original */
clone0_id = tpm->uniqueStream(orig_id);
clone0 = tpm->getProfile(clone0_id);
CPPUNIT_ASSERT(tpm->getStreamCache().size() == 2);
CPPUNIT_ASSERT(tpm->getProfileMap().size() == 4);
CPPUNIT_ASSERT(orig_id != clone0_id); CPPUNIT_ASSERT(orig != clone0);
uint64_t clone1_id = tpm->uniqueStream(orig_id);
TrafficProfileDescriptor *clone1 { tpm->getProfile(clone1_id) };
CPPUNIT_ASSERT(tpm->getStreamCache().size() == 3);
CPPUNIT_ASSERT(tpm->getProfileMap().size() == 6);
CPPUNIT_ASSERT(orig_id != clone1_id); CPPUNIT_ASSERT(orig != clone1);
CPPUNIT_ASSERT(clone0_id != clone1_id); CPPUNIT_ASSERT(clone0 != clone1);
/* 3. Clone state should be independent */
auto diff_conf { [this](const uint64_t id0, const uint64_t id1) {
tpm->addressStreamReconfigure(id0, 0x11, 0x123, Profile::READ);
tpm->addressStreamReconfigure(id1, 0xFF, 0x321, Profile::READ);
} };
/* 3.1 Original activated, one Packet per send, Original terminated,
Clones not terminated */
diff_conf(orig_id, clone0_id); orig->activate();
locked = false ; next = time = 0;
for (uint64_t txn { 0 }; txn < config_0.fifo().total_txn(); ++txn) {
auto packets { tpm->send(locked, next, time) };
CPPUNIT_ASSERT(packets.size() == 1);
for (auto &packet : packets) {
Packet *p { packet.second }; p->set_cmd(Command::READ_RESP);
tpm->receive(0, p);
}
}
// Handle remaining transactions
for (uint64_t txn { 0 }; txn < config_1.fifo().total_txn(); ++txn) {
for (auto &packet : tpm->send(locked, next, time)) {
Packet *p { packet.second }; p->set_cmd(Command::READ_RESP);
tpm->receive(0, p);
}
}
CPPUNIT_ASSERT(tpm->streamTerminated(orig_id));
CPPUNIT_ASSERT(!tpm->streamTerminated(clone0_id));
CPPUNIT_ASSERT(!tpm->streamTerminated(clone1_id));
// 3.2 Original and Clone activated, two Packets per Send, different
// addresses as configured, reset of Original does not reset Clone
reset(); tpm->streamCacheUpdate(); orig_id = tpm->profileId(profile_0);
tpm->uniqueStream(orig_id); clone0_id = tpm->uniqueStream(orig_id);
orig = tpm->getProfile(orig_id); clone0 = tpm->getProfile(clone0_id);
diff_conf(orig_id, clone0_id); orig->activate(); clone0->activate();
locked = false ; next = time = 0;
for (uint64_t txn { 0 }; txn < config_0.fifo().total_txn(); ++txn) {
auto packets { tpm->send(locked, next, time) };
CPPUNIT_ASSERT(packets.size() == 2);
Packet *p0 { packets.begin()->second },
*p1 { (++packets.begin())->second };
CPPUNIT_ASSERT(p0->addr() != p1->addr());
if (txn < 3) {
CPPUNIT_ASSERT(
(p0->addr() == 0x11 + txn && p1->addr() == 0xFF + txn) ||
(p0->addr() == 0xFF + txn && p1->addr() == 0x11 + txn)
);
}
for (auto &packet : packets) {
Packet *p { packet.second }; p->set_cmd(Command::READ_RESP);
tpm->receive(time, p);
}
}
// Handle remaining transactions
for (uint64_t txn { 0 }; txn < config_1.fifo().total_txn(); ++txn) {
auto packets { tpm->send(locked, next, time) };
CPPUNIT_ASSERT(packets.size() == 2);
for (auto &packet : packets) {
Packet *p { packet.second }; p->set_cmd(Command::READ_RESP);
tpm->receive(0, p);
}
}
CPPUNIT_ASSERT(tpm->streamTerminated(orig_id));
CPPUNIT_ASSERT(tpm->streamTerminated(clone0_id));
tpm->streamReset(orig_id);
CPPUNIT_ASSERT(!tpm->streamTerminated(orig_id));
CPPUNIT_ASSERT(tpm->streamTerminated(clone0_id));
/* 4. Diamond-shaped Stream Clones */
reset(); tpm->configureProfile(config_2); tpm->configureProfile(config_3);
tpm->streamCacheUpdate(); orig_id = tpm->profileId(profile_0);
tpm->uniqueStream(orig_id); clone0_id = tpm->uniqueStream(orig_id);
CPPUNIT_ASSERT(tpm->getStreamCache().size() == 2);
CPPUNIT_ASSERT(tpm->getProfileMap().size() == 8);
orig = tpm->getProfile(orig_id); clone0 = tpm->getProfile(clone0_id);
orig->activate(); clone0->activate();
locked = false ; next = time = 0;
for (uint64_t txn { 0 }; txn < 16; ++txn) {
auto packets { tpm->send(locked, next, time) };
for (auto &packet : packets) {
Packet *p { packet.second }; p->set_cmd(Command::READ_RESP);
tpm->receive(time, p);
}
if (next) time = next;
}
CPPUNIT_ASSERT(tpm->streamTerminated(orig_id));
CPPUNIT_ASSERT(tpm->streamTerminated(clone0_id));
tpm->streamReset(clone0_id);
CPPUNIT_ASSERT(tpm->streamTerminated(orig_id));
CPPUNIT_ASSERT(!tpm->streamTerminated(clone0_id));
/* 5. Stream Clones in different Masters */
reset(); orig_id = tpm->profileId(profile_0);
clone0_id = tpm->uniqueStream(orig_id, tpm->masterId(profile_1));
CPPUNIT_ASSERT(tpm->getStreamCache().size() == 2);
CPPUNIT_ASSERT(tpm->getProfileMap().size() == 4);
clone0 = tpm->getProfile(clone0_id); clone0->activate();
locked = false ; next = time = 0;
for (uint64_t txn { 0 }; txn < config_0.fifo().total_txn(); ++txn) {
for (auto &packet : tpm->send(locked, next, time)) {
Packet *p { packet.second };
CPPUNIT_ASSERT(p->master_id() == profile_1);
p->set_cmd(Command::READ_RESP); tpm->receive(0, p);
}
}
}
void TestAtp::testAtp_trafficProfileDelay() {
// profile configuration object
Profile config;
// fill the configuration
makeProfile(&config, ProfileDescription {
"testAtp_trafficProfileDelay_pause", Profile::READ });
// fill in the delay field
DelayConfiguration* delay = config.mutable_delay();
delay->set_time("2s");
// register delay profile
tpm->configureProfile(config);
// delay will return next == 2s in ATP time units
bool locked = false;
uint64_t next = 0, time = 0;
auto packets = tpm->send(locked, next, time);
// we should now find that delay is active
CPPUNIT_ASSERT(!tpm->isTerminated("testAtp_trafficProfileDelay_pause"));
// no transmission
CPPUNIT_ASSERT(packets.size() == 0);
// next is 2s in picoseconds (default ATP time resolution)
CPPUNIT_ASSERT(next==2*(1e+12));
// we should now find that delay is terminated
time = next;
packets = tpm->send(locked, next, time);
CPPUNIT_ASSERT(packets.size() == 0);
CPPUNIT_ASSERT(tpm->isTerminated("testAtp_trafficProfileDelay_pause"));
// register another profile
delay->set_time("3.7ns");
config.set_name("testAtp_trafficProfileDelay_pause_2");
config.set_master_id("testAtp_trafficProfileDelay_pause_2");
// register delay profile 2
tpm->configureProfile(config);
// call send
packets = tpm->send(locked, next, time);
// we should now find that delay is active
CPPUNIT_ASSERT(!tpm->isTerminated("testAtp_trafficProfileDelay_pause_2"));
// no transmission
CPPUNIT_ASSERT(packets.size() == 0);
// next is 3.7ns + 2s in picoseconds (default ATP time resolution)
CPPUNIT_ASSERT(next==(2*(1e+12) + 3700));
// we should now find that delay is terminated
time = next;
packets = tpm->send(locked, next, time);
CPPUNIT_ASSERT(packets.size() == 0);
CPPUNIT_ASSERT(tpm->isTerminated("testAtp_trafficProfileDelay_pause_2"));
// reset the profile
const uint64_t delayId = tpm->profileId("testAtp_trafficProfileDelay_pause_2");
tpm->getProfile(delayId)->reset();
// the profile should now be active again and have a next time equal to its delay
packets = tpm->send(locked, next, time);
// we should now find that delay is active
CPPUNIT_ASSERT(!tpm->isTerminated("testAtp_trafficProfileDelay_pause_2"));
// no transmission
CPPUNIT_ASSERT(packets.size() == 0);
// next is NOW (time) + 3.7ns in picoseconds (default ATP time resolution)
CPPUNIT_ASSERT(next==time+3700);
// allow for the delay to expire
time = next;
packets = tpm->send(locked, next, time);
// register another profile - white-spaces in delay specifier
delay->set_time("0.191 us");
config.set_name("testAtp_trafficProfileDelay_pause_3");
config.set_master_id("testAtp_trafficProfileDelay_pause_3");
// register delay profile 2
tpm->configureProfile(config);
// call send
packets = tpm->send(locked, next, time);
// we should now find that delay is active
CPPUNIT_ASSERT(!tpm->isTerminated("testAtp_trafficProfileDelay_pause_3"));
// no transmission
CPPUNIT_ASSERT(packets.size() == 0);
// next is 3.7ns + 2s + 0.191 us in picoseconds (default ATP time resolution)
CPPUNIT_ASSERT(next==(2*(1e+12) + 2*3700 + 191000));
// we should now find that delay is terminated
time = next;
packets = tpm->send(locked, next, time);
CPPUNIT_ASSERT(packets.size() == 0);
CPPUNIT_ASSERT(tpm->isTerminated("testAtp_trafficProfileDelay_pause_3"));
}
void TestAtp::testAtp_unitConversion() {
pair<uint64_t, uint64_t> result(0, 0);
// tests converting string to lowercase
CPPUNIT_ASSERT(Utilities::toLower("aBcDEFg")=="abcdefg");
// test reducing a fraction
auto h = Utilities::reduce<uint64_t>;
result = h(30,6);
CPPUNIT_ASSERT(result.first==5);
CPPUNIT_ASSERT(result.second==1);
// test number in string detection
CPPUNIT_ASSERT(Utilities::isNumber("10"));
CPPUNIT_ASSERT(!Utilities::isNumber("a"));
// test trimming of string
CPPUNIT_ASSERT(Utilities::trim(" t e s t ")=="test");
// test floating point string conversion to pair number, scale
auto g = Utilities::toUnsignedWithScale<uint64_t>;
result = g("1.34");
CPPUNIT_ASSERT(result.first==134);
CPPUNIT_ASSERT(result.second==100);
// test byte conversion from string
CPPUNIT_ASSERT(Utilities::toBytes<int>("512 Bytes")==512);
// test power of two rate detection
auto f = Utilities::toRate<uint64_t>;
result = f("3 TiB@s");
CPPUNIT_ASSERT(result.first==3);
CPPUNIT_ASSERT(result.second==1099511627776);
// test power of two rate, bits detection
result = f( " 5 Kibit/s");
CPPUNIT_ASSERT(result.first==5);
CPPUNIT_ASSERT(result.second==128);
// test rate in Gbytes detection
result = f( " 12.3 GBps");
// test rate in bits detection
CPPUNIT_ASSERT(result.first==123);
CPPUNIT_ASSERT(result.second==1e8);
// test rate in bytes detection
result = f( " 4.23 Bpus");
CPPUNIT_ASSERT(result.first==423);
CPPUNIT_ASSERT(result.second==1e4);
// test separator detection
result = f( "44 Bpps");
CPPUNIT_ASSERT(result.first==44);
CPPUNIT_ASSERT(result.second==1e12);
result = f("16 Tbit ps");
CPPUNIT_ASSERT(result.first==16);
CPPUNIT_ASSERT(result.second==(1e12)/8);
// tests hex conversion from int
CPPUNIT_ASSERT(Utilities::toHex(167489)=="0x28e41");
// tests next power of two calculation
CPPUNIT_ASSERT(Utilities::nextPowerTwo(27004)==16384);
}
void TestAtp::testAtp_kronos() {
// set Kronos bucket width and calendar size
tpm->setKronosConfiguration("3ps","15ps");
// create a Kronos system
Kronos k (tpm);
// initialize Kronos and checks for no schedules events
CPPUNIT_ASSERT(!k.isInitialized());
k.init();
CPPUNIT_ASSERT(k.isInitialized());
CPPUNIT_ASSERT(!k.next());
// generate events and register to Kronos
for (uint64_t i=0; i < 30; i+=3) {
Event ev(Event::TICK,Event::TRIGGERED,i,i);
k.schedule(ev);
CPPUNIT_ASSERT(k.getCounter()==(i+3)/3);
}
// get events while advancing TPM time
for (uint64_t i=3; i < 30; i+=6) {
tpm->setTime(i);
list<Event> q;
k.get(q);
CPPUNIT_ASSERT(!q.empty() && (q.size()==2));
for (auto& ev:q){
CPPUNIT_ASSERT(ev.action==Event::TRIGGERED);
CPPUNIT_ASSERT((ev.time==i) || (ev.time==(i-3)));
CPPUNIT_ASSERT((ev.id==i) || (ev.id==(i-3)));
}
CPPUNIT_ASSERT((k.getCounter()==0) || k.next()==(i+3));
}
// should be no scheduled events
CPPUNIT_ASSERT(!k.next());
}
void TestAtp::testAtp_trafficProfileSlave() {
// profile configuration object
Profile config;
bool locked = false;
// fill the configuration for testing the buffer
makeProfile(&config, ProfileDescription {
"testAtp_testAtp_trafficProfileSlave", Profile::READ });
// fill in the slave field
SlaveConfiguration* slave_cfg = config.mutable_slave();
slave_cfg->set_latency("80ns");
slave_cfg->set_rate("32GBps");
slave_cfg->set_granularity(16);
slave_cfg->set_ot_limit(6);
// register slave profile
tpm->configureProfile(config);
// get pointer to slave
auto slave = tpm->getProfile(0);
Packet* req = nullptr;
uint64_t next = 0;
bool ok = false;
/*
* Here the first 2 packets will be sent, but no further.
* This is because of the size 33 and granularity 16. So
* each packet will actually take up 3 slots. So after 2
* packets have been sent, no more packets can be be in
* transit as the buffer is full. So here we will test
* to make sure this happens.
*/
for (uint64_t i=0; i<slave_cfg->ot_limit(); i++) {
req = new Packet;
req->set_cmd(READ_REQ);
req->set_addr(0);
req->set_size(33);
ok = slave->receive(next,req,0);
CPPUNIT_ASSERT(i>1?!ok:ok);
}
// fill the configuration for testing the OT limit
makeProfile(&config, ProfileDescription {
"testAtp_testAtp_trafficProfileSlave_2", Profile::READ });
// fill in the slave field
SlaveConfiguration* slave_cfg_2 = config.mutable_slave();
slave_cfg_2->set_latency("80ns");
slave_cfg_2->set_rate("32GBps");
slave_cfg_2->set_granularity(16);
slave_cfg_2->set_ot_limit(6);
// register slave profile
tpm->configureProfile(config);
// get pointer to slave
auto slave_2 = tpm->getProfile(1);
req = nullptr;
next = 0;
/*
* Here we see that the size of the packets fit
* perfectly into the buffer, so 6 packets can be
* in transit. We will test to make sure that once
* the limit has been reached that the slave then
* becomes locked
* attempt another send after reset,
* which should succeed
* only one response should then be available for transmission
*/
for (uint64_t i=0; i<slave_cfg_2->ot_limit()+2; i++) {
req = new Packet;
req->set_cmd(READ_REQ);
req->set_addr(0);
req->set_size(16);
if (i>slave_cfg_2->ot_limit()) {
// resets the slave for the last request
slave_2->reset();
}
bool ok = slave_2->receive(next,req,0);
if (i<slave_cfg_2->ot_limit()) {
// requests within the OT limit are accepted
CPPUNIT_ASSERT(ok);
} else if (i==slave_cfg_2->ot_limit()) {
// request is rejected due to OT limit reached
CPPUNIT_ASSERT(!ok);
} else if (i>slave_cfg_2->ot_limit()) {
// last request is accepted after reset
CPPUNIT_ASSERT(ok);
}
}
// get responses - advance TPM time to memory latency
tpm->setTime(80000);
locked = false;
Packet* res = nullptr;
next = 0;
for (uint64_t i=0; i<slave_cfg_2->ot_limit(); i++) {
ok = slave_2->send(locked,res,next);
if (ok) {
delete res;
}
// only one response is available (one request after reset)
CPPUNIT_ASSERT(i==0||!ok);
}
}
void TestAtp::testAtp_trafficProfileManagerRouting() {
// number of master/slave pairs to test
const uint8_t nPairs = 10;
// fill the configurations
const string master = "testAtp_trafficProfileManagerRouting_master";
const string slave = "testAtp_trafficProfileManagerRouting_slave";
// profile configuration objects
Profile masters[nPairs];
Profile slaves[nPairs];
std::set<pair<string,string>> slaveToMasterMap;
for (uint8_t i = 0; i < nPairs; ++i) {
const string num = to_string(i);
string mName = master + num;
string sName = slave + num;
slaveToMasterMap.insert(pair <string,string> (mName,sName));
makeProfile(&masters[i], ProfileDescription {
mName, Profile::READ, &mName });
makeProfile(&slaves[i], ProfileDescription {
sName, Profile::READ, &sName });
// fill in the master field
// fill the FIFO configuration - pointer, maxLevel,
// startup level, OT, transactions, rate
makeFifoConfiguration(masters[i].mutable_fifo(), 1000,
FifoConfiguration::EMPTY, 2, 10, 2);
// fill the Packet Descriptor configuration
PatternConfiguration* pk =
makePatternConfiguration(masters[i].mutable_pattern(),
Command::READ_REQ,
Command::READ_RESP);
// configure the packet address and size generation policies
pk->set_size(64);
PatternConfiguration::Address* address = pk->mutable_address();
address->set_base(0);
address->set_increment(64);
// fill in the slave field
SlaveConfiguration* slave_cfg = slaves[i].mutable_slave();
slave_cfg->set_latency("80ns");
slave_cfg->set_rate("32GBps");
slave_cfg->set_granularity(16);
slave_cfg->set_ot_limit(6);
slave_cfg->add_master(mName);
tpm->configureProfile(masters[i]);
tpm->configureProfile(slaves[i]);
}
// Checks to make sure each master and slave pair were added correctly, and
// then removes it.
for (const auto& pair: tpm->getMasterSlaves()) {
CPPUNIT_ASSERT(slaveToMasterMap.find(pair) != slaveToMasterMap.end());
slaveToMasterMap.erase(pair);
}
// Checks to make sure that the mapping is now empty
CPPUNIT_ASSERT(slaveToMasterMap.empty());
// start TPM internal routing
tpm->loop();
}
CppUnit::TestSuite* TestAtp::suite() {
CppUnit::TestSuite* suiteOfTests = new CppUnit::TestSuite("TestAtp");
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test0 - Tests the ATP FIFO",
&TestAtp::testAtp_fifo ));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test1 - Tests the ATP Event",
&TestAtp::testAtp_event ));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test2 - Tests the ATP Packet Descriptor",
&TestAtp::testAtp_packetDesc ));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test3 - Tests the ATP Stats object",
&TestAtp::testAtp_stats ));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test4 - Tests the ATP Traffic Profile",
&TestAtp::testAtp_trafficProfile ));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test5 - Tests the ATP Traffic Profile Manager",
&TestAtp::testAtp_tpm ));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test6 - Tests the ATP Traffic Profile Delay",
&TestAtp::testAtp_trafficProfileDelay ));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test 7 - Tests the ATP Unit Conversion Utilities",
&TestAtp::testAtp_unitConversion));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test 8 - Tests the Kronos engine",
&TestAtp::testAtp_kronos));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test 9 - Tests the ATP Traffic Profile Slave",
&TestAtp::testAtp_trafficProfileSlave));
suiteOfTests->addTest(new CppUnit::TestCaller<TestAtp>(
"Test 10 - Tests the ATP Traffic Profile Manager routing",
&TestAtp::testAtp_trafficProfileManagerRouting));
return suiteOfTests;
}
} // end of namespace
| 34.892643
| 121
| 0.63823
|
wwmfdb
|
805e6bc7723f90f790ec29fb614e1b636c31e5f5
| 2,365
|
cpp
|
C++
|
Receiver/src/main.cpp
|
rhymu8354/SocketTutorial
|
9f6b6c243da6ac0b7e6754d5b2edc8f803d8c1ef
|
[
"MIT"
] | 28
|
2020-06-25T03:19:26.000Z
|
2021-12-08T04:27:09.000Z
|
Receiver/src/main.cpp
|
rhymu8354/SocketTutorial
|
9f6b6c243da6ac0b7e6754d5b2edc8f803d8c1ef
|
[
"MIT"
] | 1
|
2021-09-21T06:32:29.000Z
|
2021-09-21T06:32:29.000Z
|
Receiver/src/main.cpp
|
rhymu8354/SocketTutorial
|
9f6b6c243da6ac0b7e6754d5b2edc8f803d8c1ef
|
[
"MIT"
] | 5
|
2020-11-26T23:38:52.000Z
|
2022-01-13T13:02:20.000Z
|
#include <inttypes.h>
#include <signal.h>
#include <Sockets/DatagramSocket.hpp>
#include <stdio.h>
#include <stdlib.h>
#include <thread>
namespace {
// This is the UDP port number at which we will receive messages.
constexpr uint16_t port = 8000;
// This flag is set by our SIGINT signal handler in order to cause the main
// program's polling loop to exit and let the program clean up and
// terminate.
bool shutDown = false;
// This function is provided to the event loop to be called whenever a
// message is received at our socket.
//
// When this happens, simply print the message to standard output.
void OnReceiveMessage(const std::string& message) {
printf("Received message: %s\n", message.c_str());
}
// This function is set up to be called whenever the SIGINT signal
// (interrupt signal, typically sent when the user presses <Ctrl>+<C> on
// the terminal) is sent to the program. We just set a flag which is
// checked in the program's polling loop to control when the loop is
// exited.
void OnSigInt(int) {
shutDown = true;
}
// This is the function called from the main program in order to operate
// the socket while a SIGINT handler is set up to control when the program
// should terminate.
int InterruptableMain() {
// Make a socket and assign an address to it.
Sockets::DatagramSocket receiver;
if (!receiver.Bind(port)) {
return EXIT_FAILURE;
}
// Start the event loop to process the sending and receiving of
// datagrams.
receiver.Start(OnReceiveMessage);
printf("Now listening for messages on port %" PRIu16 "...\n", port);
// Poll the flag set by our SIGINT handler, until it is set.
while (!shutDown) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
printf("Program exiting.\n");
return EXIT_SUCCESS;
}
}
int main(int argc, char* argv[]) {
// Catch SIGINT (interrupt signal, typically sent when the user presses
// <Ctrl>+<C> on the terminal) during program execution.
const auto previousInterruptHandler = signal(SIGINT, OnSigInt);
const auto returnValue = InterruptableMain();
(void)signal(SIGINT, previousInterruptHandler);
return returnValue;
}
| 34.779412
| 79
| 0.660888
|
rhymu8354
|
8067fbf9ccdc6bffb693b8ea482f3205352d6a6c
| 3,101
|
tpp
|
C++
|
code/source/ui/hid/actionlistener.tpp
|
crafn/clover
|
586acdbcdb34c3550858af125e9bb4a6300343fe
|
[
"MIT"
] | 12
|
2015-01-12T00:19:20.000Z
|
2021-08-05T10:47:20.000Z
|
code/source/ui/hid/actionlistener.tpp
|
crafn/clover
|
586acdbcdb34c3550858af125e9bb4a6300343fe
|
[
"MIT"
] | null | null | null |
code/source/ui/hid/actionlistener.tpp
|
crafn/clover
|
586acdbcdb34c3550858af125e9bb4a6300343fe
|
[
"MIT"
] | null | null | null |
template <nodes::SignalType S>
ActionListener<S>::ActionListener( const ContextChannel::Name& channel_name,
const Context::Tag& context_tag,
const Action::Name& action_name,
Callback on_action){
startListening(channel_name, context_tag, action_name,
createTypeSafeCallback(on_action));
}
template <nodes::SignalType S>
ActionListener<S>::ActionListener( const ContextChannel::Name& channel_name,
const Context::Tag& context_tag,
const Action::Name& action_name,
GenericCb on_action){
startListening(channel_name, context_tag, action_name, on_action);
}
template <nodes::SignalType S>
ActionListener<S>::ActionListener(const ActionListener& other){
startListening(other);
}
template <nodes::SignalType S>
ActionListener<S>::ActionListener(ActionListener&& other){
other.stopListening();
startListening(other);
}
template <nodes::SignalType S>
ActionListener<S>::~ActionListener(){
stopListening();
}
template <nodes::SignalType S>
ActionListener<S>& ActionListener<S>::operator=(const ActionListener& other){
stopListening();
startListening(other);
return *this;
}
template <nodes::SignalType S>
ActionListener<S>& ActionListener<S>::operator=(ActionListener&& other){
other.stopListening();
stopListening();
startListening(other);
return *this;
}
template <nodes::SignalType S>
template <int Dummy>
typename ActionListener<S>::GenericCb
ActionListener<S>::createTypeSafeCallbackWithValue(Callback on_action) const {
return [on_action, this] (nodes::SignalValue sig_value){
Value value;
try {
value= sig_value.get<S>();
}
catch (...){
print(debug::Ch::General, debug::Vb::Critical,
"ui::hid::ActionListener::onAction(..): Invalid type for action %s: %s for %s (fix control mappings)",
getActionName().cStr(),
nodes::RuntimeSignalTypeTraits::enumString(S).cStr(),
nodes::RuntimeSignalTypeTraits::enumString(sig_value.getType()).cStr());
return;
}
on_action(value);
};
}
template <nodes::SignalType S>
template <int Dummy>
typename ActionListener<S>::GenericCb
ActionListener<S>::createTypeSafeCallbackWithoutValue(Callback on_action) const {
return [on_action] (nodes::SignalValue){ on_action(); };
}
template <nodes::SignalType S>
void ActionListener<S>::triggerCallback(const Action& action) const {
ensure(isListening());
ensure(onActionCallback);
onActionCallback(action.getValue());
}
template <nodes::SignalType S>
void ActionListener<S>::startListening(const ContextChannel::Name& channel_name, const Context::Tag& context_tag, const Action::Name& action_name, GenericCb on_action){
channelName= channel_name;
contextTag= context_tag;
actionName= action_name;
onActionCallback= on_action;
Base::onActionListeningStart(*this);
}
template <nodes::SignalType S>
void ActionListener<S>::startListening(const ActionListener& other){
startListening(other.channelName, other.contextTag, other.actionName, other.onActionCallback);
}
template <nodes::SignalType S>
void ActionListener<S>::stopListening(){
if (isListening()){
Base::onActionListeningStop(*this);
}
}
| 29.254717
| 168
| 0.750726
|
crafn
|
80754a668bb28675bc4251228b13ef9225016b78
| 1,170
|
cc
|
C++
|
config/tests/iconv.cc
|
henkdemarie/dicom-dimse-native
|
a2a5042de8c5de04831baf3de7182ea2eb7b78f8
|
[
"MIT"
] | 29
|
2020-02-13T17:40:16.000Z
|
2022-03-12T14:58:22.000Z
|
config/tests/iconv.cc
|
henkdemarie/dicom-dimse-native
|
a2a5042de8c5de04831baf3de7182ea2eb7b78f8
|
[
"MIT"
] | 20
|
2020-03-20T18:06:31.000Z
|
2022-02-25T08:38:08.000Z
|
config/tests/iconv.cc
|
henkdemarie/dicom-dimse-native
|
a2a5042de8c5de04831baf3de7182ea2eb7b78f8
|
[
"MIT"
] | 9
|
2020-03-20T17:29:55.000Z
|
2022-02-14T10:15:33.000Z
|
/*
* Copyright (C) 2018, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were developed by
*
* OFFIS e.V.
* R&D Division Health
* Escherweg 2
* D-26121 Oldenburg, Germany
*
*
* Module: config
*
* Author: Jan Schlamelcher
*
* Purpose: Analyze behavior of an iconv implementation.
*/
#include <iconv.h>
#include <stdio.h>
int main()
{
char input[2] = { '\366', '\0' };
char output[8];
iconv_t i = iconv_open( "ASCII", "ISO-8859-1" );
if( (iconv_t)-1 != i )
{
iconv( i, 0, 0, 0, 0 );
#ifdef LIBICONV_SECOND_ARGUMENT_CONST
const
#endif
char* in = input;
char* out = output;
size_t ins = 1;
size_t outs = 8;
const size_t result = iconv( i, &in, &ins, &out, &outs );
iconv_close( i );
if( ~(size_t)0 == result )
{
printf( "AbortTranscodingOnIllegalSequence" );
return 0;
}
if( 8 == outs ) // output buffer not touched
{
printf( "DiscardIllegalSequences" );
return 0;
}
}
return 1;
}
| 22.075472
| 65
| 0.538462
|
henkdemarie
|
8081e2164b2e6afc7d999f573f34ec1a4131ccef
| 910
|
cpp
|
C++
|
Number of Coins - GFG/number-of-coins.cpp
|
Jatin-Shihora/LeetCode-Solutions
|
8e6fc84971ec96ec1263ba5ba2a8ae09e6404398
|
[
"MIT"
] | 1
|
2022-01-02T10:29:32.000Z
|
2022-01-02T10:29:32.000Z
|
Number of Coins - GFG/number-of-coins.cpp
|
Jatin-Shihora/LeetCode-Solutions
|
8e6fc84971ec96ec1263ba5ba2a8ae09e6404398
|
[
"MIT"
] | null | null | null |
Number of Coins - GFG/number-of-coins.cpp
|
Jatin-Shihora/LeetCode-Solutions
|
8e6fc84971ec96ec1263ba5ba2a8ae09e6404398
|
[
"MIT"
] | 1
|
2022-03-04T12:44:14.000Z
|
2022-03-04T12:44:14.000Z
|
// { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int minCoins(int coins[], int M, int V)
{
// Your code goes here
int dp[V+1];
dp[0] = 0 ;
for(int i=1;i<=V;i++) dp[i] = INT_MAX;
for(int i=1;i<=V;i++){
for(int j=0;j<M;j++){
if(coins[j]<=i){
int res = dp[i-coins[j]];
if(res!=INT_MAX)
dp[i] = min(dp[i],res+1);
}
}
}
return dp[V]==INT_MAX?-1:dp[V];
}
};
// { Driver Code Starts.
int main()
{
int t;
cin >> t;
while (t--)
{
int v, m;
cin >> v >> m;
int coins[m];
for(int i = 0; i < m; i++)
cin >> coins[i];
Solution ob;
cout << ob.minCoins(coins, m, v) << "\n";
}
return 0;
}
// } Driver Code Ends
| 17.169811
| 46
| 0.414286
|
Jatin-Shihora
|
8081f77ad22462c18d1483e12413ea11fff88d8a
| 46
|
cpp
|
C++
|
src/libs/ocMath/Point2d.cpp
|
TO85/OttoCODE
|
48f0ea1be3c55cf63f508db93a2794b10bc346c8
|
[
"MIT"
] | 2
|
2021-08-15T17:21:27.000Z
|
2021-08-20T21:41:16.000Z
|
src/libs/ocMath/Point2d.cpp
|
TO85/OttoCODE
|
48f0ea1be3c55cf63f508db93a2794b10bc346c8
|
[
"MIT"
] | 8
|
2022-01-19T08:18:51.000Z
|
2022-03-13T14:45:03.000Z
|
src/libs/ocMath/Point2d.cpp
|
TO85/torc
|
fb21aa272192023fec9d5e1018c291e26462fd36
|
[
"MIT"
] | null | null | null |
#include "Point2d.h"
Point2d::Point2d()
{
}
| 6.571429
| 20
| 0.630435
|
TO85
|
8092684d8aeb7d29e32f21e1371ca51c03fba9b8
| 1,417
|
hpp
|
C++
|
cpp/godot-cpp/include/gen/Shader.hpp
|
GDNative-Gradle/proof-of-concept
|
162f467430760cf959f68f1638adc663fd05c5fd
|
[
"MIT"
] | 1
|
2021-03-16T09:51:00.000Z
|
2021-03-16T09:51:00.000Z
|
cpp/godot-cpp/include/gen/Shader.hpp
|
GDNative-Gradle/proof-of-concept
|
162f467430760cf959f68f1638adc663fd05c5fd
|
[
"MIT"
] | null | null | null |
cpp/godot-cpp/include/gen/Shader.hpp
|
GDNative-Gradle/proof-of-concept
|
162f467430760cf959f68f1638adc663fd05c5fd
|
[
"MIT"
] | null | null | null |
#ifndef GODOT_CPP_SHADER_HPP
#define GODOT_CPP_SHADER_HPP
#include <gdnative_api_struct.gen.h>
#include <stdint.h>
#include <core/CoreTypes.hpp>
#include <core/Ref.hpp>
#include "Shader.hpp"
#include "Resource.hpp"
namespace godot {
class Texture;
class Shader : public Resource {
struct ___method_bindings {
godot_method_bind *mb_get_code;
godot_method_bind *mb_get_default_texture_param;
godot_method_bind *mb_get_mode;
godot_method_bind *mb_has_param;
godot_method_bind *mb_set_code;
godot_method_bind *mb_set_default_texture_param;
};
static ___method_bindings ___mb;
public:
static void ___init_method_bindings();
static inline const char *___get_class_name() { return (const char *) "Shader"; }
static inline Object *___get_from_variant(Variant a) { godot_object *o = (godot_object*) a; return (o) ? (Object *) godot::nativescript_1_1_api->godot_nativescript_get_instance_binding_data(godot::_RegisterState::language_index, o) : nullptr; }
// enums
enum Mode {
MODE_SPATIAL = 0,
MODE_CANVAS_ITEM = 1,
MODE_PARTICLES = 2,
};
// constants
static Shader *_new();
// methods
String get_code() const;
Ref<Texture> get_default_texture_param(const String param) const;
Shader::Mode get_mode() const;
bool has_param(const String name) const;
void set_code(const String code);
void set_default_texture_param(const String param, const Ref<Texture> texture);
};
}
#endif
| 24.431034
| 245
| 0.768525
|
GDNative-Gradle
|
80937a3344b282b72997fbe04f38d7d1554b3e03
| 1,303
|
hpp
|
C++
|
third_party/boost/simd/function/refine_rsqrt.hpp
|
SylvainCorlay/pythran
|
908ec070d837baf77d828d01c3e35e2f4bfa2bfa
|
[
"BSD-3-Clause"
] | 6
|
2018-02-25T22:23:33.000Z
|
2021-01-15T15:13:12.000Z
|
third_party/boost/simd/function/refine_rsqrt.hpp
|
SylvainCorlay/pythran
|
908ec070d837baf77d828d01c3e35e2f4bfa2bfa
|
[
"BSD-3-Clause"
] | null | null | null |
third_party/boost/simd/function/refine_rsqrt.hpp
|
SylvainCorlay/pythran
|
908ec070d837baf77d828d01c3e35e2f4bfa2bfa
|
[
"BSD-3-Clause"
] | 7
|
2017-12-12T12:36:31.000Z
|
2020-02-10T14:27:07.000Z
|
//==================================================================================================
/*!
@file
@copyright 2016 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
//==================================================================================================
#ifndef BOOST_SIMD_FUNCTION_REFINE_RSQRT_HPP_INCLUDED
#define BOOST_SIMD_FUNCTION_REFINE_RSQRT_HPP_INCLUDED
#if defined(DOXYGEN_ONLY)
namespace boost { namespace simd
{
/*!
@ingroup group-arithmetic
This function object performs a Newton-Raphson step to improve precision of rsqrt estimate.
This function can be used in conjunction with raw_(rsqrt)
to add more precision to the estimates if their default
precision is not enough.
@par Header <boost/simd/function/refine_rsqrt.hpp>
@par semantic:
@code
auto r = refine_rsqrt(x, est);
@endcode
is similar to
@code
auto r = fma( fnms(x, sqr(est), 1), est/2, est);
@endcode
@see rec
**/
IEEEValue refine_rsqrt(IEEEValue const& x, IEEEValue const& est);
} }
#endif
#include <boost/simd/function/scalar/refine_rsqrt.hpp>
#include <boost/simd/function/simd/refine_rsqrt.hpp>
#endif
| 24.584906
| 100
| 0.606293
|
SylvainCorlay
|
809ebd14915c0890cc407b1c94923460312d5c72
| 115
|
cpp
|
C++
|
examples/implementation/greeter.cpp
|
dwd31415/emscripten-build-tool
|
0e8d1ec10f0fc899d07873ee1bed8e61b48d31c0
|
[
"MIT"
] | null | null | null |
examples/implementation/greeter.cpp
|
dwd31415/emscripten-build-tool
|
0e8d1ec10f0fc899d07873ee1bed8e61b48d31c0
|
[
"MIT"
] | null | null | null |
examples/implementation/greeter.cpp
|
dwd31415/emscripten-build-tool
|
0e8d1ec10f0fc899d07873ee1bed8e61b48d31c0
|
[
"MIT"
] | null | null | null |
#include "greeter.h"
void Greeter::greet(std::string name)
{
std::cout << this->greeting << name << std::endl;
}
| 16.428571
| 50
| 0.643478
|
dwd31415
|
80a082797bce020722e5a80eef379cc17550980b
| 3,423
|
cpp
|
C++
|
Chaos-Engine/Material.cpp
|
MrAbnox/Chaos-Engine
|
cad124526f416d661f110ac1fcc7070f4ae9fedf
|
[
"MIT"
] | 1
|
2020-02-10T13:30:44.000Z
|
2020-02-10T13:30:44.000Z
|
Chaos-Engine/Material.cpp
|
MrAbnox/Chaos-Engine
|
cad124526f416d661f110ac1fcc7070f4ae9fedf
|
[
"MIT"
] | null | null | null |
Chaos-Engine/Material.cpp
|
MrAbnox/Chaos-Engine
|
cad124526f416d661f110ac1fcc7070f4ae9fedf
|
[
"MIT"
] | null | null | null |
#include "Material.h"
#include "TheShader.h"
#include "TheDebug.h"
//-------------------------------------------------------------------------------
//Constructor
//-------------------------------------------------------------------------------
Material::Material()
{
name = "Material";
shininess = 0;
ambient = glm::vec3(1.0f);
diffuse = glm::vec3(1.0f);
specular = glm::vec3(1.0f);
}
//-------------------------------------------------------------------------------
//Destructor
//-------------------------------------------------------------------------------
Material::~Material()
{
}
//-------------------------------------------------------------------------------
//Send Data
//-------------------------------------------------------------------------------
void Material::SendData(Materials m, std::string shader)
{
std::string tempString;
switch (m)
{
case Materials::M_AMBIENT:
tempString = shader + "_material.ambient";
TheShader::Instance()->SendUniformData(tempString.c_str(), ambient);
break;
case Materials::M_SPECULAR:
tempString = shader + "_material.diffuse";
TheShader::Instance()->SendUniformData(tempString.c_str(), diffuse);
break;
case Materials::M_DIFFUSE:
tempString = shader + "_material.specular";
TheShader::Instance()->SendUniformData(tempString.c_str(), specular);
break;
case Materials::M_SHINE:
tempString = shader + "_material.shininess";
TheShader::Instance()->SendUniformData(tempString.c_str(), shininess);
break;
default:
break;
}
}
//-------------------------------------------------------------------------------
//Get Ambient
//-------------------------------------------------------------------------------
glm::vec3 Material::GetAmbient() const
{
return ambient;
}
//-------------------------------------------------------------------------------
//Get Diffuse
//-------------------------------------------------------------------------------
glm::vec3 Material::GetDiffuse() const
{
return diffuse;
}
//-------------------------------------------------------------------------------
//Get Specular
//-------------------------------------------------------------------------------
glm::vec3 Material::GetSpecular() const
{
return specular;
}
//-------------------------------------------------------------------------------
//Set Ambient
//-------------------------------------------------------------------------------
void Material::SetAmbient(glm::vec3 v3)
{
ambient = v3;
}
//-------------------------------------------------------------------------------
//Set Diffuse
//-------------------------------------------------------------------------------
void Material::SetDiffuse(glm::vec3 v3)
{
diffuse = v3;
}
//-------------------------------------------------------------------------------
//Set Specular
//-------------------------------------------------------------------------------
void Material::SetSpecular(glm::vec3 v3)
{
specular = v3;
}
//-------------------------------------------------------------------------------
//Set Shine
//-------------------------------------------------------------------------------
void Material::SetShine(float m_shininess)
{
shininess = m_shininess;
}
| 28.057377
| 82
| 0.322232
|
MrAbnox
|
80a1accc0ac9c2b7d6fbcf56cf38871659f33407
| 2,193
|
cpp
|
C++
|
13.cpp
|
malkiewiczm/adventofcode2020
|
8491a5a0be11fa8cfa61d67c97401797c0e7cf6b
|
[
"Apache-2.0"
] | null | null | null |
13.cpp
|
malkiewiczm/adventofcode2020
|
8491a5a0be11fa8cfa61d67c97401797c0e7cf6b
|
[
"Apache-2.0"
] | null | null | null |
13.cpp
|
malkiewiczm/adventofcode2020
|
8491a5a0be11fa8cfa61d67c97401797c0e7cf6b
|
[
"Apache-2.0"
] | null | null | null |
//#define PARTONE
#include "template.hpp"
#define INF(T) std::numeric_limits<T>::max()
#ifndef PARTONE
struct BusPair {
I64 line;
I64 order;
};
static inline std::ostream &operator<< (std::ostream &o, const BusPair &pair)
{
o << "{ line: " << pair.line << ", order: " << pair.order << " }";
return o;
}
#endif
int main(int argc, char **argv)
{
const char *const fname = (argc >= 2) ? argv[1] : "in.txt";
std::ifstream f(fname);
if (! f.good()) {
TRACE << "file cannot be opened" << std::endl;
die();
}
int start_time;
f >> start_time;
#ifdef PARTONE
std::vector<int> bus_lines;
{
std::string line;
std::getline(f, line);
std::getline(f, line);
size_t start = 0;
size_t end;
for (end = 0; (end = line.find(',', end)) != std::string::npos; ++end) {
const std::string token = line.substr(start, end - start);
start = end + 1;
if (token[0] == 'x')
continue;
bus_lines.push_back(atoi(token.c_str()));
}
{
const std::string token = line.substr(start, end - start);
bus_lines.push_back(atoi(token.c_str()));
}
}
int smallest = INF(int);
int which_line = 0;
for (auto bus : bus_lines) {
const int amt = bus - (start_time % bus);
if (amt < smallest) {
smallest = amt;
which_line = bus;
}
}
trace(smallest * which_line);
#else
std::vector<BusPair> bus_lines;
{
std::string line;
std::getline(f, line);
std::getline(f, line);
size_t start = 0;
size_t end;
int i = -1;
for (end = 0; (end = line.find(',', end)) != std::string::npos; ++end) {
const std::string token = line.substr(start, end - start);
start = end + 1;
++i;
if (token[0] == 'x')
continue;
bus_lines.push_back({ atoi(token.c_str()), i});
}
{
const std::string token = line.substr(start, end - start);
++i;
bus_lines.push_back({ atoi(token.c_str()), i});
}
}
I64 t = 0;
int solved = 0;
I64 step = 1;
for ( ; ; ) {
const BusPair &bus = bus_lines[solved];
const I64 level = (t + bus.order) % bus.line;
if (level == 0) {
// we have solved this line
++solved;
if (solved == static_cast<int>(bus_lines.size()))
break;
step = std::lcm(step, bus.line);
}
t += step;
}
trace(t);
#endif
}
| 21.712871
| 77
| 0.588235
|
malkiewiczm
|
80a1d9ad5e474a1350b805d04546a7092717587d
| 227
|
cpp
|
C++
|
NgineApp/src/NgineApplication.cpp
|
nak1411/Ngine
|
1f8d0784c43780f8a53149dc176f877aa12e6d7d
|
[
"Apache-2.0"
] | 1
|
2022-02-26T08:43:14.000Z
|
2022-02-26T08:43:14.000Z
|
NgineApp/src/NgineApplication.cpp
|
nak1411/Ngine
|
1f8d0784c43780f8a53149dc176f877aa12e6d7d
|
[
"Apache-2.0"
] | null | null | null |
NgineApp/src/NgineApplication.cpp
|
nak1411/Ngine
|
1f8d0784c43780f8a53149dc176f877aa12e6d7d
|
[
"Apache-2.0"
] | null | null | null |
#include <Ngine.h>
#include"Ngine/Core/EntryPoint.h"
class NgineApp : public Ngine::Application
{
public:
NgineApp()
{
}
~NgineApp()
{
}
};
Ngine::Application* Ngine::CreateApplication()
{
return new NgineApp();
}
| 9.869565
| 46
| 0.669604
|
nak1411
|
80a1f117850185069dcd0ec18217efebeae81d40
| 905
|
cpp
|
C++
|
119. Pascal's Triangle II.cpp
|
NeoYY/Leetcode-Solution
|
0f067973d3c296ac7f2fa85a89dbdd5295b0b037
|
[
"MIT"
] | null | null | null |
119. Pascal's Triangle II.cpp
|
NeoYY/Leetcode-Solution
|
0f067973d3c296ac7f2fa85a89dbdd5295b0b037
|
[
"MIT"
] | null | null | null |
119. Pascal's Triangle II.cpp
|
NeoYY/Leetcode-Solution
|
0f067973d3c296ac7f2fa85a89dbdd5295b0b037
|
[
"MIT"
] | null | null | null |
/*
Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle.
Note that the row index starts from 0.
In Pascal's triangle, each number is the sum of the two numbers directly above it.
Example:
Input: 3
Output: [1,3,3,1]
Follow up:
Could you optimize your algorithm to use only O(k) extra space?
This solution is already optimized, using dynamic allocation, only need one previous vector, reduce space usage
*/
class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<int> temp;
vector<int> curr;
temp.push_back( 1 );
curr.push_back( 1 );
for ( int i = 1; i <= rowIndex; i++ )
{
curr.resize( i + 1, 1 );
for ( int j = 1; j < i; j++ )
{
curr[j] = temp[j - 1] + temp[j];
}
temp = curr;
}
return curr;
}
};
| 22.625
| 111
| 0.569061
|
NeoYY
|
80a78fa4dec4e5bec73431063b8f66aa778de0c0
| 5,354
|
cpp
|
C++
|
src/Exciton/PaintingSecrets/PaintingSecretSurface.cpp
|
Vladimir-Lin/QtExciton
|
ac5bc82f22ac3cdcdccb90526f7dd79060535b5a
|
[
"MIT"
] | null | null | null |
src/Exciton/PaintingSecrets/PaintingSecretSurface.cpp
|
Vladimir-Lin/QtExciton
|
ac5bc82f22ac3cdcdccb90526f7dd79060535b5a
|
[
"MIT"
] | null | null | null |
src/Exciton/PaintingSecrets/PaintingSecretSurface.cpp
|
Vladimir-Lin/QtExciton
|
ac5bc82f22ac3cdcdccb90526f7dd79060535b5a
|
[
"MIT"
] | null | null | null |
#include <exciton.h>
N::PaintingSecretSurface:: PaintingSecretSurface (QWidget * parent)
: QWidget ( parent)
, progress (NULL )
, indicator (NULL )
{
}
N::PaintingSecretSurface::~PaintingSecretSurface (void)
{
}
void N::PaintingSecretSurface::showEvent(QShowEvent * event)
{
QWidget :: showEvent ( event ) ;
relocation ( ) ;
}
void N::PaintingSecretSurface::resizeEvent (QResizeEvent * event)
{
QWidget :: resizeEvent ( event ) ;
relocation ( ) ;
}
void N::PaintingSecretSurface::paintEvent(QPaintEvent * event)
{ Q_UNUSED ( event ) ;
QPainter p ( this ) ;
p . drawImage ( 0 , 0 , Painting ) ;
}
QImage N::PaintingSecretSurface::Cut(void)
{
QImage I ;
QImage S ;
int x = 0 ;
int y = 0 ;
int w = 0 ;
int h = 0 ;
double wf = width ( ) ;
double hf = height ( ) ;
wf /= Background.width ( ) ;
hf /= Background.height ( ) ;
if (wf<hf) {
y = 0 ;
h = Background.height() ;
wf = width ( ) ;
wf /= height ( ) ;
wf *= h ;
w = wf ;
x = Background.width () ;
x -= w ;
x /= 2 ;
x += Background.width () * 3 / 16 ;
if ((x+w)>Background.width()) {
x = Background.width() - w ;
} ;
} else {
x = 0 ;
w = Background.width () ;
hf = height ( ) ;
hf /= width ( ) ;
hf *= w ;
h = hf ;
y = Background.height() ;
y -= h ;
y /= 2 ;
} ;
S = Background.copy(x,y,w,h) ;
I = S.scaled (
size() ,
Qt::KeepAspectRatio ,
Qt::SmoothTransformation ) ;
return I ;
}
void N::PaintingSecretSurface::relocation (void)
{
QColor w = QColor ( 255 , 255 , 255 ) ;
QSize s = size ( ) ;
///////////////////////////////////////////////////
Mutex . lock ( ) ;
Painting = QImage ( s , QImage::Format_ARGB32 ) ;
Drawing = QImage ( s , QImage::Format_ARGB32 ) ;
Painting . fill ( w ) ;
Drawing . fill ( w ) ;
///////////////////////////////////////////////////
Painting = Cut ( ) ;
///////////////////////////////////////////////////
MoveIndicator ( ) ;
Mutex . unlock ( ) ;
}
void N::PaintingSecretSurface::StartBusy(N::Plan * plan,int total)
{
if (IsNull(indicator)) {
QColor green ( 0 , 255 , 0 ) ;
indicator = new ProgressIndicator(this,plan) ;
indicator -> setColor ( green ) ;
indicator -> setAnimationDelay ( 100 ) ;
indicator -> show ( ) ;
} ;
if (IsNull(progress)) {
progress = new QProgressBar ( this ) ;
progress -> setTextVisible ( false ) ;
progress -> hide ( ) ;
progress -> setRange ( 0 , total ) ;
} ;
MoveIndicator ( ) ;
indicator->startAnimation() ;
}
void N::PaintingSecretSurface::StopBusy(void)
{
if (IsNull(indicator)) return ;
int cnt = indicator->stopAnimation() ;
if (cnt<=0) {
indicator -> deleteLater ( ) ;
indicator = NULL ;
} ;
if (IsNull(progress)) return ;
progress -> deleteLater ( ) ;
progress = NULL ;
}
void N::PaintingSecretSurface::setStep(int index)
{
if (IsNull(progress)) return ;
if (index>0) {
progress -> show ( ) ;
} ;
progress -> setValue ( index ) ;
}
void N::PaintingSecretSurface::MoveIndicator(void)
{
if (IsNull(indicator)) return ;
int w = width () ;
int h = height() ;
int x = w / 2 ;
int y = h / 2 ;
indicator -> move ( x - 20 , y - 20 ) ;
indicator -> resize ( 40 , 40 ) ;
if (IsNull(progress)) return ;
y = h - 12 ;
progress -> move ( 0 , y ) ;
progress -> resize ( w , 12 ) ;
}
| 35.932886
| 67
| 0.341053
|
Vladimir-Lin
|
80aaba02c630ecb4f4a1ba82e2af72719c13d5ee
| 1,243
|
hpp
|
C++
|
src/org/apache/poi/ss/formula/ptg/BoolPtg.hpp
|
pebble2015/cpoi
|
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
|
[
"Apache-2.0"
] | null | null | null |
src/org/apache/poi/ss/formula/ptg/BoolPtg.hpp
|
pebble2015/cpoi
|
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
|
[
"Apache-2.0"
] | null | null | null |
src/org/apache/poi/ss/formula/ptg/BoolPtg.hpp
|
pebble2015/cpoi
|
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
|
[
"Apache-2.0"
] | null | null | null |
// Generated from /POI/java/org/apache/poi/ss/formula/ptg/BoolPtg.java
#pragma once
#include <fwd-POI.hpp>
#include <java/lang/fwd-POI.hpp>
#include <org/apache/poi/ss/formula/ptg/fwd-POI.hpp>
#include <org/apache/poi/util/fwd-POI.hpp>
#include <org/apache/poi/ss/formula/ptg/ScalarConstantPtg.hpp>
struct default_init_tag;
class poi::ss::formula::ptg::BoolPtg final
: public ScalarConstantPtg
{
public:
typedef ScalarConstantPtg super;
static constexpr int32_t SIZE { int32_t(2) };
static constexpr int8_t sid { int8_t(29) };
private:
static BoolPtg* FALSE_;
static BoolPtg* TRUE_;
bool _value { };
protected:
void ctor(bool b);
public:
static BoolPtg* valueOf(bool b);
static BoolPtg* read(::poi::util::LittleEndianInput* in);
bool getValue();
void write(::poi::util::LittleEndianOutput* out) override;
int32_t getSize() override;
::java::lang::String* toFormulaString() override;
// Generated
private:
BoolPtg(bool b);
protected:
BoolPtg(const ::default_init_tag&);
public:
static ::java::lang::Class *class_();
static void clinit();
private:
static BoolPtg*& FALSE();
static BoolPtg*& TRUE();
virtual ::java::lang::Class* getClass0();
};
| 23.018519
| 70
| 0.687852
|
pebble2015
|
80ade0f65db7d720e9f16b50b80455393a7e66ba
| 645
|
hpp
|
C++
|
source/symbol/h2_cxa.hpp
|
lingjf/h2unit
|
5a55c718bc22ba52bd4500997b2df18939996efa
|
[
"Apache-2.0"
] | 5
|
2015-03-02T22:29:00.000Z
|
2020-06-28T08:52:00.000Z
|
source/symbol/h2_cxa.hpp
|
lingjf/h2unit
|
5a55c718bc22ba52bd4500997b2df18939996efa
|
[
"Apache-2.0"
] | 5
|
2019-05-10T02:28:00.000Z
|
2021-07-17T00:53:18.000Z
|
source/symbol/h2_cxa.hpp
|
lingjf/h2unit
|
5a55c718bc22ba52bd4500997b2df18939996efa
|
[
"Apache-2.0"
] | 5
|
2016-05-25T07:31:16.000Z
|
2021-08-29T04:25:18.000Z
|
struct h2_cxa {
static char* demangle(const char* mangle_name, char* demangle_name = (char*)alloca(1024), size_t length = 1024);
static void* follow_jmp(void* fp, int n = 32);
template <typename T, typename U = typename std::remove_reference<T>::type>
static const char* type_name(char* name = (char*)alloca(512), size_t size = 512)
{
strcpy(name, "");
if (std::is_const<U>::value) strcat(name, "const ");
strcat(name, demangle(typeid(U).name()));
if (std::is_lvalue_reference<T>::value) strcat(name, "&");
else if (std::is_rvalue_reference<T>::value) strcat(name, "&&");
return name;
}
};
| 40.3125
| 115
| 0.63876
|
lingjf
|
80b8ac5e22a102766b78ccf8658ea2edd8f09d70
| 369
|
cpp
|
C++
|
tools/pathanalyzer/tests/rv_same_var.cpp
|
tjschweizer/pharos
|
4c5cea68c4489d798e341319d1d5e0d2fee71422
|
[
"RSA-MD"
] | 1,247
|
2015-06-15T17:51:31.000Z
|
2022-03-31T10:24:47.000Z
|
tools/pathanalyzer/tests/rv_same_var.cpp
|
tjschweizer/pharos
|
4c5cea68c4489d798e341319d1d5e0d2fee71422
|
[
"RSA-MD"
] | 191
|
2017-07-05T19:06:28.000Z
|
2022-03-20T14:31:10.000Z
|
tools/pathanalyzer/tests/rv_same_var.cpp
|
tjschweizer/pharos
|
4c5cea68c4489d798e341319d1d5e0d2fee71422
|
[
"RSA-MD"
] | 180
|
2015-06-25T21:34:54.000Z
|
2022-03-21T04:25:04.000Z
|
// Copyright 2019 Carnegie Mellon University. See LICENSE file for terms.
#include "test.hpp"
int func(int n) {
return n + 1;
}
int main() {
path_start();
int n = SMALL_POSITIVE_RAND;
n = func(n + 3);
volatile int t = n; // volatile to prevent optimization of nongoal
if (func(n + 4) < t) {
path_nongoal();
}
if (n == 5) {
path_goal();
}
}
| 18.45
| 74
| 0.607046
|
tjschweizer
|
80b8fdde5e5fa6d1e9963a1efd0790a65a47d240
| 10,855
|
cc
|
C++
|
stimulus/EmotionalImages.cc
|
Bearzeng/x-amber
|
351e5e9b4f66d5d4099c7ad92072b3ceaf7b11a4
|
[
"Apache-2.0"
] | 156
|
2020-11-02T06:18:55.000Z
|
2022-03-18T10:05:01.000Z
|
stimulus/EmotionalImages.cc
|
dryxia/x-amber
|
351e5e9b4f66d5d4099c7ad92072b3ceaf7b11a4
|
[
"Apache-2.0"
] | 1
|
2021-08-23T05:38:56.000Z
|
2021-08-23T05:38:56.000Z
|
stimulus/EmotionalImages.cc
|
dryxia/x-amber
|
351e5e9b4f66d5d4099c7ad92072b3ceaf7b11a4
|
[
"Apache-2.0"
] | 31
|
2020-11-03T02:05:25.000Z
|
2022-01-06T06:04:39.000Z
|
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <cmath>
#include "CommonScreens.h"
#include "EmotionalImages.h"
#include "Image.h"
#include "Mark.h"
#include "Screen.h"
#include "Shuffler.h"
#include "Util.h"
namespace stimulus {
namespace {
const int kImageWidthCm = 15;
const int kDefaultImageDisplayTimeMs = 600;
const int kMinPreimageFixationTimeMs = 1000;
const int kMaxPreimageFixationTimeMs = 2000;
const int kNumRatingDots = 5;
const float kRatingCircleDiameterCm = 1.5;
const float kRatingDotDiameterCm = 0.5;
const int kRatingDelayMs = 150;
const char *kImageDisplayTimeSetting = "image_display_time_ms";
const int kMaxRunLength = 3;
// marks
const int kMarkTaskStartStop = 999;
const int kMarkStimulusOffset = 777;
struct EmotionalImage {
std::string path;
int mark;
};
struct EmotionalImagesState {
std::string current_path;
std::string image_folder;
SDL_Texture *current_image = nullptr;
SDL_Rect dest_rect;
int current_mark;
Shuffler<EmotionalImage> *shuffler = nullptr;
};
void BuildImageList(Shuffler<EmotionalImage>*);
// This is just a blank screen. It loads the image, then switches
// to the fixation screen. This ensures there is no delay when
// the image is displayed.
class PreloaderScreen : public Screen {
public:
PreloaderScreen(EmotionalImagesState *state) : state_(state) {
}
void IsVisible() override {
if (state_->shuffler == nullptr) {
state_->shuffler = new Shuffler<EmotionalImage>();
BuildImageList(state_->shuffler);
}
if (state_->shuffler->IsDone()) {
state_->current_image = nullptr;
delete state_->shuffler;
state_->shuffler = nullptr;
SwitchToScreen(1); // Back to selection screen
return;
}
EmotionalImage image = state_->shuffler->GetNextItem();
if (state_->current_image != nullptr) {
SDL_DestroyTexture(state_->current_image);
}
state_->current_image = LoadImage(state_->image_folder + image.path);
if (state_->current_image == nullptr) {
// Exit
SwitchToScreen(1);
return;
}
state_->current_path = image.path;
state_->current_mark = image.mark;
state_->dest_rect = ComputeRectForPhysicalWidth(state_->current_image,
kImageWidthCm);
SwitchToScreen(0);
}
private:
EmotionalImagesState *state_;
};
class ImageScreen : public Screen {
public:
ImageScreen(EmotionalImagesState *state, int image_display_time_ms)
: state_(state), image_display_time_ms_(image_display_time_ms) {
}
void IsInvisible() override { SendMark(kMarkStimulusOffset); }
void Render() override {
Blit(state_->current_image, state_->dest_rect);
}
SDL_Color GetBackgroundColor() override {
return SDL_Color { 0x60, 0x60, 0x60, 0xff };
}
void IsVisible() override {
SendMark(state_->current_mark, state_->current_path);
SwitchToScreen(0, image_display_time_ms_);
}
private:
EmotionalImagesState *state_;
int image_display_time_ms_;
};
class RatingScreen : public Screen {
public:
RatingScreen(const std::string &instructions, const std::string &low_label,
const std::string &high_label, int mark_base_id)
: instructions_(instructions),
low_label_(low_label),
high_label_(high_label),
mark_base_id_(mark_base_id) {
SetCursorVisible(true);
circle_width_px_ = HorzSizeToPixels(kRatingCircleDiameterCm);
circle_height_px_ = VertSizeToPixels(kRatingCircleDiameterCm);
dot_x_inset_px_ = circle_width_px_ - HorzSizeToPixels(kRatingDotDiameterCm);
dot_y_inset_px_ = circle_height_px_ - VertSizeToPixels(kRatingDotDiameterCm);
rating_circle_ = LoadImage(GetResourceDir() + "rating-circle.bmp");
rating_dot_ = LoadImage(GetResourceDir() + "rating-dot.bmp");
int bounding_box_inset = GetDisplayWidthPx() / 3;
rating_bounding_box_.w = GetDisplayWidthPx() - bounding_box_inset * 2;
rating_bounding_box_.x = bounding_box_inset;
rating_bounding_box_.h = circle_height_px_;
rating_bounding_box_.y = (GetDisplayHeightPx() - circle_height_px_) / 2;
dot_spacing_ = (rating_bounding_box_.w - circle_width_px_) / (kNumRatingDots - 1);
int connector_height = rating_bounding_box_.h / 4;
connector_rect_.x = rating_bounding_box_.x + circle_width_px_ / 2;
connector_rect_.y = rating_bounding_box_.y + (rating_bounding_box_.h - connector_height) / 2;
connector_rect_.w = rating_bounding_box_.w - circle_width_px_;
connector_rect_.h = connector_height;
int instruction_width = GetStringWidth(instructions);
instruction_location_.x = (GetDisplayWidthPx() - instruction_width) / 2;
instruction_location_.y = (GetDisplayHeightPx() / 4)
- (GetFontHeight() / 2);
int low_label_width = GetStringWidth(low_label_);
// Center label over dot
low_label_location_.x = rating_bounding_box_.x + (circle_width_px_
- low_label_width) / 2;
low_label_location_.y = rating_bounding_box_.y - GetFontHeight() * 2;
int high_label_width = GetStringWidth(high_label_);
high_label_location_.x = rating_bounding_box_.x + rating_bounding_box_.w
- (circle_width_px_ + high_label_width) / 2;
high_label_location_.y = rating_bounding_box_.y - GetFontHeight() * 2;
}
void IsActive() override {
checked_item_ = -1;
}
void Render() override {
DrawString(low_label_location_.x, low_label_location_.y, low_label_);
DrawString(high_label_location_.x, high_label_location_.y, high_label_);
DrawString(instruction_location_.x, instruction_location_.y, instructions_);
SDL_SetRenderDrawColor(GetRenderer(), 255, 255, 255, 255);
SDL_RenderFillRect(GetRenderer(), &connector_rect_);
SDL_Rect rating_circle_rect { rating_bounding_box_.x, rating_bounding_box_.y, circle_width_px_, circle_height_px_ };
for (int i = 0; i < kNumRatingDots; i++) {
Blit(rating_circle_, rating_circle_rect);
if (checked_item_ == i) {
// Fill in this dot
SDL_Rect dot_rect = stimulus::InsetRect(rating_circle_rect, dot_x_inset_px_, dot_y_inset_px_);
Blit(rating_dot_, dot_rect);
}
rating_circle_rect.x += dot_spacing_;
}
SDL_SetRenderDrawColor(GetRenderer(), 96, 96, 96, 255);
}
void MouseClicked(int button, int x, int y) override {
int dot_y = rating_bounding_box_.y + rating_bounding_box_.h / 2;
float circle_r2_px = pow(circle_width_px_ / 2, 2);
for (int i = 0; i < kNumRatingDots; i++) {
int dot_x = rating_bounding_box_.x + circle_width_px_ / 2 + dot_spacing_ * i;
float distance2 = pow(x - dot_x, 2) + pow(y - dot_y, 2);
if (distance2 <= circle_r2_px) {
checked_item_ = i;
SendMark(mark_base_id_ + i, "Response");
SwitchToScreen(0, kRatingDelayMs);
break;
}
}
}
private:
std::string instructions_;
std::string low_label_;
std::string high_label_;
int dot_spacing_;
SDL_Point low_label_location_;
SDL_Point high_label_location_;
int mark_base_id_;
SDL_Texture *rating_dot_;
SDL_Texture *rating_circle_;
SDL_Rect rating_bounding_box_;
int circle_width_px_;
int circle_height_px_;
SDL_Point instruction_location_;
SDL_Rect connector_rect_;
int checked_item_ = -1;
int dot_x_inset_px_;
int dot_y_inset_px_;
};
void BuildImageList(std::vector<EmotionalImage> *out_vec,
const std::string &folder_name, const std::string &suffix, int count,
int mark_start_id) {
for (int i = 0; i < count; i++) {
std::string path = folder_name + "/" + std::to_string(i + 1) + "_" + suffix
+ ".jpg";
EmotionalImage image = { path, mark_start_id + i };
out_vec->push_back(image);
}
}
void BuildImageList(Shuffler<EmotionalImage> *shuffler) {
std::vector<EmotionalImage> pleasantImages;
BuildImageList(&pleasantImages, "pleasant_families_groups", "posgrp", 20, 1);
BuildImageList(&pleasantImages, "pleasant_babies", "posbaby", 20, 21);
BuildImageList(&pleasantImages, "pleasant_animals", "posaml", 20, 41);
shuffler->AddCategoryElements(pleasantImages, kMaxRunLength);
std::vector<EmotionalImage> neutralImages;
BuildImageList(&neutralImages, "neutral_people", "neutppl", 40, 61);
BuildImageList(&neutralImages, "neutral_animals", "neutaml", 20, 101);
shuffler->AddCategoryElements(neutralImages, kMaxRunLength);
std::vector<EmotionalImage> unpleasantImages;
BuildImageList(&unpleasantImages, "unpleasant_sadness", "negsad", 20, 121);
BuildImageList(&unpleasantImages, "unpleasant_disgust", "negdis", 20, 141);
BuildImageList(&unpleasantImages, "unpleasant_animals", "negaml", 20, 161);
shuffler->AddCategoryElements(unpleasantImages, kMaxRunLength);
shuffler->ShuffleElements();
}
} // namespace
Screen *InitEmotionalImages(Screen *main_screen, const Settings &settings) {
EmotionalImagesState *state = new EmotionalImagesState();
state->image_folder = stimulus::GetResourceDir() + "/emotional_images/";
Screen *version = new VersionScreen();
Screen *start_screen = new InstructionScreen(
"Click to begin.");
Screen *start_mark_screen = new MarkScreen(kMarkTaskStartStop);
Screen *preloader = new PreloaderScreen(state);
Screen *fixation1 = new FixationScreen(kMinPreimageFixationTimeMs,
kMaxPreimageFixationTimeMs);
Screen *finish = new MarkScreen(kMarkTaskStartStop);
int image_display_time_ms = kDefaultImageDisplayTimeMs;
if (settings.HasKey(kImageDisplayTimeSetting)) {
image_display_time_ms = settings.GetIntValue(kImageDisplayTimeSetting);
}
Screen *image = new ImageScreen(state, image_display_time_ms);
#if ENABLE_RATINGS_SCREEN
Screen *rating1 = new RatingScreen(
"How excited did this image make you feel?", "Calm", "Tense", 181);
Screen *rating2 = new RatingScreen(
"What was your emotion when you saw this image", "Unhappy", "Happy",191);
image->AddSuccessor(rating1);
rating1->AddSuccessor(rating2);
rating2->AddSuccessor(preloader);
#endif
image->AddSuccessor(preloader);
version->AddSuccessor(start_screen);
start_screen->AddSuccessor(start_mark_screen);
start_mark_screen->AddSuccessor(preloader);
preloader->AddSuccessor(fixation1);
preloader->AddSuccessor(finish);
fixation1->AddSuccessor(image);
finish->AddSuccessor(main_screen);
return version;
}
} // namespace stimulus
| 34.351266
| 120
| 0.727683
|
Bearzeng
|
01e93875b238b49b9f788cd0160ce72b73090d80
| 5,923
|
cpp
|
C++
|
Data Structures/Permutation Tree.cpp
|
bazzyadb/all-code
|
cf3039641b5aa84b1c5b184a95d69bd4091974c9
|
[
"MIT"
] | 1,639
|
2021-09-15T09:12:06.000Z
|
2022-03-31T22:58:57.000Z
|
Data Structures/Permutation Tree.cpp
|
bazzyadb/all-code
|
cf3039641b5aa84b1c5b184a95d69bd4091974c9
|
[
"MIT"
] | 16
|
2022-01-15T17:50:08.000Z
|
2022-01-28T12:55:21.000Z
|
Data Structures/Permutation Tree.cpp
|
bazzyadb/all-code
|
cf3039641b5aa84b1c5b184a95d69bd4091974c9
|
[
"MIT"
] | 444
|
2021-09-15T09:17:41.000Z
|
2022-03-29T18:21:46.000Z
|
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9, inf = 1e9 + 7, LG = 19;
struct ST {
#define lc (n << 1)
#define rc ((n << 1) | 1)
int t[4 * N], lazy[4 * N];
ST() {}
inline void push(int n, int b, int e) {
if (lazy[n] == 0) return;
t[n] = t[n] + lazy[n];
if (b != e) {
lazy[lc] = lazy[lc] + lazy[n];
lazy[rc] = lazy[rc] + lazy[n];
}
lazy[n] = 0;
}
inline int combine(int a, int b) {
return min(a, b);
}
inline void pull(int n) {
t[n] = min(t[lc], t[rc]);
}
void build(int n, int b, int e) {
lazy[n] = 0;
if (b == e) {
t[n] = 0;
return;
}
int mid = (b + e) >> 1;
build(lc, b, mid);
build(rc, mid + 1, e);
pull(n);
}
void upd(int n, int b, int e, int i, int j, int v) {
push(n, b, e);
if (j < b || e < i) return;
if (i <= b && e <= j) {
lazy[n] = v;
push(n, b, e);
return;
}
int mid = (b + e) >> 1;
upd(lc, b, mid, i, j, v);
upd(rc, mid + 1, e, i, j, v);
pull(n);
}
int query(int n, int b, int e, int i, int j) {
push(n, b, e);
if (i > e || b > j) return inf;
if (i <= b && e <= j) return t[n];
int mid = (b + e) >> 1;
return combine(query(lc, b, mid, i, j), query(rc, mid + 1, e, i, j));
}
} t;
// id of span {i, i} is i
int p[N];
pair<int, int> range[N * 2]; // range of permutation values
pair<int, int> span[N * 2]; // range of permutation indices
vector<int> pt[N * 2]; //directed permutation tree
int par[N * 2];
int ty[N * 2]; // 0 if cut node and 1 if increasing join node, 2 if decreasing join node
int id; //new index to assign to nodes
pair<int, int> get_range(pair<int, int> x, pair<int, int> y) {
return pair<int, int>(min(x.first, y.first), max(x.second, y.second));
}
void add_edge(int u, int v) { //u is parent of v
par[v] = u;
pt[u].push_back(v);
}
bool adjacent(int i, int j) {
return range[i].second == range[j].first - 1;
}
int length(int i) {
return range[i].second - range[i].first + 1;
}
// leaf node is a cut node
int build(int n) { //returns root of the tree
for (int i = 1; i <= 2 * n; i++) {
pt[i].clear();
ty[i] = 0;
par[i] = -1;
}
id = n + 1;
t.build(1, 1, n);
vector<int> mx = {0}, mn = {0};
vector<int> nodes; //stack of cut and join nodes
for (int i = 1; i <= n; i++) {
while (mx.back() != 0 && p[mx.back()] < p[i]) {
int r = mx.back();
mx.pop_back();
t.upd(1, 1, n, mx.back() + 1, r, p[i] - p[r]);
}
mx.push_back(i);
while (mn.back() != 0 && p[mn.back()] > p[i]) {
int r = mn.back();
mn.pop_back();
t.upd(1, 1, n, mn.back() + 1, r, p[r] - p[i]);
}
mn.push_back(i);
// handle stack updates
range[i] = {p[i], p[i]};
span[i] = {i, i};
int cur = i;
while (true) {
if (!nodes.empty() && (adjacent(nodes.back(), cur) || adjacent(cur, nodes.back()))) {
if ((adjacent(nodes.back(), cur) && ty[nodes.back()] == 1) ||
(adjacent(cur, nodes.back()) && ty[nodes.back()] == 2)) {
add_edge(nodes.back(), cur);
range[nodes.back()] = get_range(range[nodes.back()], range[cur]);
span[nodes.back()] = get_range(span[nodes.back()], span[cur]);
cur = nodes.back();
nodes.pop_back();
} else { //make a new join node
ty[id] = (adjacent(nodes.back(), cur) ? 1 : 2);
add_edge(id, nodes.back());
add_edge(id, cur);
range[id] = get_range(range[nodes.back()], range[cur]);
span[id] = get_range(span[nodes.back()], span[cur]);
nodes.pop_back();
cur = id++;
}
} else if (i - (length(cur) - 1) && t.query(1, 1, n, 1, i - length(cur)) == 0) {
int len = length(cur);
pair<int, int> r = range[cur];
pair<int, int> s = span[cur];
add_edge(id, cur);
do {
len += length(nodes.back());
r = get_range(r, range[nodes.back()]);
s = get_range(s, span[nodes.back()]);
add_edge(id, nodes.back());
nodes.pop_back();
} while (r.second - r.first + 1 != len);
reverse(pt[id].begin(), pt[id].end());
range[id] = r;
span[id] = s;
cur = id++;
} else {
break;
}
}
nodes.push_back(cur);
t.upd(1, 1, n, 1, i, -1);
}
id--;
assert(id <= 2 * n);
int r = 0;
for (int i = 1; i <= id; i++) {
if (par[i] == -1) r = i;
}
assert(r);
return r;
}
int P[N * 2][LG];
void dfs(int u, int p = 0) {
P[u][0] = p;
for (int k = 1; k < LG; k++) {
P[u][k] = P[P[u][k - 1]][k - 1];
}
for (auto v : pt[u]) {
if (v == p) continue;
dfs(v, u);
}
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
for (int i = 1; i <= n; i++) cin >> p[i];
int r = build(n);
dfs(r);
int q;
cin >> q;
while (q--) {
int l, r;
cin >> l >> r;
if (l == r) {
cout << l << ' ' << r << '\n';
continue;
}
int u = l;
for (int k = LG - 1; k >= 0; k--) {
if (P[u][k] && span[P[u][k]].second < r) u = P[u][k];
}
u = P[u][0];
if (ty[u] == 0) {
cout << span[u].first << ' ' << span[u].second << '\n';
continue;
}
int curl = -1, curr = pt[u].size();
for (int k = LG - 1; k >= 0; k--) {
if (curl + (1 << k) < pt[u].size() && span[pt[u][curl + (1 << k)]].second < l) curl += 1 << k;
if (curr - (1 << k) >= 0 && r < span[pt[u][curr - (1 << k)]].first) curr -= 1 << k;
}
cout << span[pt[u][curl + 1]].first << ' ' << span[pt[u][curr - 1]].second << '\n';
}
return 0;
}
// https://codeforces.com/gym/101620, Problem I
// https://codeforces.com/blog/entry/78898
| 28.204762
| 101
| 0.449097
|
bazzyadb
|
01f4535fe1ba18c4e6e9a9c39a8e769992b73dc8
| 1,796
|
cpp
|
C++
|
source/ff.graphics/source/sprite_data.cpp
|
spadapet/ff_game_library
|
f1bf00f90adde66c2c2aa35b109fe61b8d2c6352
|
[
"MIT"
] | null | null | null |
source/ff.graphics/source/sprite_data.cpp
|
spadapet/ff_game_library
|
f1bf00f90adde66c2c2aa35b109fe61b8d2c6352
|
[
"MIT"
] | null | null | null |
source/ff.graphics/source/sprite_data.cpp
|
spadapet/ff_game_library
|
f1bf00f90adde66c2c2aa35b109fe61b8d2c6352
|
[
"MIT"
] | null | null | null |
#include "pch.h"
#include "sprite_data.h"
#include "sprite_type.h"
#include "texture.h"
#include "texture_view_base.h"
ff::sprite_data::sprite_data()
: view_(nullptr)
, texture_uv_(0, 0, 0, 0)
, world_(0, 0, 0, 0)
, type_(ff::sprite_type::unknown)
{}
ff::sprite_data::sprite_data(
ff::texture_view_base* view,
ff::rect_float texture_uv,
ff::rect_float world,
ff::sprite_type type)
: view_(view)
, texture_uv_(texture_uv)
, world_(world)
, type_((type == ff::sprite_type::unknown && view) ? view->view_texture()->sprite_type() : type)
{}
ff::sprite_data::sprite_data(
ff::texture_view_base* view,
ff::rect_float rect,
ff::point_float handle,
ff::point_float scale,
ff::sprite_type type)
: view_(view)
, texture_uv_(rect / view->view_texture()->size().cast<float>())
, world_(-handle * scale, (rect.size() - handle) * scale)
, type_((type == ff::sprite_type::unknown && view) ? view->view_texture()->sprite_type() : type)
{}
ff::sprite_data::operator bool() const
{
return this->view_ != nullptr;
}
ff::texture_view_base* ff::sprite_data::view() const
{
return this->view_;
}
const ff::rect_float& ff::sprite_data::texture_uv() const
{
return this->texture_uv_;
}
const ff::rect_float& ff::sprite_data::world() const
{
return this->world_;
}
ff::sprite_type ff::sprite_data::type() const
{
return this->type_;
}
ff::rect_float ff::sprite_data::texture_rect() const
{
return (this->texture_uv_ * this->view_->view_texture()->size().cast<float>()).normalize();
}
ff::point_float ff::sprite_data::scale() const
{
return this->world_.size() / this->texture_rect().size();
}
ff::point_float ff::sprite_data::handle() const
{
return -this->world_.top_left() / this->scale();
}
| 23.631579
| 100
| 0.6598
|
spadapet
|
01f632d1d57e41207b8bb8076ddfbf3aa306bd4f
| 1,564
|
cpp
|
C++
|
bark/src/JSObject.cpp
|
Daivuk/onut
|
b02c5969b36897813de9c574a26d9437b67f189e
|
[
"MIT"
] | 50
|
2015-06-01T19:23:24.000Z
|
2021-12-22T02:14:23.000Z
|
bark/src/JSObject.cpp
|
Daivuk/onut
|
b02c5969b36897813de9c574a26d9437b67f189e
|
[
"MIT"
] | 109
|
2015-07-20T07:43:03.000Z
|
2021-01-31T21:52:36.000Z
|
bark/src/JSObject.cpp
|
Daivuk/onut
|
b02c5969b36897813de9c574a26d9437b67f189e
|
[
"MIT"
] | 9
|
2015-07-02T21:36:20.000Z
|
2019-10-19T04:18:02.000Z
|
#include "JSObject.h"
#include <JSBindings_Macros.h>
namespace onut
{
namespace js
{
extern duk_context* pContext; // Haxor. This context already contains all standard onut bindings
void newUI(duk_context* ctx, const OUIControlRef& pUIControl);
}
}
using namespace onut::js;
void* JSObject::js_objects_heap_ptr = nullptr;
uint64_t JSObject::next_script_unique_id = 0;
void JSObject::initJSObjects()
{
auto ctx = pContext;
// Create empty js object
duk_push_object(ctx);
duk_put_global_string(ctx, "___js_objects");
// Get it's heap ptr
duk_get_global_string(ctx, "___js_objects");
js_objects_heap_ptr = duk_get_heapptr(ctx, -1);
duk_pop(ctx);
}
void JSObject::initJSObject(void* prototype)
{
js_global_name = "obj_" + std::to_string(next_script_unique_id++);
auto ctx = pContext;
duk_push_heapptr(ctx, js_objects_heap_ptr);
// Create empty js object
duk_push_object(ctx);
duk_push_pointer(ctx, this);
duk_put_prop_string(ctx, -2, "\xff""\xff""data");
if (prototype)
{
duk_push_heapptr(ctx, prototype);
duk_set_prototype(ctx, -2);
}
duk_put_prop_string(ctx, -2, js_global_name.c_str());
// Get it's heap ptr
duk_get_prop_string(ctx, -1, js_global_name.c_str());
js_object = duk_get_heapptr(ctx, -1);
duk_pop(ctx);
duk_pop(ctx);
}
JSObject::~JSObject()
{
auto ctx = pContext;
duk_push_heapptr(ctx, js_objects_heap_ptr);
duk_del_prop_string(ctx, -1, js_global_name.c_str());
duk_pop(ctx);
}
| 22.666667
| 104
| 0.679668
|
Daivuk
|
bf0a28c1c6cf3ebcef4fb261bed0728fe7020cf9
| 11,299
|
cpp
|
C++
|
gpk/gpk_framework.cpp
|
Gorbylord/gpk
|
89ad121d3946b41f802a0bc260ff07e658cbd26e
|
[
"MIT"
] | null | null | null |
gpk/gpk_framework.cpp
|
Gorbylord/gpk
|
89ad121d3946b41f802a0bc260ff07e658cbd26e
|
[
"MIT"
] | null | null | null |
gpk/gpk_framework.cpp
|
Gorbylord/gpk
|
89ad121d3946b41f802a0bc260ff07e658cbd26e
|
[
"MIT"
] | null | null | null |
// Tip: Best viewed with zoom level at 81%.
// Tip: Hold Left ALT + SHIFT while tapping or holding the arrow keys in order to select multiple columns and write on them at once.
// Also useful for copy & paste operations in which you need to copy a bunch of variable or function names and you can't afford the time of copying them one by one.
#include "gpk_framework.h"
#include "gpk_safe.h"
#if defined(GPK_WINDOWS)
# include <Windows.h>
# include <ShellScalingApi.h> // for GetDpiForMonitor()
#endif
struct SDisplayInput {
::gpk::SDisplay & Display;
::gpk::ptr_obj<::gpk::SInput> Input;
};
::gpk::error_t gpk::updateFramework (::gpk::SFramework& framework) {
if(0 == framework.Input)
framework.Input.create();
SInput & input = *framework.Input;
input.KeyboardPrevious = input.KeyboardCurrent;
input.MousePrevious = input.MouseCurrent;
input.MouseCurrent.Deltas = {};
::gpk::SFrameInfo & frameInfo = framework.FrameInfo;
::gpk::STimer & timer = framework.Timer;
timer .Frame();
frameInfo .Frame(::gpk::min(timer.LastTimeMicroseconds, 200000ULL));
::gpk::SDisplay & mainWindow = framework.MainDisplay;
::gpk::error_t updateResult = ::gpk::displayUpdateTick(mainWindow);
ree_if(errored(updateResult), "Not sure why this would fail.");
rvi_if(1, mainWindow.Closed, "Application exiting because the main window was closed.");
rvi_if(1, 1 == updateResult, "Application exiting because the WM_QUIT message was processed.");
::gpk::ptr_obj<::gpk::SRenderTarget<::gpk::SFramework::TTexel, uint32_t>> offscreen = framework.MainDisplayOffscreen;
#if defined(GPK_WINDOWS)
if(mainWindow.PlatformDetail.WindowHandle) {
#endif
if(offscreen && offscreen->Color.Texels.size())
error_if(errored(::gpk::displayPresentTarget(mainWindow, offscreen->Color.View)), "Unknown error.");
}
if(0 != framework.MainDisplay.PlatformDetail.WindowHandle) {
RECT rcWindow = {};
::GetWindowRect(framework.MainDisplay.PlatformDetail.WindowHandle, &rcWindow);
POINT point = {rcWindow.left + 8, rcWindow.top};
::gpk::SCoord2<uint32_t> dpi = {96, 96};
HMONITOR hMonitor = ::MonitorFromPoint(point, MONITOR_DEFAULTTONEAREST);
HRESULT hr = ::GetDpiForMonitor(hMonitor, MDT_EFFECTIVE_DPI, &dpi.x, &dpi.y);
if(0 == hr && (framework.GUI.Zoom.DPI * 96).Cast<uint32_t>() != dpi) {
framework.GUI.Zoom.DPI = {dpi.x / 96.0, dpi.y / 96.0};
::gpk::guiUpdateMetrics(framework.GUI, offscreen->Color.View.metrics(), true);
}
}
return 0;
}
#include <Windowsx.h>
static constexpr const uint32_t BMP_SCREEN_WIDTH = 1280;
static constexpr const uint32_t BMP_SCREEN_HEIGHT = uint32_t(::BMP_SCREEN_WIDTH * (9.0 / 16.0));
static ::RECT minClientRect = {100, 100, 100 + 320, 100 + 200};
//extern ::SApplication * g_ApplicationInstance ;
#if defined(GPK_WINDOWS)
static LRESULT WINAPI mainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
//::SApplication & applicationInstance = *g_ApplicationInstance;
static const int adjustedMinRect = ::AdjustWindowRectEx(&minClientRect, WS_OVERLAPPEDWINDOW, FALSE, 0);
::SDisplayInput * actualMainDisplay = (::SDisplayInput*)::GetWindowLongPtrA(hWnd, GWLP_USERDATA);
::gpk::SDisplay dummyDisplay = {}; // we need this to create the reference in case the display pointer isn't there.
::gpk::SInput dummyInput = {};
::gpk::SDisplay & mainDisplay = (actualMainDisplay) ? actualMainDisplay->Display : dummyDisplay;
::gpk::SInput & input = (actualMainDisplay && actualMainDisplay->Input) ? *actualMainDisplay->Input : dummyInput;
::gpk::SDisplayPlatformDetail & displayDetail = mainDisplay.PlatformDetail;
int32_t zDelta = {};
switch(uMsg) {
default: break;
case WM_CLOSE : ::DestroyWindow(hWnd); return 0;
case WM_KEYDOWN : if(wParam > ::gpk::size(input.KeyboardPrevious.KeyState)) break; input.KeyboardCurrent.KeyState[wParam] = 1; return 0;
case WM_KEYUP : if(wParam > ::gpk::size(input.KeyboardPrevious.KeyState)) break; input.KeyboardCurrent.KeyState[wParam] = 0; return 0;
case WM_LBUTTONDOWN : info_printf("Down"); if(0 > ::gpk::size(input.MouseCurrent.ButtonState)) break; input.MouseCurrent.ButtonState[0] = 1; return 0;
case WM_LBUTTONDBLCLK : info_printf("Down"); if(0 > ::gpk::size(input.MouseCurrent.ButtonState)) break; input.MouseCurrent.ButtonState[0] = 1; return 0;
case WM_LBUTTONUP : info_printf("Up" ); if(0 > ::gpk::size(input.MouseCurrent.ButtonState)) break; input.MouseCurrent.ButtonState[0] = 0; return 0;
case WM_RBUTTONDOWN : info_printf("Down"); if(1 > ::gpk::size(input.MouseCurrent.ButtonState)) break; input.MouseCurrent.ButtonState[1] = 1; return 0;
case WM_RBUTTONDBLCLK : info_printf("Down"); if(1 > ::gpk::size(input.MouseCurrent.ButtonState)) break; input.MouseCurrent.ButtonState[1] = 1; return 0;
case WM_RBUTTONUP : info_printf("Up" ); if(1 > ::gpk::size(input.MouseCurrent.ButtonState)) break; input.MouseCurrent.ButtonState[1] = 0; return 0;
case WM_MBUTTONDOWN : info_printf("Down"); if(2 > ::gpk::size(input.MouseCurrent.ButtonState)) break; input.MouseCurrent.ButtonState[2] = 1; return 0;
case WM_MBUTTONDBLCLK : info_printf("Down"); if(2 > ::gpk::size(input.MouseCurrent.ButtonState)) break; input.MouseCurrent.ButtonState[2] = 1; return 0;
case WM_MBUTTONUP : info_printf("Up" ); if(2 > ::gpk::size(input.MouseCurrent.ButtonState)) break; input.MouseCurrent.ButtonState[2] = 0; return 0;
case WM_MOUSEWHEEL :
zDelta = GET_WHEEL_DELTA_WPARAM(wParam);
input.MouseCurrent.Deltas.z = zDelta;
return 0;
case WM_MOUSEMOVE : {
int32_t xPos = GET_X_LPARAM(lParam);
int32_t yPos = GET_Y_LPARAM(lParam);
input.MouseCurrent.Position.x = ::gpk::clamp(xPos, 0, (int32_t)mainDisplay.Size.x);
input.MouseCurrent.Position.y = ::gpk::clamp(yPos, 0, (int32_t)mainDisplay.Size.y);
input.MouseCurrent.Deltas.x = input.MouseCurrent.Position.x - input.MousePrevious.Position.x;
input.MouseCurrent.Deltas.y = input.MouseCurrent.Position.y - input.MousePrevious.Position.y;
return 0;
}
case WM_GETMINMAXINFO : // Catch this message so to prevent the window from becoming too small.
((::MINMAXINFO*)lParam)->ptMinTrackSize = {minClientRect.right - minClientRect.left, minClientRect.bottom - minClientRect.top};
return 0;
case WM_SIZE :
if(lParam) {
::gpk::SCoord2<uint32_t> newMetrics = ::gpk::SCoord2<WORD>{LOWORD(lParam), HIWORD(lParam)}.Cast<uint32_t>();
if(newMetrics != mainDisplay.Size) {
mainDisplay.PreviousSize = mainDisplay.Size;
mainDisplay.Size = newMetrics;
mainDisplay.Resized = true;
mainDisplay.Repaint = true;
char buffer [256] = {};
//sprintf_s(buffer, "[%u x %u]. Last frame seconds: %g. ", (uint32_t)newMetrics.x, (uint32_t)newMetrics.y, applicationInstance.Framework.Timer.LastTimeSeconds);
sprintf_s(buffer, "[%u x %u].", (uint32_t)newMetrics.x, (uint32_t)newMetrics.y);
#if defined(UNICODE)
#else
SetWindowText(mainDisplay.PlatformDetail.WindowHandle, buffer);
#endif
}
}
if( wParam == SIZE_MINIMIZED ) {
mainDisplay.MinOrMaxed = mainDisplay.NoDraw = true;
}
else if( wParam == SIZE_MAXIMIZED ) {
mainDisplay.Resized = mainDisplay.MinOrMaxed = true;
mainDisplay.NoDraw = false;
}
else if( wParam == SIZE_RESTORED ) {
mainDisplay.Resized = true;
mainDisplay.MinOrMaxed = true;
mainDisplay.NoDraw = false;
}
else {
//State.Resized = true; ?
mainDisplay.MinOrMaxed = mainDisplay.NoDraw = false;
}
break;
case WM_PAINT : break;
case WM_DESTROY :
::SDisplayInput * oldInput = (::SDisplayInput*)::SetWindowLongPtrA(displayDetail.WindowHandle, GWLP_USERDATA, 0);
displayDetail.WindowHandle = 0;
mainDisplay.Closed = true;
safe_delete(oldInput);
::PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
static void initWndClass (::HINSTANCE hInstance, const TCHAR* className, WNDPROC wndProc, ::WNDCLASSEX& wndClassToInit) {
wndClassToInit = {sizeof(::WNDCLASSEX),};
wndClassToInit.lpfnWndProc = wndProc;
wndClassToInit.hInstance = hInstance;
wndClassToInit.hIcon = LoadIcon (NULL, IDC_ICON);
wndClassToInit.hCursor = LoadCursor(NULL, IDC_ARROW);
wndClassToInit.hbrBackground = (::HBRUSH)(COLOR_3DFACE + 1);
wndClassToInit.lpszClassName = className;
wndClassToInit.style = CS_DBLCLKS;
}
#endif
::gpk::error_t gpk::mainWindowDestroy (::gpk::SDisplay& mainWindow) {
::DestroyWindow(mainWindow.PlatformDetail.WindowHandle);
::gpk::displayUpdate(mainWindow);
return 0;
}
::gpk::error_t gpk::mainWindowCreate (::gpk::SDisplay& mainWindow, ::gpk::SRuntimeValuesDetail& runtimeValues, ::gpk::ptr_obj<SInput>& displayInput) {
if(0 == displayInput)
displayInput.create();
::gpk::SDisplayPlatformDetail & displayDetail = mainWindow.PlatformDetail;
HINSTANCE hInstance = runtimeValues.EntryPointArgsWin.hInstance;
::initWndClass(hInstance, displayDetail.WindowClassName, ::mainWndProc, displayDetail.WindowClass);
::RegisterClassEx(&displayDetail.WindowClass);
mainWindow.Size = {::BMP_SCREEN_WIDTH, ::BMP_SCREEN_HEIGHT};
::RECT finalClientRect = {100, 100, 100 + (LONG)mainWindow.Size.x, 100 + (LONG)mainWindow.Size.y};
DWORD windowStyle = WS_OVERLAPPEDWINDOW; //WS_POPUP;
::AdjustWindowRectEx(&finalClientRect, windowStyle, FALSE, 0);
mainWindow.PlatformDetail.WindowHandle = ::CreateWindowEx(0, displayDetail.WindowClassName, TEXT("Window"), windowStyle | CS_DBLCLKS
, finalClientRect.left
, finalClientRect.top
, finalClientRect.right - finalClientRect.left
, finalClientRect.bottom - finalClientRect.top
, 0, 0, displayDetail.WindowClass.hInstance, 0
);
::SetWindowLongPtrA(mainWindow.PlatformDetail.WindowHandle, GWLP_USERDATA, (LONG_PTR)new SDisplayInput{mainWindow, displayInput});
::ShowWindow (displayDetail.WindowHandle, SW_SHOW);
::UpdateWindow (displayDetail.WindowHandle);
return 0;
}
| 58.848958
| 177
| 0.637048
|
Gorbylord
|
bf0a4dc3e816eef27a28a44d2baffaabc59559b2
| 145
|
cpp
|
C++
|
WhileFalsePhysics/Source/WhileFalsePhysics/Private/Physics/WhileFalsePhysicsStatics.cpp
|
WhileFalseStudios/unreal-wfs
|
d11ae208f939b994771dd8653c17aac762382a1f
|
[
"MIT"
] | null | null | null |
WhileFalsePhysics/Source/WhileFalsePhysics/Private/Physics/WhileFalsePhysicsStatics.cpp
|
WhileFalseStudios/unreal-wfs
|
d11ae208f939b994771dd8653c17aac762382a1f
|
[
"MIT"
] | null | null | null |
WhileFalsePhysics/Source/WhileFalsePhysics/Private/Physics/WhileFalsePhysicsStatics.cpp
|
WhileFalseStudios/unreal-wfs
|
d11ae208f939b994771dd8653c17aac762382a1f
|
[
"MIT"
] | null | null | null |
// Copyright (c) While False Studios 2019. Released under the MIT license. See LICENSE for more details.
#include "WhileFalsePhysicsStatics.h"
| 29
| 104
| 0.77931
|
WhileFalseStudios
|
bf1296436738a914e9cb747ed217a116c7550157
| 5,599
|
hpp
|
C++
|
include/codegen/include/System/Net/Sockets/SocketAsyncResult.hpp
|
Futuremappermydud/Naluluna-Modifier-Quest
|
bfda34370764b275d90324b3879f1a429a10a873
|
[
"MIT"
] | 1
|
2021-11-12T09:29:31.000Z
|
2021-11-12T09:29:31.000Z
|
include/codegen/include/System/Net/Sockets/SocketAsyncResult.hpp
|
Futuremappermydud/Naluluna-Modifier-Quest
|
bfda34370764b275d90324b3879f1a429a10a873
|
[
"MIT"
] | null | null | null |
include/codegen/include/System/Net/Sockets/SocketAsyncResult.hpp
|
Futuremappermydud/Naluluna-Modifier-Quest
|
bfda34370764b275d90324b3879f1a429a10a873
|
[
"MIT"
] | 2
|
2021-10-03T02:14:20.000Z
|
2021-11-12T09:29:36.000Z
|
// Autogenerated from CppHeaderCreator on 7/27/2020 3:10:19 PM
// Created by Sc2ad
// =========================================================================
#pragma once
#pragma pack(push, 8)
// Begin includes
#include "utils/typedefs.h"
// Including type: System.IOAsyncResult
#include "System/IOAsyncResult.hpp"
// Including type: System.Net.Sockets.SocketOperation
#include "System/Net/Sockets/SocketOperation.hpp"
// Including type: System.Net.Sockets.SocketFlags
#include "System/Net/Sockets/SocketFlags.hpp"
// Including type: System.ArraySegment`1
#include "System/ArraySegment_1.hpp"
#include "utils/il2cpp-utils.hpp"
// Completed includes
// Begin forward declares
// Forward declaring namespace: System::Net::Sockets
namespace System::Net::Sockets {
// Forward declaring type: Socket
class Socket;
// Forward declaring type: SocketError
struct SocketError;
}
// Forward declaring namespace: System
namespace System {
// Forward declaring type: Exception
class Exception;
// Forward declaring type: IntPtr
struct IntPtr;
// Forward declaring type: AsyncCallback
class AsyncCallback;
}
// Forward declaring namespace: System::Net
namespace System::Net {
// Forward declaring type: EndPoint
class EndPoint;
// Forward declaring type: IPAddress
class IPAddress;
}
// Forward declaring namespace: System::Collections::Generic
namespace System::Collections::Generic {
// Skipping declaration: IList`1 because it is already included!
}
// Completed forward declares
// Type namespace: System.Net.Sockets
namespace System::Net::Sockets {
// Autogenerated type: System.Net.Sockets.SocketAsyncResult
class SocketAsyncResult : public System::IOAsyncResult {
public:
// Nested type: System::Net::Sockets::SocketAsyncResult::$$c
class $$c;
// public System.Net.Sockets.Socket socket
// Offset: 0x30
System::Net::Sockets::Socket* socket;
// public System.Net.Sockets.SocketOperation operation
// Offset: 0x38
System::Net::Sockets::SocketOperation operation;
// private System.Exception DelayedException
// Offset: 0x40
System::Exception* DelayedException;
// public System.Net.EndPoint EndPoint
// Offset: 0x48
System::Net::EndPoint* EndPoint;
// public System.Byte[] Buffer
// Offset: 0x50
::Array<uint8_t>* Buffer;
// public System.Int32 Offset
// Offset: 0x58
int Offset;
// public System.Int32 Size
// Offset: 0x5C
int Size;
// public System.Net.Sockets.SocketFlags SockFlags
// Offset: 0x60
System::Net::Sockets::SocketFlags SockFlags;
// public System.Net.Sockets.Socket AcceptSocket
// Offset: 0x68
System::Net::Sockets::Socket* AcceptSocket;
// public System.Net.IPAddress[] Addresses
// Offset: 0x70
::Array<System::Net::IPAddress*>* Addresses;
// public System.Int32 Port
// Offset: 0x78
int Port;
// public System.Collections.Generic.IList`1<System.ArraySegment`1<System.Byte>> Buffers
// Offset: 0x80
System::Collections::Generic::IList_1<System::ArraySegment_1<uint8_t>>* Buffers;
// public System.Boolean ReuseSocket
// Offset: 0x88
bool ReuseSocket;
// public System.Int32 CurrentAddress
// Offset: 0x8C
int CurrentAddress;
// public System.Net.Sockets.Socket AcceptedSocket
// Offset: 0x90
System::Net::Sockets::Socket* AcceptedSocket;
// public System.Int32 Total
// Offset: 0x98
int Total;
// System.Int32 error
// Offset: 0x9C
int error;
// public System.Int32 EndCalled
// Offset: 0xA0
int EndCalled;
// public System.IntPtr get_Handle()
// Offset: 0x11FFE74
System::IntPtr get_Handle();
// public System.Void .ctor(System.Net.Sockets.Socket socket, System.AsyncCallback callback, System.Object state, System.Net.Sockets.SocketOperation operation)
// Offset: 0x11FFECC
static SocketAsyncResult* New_ctor(System::Net::Sockets::Socket* socket, System::AsyncCallback* callback, ::Il2CppObject* state, System::Net::Sockets::SocketOperation operation);
// public System.Net.Sockets.SocketError get_ErrorCode()
// Offset: 0x11FFF1C
System::Net::Sockets::SocketError get_ErrorCode();
// public System.Void CheckIfThrowDelayedException()
// Offset: 0x11FFFA4
void CheckIfThrowDelayedException();
// public System.Void Complete()
// Offset: 0x11FE678
void Complete();
// public System.Void Complete(System.Boolean synch)
// Offset: 0x1200060
void Complete(bool synch);
// public System.Void Complete(System.Int32 total)
// Offset: 0x11FF09C
void Complete(int total);
// public System.Void Complete(System.Exception e, System.Boolean synch)
// Offset: 0x120006C
void Complete(System::Exception* e, bool synch);
// public System.Void Complete(System.Exception e)
// Offset: 0x11FDDB0
void Complete(System::Exception* e);
// public System.Void Complete(System.Net.Sockets.Socket s)
// Offset: 0x11FDDD8
void Complete(System::Net::Sockets::Socket* s);
// public System.Void Complete(System.Net.Sockets.Socket s, System.Int32 total)
// Offset: 0x11FE0D8
void Complete(System::Net::Sockets::Socket* s, int total);
// override System.Void CompleteDisposed()
// Offset: 0x120005C
// Implemented from: System.IOAsyncResult
// Base method: System.Void IOAsyncResult::CompleteDisposed()
void CompleteDisposed();
}; // System.Net.Sockets.SocketAsyncResult
}
DEFINE_IL2CPP_ARG_TYPE(System::Net::Sockets::SocketAsyncResult*, "System.Net.Sockets", "SocketAsyncResult");
#pragma pack(pop)
| 37.326667
| 182
| 0.70459
|
Futuremappermydud
|
bf15716907ea6a670d26933ec56758c47cb32398
| 2,949
|
hpp
|
C++
|
include/codegen/include/UnityEngine/Analytics/AnalyticsSessionInfo.hpp
|
Futuremappermydud/Naluluna-Modifier-Quest
|
bfda34370764b275d90324b3879f1a429a10a873
|
[
"MIT"
] | 1
|
2021-11-12T09:29:31.000Z
|
2021-11-12T09:29:31.000Z
|
include/codegen/include/UnityEngine/Analytics/AnalyticsSessionInfo.hpp
|
Futuremappermydud/Naluluna-Modifier-Quest
|
bfda34370764b275d90324b3879f1a429a10a873
|
[
"MIT"
] | null | null | null |
include/codegen/include/UnityEngine/Analytics/AnalyticsSessionInfo.hpp
|
Futuremappermydud/Naluluna-Modifier-Quest
|
bfda34370764b275d90324b3879f1a429a10a873
|
[
"MIT"
] | 2
|
2021-10-03T02:14:20.000Z
|
2021-11-12T09:29:36.000Z
|
// Autogenerated from CppHeaderCreator on 7/27/2020 3:10:39 PM
// Created by Sc2ad
// =========================================================================
#pragma once
#pragma pack(push, 8)
// Begin includes
#include "utils/typedefs.h"
// Including type: System.Object
#include "System/Object.hpp"
#include "utils/il2cpp-utils.hpp"
// Completed includes
// Begin forward declares
// Forward declaring namespace: UnityEngine::Analytics
namespace UnityEngine::Analytics {
// Forward declaring type: AnalyticsSessionState
struct AnalyticsSessionState;
}
// Completed forward declares
// Type namespace: UnityEngine.Analytics
namespace UnityEngine::Analytics {
// Autogenerated type: UnityEngine.Analytics.AnalyticsSessionInfo
class AnalyticsSessionInfo : public ::Il2CppObject {
public:
// Nested type: UnityEngine::Analytics::AnalyticsSessionInfo::SessionStateChanged
class SessionStateChanged;
// Nested type: UnityEngine::Analytics::AnalyticsSessionInfo::IdentityTokenChanged
class IdentityTokenChanged;
// Get static field: static private UnityEngine.Analytics.AnalyticsSessionInfo/SessionStateChanged sessionStateChanged
static UnityEngine::Analytics::AnalyticsSessionInfo::SessionStateChanged* _get_sessionStateChanged();
// Set static field: static private UnityEngine.Analytics.AnalyticsSessionInfo/SessionStateChanged sessionStateChanged
static void _set_sessionStateChanged(UnityEngine::Analytics::AnalyticsSessionInfo::SessionStateChanged* value);
// Get static field: static private UnityEngine.Analytics.AnalyticsSessionInfo/IdentityTokenChanged identityTokenChanged
static UnityEngine::Analytics::AnalyticsSessionInfo::IdentityTokenChanged* _get_identityTokenChanged();
// Set static field: static private UnityEngine.Analytics.AnalyticsSessionInfo/IdentityTokenChanged identityTokenChanged
static void _set_identityTokenChanged(UnityEngine::Analytics::AnalyticsSessionInfo::IdentityTokenChanged* value);
// static System.Void CallSessionStateChanged(UnityEngine.Analytics.AnalyticsSessionState sessionState, System.Int64 sessionId, System.Int64 sessionElapsedTime, System.Boolean sessionChanged)
// Offset: 0x195A8D8
static void CallSessionStateChanged(UnityEngine::Analytics::AnalyticsSessionState sessionState, int64_t sessionId, int64_t sessionElapsedTime, bool sessionChanged);
// static public System.Int64 get_sessionId()
// Offset: 0x195AC34
static int64_t get_sessionId();
// static public System.String get_userId()
// Offset: 0x195AC68
static ::Il2CppString* get_userId();
// static System.Void CallIdentityTokenChanged(System.String token)
// Offset: 0x195AC9C
static void CallIdentityTokenChanged(::Il2CppString* token);
}; // UnityEngine.Analytics.AnalyticsSessionInfo
}
DEFINE_IL2CPP_ARG_TYPE(UnityEngine::Analytics::AnalyticsSessionInfo*, "UnityEngine.Analytics", "AnalyticsSessionInfo");
#pragma pack(pop)
| 56.711538
| 195
| 0.785351
|
Futuremappermydud
|
bf198bf97214ba22eed83bfd25ee9608a5ed65a8
| 2,770
|
cpp
|
C++
|
Quad2/Main/Quad_FlightCommand/flightCommand.cpp
|
rhockenbury/Quad2
|
1d2d6fe3902ab4a58869e06539553d0cd4bb3d21
|
[
"MIT"
] | null | null | null |
Quad2/Main/Quad_FlightCommand/flightCommand.cpp
|
rhockenbury/Quad2
|
1d2d6fe3902ab4a58869e06539553d0cd4bb3d21
|
[
"MIT"
] | null | null | null |
Quad2/Main/Quad_FlightCommand/flightCommand.cpp
|
rhockenbury/Quad2
|
1d2d6fe3902ab4a58869e06539553d0cd4bb3d21
|
[
"MIT"
] | null | null | null |
/*
* flightCommand.cpp
*
* Created on: August 18, 2013
* Author: Ryler Hockenbury
*/
#include "flightCommand.h"
#include "globals.h"
#include "receiver.h"
#include "LED.h"
#include "conf.h"
bool controlMode = 0;
bool auxMode = 0;
/*
* Distribute stick commands to system components
*/
void processFlightCommands(float stickCommands[], float targetFlightAngle[], Motors *motors,
PID controller[], ITG3200 *gyro, ADXL345 *accel, HMC5883L *comp) {
// process zero throttle stick commands
if(stickCommands[THROTTLE_CHANNEL] <= STICK_MINCHECK) {
processZeroThrottleCommands(motors, stickCommands, gyro, accel, comp);
}
if(!inFlight && stickCommands[THROTTLE_CHANNEL] > TAKEOFF_THROTTLE && motors->isArmed()) {
inFlight = true;
LED::turnOn(RED_LED);
}
// get flight angles from sticks
targetFlightAngle[ROLL_AXIS] = AR6210::mapStickCommandToAngle(stickCommands[ROLL_CHANNEL]);
targetFlightAngle[PITCH_AXIS] = AR6210::mapStickCommandToAngle(stickCommands[PITCH_CHANNEL]);
// update controller mode
PID::setMode(AR6210::mapStickCommandToBool(stickCommands[MODE_CHANNEL]));
//controller[ROLL_AXIS].setMode(controlMode);
//controller[PITCH_AXIS].setMode(controlMode);
//controller[YAW_AXIS].setMode(controlMode);
// update aux channel (currently unused)
//auxMode = AR6210::mapStickCommandToBool(stickCommands[AUX1_CHANNEL]);
}
/*
* Process commands to zero sensors, arm and disarm motors.
*/
void processZeroThrottleCommands(Motors *motors, float stickCommands[], ITG3200 *gyro,
ADXL345 *accel, HMC5883L *comp) {
// zero sensors
// Left stick bottom left, right stick bottom right
if(stickCommands[PITCH_CHANNEL] < STICK_MINCHECK && stickCommands[ROLL_CHANNEL] > STICK_MAXCHECK &&
stickCommands[YAW_CHANNEL] > STICK_MAXCHECK && !SENSORS_ONLINE) {
Serial.println("Info: Zeroing sensors");
LED::turnOn(GREEN_LED);
gyro->setOffset();
accel->setOffset();
comp->setOffset();
}
// arm motors
// Left stick bottom right
if(stickCommands[YAW_CHANNEL] < STICK_MINCHECK && SENSORS_ONLINE && !motors->isArmed()) {
Serial.println("Warning: Arming motors");
LED::turnOn(YELLOW_LED);
motors->armMotors();
motors->pulseMotors(3);
motors->commandAllMotors(1200);
//motors->setArmed(true);
}
// disarm motors
// Left stick bottom left
if(stickCommands[YAW_CHANNEL] > STICK_MAXCHECK && motors->isArmed()) {
Serial.println("Warning: Disarming motors");
LED::turnOff(YELLOW_LED);
LED::turnOff(RED_LED);
motors->disarmMotors();
//motors->setArmed(false);
inFlight = false;
}
}
| 30.108696
| 101
| 0.675812
|
rhockenbury
|
bf2089b4c966d2012adedefce8f0c9d5414b6341
| 24,252
|
cpp
|
C++
|
test/math/uint256.cpp
|
ccccbjcn/nuls-v2-cplusplus-sdk
|
3d5a76452fe0673eba490b26e5a95fea3d5788df
|
[
"MIT"
] | 1
|
2020-04-26T07:32:52.000Z
|
2020-04-26T07:32:52.000Z
|
test/math/uint256.cpp
|
CCC-NULS/nuls-cplusplus-sdk
|
3d5a76452fe0673eba490b26e5a95fea3d5788df
|
[
"MIT"
] | null | null | null |
test/math/uint256.cpp
|
CCC-NULS/nuls-cplusplus-sdk
|
3d5a76452fe0673eba490b26e5a95fea3d5788df
|
[
"MIT"
] | null | null | null |
/**
* Copyright (c) 2020 libnuls developers (see AUTHORS)
*
* This file is part of libnuls.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <boost/test/unit_test.hpp>
#include <sstream>
#include <string>
#include <nuls/system.hpp>
using namespace nuls::system;
BOOST_AUTO_TEST_SUITE(uint256_tests)
#define MAX_HASH \
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
static const auto max_hash = uint256_t(MAX_HASH);
#define NEGATIVE1_HASH \
"0x8000000000000000000000000000000000000000000000000000000000000000"
static const auto negative_zero_hash = uint256_t(NEGATIVE1_HASH);
#define MOST_HASH \
"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
static const auto most_hash = uint256_t(MOST_HASH);
#define ODD_HASH \
"0x8437390223499ab234bf128e8cd092343485898923aaaaabbcbcc4874353fff4"
static const auto odd_hash = uint256_t(ODD_HASH);
#define HALF_HASH \
"0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff"
static const auto half_hash = uint256_t(HALF_HASH);
#define QUARTER_HASH \
"0x000000000000000000000000000000000000000000000000ffffffffffffffff"
static const auto quarter_hash = uint256_t(QUARTER_HASH);
#define UNIT_HASH \
"0x0000000000000000000000000000000000000000000000000000000000000001"
static const auto unit_hash = uint256_t(UNIT_HASH);
#define ONES_HASH \
"0x0000000100000001000000010000000100000001000000010000000100000001"
static const auto ones_hash = uint256_t(ONES_HASH);
#define FIVES_HASH \
"0x5555555555555555555555555555555555555555555555555555555555555555"
static const auto fives_hash = uint256_t(FIVES_HASH);
// constructors
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__constructor_default__always__equates_to_0)
{
uint256_t minimum;
BOOST_REQUIRE_EQUAL(minimum > 0, false);
BOOST_REQUIRE_EQUAL(minimum < 0, false);
BOOST_REQUIRE_EQUAL(minimum >= 0, true);
BOOST_REQUIRE_EQUAL(minimum <= 0, true);
BOOST_REQUIRE_EQUAL(minimum == 0, true);
BOOST_REQUIRE_EQUAL(minimum != 0, false);
}
BOOST_AUTO_TEST_CASE(uint256__constructor_move__42__equals_42)
{
static const auto expected = 42u;
static const uint256_t value(expected);
BOOST_REQUIRE_EQUAL(value, expected);
}
BOOST_AUTO_TEST_CASE(uint256__constructor_copy__odd_hash__equals_odd_hash)
{
static const auto expected = uint256_t(odd_hash);
static const uint256_t value(expected);
BOOST_REQUIRE_EQUAL(value, expected);
}
BOOST_AUTO_TEST_CASE(uint256__constructor_uint32__minimum__equals_0)
{
static const auto expected = 0u;
static const uint256_t value(expected);
BOOST_REQUIRE_EQUAL(value, expected);
}
BOOST_AUTO_TEST_CASE(uint256__constructor_uint32__42__equals_42)
{
static const auto expected = 42u;
static const uint256_t value(expected);
BOOST_REQUIRE_EQUAL(value, expected);
}
BOOST_AUTO_TEST_CASE(uint256__constructor_uint32__maximum__equals_maximum)
{
static const auto expected = nuls::max_uint32;
static const uint256_t value(expected);
BOOST_REQUIRE_EQUAL(value, expected);
}
// hash
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__hash__default__returns_null_hash)
{
static const uint256_t value;
BOOST_REQUIRE_EQUAL(value, 0);
}
BOOST_AUTO_TEST_CASE(uint256__hash__1__returns_unit_hash)
{
static const uint256_t value("0x0000000000000000000000000000000000000000000000000000000000000001");
BOOST_REQUIRE_EQUAL(value, 1);
}
BOOST_AUTO_TEST_CASE(uint256__hash__negative_1__returns_negative_zero_hash)
{
BOOST_REQUIRE_EQUAL(negative_zero_hash, uint256_t("0x8000000000000000000000000000000000000000000000000000000000000000"));
}
// array operator
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__array__default__expected)
{
static const uint256_t value;
BOOST_REQUIRE_EQUAL(value, uint256_t("0x0000000000000000000000000000000000000000000000000000000000000000"));
}
BOOST_AUTO_TEST_CASE(uint256__array__42__expected)
{
static const uint256_t value(42);
BOOST_REQUIRE_EQUAL(value, uint256_t("0x000000000000000000000000000000000000000000000000000000000000002a"));
}
BOOST_AUTO_TEST_CASE(uint256__array__0x87654321__expected)
{
static const uint256_t value(0x87654321);
BOOST_REQUIRE_EQUAL(value, uint256_t("0x0000000000000000000000000000000000000000000000000000000087654321"));
}
BOOST_AUTO_TEST_CASE(uint256__array__negative_1__expected)
{
static const uint256_t value(negative_zero_hash);
BOOST_REQUIRE_EQUAL(value, uint256_t("0x8000000000000000000000000000000000000000000000000000000000000000"));
}
BOOST_AUTO_TEST_CASE(uint256__array__odd_hash__expected)
{
static const uint256_t value(odd_hash);
BOOST_REQUIRE_EQUAL(value, uint256_t("0x8437390223499ab234bf128e8cd092343485898923aaaaabbcbcc4874353fff4"));
}
// comparison operators
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__comparison_operators__null_hash__expected)
{
static const uint256_t value(0);
BOOST_REQUIRE_EQUAL(value > 0, false);
BOOST_REQUIRE_EQUAL(value < 0, false);
BOOST_REQUIRE_EQUAL(value >= 0, true);
BOOST_REQUIRE_EQUAL(value <= 0, true);
BOOST_REQUIRE_EQUAL(value == 0, true);
BOOST_REQUIRE_EQUAL(value != 0, false);
BOOST_REQUIRE_EQUAL(value > 1, false);
BOOST_REQUIRE_EQUAL(value < 1, true);
BOOST_REQUIRE_EQUAL(value >= 1, false);
BOOST_REQUIRE_EQUAL(value <= 1, true);
BOOST_REQUIRE_EQUAL(value == 1, false);
BOOST_REQUIRE_EQUAL(value != 1, true);
}
BOOST_AUTO_TEST_CASE(uint256__comparison_operators__unit_hash__expected)
{
static const uint256_t value(1);
BOOST_REQUIRE_EQUAL(value > 1, false);
BOOST_REQUIRE_EQUAL(value < 1, false);
BOOST_REQUIRE_EQUAL(value >= 1, true);
BOOST_REQUIRE_EQUAL(value <= 1, true);
BOOST_REQUIRE_EQUAL(value == 1, true);
BOOST_REQUIRE_EQUAL(value != 1, false);
BOOST_REQUIRE_EQUAL(value > 0, true);
BOOST_REQUIRE_EQUAL(value < 0, false);
BOOST_REQUIRE_EQUAL(value >= 0, true);
BOOST_REQUIRE_EQUAL(value <= 0, false);
BOOST_REQUIRE_EQUAL(value == 0, false);
BOOST_REQUIRE_EQUAL(value != 0, true);
}
BOOST_AUTO_TEST_CASE(uint256__comparison_operators__negative_zero_hash__expected)
{
static const uint256_t value(negative_zero_hash);
static const uint256_t most(most_hash);
static const uint256_t maximum(max_hash);
BOOST_REQUIRE_EQUAL(value > 1, true);
BOOST_REQUIRE_EQUAL(value < 1, false);
BOOST_REQUIRE_EQUAL(value >= 1, true);
BOOST_REQUIRE_EQUAL(value <= 1, false);
BOOST_REQUIRE_EQUAL(value == 1, false);
BOOST_REQUIRE_EQUAL(value != 1, true);
BOOST_REQUIRE_GT(value, most);
BOOST_REQUIRE_LT(value, maximum);
BOOST_REQUIRE_GE(value, most);
BOOST_REQUIRE_LE(value, maximum);
BOOST_REQUIRE_EQUAL(value, value);
BOOST_REQUIRE_NE(value, most);
BOOST_REQUIRE_NE(value, maximum);
}
// not
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__not__minimum__maximum)
{
BOOST_REQUIRE_EQUAL(~uint256_t(), uint256_t(max_hash));
}
BOOST_AUTO_TEST_CASE(uint256__not__maximum__minimum)
{
BOOST_REQUIRE_EQUAL(~uint256_t(max_hash), uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__not__most_hash__negative_zero_hash)
{
BOOST_REQUIRE_EQUAL(~uint256_t(most_hash), uint256_t(negative_zero_hash));
}
BOOST_AUTO_TEST_CASE(uint256__not__not_odd_hash__odd_hash)
{
BOOST_REQUIRE_EQUAL(~~uint256_t(odd_hash), uint256_t(odd_hash));
}
BOOST_AUTO_TEST_CASE(uint256__not__odd_hash__expected)
{
static const uint256_t value(odd_hash);
static const auto not_value = ~value;
BOOST_REQUIRE_EQUAL(not_value, uint256_t("-0x8437390223499ab234bf128e8cd092343485898923aaaaabbcbcc4874353fff5"));
}
// two's compliment (negate)
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__twos_compliment__null_hash__null_hash)
{
// Note that we use 0 - VALUE to negate, as there is a static
// assert that fails when you negate a uint256_t alone.
BOOST_REQUIRE_EQUAL(0 - uint256_t(), uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__twos_compliment__unit_hash__max_hash)
{
// Note that we use 0 - VALUE to negate, as there is a static
// assert that fails when you negate a uint256_t alone.
BOOST_REQUIRE_EQUAL(0 - uint256_t(unit_hash), uint256_t(max_hash));
}
BOOST_AUTO_TEST_CASE(uint256__twos_compliment__odd_hash__expected)
{
// Note that we use 0 - VALUE to negate, as there is a static
// assert that fails when you negate a uint256_t alone.
static const auto compliment = 0 - uint256_t(odd_hash);
BOOST_REQUIRE_EQUAL(compliment, uint256_t("-0x8437390223499ab234bf128e8cd092343485898923aaaaabbcbcc4874353fff5") + 1);
}
// shift right
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__shift_right__null_hash__null_hash)
{
BOOST_REQUIRE_EQUAL(uint256_t() >> 0, uint256_t());
BOOST_REQUIRE_EQUAL(uint256_t() >> 1, uint256_t());
BOOST_REQUIRE_EQUAL(uint256_t() >> nuls::max_uint32, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__shift_right__unit_hash_0__unit_hash)
{
static const uint256_t value(unit_hash);
BOOST_REQUIRE_EQUAL(value >> 0, value);
}
BOOST_AUTO_TEST_CASE(uint256__shift_right__unit_hash_positive__null_hash)
{
static const uint256_t value(unit_hash);
BOOST_REQUIRE_EQUAL(value >> 1, uint256_t());
BOOST_REQUIRE_EQUAL(value >> nuls::max_uint32, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__shift_right__max_hash_1__most_hash)
{
static const uint256_t value(max_hash);
BOOST_REQUIRE_EQUAL(value >> 1, uint256_t(most_hash));
}
BOOST_AUTO_TEST_CASE(uint256__shift_right__odd_hash_32__expected)
{
static const uint256_t value(odd_hash);
static const auto shifted = value >> 32;
BOOST_REQUIRE_EQUAL(shifted, uint256_t("0x000000008437390223499ab234bf128e8cd092343485898923aaaaabbcbcc487"));
}
// add256
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__add256__0_to_null_hash__null_hash)
{
BOOST_REQUIRE_EQUAL(uint256_t() + 0, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__add256__null_hash_to_null_hash__null_hash)
{
BOOST_REQUIRE_EQUAL(uint256_t() + uint256_t(), uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__add256__1_to_max_hash__null_hash)
{
static const uint256_t value(max_hash);
static const auto sum = value + 1;
BOOST_REQUIRE_EQUAL(sum, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__add256__ones_hash_to_odd_hash__expected)
{
static const uint256_t value(odd_hash);
static const auto sum = value + uint256_t(ones_hash);
BOOST_REQUIRE_EQUAL(sum, uint256_t("0x8437390323499ab334bf128f8cd092353485898a23aaaaacbcbcc4884353fff5"));
}
BOOST_AUTO_TEST_CASE(uint256__add256__1_to_0xffffffff__0x0100000000)
{
static const uint256_t value("0xffffffff");
static const auto sum = value + 1;
BOOST_REQUIRE_EQUAL(sum, uint256_t("0x0000000000000000000000000000000000000000000000000000000100000000"));
}
BOOST_AUTO_TEST_CASE(uint256__add256__1_to_negative_zero_hash__expected)
{
static const uint256_t value(negative_zero_hash);
static const auto sum = value + 1;
BOOST_REQUIRE_EQUAL(sum, uint256_t("0x8000000000000000000000000000000000000000000000000000000000000001"));
}
// divide256
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__divide256__unit_hash_by_null_hash__throws_overflow_error)
{
BOOST_REQUIRE_THROW(uint256_t(unit_hash) / uint256_t(0), std::overflow_error);
}
BOOST_AUTO_TEST_CASE(uint256__divide256__null_hash_by_unit_hash__null_hash)
{
BOOST_REQUIRE_EQUAL(uint256_t(0) / uint256_t(1), uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__divide256__max_hash_by_3__fives_hash)
{
BOOST_REQUIRE_EQUAL(uint256_t(max_hash) / uint256_t(3), uint256_t(fives_hash));
}
BOOST_AUTO_TEST_CASE(uint256__divide256__max_hash_by_max_hash__1)
{
BOOST_REQUIRE_EQUAL(uint256_t(max_hash) / uint256_t(max_hash), uint256_t(1));
}
BOOST_AUTO_TEST_CASE(uint256__divide256__max_hash_by_256__shifts_right_8_bits)
{
static const uint256_t value(max_hash);
static const auto quotient = value / uint256_t(256);
BOOST_REQUIRE_EQUAL(quotient, uint256_t("0x00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
}
// increment
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__increment__0__1)
{
BOOST_REQUIRE_EQUAL(++uint256_t(0), uint256_t(1));
}
BOOST_AUTO_TEST_CASE(uint256__increment__1__2)
{
BOOST_REQUIRE_EQUAL(++uint256_t(1), uint256_t(2));
}
BOOST_AUTO_TEST_CASE(uint256__increment__max_hash__null_hash)
{
BOOST_REQUIRE_EQUAL(++uint256_t(max_hash), uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__increment__0xffffffff__0x0100000000)
{
static const auto increment = ++uint256_t(0xffffffff);
BOOST_REQUIRE_EQUAL(increment, uint256_t("0x0000000000000000000000000000000000000000000000000000000100000000"));
}
BOOST_AUTO_TEST_CASE(uint256__increment__negative_zero_hash__expected)
{
static const auto increment = ++uint256_t(negative_zero_hash);
BOOST_REQUIRE_EQUAL(increment, uint256_t("0x8000000000000000000000000000000000000000000000000000000000000001"));
}
// assign32
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__assign__null_hash_0__null_hash)
{
uint256_t value(0);
value = 0;
BOOST_REQUIRE_EQUAL(value, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__assign__max_hash_0__null_hash)
{
uint256_t value(max_hash);
value = 0;
BOOST_REQUIRE_EQUAL(value, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__assign__odd_hash_to_42__42)
{
uint256_t value(odd_hash);
value = 42;
BOOST_REQUIRE_EQUAL(value, uint256_t("0x000000000000000000000000000000000000000000000000000000000000002a"));
}
// assign shift right
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__assign_shift_right__null_hash__null_hash)
{
uint256_t value1;
uint256_t value2;
uint256_t value3;
value1 >>= 0;
value2 >>= 1;
value3 >>= nuls::max_uint32;
BOOST_REQUIRE_EQUAL(value1, uint256_t());
BOOST_REQUIRE_EQUAL(value2, uint256_t());
BOOST_REQUIRE_EQUAL(value3, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__assign_shift_right__unit_hash_0__unit_hash)
{
uint256_t value(unit_hash);
value >>= 0;
BOOST_REQUIRE_EQUAL(value, uint256_t(unit_hash));
}
BOOST_AUTO_TEST_CASE(uint256__assign_shift_right__unit_hash_positive__null_hash)
{
uint256_t value1(unit_hash);
uint256_t value2(unit_hash);
value1 >>= 1;
value2 >>= nuls::max_uint32;
BOOST_REQUIRE_EQUAL(value1, uint256_t());
BOOST_REQUIRE_EQUAL(value2, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__assign_shift_right__max_hash_1__most_hash)
{
uint256_t value(max_hash);
value >>= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t(most_hash));
}
BOOST_AUTO_TEST_CASE(uint256__assign_shift_right__odd_hash_32__expected)
{
uint256_t value(odd_hash);
value >>= 32;
BOOST_REQUIRE_EQUAL(value, uint256_t("0x000000008437390223499ab234bf128e8cd092343485898923aaaaabbcbcc487"));
}
// assign shift left
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__assign_shift_left__null_hash__null_hash)
{
uint256_t value1;
uint256_t value2;
uint256_t value3;
value1 <<= 0;
value2 <<= 1;
value3 <<= nuls::max_uint32;
BOOST_REQUIRE_EQUAL(value1, uint256_t());
BOOST_REQUIRE_EQUAL(value2, uint256_t());
BOOST_REQUIRE_EQUAL(value3, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__assign_shift_left__unit_hash_0__1)
{
uint256_t value(unit_hash);
value <<= 0;
BOOST_REQUIRE_EQUAL(value, uint256_t(1));
}
BOOST_AUTO_TEST_CASE(uint256__assign_shift_left__unit_hash_1__2)
{
uint256_t value(unit_hash);
value <<= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t(2));
}
BOOST_AUTO_TEST_CASE(uint256__assign_shift_left__unit_hash_31__0x80000000)
{
uint256_t value(unit_hash);
value <<= 31;
BOOST_REQUIRE_EQUAL(value, uint256_t(0x80000000));
}
/* BOOST_AUTO_TEST_CASE(uint256__assign_shift_left__max_hash_1__expected) */
/* { */
/* uint256_t value(max_hash); */
/* value <<= 1; */
/* BOOST_REQUIRE_EQUAL(value, uint256_t("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe")); */
/* } */
BOOST_AUTO_TEST_CASE(uint256__assign_shift_left__odd_hash_32__expected)
{
uint256_t value(odd_hash);
value <<= 32;
BOOST_REQUIRE_EQUAL(value, uint256_t("0x23499ab234bf128e8cd092343485898923aaaaabbcbcc4874353fff400000000"));
}
// assign multiply32
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__assign_multiply32__0_by_0__0)
{
uint256_t value;
value *= 0;
BOOST_REQUIRE_EQUAL(value, uint256_t(0));
}
BOOST_AUTO_TEST_CASE(uint256__assign_multiply32__0_by_1__0)
{
uint256_t value;
value *= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t(0));
}
BOOST_AUTO_TEST_CASE(uint256__assign_multiply32__1_by_1__1)
{
uint256_t value(1);
value *= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t(1));
}
BOOST_AUTO_TEST_CASE(uint256__assign_multiply32__42_by_1__42)
{
uint256_t value(42);
value *= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t(42));
}
BOOST_AUTO_TEST_CASE(uint256__assign_multiply32__1_by_42__42)
{
uint256_t value(1);
value *= 42;
BOOST_REQUIRE_EQUAL(value, uint256_t(42));
}
BOOST_AUTO_TEST_CASE(uint256__assign_multiply32__fives_hash_by_3__max_hash)
{
uint256_t value(fives_hash);
value *= 3;
BOOST_REQUIRE_EQUAL(value, uint256_t(max_hash));
}
BOOST_AUTO_TEST_CASE(uint256__assign_multiply32__ones_hash_by_max_uint32__max_hash)
{
uint256_t value(ones_hash);
value *= nuls::max_uint32;
BOOST_REQUIRE_EQUAL(value, uint256_t(max_hash));
}
BOOST_AUTO_TEST_CASE(uint256__assign_multiply32__max_hash_by_256__shifts_left_8_bits)
{
uint256_t value(max_hash);
value *= 256;
BOOST_REQUIRE_EQUAL(value, uint256_t("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00"));
}
// assign divide32
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__assign_divide32__unit_hash_by_null_hash__throws_overflow_error)
{
uint256_t value(unit_hash);
BOOST_REQUIRE_THROW(value /= 0, std::overflow_error);
}
BOOST_AUTO_TEST_CASE(uint256__assign_divide32__null_hash_by_unit_hash__null_hash)
{
uint256_t value;
value /= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t(0));
}
BOOST_AUTO_TEST_CASE(uint256__assign_divide32__max_hash_by_3__fives_hash)
{
uint256_t value(max_hash);
value /= 3;
BOOST_REQUIRE_EQUAL(value, uint256_t(fives_hash));
}
BOOST_AUTO_TEST_CASE(uint256__assign_divide32__max_hash_by_max_uint32__ones_hash)
{
uint256_t value(max_hash);
value /= nuls::max_uint32;
BOOST_REQUIRE_EQUAL(value, uint256_t(ones_hash));
}
BOOST_AUTO_TEST_CASE(uint256__assign_divide32__max_hash_by_256__shifts_right_8_bits)
{
uint256_t value(max_hash);
value /= 256;
BOOST_REQUIRE_EQUAL(value, uint256_t("0x00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
}
// assign add256
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__assign_add256__0_to_null_hash__null_hash)
{
uint256_t value;
value += 0;
BOOST_REQUIRE_EQUAL(value, uint256_t(0));
}
BOOST_AUTO_TEST_CASE(uint256__assign_add256__null_hash_to_null_hash__null_hash)
{
uint256_t value;
value += uint256_t();
BOOST_REQUIRE_EQUAL(uint256_t() + uint256_t(), uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__assign_add256__1_to_max_hash__null_hash)
{
uint256_t value(max_hash);
value += 1;
BOOST_REQUIRE_EQUAL(value, uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__assign_add256__ones_hash_to_odd_hash__expected)
{
uint256_t value(odd_hash);
value += uint256_t(ones_hash);
BOOST_REQUIRE_EQUAL(value, uint256_t("0x8437390323499ab334bf128f8cd092353485898a23aaaaacbcbcc4884353fff5"));
}
BOOST_AUTO_TEST_CASE(uint256__assign_add256__1_to_0xffffffff__0x0100000000)
{
uint256_t value(0xffffffff);
value += 1;
BOOST_REQUIRE_EQUAL(value, uint256_t("0x100000000"));
}
BOOST_AUTO_TEST_CASE(uint256__assign_add256__1_to_negative_zero_hash__expected)
{
uint256_t value(negative_zero_hash);
value += 1;
BOOST_REQUIRE_EQUAL(value, uint256_t("0x8000000000000000000000000000000000000000000000000000000000000001"));
}
// assign subtract256
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__assign_subtract256__0_from_null_hash__null_hash)
{
uint256_t value;
value -= 0;
BOOST_REQUIRE_EQUAL(value, uint256_t(0));
}
BOOST_AUTO_TEST_CASE(uint256__assign_subtract256__null_hash_from_null_hash__null_hash)
{
uint256_t value;
value -= uint256_t();
BOOST_REQUIRE_EQUAL(uint256_t() + uint256_t(), uint256_t());
}
BOOST_AUTO_TEST_CASE(uint256__assign_subtract256__1_from_null_hash__max_hash)
{
uint256_t value;
value -= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t(max_hash));
}
BOOST_AUTO_TEST_CASE(uint256__assign_subtract256__1_from_max_hash__expected)
{
uint256_t value(max_hash);
value -= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe"));
}
BOOST_AUTO_TEST_CASE(uint256__assign_subtract256__ones_hash_from_odd_hash__expected)
{
uint256_t value(odd_hash);
value -= uint256_t(ones_hash);
BOOST_REQUIRE_EQUAL(value, uint256_t("0x8437390123499ab134bf128d8cd092333485898823aaaaaabcbcc4864353fff3"));
}
BOOST_AUTO_TEST_CASE(uint256__assign_subtract256__1_from_0xffffffff__0x0100000000)
{
uint256_t value(0xffffffff);
value -= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t(0xfffffffe));
}
BOOST_AUTO_TEST_CASE(uint256__assign_subtract256__1_from_negative_zero_hash__most_hash)
{
uint256_t value(negative_zero_hash);
value -= 1;
BOOST_REQUIRE_EQUAL(value, uint256_t(most_hash));
}
// assign divide256
//-----------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(uint256__assign_divide__unit_hash_by_null_hash__throws_overflow_error)
{
uint256_t value(unit_hash);
BOOST_REQUIRE_THROW(value /= uint256_t(0), std::overflow_error);
}
BOOST_AUTO_TEST_CASE(uint256__assign_divide__null_hash_by_unit_hash__null_hash)
{
uint256_t value;
value /= uint256_t(unit_hash);
BOOST_REQUIRE_EQUAL(value, uint256_t(0));
}
BOOST_AUTO_TEST_CASE(uint256__assign_divide__max_hash_by_3__fives_hash)
{
uint256_t value(max_hash);
value /= 3;
BOOST_REQUIRE_EQUAL(value, uint256_t(fives_hash));
}
BOOST_AUTO_TEST_CASE(uint256__assign_divide__max_hash_by_max_hash__1)
{
uint256_t value(max_hash);
value /= uint256_t(max_hash);
BOOST_REQUIRE_EQUAL(value, uint256_t(1));
}
BOOST_AUTO_TEST_CASE(uint256__assign_divide__max_hash_by_256__shifts_right_8_bits)
{
static const uint256_t value(max_hash);
static const auto quotient = value / uint256_t(256);
BOOST_REQUIRE_EQUAL(quotient, uint256_t("0x00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
}
BOOST_AUTO_TEST_SUITE_END()
| 31.172237
| 125
| 0.744186
|
ccccbjcn
|
bf20ba66b9122b37906ef811543dea5d87f63b8f
| 1,157
|
cpp
|
C++
|
src/classwork/03_assign/decision.cpp
|
acc-cosc-1337-spring-2021/acc-cosc-1337-spring-2021-aaronvonkreisler
|
6733dcd999d378149dc7c2755d6b693f2924a03f
|
[
"MIT"
] | 1
|
2021-02-03T00:59:22.000Z
|
2021-02-03T00:59:22.000Z
|
src/classwork/03_assign/decision.cpp
|
acc-cosc-1337-spring-2021/acc-cosc-1337-spring-2021-aaronvonkreisler
|
6733dcd999d378149dc7c2755d6b693f2924a03f
|
[
"MIT"
] | 1
|
2021-02-10T00:25:08.000Z
|
2021-02-10T00:25:08.000Z
|
src/classwork/03_assign/decision.cpp
|
acc-cosc-1337-spring-2021/acc-cosc-1337-spring-2021-aaronvonkreisler
|
6733dcd999d378149dc7c2755d6b693f2924a03f
|
[
"MIT"
] | null | null | null |
//cpp
#include "decision.h"
#include <iostream>
#include <string>
using std::string;
string get_letter_grade_using_if(int grade)
{
bool gradeA = grade >= 90 && grade <= 100;
bool gradeB = grade >= 80 && grade <= 89;
bool gradeC = grade >= 70 && grade <= 79;
bool gradeD = grade >= 60 && grade <= 69;
bool gradeF = grade >= 0 && grade <= 59;
string letterGrade;
if (gradeA)
letterGrade = "A";
else if (gradeB)
letterGrade = "B";
else if (gradeC)
letterGrade = "C";
else if (gradeD)
letterGrade = "D";
else
letterGrade = "F";
return letterGrade;
}
string get_letter_grade_using_switch(int grade)
{
string letterGrade;
switch (grade / 10)
{
case 10:
case 9:
letterGrade = "A";
break;
case 8:
letterGrade = "B";
break;
case 7:
letterGrade = "C";
break;
case 6:
letterGrade = "D";
break;
case 5:
case 4:
case 3:
case 2:
case 1:
letterGrade = "F";
break;
default:
letterGrade = "OUT OF RANGE";
}
return letterGrade;
}
| 18.967213
| 47
| 0.532411
|
acc-cosc-1337-spring-2021
|
bf25d954d6efcfccb2c3da744211fcfc1bde374e
| 884
|
cpp
|
C++
|
tests/YstringTest/Utf/test_Utf8StringCpp11.cpp
|
wvffle/Ystring
|
a1ee9da1e433a2e74e432da6834638d547265126
|
[
"BSD-2-Clause"
] | null | null | null |
tests/YstringTest/Utf/test_Utf8StringCpp11.cpp
|
wvffle/Ystring
|
a1ee9da1e433a2e74e432da6834638d547265126
|
[
"BSD-2-Clause"
] | 1
|
2021-02-28T12:46:55.000Z
|
2021-03-03T20:58:14.000Z
|
tests/YstringTest/Utf/test_Utf8StringCpp11.cpp
|
wvffle/Ystring
|
a1ee9da1e433a2e74e432da6834638d547265126
|
[
"BSD-2-Clause"
] | 1
|
2021-02-28T13:02:43.000Z
|
2021-02-28T13:02:43.000Z
|
//****************************************************************************
// Copyright © 2015 Jan Erik Breimo. All rights reserved.
// Created by Jan Erik Breimo on 2015-07-29
//
// This file is distributed under the Simplified BSD License.
// License text is included with the source distribution.
//****************************************************************************
#include "Ystring/Utf8.hpp"
#include "Ytest/Ytest.hpp"
namespace
{
using namespace Ystring;
void test_toUtf8_fromUtf16_u16string()
{
Y_EQUAL(Utf8::toUtf8(u"A\U00010001<"),
"A\xF0\x90\x80\x81<");
}
void test_toUtf8_fromUtf32_u32string()
{
Y_EQUAL(Utf8::toUtf8(U"A\U00010001<"),
"A\xF0\x90\x80\x81<");
}
Y_SUBTEST("Utf8",
test_toUtf8_fromUtf16_u16string,
test_toUtf8_fromUtf32_u32string);
}
| 28.516129
| 78
| 0.529412
|
wvffle
|
bf32a2f40f41ef754bdedf167eee5899de8be7ac
| 1,935
|
cpp
|
C++
|
Implementations/Luogu/P4568.cpp
|
VecTest/code-library
|
00e9e881acece02c7dbeac3a139cb55e0b439cee
|
[
"MIT"
] | 1
|
2022-03-05T00:34:14.000Z
|
2022-03-05T00:34:14.000Z
|
Implementations/Luogu/P4568.cpp
|
VecTest/code-library
|
00e9e881acece02c7dbeac3a139cb55e0b439cee
|
[
"MIT"
] | null | null | null |
Implementations/Luogu/P4568.cpp
|
VecTest/code-library
|
00e9e881acece02c7dbeac3a139cb55e0b439cee
|
[
"MIT"
] | null | null | null |
#include <bits/stdc++.h>
/*
大致思路:
分层图最短路
提交地址:
https://www.luogu.com.cn/problem/P4568
https://www.acwing.com/problem/content/2956/
*/
const int INF = 1e9;
struct Edge {
int v, w;
};
using Edges = std::vector<std::vector<Edge>>;
struct Vertex {
int d, p;
bool operator < (const Vertex &x) const {
return d > x.d;
}
};
std::vector<int> Dijkstra(int n, int s, Edges &e) {
std::vector<int> d(n, INF);
d[s] = 0;
std::vector<bool> f(n);
std::priority_queue<Vertex> q;
q.push({0, s});
while (!q.empty()) {
int x = q.top().p;
q.pop();
if (f[x]) {
continue;
}
f[x] = true;
for (int i = 0; i < (int) e[x].size(); i++) {
int y = e[x][i].v, w = e[x][i].w;
if (!f[y] && d[y] > d[x] + w) {
d[y] = d[x] + w;
q.push({d[y], y});
}
}
}
return d;
}
void add(int u, int v, int d, Edges &e) {
e[u].push_back({v, d});
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, m, k;
std::cin >> n >> m >> k;
int s, t;
std::cin >> s >> t;
// 有 k + 1 层,每层有 n 个点,故最大编号为 (k + 1) * n - 1
int p = (k + 1) * n; // 总点数
Edges e(p);
for (int i = 0; i < m; i++) {
int u, v, d;
std::cin >> u >> v >> d;
add(u, v, d, e);
add(v, u, d, e);
for (int j = 1; j <= k; j++) { // 建第 j 层的图
add(u + j * n, v + j * n, d, e);
add(v + j * n, u + j * n, d, e);
add(u + (j - 1) * n, v + j * n, 0, e);
add(v + (j - 1) * n, u + j * n, 0, e);
}
}
std::vector<int> d = Dijkstra(p, s, e);
int ans = INF;
for (int i = 0; i <= k; i++) {
ans = std::min(ans, d[t + i * n]);
}
std::cout << ans << "\n";
#ifdef LOCAL
std::cout << std::flush;
system("pause");
#endif
return 0;
}
| 18.970588
| 53
| 0.407235
|
VecTest
|
bf3b8ab62f69b53fc82fac1f5648f17b75332d14
| 27,400
|
cpp
|
C++
|
src/font/ttf.cpp
|
jjbandit/bonsai
|
f6073484c14178aff6925eaf8caddf349174b27d
|
[
"WTFPL"
] | 13
|
2017-04-12T16:26:46.000Z
|
2022-03-01T22:04:34.000Z
|
src/font/ttf.cpp
|
jjbandit/bonsai
|
f6073484c14178aff6925eaf8caddf349174b27d
|
[
"WTFPL"
] | null | null | null |
src/font/ttf.cpp
|
jjbandit/bonsai
|
f6073484c14178aff6925eaf8caddf349174b27d
|
[
"WTFPL"
] | null | null | null |
#include <bonsai_types.h>
global_variable v4 White = V4(1,1,1,0);
global_variable v4 Black = {};
global_variable v4 Red = V4(1,0,0,0);
global_variable v4 Blue = V4(0,0,1,0);
global_variable v4 Pink = V4(1,0,1,0);
global_variable v4 Green = V4(0,1,0,0);
global_variable u32 PackedWhite = PackRGBALinearTo255(White );
global_variable u32 PackedBlack = PackRGBALinearTo255(Black );
global_variable u32 PackedRed = PackRGBALinearTo255(Red );
global_variable u32 PackedBlue = PackRGBALinearTo255(Blue );
global_variable u32 PackedPink = PackRGBALinearTo255(Pink );
global_variable u32 PackedGreen = PackRGBALinearTo255(Green );
inline u8
ReadU8(u8* Source)
{
u8 Result = Source[0];
return Result;
}
inline s16
ReadS16(s16* Source)
{
s16 Result = (((u8*)Source)[0]*256) + ((u8*)Source)[1];
return Result;
}
inline s16
ReadS16(u8* Source)
{
s16 Result = (Source[0]*256) + Source[1];
return Result;
}
inline u16
ReadU16(u16* Source)
{
u16 Result = (((u8*)Source)[0]*256) + ((u8*)Source)[1];
return Result;
}
inline u16
ReadU16(u8* Source)
{
u16 Result = (Source[0]*256) + Source[1];
return Result;
}
inline s64
ReadS64(u8* Source)
{
s64 Result = (s64)( ((u64)Source[0]<<56) + ((u64)Source[1]<<48) + ((u64)Source[2]<<40) + ((u64)Source[3]<<32) + ((u64)Source[4]<<24) + ((u64)Source[5]<<16) + ((u64)Source[6]<<8) + ((u64)Source[7]) );
return Result;
}
inline u32
ReadU32(u8* Source)
{
u32 Result = (u32)( (Source[0]<<24) + (Source[1]<<16) + (Source[2]<<8) + Source[3] );
return Result;
}
inline u8*
ReadU8Array(u8_stream *Source, u32 Count)
{
u8 *Result = Source->At;
Source->At += Count;
Assert(Source->At <= Source->End);
return Result;
}
inline u16*
ReadU16Array(u8_stream *Source, u32 Count)
{
u16 *Result = (u16*)Source->At;
Source->At += sizeof(u16)*Count;
Assert(Source->At <= Source->End);
return Result;
}
inline s16*
ReadS16Array(u8_stream *Source, u32 Count)
{
s16 *Result = (s16*)Source->At;
Source->At += sizeof(s16)*Count;
Assert(Source->At <= Source->End);
return Result;
}
inline u8
ReadU8(u8_stream *Source)
{
u8 Result = ReadU8(Source->At);
Source->At += sizeof(u8);
Assert(Source->At <= Source->End);
return Result;
}
inline s16
ReadS16(u8_stream *Source)
{
s16 Result = ReadS16(Source->At);
Source->At += sizeof(s16);
Assert(Source->At <= Source->End);
return Result;
}
inline u16
ReadU16(u8_stream *Source)
{
u16 Result = ReadU16(Source->At);
Source->At += sizeof(u16);
Assert(Source->At <= Source->End);
return Result;
}
inline s64
ReadS64(u8_stream *Source)
{
s64 Result = ReadS64(Source->At);
Source->At += sizeof(s64);
Assert(Source->At <= Source->End);
return Result;
}
inline u32
ReadU32(u8_stream *Source)
{
u32 Result = ReadU32(Source->At);
Source->At += sizeof(u32);
Assert(Source->At <= Source->End);
return Result;
}
struct head_table
{
// Technically the spec says these are 32bit fixed point numbers, but IDC
// because I never use them
u32 Version;
u32 FontRevision;
u32 ChecksumAdjustment;
u32 MagicNumber;
u16 Flags;
u16 UnitsPerEm;
s64 Created;
s64 Modified;
s16 xMin;
s16 yMin;
s16 xMax;
s16 yMax;
u16 MacStyle;
u16 LowestRecPPEM;
u16 FontDirectionHint;
u16 IndexToLocFormat;
u16 GlyphDataFormat;
};
struct ttf_vert
{
v2i P;
u16 Flags;
};
struct ttf_contour
{
u32 StartIndex;
u32 EndIndex;
};
struct simple_glyph
{
v2i MinP;
v2i EmSpaceDim;
s16 ContourCount;
ttf_contour* Contours;
s16 VertCount;
ttf_vert* Verts;
};
struct font_table
{
u32 Tag;
char* HumanTag;
u32 Checksum;
u32 Offset;
u32 Length;
u8* Data;
};
struct ttf
{
font_table* head; // Font Header
head_table* HeadTable;
font_table* cmap; // Character Glyph mapping
font_table* glyf; // Glyph data
font_table* hhea; // Horizontal Header
font_table* htmx; // Horizontal Metrics
font_table* loca; // Index to Location
font_table* maxp; // Maximum Profile
font_table* name; // Naming
font_table* post; // PostScript
b32 Loaded;
};
struct offset_subtable
{
u32 ScalerType;
u16 NumTables;
u16 SearchRange;
u16 EntrySelector;
u16 RangeShift;
b32 Valid;
};
enum ttf_flag
{
TTFFlag_OnCurve = 1 << 0,
TTFFlag_ShortX = 1 << 1,
TTFFlag_ShortY = 1 << 2,
TTFFlag_Repeat = 1 << 3,
TTFFlag_DualX = 1 << 4,
TTFFlag_DualY = 1 << 5,
};
u8_stream
U8_Stream(font_table *Table)
{
u8_stream Result = U8_Stream(Table->Data, Table->Data+Table->Length);
return Result;
}
char *
HumanTag(u32 Tag, memory_arena *Memory)
{
char* Result = Allocate(char, Memory, 5);
char* Bin = (char*)&Tag;
Result[0] = Bin[3];
Result[1] = Bin[2];
Result[2] = Bin[1];
Result[3] = Bin[0];
return Result;
}
#define TTF_TAG(s) \
((s[0]<<24) | (s[1]<<16) | (s[2]<<8) | s[3])
#define AssignTo(prop) \
case TTF_TAG(#prop): { Assert(!Font->prop); Font->prop = Table; Info("Assigned Table : %s", Table->HumanTag); } break;
inline void
AssignTable(font_table *Table, ttf *Font)
{
switch (Table->Tag)
{
AssignTo(head);
AssignTo(cmap);
AssignTo(glyf);
AssignTo(hhea);
AssignTo(htmx);
AssignTo(loca);
AssignTo(maxp);
AssignTo(name);
AssignTo(post);
default:
{
Warn("Unknown Table encountered : %s", Table->HumanTag);
} break;
}
}
inline font_table*
ParseFontTable(u8_stream *Source, memory_arena *Arena)
{
font_table *Result = Allocate(font_table, Arena, 1);
Result->Tag = ReadU32(Source);
Result->Checksum = ReadU32(Source);
Result->Offset = ReadU32(Source);
Result->Length = ReadU32(Source);
Result->Data = Source->Start + Result->Offset;
Result->HumanTag = HumanTag(Result->Tag, Arena);
return Result;
}
offset_subtable
ParseOffsetSubtable(u8_stream *Source, memory_arena* Arena)
{
Assert(Source->At == Source->Start);
offset_subtable Result = {};
Result.ScalerType = ReadU32(Source);
switch (Result.ScalerType)
{
case 0x00010000:
{
Result.Valid = True;
} break;
// TODO(Jesse, id: 140, tags: font, ttf_rasterizer, completeness): Can we support these?
case 'true': // Apple encoding
case 'typ1': // Apple encoding
case 'OTTO': // OTF 1/2 - Has a CFF Table .. whatever that means
{
Error("Unsupported ScalerType encountered in FontTable : %s", HumanTag(Result.ScalerType, Arena) );
} break;
InvalidDefaultCase;
}
Result.NumTables = ReadU16(Source);
Result.SearchRange = ReadU16(Source);
Result.EntrySelector = ReadU16(Source);
Result.RangeShift = ReadU16(Source);
return Result;
}
u32
CalculateTableChecksum(font_table *Table)
{
u32 Sum = 0;
u8* TableData = Table->Data;
u32 FourByteChunks = (Table->Length + 3) / 4;
while (FourByteChunks-- > 0)
{
Sum += ReadU32(TableData);
TableData += 4;
}
return Sum;
}
ttf
InitTTF(const char* SourceFile, memory_arena *Arena)
{
ttf Result = {};
u8_stream Source = U8_StreamFromFile(SourceFile, Arena);
if (Source.Start)
{
offset_subtable TableOffsets = ParseOffsetSubtable(&Source, Arena);
if (TableOffsets.Valid)
{
for (u32 TableIndex = 0;
TableIndex < TableOffsets.NumTables;
++TableIndex)
{
font_table *CurrentTable = ParseFontTable(&Source, Arena);
u32 Checksum = CalculateTableChecksum(CurrentTable);
if (Checksum != CurrentTable->Checksum) { Error("Invalid checksum encountered when reading table %s", CurrentTable->HumanTag); }
AssignTable(CurrentTable, &Result);
}
Result.Loaded = True;
}
}
return Result;
}
simple_glyph
ParseGlyph(u8_stream *Stream, memory_arena *Arena)
{
simple_glyph Glyph = {};
Glyph.ContourCount = ReadS16(Stream);
if (Glyph.ContourCount > 0) // We don't support compound glyphs, yet
{
Glyph.Contours = Allocate(ttf_contour, Arena, Glyph.ContourCount);
s16 xMin = ReadS16(Stream);
s16 yMin = ReadS16(Stream);
s16 xMax = ReadS16(Stream);
s16 yMax = ReadS16(Stream);
Glyph.MinP = { xMin, yMin };
Glyph.EmSpaceDim.x = xMax - xMin + 1; // Add one to put from 0-based to 1-based
Glyph.EmSpaceDim.y = yMax - yMin + 1; // coordinate system
u16 *EndPointsOfContours = ReadU16Array(Stream, (u32)Glyph.ContourCount);
u16 NextStart = 0;
for (u16 ContourIndex = 0;
ContourIndex < Glyph.ContourCount;
++ContourIndex)
{
Glyph.Contours[ContourIndex].StartIndex = NextStart;
Glyph.Contours[ContourIndex].EndIndex = ReadU16(EndPointsOfContours + ContourIndex);
NextStart = SafeTruncateToU16(Glyph.Contours[ContourIndex].EndIndex + 1);
}
u16 InstructionLength = ReadU16(Stream);
/* u8* Instructions = */ ReadU8Array(Stream, InstructionLength);
u8* Flags = Stream->At;
u8* FlagsAt = Flags;
Glyph.VertCount = (s16)(1 + ReadU16(EndPointsOfContours+Glyph.ContourCount-1));
Glyph.Verts = Allocate(ttf_vert, Arena, Glyph.VertCount);
s16 RepeatCount = 0;
u8 Flag = 0;
for (s16 PointIndex = 0;
PointIndex < Glyph.VertCount;
++PointIndex)
{
if (RepeatCount)
{
--RepeatCount;
}
else
{
Flag = *FlagsAt++;
Assert((Flag & 64) == 0);
Assert((Flag & 128) == 0);
if (Flag & TTFFlag_Repeat)
{
RepeatCount = *FlagsAt++;
Assert(PointIndex + RepeatCount < Glyph.VertCount);
}
}
Glyph.Verts[PointIndex].Flags = Flag;
}
u8_stream VertStream = U8_Stream(FlagsAt, (u8*)0xFFFFFFFFFFFFFFFF);
s16 X = 0;
for (s16 PointIndex = 0;
PointIndex < Glyph.VertCount;
++PointIndex)
{
ttf_vert *Vert = Glyph.Verts + PointIndex;
if (Vert->Flags & TTFFlag_ShortX)
{
u16 Delta = ReadU8(&VertStream);
X += (Vert->Flags & TTFFlag_DualX) ? Delta : -Delta;
}
else
{
if (!(Vert->Flags & TTFFlag_DualX))
{
X += ReadU16(&VertStream);
}
}
Vert->P.x = X - xMin;
Assert(Vert->P.x >= 0);
Assert(Vert->P.x <= Glyph.EmSpaceDim.x);
}
s16 Y = 0;
for (s16 PointIndex = 0;
PointIndex < Glyph.VertCount;
++PointIndex)
{
ttf_vert *Vert = Glyph.Verts + PointIndex;
if (Vert->Flags & TTFFlag_ShortY)
{
u16 Delta = ReadU8(&VertStream);
Y += (Vert->Flags & TTFFlag_DualY) ? Delta : -Delta;
}
else
{
if (!(Vert->Flags & TTFFlag_DualY))
{
Y += ReadU16(&VertStream);
}
}
Vert->P.y = Y - yMin;
Assert(Vert->P.y >= 0);
Assert(Vert->P.y <= Glyph.EmSpaceDim.y);
}
}
return Glyph;
}
/* #define DebugCase(platform_id) \ */
/* case platform_id: { Info("Platform Id : %s", #platform_id); */
/* #define UnsupportedPlatform(platform_id) \ */
/* case platform_id: { Error("Unsupported Platform %s", #platform_id); } break; */
u16
GetGlyphIdForCharacterCode(u32 UnicodeCodepoint, ttf *Font)
{
font_table *Cmap = Font->cmap;
u32 Checksum = CalculateTableChecksum(Cmap);
Assert(Checksum == Cmap->Checksum);
u8_stream CmapStream = U8_Stream(Cmap);
u16 TableVersion = ReadU16(&CmapStream);
Assert(TableVersion == 0);
u16 NumSubtables = ReadU16(&CmapStream);
for (u32 SubtableIndex = 0;
SubtableIndex < NumSubtables;
++SubtableIndex)
{
/* u16 PlatformId = */ ReadU16(&CmapStream);
/* u16 PlatformSpecificId = */ ReadU16(&CmapStream);
u32 Offset = ReadU32(&CmapStream);
u8* Start = CmapStream.Start + Offset;
u8_stream TableStream = {};
TableStream.Start = Start;
TableStream.At = Start;
TableStream.End = Start+4;
u16 Format = ReadU16(&TableStream);
u16 Length = ReadU16(&TableStream);
TableStream.End = Start+Length;
if (Format == 4)
{
/* u16 Lang = */ ReadU16(&TableStream);
u16 SegCountX2 = ReadU16(&TableStream);
u16 SegCount = SegCountX2/2;
/* u16 SearchRange = */ ReadU16(&TableStream);
/* u16 EntrySelector = */ ReadU16(&TableStream);
/* u16 RangeShift = */ ReadU16(&TableStream);
u16* EndCodes = ReadU16Array(&TableStream, SegCount);
u16 Pad = ReadU16(&TableStream);
Assert(Pad==0);
u16* StartCodes = ReadU16Array(&TableStream, SegCount);
u16* IdDelta = ReadU16Array(&TableStream, SegCount);
u16* IdRangeOffset = ReadU16Array(&TableStream, SegCount);
for (u32 SegIdx = 0;
SegIdx < SegCount;
++SegIdx)
{
u16 StartCode = ReadU16(StartCodes+SegIdx);
u16 End = ReadU16(EndCodes+SegIdx);
u16 Delta = ReadU16(IdDelta+SegIdx);
u16 RangeOffset = ReadU16(IdRangeOffset+SegIdx);
if (UnicodeCodepoint >= StartCode && UnicodeCodepoint <= End)
{
if (RangeOffset)
{
u16 GlyphIndex = ReadU16( &IdRangeOffset[SegIdx] + RangeOffset / 2 + (UnicodeCodepoint - StartCode) );
u16 Result = GlyphIndex ? GlyphIndex + Delta : GlyphIndex;
return Result;
}
else
{
u32 GlyphIndex = Delta + UnicodeCodepoint;
return GlyphIndex & 0xFFFF;
}
}
}
}
}
return 0;
}
inline head_table*
ParseHeadTable(u8_stream *Stream, memory_arena *Arena)
{
head_table *Result = Allocate(head_table, Arena, 1);
Result->Version = ReadU32(Stream);
Assert(Result->Version == 0x00010000);
Result->FontRevision = ReadU32(Stream);
Result->ChecksumAdjustment = ReadU32(Stream);
Result->MagicNumber = ReadU32(Stream);
Assert(Result->MagicNumber == 0x5F0F3CF5);
Result->Flags = ReadU16(Stream);
Result->UnitsPerEm = ReadU16(Stream);
Result->Created = ReadS64(Stream);
Result->Modified = ReadS64(Stream);
Result->xMin = ReadS16(Stream);
Result->yMin = ReadS16(Stream);
Result->xMax = ReadS16(Stream);
Result->yMax = ReadS16(Stream);
Result->MacStyle = ReadU16(Stream);
Result->LowestRecPPEM = ReadU16(Stream);
Result->FontDirectionHint = ReadU16(Stream);
Result->IndexToLocFormat = ReadU16(Stream);
Result->GlyphDataFormat = ReadU16(Stream);
Assert(Stream->At == Stream->End);
return Result;
}
#define SHORT_INDEX_LOCATION_FORMAT 0
#define LONG_INDEX_LOCATION_FORMAT 1
inline u8_stream
GetStreamForGlyphIndex(u32 GlyphIndex, ttf *Font)
{
head_table *HeadTable = Font->HeadTable;
u8_stream Result = {};
if (HeadTable->IndexToLocFormat == SHORT_INDEX_LOCATION_FORMAT)
{
u32 GlyphIndexOffset = GlyphIndex * sizeof(u16);
u32 StartOffset = ReadU16(Font->loca->Data + GlyphIndexOffset) *2;
u32 EndOffset = ReadU16(Font->loca->Data + GlyphIndexOffset + sizeof(u16)) *2;
Assert(StartOffset <= EndOffset);
u8* Start = Font->glyf->Data + StartOffset;
u8* End = Font->glyf->Data + EndOffset;
Result = U8_Stream(Start, End);
}
else if (HeadTable->IndexToLocFormat == LONG_INDEX_LOCATION_FORMAT)
{
/* u32 FirstOffset = */ ReadU32(Font->loca->Data);
/* u32 FirstEndOffset = */ ReadU32(Font->loca->Data+1);
u32 StartOffset = ReadU32(Font->loca->Data+(GlyphIndex*4));
u32 EndOffset = ReadU32(Font->loca->Data+(GlyphIndex*4)+4);
u8* Start = Font->glyf->Data + StartOffset;
u8* End = Font->glyf->Data + EndOffset;
Result = U8_Stream(Start, End);
}
else
{
InvalidCodePath();
}
return Result;
}
inline u32
GetPixelIndex(v2i PixelP, bitmap* Bitmap)
{
Assert(PixelP.x < Bitmap->Dim.x);
Assert(PixelP.y < Bitmap->Dim.y);
u32 Result = (u32)(PixelP.x + (s32)(PixelP.y*Bitmap->Dim.x));
Assert(Result < (u32)PixelCount(Bitmap));
return Result;
}
u32
WrapToCurveIndex(u32 IndexWanted, u32 CurveStart, u32 CurveEnd)
{
u32 Result = IndexWanted;
if (Result > CurveEnd)
{
u32 Remaining = Result - CurveEnd;
Result = CurveStart + Remaining - 1;
}
return Result;
}
bitmap
RasterizeGlyph(v2i OutputSize, v2i FontMaxEmDim, v2i FontMinGlyphP, u8_stream *GlyphStream, memory_arena* Arena)
{
#define DO_RASTERIZE 1
#define DO_AA 1
#define WRITE_DEBUG_BITMAPS 0
s32 SamplesPerPixel = 4;
v2i SamplingBitmapDim = OutputSize*SamplesPerPixel;
bitmap SamplingBitmap = AllocateBitmap(SamplingBitmapDim, Arena);
bitmap OutputBitmap = {};
if (Remaining(GlyphStream) > 0) // A glyph stream with 0 length means there's no glyph
{
simple_glyph Glyph = ParseGlyph(GlyphStream, Arena);
if (Glyph.ContourCount > 0) // We don't support compound glyphs, yet
{
FillBitmap(PackRGBALinearTo255(White), &SamplingBitmap);
OutputBitmap = AllocateBitmap(OutputSize, Arena);
FillBitmap(PackRGBALinearTo255(White), &OutputBitmap);
for (u16 ContourIndex = 0;
ContourIndex < Glyph.ContourCount;
++ContourIndex)
{
ttf_contour* Contour = Glyph.Contours + ContourIndex;
u32 ContourVertCount = Contour->EndIndex - Contour->StartIndex;
u32 AtIndex = Contour->StartIndex;
u32 VertsProcessed = 0;
while (VertsProcessed <= ContourVertCount)
{
Assert(Glyph.Verts[AtIndex].Flags & TTFFlag_OnCurve);
u32 VertCount = 1;
u32 CurveEndIndex = WrapToCurveIndex(AtIndex+1, Contour->StartIndex, Contour->EndIndex);
while ( !(Glyph.Verts[CurveEndIndex].Flags & TTFFlag_OnCurve) )
{
CurveEndIndex = WrapToCurveIndex(CurveEndIndex+1, Contour->StartIndex, Contour->EndIndex);
++VertCount;
}
++VertCount;
v2* TempVerts = Allocate(v2, Arena, VertCount); // TODO(Jesse, id: 141, tags: transient_memory, ttf_rasterizer): Temp-memory?
v2i BaselineOffset = Glyph.MinP - FontMinGlyphP;
// Here we have to subtract one from everything because we're going
// from a dimension [1, Dim] to an indexable range [0, Dim-1]
//
// TODO(Jesse, id: 142, tags: open_question): Is there a better way of making that adjustment?
v2i One = V2i(1,1);
v2 EmScale = V2(Glyph.EmSpaceDim-One) / V2(FontMaxEmDim-One);
v2 EmSpaceToPixelSpace = EmScale*( (SamplingBitmapDim-One) / (Glyph.EmSpaceDim-One) );
v4 LastColor = Red;
u32 LastPixelIndex = 0;
for (r32 t = 0.0f;
t < 1.0f;
t += 0.0001f)
{
for (u32 VertIndex = 0;
VertIndex < VertCount;
++VertIndex)
{
u32 CurveVertIndex = WrapToCurveIndex(AtIndex + VertIndex, Contour->StartIndex, Contour->EndIndex);
TempVerts[VertIndex] = V2(Glyph.Verts[CurveVertIndex].P + BaselineOffset) * EmSpaceToPixelSpace;
}
v2 TangentMax = {};
for (u32 Outer = VertCount;
Outer > 1;
--Outer)
{
for (u32 Inner = 0;
Inner < Outer-1;
++Inner)
{
v2 tVec01 = (TempVerts[Inner+1]-TempVerts[Inner]) * t;
TempVerts[Inner] = TempVerts[Inner+1] - tVec01;
if (Inner == Outer-2)
{
TangentMax = TempVerts[Inner+1];
}
}
}
v2 PointOnCurve = TempVerts[0];
v4 Color = Red;
// On-curve transition
if ( (TangentMax.x >= PointOnCurve.x && TangentMax.y > PointOnCurve.y) ||
(TangentMax.x <= PointOnCurve.x && TangentMax.y > PointOnCurve.y) )
{
Color = Green;
}
else
if ( (TangentMax.x >= PointOnCurve.x && TangentMax.y <= PointOnCurve.y) ||
(TangentMax.x <= PointOnCurve.x && TangentMax.y <= PointOnCurve.y) )
{
Color = Blue;
}
u32 PixelIndex = GetPixelIndex(V2i(PointOnCurve), &SamplingBitmap);
SamplingBitmap.Pixels.Start[PixelIndex] = PackRGBALinearTo255(Color);
if (LastColor == Green && Color == Blue)
{
SamplingBitmap.Pixels.Start[PixelIndex] = PackRGBALinearTo255(Green);
}
if (LastColor == Blue && Color == Green)
{
SamplingBitmap.Pixels.Start[LastPixelIndex] = PackRGBALinearTo255(Green);
}
LastColor = Color;
LastPixelIndex = PixelIndex;
}
VertsProcessed += VertCount -1;
AtIndex = CurveEndIndex;
}
}
#if DO_RASTERIZE
for (s32 yIndex = 0;
yIndex < SamplingBitmap.Dim.y;
++yIndex)
{
s32 TransitionCount = 0;
for (s32 xIndex = 0;
xIndex < SamplingBitmap.Dim.x;
++xIndex)
{
u32 PixelIndex = GetPixelIndex(V2i(xIndex, yIndex), &SamplingBitmap);
u32 PixelColor = SamplingBitmap.Pixels.Start[PixelIndex];
if (PixelColor == PackedGreen)
{
TransitionCount = 1;
continue;
}
else if (PixelColor == PackedBlue)
{
TransitionCount = 0;
continue;
}
if (TransitionCount > 0)
{
SamplingBitmap.Pixels.Start[PixelIndex] = PackedBlack;
}
else
{
SamplingBitmap.Pixels.Start[PixelIndex] = PackedWhite;
}
}
}
#endif
#if DO_RASTERIZE && DO_AA
r32 SampleContrib = 1.0f/((r32)SamplesPerPixel*(r32)SamplesPerPixel);
for (s32 yPixelIndex = 0;
yPixelIndex < OutputBitmap.Dim.y;
++yPixelIndex)
{
for (s32 xPixelIndex = 0;
xPixelIndex < OutputBitmap.Dim.x;
++xPixelIndex)
{
r32 OneMinusAlpha = 0.0f;
s32 yStart = yPixelIndex*SamplesPerPixel;
for (s32 ySampleIndex = yStart;
ySampleIndex < yStart+SamplesPerPixel;
++ySampleIndex)
{
s32 xStart = xPixelIndex*SamplesPerPixel;
for (s32 xSampleIndex = xStart;
xSampleIndex < xStart+SamplesPerPixel;
++xSampleIndex)
{
if (xSampleIndex < SamplingBitmap.Dim.x && ySampleIndex < SamplingBitmap.Dim.y)
{
u32 SampleIndex = GetPixelIndex(V2i(xSampleIndex, ySampleIndex), &SamplingBitmap);
u32 PixelColor = SamplingBitmap.Pixels.Start[SampleIndex];
OneMinusAlpha += PixelColor == PackedWhite ? SampleContrib : 0.0f;
}
}
}
u32 PixelIndex = GetPixelIndex(V2i(xPixelIndex, yPixelIndex), &OutputBitmap);
r32 Alpha = 1.0f - OneMinusAlpha;
OutputBitmap.Pixels.Start[PixelIndex] = PackRGBALinearTo255(V4(1.0f, 1.0f, 1.0f, Alpha));
if (xPixelIndex == (OutputBitmap.Dim.x-1) || yPixelIndex == (OutputBitmap.Dim.y-1))
{
OutputBitmap.Pixels.Start[PixelIndex] = PackedRed;
}
}
}
#endif
#if 0
v2 At = V2(Glyph.Verts->P);
v2 LastVertP = At;
v4 CurrentColor = (Glyph.Verts->Flags&TTFFlag_OnCurve) ? Black : Red;
v4 TargetColor = Black;
for (u32 VertIndex = 0;
VertIndex < Glyph.VertCount;
++VertIndex)
{
ttf_vert *Vert = Glyph.Verts + VertIndex;
v2 VertP = V2(Vert->P);
if (Vert->Flags & TTFFlag_OnCurve)
{
TargetColor = Black;
Debug("On Curve %d %d", Vert->P.x, Vert->P.y);
}
else
{
TargetColor = Red;
Debug("Off Curve %d %d", Vert->P.x, Vert->P.y);
}
v2 CurrentToVert = Normalize(VertP-At) * 0.5f;
while(Abs(Length(VertP - At)) > 0.5f)
{
r32 t = SafeDivide0(LengthSq(LastVertP-At), LengthSq(LastVertP-VertP));
u32 PixelColor = PackRGBALinearTo255(Lerp(t, CurrentColor, TargetColor));
u32 PixelIndex = GetPixelIndex(V2i(At), &Bitmap);
*(Bitmap.Pixels.Start + PixelIndex) = PixelColor;
At += CurrentToVert;
}
LastVertP = VertP;
CurrentColor = TargetColor;
}
#endif
}
#if WRITE_DEBUG_BITMAPS
WriteBitmapToDisk(&SamplingBitmap, "sample_glyph.bmp");
WriteBitmapToDisk(&OutputBitmap, "output_glyph.bmp");
#endif
}
return OutputBitmap;
}
void
CopyBitmapOffset(bitmap *Source, bitmap *Dest, v2i Offset)
{
for (s32 ySourcePixel = 0;
ySourcePixel < Source->Dim.y;
++ySourcePixel)
{
for (s32 xSourcePixel = 0;
xSourcePixel < Source->Dim.x;
++xSourcePixel)
{
u32 SourcePixelIndex = GetPixelIndex(V2i(xSourcePixel, ySourcePixel), Source);
u32 DestPixelIndex = GetPixelIndex( V2i(xSourcePixel, ySourcePixel) + Offset, Dest);
Dest->Pixels.Start[DestPixelIndex] = Source->Pixels.Start[SourcePixelIndex] ;
}
}
return;
}
int
main()
{
const char* FontName = "fonts/Anonymice/Anonymice Nerd Font Complete Mono Windows Compatible.ttf";
memory_arena* PermArena = AllocateArena();
memory_arena* TempArena = AllocateArena();
ttf Font = InitTTF(FontName, PermArena);
if (Font.Loaded)
{
u8_stream HeadStream = U8_Stream(Font.head);
Font.HeadTable = ParseHeadTable(&HeadStream, PermArena);
v2i FontMaxEmDim = { Font.HeadTable->xMax - Font.HeadTable->xMin, Font.HeadTable->yMax - Font.HeadTable->yMin };
v2i FontMinGlyphP = V2i(Font.HeadTable->xMin, Font.HeadTable->yMin);
v2i GlyphSize = V2i(32, 32);
bitmap TextureAtlasBitmap = AllocateBitmap(16*GlyphSize, PermArena);
u32 AtlasCount = 65536/256;
for (u32 AtlasIndex = 0;
AtlasIndex < AtlasCount;
++AtlasIndex)
{
FillBitmap(PackedPink, &TextureAtlasBitmap);
u32 GlyphsRasterized = 0;
for (u32 CharCode = AtlasIndex*256;
CharCode < (AtlasIndex*256)+256;
++CharCode)
{
u32 GlyphIndex = GetGlyphIdForCharacterCode(CharCode, &Font);
if (!GlyphIndex) continue;
u8_stream GlyphStream = GetStreamForGlyphIndex(GlyphIndex, &Font);
bitmap GlyphBitmap = RasterizeGlyph(GlyphSize, FontMaxEmDim, FontMinGlyphP, &GlyphStream, TempArena);
if ( PixelCount(&GlyphBitmap) )
{
Debug("Rasterized Glyph %d (%d)", CharCode, GlyphsRasterized);
++GlyphsRasterized;
#if 1
v2 UV = GetUVForCharCode((u8)(CharCode % 256));
CopyBitmapOffset(&GlyphBitmap, &TextureAtlasBitmap, V2i(UV*V2(TextureAtlasBitmap.Dim)) );
#else
char Name[128] = {};
FormatCountedString_(Name, 128, "Glyph_%d.bmp", CharCode);
WriteBitmapToDisk(&GlyphBitmap, Name);
#endif
}
RewindArena(TempArena);
}
if (GlyphsRasterized)
{
counted_string AtlasName = FormatCountedString(TempArena, CSz("texture_atlas_%d.bmp"), AtlasIndex);
// TODO(Jesse, id: 143, tags: robustness, open_question, format_counted_string_api): This could probably be made better by writing to a statically allocated buffer ..?
WriteBitmapToDisk(&TextureAtlasBitmap, GetNullTerminated(AtlasName));
}
GlyphsRasterized = 0;
}
}
else
{
Error("Loading Font %s", FontName);
}
return 0;
}
| 26.145038
| 201
| 0.61062
|
jjbandit
|
bf3fdb6deda0b4dadbb0a86d8f14c1c554d5b643
| 10,758
|
cpp
|
C++
|
src/tools/loop_invariant_code_motion/src/LastLiveOutPeeler.cpp
|
SusanTan/noelle
|
33c9e10a20bc59590c13bf29fb661fc406a9e687
|
[
"MIT"
] | 43
|
2020-09-04T15:21:40.000Z
|
2022-03-23T03:53:02.000Z
|
src/tools/loop_invariant_code_motion/src/LastLiveOutPeeler.cpp
|
SusanTan/noelle
|
33c9e10a20bc59590c13bf29fb661fc406a9e687
|
[
"MIT"
] | 15
|
2020-09-17T18:06:15.000Z
|
2022-01-24T17:14:36.000Z
|
src/tools/loop_invariant_code_motion/src/LastLiveOutPeeler.cpp
|
SusanTan/noelle
|
33c9e10a20bc59590c13bf29fb661fc406a9e687
|
[
"MIT"
] | 23
|
2020-09-04T15:50:09.000Z
|
2022-03-25T13:38:25.000Z
|
/*
* Copyright 2019 - 2020 Simone Campanoni
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "LastLiveOutPeeler.hpp"
using namespace llvm;
/*
* Restricted to loops where:
* The only loop exit is from the loop entry block
* The loop (and all sub-loops?) are governed by an IV
*/
/*
TODO:
Clone every basic block in the loop
Exit from the original loop entry to the cloned loop entry
If no loop body iteration ever executed, then route to the loop exit
Otherwise, route to the cloned loop body
The cloned latches route to a 2nd cloned entry that unconditionally branches to the loop exit
Clone IV sccs, branches/conditions on IVs in dependent SCCs, last live out SCCs with computation and their dependent SCCs
Step loop governing IV back one iteration
Wire instructions together as follows:
Any instructions from original loop governing IV to cloned, stepped-back IV
Any instructions from other IVs to cloned IVs
Any instructions from original loop entry to trailing/latch PHI pairs
A trailing PHI at the loop entry consumes the PHI's previous iteration value at each latch
Any instructions from original loop body to PHIs on the cloned loop body values
The cloned body values only need PHIs since they do not dominate the last iteration's execution
*/
#include "LastLiveOutPeeler.hpp"
using namespace llvm;
using namespace llvm::noelle;
LastLiveOutPeeler::LastLiveOutPeeler (LoopDependenceInfo const &LDI, Noelle &noelle)
: LDI{LDI}, noelle{noelle} {
}
// bool LastLiveOutPeeler::peelLastLiveOutComputation () {
// /*
// * Ensure the loop entry is the only block to exit the loop
// */
// auto loopStructure = LDI.getLoopStructure();
// auto loopHeader = loopStructure->getHeader();
// auto exitBlocks = loopStructure->getLoopExitBasicBlocks();
// if (exitBlocks.size() != 1) return false;
// auto singleExitBlock = exitBlocks[0];
// bool onlyExitsFromHeader = true;
// bool exitsFromHeader = false;
// for (auto exitPred : predecessors(singleExitBlock)) {
// exitsFromHeader |= exitPred == loopHeader;
// onlyExitsFromHeader = !loopStructure->isIncluded(exitPred) || exitPred == loopHeader;
// }
// if (!exitsFromHeader || !onlyExitsFromHeader) return false;
// /*
// * Ensure the loop is governed by an IV
// */
// auto loopGoverningIVAttribution = LDI.getLoopGoverningIVAttribution();
// if (!loopGoverningIVAttribution) return false;
// /*
// * Determine if there is any live out computation that can be peeled
// */
// fetchSCCsOfLastLiveOuts();
// if (this->sccsOfLastLiveOuts.size() == 0) return false;
// /*
// * Ensure that the control flow of the loop is governed by IVs and fully understood
// */
// auto controlFlowGovernedByIVs = fetchNormalizedSCCsGoverningControlFlowOfLoop();
// if (!controlFlowGovernedByIVs) return false;
// /*
// * Identify induction variable SCCs in all sub-loops
// */
// auto ivManager = LDI.getInductionVariableManager();
// std::unordered_set<InductionVariable *> allIVsInLoop{};
// auto loops = loopStructure->getDescendants();
// for (auto loop : loops) {
// auto ivs = ivManager->getInductionVariables(*loop);
// allIVsInLoop.insert(ivs.begin(), ivs.end());
// }
// auto loopGoverningIV = loopGoverningIVAttribution->getInductionVariable();
// // TODO: Clone this later:
// loopGoverningIV.getComputationOfStepValue();
// // TODO: Everything
// return true;
// }
// bool LastLiveOutPeeler::fetchNormalizedSCCsGoverningControlFlowOfLoop (void) {
// auto loopStructure = LDI.getLoopStructure();
// auto normalizedSCCDAG = LDI.sccdagAttrs.getSCCDAG();
// auto ivManager = LDI.getInductionVariableManager();
// for (auto loopBlock : loopStructure->getBasicBlocks()) {
// auto terminator = loopBlock->getTerminator();
// assert(terminator != nullptr
// && "LastLiveOutPeeler: Loop is not well formed, having an un-terminated basic block");
// /*
// * Currently, we only support un-conditional or conditional branches w/conditions that are
// * loop invariants OR instructions using IVs and loop invariants only
// */
// if (!isa<BranchInst>(terminator)) return false;
// auto brInst = cast<BranchInst>(terminator);
// if (brInst->isUnconditional()) continue;
// auto sccOfTerminator = normalizedSCCDAG->sccOfValue(terminator);
// auto sccInfoOfTerminator = LDI.sccdagAttrs.getSCCAttrs(sccOfTerminator);
// if (sccInfoOfTerminator->isInductionVariableSCC()) {
// normalizedSCCsOfGoverningIVs.insert(sccOfTerminator);
// continue;
// }
// /*
// * The condition must be loop invariant or an instruction using IVs and loop invariants only
// */
// auto condition = brInst->getCondition();
// if (!isa<Instruction>(condition)) {
// if (!loopStructure->isLoopInvariant(condition)) return false;
// continue;
// }
// auto conditionInst = cast<Instruction>(condition);
// auto sccOfCondition = normalizedSCCDAG->sccOfValue(condition);
// normalizedSCCsOfConditionsAndBranchesDependentOnIVSCCs.insert(sccOfTerminator);
// normalizedSCCsOfConditionsAndBranchesDependentOnIVSCCs.insert(sccOfCondition);
// for (auto &op : conditionInst->operands()) {
// auto value = op.get();
// if (loopStructure->isLoopInvariant(value)) continue;
// if (!isa<Instruction>(value)) return false;
// auto inst = cast<Instruction>(value);
// auto loopOfValue = LDI.getNestedMostLoopStructure(inst);
// auto ivOfValue = ivManager->getInductionVariable(*loopOfValue, inst);
// if (ivOfValue) continue;
// return false;
// }
// }
// return true;
// }
// /*
// * We are interested in any last live outs with meaningful computation contained in the chain (excludes PHIs, casts)
// */
// void LastLiveOutPeeler::fetchSCCsOfLastLiveOuts (void) {
// auto loopStructure = LDI.getLoopStructure();
// auto loopHeader = loopStructure->getHeader();
// auto loopSCCDAG = LDI.getLoopSCCDAG();
// auto normalizedSCCDAG = LDI.sccdagAttrs.getSCCDAG();
// auto loopCarriedDependencies = LDI.getLoopCarriedDependencies();
// auto outermostLoopCarriedDependencies = loopCarriedDependencies->getLoopCarriedDependenciesForLoop(*loopStructure);
// std::unordered_set<Value *> loopCarriedConsumers{};
// for (auto dependency : outermostLoopCarriedDependencies) {
// auto consumer = dependency->getIncomingT();
// this->loopCarriedConsumers.insert(consumer);
// }
// /*
// * Last live outs can only result in leaf nodes
// * Their computation CAN span a chain of SCCs though, all of which must only produce last live out loop carried dependencies
// *
// * To be sure the parent SCCs/instructions up that chain we collect ONLY contain last live outs,
// * we use the strict SCCDAG, not the normalized SCCDAG
// */
// for (auto leafSCCNode : loopSCCDAG->getLeafNodes()) {
// auto leafSCC = leafSCCNode->getT();
// /*
// * The leaf SCC must be a single loop carried PHI
// */
// if (leafSCC->numInternalNodes() > 1) continue;
// auto singleValue = leafSCC->internalNodePairs().begin()->first;
// if (!isa<PHINode>(singleValue)) continue;
// auto singlePHI = cast<PHINode>(singleValue);
// if (singlePHI->getParent() != loopHeader) continue;
// auto chainOfSCCs = fetchChainOfSCCsForLastLiveOutLeafSCC(leafSCCNode);
// this->sccsOfLastLiveOuts.insert(chainOfSCCs.begin(), chainOfSCCs.end());
// }
// return;
// }
// std::unordered_set<SCC *> LastLiveOutPeeler::fetchChainOfSCCsForLastLiveOutLeafSCC (DGNode<SCC> *sccNode) {
// /*
// * Traverse up the graph, collecting as many SCC nodes that ONLY contribute loop carried
// * dependencies to last live out values. Keep track if any of those SCCs contain meaningful computation
// */
// bool hasMeaningfulComputation = false;
// std::unordered_set<SCC *> computationOfLastLiveOut{};
// std::queue<DGNode<SCC> *> queueOfLastLiveOutComputation{};
// queueOfLastLiveOutComputation.push(sccNode);
// /*
// * For the sake of efficiency, even if the SCCDAG is acyclic, don't re-process SCCs
// */
// std::unordered_set<DGNode<SCC> *> visited{};
// visited.insert(sccNode);
// while (!queueOfLastLiveOutComputation.empty()) {
// auto sccNode = queueOfLastLiveOutComputation.front();
// queueOfLastLiveOutComputation.pop();
// auto scc = sccNode->getT();
// bool isLoopCarried = false;
// bool hasComputation = false;
// for (auto nodePair : scc->internalNodePairs()) {
// auto value = nodePair.first;
// if (!isa<Instruction>(value)) continue;
// auto inst = cast<Instruction>(value);
// if (!isa<PHINode>(inst) && !isa<CastInst>(inst)) {
// hasComputation = true;
// }
// if (loopCarriedConsumers.find(inst) != loopCarriedConsumers.end()) {
// isLoopCarried = true;
// break;
// }
// }
// /*
// * Do not include SCCs with loop carried values
// */
// if (isLoopCarried) continue;
// hasMeaningfulComputation |= hasComputation;
// computationOfLastLiveOut.insert(scc);
// for (auto edge : sccNode->getIncomingEdges()) {
// auto producerSCCNode = edge->getOutgoingNode();
// if (visited.find(producerSCCNode) != visited.end()) continue;
// queueOfLastLiveOutComputation.push(producerSCCNode);
// visited.insert(producerSCCNode);
// }
// }
// /*
// * Only return a non-empty set if those SCCs are worth peeling
// */
// if (!hasMeaningfulComputation) computationOfLastLiveOut.clear();
// return computationOfLastLiveOut;
// }
| 40.141791
| 435
| 0.697249
|
SusanTan
|
bf4697f76aafea71af2955d6209b0bb7054cddfb
| 5,690
|
cpp
|
C++
|
webkit/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
|
s1rcheese/nintendo-3ds-internetbrowser-sourcecode
|
3dd05f035e0a5fc9723300623e9b9b359be64e11
|
[
"Unlicense"
] | 15
|
2016-01-05T12:43:41.000Z
|
2022-03-15T10:34:47.000Z
|
webkit/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
|
s1rcheese/nintendo-3ds-internetbrowser-sourcecode
|
3dd05f035e0a5fc9723300623e9b9b359be64e11
|
[
"Unlicense"
] | null | null | null |
webkit/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
|
s1rcheese/nintendo-3ds-internetbrowser-sourcecode
|
3dd05f035e0a5fc9723300623e9b9b359be64e11
|
[
"Unlicense"
] | 2
|
2020-11-30T18:36:01.000Z
|
2021-02-05T23:20:24.000Z
|
/*
* Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "FontPlatformData.h"
#include "HarfbuzzSkia.h"
#include "NotImplemented.h"
#include "PlatformString.h"
#include "StringImpl.h"
#include "SkPaint.h"
#include "SkTypeface.h"
namespace WebCore {
static SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting;
static bool isSkiaAntiAlias = true, isSkiaSubpixelGlyphs;
void FontPlatformData::setHinting(SkPaint::Hinting hinting)
{
skiaHinting = hinting;
}
void FontPlatformData::setAntiAlias(bool isAntiAlias)
{
isSkiaAntiAlias = isAntiAlias;
}
void FontPlatformData::setSubpixelGlyphs(bool isSubpixelGlyphs)
{
isSkiaSubpixelGlyphs = isSubpixelGlyphs;
}
FontPlatformData::RefCountedHarfbuzzFace::~RefCountedHarfbuzzFace()
{
HB_FreeFace(m_harfbuzzFace);
}
FontPlatformData::FontPlatformData(const FontPlatformData& src)
: m_typeface(src.m_typeface)
, m_textSize(src.m_textSize)
, m_fakeBold(src.m_fakeBold)
, m_fakeItalic(src.m_fakeItalic)
, m_harfbuzzFace(src.m_harfbuzzFace)
{
m_typeface->safeRef();
}
FontPlatformData::FontPlatformData(SkTypeface* tf, float textSize, bool fakeBold, bool fakeItalic)
: m_typeface(tf)
, m_textSize(textSize)
, m_fakeBold(fakeBold)
, m_fakeItalic(fakeItalic)
{
m_typeface->safeRef();
}
FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize)
: m_typeface(src.m_typeface)
, m_textSize(textSize)
, m_fakeBold(src.m_fakeBold)
, m_fakeItalic(src.m_fakeItalic)
, m_harfbuzzFace(src.m_harfbuzzFace)
{
m_typeface->safeRef();
}
FontPlatformData::~FontPlatformData()
{
m_typeface->safeUnref();
}
FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src)
{
SkRefCnt_SafeAssign(m_typeface, src.m_typeface);
m_textSize = src.m_textSize;
m_fakeBold = src.m_fakeBold;
m_fakeItalic = src.m_fakeItalic;
m_harfbuzzFace = src.m_harfbuzzFace;
return *this;
}
#ifndef NDEBUG
String FontPlatformData::description() const
{
return String();
}
#endif
void FontPlatformData::setupPaint(SkPaint* paint) const
{
const float ts = m_textSize > 0 ? m_textSize : 12;
paint->setAntiAlias(isSkiaAntiAlias);
paint->setHinting(skiaHinting);
paint->setLCDRenderText(isSkiaSubpixelGlyphs);
paint->setTextSize(SkFloatToScalar(ts));
paint->setTypeface(m_typeface);
paint->setFakeBoldText(m_fakeBold);
paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
}
SkFontID FontPlatformData::uniqueID() const
{
return m_typeface->uniqueID();
}
bool FontPlatformData::operator==(const FontPlatformData& a) const
{
// If either of the typeface pointers are invalid (either NULL or the
// special deleted value) then we test for pointer equality. Otherwise, we
// call SkTypeface::Equal on the valid pointers.
bool typefacesEqual;
if (m_typeface == hashTableDeletedFontValue()
|| a.m_typeface == hashTableDeletedFontValue()
|| !m_typeface
|| !a.m_typeface)
typefacesEqual = m_typeface == a.m_typeface;
else
typefacesEqual = SkTypeface::Equal(m_typeface, a.m_typeface);
return typefacesEqual
&& m_textSize == a.m_textSize
&& m_fakeBold == a.m_fakeBold
&& m_fakeItalic == a.m_fakeItalic;
}
unsigned FontPlatformData::hash() const
{
unsigned h = SkTypeface::UniqueID(m_typeface);
h ^= 0x01010101 * ((static_cast<int>(m_fakeBold) << 1) | static_cast<int>(m_fakeItalic));
// This memcpy is to avoid a reinterpret_cast that breaks strict-aliasing
// rules. Memcpy is generally optimized enough so that performance doesn't
// matter here.
uint32_t textSizeBytes;
memcpy(&textSizeBytes, &m_textSize, sizeof(uint32_t));
h ^= textSizeBytes;
return h;
}
bool FontPlatformData::isFixedPitch() const
{
notImplemented();
return false;
}
HB_FaceRec_* FontPlatformData::harfbuzzFace() const
{
if (!m_harfbuzzFace)
m_harfbuzzFace = RefCountedHarfbuzzFace::create(HB_NewFace(const_cast<FontPlatformData*>(this), harfbuzzSkiaGetTable));
return m_harfbuzzFace->face();
}
} // namespace WebCore
| 30.265957
| 127
| 0.735852
|
s1rcheese
|
bf4c0c6e8831f0dabcb22e015a74ad33e893483d
| 1,076
|
hh
|
C++
|
pathtracer/src/datastruct/box/BoundingBox.hh
|
bjorn-grape/bidirectional-pathtracer
|
6fbbf5fc6cee39f595533494d779726658d646e1
|
[
"MIT"
] | null | null | null |
pathtracer/src/datastruct/box/BoundingBox.hh
|
bjorn-grape/bidirectional-pathtracer
|
6fbbf5fc6cee39f595533494d779726658d646e1
|
[
"MIT"
] | null | null | null |
pathtracer/src/datastruct/box/BoundingBox.hh
|
bjorn-grape/bidirectional-pathtracer
|
6fbbf5fc6cee39f595533494d779726658d646e1
|
[
"MIT"
] | null | null | null |
#pragma once
#include "Vector3D.hh"
#include "SplitAxis.hh"
#include "Ray.hh"
class BoundingBox {
public:
BoundingBox(const Vector3D<float> &mini, const Vector3D<float> &maxi);
BoundingBox();
inline SplitAxis::Axis GetLargestDimension() const;
inline SplitAxis::Axis GetSmallestDimension() const;
inline Vector3D<float> GetDimensions() const;
bool DoIntersect(Ray r);
bool FasterDoIntersect(Ray r);
inline void readVector3DinMin(const Vector3D<float> &vector3D);
inline void readVector3DinMax(const Vector3D<float> &vector3D);
inline float getMinX() const;
inline float getMinY() const;
inline float getMinZ() const;
inline float getMaxX() const;
inline float getMaxY() const;
inline float getMaxZ() const;
inline void setExtremumFromPolygonList(const std::vector<Polygon> &polygons);
inline float* operator[](const int& i);
private:
float min[3] = {0.f, 0.f, 0.f};
float max[3] = {0.f, 0.f, 0.f};
static const Vector3D<float> toleranceBoundaries;
};
#include "BoundingBox.hxx"
| 22.893617
| 81
| 0.697955
|
bjorn-grape
|
bf5034669064e87d1da109095bf6599898933a3a
| 28,832
|
cpp
|
C++
|
src/agile_grasp2/plot.cpp
|
pyni/agile_grasp2
|
bbe64572f08f5f8b78f9f361da3fd5d3032cdbdf
|
[
"BSD-2-Clause"
] | null | null | null |
src/agile_grasp2/plot.cpp
|
pyni/agile_grasp2
|
bbe64572f08f5f8b78f9f361da3fd5d3032cdbdf
|
[
"BSD-2-Clause"
] | null | null | null |
src/agile_grasp2/plot.cpp
|
pyni/agile_grasp2
|
bbe64572f08f5f8b78f9f361da3fd5d3032cdbdf
|
[
"BSD-2-Clause"
] | 1
|
2021-06-24T01:33:05.000Z
|
2021-06-24T01:33:05.000Z
|
#include <agile_grasp2/plot.h>
void Plot::plotFingers(const std::vector<GraspHypothesis>& hand_list, const PointCloudRGBA::Ptr& cloud,
std::string str, double outer_diameter)
{
const int WIDTH = pcl::visualization::PCL_VISUALIZER_LINE_WIDTH;
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = createViewer(str);
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGBA> rgb(cloud);
viewer->addPointCloud<pcl::PointXYZRGBA>(cloud, rgb, "cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud");
//~ PointCloudRGBA::Ptr cloud_fingers(new PointCloudRGBA);
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_fingers(new pcl::PointCloud<pcl::PointXYZ>);
for (int i = 0; i < hand_list.size(); i++)
{
//~ pcl::PointXYZRGBA pc;
pcl::PointXYZ pc;
pc.getVector3fMap() = hand_list[i].getGraspBottom().cast<float>();
// double width = hand_list[i].getGraspWidth();
double width = outer_diameter;
double hw = 0.5 * width;
double step = hw / 30.0;
Eigen::Vector3d left_bottom = hand_list[i].getGraspBottom() + hw * hand_list[i].getBinormal();
Eigen::Vector3d right_bottom = hand_list[i].getGraspBottom() - hw * hand_list[i].getBinormal();
//~ pcl::PointXYZRGBA p1, p2;
pcl::PointXYZ p1, p2;
p1.getVector3fMap() = left_bottom.cast<float>();
p2.getVector3fMap() = right_bottom.cast<float>();
cloud_fingers->points.push_back(pc);
cloud_fingers->points.push_back(p1);
cloud_fingers->points.push_back(p2);
for (double j=step; j < hw; j+=step)
{
Eigen::Vector3d lb, rb, a;
lb = hand_list[i].getGraspBottom() + j * hand_list[i].getBinormal();
rb = hand_list[i].getGraspBottom() - j * hand_list[i].getBinormal();
a = hand_list[i].getGraspBottom() - j * hand_list[i].getApproach();
//~ pcl::PointXYZRGBA plb, prb, pa;
pcl::PointXYZ plb, prb, pa;
plb.getVector3fMap() = lb.cast<float>();
prb.getVector3fMap() = rb.cast<float>();
pa.getVector3fMap() = a.cast<float>();
cloud_fingers->points.push_back(plb);
cloud_fingers->points.push_back(prb);
cloud_fingers->points.push_back(pa);
}
double dist = (hand_list[i].getGraspTop() - hand_list[i].getGraspBottom()).norm();
step = dist / 40.0;
for (double j=step; j < dist; j+=step)
{
Eigen::Vector3d lt, rt;
lt = left_bottom + j * hand_list[i].getApproach();
rt = right_bottom + j * hand_list[i].getApproach();
//~ pcl::PointXYZRGBA plt, prt;
pcl::PointXYZ plt, prt;
plt.getVector3fMap() = lt.cast<float>();
prt.getVector3fMap() = rt.cast<float>();
cloud_fingers->points.push_back(plt);
cloud_fingers->points.push_back(prt);
}
//~ std::string istr = boost::lexical_cast<std::string>(i);
//~ viewer->addLine<pcl::PointXYZ>(center, left_bottom, 0.0, 0.0, 1.0, "left_bottom_" + istr);
//~ viewer->addLine<pcl::PointXYZ>(center, right_bottom, 0.0, 0.0, 1.0, "right_bottom_" + istr);
//~ viewer->addLine<pcl::PointXYZ>(left_bottom, left_top, 0.0, 0.0, 1.0, "left_top_" + istr);
//~ viewer->addLine<pcl::PointXYZ>(right_bottom, right_top, 0.0, 0.0, 1.0, "right_top_" + istr);
//~ viewer->addLine<pcl::PointXYZ>(center, approach_center, 0.0, 0.0, 1.0, "approach_" + istr);
//~
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "left_bottom_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "right_bottom_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "left_top_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "right_top_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "approach_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_REPRESENTATION,
//~ pcl::visualization::PCL_VISUALIZER_REPRESENTATION_WIREFRAME, "approach_" + boost::lexical_cast<std::string>(i));
}
viewer->addPointCloud<pcl::PointXYZ>(cloud_fingers, "fingers");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 0.0, 0.8, "fingers");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "fingers");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_OPACITY, 0.4, "fingers");
runViewer(viewer);
}
void Plot::plotFingers(const std::vector<Handle>& hand_list, const PointCloudRGBA::Ptr& cloud,
std::string str, double outer_diameter)
{
const int WIDTH = pcl::visualization::PCL_VISUALIZER_LINE_WIDTH;
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = createViewer(str);
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGBA> rgb(cloud);
viewer->addPointCloud<pcl::PointXYZRGBA>(cloud, rgb, "cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud");
//~ PointCloudRGBA::Ptr cloud_fingers(new PointCloudRGBA);
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_fingers(new pcl::PointCloud<pcl::PointXYZ>);
for (int i = 0; i < hand_list.size(); i++)
{
//~ pcl::PointXYZRGBA pc;
pcl::PointXYZ pc;
pc.getVector3fMap() = hand_list[i].getGraspBottom().cast<float>();
// double width = hand_list[i].getGraspWidth();
double width = outer_diameter;
double hw = 0.5 * width;
double step = hw / 30.0;
Eigen::Vector3d left_bottom = hand_list[i].getGraspBottom() + hw * hand_list[i].getBinormal();
Eigen::Vector3d right_bottom = hand_list[i].getGraspBottom() - hw * hand_list[i].getBinormal();
//~ pcl::PointXYZRGBA p1, p2;
pcl::PointXYZ p1, p2;
p1.getVector3fMap() = left_bottom.cast<float>();
p2.getVector3fMap() = right_bottom.cast<float>();
cloud_fingers->points.push_back(pc);
cloud_fingers->points.push_back(p1);
cloud_fingers->points.push_back(p2);
for (double j=step; j < hw; j+=step)
{
Eigen::Vector3d lb, rb, a;
lb = hand_list[i].getGraspBottom() + j * hand_list[i].getBinormal();
rb = hand_list[i].getGraspBottom() - j * hand_list[i].getBinormal();
a = hand_list[i].getGraspBottom() - j * hand_list[i].getApproach();
//~ pcl::PointXYZRGBA plb, prb, pa;
pcl::PointXYZ plb, prb, pa;
plb.getVector3fMap() = lb.cast<float>();
prb.getVector3fMap() = rb.cast<float>();
pa.getVector3fMap() = a.cast<float>();
cloud_fingers->points.push_back(plb);
cloud_fingers->points.push_back(prb);
cloud_fingers->points.push_back(pa);
}
double dist = (hand_list[i].getGraspTop() - hand_list[i].getGraspBottom()).norm();
step = dist / 40.0;
for (double j=step; j < dist; j+=step)
{
Eigen::Vector3d lt, rt;
lt = left_bottom + j * hand_list[i].getApproach();
rt = right_bottom + j * hand_list[i].getApproach();
//~ pcl::PointXYZRGBA plt, prt;
pcl::PointXYZ plt, prt;
plt.getVector3fMap() = lt.cast<float>();
prt.getVector3fMap() = rt.cast<float>();
cloud_fingers->points.push_back(plt);
cloud_fingers->points.push_back(prt);
}
//~ std::string istr = boost::lexical_cast<std::string>(i);
//~ viewer->addLine<pcl::PointXYZ>(center, left_bottom, 0.0, 0.0, 1.0, "left_bottom_" + istr);
//~ viewer->addLine<pcl::PointXYZ>(center, right_bottom, 0.0, 0.0, 1.0, "right_bottom_" + istr);
//~ viewer->addLine<pcl::PointXYZ>(left_bottom, left_top, 0.0, 0.0, 1.0, "left_top_" + istr);
//~ viewer->addLine<pcl::PointXYZ>(right_bottom, right_top, 0.0, 0.0, 1.0, "right_top_" + istr);
//~ viewer->addLine<pcl::PointXYZ>(center, approach_center, 0.0, 0.0, 1.0, "approach_" + istr);
//~
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "left_bottom_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "right_bottom_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "left_top_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "right_top_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(WIDTH, 5, "approach_" + boost::lexical_cast<std::string>(i));
//~ viewer->setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_REPRESENTATION,
//~ pcl::visualization::PCL_VISUALIZER_REPRESENTATION_WIREFRAME, "approach_" + boost::lexical_cast<std::string>(i));
}
viewer->addPointCloud<pcl::PointXYZ>(cloud_fingers, "fingers");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 0.0, 0.8, "fingers");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 5, "fingers");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_OPACITY, 0.4, "fingers");
runViewer(viewer);
}
void Plot::plotHands(const std::vector<GraspHypothesis>& hand_list,
const std::vector<GraspHypothesis>& antipodal_hand_list, const PointCloudRGBA::Ptr& cloud, std::string str,
bool use_grasp_bottom)
{
PointCloudNormal::Ptr hands_cloud = createNormalsCloud(hand_list, false, false);
PointCloudNormal::Ptr antipodal_hands_cloud = createNormalsCloud(antipodal_hand_list, true,
false);
plotHandsHelper(hands_cloud, antipodal_hands_cloud, cloud, str, use_grasp_bottom);
}
void Plot::plotHands(const std::vector<GraspHypothesis>& hand_list, const PointCloudRGBA::Ptr& cloud,
std::string str, bool use_grasp_bottom)
{
PointCloudNormal::Ptr hands_cloud = createNormalsCloud(hand_list, false, false);
PointCloudNormal::Ptr antipodal_hands_cloud = createNormalsCloud(hand_list, true, false);
plotHandsHelper(hands_cloud, antipodal_hands_cloud, cloud, str, use_grasp_bottom);
}
void Plot::plotSamples(const std::vector<int>& index_list, const PointCloudRGBA::Ptr& cloud)
{
PointCloudRGBA::Ptr samples_cloud(new PointCloudRGBA);
for (int i = 0; i < index_list.size(); i++)
samples_cloud->points.push_back(cloud->points[index_list[i]]);
plotSamples(samples_cloud, cloud);
}
void Plot::plotSamples(const Eigen::Matrix3Xd& samples, const PointCloudRGBA::Ptr& cloud)
{
PointCloudRGBA::Ptr samples_cloud(new PointCloudRGBA);
for (int i = 0; i < samples.cols(); i++)
{
pcl::PointXYZRGBA p;
p.x = samples.col(i)(0);
p.y = samples.col(i)(1);
p.z = samples.col(i)(2);
samples_cloud->points.push_back(p);
}
plotSamples(samples_cloud, cloud);
}
void Plot::plotSamples(const PointCloudRGBA::Ptr& samples_cloud, const PointCloudRGBA::Ptr& cloud)
{
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = createViewer("Samples");
// draw the point cloud
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGBA> rgb(cloud);
viewer->addPointCloud<pcl::PointXYZRGBA>(cloud, rgb, "registered point cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "registered point cloud");
// draw the samples
viewer->addPointCloud<pcl::PointXYZRGBA>(samples_cloud, "samples cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 4, "samples cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 1.0, "samples cloud");
runViewer(viewer);
}
void Plot::plotNormals(const PointCloudRGBA::Ptr& cloud, const Eigen::Matrix3Xd& normals)
{
PointCloudNormal::Ptr normals_cloud(new PointCloudNormal);
for (int i=0; i < normals.cols(); i++)
{
pcl::PointNormal p;
p.x = cloud->points[i].x;
p.y = cloud->points[i].y;
p.z = cloud->points[i].z;
p.normal_x = normals(0,i);
p.normal_y = normals(1,i);
p.normal_z = normals(2,i);
normals_cloud->points.push_back(p);
}
std::cout << "Drawing " << normals_cloud->size() << " normals\n";
double red[3] = {1.0, 0.0, 0.0};
double blue[3] = {0.0, 0.0, 1.0};
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = createViewer("Normals");
addCloudNormalsToViewer(viewer, normals_cloud, 2, blue, red, std::string("cloud"), std::string("normals"));
runViewer(viewer);
}
void Plot::plotLocalAxes(const std::vector<LocalFrame>& quadric_list, const PointCloudRGBA::Ptr& cloud)
{
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = createViewer("Local Axes");
viewer->addPointCloud<pcl::PointXYZRGBA>(cloud, "registered point cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1,
"registered point cloud");
for (int i = 0; i < quadric_list.size(); i++)
quadric_list[i].plotAxes((void*) &viewer, i);
runViewer(viewer);
}
void Plot::plotCameraSource(const Eigen::VectorXi& pts_cam_source_in, const PointCloudRGBA::Ptr& cloud)
{
PointCloudRGBA::Ptr left_cloud(new PointCloudRGBA);
PointCloudRGBA::Ptr right_cloud(new PointCloudRGBA);
for (int i = 0; i < pts_cam_source_in.size(); i++)
{
if (pts_cam_source_in(i) == 0)
left_cloud->points.push_back(cloud->points[i]);
else if (pts_cam_source_in(i) == 1)
right_cloud->points.push_back(cloud->points[i]);
}
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = createViewer("Camera Sources");
viewer->addPointCloud<pcl::PointXYZRGBA>(left_cloud, "left point cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1,
"left point cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0,
"left point cloud");
viewer->addPointCloud<pcl::PointXYZRGBA>(right_cloud, "right point cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1,
"right point cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 1.0, 0.0,
"right point cloud");
runViewer(viewer);
}
PointCloudNormal::Ptr Plot::createNormalsCloud(const std::vector<GraspHypothesis>& hand_list,
bool plots_only_antipodal, bool plots_grasp_bottom)
{
PointCloudNormal::Ptr cloud(new PointCloudNormal);
for (int i = 0; i < hand_list.size(); i++)
{
Eigen::Matrix3Xd grasp_surface = hand_list[i].getGraspSurface();
Eigen::Matrix3Xd grasp_bottom = hand_list[i].getGraspBottom();
Eigen::Matrix3Xd hand_approach = hand_list[i].getApproach();
if (!plots_only_antipodal || (plots_only_antipodal && hand_list[i].isFullAntipodal()))
{
pcl::PointNormal p;
if (!plots_grasp_bottom)
{
p.x = grasp_surface(0);
p.y = grasp_surface(1);
p.z = grasp_surface(2);
}
else
{
p.x = grasp_bottom(0);
p.y = grasp_bottom(1);
p.z = grasp_bottom(2);
}
p.normal[0] = -hand_approach(0);
p.normal[1] = -hand_approach(1);
p.normal[2] = -hand_approach(2);
cloud->points.push_back(p);
}
}
return cloud;
}
void Plot::addCloudNormalsToViewer(boost::shared_ptr<pcl::visualization::PCLVisualizer>& viewer,
const PointCloudNormal::Ptr& cloud, double line_width, double* color_cloud,
double* color_normals, const std::string& cloud_name, const std::string& normals_name)
{
viewer->addPointCloud<pcl::PointNormal>(cloud, cloud_name);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, color_cloud[0],
color_cloud[1], color_cloud[2], cloud_name);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 6,
cloud_name);
viewer->addPointCloudNormals<pcl::PointNormal>(cloud, 1, 0.01, normals_name);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, line_width,
normals_name);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, color_normals[0],
color_normals[1], color_normals[2], normals_name);
}
void Plot::plotHandsHelper(const PointCloudNormal::Ptr& hands_cloud,
const PointCloudNormal::Ptr& antipodal_hands_cloud, const PointCloudRGBA::Ptr& cloud,
std::string str, bool use_grasp_bottom)
{
std::cout << "Drawing " << hands_cloud->size() << " grasps of which " << antipodal_hands_cloud->size()
<< " are antipodal grasps.\n";
std::string title = "Hands: " + str;
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = createViewer(title);
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGBA> rgb(cloud);
viewer->addPointCloud<pcl::PointXYZRGBA>(cloud, rgb, "cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud");
double green[3] = { 0.0, 1.0, 0.0 };
double cyan[3] = { 0.0, 0.4, 0.8 };
addCloudNormalsToViewer(viewer, hands_cloud, 2, green, cyan, std::string("hands"), std::string("approaches"));
if (antipodal_hands_cloud->size() > 0)
{
double red[3] = { 1.0, 0.0, 0.0 };
addCloudNormalsToViewer(viewer, antipodal_hands_cloud, 2, green, red, std::string("antipodal_hands"),
std::string("antipodal_approaches"));
}
runViewer(viewer);
}
void Plot::runViewer(boost::shared_ptr<pcl::visualization::PCLVisualizer>& viewer)
{
while (!viewer->wasStopped())
{
viewer->spinOnce(100);
boost::this_thread::sleep(boost::posix_time::microseconds(100000));
}
viewer->close();
}
boost::shared_ptr<pcl::visualization::PCLVisualizer> Plot::createViewer(std::string title)
{
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer(new pcl::visualization::PCLVisualizer(title));
// viewer->initCameraParameters();
viewer->setPosition(0, 0);
viewer->setSize(640, 480);
viewer->setBackgroundColor(1.0, 1.0, 1.0);
pcl::visualization::Camera camera;
camera.clip[0] = 0.00130783;
camera.clip[1] = 1.30783;
camera.focal[0] = 0.776838;
camera.focal[1] = -0.095644;
camera.focal[2] = -0.18991;
camera.pos[0] = 0.439149;
camera.pos[1] = -0.10342;
camera.pos[2] = 0.111626;
camera.view[0] = 0.666149;
camera.view[1] = -0.0276846;
camera.view[2] = 0.745305;
camera.fovy = 0.8575;
camera.window_pos[0] = 0;
camera.window_pos[1] = 0;
camera.window_size[0] = 640;
camera.window_size[1] = 480;
viewer->setCameraParameters(camera);
// viewer->updateCamera();
// viewer->addCoordinateSystem(0.5, 0);
return viewer;
}
void Plot::createVisualPublishers(ros::NodeHandle& node, double marker_lifetime)
{
hypotheses_pub_ = node.advertise<visualization_msgs::MarkerArray>("grasp_hypotheses_visual", 10);
antipodal_pub_ = node.advertise<visualization_msgs::MarkerArray>("antipodal_grasps_visual", 10);
handles_pub_ = node.advertise<visualization_msgs::MarkerArray>("handles_visual", 10);
marker_lifetime_ = marker_lifetime;
}
void Plot::plotGraspsRviz(const std::vector<GraspHypothesis>& hand_list, const std::string& frame, bool is_antipodal)
{
double red[3] = {1, 0, 0};
double cyan[3] = {0, 1, 1};
double* color;
if (is_antipodal)
{
color = red;
std::cout << "Visualizing antipodal grasps in Rviz ...\n";
}
else
{
color = cyan;
std::cout << "Visualizing grasp hypotheses in Rviz ...\n";
}
visualization_msgs::MarkerArray marker_array;
marker_array.markers.resize(hand_list.size());
for (int i=0; i < hand_list.size(); i++)
{
geometry_msgs::Point position;
position.x = hand_list[i].getGraspSurface()(0);
position.y = hand_list[i].getGraspSurface()(1);
position.z = hand_list[i].getGraspSurface()(2);
visualization_msgs::Marker marker = createApproachMarker(frame, position, hand_list[i].getApproach(), i, color, 0.4,
0.004);
marker.ns = "grasp_hypotheses";
marker.id = i;
marker_array.markers[i] = marker;
}
if (is_antipodal)
antipodal_pub_.publish(marker_array);
else
hypotheses_pub_.publish(marker_array);
ros::Duration(1.0).sleep();
}
void Plot::plotHandlesRviz(const std::vector<Handle>& handle_list, const std::string& frame)
{
std::cout << "Visualizing handles in Rviz ...\n";
double green[3] = {0, 1, 0};
visualization_msgs::MarkerArray marker_array;
marker_array.markers.resize(handle_list.size());
for (int i=0; i < handle_list.size(); i++)
{
geometry_msgs::Point position;
position.x = handle_list[i].getGraspSurface()(0);
position.y = handle_list[i].getGraspSurface()(1);
position.z = handle_list[i].getGraspSurface()(2);
visualization_msgs::Marker marker = createApproachMarker(frame, position, handle_list[i].getApproach(), i, green, 0.6,
0.008);
marker.ns = "handles";
marker_array.markers[i] = marker;
}
handles_pub_.publish(marker_array);
ros::Duration(1.0).sleep();
}
void Plot::plotHandlesComplete(const std::vector<Handle>& handle_list, const PointCloudRGBA::Ptr& cloud, std::string str)
{
const int WIDTH = pcl::visualization::PCL_VISUALIZER_LINE_WIDTH;
const double OFFSET = 0.06;
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = createViewer(str);
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGBA> rgb(cloud);
viewer->addPointCloud<pcl::PointXYZRGBA>(cloud, rgb, "cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud");
for (int i = 0; i < handle_list.size(); i++)
{
std::cout << "axis.norm: " << handle_list[i].getAxis().norm() << ", approach.norm: "
<< handle_list[i].getApproach().norm() << ", binormal.norm: " << handle_list[i].getBinormal().norm() << std::endl;
std::cout << "axis*approach: " << handle_list[i].getAxis().transpose() * handle_list[i].getApproach()
<< ", axis*binormal: " << handle_list[i].getAxis().transpose() * handle_list[i].getBinormal()
<< ", binormal*approach: " << handle_list[i].getApproach().transpose() * handle_list[i].getBinormal() << "\n";
pcl::PointXYZ p, q, r, s;
p.getVector3fMap() = handle_list[i].getGraspSurface().cast<float>();
q.getVector3fMap() = (handle_list[i].getGraspSurface() + OFFSET*handle_list[i].getAxis()).cast<float>();
r.getVector3fMap() = (handle_list[i].getGraspSurface() + OFFSET*handle_list[i].getApproach()).cast<float>();
s.getVector3fMap() = (handle_list[i].getGraspSurface() + OFFSET*handle_list[i].getBinormal()).cast<float>();
std::string istr = boost::lexical_cast<std::string>(i);
viewer->addLine<pcl::PointXYZ> (p, q, 1.0, 0.0, 0.0, "axis_" + istr);
viewer->addLine<pcl::PointXYZ> (p, r, 0.0, 1.0, 0.0, "approach_" + istr);
viewer->addLine<pcl::PointXYZ> (p, s, 0.0, 0.0, 1.0, "binormal_" + istr);
viewer->setShapeRenderingProperties(WIDTH, 5, "axis_" + boost::lexical_cast<std::string>(i));
viewer->setShapeRenderingProperties(WIDTH, 5, "approach_" + boost::lexical_cast<std::string>(i));
viewer->setShapeRenderingProperties(WIDTH, 5, "binormal_" + boost::lexical_cast<std::string>(i));
}
runViewer(viewer);
}
void Plot::plotHandles(const std::vector<Handle>& handle_list, const PointCloudRGBA::Ptr& cloud, std::string str)
{
double colors[6][3] = { { 1.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }, { 0.0, 0.0, 1.0 },
{ 1.0, 1.0, 0.0 }, { 1.0, 0.0, 1.0 }, { 0.0, 1.0, 1.0 } };
// { 0, 0.4470, 0.7410 },
// { 0, 0.4470, 0.7410 }, { 0, 0.4470, 0.7410 }, { 0.8500, 0.3250, 0.0980 }, { 0.9290, 0.6940, 0.1250 },
// { 0.4940, 0.1840, 0.5560 }, { 0.4660, 0.6740, 0.1880 }, { 0.3010, 0.7450, 0.9330 }, { 0.6350, 0.0780, 0.1840 },
// { 0, 0.4470, 0.7410 }, { 0.8500, 0.3250, 0.0980 }, { 0.9290, 0.6940, 0.1250} };
// 0.4940 0.1840 0.5560
// 0.4660 0.6740 0.1880
// 0.3010 0.7450 0.9330
// 0.6350 0.0780 0.1840
// 0 0.4470 0.7410
// 0.8500 0.3250 0.0980
// 0.9290 0.6940 0.1250
// 0.4940 0.1840 0.5560
// 0.4660 0.6740 0.1880
// 0.3010 0.7450 0.9330
// 0.6350 0.0780 0.1840
std::vector<pcl::PointCloud<pcl::PointNormal>::Ptr> clouds;
pcl::PointCloud<pcl::PointNormal>::Ptr handle_cloud(new pcl::PointCloud<pcl::PointNormal>());
for (int i = 0; i < handle_list.size(); i++)
{
pcl::PointNormal p;
p.x = handle_list[i].getGraspSurface()(0);
p.y = handle_list[i].getGraspSurface()(1);
p.z = handle_list[i].getGraspSurface()(2);
p.normal[0] = -handle_list[i].getApproach()(0);
p.normal[1] = -handle_list[i].getApproach()(1);
p.normal[2] = -handle_list[i].getApproach()(2);
handle_cloud->points.push_back(p);
const std::vector<int>& inliers = handle_list[i].getInliers();
const std::vector<GraspHypothesis>& hand_list = handle_list[i].getHandList();
pcl::PointCloud<pcl::PointNormal>::Ptr axis_cloud(new pcl::PointCloud<pcl::PointNormal>);
for (int j = 0; j < inliers.size(); j++)
{
pcl::PointNormal p;
p.x = hand_list[inliers[j]].getGraspSurface()(0);
p.y = hand_list[inliers[j]].getGraspSurface()(1);
p.z = hand_list[inliers[j]].getGraspSurface()(2);
p.normal[0] = -hand_list[inliers[j]].getApproach()(0);
p.normal[1] = -hand_list[inliers[j]].getApproach()(1);
p.normal[2] = -hand_list[inliers[j]].getApproach()(2);
axis_cloud->points.push_back(p);
}
clouds.push_back(axis_cloud);
}
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer(new pcl::visualization::PCLVisualizer(str));
viewer->setBackgroundColor(1, 1, 1);
viewer->setPosition(0, 0);
viewer->setSize(640, 480);
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGBA> rgb(cloud);
viewer->addPointCloud<pcl::PointXYZRGBA>(cloud, rgb, "registered point cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1,
"registered point cloud");
// viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 1.0, 0.0,
// "registered point cloud");
for (int i = 0; i < clouds.size(); i++)
{
std::string name = "handle_" + boost::lexical_cast<std::string>(i);
int ci = i % 6;
viewer->addPointCloud<pcl::PointNormal>(clouds[i], name);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, colors[ci][0],
colors[ci][1], colors[ci][2], name);
std::string name2 = "approach_" + boost::lexical_cast<std::string>(i);
viewer->addPointCloudNormals<pcl::PointNormal>(clouds[i], 1, 0.04, name2);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 2, name2);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, colors[ci][0],
colors[ci][1], colors[ci][2], name2);
}
viewer->addPointCloud<pcl::PointNormal>(handle_cloud, "handles");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 0, 0, 0, "handles");
viewer->addPointCloudNormals<pcl::PointNormal>(handle_cloud, 1, 0.08, "approach");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 4, "approach");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 0, 0, 0, "approach");
// viewer->addCoordinateSystem(1.0, "", 0);
viewer->initCameraParameters();
viewer->setPosition(0, 0);
viewer->setSize(640, 480);
while (!viewer->wasStopped())
{
viewer->spinOnce(100);
boost::this_thread::sleep(boost::posix_time::microseconds(100000));
}
viewer->close();
}
void Plot::drawCloud(const PointCloudRGBA::Ptr& cloud_rgb, const std::string& title)
{
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = createViewer(title);
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGBA> rgb(cloud_rgb);
viewer->addPointCloud<pcl::PointXYZRGBA>(cloud_rgb, rgb, "registered point cloud");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "registered point cloud");
runViewer(viewer);
}
visualization_msgs::Marker Plot::createApproachMarker(const std::string& frame, const geometry_msgs::Point& center,
const Eigen::Vector3d& approach, int id, const double* color, double alpha, double diam)
{
visualization_msgs::Marker marker = createMarker(frame);
marker.type = visualization_msgs::Marker::ARROW;
marker.id = id;
marker.scale.x = diam; // shaft diameter
marker.scale.y = diam; // head diameter
marker.scale.z = 0.01; // head length
marker.color.r = color[0];
marker.color.g = color[1];
marker.color.b = color[2];
marker.color.a = alpha;
geometry_msgs::Point p, q;
p.x = center.x;
p.y = center.y;
p.z = center.z;
q.x = p.x - 0.03 * approach(0);
q.y = p.y - 0.03 * approach(1);
q.z = p.z - 0.03 * approach(2);
marker.points.push_back(p);
marker.points.push_back(q);
return marker;
}
visualization_msgs::Marker Plot::createMarker(const std::string& frame)
{
visualization_msgs::Marker marker;
marker.header.frame_id = frame;
marker.header.stamp = ros::Time::now();
marker.lifetime = ros::Duration(marker_lifetime_);
marker.action = visualization_msgs::Marker::ADD;
return marker;
}
| 41.30659
| 122
| 0.695581
|
pyni
|
bf53850616ef00ac2520e6faa9d5d6443781ea9e
| 1,464
|
hpp
|
C++
|
include/lattice_model_impl/update_dynamics/lattice_update_dynamics/lattice_update_formalisms/global_lattice_update.hpp
|
statphysandml/LatticeModelSimulationLib
|
37900336a35d81d28f3477c44da64e692212973a
|
[
"MIT"
] | null | null | null |
include/lattice_model_impl/update_dynamics/lattice_update_dynamics/lattice_update_formalisms/global_lattice_update.hpp
|
statphysandml/LatticeModelSimulationLib
|
37900336a35d81d28f3477c44da64e692212973a
|
[
"MIT"
] | 3
|
2021-02-24T16:34:35.000Z
|
2021-11-30T13:14:24.000Z
|
include/lattice_model_impl/update_dynamics/lattice_update_dynamics/lattice_update_formalisms/global_lattice_update.hpp
|
statphysandml/LatticeModelSimulationLib
|
37900336a35d81d28f3477c44da64e692212973a
|
[
"MIT"
] | null | null | null |
//
// Created by lukas on 06.08.20.
//
#ifndef LATTICEMODELIMPLEMENTATIONS_SIMPLE_UPDATE_HPP
#define LATTICEMODELIMPLEMENTATIONS_SIMPLE_UPDATE_HPP
#include "../../update_dynamics_base.hpp"
namespace lm_impl {
namespace update_dynamics {
struct GlobalLatticeUpdate;
struct GlobalLatticeUpdateParameters : UpdateDynamicsBaseParameters {
explicit GlobalLatticeUpdateParameters(const json params_) : UpdateDynamicsBaseParameters(params_) {}
explicit GlobalLatticeUpdateParameters() : GlobalLatticeUpdateParameters(json{}) {}
static std::string name() {
return "GlobalLatticeUpdate";
}
typedef GlobalLatticeUpdate UpdateDynamics; // LatticeUpdate;
};
struct GlobalLatticeUpdate : public UpdateDynamicsBase<GlobalLatticeUpdate> {
explicit GlobalLatticeUpdate(const GlobalLatticeUpdateParameters &lp_) : lp(lp_) {}
template<typename Lattice>
void initialize_update(const Lattice &lattice) {}
template<typename Lattice>
void update(Lattice &lattice, uint measure_interval = 1) {
for (uint k = 0; k < measure_interval; k++) {
global_lattice_update(lattice.get_update_formalism(), lattice);
}
}
const GlobalLatticeUpdateParameters &lp;
};
}
}
#endif //LATTICEMODELIMPLEMENTATIONS_SIMPLE_UPDATE_HPP
| 29.877551
| 113
| 0.664617
|
statphysandml
|
bf55043ca9bfdd1e54352dba0388a0742ceead73
| 3,168
|
hpp
|
C++
|
ngraph/core/reference/include/ngraph/runtime/reference/ctc_greedy_decoder_seq_len.hpp
|
tkrupa-intel/openvino
|
8c0ff5d9065486d23901a9c27debd303661f465f
|
[
"Apache-2.0"
] | 1
|
2021-05-30T18:25:07.000Z
|
2021-05-30T18:25:07.000Z
|
ngraph/core/reference/include/ngraph/runtime/reference/ctc_greedy_decoder_seq_len.hpp
|
tkrupa-intel/openvino
|
8c0ff5d9065486d23901a9c27debd303661f465f
|
[
"Apache-2.0"
] | null | null | null |
ngraph/core/reference/include/ngraph/runtime/reference/ctc_greedy_decoder_seq_len.hpp
|
tkrupa-intel/openvino
|
8c0ff5d9065486d23901a9c27debd303661f465f
|
[
"Apache-2.0"
] | null | null | null |
//*****************************************************************************
// Copyright 2017-2021 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#pragma once
#include <algorithm>
#include <limits>
#include <vector>
#include "ngraph/coordinate_transform.hpp"
namespace ngraph
{
namespace runtime
{
namespace reference
{
template <typename TF, typename TI, typename TCI, typename TSL>
void ctc_greedy_decoder_seq_len(const TF* data,
const TI* sequence_length,
const TI* blank_index,
TCI* out1,
TSL* out2,
const Shape& data_shape,
const Shape& out_shape,
const bool ctc_merge_repeated)
{
const auto batch_size = data_shape[0];
const auto seq_len_max = data_shape[1];
const auto class_count = data_shape[2];
std::fill_n(out1, shape_size(out_shape), -1);
for (std::size_t batch_ind = 0; batch_ind < batch_size; ++batch_ind)
{
TI previous_class_index = static_cast<TI>(-1);
auto out_index = batch_ind * seq_len_max;
auto seq_len = static_cast<std::size_t>(sequence_length[batch_ind]);
for (std::size_t seq_ind = 0; seq_ind < seq_len; seq_ind++)
{
auto data_index =
batch_ind * seq_len_max * class_count + seq_ind * class_count;
auto class_index = data + data_index;
auto class_max_element =
std::max_element(class_index, class_index + class_count);
const auto max_class_ind = std::distance(class_index, class_max_element);
if (max_class_ind < blank_index[0] &&
!(ctc_merge_repeated && previous_class_index == max_class_ind))
{
out1[out_index++] = max_class_ind;
}
previous_class_index = max_class_ind;
}
out2[batch_ind] = seq_len;
}
}
} // namespace reference
} // namespace runtime
} // namespace ngraph
| 45.257143
| 97
| 0.493687
|
tkrupa-intel
|
bf571a0b4858aef6b574178caf4800422f874682
| 765
|
cpp
|
C++
|
cpp/euler368.cpp
|
t-highfill/project-euler
|
f92ad1092f2529994e7b2d023180a60a5c8194ee
|
[
"MIT"
] | null | null | null |
cpp/euler368.cpp
|
t-highfill/project-euler
|
f92ad1092f2529994e7b2d023180a60a5c8194ee
|
[
"MIT"
] | null | null | null |
cpp/euler368.cpp
|
t-highfill/project-euler
|
f92ad1092f2529994e7b2d023180a60a5c8194ee
|
[
"MIT"
] | null | null | null |
#include <cstdint>
#include <iostream>
#include <map>
typedef uint32_t denom_t;
typedef std::map<denom_t, bool> known_map;
bool validate(denom_t d, known_map& known){
while(d >= 111){
// auto itr = known.find(d);
// if(itr != known.end())
// return itr->second;
if((d % 1000) % 111 == 0){
return false;
}
d /= 10;
}
return true;
}
int main(){
known_map *known = new known_map();
denom_t d = 1, max=-1;
double res = 0;
std::cout.precision(10);
std::cout.setf( std::ios::fixed, std:: ios::floatfield ); // floatfield set to fixed
std::cout << "Starting..." << std::endl;
while(d < max){
if(validate(res, *known)){
res += 1.0 / d;
std::cout << "res = " << res << "\td = " << d << '\r' << std::flush;
}
++d;
}
delete known;
}
| 20.675676
| 85
| 0.576471
|
t-highfill
|
bf5818f3dfc705cde77970b054c3324be7d2bdb5
| 6,340
|
cpp
|
C++
|
cell_based/src/simulation/RK4NumericalMethodTimestepper.cpp
|
ktunya/ChasteMod
|
88ac65b00473cd730d348c783bd74b2b39de5f69
|
[
"Apache-2.0"
] | null | null | null |
cell_based/src/simulation/RK4NumericalMethodTimestepper.cpp
|
ktunya/ChasteMod
|
88ac65b00473cd730d348c783bd74b2b39de5f69
|
[
"Apache-2.0"
] | null | null | null |
cell_based/src/simulation/RK4NumericalMethodTimestepper.cpp
|
ktunya/ChasteMod
|
88ac65b00473cd730d348c783bd74b2b39de5f69
|
[
"Apache-2.0"
] | null | null | null |
/*
Copyright (c) 2005-2015, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the University of Oxford nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "RK4NumericalMethodTimestepper.hpp"
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
RK4NumericalMethodTimestepper<ELEMENT_DIM,SPACE_DIM> :: RK4NumericalMethodTimestepper(
AbstractOffLatticeCellPopulation<ELEMENT_DIM,SPACE_DIM>& inputCellPopulation,
std::vector<boost::shared_ptr<AbstractForce<ELEMENT_DIM, SPACE_DIM> > >& inputForceCollection):
AbstractNumericalMethodTimestepper<ELEMENT_DIM,SPACE_DIM>( inputCellPopulation, inputForceCollection)
{
};
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
RK4NumericalMethodTimestepper<ELEMENT_DIM,SPACE_DIM>::~RK4NumericalMethodTimestepper(){
};
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void RK4NumericalMethodTimestepper<ELEMENT_DIM,SPACE_DIM>::UpdateAllNodePositions(double dt){
if(this->nonEulerSteppersEnabled){
std::vector<c_vector<double, SPACE_DIM> > K1 = this->ComputeAndSaveForces();
int index = 0;
for (typename AbstractMesh<ELEMENT_DIM, SPACE_DIM>::NodeIterator node_iter = this->rCellPopulation.rGetMesh().GetNodeIteratorBegin();
node_iter != this->rCellPopulation.rGetMesh().GetNodeIteratorEnd(); ++node_iter, ++index)
{
c_vector<double, SPACE_DIM> newLocation = node_iter->rGetLocation() + dt * K1[index]/2.0;
ChastePoint<SPACE_DIM> new_point(newLocation);
this->rCellPopulation.SetNode(node_iter->GetIndex(), new_point);
}
std::vector< c_vector<double, SPACE_DIM> > K2 = this->ComputeAndSaveForces();
index = 0;
for (typename AbstractMesh<ELEMENT_DIM, SPACE_DIM>::NodeIterator node_iter = this->rCellPopulation.rGetMesh().GetNodeIteratorBegin();
node_iter != this->rCellPopulation.rGetMesh().GetNodeIteratorEnd(); ++node_iter, ++index)
{
c_vector<double, SPACE_DIM> newLocation = node_iter->rGetLocation() + dt * (K2[index] - K1[index])/2.0; //revert, then update
ChastePoint<SPACE_DIM> new_point(newLocation);
this->rCellPopulation.SetNode(node_iter->GetIndex(), new_point);
}
std::vector< c_vector<double, SPACE_DIM> > K3 = this->ComputeAndSaveForces();
index = 0;
for (typename AbstractMesh<ELEMENT_DIM, SPACE_DIM>::NodeIterator node_iter = this->rCellPopulation.rGetMesh().GetNodeIteratorBegin();
node_iter != this->rCellPopulation.rGetMesh().GetNodeIteratorEnd(); ++node_iter, ++index)
{
double damping = this->rCellPopulation.GetDampingConstant(node_iter->GetIndex());
c_vector<double, SPACE_DIM> newLocation = node_iter->rGetLocation() + dt * (K3[index] - K2[index]/2.0); //revert, then update
ChastePoint<SPACE_DIM> new_point(newLocation);
this->rCellPopulation.SetNode(node_iter->GetIndex(), new_point);
}
std::vector< c_vector<double, SPACE_DIM> > K4 = this->ComputeAndSaveForces();
index = 0;
for (typename AbstractMesh<ELEMENT_DIM, SPACE_DIM>::NodeIterator node_iter = this->rCellPopulation.rGetMesh().GetNodeIteratorBegin();
node_iter != this->rCellPopulation.rGetMesh().GetNodeIteratorEnd(); ++node_iter, ++index)
{
c_vector<double, SPACE_DIM> effectiveForce = (K1[index] + 2*K2[index] + 2*K3[index] + K4[index] )/6.0;
c_vector<double, SPACE_DIM> oldLocation = node_iter->rGetLocation() - dt * K3[index];
c_vector<double, SPACE_DIM> displacement = dt * effectiveForce;
this->HandleStepSizeExceptions(&displacement, dt, node_iter->GetIndex());
c_vector<double, SPACE_DIM> newLocation = oldLocation + displacement;
ChastePoint<SPACE_DIM> new_point(newLocation);
this->rCellPopulation.SetNode(node_iter->GetIndex(), new_point);
//Ensure the nodes hold accurate forces, incase they're accessed by some other class
double damping = this->rCellPopulation.GetDampingConstant(node_iter->GetIndex());
node_iter->ClearAppliedForce();
c_vector<double, SPACE_DIM> force = effectiveForce*damping;
node_iter->AddAppliedForceContribution(force);
}
}else{
this->ComputeAndSaveForces();
this->rCellPopulation.UpdateNodeLocations(dt);
}
};
///////// Explicit instantiation
template class RK4NumericalMethodTimestepper<1,1>;
template class RK4NumericalMethodTimestepper<1,2>;
template class RK4NumericalMethodTimestepper<2,2>;
template class RK4NumericalMethodTimestepper<1,3>;
template class RK4NumericalMethodTimestepper<2,3>;
template class RK4NumericalMethodTimestepper<3,3>;
| 48.769231
| 145
| 0.728707
|
ktunya
|
bf5f4749627c0f3b5018ad6c17a7d8aea109c664
| 739
|
hpp
|
C++
|
include/RED4ext/Types/generated/quest/SetLootInteractionAccess_NodeType.hpp
|
Cyberpunk-Extended-Development-Team/RED4ext.SDK
|
2dc828c761d87a1b4235ce9ca4fbdf9fb4312fae
|
[
"MIT"
] | 1
|
2021-02-01T23:07:50.000Z
|
2021-02-01T23:07:50.000Z
|
include/RED4ext/Types/generated/quest/SetLootInteractionAccess_NodeType.hpp
|
Cyberpunk-Extended-Development-Team/RED4ext.SDK
|
2dc828c761d87a1b4235ce9ca4fbdf9fb4312fae
|
[
"MIT"
] | null | null | null |
include/RED4ext/Types/generated/quest/SetLootInteractionAccess_NodeType.hpp
|
Cyberpunk-Extended-Development-Team/RED4ext.SDK
|
2dc828c761d87a1b4235ce9ca4fbdf9fb4312fae
|
[
"MIT"
] | null | null | null |
#pragma once
// This file is generated from the Game's Reflection data
#include <cstdint>
#include <RED4ext/Common.hpp>
#include <RED4ext/REDhash.hpp>
#include <RED4ext/Types/generated/game/EntityReference.hpp>
#include <RED4ext/Types/generated/quest/IItemManagerNodeType.hpp>
namespace RED4ext
{
namespace quest {
struct SetLootInteractionAccess_NodeType : quest::IItemManagerNodeType
{
static constexpr const char* NAME = "questSetLootInteractionAccess_NodeType";
static constexpr const char* ALIAS = NAME;
game::EntityReference objectRef; // 30
bool accessible; // 68
uint8_t unk69[0x70 - 0x69]; // 69
};
RED4EXT_ASSERT_SIZE(SetLootInteractionAccess_NodeType, 0x70);
} // namespace quest
} // namespace RED4ext
| 28.423077
| 81
| 0.769959
|
Cyberpunk-Extended-Development-Team
|
bf62028f5ba64a4d5d5cdffa15d5147cc22e285d
| 585
|
cpp
|
C++
|
0041 First Missing Positive/solution.cpp
|
Aden-Tao/LeetCode
|
c34019520b5808c4251cb76f69ca2befa820401d
|
[
"MIT"
] | 1
|
2019-12-19T04:13:15.000Z
|
2019-12-19T04:13:15.000Z
|
0041 First Missing Positive/solution.cpp
|
Aden-Tao/LeetCode
|
c34019520b5808c4251cb76f69ca2befa820401d
|
[
"MIT"
] | null | null | null |
0041 First Missing Positive/solution.cpp
|
Aden-Tao/LeetCode
|
c34019520b5808c4251cb76f69ca2befa820401d
|
[
"MIT"
] | null | null | null |
#include <bits/stdc++.h>
class Solution {
public:
int firstMissingPositive(std::vector<int>& nums) {
int n = nums.size();
for (int i = 0; i < n; i ++)
{
while (nums[i] > 0 && nums[i] <= n && nums[nums[i] - 1] != nums[i])
std::swap(nums[i], nums[nums[i] - 1]);
}
for (int i = 0; i < n; i ++)
if (nums[i] != i + 1)
return i + 1;
return n + 1;
}
};
int main(){
Solution s;
std::vector<int> vec{3,4,-1,1};
assert(s.firstMissingPositive(vec) == 2);
return 0;
}
| 24.375
| 79
| 0.444444
|
Aden-Tao
|
bf67beeea3376a30354343c172eae1d467326b35
| 3,641
|
cpp
|
C++
|
graph/minCostMaxFlow_inet_chinese_dijkstra.cpp
|
fersarr/algo
|
a6ed2b53be8e748d9c0e488dc5fad075fa7cbb53
|
[
"MIT"
] | null | null | null |
graph/minCostMaxFlow_inet_chinese_dijkstra.cpp
|
fersarr/algo
|
a6ed2b53be8e748d9c0e488dc5fad075fa7cbb53
|
[
"MIT"
] | null | null | null |
graph/minCostMaxFlow_inet_chinese_dijkstra.cpp
|
fersarr/algo
|
a6ed2b53be8e748d9c0e488dc5fad075fa7cbb53
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <list>
#define MAX 1l << 62
//too slow, TLE (time limit exceeded)
using namespace std;
typedef pair<int,int> ii;
typedef pair<long long,long long> llll;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<llll> vllll;
typedef vector<long long> vll;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
int N,M;
long long D,K;
llll mm[105][105];
int parent[105];
long long minT = 0;
void augment(){
int nc = N-1;
vi S;
while(nc >= 0){
S.push_back(nc);
nc = parent[nc];
}
long long minEdge = MAX; //min residual capacity edge
reverse(S.begin(),S.end());
for(int i=1;i<S.size();i++){
int u = S[i-1], v = S[i];
minEdge = min(minEdge,mm[u][v].first);
}
if(D < minEdge)
minEdge = D;
D -= minEdge;//each time we have less data to flow through network
for(int i=1;i<S.size();i++){
int u = S[i-1], v = S[i];
mm[u][v].first -= minEdge; //flow
mm[v][u].first += minEdge;
minT += minEdge * mm[u][v].second; //flow * edgeCost = cost
// printf(" u,v = %d,%d, minEdge = %d, second = %d, minT = %ld\n",u,v,minEdge,mm[u][v].second, minT);
}
}
int cnt[105];
int main(){
while(cin >> N >> M){
minT = 0;
memset(mm,0,sizeof mm);
int a,b;
long long c;
for(int i=0;i<M;i++){
cin >> a >> b >> c;
a--;b--;
mm[a][b].second = c; //cost
mm[b][a].second = -c;
mm[a][b].first =-1; //flowCapacity - all have the same
mm[b][a].first =-1;
}
cin >> D >> K;
for(int i=0;i<N;i++){
for(int j=0;j<N;j++){
if(mm[i][j].first == -1){
mm[i][j].first = K; //flowCapacity - all have the same
}
}
}
// then do the max-flow alg -- using dijkstra's to find the shortest path
while(true){
// init first
for(int i=0;i<N;i++)
parent[i] = -2;
priority_queue<llll,vllll,greater<llll > > q; //cost-node : pair<long long, long long>
vll dist(N,MAX);
q.push(llll(0,0));
dist[0] = 0;
memset(cnt,0,sizeof cnt);
while(!q.empty()){
int cost = q.top().first;
int u = q.top().second;q.pop();
if(cost > dist[u]) //if we reached this node in a better way before, ignore this pass
continue;
if(u == N - 1) break; // avoid negative cycle. N-1 is sink
cnt[u]++;
if(cnt[u] > N) break;
dist[u] = cost;
for(int i=0;i<N;i++){
int nd = cost + mm[u][i].second; //costSoFar +edgeCost
if(nd < dist[i] && mm[u][i].first > 0){
// printf(" u,i = %d, %d, mm[u][i] = %d\n",u,i,mm[u][i].first);
parent[i] = u;
q.push(llll(nd,i));
}
}
}
if(parent[N-1] != -2){
// printf("parent[N-1] = %d\n",parent[N-1]);
augment();
}
else break;
if(D <= 0) break;
}
if(D > 0) cout << "Impossible." << endl;
else cout << minT << endl;
}
return 0;
}
| 27.171642
| 109
| 0.449327
|
fersarr
|
bf6ad18739722e9b812277069f15dba5087b0159
| 379
|
hpp
|
C++
|
worker/fuzzer/include/RTC/RTCP/FuzzerFeedbackPsVbcm.hpp
|
kcking/mediasoup
|
f385349d0f06fe14a4e38d50f0212b48d588fa32
|
[
"ISC"
] | 4,465
|
2017-04-05T20:00:24.000Z
|
2022-03-31T13:27:43.000Z
|
worker/fuzzer/include/RTC/RTCP/FuzzerFeedbackPsVbcm.hpp
|
kcking/mediasoup
|
f385349d0f06fe14a4e38d50f0212b48d588fa32
|
[
"ISC"
] | 617
|
2017-04-05T21:24:27.000Z
|
2022-03-31T06:17:25.000Z
|
worker/fuzzer/include/RTC/RTCP/FuzzerFeedbackPsVbcm.hpp
|
kcking/mediasoup
|
f385349d0f06fe14a4e38d50f0212b48d588fa32
|
[
"ISC"
] | 900
|
2017-04-11T09:25:27.000Z
|
2022-03-30T21:37:00.000Z
|
#ifndef MS_FUZZER_RTC_RTCP_FEEDBACK_PS_VBCM
#define MS_FUZZER_RTC_RTCP_FEEDBACK_PS_VBCM
#include "common.hpp"
#include "RTC/RTCP/FeedbackPsVbcm.hpp"
namespace Fuzzer
{
namespace RTC
{
namespace RTCP
{
namespace FeedbackPsVbcm
{
void Fuzz(::RTC::RTCP::FeedbackPsVbcmPacket* packet);
}
} // namespace RTCP
} // namespace RTC
} // namespace Fuzzer
#endif
| 17.227273
| 57
| 0.733509
|
kcking
|
bf7de81fa0b557e97b39233802a7992d585f4d92
| 888
|
cpp
|
C++
|
c++/trick/defer.cpp
|
dannypsnl/languages-learn
|
2351a235bd55e720394111237d41f65482eb89ec
|
[
"MIT"
] | 2
|
2018-01-04T00:47:25.000Z
|
2018-01-12T08:07:50.000Z
|
c++/trick/defer.cpp
|
dannypsnl/languages-learn
|
2351a235bd55e720394111237d41f65482eb89ec
|
[
"MIT"
] | 1
|
2018-01-08T14:45:55.000Z
|
2018-01-09T05:02:09.000Z
|
c++/trick/defer.cpp
|
dannypsnl/languages-learn
|
2351a235bd55e720394111237d41f65482eb89ec
|
[
"MIT"
] | null | null | null |
#include <functional>
#include <iostream>
#include <stack>
class deferer {
std::stack<std::function<void()>> defers;
void callAll() {
while (!this->defers.empty()) {
this->defers.top()();
this->defers.pop();
}
}
public:
deferer() {}
void add(std::function<void()> &&f) {
this->defers.push(std::forward<decltype(f)>(f));
}
~deferer() { callAll(); }
};
#define allow_defer() deferer __deferer{};
#define defer(...) \
auto defered = std::bind(__VA_ARGS__); \
__deferer.add(defered);
int main() {
allow_defer();
defer([=]() { std::cout << "defer!!!!!!!!!!" << '\n'; });
for (size_t i = 0; i < 10; ++i) {
defer(
[=]() { std::cout << "Number " << i + 1 << " defer be call" << '\n'; });
}
std::cout << "hello, defer" << '\n';
}
| 24
| 80
| 0.471847
|
dannypsnl
|
bf823130af8ed770bcf8e1e3f75db8d8285bdfe5
| 5,641
|
cpp
|
C++
|
common/ImageCoder.cpp
|
victorliu/vklBoards
|
253d94047993c7cf8952754fc26029245821e987
|
[
"MIT"
] | null | null | null |
common/ImageCoder.cpp
|
victorliu/vklBoards
|
253d94047993c7cf8952754fc26029245821e987
|
[
"MIT"
] | null | null | null |
common/ImageCoder.cpp
|
victorliu/vklBoards
|
253d94047993c7cf8952754fc26029245821e987
|
[
"MIT"
] | 1
|
2020-04-22T00:40:25.000Z
|
2020-04-22T00:40:25.000Z
|
#include "ImageCoder.h"
#include <cstring>
#include <cstdio>
#include "fastlz.h"
typedef int (*encoderproc)(
const unsigned char *rgb, unsigned stride, unsigned w, unsigned h,
std::vector<unsigned char> &buffer
);
typedef int (*decoderproc)(
const unsigned char *buffer, unsigned buflen,
unsigned char *rgb, unsigned stride, unsigned w, unsigned h
);
int raw_enc(
const unsigned char *rgb, unsigned stride, unsigned w, unsigned h,
std::vector<unsigned char> &buffer
);
int raw_dec(
const unsigned char *buffer, unsigned buflen,
unsigned char *rgb, unsigned stride, unsigned w, unsigned h
);
int rle_enc(
const unsigned char *rgb, unsigned stride, unsigned w, unsigned h,
std::vector<unsigned char> &buffer
);
int rle_dec(
const unsigned char *buffer, unsigned buflen,
unsigned char *rgb, unsigned stride, unsigned w, unsigned h
);
struct endecpair{
encoderproc encoder;
decoderproc decoder;
};
endecpair endec[2] = {
{ &raw_enc, &raw_dec },
{ &rle_enc, &rle_dec }
};
int ImageCoder::encode(int method,
const unsigned char *rgb, unsigned stride, unsigned w, unsigned h,
std::vector<unsigned char> &buffer
){
if(method < 0 || method > 1){ return -1; }
return endec[method].encoder(rgb, stride, w, h, buffer);
}
int ImageCoder::decode(int method,
const unsigned char *buffer, unsigned buflen,
unsigned char *rgb, unsigned stride, unsigned w, unsigned h
){
if(method < 0 || method > 1){ return -1; }
return endec[method].decoder(buffer, buflen, rgb, stride, w, h);
}
int raw_enc(
const unsigned char *rgb, unsigned stride, unsigned w, unsigned h,
std::vector<unsigned char> &buffer
){
size_t off = buffer.size();
buffer.resize(off + 3*w*h);
unsigned char *dst = &buffer[off];
const unsigned char *row = rgb;
for(unsigned j = 0; j < h; ++j){
memcpy(dst, row, 3*w);
row += 3*stride;
dst += 3*w;
}
return 0;
}
int raw_dec(
const unsigned char *buffer, unsigned buflen,
unsigned char *rgb, unsigned stride, unsigned w, unsigned h
){
if(3*w*h != buflen){ return -2; }
unsigned char *dst = rgb;
const unsigned char *row = &buffer[0];
for(unsigned j = 0; j < h; ++j){
memcpy(dst, row, 3*w);
dst += 3*stride;
row += 3*w;
}
return 0;
}
unsigned encode_byte_continuation(
unsigned int val,
std::vector<unsigned char> &buffer
){
unsigned count = 0;
while(val > 127){
buffer.push_back(0x80 | (val & 0x7F));
val >>= 7;
++count;
}
buffer.push_back(val);
++count;
return count;
}
unsigned int decode_byte_continuation(
const unsigned char *buffer, unsigned buflen
){
unsigned int val = 0;
unsigned int shift = 0;
while(buflen --> 0){
val |= (((*buffer) & 0x7F) << shift);
if(0 == (0x80 & (*buffer))){ break; }
++buffer;
shift += 7;
}
return val;
}
int rle_enc(
const unsigned char *rgb, unsigned stride, unsigned w, unsigned h,
std::vector<unsigned char> &buffer
){
size_t off = buffer.size();
/*
const unsigned char *row = rgb;
for(unsigned j = 0; j < h; ++j){
const unsigned char *ptr = row;
// Push first pixel
buffer.push_back(ptr[0]);
buffer.push_back(ptr[1]);
buffer.push_back(ptr[2]);
unsigned count = 1;
for(unsigned int i = 1; i < w; ++i){
if(
ptr[0] == buffer[off+0] &&
ptr[1] == buffer[off+1] &&
ptr[2] == buffer[off+2]
){ // run of length 2 or more
count++;
}else{ // run ended
if(count > 1){
off += encode_byte_continuation(count, buffer);
}
buffer.push_back(ptr[0]);
buffer.push_back(ptr[1]);
buffer.push_back(ptr[2]);
off += 3;
count = 1;
}
ptr += 3;
}
if(count > 1){
off += encode_byte_continuation(count, buffer);
}
// Determine row repeat and append it
unsigned rowrep = 1;
unsigned jnext = j+1;
const unsigned char *rownext = row+1;
while(jnext < h && 0 == memcmp(row, rownext, 3*w)){
jnext++;
rownext += 3*stride;
rowrep++;
}
off += encode_byte_continuation(rowrep, buffer);
row = rownext;
j = jnext-1; // subtract 1 to compensate for loop update
}
*/
size_t bufsize = 3*w*h + (3*w*h+19/20);
buffer.resize(off + bufsize);
int sz;
if(stride == w){
sz = fastlz_compress_level(2, rgb, 3*w*h, &buffer[off]);
}else{
std::vector<unsigned char> buf(3*w*h);
unsigned char *row = &buf[0];
for(unsigned j = 0; j < h; ++j){
memcpy(row, rgb, 3*w);
rgb += 3*stride;
row += 3*w;
}
sz = fastlz_compress_level(2, &buf[0], 3*w*h, &buffer[off]);
}
buffer.resize(off+sz);
return 0;
}
int rle_dec(
const unsigned char *buffer, unsigned buflen,
unsigned char *rgb, unsigned stride, unsigned w, unsigned h
){
int sz;
if(stride == w){
sz = fastlz_decompress(buffer, buflen, rgb, 3*w*h);
}else{
std::vector<unsigned char> buf(3*w*h);
sz = fastlz_decompress(buffer, buflen, &buf[0], 3*w*h);
unsigned char *row = &buf[0];
for(unsigned j = 0; j < h; ++j){
memcpy(rgb, row, 3*w);
rgb += 3*stride;
row += 3*w;
}
}
/*
size_t off = 0;
unsigned char *row = rgb;
for(unsigned j = 0; j < h; ++j){
unsigned char *ptr = row;
unsigned rowcount = 1;
ptr[0] = buffer[off+0];
ptr[1] = buffer[off+1];
ptr[2] = buffer[off+2];
...
while(rowcount < w){
unsigned count = buffer[off+3];
for(unsigned i = 0; i < count; ++i){
if(rowcount >= w){ break; } // error condition
ptr[0] = buffer[off+0];
ptr[1] = buffer[off+1];
ptr[2] = buffer[off+2];
ptr += 3;
++rowcount;
}
off += 4;
}
row += 3*stride;
}
*/
return 0;
}
| 24.2103
| 68
| 0.605744
|
victorliu
|
bf8d72ff9d55999e90a336cc096140cd230f9887
| 8,436
|
cpp
|
C++
|
logic/ShenGuan.cpp
|
chntujia/CodfiyAsteriatedGrailClient
|
5e148f2f31783fcf4ecb6b46d94245a8d2f9a8f6
|
[
"MIT"
] | 23
|
2016-01-14T01:44:18.000Z
|
2021-11-07T05:36:21.000Z
|
logic/ShenGuan.cpp
|
chntujia/CodfiyAsteriatedGrailClient
|
5e148f2f31783fcf4ecb6b46d94245a8d2f9a8f6
|
[
"MIT"
] | null | null | null |
logic/ShenGuan.cpp
|
chntujia/CodfiyAsteriatedGrailClient
|
5e148f2f31783fcf4ecb6b46d94245a8d2f9a8f6
|
[
"MIT"
] | 8
|
2016-01-11T06:28:06.000Z
|
2020-05-17T11:03:53.000Z
|
#include "ShenGuan.h"
enum CAUSE{
SHEN_SHENG_QI_SHI = 1501,
SHEN_SHENG_QI_FU = 1502,
SHUI_ZHI_SHEN_LI = 1503,
SHENG_SHI_SHOU_HU = 1504,
SHEN_SHENG_QI_YUE = 1505,
SHEN_SHENG_LING_YU = 1506,
SHUI_ZHI_SHEN_LI_GIVE = 1531,
SHUI_ZHI_SHEN_LI_CROSS = 1532,
SHEN_SHENG_QI_YUE_1 = 1551,
SHEN_SHENG_QI_YUE_2 = 1552,
SHEN_SHENG_LING_YU_1 = 1561,
SHEN_SHENG_LING_YU_2 = 1562
};
ShenGuan::ShenGuan()
{
makeConnection();
setMyRole(this);
Button *shenShengQiFu, *shuiZhiShenLi, *shenShengLingYu;
shenShengQiFu = new Button(3,QStringLiteral("神圣祈福"));
buttonArea->addButton(shenShengQiFu);
connect(shenShengQiFu,SIGNAL(buttonSelected(int)),this,SLOT(ShenShengQiFu()));
shuiZhiShenLi = new Button(4,QStringLiteral("水之神力"));
buttonArea->addButton(shuiZhiShenLi);
connect(shuiZhiShenLi,SIGNAL(buttonSelected(int)),this,SLOT(ShuiZhiShenLi1()));
shenShengLingYu = new Button(5,QStringLiteral("神圣领域"));
buttonArea->addButton(shenShengLingYu);
connect(shenShengLingYu,SIGNAL(buttonSelected(int)),this,SLOT(ShenShengLingYu1()));
}
void ShenGuan::normal()
{
Role::normal();
Player* myself=dataInterface->getMyself();
SafeList<Card*> handcards=dataInterface->getHandCards();
int qiFu = 0;
for(int i=0; i<handcards.size();i++)
{
if(handcards[i]->getType() == QStringLiteral("magic"))
qiFu++;
}
if(qiFu>1)
buttonArea->enable(3);
if(handArea->checkElement("water"))
buttonArea->enable(4);
if(myself->getEnergy()>0)
buttonArea->enable(5);
unactionalCheck();
}
void ShenGuan::ShenShengQiFu()
{
state = SHEN_SHENG_QI_FU;
handArea->reset();
playerArea->reset();
tipArea->reset();
handArea->setQuota(2);
decisionArea->enable(1);
decisionArea->disable(0);
handArea->enableMagic();
}
void ShenGuan::ShuiZhiShenLi1()
{
state = SHUI_ZHI_SHEN_LI;
handArea->reset();
playerArea->reset();
tipArea->reset();
playerArea->setQuota(1);
handArea->setQuota(1);
decisionArea->enable(1);
decisionArea->disable(0);
handArea->enableElement("water");
}
void ShenGuan::ShuiZhiShenLi2()
{
state = SHUI_ZHI_SHEN_LI_GIVE;
handArea->reset();
playerArea->reset();
tipArea->reset();
tipArea->setMsg(QStringLiteral("请给目标角色一张牌"));
handArea->setQuota(1);
decisionArea->enable(1);
decisionArea->disable(0);
handArea->enableAll();
}
void ShenGuan::ShenShengQiYue1()
{
state = SHEN_SHENG_QI_YUE_1;
gui->reset();
tipArea->setMsg(QStringLiteral("是否发动神圣契约"));
SafeList<Card*> handcards=dataInterface->getHandCards();
bool flag=true;
if(handcards.size()==1 && handcards.at(0)->getType()=="light" && dataInterface->getMyself()->getEnergy()==1)
flag=false;
if(flag)
decisionArea->enable(0);
decisionArea->enable(1);
}
void ShenGuan::ShenShengQiYue2()
{
state = SHEN_SHENG_QI_YUE_2;
Player* myself=dataInterface->getMyself();
handArea->reset();
playerArea->reset();
tipArea->reset();
int cross = myself->getCrossNum();
if (cross>4)
cross = 4;
for(;cross>0;cross--)
tipArea->addBoxItem(QString::number(cross));
tipArea->setMsg(QStringLiteral("请选择要转移的治疗数目"));
tipArea->showBox();
playerArea->setQuota(1);
playerArea->enableMate();
decisionArea->enable(1);
decisionArea->disable(0);
}
void ShenGuan::ShenShengLingYu1()
{
state = SHEN_SHENG_LING_YU_1;
handArea->reset();
playerArea->reset();
tipArea->reset();
decisionArea->enable(1);
decisionArea->enable(0);
tipArea->setMsg(QStringLiteral("请先选择一项:"));
if(dataInterface->getMyself()->getCrossNum()>0)
tipArea->addBoxItem(QStringLiteral("1.(移除1治疗)对目标角色造成2点法术伤害"));
tipArea->addBoxItem(QStringLiteral("2.增加2治疗,目标队友增加1治疗"));
tipArea->showBox();
}
void ShenGuan::ShenShengLingYu2()
{
state = SHEN_SHENG_LING_YU_2;
handArea->reset();
playerArea->reset();
tipArea->reset();
playerArea->setQuota(1);
SafeList<Card*> handcards=dataInterface->getHandCards();
if(handcards.size()>1)
handArea->setQuota(2);
else if(handcards.size()==1)
handArea->setQuota(1);
else
{
if(lingYu==1)
playerArea->enableAll();
else
playerArea->enableMate();
}
handArea->enableAll();
decisionArea->enable(1);
decisionArea->disable(0);
}
void ShenGuan::cardAnalyse()
{
Role::cardAnalyse();
switch (state)
{
case SHEN_SHENG_QI_FU:
decisionArea->enable(0);
break;
case SHUI_ZHI_SHEN_LI:
playerArea->enableMate();
break;
case SHUI_ZHI_SHEN_LI_GIVE:
decisionArea->enable(0);
break;
case SHEN_SHENG_LING_YU_2:
if(lingYu==1)
playerArea->enableAll();
else
playerArea->enableMate();
break;
}
}
void ShenGuan::onOkClicked()
{
Role::onOkClicked();
SafeList<Card*> selectedCards;
SafeList<Player*>selectedPlayers;
selectedCards=handArea->getSelectedCards();
selectedPlayers=playerArea->getSelectedPlayers();
network::Action* action;
network::Respond* respond;
try{
switch(state)
{
case SHEN_SHENG_QI_FU:
action = newAction(ACTION_MAGIC_SKILL, SHEN_SHENG_QI_FU);
foreach(Card*ptr,selectedCards){
action->add_card_ids(ptr->getID());
}
emit sendCommand(network::MSG_ACTION, action);
gui->reset();
break;
case SHUI_ZHI_SHEN_LI:
action = newAction(ACTION_MAGIC_SKILL, SHUI_ZHI_SHEN_LI);
action->add_card_ids(selectedCards[0]->getID());
action->add_dst_ids(selectedPlayers[0]->getID());
emit sendCommand(network::MSG_ACTION, action);
gui->reset();
break;
case SHUI_ZHI_SHEN_LI_GIVE:
respond = newRespond(SHUI_ZHI_SHEN_LI_GIVE);
respond->add_card_ids(selectedCards[0]->getID());
emit sendCommand(network::MSG_RESPOND, respond);
gui->reset();
break;
case SHEN_SHENG_QI_YUE_1:
ShenShengQiYue2();
break;
case SHEN_SHENG_QI_YUE_2:
respond = newRespond(SHEN_SHENG_QI_YUE);
respond->add_dst_ids(selectedPlayers[0]->getID());
respond->add_args(tipArea->getBoxCurrentText().toInt());
start = true;
emit sendCommand(network::MSG_RESPOND, respond);
gui->reset();
break;
case SHEN_SHENG_LING_YU_1:
if(tipArea->getBoxCurrentText()[0]=='1')
lingYu = 1;
else
lingYu = 2;
ShenShengLingYu2();
break;
case SHEN_SHENG_LING_YU_2:
action = newAction(ACTION_MAGIC_SKILL, SHEN_SHENG_LING_YU);
action->add_args(lingYu);
action->add_dst_ids(selectedPlayers[0]->getID());
foreach(Card*ptr,selectedCards){
action->add_card_ids(ptr->getID());
}
emit sendCommand(network::MSG_ACTION, action);
gui->reset();
break;
}
}catch(int error){
logic->onError(error);
}
}
void ShenGuan::onCancelClicked()
{
Role::onCancelClicked();
QString command;
network::Respond* respond;
switch(state)
{
case SHEN_SHENG_QI_FU:
case SHUI_ZHI_SHEN_LI:
case SHEN_SHENG_LING_YU_1:
case SHEN_SHENG_LING_YU_2:
normal();
break;
case SHEN_SHENG_QI_YUE_1:
respond = newRespond(SHEN_SHENG_QI_YUE);
respond->add_args(0);
emit sendCommand(network::MSG_RESPOND, respond);
gui->reset();
break;
case SHEN_SHENG_QI_YUE_2:
respond = newRespond(SHEN_SHENG_QI_YUE);
respond->add_args(0);
emit sendCommand(network::MSG_RESPOND, respond);
gui->reset();
break;
}
}
void ShenGuan::askForSkill(network::Command* cmd)
{
switch (cmd->respond_id())
{
case SHUI_ZHI_SHEN_LI_GIVE:
ShuiZhiShenLi2();
break;
case SHEN_SHENG_QI_YUE:
ShenShengQiYue1();
break;
default:
Role::askForSkill(cmd);
}
}
| 26.3625
| 113
| 0.61119
|
chntujia
|
bf8ef47648deb21ca90f6d4ad65b623d1f7c002e
| 8,952
|
cpp
|
C++
|
src/fsnorm.cpp
|
melmi/aban2
|
b17e318a82ef9003893ac818465807aecd8757fc
|
[
"MIT"
] | 1
|
2017-10-15T07:20:16.000Z
|
2017-10-15T07:20:16.000Z
|
src/fsnorm.cpp
|
melmi/aban2
|
b17e318a82ef9003893ac818465807aecd8757fc
|
[
"MIT"
] | null | null | null |
src/fsnorm.cpp
|
melmi/aban2
|
b17e318a82ef9003893ac818465807aecd8757fc
|
[
"MIT"
] | null | null | null |
#include "vof.h"
#include <cmath>
#include <memory>
#include "gradient.h"
#include "volreconst.h"
namespace aban2
{
fsnorm::fsnorm(aban2::domain_t *_d): d(_d)
{
}
fsnorm::~fsnorm()
{
}
fsnorm::neighbs_t fsnorm::get_nighb_vals(size_t i, size_t j, size_t k)
{
neighbs_t result;
size_t no;
for (int ii = 0; ii < 3; ++ii)
for (int jj = 0; jj < 3; ++jj)
#ifdef THREE_D
for (int kk = 0; kk < 3; ++kk)
if (d->exists_and_inside(i, j, k, ii - 1, jj - 1, kk - 1, no))
result[ii][jj][kk] = d->vof[no];
else
result[ii][jj][kk] = -1;
#else
if (d->is_inside(i, j, k, ii - 1, jj - 1, k, no))
result[ii][jj][0] = result[ii][jj][1] = result[ii][jj][2] = d->vof[no];
else
result[ii][jj][0] = result[ii][jj][1] = result[ii][jj][2] = -1;
#endif
return result;
}
double fsnorm::col_sum(double delta, double v1, double v2, double v3)
{
if (v1 < -0.5 || v2 < -0.5 || v3 < -0.5)return -1;
return delta * (v1 + v2 + v3);
}
double fsnorm::dir_sign(double v1, double v2, double v3)
{
if (v1 > -epsilon && v3 > -epsilon) return (v3 - v1) / (std::abs(v3 - v1) + epsilon);
if (v1 > -epsilon && v2 > -epsilon) return (v2 - v1) / (std::abs(v2 - v1) + epsilon);
if (v3 > -epsilon && v2 > -epsilon) return (v3 - v2) / (std::abs(v3 - v2) + epsilon);
return 0;
}
double fsnorm::get_column_grad(double p, double f, double b, double delta)
{
if (f < -0.5) return (p - b) / delta;
if (b < -0.5) return (f - p) / delta;
double gf = (f - p) / delta;
double gb = (p - b) / delta;
// return std::abs(gb) > std::abs(gf) ? gb : gf; // Zalski
// return 0.5 * (gf + bf); // CC
double yf = p + 1.5 * delta * gb;
double yb = p - 1.5 * delta * gf;
bool cf = 0 <= yf && yf <= 3 * delta;
bool cb = 0 <= yb && yb <= 3 * delta;
if (cf && !cb) return gf;
if (cb && !cf) return gb;
return 0.5 * (gf + gb);
}
bool fsnorm::create_column_candidate(vector &v, size_t dir, double sign, molecule_t molecule)
{
if (molecule.p < -0.5 || std::abs(sign) < 0.5 ||
(molecule.f1 < -0.5 && molecule.b1 < -0.5) ||
(molecule.f2 < -0.5 && molecule.b2 < -0.5)) return false;
size_t dir1 = (dir + 1) % 3, dir2 = (dir + 2) % 3;
v.cmpnt[dir] = sign;
v.cmpnt[dir1] = get_column_grad(molecule.p, molecule.f1, molecule.b1, d->delta);
v.cmpnt[dir2] = get_column_grad(molecule.p, molecule.f2, molecule.b2, d->delta);
return true;
}
void fsnorm::create_column_candidates(const neighbs_t &n, vector *candidates, bool *ok)
{
double center[3], dir1f[3], dir1b[3], dir2f[3], dir2b[3], sign[3];
sign[0] = dir_sign(n[0][1][1], n[1][1][1], n[2][1][1]);
sign[1] = dir_sign(n[1][0][1], n[1][1][1], n[1][2][1]);
sign[2] = dir_sign(n[1][1][0], n[1][1][1], n[1][1][2]);
center[0] = col_sum(d->delta, n[0][1][1], n[1][1][1], n[2][1][1]);
center[1] = col_sum(d->delta, n[1][0][1], n[1][1][1], n[1][2][1]);
center[2] = col_sum(d->delta, n[1][1][0], n[1][1][1], n[1][1][2]);
dir1f[0] = col_sum(d->delta, n[0][2][1], n[1][2][1], n[2][2][1]);
dir1f[1] = col_sum(d->delta, n[1][0][2], n[1][1][2], n[1][2][2]);
dir1f[2] = col_sum(d->delta, n[2][1][0], n[2][1][1], n[2][1][2]);
dir1b[0] = col_sum(d->delta, n[0][0][1], n[1][0][1], n[2][0][1]);
dir1b[1] = col_sum(d->delta, n[1][0][0], n[1][1][0], n[1][2][0]);
dir1b[2] = col_sum(d->delta, n[0][1][0], n[0][1][1], n[0][1][2]);
dir2f[0] = col_sum(d->delta, n[0][1][2], n[1][1][2], n[2][1][2]);
dir2f[1] = col_sum(d->delta, n[2][0][1], n[2][1][1], n[2][2][1]);
dir2f[2] = col_sum(d->delta, n[1][2][0], n[1][2][1], n[1][2][2]);
dir2b[0] = col_sum(d->delta, n[0][1][0], n[1][1][0], n[2][1][0]);
dir2b[1] = col_sum(d->delta, n[0][0][1], n[0][1][1], n[0][2][1]);
dir2b[2] = col_sum(d->delta, n[1][0][0], n[1][0][1], n[1][0][2]);
for (size_t i = 0; i < 3; ++i)
ok[i] = create_column_candidate(candidates[i], i, sign[i], {center[i], dir1f[i], dir1b[i], dir2f[i], dir2b[i]});
}
bool fsnorm::create_young_candidate(const neighbs_t &n, vector &candidate)
{
for (int ii = 0; ii < 3; ++ii)
for (int jj = 0; jj < 3; ++jj)
for (int kk = 0; kk < 3; ++kk)
if (n[ii][jj][kk] < -0.5)return false;
candidate.x = (
(1.0 * (n[2][0][0] + n[2][0][2] + n[2][2][0] + n[2][2][2]) +
2.0 * (n[2][1][0] + n[2][1][2] + n[2][0][1] + n[2][2][1]) +
4.0 * (n[2][1][1])) -
(1.0 * (n[0][0][0] + n[0][0][2] + n[0][2][0] + n[0][2][2]) +
2.0 * (n[0][1][0] + n[0][1][2] + n[0][0][1] + n[0][2][1]) +
4.0 * (n[0][1][1]))
) / 2. / d->delta;
candidate.y = (
(1.0 * (n[0][2][0] + n[0][2][2] + n[2][2][0] + n[2][2][2]) +
2.0 * (n[1][2][0] + n[1][2][2] + n[0][2][1] + n[2][2][1]) +
4.0 * (n[1][2][1])) -
(1.0 * (n[0][0][0] + n[0][0][2] + n[2][0][0] + n[2][0][2]) +
2.0 * (n[1][0][0] + n[1][0][2] + n[0][0][1] + n[2][0][1]) +
4.0 * (n[1][0][1]))
) / 2. / d->delta;
candidate.z = (
(1.0 * (n[0][0][2] + n[0][2][2] + n[2][0][2] + n[2][2][2]) +
2.0 * (n[1][0][2] + n[1][2][2] + n[0][1][2] + n[2][1][2]) +
4.0 * (n[1][1][2])) -
(1.0 * (n[0][0][0] + n[0][2][0] + n[2][0][0] + n[2][2][0]) +
2.0 * (n[1][0][0] + n[1][2][0] + n[0][1][0] + n[2][1][0]) +
4.0 * (n[1][1][0]))
) / 2. / d->delta;
return true;
}
void fsnorm::relax_center_val(int i, int j, int k, neighbs_t &n)
{
if (n[i][j][k] < -0.5)n[i][j][k] = n[1][1][1];
}
void fsnorm::relax_edge_val(int i, int j, int k, neighbs_t &n)
{
if (n[i][j][k] >= -0.5)return;
int i1 = i, i2 = i, j1 = j, j2 = j, k1 = k, k2 = k;
if (i == 1)
{
j1 = (j + 1) % 3;
k2 = (k + 1) % 3;
}
if (j == 1)
{
i1 = (i + 1) % 3;
k2 = (k + 1) % 3;
}
if (k == 1)
{
i1 = (i + 1) % 3;
j2 = (j + 1) % 3;
}
n[i][j][k] = 0.5 * (n[i1][j1][k1] + n[i2][j2][k2]);
}
void fsnorm::relax_corner_val(int i, int j, int k, neighbs_t &n)
{
if (n[i][j][k] >= -0.5)return;
int ii = (i + 1) % 3;
int jj = (j + 1) % 3;
int kk = (k + 1) % 3;
n[i][j][k] = (n[ii][j][k] + n[i][jj][k] + n[i][j][kk]) / 3.0;
}
void fsnorm::relax_neighb_vals(neighbs_t &n)
{
relax_center_val(0, 1, 1, n);
relax_center_val(2, 1, 1, n);
relax_center_val(1, 0, 1, n);
relax_center_val(1, 2, 1, n);
relax_center_val(1, 1, 0, n);
relax_center_val(1, 1, 2, n);
relax_edge_val(1, 0, 0, n);
relax_edge_val(1, 0, 2, n);
relax_edge_val(1, 2, 0, n);
relax_edge_val(1, 2, 2, n);
relax_edge_val(0, 1, 0, n);
relax_edge_val(0, 1, 2, n);
relax_edge_val(2, 1, 0, n);
relax_edge_val(2, 1, 2, n);
relax_edge_val(0, 0, 1, n);
relax_edge_val(0, 2, 1, n);
relax_edge_val(2, 0, 1, n);
relax_edge_val(2, 2, 1, n);
relax_corner_val(0, 0, 0, n);
relax_corner_val(0, 0, 2, n);
relax_corner_val(0, 2, 0, n);
relax_corner_val(0, 2, 2, n);
relax_corner_val(2, 0, 0, n);
relax_corner_val(2, 0, 2, n);
relax_corner_val(2, 2, 0, n);
relax_corner_val(2, 2, 2, n);
}
inline vector taxicab_normalized(const vector &v)
{
double size = std::abs(v.x) + std::abs(v.y) + std::abs(v.z);
return v * (1.0 / size);
}
vector fsnorm::get_normal(size_t i, size_t j, size_t k, size_t no)
{
vector y; // young's normal vector
// bool y_ok; // young's normal ok
vector c[3]; // column normal vector
bool c_ok[3];
vector *final;
auto neighb_vals = get_nighb_vals(i, j, k);
create_column_candidates(neighb_vals, c, c_ok);
// y_ok = create_young_candidate(neighb_vals, y);
if (c_ok[0] || c_ok[1] || c_ok[2])
{
double m0[] {0, 0, 0};
int selected_dir = -1;
for (size_t i = 0; i < 3; ++i)
if (c_ok[i])
{
m0[i] = std::abs(taxicab_normalized(c[i]).cmpnt[i]);
if (selected_dir == -1 || m0[i] > m0[selected_dir])selected_dir = i;
}
// if (y_ok)
// if (std::abs(taxicab_normalized(y).cmpnt[selected_dir]) < m0[selected_dir])
// final = &y;
// else
// final = c + selected_dir;
// else
final = c + selected_dir;
}
// else if (y_ok) // Young helper
// final = &y;
else
{
relax_neighb_vals(neighb_vals);
create_young_candidate(neighb_vals, y);
final = &y;
}
final->normalize();
return *final;
}
}
| 31.191638
| 120
| 0.457887
|
melmi
|
bf906dbb10eab49b7ab0ae63c332a1601f86f4f6
| 2,192
|
cpp
|
C++
|
breadth-first-search/542-01-matrix.cpp
|
gromitsun/algorithm
|
5aea12139c1b98221650063b91c0d38b965047e5
|
[
"MIT"
] | null | null | null |
breadth-first-search/542-01-matrix.cpp
|
gromitsun/algorithm
|
5aea12139c1b98221650063b91c0d38b965047e5
|
[
"MIT"
] | null | null | null |
breadth-first-search/542-01-matrix.cpp
|
gromitsun/algorithm
|
5aea12139c1b98221650063b91c0d38b965047e5
|
[
"MIT"
] | null | null | null |
ass Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& matrix) {
if (matrix.empty())
return matrix;
if (matrix[0].empty())
return matrix;
// queue for BFS
queue<int> rows;
queue<int> cols;
// sizes
int n = matrix.size();
int m = matrix[0].size();
// initialize queue with indices of 0's
for (int i=0; i<matrix.size(); i++)
{
for (int j=0; j<matrix[i].size(); j++)
{
if (matrix[i][j] == 0)
{
rows.push(i);
cols.push(j);
}
else
{
matrix[i][j] = -1;
}
}
}
// BFS
while (!rows.empty())
{
int i = rows.front();
int j = cols.front();
rows.pop();
cols.pop();
// check elements on nsew
if (i > 0)
{
if (matrix[i-1][j] < 0)
{
matrix[i-1][j] = matrix[i][j] + 1;
rows.push(i-1);
cols.push(j);
}
}
if (j > 0)
{
if (matrix[i][j-1] < 0)
{
matrix[i][j-1] = matrix[i][j] + 1;
rows.push(i);
cols.push(j-1);
}
}
if (i < n - 1)
{
if (matrix[i+1][j] < 0)
{
matrix[i+1][j] = matrix[i][j] + 1;
rows.push(i+1);
cols.push(j);
}
}
if (j < m - 1)
{
if (matrix[i][j+1] < 0)
{
matrix[i][j+1] = matrix[i][j] + 1;
rows.push(i);
cols.push(j+1);
}
}
}
return matrix;
}
};
| 23.826087
| 67
| 0.273723
|
gromitsun
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.